harperdb 4.6.2 → 4.6.4
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.
- package/README.md +1 -1
- package/bin/harperdb.js +75 -75
- package/bin/lite.js +74 -74
- package/launchServiceScripts/launchNatsIngestService.js +73 -73
- package/launchServiceScripts/launchNatsReplyService.js +73 -73
- package/launchServiceScripts/launchUpdateNodes4-0-0.js +74 -74
- package/npm-shrinkwrap.json +77 -77
- package/package.json +2 -2
- package/resources/ResourceInterface.d.ts +1 -0
- package/resources/Table.d.ts +40 -41
- package/resources/analytics/hostnames.d.ts +39 -39
- package/resources/blob.d.ts +4 -4
- package/resources/databases.d.ts +39 -39
- package/server/Server.d.ts +5 -1
- package/server/jobs/jobProcess.js +73 -73
- package/server/threads/threadServer.js +73 -73
- package/studio/build-local/asset-manifest.json +41 -41
- package/studio/build-local/index.html +1 -1
- package/studio/build-local/static/css/main.a46e2bd8.css +13 -0
- package/studio/build-local/static/js/11.17b2806b.chunk.js +2 -0
- package/studio/build-local/static/js/164.794c66a1.chunk.js +1 -0
- package/studio/build-local/static/js/23.55c690ce.chunk.js +1 -0
- package/studio/build-local/static/js/239.5d22fd48.chunk.js +2 -0
- package/studio/build-local/static/js/240.2c705279.chunk.js +2 -0
- package/studio/build-local/static/js/240.2c705279.chunk.js.LICENSE.txt +16 -0
- package/studio/build-local/static/js/279.bbdf2928.chunk.js +1 -0
- package/studio/build-local/static/js/724.daf66453.chunk.js +1 -0
- package/studio/build-local/static/js/833.8c4a4a90.chunk.js +1 -0
- package/studio/build-local/static/js/browse-csvupload.088afad6.chunk.js +1 -0
- package/studio/build-local/static/js/browse-datatable.9e5f57a4.chunk.js +1 -0
- package/studio/build-local/static/js/browse-entitymanager.b1467efe.chunk.js +1 -0
- package/studio/build-local/static/js/browse-jsonviewer.c5715070.chunk.js +1 -0
- package/studio/build-local/static/js/custom-functions.a20f8853.chunk.js +1 -0
- package/studio/build-local/static/js/instance-cluster.d9f5d94b.chunk.js +1 -0
- package/studio/build-local/static/js/instance-config.cc1f0e92.chunk.js +1 -0
- package/studio/build-local/static/js/instance-logs.9d60d6ad.chunk.js +1 -0
- package/studio/build-local/static/js/instance-roles.cf38a24f.chunk.js +1 -0
- package/studio/build-local/static/js/instance-status.3c776235.chunk.js +1 -0
- package/studio/build-local/static/js/instance-users-datatable.2fa06057.chunk.js +1 -0
- package/studio/build-local/static/js/instance-users-edit.d26ea514.chunk.js +1 -0
- package/studio/build-local/static/js/instance-users.f11ec173.chunk.js +1 -0
- package/studio/build-local/static/js/instance.99cd7bf2.chunk.js +1 -0
- package/studio/build-local/static/js/instances.289c385e.chunk.js +1 -0
- package/studio/build-local/static/js/{main.447848b8.js → main.ba5ab027.js} +2 -2
- package/studio/build-local/static/js/offline-app.54fd7408.chunk.js +1 -0
- package/studio/build-local/static/js/online-app.060fd872.chunk.js +1 -0
- package/studio/build-local/static/js/organization-billing.e0e08f86.chunk.js +1 -0
- package/studio/build-local/static/js/organization-users.5755c9f0.chunk.js +1 -0
- package/studio/build-local/static/js/organization.6db4c138.chunk.js +1 -0
- package/studio/build-local/static/js/organizations.cf417207.chunk.js +1 -0
- package/studio/build-local/static/js/profile.3502eb02.chunk.js +1 -0
- package/studio/build-local/static/js/resetPassword.bdccbba4.chunk.js +1 -0
- package/studio/build-local/static/js/roles-jsonviewer.2488b213.chunk.js +1 -0
- package/studio/build-local/static/js/signIn.44a8eea8.chunk.js +1 -0
- package/studio/build-local/static/js/signUp.84b57b20.chunk.js +1 -0
- package/studio/build-local/static/js/structure-reloader.99217942.chunk.js +1 -0
- package/studio/build-local/static/js/topnav.dc554a18.chunk.js +1 -0
- package/studio/build-local/static/js/updatePassword.56bfd9f7.chunk.js +1 -0
- package/utility/hdbTerms.d.ts +1 -1
- package/utility/scripts/restartHdb.js +73 -73
- package/studio/build-local/static/css/main.34b26890.css +0 -13
- package/studio/build-local/static/js/164.a89f3fc2.chunk.js +0 -1
- package/studio/build-local/static/js/23.3b9f7144.chunk.js +0 -1
- package/studio/build-local/static/js/239.183c6cbc.chunk.js +0 -2
- package/studio/build-local/static/js/279.7dfac9c5.chunk.js +0 -1
- package/studio/build-local/static/js/545.046f5738.chunk.js +0 -1
- package/studio/build-local/static/js/759.7c5150cd.chunk.js +0 -2
- package/studio/build-local/static/js/833.fbb1857f.chunk.js +0 -1
- package/studio/build-local/static/js/845.79392583.chunk.js +0 -2
- package/studio/build-local/static/js/845.79392583.chunk.js.LICENSE.txt +0 -5
- package/studio/build-local/static/js/browse-csvupload.2a02693a.chunk.js +0 -1
- package/studio/build-local/static/js/browse-datatable.6944e1d5.chunk.js +0 -1
- package/studio/build-local/static/js/browse-entitymanager.78d9f3cf.chunk.js +0 -1
- package/studio/build-local/static/js/browse-jsonviewer.b9b13d1d.chunk.js +0 -1
- package/studio/build-local/static/js/custom-functions.5e20728d.chunk.js +0 -1
- package/studio/build-local/static/js/instance-cluster.7fa04087.chunk.js +0 -1
- package/studio/build-local/static/js/instance-config.cab20f8e.chunk.js +0 -1
- package/studio/build-local/static/js/instance-logs.c590cea3.chunk.js +0 -1
- package/studio/build-local/static/js/instance-roles.02c01413.chunk.js +0 -1
- package/studio/build-local/static/js/instance-status.872064e6.chunk.js +0 -1
- package/studio/build-local/static/js/instance-users-datatable.eaa7f9f0.chunk.js +0 -1
- package/studio/build-local/static/js/instance-users-edit.b3009a22.chunk.js +0 -1
- package/studio/build-local/static/js/instance-users.d4c9a21b.chunk.js +0 -1
- package/studio/build-local/static/js/instance.ac2d8e63.chunk.js +0 -1
- package/studio/build-local/static/js/instances.e177eb54.chunk.js +0 -1
- package/studio/build-local/static/js/offline-app.e75335f8.chunk.js +0 -1
- package/studio/build-local/static/js/online-app.161383cc.chunk.js +0 -1
- package/studio/build-local/static/js/organization-billing.8a6543c9.chunk.js +0 -1
- package/studio/build-local/static/js/organization-users.28a7fddd.chunk.js +0 -1
- package/studio/build-local/static/js/organization.7e6de94f.chunk.js +0 -1
- package/studio/build-local/static/js/organizations.a35fef39.chunk.js +0 -1
- package/studio/build-local/static/js/profile.ec638faf.chunk.js +0 -1
- package/studio/build-local/static/js/resetPassword.c64684e3.chunk.js +0 -1
- package/studio/build-local/static/js/roles-jsonviewer.28347efe.chunk.js +0 -1
- package/studio/build-local/static/js/signIn.95abea6a.chunk.js +0 -1
- package/studio/build-local/static/js/signUp.a095114b.chunk.js +0 -1
- package/studio/build-local/static/js/structure-reloader.89712250.chunk.js +0 -1
- package/studio/build-local/static/js/topnav.6ac108a6.chunk.js +0 -1
- package/studio/build-local/static/js/updatePassword.839328e6.chunk.js +0 -1
- /package/studio/build-local/static/js/{759.7c5150cd.chunk.js.LICENSE.txt → 11.17b2806b.chunk.js.LICENSE.txt} +0 -0
- /package/studio/build-local/static/js/{239.183c6cbc.chunk.js.LICENSE.txt → 239.5d22fd48.chunk.js.LICENSE.txt} +0 -0
- /package/studio/build-local/static/js/{main.447848b8.js.LICENSE.txt → main.ba5ab027.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[214],{9167:(e,s,n)=>{n.r(s),n.d(s,{default:()=>k});var i=n(9950),l=n(5077),t=n(7348),d=n(8040),a=n(9435),c=n(5283),r=n(5996),o=n(4979),h=n(3150),u=n(884),j=n(7372),p=n(5971),x=n(4319),v=n(4414);const m=(0,i.lazy)((()=>n.e(83).then(n.bind(n,5928)))),A=(0,i.lazy)((()=>Promise.all([n.e(11),n.e(358)]).then(n.bind(n,7408)))),f=(0,i.lazy)((()=>n.e(881).then(n.bind(n,6304))));const b=function(){var e,s;const n=(0,l.Zp)(),t=(0,l.zy)(),[d,b]=(0,i.useState)(!0),[k,g]=(0,c.A)({}),[_]=(0,x.A)({});return(0,i.useEffect)((()=>{(0,p.A)(null===k||void 0===k?void 0:k.theme)}),[null===k||void 0===k?void 0:k.theme]),(0,i.useEffect)((()=>{(0,j.A)({currentPath:t.pathname,navigate:n,persistedUser:k,setPersistedUser:g,setFetchingUser:b,instanceAuths:_,controller:undefined})}),[]),(0,v.jsxs)("div",{id:"local-studio",className:"".concat(k.theme),children:[(0,v.jsxs)("div",{className:"vh-100",children:[(0,v.jsx)(i.Suspense,{fallback:(0,v.jsx)(o.A,{header:" ",spinner:!0}),children:(0,v.jsx)(m,{loggedIn:null===_||void 0===_||null===(e=_.local)||void 0===e?void 0:e.valid})}),d?(0,v.jsx)(o.A,{header:"Signing in",spinner:!0}):null!==_&&void 0!==_&&null!==(s=_.local)&&void 0!==s&&s.valid?(0,v.jsx)("div",{id:"app-container",children:(0,v.jsx)(a.tH,{FallbackComponent:h.A,children:(0,v.jsx)(i.Suspense,{fallback:(0,v.jsx)(o.A,{header:" ",spinner:!0}),children:(0,v.jsxs)(l.BV,{children:[(0,v.jsx)(l.qh,{element:(0,v.jsx)(A,{}),path:"/o/:customer_id/i/:compute_stack_id/*"}),(0,v.jsx)(l.qh,{element:(0,v.jsx)(l.C5,{to:"/",replace:!0})})]})})})}):(0,v.jsx)("div",{className:"d-flex justify-content-center align-items-center h-100",children:(0,v.jsx)(a.tH,{FallbackComponent:u.A,children:(0,v.jsx)(i.Suspense,{fallback:(0,v.jsx)(o.A,{header:" ",spinner:!0}),children:(0,v.jsx)(l.BV,{children:(0,v.jsx)(l.qh,{element:(0,v.jsx)(f,{}),path:"/"})})})})})]}),(0,v.jsx)("div",{id:"app-bg-color"}),(0,v.jsxs)("div",{className:"version",children:["Harper Local Studio v",r.A.studio_version]})]})};const k=function(){return(0,v.jsx)(t.Kq,{template:d.A,timeout:4e3,position:t.Xq.TOP_CENTER,children:(0,v.jsx)(l.Kd,{children:(0,v.jsx)(b,{})})})}},4319:(e,s,n)=>{n.d(s,{A:()=>i});const i=(0,n(6997).A)("instanceAuths")}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[924],{7338:(e,s,n)=>{n.r(s),n.d(s,{default:()=>W});var t=n(9950),a=n(5077),i=n(5604),r=n(7348),l=n(7202),c=n(5996);const o=(0,l.c)(c.A.stripe_public_key);var d=n(8040),h=n(7732),m=n(6713),p=n(135),u=n(9435),x=n(4283),j=n(5553),f=n(5283),A=n(4979),b=n(4414);const v=function(){return(0,b.jsx)(A.A,{header:"Harper Studio Is Being Updated",body:"Please check back in a few minutes and get ready for a whole new batch of awesome!"})};var g=n(3150),y=n(884),N=n(2763),_=n(7806),w=n(1129),k=n(2676);var q=n(7372),I=n(1659),E=n(5971),z=n(8342),O=n(9335),S=n(7176),C=n(6114);const P=function(){return(0,b.jsx)(O.A,{fluid:"xs",className:"h-100",children:(0,b.jsxs)(S.A,{xs:"1",sm:"2",className:"h-100",children:[(0,b.jsx)(C.A,{className:"p-5 auth-studio-info d-none d-sm-flex justify-content-center align-items-center",children:(0,b.jsxs)("div",{className:"auth-studio-info-container",children:[(0,b.jsx)("h1",{className:"auth-title",children:"Harper Studio"}),(0,b.jsx)("span",{className:"mb-4 auth-subtitle d-inline-block",children:"Manage all your Harper instances."}),(0,b.jsxs)("ul",{className:"auth-info-list-items",children:[(0,b.jsxs)("li",{children:[(0,b.jsx)("h3",{className:"item-title",children:"Manage All Instances"}),(0,b.jsx)("span",{className:"item-subtitle",children:"Set access, cluster, monitor, and more."})]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("h3",{className:"item-title",children:"Embedded API Server"}),(0,b.jsx)("span",{className:"item-subtitle",children:"Harper components give you unlimited application flexibility."})]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("h3",{className:"item-title",children:"Fully Managed Cloud & 5G Instances"}),(0,b.jsx)("span",{className:"item-subtitle",children:"Go from zero to code in minutes."})]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("h3",{className:"item-title",children:"Deploy Anywhere"}),(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("a",{href:"https://hub.docker.com/r/harperdb/harperdb",target:"_blank",rel:"noreferrer",className:"deploy-subitem",children:"Docker"}),(0,b.jsx)("a",{href:"https://www.npmjs.com/package/harperdb",target:"_blank",rel:"noreferrer",className:"deploy-subitem",children:"npm"}),(0,b.jsx)("a",{href:"https://docs.harperdb.io/docs/deployments/install-harperdb",target:"_blank",rel:"noreferrer",className:"deploy-subitem",children:"all options"})]})]})]})]})}),(0,b.jsx)(C.A,{className:"p-5 d-flex justify-content-center align-items-center auth-form-container",children:(0,b.jsx)(a.sv,{})})]})})},M=(0,t.lazy)((()=>n.e(83).then(n.bind(n,5928)))),H=(0,t.lazy)((()=>n.e(195).then(n.bind(n,6269)))),T=(0,t.lazy)((()=>n.e(881).then(n.bind(n,5559)))),$=(0,t.lazy)((()=>n.e(75).then(n.bind(n,3550)))),R=(0,t.lazy)((()=>n.e(607).then(n.bind(n,2553)))),F=(0,t.lazy)((()=>Promise.all([n.e(11),n.e(478)]).then(n.bind(n,52)))),U=(0,t.lazy)((()=>Promise.all([n.e(851),n.e(678)]).then(n.bind(n,5203)))),B=(0,t.lazy)((()=>Promise.all([n.e(851),n.e(279),n.e(860),n.e(913)]).then(n.bind(n,7270)))),D=(0,t.lazy)((()=>Promise.all([n.e(11),n.e(358)]).then(n.bind(n,7408)))),V=(0,t.lazy)((()=>Promise.all([n.e(11),n.e(138)]).then(n.bind(n,4244)))),G={timeout:0,position:r.Xq.BOTTOM_CENTER};let K;function X(e){const{customer_id:s}=(0,a.g)();return e.auth.orgs.some((e=>e.customer_id===s))?(0,b.jsx)(a.sv,{}):(0,b.jsx)(a.C5,{to:"/organization",replace:!0})}const L=function(){const e=document.querySelector('link[rel="canonical"]'),s=(0,a.Zp)(),n=(0,r.MW)(),i=(0,a.zy)(),{search:l,pathname:o}=i,{redirect:d}=x.A.parse(l),O=(0,m.O$)(j.A,(e=>e.auth)),S=(0,m.O$)(j.A,(e=>e.theme)),C=(0,m.O$)(j.A,(e=>e.products)),L=(0,m.O$)(j.A,(e=>e.regions)),W=(0,m.O$)(j.A,(e=>e.wavelengthRegions)),Z=(0,m.O$)(j.A,(e=>e.akamaiRegions)),J=(0,m.O$)(j.A,(e=>e.version)),[Q,Y]=(0,t.useState)(!0),[ee,se]=(0,t.useState)(!1),[ne,te]=(0,f.A)({}),ae=null===O||void 0===O?void 0:O.user_id,ie=ae&&-1===(null===O||void 0===O?void 0:O.email.indexOf("harperdb.io"))&&-1===(null===O||void 0===O?void 0:O.email.indexOf("deliciousmonster.com")),re=(null===J||void 0===J?void 0:J.maintenance)&&ie;return h.Ay.initialize(c.A.google_analytics_code),(0,t.useEffect)((()=>{h.Ay.send({hitType:"pageview",page:window.location.pathname+window.location.search})}),[i.pathname]),(0,t.useEffect)((()=>{(0,E.A)(null===ne||void 0===ne?void 0:ne.theme)}),[null===ne||void 0===ne?void 0:ne.theme]),(0,t.useEffect)((()=>{se((e=>{let{apiVersion:s}=e;if(s){let e=!1;try{const n=c.A.studio_version.split("."),t=s.split("."),a=parseInt(n[0],10)<parseInt(t[0],10),i=parseInt(n[0],10)===parseInt(t[0],10)&&parseInt(n[1],10)<parseInt(t[1],10),r=parseInt(n[0],10)===parseInt(t[0],10)&&parseInt(n[1],10)===parseInt(t[1],10)&&parseInt(n[2],10)<parseInt(t[2],10);(a||i||r)&&(e=s)}catch(n){return!1}return e}return!1})({apiVersion:J.studio}))}),[J.studio]),(0,t.useEffect)((()=>{null!==O&&void 0!==O&&O.email&&(window._kmq&&window._kmq.push(["identify",O.email]),null!==O&&void 0!==O&&O.update_password&&s("/update-password"),d&&s(d))}),[null===O||void 0===O?void 0:O.email]),(0,t.useEffect)((()=>{ee&&n.info("Harper Studio v".concat(ee," is now available. Refresh to update."),G)}),[ee]),(0,t.useEffect)((()=>{e.href=window.location.href}),[i,e]),(0,t.useEffect)((()=>{(0,q.A)({currentPath:i.pathname,navigate:s,persistedUser:ne,setPersistedUser:te,setFetchingUser:Y,controller:K})}),[]),(0,p.A)((()=>{C||(0,N.A)(),L||(0,_.A)(),W||(0,w.A)(),Z||(0,z.A)()}),c.A.refresh_content_interval),(0,p.A)((()=>{(0,k.A)(),(0,I.A)({auth:O,controller:K})}),c.A.check_version_interval),(0,b.jsxs)("div",{className:"".concat(S," ").concat(c.A.maintenance?"maintenance":""),children:[(0,b.jsx)(t.Suspense,{fallback:(0,b.jsx)(A.A,{header:" ",spinner:!0}),children:(0,b.jsx)(M,{isMaintenance:re,loggedIn:ae})}),Q?(0,b.jsx)("div",{className:"vh-100",children:(0,b.jsx)(A.A,{header:"Signing in...",spinner:!0})}):(0,b.jsx)("main",{id:ae?"app-container":"",className:ae?"":"auth-container",children:(0,b.jsx)(u.tH,{FallbackComponent:ae?g.A:y.A,children:(0,b.jsx)(t.Suspense,{fallback:(0,b.jsx)(A.A,{header:"Loading...",spinner:!0}),children:(0,b.jsx)(a.BV,{children:ae?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a.qh,{element:re?(0,b.jsx)(v,{}):(0,b.jsx)(R,{}),path:"/update-password"}),(0,b.jsx)(a.qh,{element:re?(0,b.jsx)(v,{}):(0,b.jsx)(V,{}),path:"/profile/*"}),(0,b.jsxs)(a.qh,{element:re?(0,b.jsx)(v,{}):(0,b.jsx)(X,{auth:O}),children:[(0,b.jsx)(a.qh,{element:(0,b.jsx)(D,{}),path:"/o/:customer_id/i/:compute_stack_id/*"}),(0,b.jsx)(a.qh,{element:(0,b.jsx)(B,{}),path:"/o/:customer_id/instances/:action?/:purchaseStep?"}),(0,b.jsx)(a.qh,{element:(0,b.jsx)(F,{}),path:"/o/:customer_id/*"})]}),(0,b.jsx)(a.qh,{element:re?(0,b.jsx)(v,{}):(0,b.jsx)(U,{}),path:"/:list?/:action?"}),(0,b.jsx)(a.qh,{element:(0,b.jsx)(a.C5,{to:"/",replace:!0})})]}):(0,b.jsxs)(a.qh,{element:(0,b.jsx)(P,{}),children:[(0,b.jsx)(a.qh,{element:(0,b.jsx)(T,{}),path:"/"}),(0,b.jsx)(a.qh,{element:c.A.maintenance?(0,b.jsx)(v,{}):(0,b.jsx)(H,{}),path:"/sign-up"}),(0,b.jsx)(a.qh,{element:re?(0,b.jsx)(v,{}):(0,b.jsx)($,{}),path:"/reset-password"}),(0,b.jsx)(a.qh,{path:"*",element:(0,b.jsx)(a.C5,{to:"/?redirect=".concat(o).concat(l),replace:!0})})]})})})})}),(0,b.jsx)("div",{id:"app-bg-color"}),(0,b.jsxs)("div",{className:"version",children:["Harper Studio v",c.A.studio_version,J.maintenance&&" - MAINTENANCE MODE"]})]})};const W=function(){return(0,b.jsx)(i.Elements,{stripe:o,children:(0,b.jsx)(r.Kq,{template:d.A,timeout:4e3,position:r.Xq.TOP_CENTER,children:(0,b.jsx)(a.Kd,{children:(0,b.jsx)(L,{})})})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[588],{1192:(e,t,s)=>{s.r(t),s.d(t,{default:()=>H});var r=s(9950),n=s(7176),a=s(6114),o=s(5077),c=s(6713),i=s(9163),d=s.n(i),l=s(5553),u=s(4084),m=s(8156),p=s(3452),x=s(9435),h=s(2714);var A=s(8188),v=s(5887),j=s(9519),f=s(3150),_=s(3628),g=s(4414);const b=function(e){var t,s,i,b,y,N,C,w,k,S,O,P,E,T,R;let{setEditingCard:$,customerCard:z,formStateHeight:F,badCard:H}=e;const{customer_id:I}=(0,o.g)(),q=(0,c.O$)(l.A,(e=>e.auth)),M=(0,c.O$)(l.A,(e=>e.instances)),D=(0,c.O$)(l.A,(e=>{var t;return null===(t=e.customer)||void 0===t?void 0:t.stripe_id})),[B,L]=(0,r.useState)({});return d()((async()=>{const{submitted:e}=B;if(e){if(M.find((e=>e.totalPrice)))L({error:"You have active, non-free instances."}),setTimeout((()=>L({})),2e3);else{L({processing:!0});const e=await(async e=>{let{auth:t,payment_method_id:s,stripe_id:r,customer_id:n}=e;return(0,h.A)({endpoint:"removePaymentMethod",method:"POST",payload:{payment_method_id:s,stripe_id:r,customer_id:n},auth:t})})({auth:q,stripe_id:D,payment_method_id:z.id,customer_id:I});e.error?(L({error:e.message}),setTimeout((()=>L({})),2e3)):(L({success:!0}),await(0,j.A)({auth:q,customer_id:I}),L({}),setTimeout((()=>$(!1)),0))}}}),[B]),(0,g.jsx)(x.tH,{onError:(e,t)=>(0,_.A)({error:{message:e.message,componentStack:t},customer_id:I}),FallbackComponent:f.A,children:B.processing?(0,g.jsx)(A.A,{height:F,status:"processing",header:"Removing Card From Account",subhead:"The Credit Schnauzer is securely contacting Stripe."}):B.success?(0,g.jsx)(A.A,{height:F,status:"success",header:"Card Removed Successfully",subhead:"Your account is now limited to free products."}):B.error?(0,g.jsx)(A.A,{height:F,status:"error",header:B.error,subhead:"You must remove them to remove your card."}):(0,g.jsx)(u.A,{children:(0,g.jsxs)(m.A,{children:[H&&(0,g.jsx)(v.A,{}),(0,g.jsxs)(n.A,{children:[(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"card number"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsxs)("div",{className:"input-static",children:["**** **** ****",null===z||void 0===z||null===(t=z.card)||void 0===t?void 0:t.last4]})}),(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)("hr",{className:"my-2"})}),(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"expiration"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsx)("div",{className:"input-static",children:"".concat(null===z||void 0===z||null===(s=z.card)||void 0===s?void 0:s.exp_month," / ").concat(null===z||void 0===z||null===(i=z.card)||void 0===i?void 0:i.exp_year)})}),(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)("hr",{className:"my-2"})}),(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"cvcc"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsx)("div",{className:"input-static",children:"***"})}),(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)("hr",{className:"my-2"})}),(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"country"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsx)("div",{className:"input-static",children:null===z||void 0===z||null===(b=z.billing_details)||void 0===b||null===(y=b.address)||void 0===y?void 0:y.country})}),(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)("hr",{className:"my-2"})}),(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"state/province"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsx)("div",{className:"input-static",children:null===z||void 0===z||null===(N=z.billing_details)||void 0===N||null===(C=N.address)||void 0===C?void 0:C.state})}),(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)("hr",{className:"my-2"})}),(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"address"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsx)("div",{className:"input-static",children:null===z||void 0===z||null===(w=z.billing_details)||void 0===w||null===(k=w.address)||void 0===k?void 0:k.line1})}),(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)("hr",{className:"my-2"})}),(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"apt/unit"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsx)("div",{className:"input-static",children:null===z||void 0===z||null===(S=z.billing_details)||void 0===S||null===(O=S.address)||void 0===O?void 0:O.line2})}),(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)("hr",{className:"my-2"})}),(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"city"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsx)("div",{className:"input-static",children:null===z||void 0===z||null===(P=z.billing_details)||void 0===P||null===(E=P.address)||void 0===E?void 0:E.city})}),(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)("hr",{className:"my-2"})}),(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"billing postal code"}),(0,g.jsx)(a.A,{md:"6",xs:"12",children:(0,g.jsx)("div",{className:"input-static",children:null===z||void 0===z||null===(T=z.billing_details)||void 0===T||null===(R=T.address)||void 0===R?void 0:R.postal_code})})]}),(0,g.jsx)("hr",{className:"my-2"}),(0,g.jsxs)(n.A,{children:[(0,g.jsx)(a.A,{sm:"6",children:(0,g.jsx)(p.A,{id:"removeCard",title:"Remove Card",disabled:B.submitted,onClick:()=>L({submitted:!0}),block:!0,className:"mt-3",color:"danger",children:"Remove Card"})}),(0,g.jsx)(a.A,{sm:"6",children:(0,g.jsx)(p.A,{id:"updateCard",block:!0,color:"success",className:"mt-3",onClick:()=>$(!0),children:"Update Card"})})]})]})})})};var y=s(9379),N=s(5604),C=s(4283),w=s(1701),k=s(414);const S=function(e){let{setEditingCard:t,customerCard:s,formStateHeight:i,badCard:h}=e;const{customer_id:b}=(0,o.g)(),S=(0,c.O$)(l.A,(e=>e.auth)),O=(0,c.O$)(l.A,(e=>{var t;return null===(t=e.customer)||void 0===t?void 0:t.stripe_id})),[P,E]=(0,r.useState)({postal_code:!1,card:!1,expire:!1,cvc:!1}),[T,R]=(0,r.useState)({}),$=(0,N.useStripe)(),z=(0,N.useElements)(),F=(0,o.Zp)(),{search:H}=(0,o.zy)(),{returnURL:I}=C.A.parse(H);return d()((async()=>{const{submitted:e,processing:s}=T;if(e&&!s){const{card:e,expire:s,cvc:r,postal_code:n,line1:a,line2:o,state:c,city:i,country:d}=P;if(e&&s&&r&&n&&a&&c&&i&&d){const e=await $.createPaymentMethod({type:"card",card:z.getElement(N.CardNumberElement),billing_details:{address:{postal_code:n,line1:a,line2:o,state:c,city:i,country:d}}});if(R({processing:!0}),e.error)R((0,y.A)((0,y.A)({},T),{},{error:e.error.message})),setTimeout((()=>R((0,y.A)((0,y.A)({},T),{},{error:!1}))),2e3);else{const s=await(0,w.A)({auth:S,payment_method_id:e.paymentMethod.id,stripe_id:O,customer_id:b});s.error?(R((0,y.A)((0,y.A)({},T),{},{error:s.message})),setTimeout((()=>R((0,y.A)((0,y.A)({},T),{},{error:!1}))),2e3)):(window._kmq&&window._kmq.push(["record","added credit card - billing page"]),R({success:s.message}),await(0,j.A)({auth:S,customer_id:b}),I?F(I):t(!1))}}else R({error:"All fields are required"})}}),[T]),(0,g.jsx)(x.tH,{onError:(e,t)=>(0,_.A)({error:{message:e.message,componentStack:t},customer_id:b}),FallbackComponent:f.A,children:T.processing?(0,g.jsx)(A.A,{height:i,status:"processing",header:"Adding Card To Your Account",subhead:"The Credit Schnauzer is securely contacting Stripe."}):T.success?(0,g.jsx)(A.A,{height:i,status:"success",header:"Success!",subhead:"Credit Card was successfully added to your account."}):T.error?(0,g.jsx)(A.A,{height:i,status:"error",header:T.error,subhead:"Please try again"}):(0,g.jsx)(u.A,{children:(0,g.jsxs)(m.A,{children:[h&&(0,g.jsx)(v.A,{}),(0,g.jsx)(k.A,{setFormData:E,formData:P}),(0,g.jsx)("hr",{className:"my-2"}),(0,g.jsxs)(n.A,{children:[s&&(0,g.jsx)(a.A,{sm:"6",children:(0,g.jsx)(p.A,{id:"editCard",onClick:()=>t(!1),block:!0,color:"danger",className:"mt-3",children:"Cancel"})}),(0,g.jsx)(a.A,{children:(0,g.jsx)(p.A,{id:s?"saveNewCard":"addCardToAccount",title:s?"Save New Card":"Add Card To Account",disabled:T.submitted||!P.card||!P.expire||!P.cvc||!P.postal_code||!$||!z,onClick:()=>R({submitted:!0}),block:!0,className:"mt-3",color:"success",children:s?"Save New Card":"Add Card To Account"})})]})]})})})};const O=function(){const[e,t]=(0,r.useState)(!1),s=(0,c.O$)(l.A,(e=>e.hasCard),[e]),n=(0,c.O$)(l.A,(e=>{var t,s;return"invoice.payment_failed"===(null===(t=e.customer)||void 0===t||null===(s=t.current_payment_status)||void 0===s?void 0:s.status)})),a="582px";return(0,g.jsx)("div",{className:"mt-3 mb-4",children:e||!s?(0,g.jsx)(S,{formStateHeight:a,setEditingCard:t,customerCard:s,badCard:n}):(0,g.jsx)(b,{formStateHeight:a,setEditingCard:t,customerCard:s,badCard:n})})};var P=s(5996);let E;const T=function(){const{customer_id:e}=(0,o.g)(),t=(0,c.O$)(l.A,(e=>e.auth)),s=(0,c.O$)(l.A,(e=>e.invoices));return d()((()=>{E=new AbortController,(async e=>{let{auth:t,signal:s,customer_id:r}=e,n=null;try{n=await(0,h.A)({endpoint:"getInvoices",method:"POST",payload:{customer_id:r},signal:s,auth:t});let e=[];return Array.isArray(n)&&(e=n),l.A.update((t=>{t.invoices=e.filter((e=>e.amount_paid))}))}catch(a){return(0,_.A)({type:"lms data",status:"error",url:P.A.lms_api_url,operation:"getInvoices",request:{customer_id:r},error:{catch:a.toString()},customer_id:r})}})({auth:t,signal:E.signal,customer_id:e})}),(()=>{var e;return null===(e=E)||void 0===e?void 0:e.abort()}),[]),(0,g.jsx)(x.tH,{onError:(t,s)=>(0,_.A)({error:{message:t.message,componentStack:s},customer_id:e}),FallbackComponent:f.A,children:(0,g.jsx)(u.A,{className:"my-3",children:(0,g.jsx)(m.A,{children:s?s.length?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(n.A,{children:[(0,g.jsx)(a.A,{xs:"6",className:"text text-bold text-small",children:"date"}),(0,g.jsx)(a.A,{xs:"3",className:"text-end text-bold text-small",children:"amount"}),(0,g.jsx)(a.A,{xs:"3",className:"text-end text-bold text-small",children:"print"})]}),s.map((e=>(0,g.jsxs)(r.Fragment,{children:[(0,g.jsx)("hr",{className:"mt-2"}),(0,g.jsxs)(n.A,{className:"pb-2",children:[(0,g.jsx)(a.A,{xs:"6",className:"text text-nowrap",children:new Date(1e3*e.created).toLocaleString()}),(0,g.jsxs)(a.A,{xs:"3",className:"text-end text text-nowrap",children:["$",(e.total/100).toFixed(2)]}),(0,g.jsx)(a.A,{xs:"3",className:"text-end text text-nowrap",children:(0,g.jsx)("a",{title:"print invoice",href:e.hosted_invoice_url,target:"_blank",rel:"noopener noreferrer",children:(0,g.jsx)("i",{className:"fa fa-print text-purple"})})})]})]},e.id)))]}):(0,g.jsx)("div",{className:"py-5 text-center",children:"You have not yet received an invoice."}):(0,g.jsx)("div",{className:"py-5 text-center",children:(0,g.jsx)("i",{className:"fa fa-spinner fa-spin text-purple"})})})})})};var R=s(2257);const $=function(){const{customer_id:e}=(0,o.g)(),t=(0,c.O$)(l.A,(e=>e.customer.stripe_coupons));return(0,g.jsx)(x.tH,{onError:(t,s)=>(0,_.A)({error:{message:t.message,componentStack:s},customer_id:e}),FallbackComponent:f.A,children:(0,g.jsx)(u.A,{className:"my-3",children:(0,g.jsxs)(m.A,{children:[(0,g.jsx)(R.A,{}),null!==t&&void 0!==t&&t.length?(0,g.jsxs)("div",{className:"mt-2",children:[t.map((e=>(0,g.jsxs)(r.Fragment,{children:[(0,g.jsx)("hr",{className:"my-2"}),(0,g.jsxs)(n.A,{children:[(0,g.jsx)(a.A,{xs:"6",children:e.name}),(0,g.jsxs)(a.A,{xs:"6",className:"text-end",children:["$",parseInt(e.amount_off/100,10)]})]})]},e.id))),(0,g.jsx)("hr",{className:"my-2"}),(0,g.jsxs)(n.A,{children:[(0,g.jsx)(a.A,{xs:"6",children:(0,g.jsx)("b",{children:"Total Credit"})}),(0,g.jsx)(a.A,{xs:"6",className:"text-end",children:(0,g.jsxs)("b",{children:["$",t.reduce(((e,t)=>e+parseInt(t.amount_off/100,10)),0)]})})]})]}):null]})})})};var z=s(5345),F=s(3906);const H=function(){const{customer_id:e}=(0,o.g)(),t=(0,c.O$)(l.A,(e=>e.auth)),s=(0,c.O$)(l.A,(e=>e.products)),i=(0,c.O$)(l.A,(e=>e.regions)),u=(0,c.O$)(l.A,(e=>e.subscriptions)),m=(0,c.O$)(l.A,(e=>e.instances)),p=(0,c.O$)(l.A,(e=>e.customer.is_unpaid));return(0,r.useEffect)((()=>{(0,j.A)({auth:t,customer_id:e})}),[]),d()((()=>{t&&s&&i&&u&&e&&(null===m||void 0===m||!m.length)&&(0,F.A)({auth:t,customer_id:e,products:s,regions:i,subscriptions:u,instanceCount:null===m||void 0===m?void 0:m.length})}),[t,s,i,e,u,m]),(0,g.jsxs)(n.A,{children:[p&&(0,g.jsx)(a.A,{xs:"12",children:(0,g.jsx)(z.A,{})}),(0,g.jsxs)(a.A,{md:"6",children:[(0,g.jsx)("span",{className:"floating-card-header",children:"card"}),(0,g.jsx)(O,{})]}),(0,g.jsxs)(a.A,{md:"6",children:[(0,g.jsx)("span",{className:"floating-card-header",children:"coupons"}),(0,g.jsx)($,{}),(0,g.jsx)("br",{}),(0,g.jsx)("span",{className:"floating-card-header",children:"invoices"}),(0,g.jsx)(T,{})]})]})}},5887:(e,t,s)=>{s.d(t,{A:()=>n});s(9950);var r=s(4414);const n=function(){return(0,r.jsxs)("div",{className:"text-danger",children:[(0,r.jsx)("i",{children:"Your most recent card payment failed. Please update your card below."}),(0,r.jsx)("hr",{className:"mt-3 mb-2"})]})}},2257:(e,t,s)=>{s.d(t,{A:()=>g});var r=s(9950),n=s(7176),a=s(6114),o=s(5488),c=s(3452),i=s(9163),d=s.n(i),l=s(6713),u=s(9435),m=s(5077),p=s(4283),x=s(5553),h=s(2714);var A=s(9519),v=s(3150),j=s(3628),f=s(4414);let _;const g=function(){const{customer_id:e}=(0,m.g)(),{search:t}=(0,m.zy)(),{code:s}=p.A.parse(t),i=(0,l.O$)(x.A,(e=>e.auth)),[g,b]=(0,r.useState)({coupon_code:s||""}),[y,N]=(0,r.useState)({}),[C,w]=(0,r.useState)(!1);return d()((async()=>{if(y.submitted){const{coupon_code:t}=g;if(t){_=new AbortController;const s=await(async e=>{let{auth:t,customer_id:s,coupon_code:r}=e;return(0,h.A)({endpoint:"addCoupon",method:"POST",auth:t,payload:{customer_id:s,coupon_code:r,user_id:t.user_id}})})({auth:i,customer_id:e,coupon_code:t});!1===s.result||s.error?N({error:s.message}):(window._kmq&&window._kmq.push(["record","user added coupon"]),await(0,A.A)({auth:i,customer_id:e}),C&&(b({coupon_code:""}),N({})))}else N({error:"Please enter a valid coupon code"})}}),(()=>{var e;return null===(e=_)||void 0===e?void 0:e.abort()}),[y]),d()((()=>{y.submitted||N({})}),[g]),d()((()=>{w(!0),g.coupon_code&&N({submitted:!0})}),(()=>w(!1)),[]),(0,f.jsx)(u.tH,{onError:(t,s)=>(0,j.A)({error:{message:t.message,componentStack:s},customer_id:e}),FallbackComponent:v.A,children:(0,f.jsxs)(n.A,{children:[(0,f.jsx)(a.A,{md:"6",children:(0,f.jsx)(o.A,{id:"coupon_code",className:"mb-2",type:"text",value:g.coupon_code,invalid:!!y.error,disabled:y.submitted,placeholder:"coupon code",onChange:e=>b({coupon_code:e.target.value.toUpperCase()})})}),(0,f.jsx)(a.A,{md:"6",children:(0,f.jsx)(c.A,{id:"addCoupon",color:"success",disabled:y.submitted,block:!0,onClick:()=>N({submitted:!0}),children:y.submitted?(0,f.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,f.jsx)("span",{children:"Add Coupon"})})}),(0,f.jsxs)(a.A,{xs:"12",className:"text-center text-danger text-small",children:[y.error,"\xa0"]})]})})}},414:(e,t,s)=>{s.d(t,{A:()=>v});var r=s(9379),n=s(9950),a=s(7176),o=s(6114),c=s(5488),i=s(5604),d=s(5285),l=s(6713),u=s(5077),m=s(9435);var p=s(5553),x=s(3150),h=s(3628),A=s(4414);const v=function(e){let{setFormData:t,formData:s}=e;const{customer_id:v}=(0,u.g)(),[j,f]=(0,n.useState)({}),_=(e=>{let{theme:t}=e;return{style:{base:{iconColor:"#403b8a",color:"dark"===t?"#ffffff":"#212121",fontWeight:100,fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans", Arial, Helvetica, Verdana, Sans-Serif',fontSize:"14px",fontSmoothing:"antialiased","::placeholder":{color:"#bcbcbc"}},invalid:{iconColor:"#ea4c89",color:"#ea4c89"}}}})({theme:(0,l.O$)(p.A,(e=>e.theme))});return(0,A.jsx)(m.tH,{onError:(e,t)=>(0,h.A)({error:{message:e.message,componentStack:t},customer_id:v}),FallbackComponent:x.A,children:(0,A.jsxs)(a.A,{children:[(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"card number"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)("div",{className:"fake-input ".concat(j.cardError?"error":""),children:(0,A.jsx)(i.CardNumberElement,{options:_,id:"ccCardNumber",onChange:e=>{var n;f((0,r.A)((0,r.A)({},j),{},{cardError:null===(n=e.error)||void 0===n?void 0:n.message})),t((0,r.A)((0,r.A)({},s),{},{card:e.complete}))}})})}),(0,A.jsx)(o.A,{xs:"12",children:(0,A.jsx)("hr",{className:"my-2"})}),(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"expiration"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)("div",{className:"fake-input ".concat(j.expError?"error":""),children:(0,A.jsx)(i.CardExpiryElement,{options:_,id:"ccExpire",onChange:e=>{var n;f((0,r.A)((0,r.A)({},j),{},{expError:null===(n=e.error)||void 0===n?void 0:n.message})),t((0,r.A)((0,r.A)({},s),{},{expire:e.complete}))}})})}),(0,A.jsx)(o.A,{xs:"12",children:(0,A.jsx)("hr",{className:"my-2"})}),(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"cvcc"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)("div",{className:"fake-input ".concat(j.cvcError?"error":""),children:(0,A.jsx)(i.CardCvcElement,{id:"ccCVC",options:_,onChange:e=>{var n;f((0,r.A)((0,r.A)({},j),{},{cvcError:null===(n=e.error)||void 0===n?void 0:n.message})),t((0,r.A)((0,r.A)({},s),{},{cvc:e.complete}))}})})}),(0,A.jsx)(o.A,{xs:"12",children:(0,A.jsx)("hr",{className:"my-2"})}),(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"country"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)(d.wP,{id:"ccCountry",valueType:"short",value:s.country,priorityOptions:["CA","US","GB"],defaultOptionLabel:"select your country",onChange:e=>t((0,r.A)((0,r.A)({},s),{},{country:e}))})}),(0,A.jsx)(o.A,{xs:"12",children:(0,A.jsx)("hr",{className:"my-2"})}),(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"state/province"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)(d.mM,{id:"ccRegion",blankOptionLabel:"select country first",defaultOptionLabel:"select state / province",valueType:"short",countryValueType:"short",country:s.country,value:s.state,onChange:e=>t((0,r.A)((0,r.A)({},s),{},{state:e}))})}),(0,A.jsx)(o.A,{xs:"12",children:(0,A.jsx)("hr",{className:"my-2"})}),(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"address"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)(c.A,{id:"ccLine1",onChange:e=>t((0,r.A)((0,r.A)({},s),{},{line1:e.target.value}))})}),(0,A.jsx)(o.A,{xs:"12",children:(0,A.jsx)("hr",{className:"my-2"})}),(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"apt/unit"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)(c.A,{id:"ccApt",onChange:e=>t((0,r.A)((0,r.A)({},s),{},{line2:e.target.value}))})}),(0,A.jsx)(o.A,{xs:"12",children:(0,A.jsx)("hr",{className:"my-2"})}),(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"city"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)(c.A,{id:"ccCity",onChange:e=>t((0,r.A)((0,r.A)({},s),{},{city:e.target.value}))})}),(0,A.jsx)(o.A,{xs:"12",children:(0,A.jsx)("hr",{className:"my-2"})}),(0,A.jsx)(o.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"billing postal code"}),(0,A.jsx)(o.A,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,A.jsx)(c.A,{id:"ccPostalCode",onChange:e=>t((0,r.A)((0,r.A)({},s),{},{postal_code:e.target.value}))})})]})})}},8188:(e,t,s)=>{s.d(t,{A:()=>o});s(9950);var r=s(4084),n=s(8156),a=s(4414);const o=function(e){let{header:t,subhead:s=" ",height:o,status:c,className:i}=e;return(0,a.jsx)(r.A,{className:"form-status ".concat(i),children:(0,a.jsxs)(n.A,{className:"text-center",style:{height:o},children:[(0,a.jsx)("div",{className:"text-bold",children:t}),(0,a.jsx)("div",{className:"py-4",children:(0,a.jsx)("i",{className:"fa fa-lg ".concat("processing"===c?"fa-spinner fa-spin text-purple":"success"===c?"fa-check-circle text-purple":"fa-exclamation-triangle text-danger")})}),(0,a.jsx)("div",{className:"text-grey",children:s})]})})}},5345:(e,t,s)=>{s.d(t,{A:()=>o});s(9950);var r=s(4084),n=s(8156),a=s(4414);const o=function(){return(0,a.jsx)(r.A,{color:"danger",className:"mb-4",children:(0,a.jsx)(n.A,{className:"text-center text-danger",children:"This Organization Will Not Be Billed"})})}},1701:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(2714);const n=async e=>{let{auth:t,payment_method_id:s,stripe_id:n,customer_id:a}=e;return(0,r.A)({endpoint:"addPaymentMethod",method:"POST",payload:{payment_method_id:s,stripe_id:n,customer_id:a},auth:t})}},9519:(e,t,s)=>{s.d(t,{A:()=>d});var r=s(9379),n=s(2714),a=s(5553),o=s(3628),c=s(5996),i=s(7596);const d=async e=>{let{auth:t,customer_id:s}=e,d=null;try{var l;return d=await(0,n.A)({endpoint:"getCustomer",method:"POST",payload:{customer_id:s},auth:t}),(0,i.A)({auth:t,customer_id:s,stripe_id:null===(l=d)||void 0===l?void 0:l.stripe_id}),d.error||a.A.update((e=>{var t;e.customer=(0,r.A)((0,r.A)({},d),{},{customer_id:s}),e.hasCard=null===(t=d.stripe_payment_methods)||void 0===t?void 0:t[0]})),d}catch(u){return(0,o.A)({type:"lms data",status:"error",url:c.A.lms_api_url,operation:"getCustomer",request:{customer_id:s},error:{catch:u.toString()},customer_id:s})}}},3906:(e,t,s)=>{s.d(t,{A:()=>l});var r=s(9379),n=s(2714),a=s(5553),o=s(4549);const c=e=>{let{is_local:t,wavelength_zone_id:s,cloud_provider:r}=e;switch(!0){case s:return"wavelength_compute";case t:return"local_compute";case"akamai"===r:return"akamai_compute";default:return"cloud_compute"}};var i=s(3628),d=s(5996);const l=async e=>{let{auth:t,customer_id:s,products:l,regions:u,subscriptions:m,instanceCount:p=0}=e,x=null;try{if(x=await(0,n.A)({endpoint:"getInstances",method:"POST",payload:{customer_id:s,user_id:t.user_id},auth:t}),Array.isArray(x)){const e=x.map((e=>{const t=(e=>{let{instance:t,products:s,regions:r,subscriptions:n}=e;try{var a,i;const e=t.compute_subscription_id?n[c(t)]:s[c(t)],d=null===e||void 0===e?void 0:e.find((e=>e.value.stripe_plan_id===t.stripe_plan_id&&(!t.compute_subscription_id||e.value.compute_subscription_id===t.compute_subscription_id))),l=t.storage_subscription_id?n.cloud_storage:s.cloud_storage,u=!t.is_local&&(null===l||void 0===l?void 0:l.find((e=>e.value.data_volume_size===t.data_volume_size&&e.value.stripe_storage_plan_id===t.stripe_storage_plan_id&&(!t.storage_subscription_id||e.value.storage_subscription_id===t.storage_subscription_id)))),m=parseFloat((null===d||void 0===d||null===(a=d.value)||void 0===a?void 0:a.compute_price)||0)+parseFloat((null===u||void 0===u||null===(i=u.value)||void 0===i?void 0:i.storage_price)||0),p=m?"$".concat((0,o.A)(m.toFixed(2))):"FREE",x=t.compute_subscription_id&&t.storage_subscription_id?"PREPAID":m?"".concat(p,"/").concat(d.value.compute_interval):"FREE",h=!t.is_local&&r.find((e=>e.value===t.instance_region));return{compute:null===d||void 0===d?void 0:d.value,storage:null===u||void 0===u?void 0:u.value,totalPrice:m,totalPriceString:p,totalPriceStringWithInterval:x,region:h}}catch(d){return console.log(d)}})({instance:e,products:l,regions:u,subscriptions:m});return(0,r.A)((0,r.A)({},e),t)})),t=e.sort(((e,t)=>e.instance_name>t.instance_name?1:-1));return a.A.update((e=>{e.instances=t})),t}return!p&&a.A.update((e=>{e.instances=[]}))}catch(h){return(0,i.A)({type:"lms data",status:"error",url:d.A.lms_api_url,operation:"getInstances",request:{customer_id:s},error:{catch:h.toString()},customer_id:s})}}},7596:(e,t,s)=>{s.d(t,{A:()=>d});var r=s(2714),n=s(5553),a=s(3628),o=s(2434),c=s(2696),i=s(5996);const d=async e=>{let{auth:t,customer_id:s,stripe_id:d}=e;try{const e=await(0,r.A)({endpoint:"getPrepaidSubscriptions",method:"POST",payload:{customer_id:s,stripe_id:d},auth:t});return!e.error&&n.A.update((t=>{t.subscriptions={cloud_storage:(0,c.A)(e.cloud_storage||[]),cloud_compute:(0,o.A)(e.cloud_compute||[]),wavelength_compute:(0,o.A)(e.wavelength_compute||[]),local_compute:(0,o.A)(e.local_compute||[])}}))}catch(l){return(0,a.A)({type:"lms data",status:"error",url:i.A.lms_api_url,operation:"getPrepaidSubscriptions",error:{catch:l.toString()}})}}},5488:(e,t,s)=>{s.d(t,{A:()=>_});var r=s(9950),n=s(1942),a=s.n(n),o=s(8738),c=s.n(o),i=s(1497);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var l=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},u.apply(this,arguments)}function m(e,t){if(null==e)return{};var s,r,n=function(e,t){if(null==e)return{};var s,r,n={},a=Object.keys(e);for(r=0;r<a.length;r++)s=a[r],t.indexOf(s)>=0||(n[s]=e[s]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)s=a[r],t.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function p(e,t){for(var s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var s,r=v(e);if(t){var n=v(this).constructor;s=Reflect.construct(r,arguments,n)}else s=r.apply(this,arguments);return function(e,t){if(t&&("object"===d(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return A(e)}(this,s)}}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}var j={children:a().node,type:a().string,size:a().oneOfType([a().number,a().string]),bsSize:a().string,valid:a().bool,invalid:a().bool,tag:i.Wx,innerRef:a().oneOfType([a().object,a().func,a().string]),plaintext:a().bool,addon:a().bool,className:a().string,cssModule:a().object},f=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(o,e);var t,s,n,a=h(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=a.call(this,e)).getRef=t.getRef.bind(A(t)),t.focus=t.focus.bind(A(t)),t}return t=o,(s=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var e=this.props,t=e.className,s=e.cssModule,n=e.type,a=void 0===n?"text":n,o=e.bsSize,d=e.valid,p=e.invalid,x=e.tag,h=e.addon,A=e.plaintext,v=e.innerRef,j=m(e,l),f=["switch","radio","checkbox"].indexOf(a)>-1,_="select"===a,g="range"===a,b=x||(_||"textarea"===a?a:"input"),y="form-control";A?(y="".concat(y,"-plaintext"),b=x||"input"):g?y="form-range":_?y="form-select":f&&(y=h?null:"form-check-input"),j.size&&/\D/g.test(j.size)&&((0,i.mc)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),o=j.size,delete j.size);var N=(0,i.qO)(c()(t,p&&"is-invalid",d&&"is-valid",!!o&&(_?"form-select-".concat(o):"form-control-".concat(o)),y),s);return("input"===b||x&&"function"===typeof x)&&(j.type="switch"===a?"checkbox":a),j.children&&!A&&"select"!==a&&"string"===typeof b&&"select"!==b&&((0,i.mc)('Input with a type of "'.concat(a,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete j.children),r.createElement(b,u({},j,{ref:v,className:N,"aria-invalid":p}))}}])&&p(t.prototype,s),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(r.Component);f.propTypes=j;const _=f}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[521],{958:(e,s,a)=>{a.r(s),a.d(s,{default:()=>L});var t=a(9950),r=a(7176),i=a(6114),n=a(6713),l=a(135),o=a(5077),c=a(5553),d=a(9379),u=a(3452),m=a(4084),h=a(8156),g=a(7348),x=a(4343),p=a(4414);const j={tableData:!1,dataTableColumns:[],filtered:[],sorted:[{id:"email",desc:!1}],page:0,loading:!1,totalPages:1,pageSize:20,autoRefresh:!1,showFilter:!1,lastUpdate:!1};const A=function(){var e,s;const{customer_id:a}=(0,o.g)(),l=(0,g.MW)(),A=(0,o.Zp)(),[b,f]=(0,t.useState)(j),v=null===(e=b.sorted[0])||void 0===e?void 0:e.id,_=null===(s=b.sorted[0])||void 0===s?void 0:s.desc,N=(0,n.O$)(c.A,(e=>e.auth)),y=(0,n.O$)(c.A,(e=>e.users)),C=[{Header:"email address",accessor:"email"},{Header:"status",accessor:"orgs[0].status"}],w=(0,t.useCallback)((e=>{N.user_id===e?l.error("Edit your own profile by clicking the user icon in the top nav"):A("/o/".concat(a,"/users/").concat(e))}),[N.user_id,a]);return(0,t.useEffect)((()=>{if(b.tableData.length&&v){const e=[...[...b.tableData]].sort(((e,s)=>e[v]>s[v]&&_?-1:e[v]>s[v]||_?1:-1));f((0,d.A)((0,d.A)({},b),{},{tableData:e}))}}),[v,_]),(0,t.useEffect)((()=>{y&&C&&f((0,d.A)((0,d.A)({},b),{},{tableData:y,dataTableColumns:C,totalPages:Math.ceil((y.length||b.pageSize)/b.pageSize)}))}),[y,f,b.pageSize]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(r.A,{className:"floating-card-header",children:[(0,p.jsx)(i.A,{children:"existing org users"}),(0,p.jsx)(i.A,{className:"text-end",children:(0,p.jsx)(u.A,{color:"link",tabIndex:"0",title:"Filter Users",className:"me-3",onClick:()=>f((0,d.A)((0,d.A)({},b),{},{filtered:b.showFilter?[]:b.filtered,showFilter:!b.showFilter})),children:(0,p.jsx)("i",{className:"fa fa-search"})})})]}),(0,p.jsx)(m.A,{className:"my-3",children:(0,p.jsx)(h.A,{className:"react-table-holder",children:(0,p.jsx)(x.A,{columns:b.dataTableColumns,data:b.tableData,currentPage:b.page,pageSize:b.pageSize,totalPages:b.totalPages,showFilter:b.showFilter,sorted:b.sorted,loading:!y||b.loading&&!b.autoRefresh,onFilteredChange:e=>f((0,d.A)((0,d.A)({},b),{},{filtered:e})),onSortedChange:e=>f((0,d.A)((0,d.A)({},b),{},{sorted:e})),onPageChange:e=>f((0,d.A)((0,d.A)({},b),{},{pageSize:e})),onPageSizeChange:e=>f((0,d.A)((0,d.A)({},b),{},{page:0,pageSize:e})),onRowClick:e=>w(e.user_id)})})})]})};var b=a(9163),f=a.n(b),v=a(9435),_=a(1110),N=a(2714);const y=async e=>{let{auth:s,customer_id:a,user_id:t,user_id_owner:r,status:i}=e;return(0,N.A)({endpoint:"updateOrgUser",method:"POST",payload:{customer_id:a,user_id:t,user_id_owner:r,status:i},auth:s})};var C=a(3628),w=a(5996);const S=async e=>{let{auth:s,customer_id:a}=e,t=null;try{t=await(0,N.A)({endpoint:"getUsers",method:"POST",payload:{customer_id:a},auth:s});let e=[];return Array.isArray(t)&&(e=[...t].sort(((e,s)=>e.email>s.email?1:-1))),c.A.update((s=>{s.users=e}))}catch(r){return(0,C.A)({type:"lms data",status:"error",url:w.A.lms_api_url,operation:"getUsers",request:{customer_id:a},error:{catch:r.toString()},customer_id:a})}};var k=a(3150);const P=function(){const{user_id:e}=(0,o.g)(),{customer_id:s}=(0,o.g)(),a=(0,g.MW)(),l=(0,n.O$)(c.A,(e=>e.auth)),d=(0,n.O$)(c.A,(s=>s.users&&s.users.find((s=>s.user_id===e))),[e]),[m,h]=(0,t.useState)(!1),[x,j]=(0,t.useState)({});return f()((()=>{var e,a;h(d&&(null===(e=d.orgs)||void 0===e||null===(a=e.find((e=>{var a;return(null===(a=e.customer_id)||void 0===a?void 0:a.toString())===s})))||void 0===a?void 0:a.status))}),[d,s]),f()((async()=>{const{submitted:t,processing:r}=x;if(t&&!r){const t="declined"===m?"invited":"accepted"===m?"owner":"owner"===m?"accepted":"invited";h(t);const r=await y({auth:l,user_id:e,user_id_owner:l.user_id,customer_id:s,status:t});r.error?(a.error(r.message),j({})):(a.success("User role updated to ".concat("accepted"===t?"user":t)),j({}),S({auth:l,customer_id:s}))}}),[x]),(0,p.jsx)(v.tH,{onError:(e,a)=>(0,C.A)({error:{message:e.message,componentStack:a},customer_id:s}),FallbackComponent:k.A,children:["invited","declined"].includes(m)?"declined"===m?(0,p.jsxs)(r.A,{children:[(0,p.jsxs)(i.A,{xs:"8",className:"py-1",children:["User declined invitation to join",(0,p.jsx)("br",{}),(0,p.jsx)("span",{className:"text-small",children:"reinvite them by clicking this button"})]}),(0,p.jsx)(i.A,{xs:"4",children:(0,p.jsx)(u.A,{id:"reinviteOrganizationUser",block:!0,color:"success",onClick:()=>j({submitted:!0}),disabled:x.submitted,children:x.submitted?(0,p.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,p.jsx)("span",{children:"Reinvite User"})})})]}):(0,p.jsx)(r.A,{children:(0,p.jsxs)(i.A,{className:"py-1",children:["User has not yet accepted invitation",(0,p.jsx)("br",{}),(0,p.jsx)("span",{className:"text-small",children:"You must wait for them to accept before modifying them"})]})}):(0,p.jsxs)(r.A,{children:[(0,p.jsxs)(i.A,{xs:"8",className:"py-1",children:["Is Owner",(0,p.jsx)("br",{}),(0,p.jsx)("span",{className:"text-small",children:"can invite other users, add instances"})]}),(0,p.jsx)(i.A,{xs:"4",children:(0,p.jsx)("div",{className:"role-toggle-holder",children:(0,p.jsx)(_.A,{checked:"owner"===m,onChange:()=>j({submitted:!0})})})})]})})};var E=a(5488),O=a(5269);const z=function(){const{user_id:e,customer_id:s}=(0,o.g)(),{pathname:a}=(0,o.zy)(),l=(0,o.Zp)(),d=(0,g.MW)(),[m,h]=(0,t.useState)({}),[x,j]=(0,t.useState)({}),A=(0,n.O$)(c.A,(e=>e.auth));return(0,p.jsx)(v.tH,{onError:(e,a)=>(0,C.A)({error:{message:e.message,componentStack:a},customer_id:s}),FallbackComponent:k.A,children:(0,p.jsxs)(r.A,{children:[(0,p.jsxs)(i.A,{xs:"4",className:"py-1",children:["Delete Org User",(0,p.jsx)("br",{}),(0,p.jsx)("span",{className:"text-small",children:"user will be removed from this organization"})]}),(0,p.jsx)(i.A,{xs:"4",children:(0,p.jsx)(E.A,{id:"delete_username",onChange:e=>h({delete_username:e.target.value}),type:"text",className:"text-center",title:"confirm username to delete",placeholder:'Enter "DELETE" here to enable deletion.',value:m.delete_username||""})}),(0,p.jsx)(i.A,{xs:"4",children:(0,p.jsx)(u.A,{id:"deleteUser",block:!0,color:"danger",onClick:async()=>{if("DELETE"!==m.delete_username)d.error("Please type DELETE to delete this user");else{j({submitted:!0});const t=await y({auth:A,user_id:e,user_id_owner:A.user_id,customer_id:s,status:"removed"});-1!==t.message.indexOf("successfully")?(d.success(t.message),O.A.update((e=>{e.lastUpdate=Date.now()})),j({}),setTimeout((()=>l(a.replace("/".concat(e),""))),100)):(d.error(t.message),j({}))}},disabled:"DELETE"!==m.delete_username||x.submitted,children:x.submitted?(0,p.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,p.jsx)("span",{children:"Delete User"})})})]})})};const F=function(e){let{userEmail:s}=e;const{user_id:a}=(0,o.g)(),{pathname:t}=(0,o.zy)(),n=(0,o.Zp)();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"floating-card-header",children:["existing org users > edit > ",(0,p.jsx)("b",{children:s})]}),(0,p.jsx)(m.A,{className:"my-3",children:(0,p.jsxs)(h.A,{children:[(0,p.jsx)(P,{}),(0,p.jsx)("hr",{className:"my-3"}),(0,p.jsx)(z,{}),(0,p.jsx)("hr",{className:"my-3"}),(0,p.jsxs)(r.A,{children:[(0,p.jsxs)(i.A,{xs:"8",className:"py-1",children:["Return to User List",(0,p.jsx)("br",{}),(0,p.jsx)("span",{className:"text-small",children:"make no further changes to this user"})]}),(0,p.jsx)(i.A,{xs:"4",children:(0,p.jsx)(u.A,{id:"returnToOrganizationUserList",block:!0,color:"grey",onClick:()=>n(t.replace("/".concat(a),"")),children:"Return to User List"})})]})]})})]})};var U=a(1440),T=a(8188);const D=function(e){let{refreshUsers:s,userEmails:a}=e;const r=(0,o.Zp)(),{customer_id:i}=(0,o.g)(),l=(0,n.O$)(c.A,(e=>e.auth)),[g,x]=(0,t.useState)({}),[j,A]=(0,t.useState)({}),b="132px";return f()((async()=>{const{email:e}=j,{submitted:t}=g;if(t){if((0,U.A)(e))if(a&&a.includes(e))x({error:"This user has already been invited"});else if(e===l.email)x({error:"You cannot invite yourself"});else{x({processing:!0});const a=await(async e=>{let{auth:s,email:a,customer_id:t,login_domain:r=window.location.host}=e;return(0,N.A)({endpoint:"addUser",method:"POST",payload:{email:a,customer_id:t,login_domain:r,user_id:s.user_id},auth:s})})({auth:l,email:e,customer_id:i});a.error?x({error:a.message}):(window._kmq&&window._kmq.push(["record","added org user"]),s(),x({success:a.message}))}else x({error:"Please enter a valid email"});setTimeout((()=>A({})),2e3)}}),[g]),f()((()=>x({})),[j]),(0,p.jsx)(v.tH,{onError:(e,s)=>(0,C.A)({error:{message:e.message,componentStack:s},customer_id:i}),FallbackComponent:k.A,children:(0,p.jsx)("div",{className:"mt-3 mb-4",children:l.email_bounced?(0,p.jsx)(m.A,{children:(0,p.jsxs)(h.A,{children:[(0,p.jsx)("b",{children:"Unable to Add New Org User"}),(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),"Your email address seems to be unreachable. Please update it to ensure billing, upgrade, and other critical system announcements reach you.",(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),(0,p.jsx)(u.A,{id:"updateEmail",onClick:()=>r("/profile"),title:"Update My Email",block:!0,className:"mt-3",color:"danger",children:"Update My Email"})]})}):g.processing?(0,p.jsx)(T.A,{height:b,status:"processing",header:"Adding User",subhead:"The Account Airedale Is A Good Boy"}):g.success?(0,p.jsx)(T.A,{height:b,status:"success",header:"Success!",subhead:g.success}):g.error?(0,p.jsx)(T.A,{height:b,status:"error",header:g.error,subhead:"Please try again"}):(0,p.jsx)(m.A,{children:(0,p.jsxs)(h.A,{children:[(0,p.jsx)(E.A,{id:"email",type:"text",className:"mb-3 text-center",name:"email",placeholder:"email address",onChange:e=>A((0,d.A)((0,d.A)({},j),{},{email:e.target.value.toLowerCase()})),disabled:g.submitted}),(0,p.jsx)(u.A,{id:"addOrganizationUser",color:"success",block:!0,onClick:()=>x({submitted:!0}),disabled:g.submitted,children:"Add Org User"})]})})})})};var R=a(9519);const L=function(){const{user_id:e,customer_id:s}=(0,o.g)(),a=(0,n.O$)(c.A,(e=>e.auth)),d=(0,n.O$)(c.A,(e=>e.users)),u=e&&d&&d.find((s=>s.user_id===e)),m=(0,t.useCallback)((()=>{a&&s&&S({auth:a,customer_id:s})}),[a,s]);return(0,t.useEffect)((()=>{m(),(0,R.A)({auth:a,customer_id:s})}),[]),(0,l.A)((()=>m()),w.A.refresh_content_interval),(0,p.jsxs)(r.A,{children:[(0,p.jsxs)(i.A,{xl:"3",lg:"4",md:"5",xs:"12",children:[(0,p.jsx)("span",{className:"floating-card-header",children:"add org user"}),(0,p.jsx)(D,{refreshUsers:m,userEmails:d&&d.map((e=>"declined"!==e.orgs[0].status&&e))})]}),(0,p.jsx)(i.A,{xl:"9",lg:"8",md:"7",xs:"12",className:"pb-5",children:u?(0,p.jsx)(F,{userEmail:u.email}):(0,p.jsx)(A,{refreshUsers:m})})]})}},4343:(e,s,a)=>{a.d(s,{A:()=>N});var t=a(9950),r=a(2043),i=a(5488),n=a(9435),l=a(9379),o=a(45),c=a(7176),d=a(6114),u=a(4414);const m=["key"],h=e=>{let{headerGroups:s,onSortedChange:a,sorted:t,showFilter:r,dynamicAttributesFromDataTable:i,tableDescriptionAttributes:n}=e;const h=e=>{let s=!1;return n.forEach((a=>{a.attribute===e&&(a.is_primary_key||a.indexed)&&(s=!0)})),s};return s.map((e=>{const s=e.getHeaderGroupProps(),{key:n}=s,g=(0,o.A)(s,m);return(0,u.jsxs)("div",(0,l.A)((0,l.A)({},g),{},{children:[(0,u.jsx)(c.A,{className:"header g-0",children:e.headers.map((e=>{var s,r;return(0,u.jsx)(d.A,{onClick:()=>{var s,r;i&&!i.includes(e.id)&&h(e.id)&&a([{id:e.id,desc:(null===(s=t[0])||void 0===s?void 0:s.id)===e.id&&!(null!==(r=t[0])&&void 0!==r&&r.desc)}])},className:"".concat((null===(s=t[0])||void 0===s?void 0:s.id)===e.id?"sorted":""," ").concat(null!==(r=t[0])&&void 0!==r&&r.desc?"desc":"asc"," ").concat(-1!==e.id.indexOf("hdb-narrow")?"action":""," px-1 ").concat(i&&!i.includes(e.id)&&h(e.id)?"":"disabled-column"),children:(0,u.jsx)("div",{className:"text-renderer",children:e.render("Header")})},e.id)}))}),r&&(0,u.jsx)(c.A,{className:"filter g-0",children:e.headers.map((e=>(0,u.jsx)(d.A,{className:-1!==e.id.indexOf("hdb-narrow")?"action":"",children:e.render("Filter")},e.id)))})]}),n)}))};var g=a(3452);const x=function(e){let{page:s,pageSize:a,totalPages:t,onPageChange:r,onPageSizeChange:n,loading:l}=e;return(0,u.jsxs)(c.A,{className:"pagination",children:[(0,u.jsx)(d.A,{xs:"12",sm:"2",className:"previous",children:(0,u.jsx)(g.A,{className:"mb-2 btn-pagination",color:"purple",block:!0,onClick:()=>r(s-1),disabled:!t||0===s,children:(0,u.jsx)("i",{className:"fa fa-chevron-left"})})}),(0,u.jsxs)(d.A,{xs:"12",sm:"4",className:"paginator",children:[(0,u.jsx)("i",{className:"fa fa-book me-2"}),(0,u.jsx)(i.A,{className:"mb-2",type:"number",value:s+1,min:1,max:t,onChange:e=>r(e.target.value-1)}),(0,u.jsxs)("div",{className:"page-count",children:["\xa0/\xa0",l?(0,u.jsx)("i",{className:"fa fa-spinner fa-spin"}):t]})]}),(0,u.jsx)(d.A,{xs:"12",sm:"4",className:"page-size",children:(0,u.jsx)(i.A,{className:"mb-2",type:"select",value:a,onChange:e=>n(e.target.value),children:[20,50,100,250].map((e=>(0,u.jsxs)("option",{value:e,children:[e," rows"]},e)))})}),(0,u.jsx)(d.A,{xs:"12",sm:"2",className:"next",children:(0,u.jsx)(g.A,{className:"mb-2 pull-right btn-pagination",block:!0,color:"purple",onClick:()=>r(s+1),disabled:!t||s+1===t,children:(0,u.jsx)("i",{className:"fa fa-chevron-right"})})})]})};const p=function(e){let{previousPage:s,canPreviousPage:a,pageIndex:t,gotoPage:r,setPageSize:n,pageCount:l,nextPage:o,canNextPage:m,loading:h}=e;return(0,u.jsxs)(c.A,{className:"pagination",children:[(0,u.jsx)(d.A,{xs:"12",sm:"2",className:"previous",children:(0,u.jsx)(g.A,{className:"mb-2 btn-pagination",color:"purple",block:!0,onClick:s,disabled:!l||!a,children:(0,u.jsx)("i",{className:"fa fa-chevron-left"})})}),(0,u.jsxs)(d.A,{xs:"12",sm:"4",className:"paginator",children:[(0,u.jsx)("i",{className:"fa fa-book me-2"}),(0,u.jsx)(i.A,{className:"mb-2",type:"number",value:t+1||1,min:1,max:l,onChange:e=>r(e.target.value?Number(e.target.value)-1:0)}),(0,u.jsxs)("div",{className:"page-count",children:["\xa0/\xa0",h?(0,u.jsx)("i",{className:"fa fa-spinner fa-spin"}):l]})]}),(0,u.jsx)(d.A,{xs:"12",sm:"4",className:"page-size",children:(0,u.jsx)(i.A,{className:"mb-2",type:"select",onChange:e=>{r(0),setTimeout((()=>n(e.target.value)),1e3)},children:[20,50,100,250].map((e=>(0,u.jsxs)("option",{value:e,children:[e," rows"]},e)))})}),(0,u.jsx)(d.A,{xs:"12",sm:"2",className:"next",children:(0,u.jsx)(g.A,{className:"mb-2 pull-right btn-pagination",block:!0,color:"purple",onClick:o,disabled:!l||!m,children:(0,u.jsx)("i",{className:"fa fa-chevron-right"})})})]})};const j=function(e){let{prepareRow:s,row:a,onRowClick:t=!1}=e;return s(a),(0,u.jsx)(c.A,{onClick:()=>t&&t(a.original),className:"g-0",children:a.cells.map((e=>(0,u.jsx)(d.A,{className:-1!==e.column.id.indexOf("hdb-narrow")?"action":"",children:e.render("Cell")},"".concat(e.row.id,"-").concat(e.column.id))))})};var A=a(3628),b=a(3150);function f(e){let{value:s}=e;return(0,u.jsx)("div",{className:"text-renderer",children:s})}function v(e){let{src:s}=e;const[a,r]=(0,t.useState)(!1),[i,n]=(0,t.useState)(!1);return(0,u.jsxs)("div",{className:"image-renderer",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,u.jsx)("i",{className:"fa fa-image"}),a&&i?(0,u.jsxs)("div",{className:"preview-image no-image",children:[(0,u.jsx)("i",{className:"fa fa-ban text-danger"}),(0,u.jsx)("div",{className:"mt-2",children:"image failed to load"})]}):a?(0,u.jsx)("img",{onError:n,alt:s,src:s,className:"preview-image"}):null]})}const _={Filter:e=>{let{column:{filterValue:s,setFilter:a}}=e;return(0,u.jsx)(i.A,{type:"text",value:s||"",onChange:e=>a(e.target.value||void 0)})},Cell:e=>{let{value:s}=e;return(e=>{switch(Object.prototype.toString.call(e)){case"[object Array]":case"[object Object]":return(0,u.jsx)(f,{value:JSON.stringify(e)});case"[object Boolean]":return(0,u.jsx)(f,{value:e?"true":"false"});case"[object String]":return(s=e)&&(s.match(/^https?.*\.(jpeg|jpg|gif|png)$/)||-1!==s.indexOf("data:image"))?(0,u.jsx)(v,{src:e}):(0,u.jsx)(f,{value:e});default:return(0,u.jsx)(f,{value:e})}var s})(s)}};const N=function(e){let{columns:s,data:a,error:i,currentPage:l,pageSize:o,totalPages:c,onFilteredChange:d,onSortedChange:m,onPageChange:g,onPageSizeChange:f,showFilter:v,onRowClick:N,sorted:y,loading:C,dynamicAttributesFromDataTable:w,tableDescriptionAttributes:S,manual:k=!1}=e;const{headerGroups:P,page:E,rows:O,prepareRow:z,state:F,setAllFilters:U,canPreviousPage:T,canNextPage:D,pageOptions:R,pageCount:L,gotoPage:$,nextPage:H,previousPage:M,setPageSize:I}=(0,r.useTable)({columns:s,data:a,defaultColumn:_,onFilteredChange:d,onSortedChange:m,onPageChange:g,onPageSizeChange:f,onRowClick:N,manualPagination:k,manualFilters:k,initialState:{pageIndex:l,pageSize:o}},r.useFilters,r.usePagination),[G,q]=(0,t.useState)(!0),Z=k||!E.length?O:E;return(0,t.useEffect)((()=>{!v&&F.filters.length?U([]):d(F.filters)}),[F.filters,v]),(0,t.useEffect)((()=>{setTimeout((()=>q(!1)),100)}),[null===Z||void 0===Z?void 0:Z.length]),(0,u.jsxs)(n.tH,{onError:(e,s)=>(0,A.A)({error:{message:e.message,componentStack:s}}),FallbackComponent:b.A,children:[(0,u.jsxs)("div",{className:"react-table-scroller",children:[(0,u.jsx)(h,{headerGroups:P,tableDescriptionAttributes:S,dynamicAttributesFromDataTable:w,onSortedChange:m,sorted:y,showFilter:v}),C||G?(0,u.jsx)("div",{className:"centered text-center",children:(0,u.jsx)("i",{className:"fa fa-spinner fa-spin"})}):Z.length?Z.map((e=>(0,u.jsx)(j,{row:e,prepareRow:z,onRowClick:N},e.id))):(0,u.jsxs)("div",{className:"centered text-center",children:[(0,u.jsx)("i",{className:"fa fa-exclamation-triangle text-danger"}),(0,u.jsx)("div",{className:"mt-2 text-darkgrey",children:i?"Error loading data: ".concat(i):"no records"})]})]}),k?(0,u.jsx)(x,{page:l,pageSize:o,totalPages:c,onPageChange:g,onPageSizeChange:f,loading:C}):(0,u.jsx)(p,{previousPage:M,pageSize:o,canPreviousPage:T,pageIndex:F.pageIndex,pageOptions:R,gotoPage:$,setPageSize:I,pageCount:L,nextPage:H,canNextPage:D,loading:C})]})}},8188:(e,s,a)=>{a.d(s,{A:()=>n});a(9950);var t=a(4084),r=a(8156),i=a(4414);const n=function(e){let{header:s,subhead:a=" ",height:n,status:l,className:o}=e;return(0,i.jsx)(t.A,{className:"form-status ".concat(o),children:(0,i.jsxs)(r.A,{className:"text-center",style:{height:n},children:[(0,i.jsx)("div",{className:"text-bold",children:s}),(0,i.jsx)("div",{className:"py-4",children:(0,i.jsx)("i",{className:"fa fa-lg ".concat("processing"===l?"fa-spinner fa-spin text-purple":"success"===l?"fa-check-circle text-purple":"fa-exclamation-triangle text-danger")})}),(0,i.jsx)("div",{className:"text-grey",children:a})]})})}},9519:(e,s,a)=>{a.d(s,{A:()=>c});var t=a(9379),r=a(2714),i=a(5553),n=a(3628),l=a(5996),o=a(7596);const c=async e=>{let{auth:s,customer_id:a}=e,c=null;try{var d;return c=await(0,r.A)({endpoint:"getCustomer",method:"POST",payload:{customer_id:a},auth:s}),(0,o.A)({auth:s,customer_id:a,stripe_id:null===(d=c)||void 0===d?void 0:d.stripe_id}),c.error||i.A.update((e=>{var s;e.customer=(0,t.A)((0,t.A)({},c),{},{customer_id:a}),e.hasCard=null===(s=c.stripe_payment_methods)||void 0===s?void 0:s[0]})),c}catch(u){return(0,n.A)({type:"lms data",status:"error",url:l.A.lms_api_url,operation:"getCustomer",request:{customer_id:a},error:{catch:u.toString()},customer_id:a})}}},7596:(e,s,a)=>{a.d(s,{A:()=>c});var t=a(2714),r=a(5553),i=a(3628),n=a(2434),l=a(2696),o=a(5996);const c=async e=>{let{auth:s,customer_id:a,stripe_id:c}=e;try{const e=await(0,t.A)({endpoint:"getPrepaidSubscriptions",method:"POST",payload:{customer_id:a,stripe_id:c},auth:s});return!e.error&&r.A.update((s=>{s.subscriptions={cloud_storage:(0,l.A)(e.cloud_storage||[]),cloud_compute:(0,n.A)(e.cloud_compute||[]),wavelength_compute:(0,n.A)(e.wavelength_compute||[]),local_compute:(0,n.A)(e.local_compute||[])}}))}catch(d){return(0,i.A)({type:"lms data",status:"error",url:o.A.lms_api_url,operation:"getPrepaidSubscriptions",error:{catch:d.toString()}})}}},5269:(e,s,a)=>{a.d(s,{A:()=>t});const t=new(a(6713).il)({})},1440:(e,s,a)=>{a.d(s,{A:()=>t});const t=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase())}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[478],{52:(e,n,a)=>{a.r(n),a.d(n,{default:()=>m});var l=a(9950),s=a(5077),i=a(6713),r=a(4414);const t=(0,l.lazy)((()=>Promise.all([a.e(43),a.e(805),a.e(521)]).then(a.bind(a,958)))),c=(0,l.lazy)((()=>Promise.all([a.e(279),a.e(588)]).then(a.bind(a,1192)))),o=()=>[{element:(0,r.jsx)(t,{}),path:"users/:user_id?",link:"users",label:"users",icon:"users",iconCode:"f0c0"},{element:(0,r.jsx)(c,{}),path:"billing",link:"billing",label:"billing",icon:"credit-card-alt",iconCode:"f283"}];var d=a(8651),h=a(5553),u=a(4979);const m=function(){const e=(0,s.zy)(),{customer_id:n}=(0,s.g)(),a=o(),t=(0,i.O$)(h.A,(e=>{var a,l;return null===(a=e.auth)||void 0===a||null===(l=a.orgs)||void 0===l?void 0:l.find((e=>{var a;return(null===(a=e.customer_id)||void 0===a?void 0:a.toString())===n}))}),[n]),c="owner"===(null===t||void 0===t?void 0:t.status),m=(0,i.O$)(h.A,(e=>{var n;return e.auth&&(null===(n=e.auth)||void 0===n?void 0:n.orgs[0].customer_id)})),p="primary"===n&&"/o/".concat(m).concat(e.pathname.split("primary")[1]).concat(e.search);return c?(0,r.jsxs)("main",{id:"organization",children:[(0,r.jsx)(d.A,{}),(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(u.A,{header:" ",spinner:!0}),children:(0,r.jsxs)(s.BV,{children:[a.map((e=>(0,r.jsx)(s.qh,{path:e.path,element:e.element},e.path))),(0,r.jsx)(s.qh,{path:"*",element:(0,r.jsx)(s.C5,{to:"users",replace:!0})})]})})]}):t?(0,r.jsx)(s.BV,{children:(0,r.jsx)(s.qh,{path:"*",element:(0,r.jsx)(s.C5,{to:"instances",replace:!0})})}):p?(0,r.jsx)(s.BV,{children:(0,r.jsx)(s.qh,{path:"*",element:(0,r.jsx)(s.C5,{to:p,replace:!0})})}):null}},8651:(e,n,a)=>{a.d(n,{A:()=>m});var l=a(9379),s=(a(9950),a(2072)),i=a(8125),r=a(5746),t=a(8547),c=a(5077),o=a(9435),d=a(3150),h=a(3628),u=a(4414);const m=function(e){let{routes:n=[]}=e;const a=(0,c.Zp)(),m=(0,c.zy)(),p=(null===n||void 0===n?void 0:n.find((e=>e.link===m.pathname)))||n[0];return(0,u.jsx)(o.tH,{onError:(e,n)=>(0,h.A)({error:{message:e.message,componentStack:n}}),FallbackComponent:d.A,children:(0,u.jsx)(s.A,{className:"app-subnav",children:p&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.A,{navbar:!0,className:"instance-nav d-none d-md-flex",children:n.map((e=>e.external?(0,u.jsx)("li",{className:"nav-item",children:(0,u.jsxs)("a",{className:"nav-link",href:e.url,target:"_blank",rel:"noreferrer",children:[(0,u.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]})},e.path):(0,u.jsx)(r.A,{children:(0,u.jsxs)(c.k2,{title:e.link,className:"nav-link",to:e.link||e.path,children:[(0,u.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]})},e.path)))}),(0,u.jsx)(i.A,{navbar:!0,className:"d-flex d-md-none",children:(0,u.jsx)(t.Ay,{className:"react-select-container",classNamePrefix:"react-select",width:"200px",onChange:e=>{let{value:n}=e;return a(n)},options:n.filter((e=>e.link!==p.link)).map((e=>({label:(0,u.jsxs)("span",{children:[(0,u.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]}),value:e.link,iconCode:e.iconCode}))),value:(0,l.A)((0,l.A)({},p),{},{value:null===p||void 0===p?void 0:p.link}),defaultValue:null===p||void 0===p?void 0:p.link,isSearchable:!1,isClearable:!1})})]})})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[678],{5203:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Q});var a=s(9950),r=s(7176),n=s(5077),c=s(6713),i=s(9435),o=s(5553),l=s(2072),d=s(8125),u=s(5488),m=s(3452);const x=e=>{o.A.update((t=>{t.orgSearch=e.target.value}))},h=()=>{o.A.update((e=>{e.orgSearch=""}))};var p=s(4414);const g=function(){const e=(0,c.O$)(o.A,(e=>e.orgSearch));return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u.A,{id:"filter_orgs",type:"text",className:"text-center",onChange:x,placeholder:"filter your organizations",value:e||""}),e&&(0,p.jsx)(m.A,{className:"clear-filter",onClick:h,children:(0,p.jsx)("i",{className:"fa fa-times"})})]})};const j=function(){const e=(0,c.O$)(o.A,(e=>e.auth.orgs)),[t,s]=a.useState(!0);return(0,p.jsx)(m.A,{color:"link",className:"btn btn-purple px-4 mx-2",onClick:()=>{o.A.update((a=>{a.auth.orgs=function(e,t){const s=[...e];return t?s.sort(((e,t)=>e.customer_name.localeCompare(t.customer_name))):s.sort(((e,t)=>t.customer_name.localeCompare(e.customer_name))),s}(e,t),s(!t)}))},children:t?(0,p.jsxs)("span",{children:[(0,p.jsx)("i",{className:"fa fa-sort-alpha-up"})," Sort by Name: Ascending"]}):(0,p.jsxs)("span",{children:[(0,p.jsx)("i",{className:"fa fa-sort-alpha-down"})," Sort by Name: Descending"]})})};var f=s(3150),b=s(3628);const A=function(){return(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t}}),FallbackComponent:f.A,children:(0,p.jsx)(l.A,{className:"app-subnav",children:(0,p.jsxs)(d.A,{navbar:!0,children:[(0,p.jsx)("div",{className:"filter-holder",children:(0,p.jsx)(g,{})}),(0,p.jsx)(j,{})]})})})};var v=s(9379),N=s(45),y=s(6114),O=s(4084),_=s(8156),C=s(7348),k=s(2714);const S=async e=>{let{auth:t,customer_id:s,user_id:a,status:r}=e;return(0,k.A)({endpoint:"updateUserOrgs",method:"POST",payload:{customer_id:s,user_id:a,status:r},auth:t})};var w=s(5429),E=s(3304);const z=function(e){let{loading:t,status:s,customer_name:r,setFlipState:n,total_instance_count:c}=e;const i=(0,C.MW)(),o=(0,a.useCallback)((e=>{e.stopPropagation();const t=e.currentTarget.getAttribute("data-action");"delete"===t&&c?i.error("You must remove all instances from an Organization before deleting it."):n(t)}),[c,i,n]);return t?(0,p.jsx)("i",{className:"status-icon fa fa-spinner fa-spin text-purple"}):"accepted"===s?(0,p.jsx)(m.A,{"data-action":"leave",className:"status-icon",color:"link",title:"Leave ".concat(r," organization"),onClick:o,children:(0,p.jsx)("i",{className:"fa fa-times-circle text-purple"})}):"owner"===s?(0,p.jsx)(m.A,{"data-action":"delete",className:"status-icon",color:"link",title:"Delete ".concat(r," organization"),onClick:o,children:(0,p.jsx)("i",{className:"fa fa-trash delete text-purple ".concat(c?"disabled":"")})}):null};const F=function(e){let{customer_name:t,customer_id:s,total_instance_count:l,status:d,setFlipState:u}=e;const x=(0,c.O$)(o.A,(e=>e.auth)),[h,g]=(0,a.useState)(!1),j=(0,n.Zp)(),A=(0,C.MW)(),v=!h&&["owner","accepted"].includes(d),N=async e=>{const t=e.currentTarget.getAttribute("data-status");g(t);const a=await S({auth:x,customer_id:s,user_id:x.user_id,status:t});a.error?(A.error(a.message),g(!1)):(await(0,E.A)(x),"declined"!==t&&g(!1),A.success("Organization ".concat(t," successfully")))};return(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t},customer_id:s}),FallbackComponent:f.A,children:(0,p.jsx)(O.A,{className:"instance ".concat(v?"clickable":""),onClick:async()=>v&&j("/o/".concat(s,"/instances")),children:(0,p.jsxs)(_.A,{children:[(0,p.jsxs)(r.A,{className:"g-0",children:[(0,p.jsx)(y.A,{xs:"10",className:"org-name",children:t}),(0,p.jsx)(y.A,{xs:"2",className:"status-icons text-end",children:(0,p.jsx)(z,{status:d,loading:h,customer_name:t,setFlipState:u,total_instance_count:l})})]}),(0,p.jsxs)("div",{className:"org-status",children:["ORG ID: ",s]}),(0,p.jsx)(w.A,{textClass:"text-bold",label:"ROLE",isReady:!0,value:"accepted"===d?"USER":d.toUpperCase(),bottomDivider:!0}),(0,p.jsx)(w.A,{label:"INSTANCES",isReady:!0,value:l||"..."}),(0,p.jsx)("div",{className:"action-buttons",children:"invited"===d&&(0,p.jsxs)(r.A,{className:"g-0",children:[(0,p.jsx)(y.A,{xs:"6",className:"pe-1",children:(0,p.jsx)(m.A,{title:"Decline invitation to ".concat(t," organization"),disabled:!!h,color:"danger",block:!0,"data-status":"declined",onClick:N,children:"declined"===h?(0,p.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,p.jsx)("span",{children:"Decline"})})}),(0,p.jsx)(y.A,{xs:"6",className:"ps-1",children:(0,p.jsx)(m.A,{title:"Accept invitation to ".concat(t," organization"),disabled:!!h,color:"success",block:!0,"data-status":"accepted",onClick:N,children:"accepted"===h?(0,p.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,p.jsx)("span",{children:"Join"})})})]})})]})})})};var T=s(9163),M=s.n(T);const D=function(e){var t;let{customer_id:s,customer_name:n,setFlipState:l,flipState:d}=e;const x=(0,C.MW)(),h=(0,c.O$)(o.A,(e=>e.auth)),[g,j]=(0,a.useState)({}),[A,v]=(0,a.useState)({});return M()((async()=>{const{submitted:e}=g;if(e){const{delete_customer_name:e}=A;if(n.toString()!==(null===e||void 0===e?void 0:e.toString()))j({error:"organization name is not correct"});else{const e=await S({auth:h,customer_id:s,user_id:h.user_id,status:"removed"});e.error?x.error(e.message):(await(0,E.A)(h),x.success("Organization removed from your profile successfully"))}}}),[g]),(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t},customer_id:s}),FallbackComponent:f.A,children:(0,p.jsx)(O.A,{className:"instance",children:d&&(0,p.jsxs)(_.A,{children:[(0,p.jsxs)("ul",{className:"text-small my-0 text-nowrap",children:[(0,p.jsxs)("li",{children:[(0,p.jsx)("b",{children:"YOU"})," will be removed from the org."]}),(0,p.jsxs)("li",{children:[(0,p.jsx)("b",{children:"THE ORG"})," will not be removed."]})]}),(0,p.jsx)(u.A,{id:"customer_name",onChange:e=>v({delete_customer_name:e.target.value}),type:"text",title:"customer name",className:"my-3",placeholder:'Enter "'.concat(n,'" here to confirm.'),value:A.customer_name}),(0,p.jsxs)(r.A,{children:[(0,p.jsx)(y.A,{children:(0,p.jsx)(m.A,{onClick:()=>l(!1),title:"Cancel",block:!0,disabled:g.submitted,color:"grey",children:"Cancel"})}),(0,p.jsx)(y.A,{children:(0,p.jsx)(m.A,{onClick:()=>j({submitted:!0}),title:"Confirm Organization Details",block:!0,disabled:g.submitted||(null===n||void 0===n?void 0:n.toString())!==(null===(t=A.delete_customer_name)||void 0===t?void 0:t.toString()),color:"danger",children:g.submitted?(0,p.jsx)("i",{className:"fa fa-spinner fa-spin"}):(0,p.jsx)("span",{children:"Do It"})})})]})]})})})};const H=function(e){var t;let{customer_id:s,customer_name:n,setFlipState:l,flipState:d}=e;const x=(0,C.MW)(),h=(0,c.O$)(o.A,(e=>e.auth)),[g,j]=(0,a.useState)({}),[A,v]=(0,a.useState)({});return M()((async()=>{const{submitted:e}=g;if(e){const{delete_customer_name:e}=A;if(n.toString()!==(null===e||void 0===e?void 0:e.toString()))j({error:"organization name is not correct"});else{const e=await(async e=>{let{auth:t,user_id:s,customer_id:a}=e;return(0,k.A)({endpoint:"removeOrg",method:"POST",payload:{user_id:s,customer_id:a},auth:t})})({auth:h,customer_id:s.toString(),user_id:h.user_id});e.error?j({error:e.message}):(await(0,E.A)(h),x.success("Organization removed successfully"))}}}),[g]),(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t},customer_id:s}),FallbackComponent:f.A,children:(0,p.jsx)(O.A,{className:"instance",children:d&&(0,p.jsx)(_.A,{children:g.error?(0,p.jsxs)(p.Fragment,{children:["There was an error processing your request:",(0,p.jsx)("hr",{className:"mt-3 mb-2"}),(0,p.jsx)("div",{className:"text-danger text-small",children:g.error}),(0,p.jsx)("hr",{className:"mt-2 mb-3"}),(0,p.jsx)(m.A,{onClick:()=>l(!1),title:"Cancel",block:!0,disabled:g.submitted,color:"grey",children:"Cancel"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("ul",{className:"text-small text-nowrap my-0",children:[(0,p.jsxs)("li",{children:[(0,p.jsx)("b",{children:"INSTANCES"})," must first be removed."]}),(0,p.jsxs)("li",{children:[(0,p.jsx)("b",{children:"USERS"})," will no longer see this org."]})]}),(0,p.jsx)(u.A,{id:"customer_name",onChange:e=>v({delete_customer_name:e.target.value}),type:"text",title:"customer name",className:"my-3",placeholder:'Enter "'.concat(n,'" here to confirm.'),value:A.customer_name}),(0,p.jsxs)(r.A,{children:[(0,p.jsx)(y.A,{children:(0,p.jsx)(m.A,{onClick:()=>l(!1),title:"Cancel",block:!0,disabled:g.submitted,color:"grey",children:"Cancel"})}),(0,p.jsx)(y.A,{children:(0,p.jsx)(m.A,{id:"deleteOrganization",onClick:()=>j({submitted:!0}),title:"Confirm Organization Details",block:!0,disabled:g.submitted||(null===n||void 0===n?void 0:n.toString())!==(null===(t=A.delete_customer_name)||void 0===t?void 0:t.toString()),color:"danger",children:g.submitted?(0,p.jsx)("i",{className:"fa fa-spinner fa-spin"}):(0,p.jsx)("span",{children:"Do It"})})})]})]})})})})};const I=function(e){return"leave"===e.flipState?(0,p.jsx)(D,(0,v.A)({},e)):(0,p.jsx)(H,(0,v.A)({},e))};var P=s(1852);const U=["flippedCard","setFlippedCard","customer_id"];const $=function(e){let{flippedCard:t,setFlippedCard:s,customer_id:r}=e,n=(0,N.A)(e,U);const[c,o]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{t!==r&&o(!1)}),[t]),(0,a.useEffect)((()=>{c&&s(r)}),[c]),(0,p.jsx)(y.A,{xs:"12",md:"6",lg:"4",xl:"3",className:"mb-4",children:(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t},customer_id:r}),FallbackComponent:P.A,children:c?(0,p.jsx)(I,(0,v.A)({setFlipState:o,flipState:c,customer_id:r},n)):(0,p.jsx)(F,(0,v.A)({setFlipState:o,flipState:c,customer_id:r},n))})})},R=()=>{const[e,t]=(0,a.useState)(!1);return(0,c.O$)(o.A,(e=>(e=>{let{orgSearch:t,orgs:s}=e;if(!s)return[];const a=((e,t)=>{const s={};return e.filter((e=>!s[e[t]]&&(s[e[t]]=!0,!0)))})(s,"customer_id");return t&&""!==t?a.filter((e=>e.customer_name&&-1!==e.customer_name.toLowerCase().indexOf(t.toLowerCase()))):a})({orgSearch:e.orgSearch,orgs:e.auth.orgs}))).map((s=>(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t}}),FallbackComponent:P.A,children:(0,p.jsx)($,(0,v.A)((0,v.A)({},s),{},{flippedCard:e,setFlippedCard:t}))},s.customer_id)))};const q=function(){const e=(0,n.Zp)(),t=()=>{window._kmq&&window._kmq.push(["record","clicked new org card"]),e("/organizations/new")};return(0,p.jsx)(y.A,{xs:"12",md:"6",lg:"4",xl:"3",className:"mb-4",children:(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t}}),FallbackComponent:f.A,children:(0,p.jsx)(O.A,{tabIndex:"0",id:"newOrgCard",title:"Add New Organization",className:"instance new",onKeyDown:e=>13!==e.keyCode||t(),onClick:t,children:(0,p.jsxs)(_.A,{className:"d-flex flex-column align-items-center justify-content-center",children:[(0,p.jsx)("span",{children:"Create A New Organization"}),(0,p.jsx)("div",{className:"my-4",children:(0,p.jsx)("i",{className:"fa fa-2x fa-plus-circle new-org-plus"})}),(0,p.jsx)("span",{children:"With Its Own Instances And Billing"})]})})})})};var L=s(6685),W=s(877),Y=s(1340),Z=s(1652);var B=s(4701);const G=async e=>{let{formData:t,auth:s}=e;const{org:a,subdomain:r}=t;if(!a||!r)return{error:"All fields must be filled out"};if(!(0,B.A)(r))return{error:"subdomain: alphanumeric characters only"};if(r.length>16)return{error:"subdomain: max 16 characters"};const n=await(async e=>{let{auth:t,org:s,subdomain:a}=e;return(0,k.A)({endpoint:"addOrg",method:"POST",auth:t,payload:{org:s,subdomain:a,user_id:t.user_id}})})({auth:s,org:a,subdomain:r});return n.error?{error:n.message.replace("Bad request: ","").replace(/['"]+/g,"")}:{success:!0}};const J=function(){const e=(0,c.O$)(o.A,(e=>e.auth)),t=(0,c.O$)(o.A,(e=>e.theme)),s=(0,n.Zp)(),[l,d]=(0,a.useState)({}),[x,h]=(0,a.useState)({}),[g,j]=(0,a.useState)(!1),A=()=>s("/organizations");return M()((async()=>{if(x.submitted){j(!1);const t=await G({formData:l,auth:e});h(t),t.error||(await(0,E.A)(e),A())}}),[x]),(0,a.useEffect)((()=>{x.submitted||h({})}),[l]),(0,p.jsx)(L.A,{id:"new-org-modal",isOpen:!0,className:t,centered:!0,fade:!1,children:(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t}}),FallbackComponent:f.A,children:e.email_bounced?(0,p.jsx)(W.A,{children:(0,p.jsx)(O.A,{children:(0,p.jsxs)(_.A,{children:[(0,p.jsxs)("div",{className:"p-4 pb-0 text-center",children:[(0,p.jsx)("b",{children:"Unable to Create New Organization"}),(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),"Your email address seems to be unreachable. Please update it to ensure billing, upgrade, and other critical system announcements reach you."]}),(0,p.jsxs)(r.A,{children:[(0,p.jsx)(y.A,{sm:"6",children:(0,p.jsx)(m.A,{id:"cancelNewOrg",onClick:()=>s("/organizations"),title:"Cancel New Org",block:!0,className:"mt-3",color:"grey",children:"Cancel"})}),(0,p.jsx)(y.A,{sm:"6",children:(0,p.jsx)(m.A,{id:"updateEmail",onClick:()=>s("/profile"),title:"Update My Email",block:!0,className:"mt-3",color:"danger",children:"Update My Email"})})]})]})})}):x.submitted?(0,p.jsx)(W.A,{children:(0,p.jsx)(O.A,{children:(0,p.jsx)(_.A,{children:(0,p.jsxs)("div",{className:"p-4 text-center",children:[(0,p.jsx)("b",{children:"Creating Your Organization"}),(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),(0,p.jsx)("i",{className:"fa fa-lg fa-spinner fa-spin text-purple mb-4"}),(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),"The Organization Otterhound is fetching your stuff."]})})})}):x.success?(0,p.jsx)(W.A,{children:(0,p.jsx)(O.A,{children:(0,p.jsx)(_.A,{children:(0,p.jsxs)("div",{className:"p-4 text-center",children:[(0,p.jsx)("b",{children:"Success"}),(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),(0,p.jsx)("i",{className:"fa fa-lg fa-thumbs-up text-purple mb-4"}),(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),"Your organization was created successfully."]})})})}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Y.A,{toggle:A,children:"Add New Organization"}),(0,p.jsxs)(W.A,{children:[(0,p.jsx)(O.A,{className:"mb-3",children:(0,p.jsxs)(_.A,{children:[(0,p.jsx)(Z.A,{header:"Name",children:(0,p.jsxs)(r.A,{children:[(0,p.jsx)(y.A,{sm:"4",className:"pt-2 text-nowrap text-grey",children:'Ex: "My Org"'}),(0,p.jsx)(y.A,{sm:"8",children:(0,p.jsx)(u.A,{id:"org_name",className:"text-center",onChange:e=>d((0,v.A)((0,v.A)({},l),{},{org:e.target.value})),type:"text",title:"name",value:l.org||""})})]})}),(0,p.jsxs)(Z.A,{header:"Subdomain",subheader:"alphanumeric only. 16 char max.",children:[(0,p.jsxs)(r.A,{children:[(0,p.jsxs)(y.A,{sm:"4",className:"pt-2 text-nowrap text-grey",children:['Ex: "myorg"\xa0',(0,p.jsx)(m.A,{color:"link",title:"Learn more",onClick:()=>j(!g),children:(0,p.jsx)("i",{className:"fa fa-question-circle text-purple"})})]}),(0,p.jsx)(y.A,{sm:"8",children:(0,p.jsx)(u.A,{id:"subdomain",className:"text-center",type:"text",title:"subdomain",value:l.subdomain||"",disabled:x.submitted,onChange:e=>d((0,v.A)((0,v.A)({},l),{},{subdomain:e.target.value.substring(0,15).toLowerCase()}))})})]}),g&&(0,p.jsx)("div",{className:"text-center pt-2 pb-1 text-lightpurple text-small",children:(0,p.jsx)("i",{children:"Part of the URL of your Harper Cloud Instances- see below."})}),(0,p.jsx)("hr",{className:"my-2 d-none d-sm-block"}),(0,p.jsx)(r.A,{children:(0,p.jsx)(y.A,{xs:"12",className:"pt-2 text-center text-nowrap overflow-hidden text-truncate",children:l.subdomain?(0,p.jsxs)("i",{className:"text-grey",children:["INSTANCE_NAME-",l.subdomain,".harperdbcloud.com"]}):(0,p.jsx)("span",{className:"text-lightgrey",children:"INSTANCE_NAME-SUBDOMAIN.harperdbcloud.com"})})})]})]})}),(0,p.jsx)(m.A,{id:"createOrganization",onClick:()=>h({submitted:!0}),title:"Create Organization",block:!0,className:"mt-3",color:"success",children:"Create Organization"}),x.error&&(0,p.jsx)(O.A,{className:"mt-3 error",children:(0,p.jsx)(_.A,{children:x.error})})]})]})})})};var K=s(4979);const Q=function(){const{list:e,action:t}=(0,n.g)(),s=(0,n.Zp)(),l=(0,c.O$)(o.A,(e=>e.auth));return(0,a.useEffect)((()=>o.A.update((e=>{e.users=!1,e.instances=!1,e.hasCard=!1,e.lastUpdate=!1})))),(0,a.useEffect)((()=>{1!==(null===l||void 0===l?void 0:l.orgs.filter((e=>["accepted","owner"].includes(e.status)))).length||e&&"sign-up"!==e||s("/o/".concat(l.orgs[0].customer_id,"/instances"))}),[l,e]),(0,p.jsxs)("div",{id:"organizations",children:[(0,p.jsx)(A,{}),null!==l&&void 0!==l&&l.orgs?(0,p.jsxs)(r.A,{children:[(0,p.jsx)(i.tH,{onError:(e,t)=>(0,b.A)({error:{message:e.message,componentStack:t}}),FallbackComponent:P.A,children:(0,p.jsx)(q,{})}),(0,p.jsx)(R,{})]}):(0,p.jsx)(K.A,{header:"loading organizations",spinner:!0}),"new"===t&&(0,p.jsx)(J,{})]})}},5429:(e,t,s)=>{s.d(t,{A:()=>c});s(9950);var a=s(7176),r=s(6114),n=s(4414);const c=function(e){let{label:t,value:s,textClass:c="",isReady:i,bottomDivider:o=!1}=e;return(0,n.jsxs)(a.A,{className:"card-front-status-row text-darkgrey",children:[(0,n.jsx)(r.A,{xs:"4",children:t}),(0,n.jsx)(r.A,{xs:"8",className:c,children:i?s:""}),o&&(0,n.jsx)(r.A,{xs:"12",children:(0,n.jsx)("hr",{})})]})}},1652:(e,t,s)=>{s.d(t,{A:()=>r});s(9950);var a=s(4414);const r=function(e){let{children:t,header:s,subheader:r,maxHeight:n="auto",minHeight:c="auto",className:i}=e;return(0,a.jsxs)("div",{className:"content-container ".concat(i),children:[(0,a.jsxs)("div",{className:"header-container",children:[(0,a.jsx)("span",{className:"header",children:s}),(0,a.jsx)("span",{className:"subheader",children:r})]}),(0,a.jsx)("div",{className:"auto"!==n?"scrollable":"",style:{maxHeight:n,minHeight:c},children:t})]})}},1852:(e,t,s)=>{s.d(t,{A:()=>c});var a=s(9379),r=(s(9950),s(3150)),n=s(4414);const c=function(e){return(0,n.jsx)(r.A,(0,a.A)((0,a.A)({},e),{},{extraClass:"entity-card"}))}},4701:(e,t,s)=>{s.d(t,{A:()=>a});const a=e=>e.match(/^[a-z0-9]+$/i)},8125:(e,t,s)=>{s.d(t,{A:()=>h});var a=s(9950),r=s(1942),n=s.n(r),c=s(8738),i=s.n(c),o=s(1497),l=["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},d.apply(this,arguments)}function u(e,t){if(null==e)return{};var s,a,r=function(e,t){if(null==e)return{};var s,a,r={},n=Object.keys(e);for(a=0;a<n.length;a++)s=n[a],t.indexOf(s)>=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)s=n[a],t.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var m={card:n().bool,className:n().string,cssModule:n().object,fill:n().bool,horizontal:n().oneOf(["center","end"]),justified:n().bool,navbar:n().bool,pills:n().bool,tabs:n().bool,tag:o.Wx,vertical:n().oneOfType([n().bool,n().string])};function x(e){var t=e.className,s=e.cssModule,r=e.tabs,n=e.pills,c=e.vertical,m=void 0!==c&&c,x=e.horizontal,h=e.justified,p=e.fill,g=e.navbar,j=e.card,f=e.tag,b=void 0===f?"ul":f,A=u(e,l),v=(0,o.qO)(i()(t,g?"navbar-nav":"nav",!!x&&"justify-content-".concat(x),function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-".concat(e,"-column"))}(m),{"nav-tabs":r,"card-header-tabs":j&&r,"nav-pills":n,"card-header-pills":j&&n,"nav-justified":h,"nav-fill":p}),s);return a.createElement(b,d({},A,{className:v}))}x.propTypes=m;const h=x},2072:(e,t,s)=>{s.d(t,{A:()=>p});var a=s(9950),r=s(1942),n=s.n(r),c=s(8738),i=s.n(c),o=s(1497),l=["expand","className","cssModule","light","dark","fixed","sticky","color","container","tag","children"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},d.apply(this,arguments)}function u(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function m(e,t){if(null==e)return{};var s,a,r=function(e,t){if(null==e)return{};var s,a,r={},n=Object.keys(e);for(a=0;a<n.length;a++)s=n[a],t.indexOf(s)>=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)s=n[a],t.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var x={children:n().node,className:n().string,color:n().string,container:n().oneOfType([n().bool,n().string]),cssModule:n().object,dark:n().bool,expand:n().oneOfType([n().bool,n().string]),fixed:n().string,light:n().bool,role:n().string,sticky:n().string,tag:o.Wx};function h(e){var t,s=e.expand,r=void 0!==s&&s,n=e.className,c=e.cssModule,x=e.light,h=e.dark,p=e.fixed,g=e.sticky,j=e.color,f=e.container,b=void 0===f?"fluid":f,A=e.tag,v=void 0===A?"nav":A,N=e.children,y=m(e,l),O=(0,o.qO)(i()(n,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-".concat(e))}(r),(u(t={"navbar-light":x,"navbar-dark":h},"bg-".concat(j),j),u(t,"fixed-".concat(p),p),u(t,"sticky-".concat(g),g),t)),c),_=b&&!0===b?"container":"container-".concat(b);return a.createElement(v,d({},y,{className:O}),b?a.createElement("div",{className:_},N):N)}h.propTypes=x;const p=h},9163:(e,t,s)=>{var a=s(9950);function r(e,t,s){var r="function"===typeof t;a.useEffect((function(){var s,a=!0,n=e((function(){return a}));return Promise.resolve(n).then((function(e){s=e})),function(){a=!1,r&&t(s)}}),r?s:t)}e.exports=r,e.exports.useAsyncEffect=r}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[138],{4244:(e,s,t)=>{t.r(s),t.d(s,{default:()=>d});var r=t(9950),a=t(5077),n=t(4414);const o=(0,r.lazy)((()=>Promise.all([t.e(11),t.e(138)]).then(t.bind(t,2670)))),i=[{element:(0,n.jsx)(o,{}),path:"",link:"profile",label:"profile",icon:"user",iconCode:"f007"}];var l=t(8651),c=t(4979);const d=function(){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.A,{}),(0,n.jsx)(r.Suspense,{fallback:(0,n.jsx)(c.A,{header:" ",spinner:!0}),children:(0,n.jsxs)(a.BV,{children:[i.map((e=>(0,n.jsx)(a.qh,{path:e.path,element:e.element},e.path))),(0,n.jsx)(a.qh,{path:"*",element:(0,n.jsx)(a.C5,{to:"/profile",replace:!0})},"*")]})})]})}},2670:(e,s,t)=>{t.r(s),t.d(s,{default:()=>_});var r=t(9950),a=t(7176),n=t(6114),o=t(9379),i=t(4084),l=t(8156),c=t(5488),d=t(3452),u=t(6713),p=t(9435),m=t(5553),h=t(2714),f=t(3628),x=t(5996),b=t(3304);var g=t(8188),j=t(3150),A=t(2773),v=t(4414);const y=function(){const e=(0,u.O$)(m.A,(e=>e.auth)),[s,t]=(0,r.useState)({}),[y,w]=(0,r.useState)(e),N="314px";return(0,r.useEffect)((()=>{let s=!0;return s&&null!==e&&void 0!==e&&e.profileError?t({error:e.message}):s&&null!==e&&void 0!==e&&e.profileSuccess&&t({success:e.message}),()=>{s=!1}}),[e.profileError,e.profileSuccess]),(0,r.useEffect)((()=>{let e=!0;return(s.error||s.success)&&setTimeout((()=>{e&&t({})}),2e3),()=>{e=!1}}),[s.error,s.success]),(0,v.jsx)(p.tH,{onError:(e,s)=>(0,f.A)({error:{message:e.message,componentStack:s}}),FallbackComponent:j.A,children:(0,v.jsx)("div",{className:"my-3",children:s.processing?(0,v.jsx)(g.A,{height:N,status:"processing",header:"Updating Profile",subhead:"The Profile Poodle is doing his thing."}):s.success?(0,v.jsx)(g.A,{height:N,status:"success",header:"Success!",subhead:s.success}):s.error?(0,v.jsx)(g.A,{height:N,status:"error",header:s.error,subhead:"Please try again"}):(0,v.jsx)(i.A,{className:"mb-3",children:(0,v.jsxs)(l.A,{children:[(0,v.jsxs)(a.A,{children:[(0,v.jsx)(n.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:null===e||void 0===e||!e.email_bounced||null!==e&&void 0!==e&&e.profileSuccess?(0,v.jsx)("span",{children:e.email}):(0,v.jsx)("span",{className:"text-danger",children:"please provide a valid email address"})}),(0,v.jsx)(n.A,{md:"6",xs:"12",children:(0,v.jsx)(c.A,{id:"email",type:"text",className:"mb-0 text-center ".concat(null===e||void 0===e||!e.email_bounced||null!==e&&void 0!==e&&e.profileSuccess?"":"error"),name:"email",placeholder:"email address",onChange:e=>w((0,o.A)((0,o.A)({},y),{},{email:e.target.value})),value:y.email||"",disabled:s.submitted})}),(0,v.jsx)(n.A,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"first name"}),(0,v.jsx)(n.A,{md:"6",xs:"12",children:(0,v.jsx)(c.A,{id:"firstname",type:"text",className:"mb-0 text-center",name:"fname",placeholder:"first name",onChange:e=>w((0,o.A)((0,o.A)({},y),{},{firstname:e.target.value})),value:y.firstname||"",disabled:s.submitted})}),(0,v.jsx)(n.A,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"last name"}),(0,v.jsx)(n.A,{md:"6",xs:"12",children:(0,v.jsx)(c.A,{id:"lastname",type:"text",className:"mb-0 text-center",name:"lname",placeholder:"last name",onChange:e=>w((0,o.A)((0,o.A)({},y),{},{lastname:e.target.value})),value:y.lastname||"",disabled:s.submitted})}),(0,v.jsx)(n.A,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"github repo"}),(0,v.jsx)(n.A,{md:"6",xs:"12",children:(0,v.jsx)(c.A,{id:"github_repo",type:"text",className:"mb-0 text-center",name:"github_repo",placeholder:"github repo",onChange:e=>w((0,o.A)((0,o.A)({},y),{},{github_repo:e.target.value})),value:y.github_repo||"",disabled:s.submitted})})]}),(0,v.jsx)("hr",{className:"mt-2 mb-4"}),(0,v.jsx)(d.A,{id:"saveProfile",color:"purple",block:!0,onClick:()=>{t({submitted:!0});const{firstname:s,lastname:r,github_repo:a,email:n}=y;s&&r&&n?a&&!(0,A.A)(a)?t({error:"github repo must be a valid URL"}):e.firstname===s&&e.lastname===r&&e.github_repo===a&&e.email===n?t({error:"Nothing seems to have changed"}):(t({processing:!0}),(async e=>{let{auth:s,firstname:t,lastname:r,customer_id:a,user_id:n,github_repo:i,email:l}=e,c=null;try{return c=await(0,h.A)({endpoint:"updateUser",method:"POST",payload:{firstname:t,lastname:r,customer_id:a,user_id:n,github_repo:i,email:l},auth:s}),c.error?m.A.update((e=>{e.auth=(0,o.A)((0,o.A)((0,o.A)({},s),c),{},{profileError:Date.now()})})):(m.A.update((e=>{e.auth=(0,o.A)((0,o.A)({},s),{},{profileSuccess:Date.now()},c)})),(0,b.A)({email:l,pass:s.pass,loggingIn:!0}))}catch(d){return(0,f.A)({type:"lms data",status:"error",url:x.A.lms_api_url,operation:"updateUser",request:{firstname:t,lastname:r,customer_id:a,user_id:n,github_repo:i},error:{catch:d.toString()},customer_id:a})}})({auth:e,firstname:s,lastname:r,user_id:e.user_id,github_repo:a,email:n})):t({error:"All fields are required"})},disabled:s.submitted,children:"Save Profile"})]})})})})};var w=t(4127),N=t(5283);const k=function(){const e=(0,u.O$)(m.A,(e=>e.auth)),[s,t]=(0,N.A)({}),[h,x]=(0,r.useState)({}),[b,A]=(0,r.useState)({}),y="259px";return(0,r.useEffect)((()=>{let e=!0;return(h.error||h.success)&&setTimeout((()=>{e&&x({})}),2e3),()=>{e=!1}}),[h.error,h.success]),(0,v.jsx)(p.tH,{onError:(e,s)=>(0,f.A)({error:{message:e.message,componentStack:s}}),FallbackComponent:j.A,children:(0,v.jsx)("div",{className:"my-3",children:h.processing?(0,v.jsx)(g.A,{height:y,status:"processing",header:"Updating Password",subhead:"The Security Shepherd is mad-hashing."}):h.success?(0,v.jsx)(g.A,{height:y,status:"success",header:"Success!",subhead:h.success}):h.error?(0,v.jsx)(g.A,{height:y,status:"error",header:h.error,subhead:"Please try again"}):(0,v.jsx)(i.A,{children:(0,v.jsxs)(l.A,{children:[(0,v.jsxs)(a.A,{children:[(0,v.jsx)(n.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"current password"}),(0,v.jsx)(n.A,{md:"6",xs:"12",children:(0,v.jsx)(c.A,{id:"oldpassword",type:"password",className:"mb-0 text-center",name:"current password",placeholder:"current password",onChange:e=>A((0,o.A)((0,o.A)({},b),{},{oldpassword:e.target.value})),value:b.oldpassword||"",disabled:h.submitted})}),(0,v.jsx)(n.A,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"new password"}),(0,v.jsx)(n.A,{md:"6",xs:"12",children:(0,v.jsx)(c.A,{id:"newpassword1",type:"password",className:"mb-0 text-center",name:"new password",placeholder:"new password",onChange:e=>A((0,o.A)((0,o.A)({},b),{},{newpassword:e.target.value})),value:b.newpassword||"",disabled:h.submitted})}),(0,v.jsx)(n.A,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.A,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"verify password"}),(0,v.jsx)(n.A,{md:"6",xs:"12",children:(0,v.jsx)(c.A,{id:"newpassword2",type:"password",className:"mb-0 text-center",name:"verify password",placeholder:"verify password",onChange:e=>A((0,o.A)((0,o.A)({},b),{},{newpassword2:e.target.value})),value:b.newpassword2||"",disabled:h.submitted})})]}),(0,v.jsx)("hr",{className:"mt-2 mb-4"}),(0,v.jsx)(d.A,{id:"updatePassword",color:"purple",block:!0,onClick:async()=>{x({submitted:!0});const{oldpassword:r,newpassword:a,newpassword2:n}=b;if(r!==e.pass)x({error:"old password is incorrect"}),A({});else if(a!==n)x({error:"new passwords do not match"}),A({});else if(r&&a&&n){x({processing:!0});const r=await(0,w.A)({auth:e,user_id:e.user_id,password:a});!r||r.passwordError?x({error:e.message}):(t((0,o.A)((0,o.A)({},s),{},{pass:a})),x({success:e.message}),A({}))}else x({error:"all fields are required"}),A({})},disabled:h.submitted,children:"Update Password"})]})})})})};const _=function(){return(0,v.jsxs)(a.A,{children:[(0,v.jsxs)(n.A,{md:"6",className:"mb-4",children:[(0,v.jsx)("span",{className:"floating-card-header",children:"profile"}),(0,v.jsx)(y,{})]}),(0,v.jsxs)(n.A,{md:"6",className:"mb-4",children:[(0,v.jsx)("span",{className:"floating-card-header",children:"password"}),(0,v.jsx)(k,{})]})]})}},8188:(e,s,t)=>{t.d(s,{A:()=>o});t(9950);var r=t(4084),a=t(8156),n=t(4414);const o=function(e){let{header:s,subhead:t=" ",height:o,status:i,className:l}=e;return(0,n.jsx)(r.A,{className:"form-status ".concat(l),children:(0,n.jsxs)(a.A,{className:"text-center",style:{height:o},children:[(0,n.jsx)("div",{className:"text-bold",children:s}),(0,n.jsx)("div",{className:"py-4",children:(0,n.jsx)("i",{className:"fa fa-lg ".concat("processing"===i?"fa-spinner fa-spin text-purple":"success"===i?"fa-check-circle text-purple":"fa-exclamation-triangle text-danger")})}),(0,n.jsx)("div",{className:"text-grey",children:t})]})})}},8651:(e,s,t)=>{t.d(s,{A:()=>m});var r=t(9379),a=(t(9950),t(2072)),n=t(8125),o=t(5746),i=t(8547),l=t(5077),c=t(9435),d=t(3150),u=t(3628),p=t(4414);const m=function(e){let{routes:s=[]}=e;const t=(0,l.Zp)(),m=(0,l.zy)(),h=(null===s||void 0===s?void 0:s.find((e=>e.link===m.pathname)))||s[0];return(0,p.jsx)(c.tH,{onError:(e,s)=>(0,u.A)({error:{message:e.message,componentStack:s}}),FallbackComponent:d.A,children:(0,p.jsx)(a.A,{className:"app-subnav",children:h&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n.A,{navbar:!0,className:"instance-nav d-none d-md-flex",children:s.map((e=>e.external?(0,p.jsx)("li",{className:"nav-item",children:(0,p.jsxs)("a",{className:"nav-link",href:e.url,target:"_blank",rel:"noreferrer",children:[(0,p.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]})},e.path):(0,p.jsx)(o.A,{children:(0,p.jsxs)(l.k2,{title:e.link,className:"nav-link",to:e.link||e.path,children:[(0,p.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]})},e.path)))}),(0,p.jsx)(n.A,{navbar:!0,className:"d-flex d-md-none",children:(0,p.jsx)(i.Ay,{className:"react-select-container",classNamePrefix:"react-select",width:"200px",onChange:e=>{let{value:s}=e;return t(s)},options:s.filter((e=>e.link!==h.link)).map((e=>({label:(0,p.jsxs)("span",{children:[(0,p.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]}),value:e.link,iconCode:e.iconCode}))),value:(0,r.A)((0,r.A)({},h),{},{value:null===h||void 0===h?void 0:h.link}),defaultValue:null===h||void 0===h?void 0:h.link,isSearchable:!1,isClearable:!1})})]})})})}},4127:(e,s,t)=>{t.d(s,{A:()=>l});var r=t(9379),a=t(2714),n=t(5553),o=t(3628),i=t(5996);const l=async e=>{let{auth:s,user_id:t,password:l}=e,c=null;try{if(c=await(0,a.A)({endpoint:"updatePassword",method:"POST",payload:{user_id:t,password:l,loggingIn:!0},auth:s}),c.error){const e=(0,r.A)((0,r.A)((0,r.A)({},s),c),{},{passwordError:Date.now()});return n.A.update((s=>{s.auth=e})),e}const e=(0,r.A)((0,r.A)((0,r.A)({},s),{},{passwordSuccess:Date.now(),update_password:!1},c),{},{pass:l});return n.A.update((s=>{s.auth=e})),e}catch(d){return(0,o.A)({type:"lms data",status:"error",url:i.A.lms_api_url,operation:"updatePassword",request:{user_id:t},error:{catch:d.toString()}})}}},2773:(e,s,t)=>{t.d(s,{A:()=>r});const r=e=>!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)},5488:(e,s,t)=>{t.d(s,{A:()=>A});var r=t(9950),a=t(1942),n=t.n(a),o=t(8738),i=t.n(o),l=t(1497);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}var d=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function u(){return u=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},u.apply(this,arguments)}function p(e,s){if(null==e)return{};var t,r,a=function(e,s){if(null==e)return{};var t,r,a={},n=Object.keys(e);for(r=0;r<n.length;r++)t=n[r],s.indexOf(t)>=0||(a[t]=e[t]);return a}(e,s);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)t=n[r],s.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function m(e,s){for(var t=0;t<s.length;t++){var r=s[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,s){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,s){return e.__proto__=s,e},h(e,s)}function f(e){var s=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,r=b(e);if(s){var a=b(this).constructor;t=Reflect.construct(r,arguments,a)}else t=r.apply(this,arguments);return function(e,s){if(s&&("object"===c(s)||"function"===typeof s))return s;if(void 0!==s)throw new TypeError("Derived constructors may only return object or undefined");return x(e)}(this,t)}}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var g={children:n().node,type:n().string,size:n().oneOfType([n().number,n().string]),bsSize:n().string,valid:n().bool,invalid:n().bool,tag:l.Wx,innerRef:n().oneOfType([n().object,n().func,n().string]),plaintext:n().bool,addon:n().bool,className:n().string,cssModule:n().object},j=function(e){!function(e,s){if("function"!==typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(s&&s.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),s&&h(e,s)}(o,e);var s,t,a,n=f(o);function o(e){var s;return function(e,s){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this,o),(s=n.call(this,e)).getRef=s.getRef.bind(x(s)),s.focus=s.focus.bind(x(s)),s}return s=o,(t=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var e=this.props,s=e.className,t=e.cssModule,a=e.type,n=void 0===a?"text":a,o=e.bsSize,c=e.valid,m=e.invalid,h=e.tag,f=e.addon,x=e.plaintext,b=e.innerRef,g=p(e,d),j=["switch","radio","checkbox"].indexOf(n)>-1,A="select"===n,v="range"===n,y=h||(A||"textarea"===n?n:"input"),w="form-control";x?(w="".concat(w,"-plaintext"),y=h||"input"):v?w="form-range":A?w="form-select":j&&(w=f?null:"form-check-input"),g.size&&/\D/g.test(g.size)&&((0,l.mc)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),o=g.size,delete g.size);var N=(0,l.qO)(i()(s,m&&"is-invalid",c&&"is-valid",!!o&&(A?"form-select-".concat(o):"form-control-".concat(o)),w),t);return("input"===y||h&&"function"===typeof h)&&(g.type="switch"===n?"checkbox":n),g.children&&!x&&"select"!==n&&"string"===typeof y&&"select"!==y&&((0,l.mc)('Input with a type of "'.concat(n,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete g.children),r.createElement(y,u({},g,{ref:b,className:N,"aria-invalid":m}))}}])&&m(s.prototype,t),a&&m(s,a),Object.defineProperty(s,"prototype",{writable:!1}),o}(r.Component);j.propTypes=g;const A=j}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[75],{3550:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var r=n(9379),o=n(9950),i=n(9708),c=n(1646),s=n(5488),a=n(3452),l=n(9163),u=n.n(l),f=n(5077),p=n(1440),d=n(2714);var b=n(4979),y=n(4414);const m=function(){const[e,t]=(0,o.useState)({}),[n,l]=(0,o.useState)({});return u()((async()=>{const{submitted:r,processing:o}=e;let i;if(r&&!o){const{email:e}=n;if((0,p.A)(e)){t({processing:!0});const n=await(async e=>{let{email:t,login_domain:n=window.location.host}=e;return(0,d.A)({endpoint:"resetPassword",method:"POST",payload:{email:t,login_domain:n}})})({email:e});n.error&&"User does not exist"!==n.message?(t({error:n.message}),i=setTimeout((()=>t({})),5e3)):t({success:!0})}else t({error:"A valid email is required"}),i=setTimeout((()=>t({})),5e3)}return()=>{clearTimeout(i)}}),[e]),u()((()=>{e.submitted||t({})}),[n]),(0,y.jsx)("div",{className:"login-form",children:e.processing?(0,y.jsx)(b.A,{header:"Resetting password",spinner:!0,relative:!0}):e.success?(0,y.jsx)(b.A,{header:"success!",body:"Check the provided email for a temporary password.",links:[{to:"/",text:"Go to Sign In",className:"text-center"}],relative:!0}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(i.A,{children:[(0,y.jsx)("h2",{className:"mb-2 instructions",children:"Enter your account email"}),(0,y.jsx)("span",{className:"mb-2 d-inline-block",children:"If a matching account exists, we'll send you a password reset link."}),(0,y.jsx)("span",{className:"login-nav-link error d-inline-block",children:e.error}),(0,y.jsxs)(c.A,{className:"mb-3 d-block",children:[(0,y.jsx)("span",{className:"mb-2 d-inline-block",children:"Email"}),(0,y.jsx)(s.A,{name:"email",autoComplete:"email",required:!0,id:"email",onChange:e=>{e.currentTarget.focus(),l((0,r.A)((0,r.A)({},n),{},{email:e.target.value.trim().toLowerCase()}))},value:n.email||"",disabled:e.submitted,type:"text",title:"email",placeholder:"email address"})]}),(0,y.jsx)(a.A,{id:"sendPasswordResetEmail",onClick:()=>t({submitted:!0}),disabled:e.submitted,className:"border-0 rounded-pill btn-gradient-blue",title:"Send Password Reset Email",block:!0,type:"submit",color:"purple",children:"Send Password Reset Email"})]}),(0,y.jsxs)("div",{className:"px-4 mt-3 d-flex justify-content-between",children:[(0,y.jsx)(f.k2,{to:"/",className:"login-nav-link d-inline-block",children:"Back to Sign In"}),(0,y.jsx)(f.k2,{to:"/sign-up",className:"login-nav-link d-inline-block",children:"Sign Up for Free"})]})]})})}},1440:(e,t,n)=>{n.d(t,{A:()=>r});const r=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase())},9708:(e,t,n)=>{n.d(t,{A:()=>v});var r=n(9950),o=n(1942),i=n.n(o),c=n(1497);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var a=["className","cssModule","tag","innerRef"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function d(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}(this,n)}}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}var m={children:i().node,tag:c.Wx,innerRef:i().oneOfType([i().object,i().func,i().string]),className:i().string,cssModule:i().object},h=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(s,e);var t,n,o,i=d(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=i.call(this,e)).getRef=t.getRef.bind(b(t)),t.submit=t.submit.bind(b(t)),t}return t=s,(n=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"submit",value:function(){this.ref&&this.ref.submit()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.cssModule,o=e.tag,i=void 0===o?"form":o,s=e.innerRef,f=u(e,a),p=(0,c.qO)(t,n);return r.createElement(i,l({},f,{ref:s,className:p}))}}])&&f(t.prototype,n),o&&f(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);h.propTypes=m;const v=h},5488:(e,t,n)=>{n.d(t,{A:()=>O});var r=n(9950),o=n(1942),i=n.n(o),c=n(8738),s=n.n(c),a=n(1497);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var u=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function y(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}(this,n)}}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}var v={children:i().node,type:i().string,size:i().oneOfType([i().number,i().string]),bsSize:i().string,valid:i().bool,invalid:i().bool,tag:a.Wx,innerRef:i().oneOfType([i().object,i().func,i().string]),plaintext:i().bool,addon:i().bool,className:i().string,cssModule:i().object},g=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(c,e);var t,n,o,i=y(c);function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=i.call(this,e)).getRef=t.getRef.bind(m(t)),t.focus=t.focus.bind(m(t)),t}return t=c,(n=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.cssModule,o=e.type,i=void 0===o?"text":o,c=e.bsSize,l=e.valid,d=e.invalid,b=e.tag,y=e.addon,m=e.plaintext,h=e.innerRef,v=p(e,u),g=["switch","radio","checkbox"].indexOf(i)>-1,O="select"===i,j="range"===i,w=b||(O||"textarea"===i?i:"input"),x="form-control";m?(x="".concat(x,"-plaintext"),w=b||"input"):j?x="form-range":O?x="form-select":g&&(x=y?null:"form-check-input"),v.size&&/\D/g.test(v.size)&&((0,a.mc)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),c=v.size,delete v.size);var k=(0,a.qO)(s()(t,d&&"is-invalid",l&&"is-valid",!!c&&(O?"form-select-".concat(c):"form-control-".concat(c)),x),n);return("input"===w||b&&"function"===typeof b)&&(v.type="switch"===i?"checkbox":i),v.children&&!m&&"select"!==i&&"string"===typeof w&&"select"!==w&&((0,a.mc)('Input with a type of "'.concat(i,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete v.children),r.createElement(w,f({},v,{ref:h,className:k,"aria-invalid":d}))}}])&&d(t.prototype,n),o&&d(t,o),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.Component);g.propTypes=v;const O=g},1646:(e,t,n)=>{n.d(t,{A:()=>g});var r=n(9950),o=n(1942),i=n.n(o),c=n(8738),s=n.n(c),a=n(1497),l=["className","cssModule","hidden","widths","tag","check","size","for"];function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var d=["xs","sm","md","lg","xl","xxl"],b=i().oneOfType([i().number,i().string]),y=i().oneOfType([i().bool,i().string,i().number,i().shape({size:b,order:b,offset:b})]),m={children:i().node,hidden:i().bool,check:i().bool,size:i().string,for:i().string,tag:a.Wx,className:i().string,cssModule:i().object,xs:y,sm:y,md:y,lg:y,xl:y,xxl:y,widths:i().array},h=function(e,t,n){return!0===n||""===n?e?"col":"col-".concat(t):"auto"===n?e?"col-auto":"col-".concat(t,"-auto"):e?"col-".concat(n):"col-".concat(t,"-").concat(n)};function v(e){var t=e.className,n=e.cssModule,o=e.hidden,i=e.widths,c=void 0===i?d:i,b=e.tag,y=void 0===b?"label":b,m=e.check,v=e.size,g=e.for,O=p(e,l),j=[];c.forEach((function(t,r){var o=e[t];if(delete O[t],o||""===o){var i,c=!r;if((0,a.Gv)(o)){var l,u=c?"-":"-".concat(t,"-");i=h(c,t,o.size),j.push((0,a.qO)(s()((f(l={},i,o.size||""===o.size),f(l,"order".concat(u).concat(o.order),o.order||0===o.order),f(l,"offset".concat(u).concat(o.offset),o.offset||0===o.offset),l))),n)}else i=h(c,t,o),j.push(i)}}));var w=v||j.length,x=!(m||w),k=(0,a.qO)(s()(t,!!o&&"visually-hidden",!!m&&"form-check-label",!!v&&"col-form-label-".concat(v),j,!!w&&"col-form-label",!!x&&"form-label"),n);return r.createElement(y,u({htmlFor:g},O,{className:k}))}v.propTypes=m;const g=v},9163:(e,t,n)=>{var r=n(9950);function o(e,t,n){var o="function"===typeof t;r.useEffect((function(){var n,r=!0,i=e((function(){return r}));return Promise.resolve(i).then((function(e){n=e})),function(){r=!1,o&&t(n)}}),o?n:t)}e.exports=o,e.exports.useAsyncEffect=o}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[831],{3109:(e,t,a)=>{a.r(t),a.d(t,{default:()=>A});var r=a(9379),s=a(9950),i=a(2594),n=a(1110),l=a(5012),o=a(7176),c=a(6114),u=a(5488),d=a(3452),h=a(5077),p=a(6713),f=a(7348),v=a(9163),b=a.n(v),m=a(9435),k=a(5553),g=a(5269),y=a(127);var _=a(5346);var x=a(3150),w=a(3628),j=a(4414);const A=function(e){let{showAttributes:t,fetchRoles:a}=e;const v=(0,f.MW)(),{role_id:A}=(0,h.g)(),O=(0,p.O$)(g.A,(e=>e.roles)),C=(0,p.O$)(g.A,(e=>{var t;return null===(t=e.registration)||void 0===t?void 0:t.version})),[P,S]=(null===C||void 0===C?void 0:C.split("."))||[],T=parseFloat("".concat(P,".").concat(S)),E=(0,p.O$)(g.A,(e=>e.lastUpdate)),N=(0,p.O$)(g.A,(e=>e.auth)),F=(0,p.O$)(g.A,(e=>e.url)),M=(0,p.O$)(k.A,(e=>e.theme)),[X,B]=(0,s.useState)({}),[R,$]=(0,s.useState)({}),[D,L]=(0,s.useState)({}),[U,I]=(0,s.useState)({}),[J,Y]=(0,s.useState)(!1),[G,H]=(0,s.useState)(!1),[K,W]=(0,s.useState)(!0),q=P>=3&&(P>3||S>=3),z=q?"calc(100vh - 440px)":"calc(100vh - 340px)",Q={checked:(0,j.jsxs)("div",{style:{width:"100%",textAlign:"center"},children:["manage ",T>=4.2?"databases":"schemas","/tables"]}),unchecked:(0,j.jsxs)("div",{style:{width:"100%",textAlign:"center"},children:["manage ",T>=4.2?"databases":"schemas","/tables"]})};return b()((async()=>{var e;if(A&&O&&null!==(e=O.find((e=>e.id===A)))&&void 0!==e&&e.permission){var a;const e=null===(a=O.find((e=>e.id===A)))||void 0===a?void 0:a.permission,r=Array.isArray(e.structure_user)?e.structure_user.join(", "):e.structure_user||!1,s=await(async e=>{let{auth:t,url:a,currentRolePermissions:r,version:s,showAttributes:i}=e;const n=await(0,_.A)({auth:t,url:a}),l={},[o,c,u]=s.split("."),d="2.0.000"!==s&&o<=2&&c<=1&&u<=2;return n.error||Object.keys(n).map((e=>(l[e]={tables:{}},Object.keys(n[e]).map((t=>{const a=n[e][t],s=r&&r[e]&&r[e].tables[t],o=a.attributes.map((e=>e.attribute)).sort();return l[e].tables[t]=d?(e=>{let{extantTablePermissions:t,attributes:a,showAttributes:r}=e;return{read:!t||t.read,insert:!t||t.insert,update:!t||t.update,delete:!t||t.delete,attribute_restrictions:a.filter((e=>{var a;return r||(null===t||void 0===t||null===(a=t.attribute_restrictions)||void 0===a?void 0:a.find((t=>t.attribute_name===e)))})).map((e=>{var a;const r=null===t||void 0===t||null===(a=t.attribute_restrictions)||void 0===a?void 0:a.find((t=>t.attribute_name===e));return{attribute_name:e,read:r?r.read:!t||t.read,insert:r?r.insert:!t||t.insert,update:r?r.update:!t||t.update,delete:r?r.delete:!t||t.delete}}))}})({extantTablePermissions:s,attributes:o,showAttributes:i}):(e=>{let{extantTablePermissions:t,attributes:a,showAttributes:r}=e;return{read:!!t&&t.read,insert:!!t&&t.insert,update:!!t&&t.update,delete:!!t&&t.delete,attribute_permissions:a.filter((()=>{var e;return r||(null===t||void 0===t||null===(e=t.attribute_permissions)||void 0===e?void 0:e.some((e=>e.read||e.insert||e.update)))})).map((e=>{var a;const r=null===t||void 0===t||null===(a=t.attribute_permissions)||void 0===a?void 0:a.find((t=>t.attribute_name===e));return{attribute_name:e,read:r?r.read:(null===t||void 0===t||!t.attribute_permissions.length)&&((null===t||void 0===t?void 0:t.read)||!1),insert:r?r.insert:(null===t||void 0===t||!t.attribute_permissions.length)&&((null===t||void 0===t?void 0:t.insert)||!1),update:r?r.update:(null===t||void 0===t||!t.attribute_permissions.length)&&((null===t||void 0===t?void 0:t.update)||!1)}}))}})({extantTablePermissions:s,attributes:o,showAttributes:i}),!0}))))),l})({auth:N,url:F,version:C,currentRolePermissions:e,showAttributes:t});$(s),B(s),I(r),L(r)}}),[A,O,E,t]),(0,j.jsxs)(m.tH,{onError:(e,t)=>(0,w.A)({error:{message:e.message,componentStack:t}}),FallbackComponent:x.A,children:[q&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(o.A,{children:[(0,j.jsx)(c.A,{xs:"12",sm:"6",md:"12",lg:"5",xl:"4",className:"pt-2 pb-2",children:(0,j.jsx)(n.A,{width:"100%",checked:!!D,onChange:()=>{L(!D&&(!1!==D||!U||U)),H(!0)},icons:Q})}),D&&(0,j.jsx)(c.A,{xs:"12",sm:"6",md:"12",lg:"7",xl:"8",children:(0,j.jsx)(u.A,{onChange:e=>{L(!e.target.value||e.target.value),H(!0)},type:"text",id:"permitted_schemas",title:"permitted ".concat(T>=4.2?"databases":"schemas"),placeholder:"comma-separated ".concat(T>=4.2?"databases":"schemas",", or blank for all"),value:!0===D?"":D,disabled:J})})]}),(0,j.jsx)("hr",{})]}),(0,j.jsx)(i.A,{placeholder:R,height:z,theme:"light_mitsuketa_tribute",colors:{background:"transparent",default:"dark"===M?"#aaa":"#000",colon:"dark"===M?"#aaa":"#000",keys:"dark"===M?"#aaa":"#000",string:"#13c664",number:"#ea4c89",primitive:"#ffa500"},style:{warningBox:{display:"none"}},locale:l.A,width:"100%",waitAfterKeyPress:1e3,confirmGood:!1,onChange:e=>{W(!e.error),H(JSON.stringify(e.jsObject)!==JSON.stringify(R)),B(e.jsObject)}}),(0,j.jsx)("hr",{}),(0,j.jsx)(d.A,{id:"updateRolePermissions",block:!0,color:"success",disabled:J||!G||!K,onClick:async e=>{if(e.preventDefault(),!X)return v.error("Please insert valid JSON to proceed"),!1;Y(!0),H(!1);const t=(0,r.A)({super_user:!1},X);q&&(t.structure_user=!0===D||!!D&&D.split(/[ ,]+/).filter((e=>""!==e)));const s=await(async e=>{let{auth:t,url:a,id:r,permission:s}=e;return(0,y.A)({operation:{operation:"alter_role",id:r,permission:s},auth:t,url:a})})({permission:t,id:A,auth:N,url:F});if(Y(!1),s.error){let e=s.role_errors||s.message;return e+=". Permissions reset.",v.error(e),L(U),B(R)}return v.success("Permissions updated successfully"),a(),g.A.update((e=>{e.lastUpdate=Date.now()}))},children:J?(0,j.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,j.jsx)("span",{children:"Update Role Permissions"})})]})}},4010:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});var r,s=a(9950),i=(r=s)&&r.__esModule?r:{default:r};t.default=function(){return i.default.createElement("svg",{width:"14",height:"11",viewBox:"0 0 14 11"},i.default.createElement("path",{d:"M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0",fill:"#fff",fillRule:"evenodd"}))}},1110:(e,t,a)=>{var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},s=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),i=a(9950),n=h(i),l=h(a(8738)),o=h(a(1942)),c=h(a(4010)),u=h(a(4990)),d=a(6104);function h(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.handleClick=a.handleClick.bind(a),a.handleTouchStart=a.handleTouchStart.bind(a),a.handleTouchMove=a.handleTouchMove.bind(a),a.handleTouchEnd=a.handleTouchEnd.bind(a),a.handleFocus=a.handleFocus.bind(a),a.handleBlur=a.handleBlur.bind(a),a.previouslyChecked=!(!e.checked&&!e.defaultChecked),a.state={checked:!(!e.checked&&!e.defaultChecked),hasFocus:!1},a}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),s(t,[{key:"componentDidUpdate",value:function(e){e.checked!==this.props.checked&&this.setState({checked:!!this.props.checked})}},{key:"handleClick",value:function(e){if(!this.props.disabled){var t=this.input;if(e.target!==t&&!this.moved)return this.previouslyChecked=t.checked,e.preventDefault(),t.focus(),void t.click();var a=this.props.hasOwnProperty("checked")?this.props.checked:t.checked;this.setState({checked:a})}}},{key:"handleTouchStart",value:function(e){this.props.disabled||(this.startX=(0,d.pointerCoord)(e).x,this.activated=!0)}},{key:"handleTouchMove",value:function(e){if(this.activated&&(this.moved=!0,this.startX)){var t=(0,d.pointerCoord)(e).x;this.state.checked&&t+15<this.startX?(this.setState({checked:!1}),this.startX=t,this.activated=!0):t-15>this.startX&&(this.setState({checked:!0}),this.startX=t,this.activated=t<this.startX+5)}}},{key:"handleTouchEnd",value:function(e){if(this.moved){var t=this.input;if(e.preventDefault(),this.startX){var a=(0,d.pointerCoord)(e).x;!0===this.previouslyChecked&&this.startX+4>a?this.previouslyChecked!==this.state.checked&&(this.setState({checked:!1}),this.previouslyChecked=this.state.checked,t.click()):this.startX-4<a&&this.previouslyChecked!==this.state.checked&&(this.setState({checked:!0}),this.previouslyChecked=this.state.checked,t.click()),this.activated=!1,this.startX=null,this.moved=!1}}}},{key:"handleFocus",value:function(e){var t=this.props.onFocus;t&&t(e),this.setState({hasFocus:!0})}},{key:"handleBlur",value:function(e){var t=this.props.onBlur;t&&t(e),this.setState({hasFocus:!1})}},{key:"getIcon",value:function(e){var a=this.props.icons;return a?void 0===a[e]?t.defaultProps.icons[e]:a[e]:null}},{key:"render",value:function(){var e=this,t=this.props,a=t.className,s=(t.icons,function(e,t){var a={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(a[r]=e[r]);return a}(t,["className","icons"])),i=(0,l.default)("react-toggle",{"react-toggle--checked":this.state.checked,"react-toggle--focus":this.state.hasFocus,"react-toggle--disabled":this.props.disabled},a);return n.default.createElement("div",{className:i,onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd},n.default.createElement("div",{className:"react-toggle-track"},n.default.createElement("div",{className:"react-toggle-track-check"},this.getIcon("checked")),n.default.createElement("div",{className:"react-toggle-track-x"},this.getIcon("unchecked"))),n.default.createElement("div",{className:"react-toggle-thumb"}),n.default.createElement("input",r({},s,{ref:function(t){e.input=t},onFocus:this.handleFocus,onBlur:this.handleBlur,className:"react-toggle-screenreader-only",type:"checkbox"})))}}]),t}(i.PureComponent);t.A=p,p.displayName="Toggle",p.defaultProps={icons:{checked:n.default.createElement(c.default,null),unchecked:n.default.createElement(u.default,null)}},p.propTypes={checked:o.default.bool,disabled:o.default.bool,defaultChecked:o.default.bool,onChange:o.default.func,onFocus:o.default.func,onBlur:o.default.func,className:o.default.string,name:o.default.string,value:o.default.string,id:o.default.string,"aria-labelledby":o.default.string,"aria-label":o.default.string,icons:o.default.oneOfType([o.default.bool,o.default.shape({checked:o.default.node,unchecked:o.default.node})])}},6104:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pointerCoord=function(e){if(e){var t=e.changedTouches;if(t&&t.length>0){var a=t[0];return{x:a.clientX,y:a.clientY}}var r=e.pageX;if(void 0!==r)return{x:r,y:e.pageY}}return{x:0,y:0}}},4990:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});var r,s=a(9950),i=(r=s)&&r.__esModule?r:{default:r};t.default=function(){return i.default.createElement("svg",{width:"10",height:"10",viewBox:"0 0 10 10"},i.default.createElement("path",{d:"M9.9 2.12L7.78 0 4.95 2.828 2.12 0 0 2.12l2.83 2.83L0 7.776 2.123 9.9 4.95 7.07 7.78 9.9 9.9 7.776 7.072 4.95 9.9 2.12",fill:"#fff",fillRule:"evenodd"}))}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[881],{6304:(e,t,r)=>{r.r(t),r.d(t,{default:()=>y});var n=r(9379),o=r(9950),i=r(9708),s=r(1646),a=r(5488),c=r(3452),l=r(5077),u=r(6713),f=r(4979),p=r(4319),d=r(5911),m=r(5553),b=r(4414);const y=function(){const e=(0,u.O$)(m.A,(e=>{var t;return null===(t=e.instances.find((e=>"local"===e.compute_stack_id)))||void 0===t?void 0:t.url})),[t,r]=(0,o.useState)({}),[y,g]=(0,o.useState)({}),[h,v]=(0,p.A)({}),j=(0,l.Zp)(),O=async()=>{r({submitted:!0});const{user:t,pass:o}=y;if(t&&o){const i=await(0,d.A)({auth:{user:t,pass:o},url:e});i.error&&"catch"===i.type?r({error:"SSL ERROR. ACCEPT SELF-SIGNED CERT?",url:e}):i.error&&"Login failed"===i.message||"Login failed"===i.error?r({error:"Login failed. Using instance credentials?",url:"https://harperdb.io/docs/harperdb-studio/instances/#instance-login"}):i.error?r({error:i.message||i.error}):(v((0,n.A)((0,n.A)({},h),{},{local:{valid:!0,user:y.user,pass:y.pass,super:i.role.permission.super_user,structure:i.role.permission.structure_user}})),setTimeout(j("/o/local/i/local/browse"),0))}else r({error:"All fields are required"})},x=e=>{"Enter"===e.code&&O()};return(0,b.jsx)("div",{className:"login-form",children:t.submitted?(0,b.jsx)(f.A,{header:"Signing in",spinner:!0,relative:!0}):(0,b.jsxs)(i.A,{children:[(0,b.jsx)("h2",{className:"mb-2 instructions",children:"Please sign into Harper"}),t.error&&(0,b.jsxs)("a",{href:t.url||null,target:"_blank",rel:"noopener noreferrer",className:"my-2 text-center text-bold text-small d-block text-nowrap text-decoration-none",children:[(0,b.jsx)("span",{className:"login-nav-link error",children:t.error}),t.url&&(0,b.jsx)("i",{className:"ms-2 fa fa-lg fa-external-link-square text-danger"})]}),(0,b.jsxs)(s.A,{className:"mb-3 d-block",children:[(0,b.jsx)("span",{className:"mb-2 d-inline-block",children:"Instance user"}),(0,b.jsx)(a.A,{id:"username",autoComplete:"username",required:!0,onChange:e=>g((0,n.A)((0,n.A)({},y),{},{user:e.target.value})),type:"text",title:"instance user",placeholder:"Instance user",value:y.user||"",disabled:t.submitted,onKeyDown:x})]}),(0,b.jsxs)(s.A,{className:"mb-4 d-block",children:[(0,b.jsx)("span",{className:"mb-2 d-inline-block",children:"Password"}),(0,b.jsx)(a.A,{id:"password",name:"password",required:!0,autoComplete:"current-password",onChange:e=>g((0,n.A)((0,n.A)({},y),{},{pass:e.target.value})),className:"mb-2",type:"password",title:"instance password",placeholder:"Instance password",disabled:t.submitted,value:y.pass||"",onKeyDown:x})]}),(0,b.jsx)(c.A,{id:"signIn",className:"border-0 rounded-pill btn-gradient-blue",onClick:O,title:"Sign In My Account",block:!0,disabled:t.submitted,children:"Sign In"})]})})}},5559:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var n=r(9379),o=r(9950),i=r(9708),s=r(1646),a=r(5488),c=r(3452),l=r(5077),u=r(6713),f=r(4283),p=r(5553),d=r(3304),m=r(1440),b=r(4979),y=r(5283),g=r(4414);const h=function(){const{search:e}=(0,l.zy)(),{user:t,token:r}=f.A.parse(e,{decode:!1}),h=(0,u.O$)(p.A,(e=>e.theme)),[v,j]=(0,o.useState)({}),[O,x]=(0,o.useState)({}),[w,k]=(0,y.A)({});return(0,o.useEffect)((()=>{t&&r&&(0,d.A)({email:t,pass:r,loggingIn:!0})}),[t,r]),(0,g.jsx)("div",{className:"login-form",children:v.processing?(0,g.jsx)(b.A,{header:"signing in",spinner:!0,relative:!0}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(i.A,{children:[(0,g.jsx)("h2",{className:"mb-2 instructions",children:"Sign in to Harper Studio"}),(0,g.jsx)("span",{className:"login-nav-link error d-inline-block",children:v.error}),(0,g.jsxs)(s.A,{className:"mb-3 d-block",children:[(0,g.jsx)("span",{className:"mb-2 d-inline-block",children:"Email"}),(0,g.jsx)(a.A,{name:"email",autoComplete:"email",required:!0,id:"email",onChange:e=>{e.currentTarget.focus(),x((0,n.A)((0,n.A)({},O),{},{email:e.target.value.trim().toLowerCase()}))},value:O.email||"",disabled:v.submitted,type:"text",title:"email",placeholder:"email address"})]}),(0,g.jsxs)(s.A,{className:"mb-4 d-block",children:[(0,g.jsx)("span",{className:"mb-2 d-inline-block",children:"Password"}),(0,g.jsx)(a.A,{id:"password",required:!0,onChange:e=>{e.currentTarget.focus(),x((0,n.A)((0,n.A)({},O),{},{pass:e.target.value}))},value:O.pass||"",disabled:v.submitted,type:"password",title:"password",name:"password",autoComplete:"current-password",placeholder:"password"})]}),(0,g.jsx)(c.A,{id:"signIn",type:"submit",className:"border-0 rounded-pill btn-gradient-blue",onClick:async()=>{j({submitted:!0});const{email:e,pass:t}=O;if((0,m.A)(e))if(t)if("akamai"===h&&-1===O.email.indexOf("harperdb.io")&&-1===O.email.indexOf("akamai.com")&&-1===O.email.indexOf("walmart.com"))j({error:"Portal access denied"});else{j({processing:!0});const r=await(0,d.A)({email:e,pass:t,loggingIn:!0});if(!r||null!==r&&void 0!==r&&r.error)j({error:["Unauthorized","User does not exist"].includes(null===r||void 0===r?void 0:r.message)?"Login Failed":(null===r||void 0===r?void 0:r.message)||"Login Failed"}),setTimeout((()=>j({})),5e3);else{k((0,n.A)((0,n.A)({},w),{},{email:e,pass:t}));const r={username:e,type:"email",company:e.split("@")[1]};Reo.identify(r)}}else j({error:"Password is required"});else j({error:"A valid email is required"})},title:"Sign In My Account",block:!0,disabled:v.submitted,children:"Sign In"})]}),(0,g.jsxs)("div",{className:"px-4 mt-3 d-flex justify-content-between",children:[(0,g.jsx)(l.k2,{to:"/sign-up",className:"login-nav-link d-inline-block",children:"Sign Up for Free"}),(0,g.jsx)(l.k2,{to:"/reset-password",className:"login-nav-link d-inline-block",children:"Reset Password"})]})]})})}},5911:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(127);const o=async e=>{let{auth:t,url:r}=e;return(0,n.A)({operation:{operation:"user_info"},auth:t,url:r,timeout:5e3})}},127:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(4038);const o=async e=>{let{operation:t,auth:r,url:o,timeout:i=0,authType:s,signal:a}=e;try{const e=new AbortController,u=setTimeout((()=>i?e.abort():null),i),f={"Content-Type":"application/json"};"token"===s?f.Authorization="Bearer ".concat(r.token):null!==r&&void 0!==r&&r.pass&&(f.Authorization="Basic ".concat(btoa("".concat(r.user,":").concat(r.pass))));const p=await(0,n.hd)(o,{signal:a||e.signal,method:"POST",body:JSON.stringify(t),headers:f,credentials:f.Authorization?"omit":"include"});clearTimeout(u);const d=await p.json();var c,l;return d.error?{error:!0,message:d.error,type:"response",status:p.status,role_errors:null===(c=d.main_permissions)||void 0===c?void 0:c.join(", "),access_errors:null===(l=d.unauthorized_access)||void 0===l?void 0:l.map((e=>{var t,r,n,o,i,s;return{schema:e.schema,table:e.table,type:null!==(t=e.required_attribute_permissions)&&void 0!==t&&t.length?"attribute":"table",entity:null!==(r=e.required_attribute_permissions)&&void 0!==r&&r.length?null===(n=e.required_attribute_permissions[0])||void 0===n?void 0:n.attribute_name:e.table,permission:null!==(o=e.required_attribute_permissions)&&void 0!==o&&o.length?null===(i=e.required_attribute_permissions[0])||void 0===i?void 0:i.required_permissions.join(", "):null===(s=e.required_table_permissions)||void 0===s?void 0:s.join(", ")}}))}:200!==p.status?{error:!0,message:"Error of type ".concat(p.status),type:"status"}:d}catch(u){return{error:!0,message:u.message,type:"catch"}}}},4319:(e,t,r)=>{r.d(t,{A:()=>n});const n=(0,r(6997).A)("instanceAuths")},1440:(e,t,r)=>{r.d(t,{A:()=>n});const n=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase())},9708:(e,t,r)=>{r.d(t,{A:()=>h});var n=r(9950),o=r(1942),i=r.n(o),s=r(1497);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var c=["className","cssModule","tag","innerRef"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}function u(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function d(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var o=b(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===a(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}(this,r)}}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var y={children:i().node,tag:s.Wx,innerRef:i().oneOfType([i().object,i().func,i().string]),className:i().string,cssModule:i().object},g=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(a,e);var t,r,o,i=d(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getRef=t.getRef.bind(m(t)),t.submit=t.submit.bind(m(t)),t}return t=a,(r=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"submit",value:function(){this.ref&&this.ref.submit()}},{key:"render",value:function(){var e=this.props,t=e.className,r=e.cssModule,o=e.tag,i=void 0===o?"form":o,a=e.innerRef,f=u(e,c),p=(0,s.qO)(t,r);return n.createElement(i,l({},f,{ref:a,className:p}))}}])&&f(t.prototype,r),o&&f(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(n.Component);g.propTypes=y;const h=g},5488:(e,t,r)=>{r.d(t,{A:()=>j});var n=r(9950),o=r(1942),i=r.n(o),s=r(8738),a=r.n(s),c=r(1497);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var u=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}function p(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function b(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=g(e);if(t){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}(this,r)}}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}var h={children:i().node,type:i().string,size:i().oneOfType([i().number,i().string]),bsSize:i().string,valid:i().bool,invalid:i().bool,tag:c.Wx,innerRef:i().oneOfType([i().object,i().func,i().string]),plaintext:i().bool,addon:i().bool,className:i().string,cssModule:i().object},v=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(s,e);var t,r,o,i=b(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=i.call(this,e)).getRef=t.getRef.bind(y(t)),t.focus=t.focus.bind(y(t)),t}return t=s,(r=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var e=this.props,t=e.className,r=e.cssModule,o=e.type,i=void 0===o?"text":o,s=e.bsSize,l=e.valid,d=e.invalid,m=e.tag,b=e.addon,y=e.plaintext,g=e.innerRef,h=p(e,u),v=["switch","radio","checkbox"].indexOf(i)>-1,j="select"===i,O="range"===i,x=m||(j||"textarea"===i?i:"input"),w="form-control";y?(w="".concat(w,"-plaintext"),x=m||"input"):O?w="form-range":j?w="form-select":v&&(w=b?null:"form-check-input"),h.size&&/\D/g.test(h.size)&&((0,c.mc)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),s=h.size,delete h.size);var k=(0,c.qO)(a()(t,d&&"is-invalid",l&&"is-valid",!!s&&(j?"form-select-".concat(s):"form-control-".concat(s)),w),r);return("input"===x||m&&"function"===typeof m)&&(h.type="switch"===i?"checkbox":i),h.children&&!y&&"select"!==i&&"string"===typeof x&&"select"!==x&&((0,c.mc)('Input with a type of "'.concat(i,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete h.children),n.createElement(x,f({},h,{ref:g,className:k,"aria-invalid":d}))}}])&&d(t.prototype,r),o&&d(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(n.Component);v.propTypes=h;const j=v},1646:(e,t,r)=>{r.d(t,{A:()=>v});var n=r(9950),o=r(1942),i=r.n(o),s=r(8738),a=r.n(s),c=r(1497),l=["className","cssModule","hidden","widths","tag","check","size","for"];function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var d=["xs","sm","md","lg","xl","xxl"],m=i().oneOfType([i().number,i().string]),b=i().oneOfType([i().bool,i().string,i().number,i().shape({size:m,order:m,offset:m})]),y={children:i().node,hidden:i().bool,check:i().bool,size:i().string,for:i().string,tag:c.Wx,className:i().string,cssModule:i().object,xs:b,sm:b,md:b,lg:b,xl:b,xxl:b,widths:i().array},g=function(e,t,r){return!0===r||""===r?e?"col":"col-".concat(t):"auto"===r?e?"col-auto":"col-".concat(t,"-auto"):e?"col-".concat(r):"col-".concat(t,"-").concat(r)};function h(e){var t=e.className,r=e.cssModule,o=e.hidden,i=e.widths,s=void 0===i?d:i,m=e.tag,b=void 0===m?"label":m,y=e.check,h=e.size,v=e.for,j=p(e,l),O=[];s.forEach((function(t,n){var o=e[t];if(delete j[t],o||""===o){var i,s=!n;if((0,c.Gv)(o)){var l,u=s?"-":"-".concat(t,"-");i=g(s,t,o.size),O.push((0,c.qO)(a()((f(l={},i,o.size||""===o.size),f(l,"order".concat(u).concat(o.order),o.order||0===o.order),f(l,"offset".concat(u).concat(o.offset),o.offset||0===o.offset),l))),r)}else i=g(s,t,o),O.push(i)}}));var x=h||O.length,w=!(y||x),k=(0,c.qO)(a()(t,!!o&&"visually-hidden",!!y&&"form-check-label",!!h&&"col-form-label-".concat(h),O,!!x&&"col-form-label",!!w&&"form-label"),r);return n.createElement(b,u({htmlFor:v},j,{className:k}))}h.propTypes=y;const v=h},4283:(e,t,r)=>{r.d(t,{A:()=>P});var n={};r.r(n),r.d(n,{exclude:()=>R,extract:()=>x,parse:()=>w,parseUrl:()=>A,pick:()=>N,stringify:()=>k,stringifyUrl:()=>S});var o=r(9379);const i="%[a-f0-9]{2}",s=new RegExp("("+i+")|([^%]+?)","gi"),a=new RegExp("("+i+")+","gi");function c(e,t){try{return[decodeURIComponent(e.join(""))]}catch(o){}if(1===e.length)return e;t=t||1;const r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],c(r),c(n))}function l(e){try{return decodeURIComponent(e)}catch(t){let r=e.match(s)||[];for(let n=1;n<r.length;n++)r=(e=c(r,n).join("")).match(s)||[];return e}}function u(e){if("string"!==typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch(t){return function(e){const t={"%FE%FF":"\ufffd\ufffd","%FF%FE":"\ufffd\ufffd"};let r=a.exec(e);for(;r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(o){const e=l(r[0]);e!==r[0]&&(t[r[0]]=e)}r=a.exec(e)}t["%C2"]="\ufffd";const n=Object.keys(t);for(const i of n)e=e.replace(new RegExp(i,"g"),t[i]);return e}(e)}}function f(e,t){const r={};if(Array.isArray(t))for(const n of t){const t=Object.getOwnPropertyDescriptor(e,n);null!==t&&void 0!==t&&t.enumerable&&Object.defineProperty(r,n,t)}else for(const n of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,n);if(o.enumerable){t(n,e[n],e)&&Object.defineProperty(r,n,o)}}return r}function p(e,t){if("string"!==typeof e||"string"!==typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===e||""===t)return[];const r=e.indexOf(t);return-1===r?[]:[e.slice(0,r),e.slice(r+t.length)]}const d=e=>null===e||void 0===e,m=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,(e=>"%".concat(e.charCodeAt(0).toString(16).toUpperCase()))),b=Symbol("encodeFragmentIdentifier");function y(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function g(e,t){return t.encode?t.strict?m(e):encodeURIComponent(e):e}function h(e,t){return t.decode?u(e):e}function v(e){return Array.isArray(e)?e.sort():"object"===typeof e?v(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function j(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function O(e,t,r){return"string"===r&&"string"===typeof e?e:"function"===typeof r&&"string"===typeof e?r(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()?"number"!==r||Number.isNaN(Number(e))||"string"!==typeof e||""===e.trim()?t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?Number(e):e:Number(e):"true"===e.toLowerCase()}function x(e){const t=(e=j(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function w(e,t){y((t=(0,o.A)({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null)},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),t?void 0!==n[e]?n[e]=[...n[e],r]:n[e]=[r]:n[e]=r};case"colon-list-separator":return(e,r,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[...n[e],r]:n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const o="string"===typeof r&&r.includes(e.arrayFormatSeparator),i="string"===typeof r&&!o&&h(r,e).includes(e.arrayFormatSeparator);r=i?h(r,e):r;const s=o||i?r.split(e.arrayFormatSeparator).map((t=>h(t,e))):null===r?r:h(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o)return void(n[t]=r?h(r,e):r);const i=null===r?[]:h(r,e).split(e.arrayFormatSeparator);void 0!==n[t]?n[t]=[...n[t],...i]:n[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[...[r[e]].flat(),t]:r[e]=t}}}(t),n=Object.create(null);if("string"!==typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const o of e.split("&")){if(""===o)continue;const e=t.decode?o.replaceAll("+"," "):o;let[i,s]=p(e,"=");void 0===i&&(i=e),s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:h(s,t),r(h(i,t),s,n)}for(const[o,i]of Object.entries(n))if("object"===typeof i&&null!==i&&"string"!==t.types[o])for(const[e,r]of Object.entries(i)){const n=t.types[o]?t.types[o].replace("[]",""):void 0;i[e]=O(r,t,n)}else"object"===typeof i&&null!==i&&"string"===t.types[o]?n[o]=Object.values(i).join(t.arrayFormatSeparator):n[o]=O(i,t,t.types[o]);return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce(((e,t)=>{const r=n[t];return e[t]=Boolean(r)&&"object"===typeof r&&!Array.isArray(r)?v(r):r,e}),Object.create(null))}function k(e,t){if(!e)return"";y((t=(0,o.A)({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&d(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const o=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[g(t,e),"[",o,"]"].join("")]:[...r,[g(t,e),"[",g(o,e),"]=",g(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[g(t,e),"[]"].join("")]:[...r,[g(t,e),"[]=",g(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[g(t,e),":list="].join("")]:[...r,[g(t,e),":list=",g(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?n:(o=null===o?"":o,0===n.length?[[g(r,e),t,g(o,e)].join("")]:[[n,g(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,g(t,e)]:[...r,[g(t,e),"=",g(n,e)].join("")]}}(t),i={};for(const[o,a]of Object.entries(e))r(o)||(i[o]=a);const s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map((r=>{const o=e[r];return void 0===o?"":null===o?g(r,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?g(r,t)+"[]":o.reduce(n(r),[]).join("&"):g(r,t)+"="+g(o,t)})).filter((e=>e.length>0)).join("&")}function A(e,t){var r,n;t=(0,o.A)({decode:!0},t);let[i,s]=p(e,"#");return void 0===i&&(i=e),(0,o.A)({url:null!==(r=null===(n=i)||void 0===n||null===(n=n.split("?"))||void 0===n?void 0:n[0])&&void 0!==r?r:"",query:w(x(e),t)},t&&t.parseFragmentIdentifier&&s?{fragmentIdentifier:h(s,t)}:{})}function S(e,t){t=(0,o.A)({encode:!0,strict:!0,[b]:!0},t);const r=j(e.url).split("?")[0]||"",n=x(e.url);let i=k((0,o.A)((0,o.A)({},w(n,{sort:!1})),e.query),t);i&&(i="?".concat(i));let s=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);if("string"===typeof e.fragmentIdentifier){const n=new URL(r);n.hash=e.fragmentIdentifier,s=t[b]?n.hash:"#".concat(e.fragmentIdentifier)}return"".concat(r).concat(i).concat(s)}function N(e,t,r){r=(0,o.A)({parseFragmentIdentifier:!0,[b]:!1},r);const{url:n,query:i,fragmentIdentifier:s}=A(e,r);return S({url:n,query:f(i,t),fragmentIdentifier:s},r)}function R(e,t,r){return N(e,Array.isArray(t)?e=>!t.includes(e):(e,r)=>!t(e,r),r)}const P=n}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[195],{6269:(e,t,n)=>{n.r(t),n.d(t,{default:()=>k});var r=n(9379),o=n(9950),a=n(9708),i=n(1646),s=n(5488),c=n(7176),l=n(6114),u=n(3452),f=n(5077),d=n(9163),p=n.n(d),m=n(4283),b=n(6713),h=n(1440),y=n(2714);var g=n(4701),v=n(3304);const j=async e=>{let{formData:t,theme:n}=e;const{firstname:r,lastname:o,email:a,subdomain:i,coupon_code:s,htuk:c,pageName:l,pageUri:u}=t;if(!r||!o||!a||!i)return{error:"All fields must be filled out"};if(!(0,h.A)(a))return{error:"Please provide a valid email"};if(!(0,g.A)(i))return{error:"subdomain: alphanumeric characters only"};if(i.length>16)return{error:"subdomain: max 16 characters"};if("akamai"===n&&-1===t.email.indexOf("harperdb.io")&&-1===t.email.indexOf("akamai.com")&&-1===t.email.indexOf("walmart.com"))return{error:"portal signup denied"};const f=await(async e=>{let{firstname:t,lastname:n,email:r,customer_name:o,subdomain:a,coupon_code:i,htuk:s,pageName:c,pageUri:l,login_domain:u=window.location.host}=e;return(0,y.A)({endpoint:"addCustomer",method:"POST",payload:{firstname:t,lastname:n,email:r,customer_name:o,subdomain:a,coupon_code:i,htuk:s,pageName:c,pageUri:l,login_domain:u}})})({firstname:r,lastname:o,email:a,customer_name:"".concat(r,"'s Org"),subdomain:i,coupon_code:s,htuk:c,pageName:l,pageUri:u});return f.error?{error:f.message.replace("Bad request: ","").replace(/['"]+/g,"")}:(window._kmq&&(window._kmq.push(["identify",a]),window._kmq.push(["record","successful_signup",{email:a,firstname:r,lastname:o}])),f.temp_password?(0,v.A)({email:a,pass:f.temp_password,loggingIn:!0}):{success:!0})};var O=n(4979),x=n(5553),w=n(4414);const k=function(){const{search:e}=(0,f.zy)(),{code:t,htuk:n,pageName:d,pageUri:h}=m.A.parse(e),y=(0,b.O$)(x.A,(e=>e.auth)),g=(0,b.O$)(x.A,(e=>e.theme)),[v,k]=(0,o.useState)({}),[N,A]=(0,o.useState)({coupon_code:t,htuk:n,pageName:d,pageUri:h}),[_,P]=(0,o.useState)(!1);return p()((async()=>{if(v.submitted){const e=await j({formData:N,theme:g});!y.email&&e&&k(e)}}),[v]),(0,o.useEffect)((()=>{v.submitted||k({})}),[N]),(0,w.jsx)("div",{className:"login-form",children:v.submitted?(0,w.jsx)(O.A,{header:"creating your account",spinner:!0,relative:!0}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(a.A,{children:[(0,w.jsx)("h2",{className:"mb-2 instructions",children:"Sign Up"}),(0,w.jsx)("span",{className:"mb-2 login-nav-link error d-inline-block",children:v.error}),(0,w.jsxs)(i.A,{className:"mb-3 d-block",children:[(0,w.jsx)("span",{className:"mb-2 d-inline-block",children:"First Name"}),(0,w.jsx)(s.A,{id:"firstname",name:"fname",required:!0,maxLength:40,autoComplete:"given-name",type:"text",title:"first name",placeholder:"Jane",value:N.firstname||"",disabled:v.submitted,onChange:e=>A((0,r.A)((0,r.A)({},N),{},{firstname:e.target.value}))})]}),(0,w.jsxs)(i.A,{className:"mb-3 d-block",children:[(0,w.jsx)("span",{className:"mb-2 d-inline-block",children:"Last Name"}),(0,w.jsx)(s.A,{id:"lastname",name:"lname",maxLength:40,required:!0,autoComplete:"family-name",type:"text",title:"last name",placeholder:"Doe",value:N.lastname||"",disabled:v.submitted,onChange:e=>A((0,r.A)((0,r.A)({},N),{},{lastname:e.target.value}))})]}),(0,w.jsxs)(i.A,{className:"mb-3 d-block",children:[(0,w.jsx)("span",{className:"mb-2 d-inline-block",children:"Email"}),(0,w.jsx)(s.A,{id:"email",autoComplete:"email",name:"email",maxLength:80,required:!0,className:"mb-2",type:"text",title:"email",placeholder:"jane.doe@harperdb.io",value:N.email||"",disabled:v.submitted,onChange:e=>A((0,r.A)((0,r.A)({},N),{},{email:e.target.value.toLowerCase()}))})]}),(0,w.jsx)(i.A,{className:"mb-3 d-block",children:(0,w.jsxs)(c.A,{children:[(0,w.jsx)("span",{className:"mb-2 d-inline-block",children:"Subdomain"}),(0,w.jsx)(l.A,{className:"subdomain-form",children:(0,w.jsx)(s.A,{id:"subdomain",name:"subdomain",required:!0,className:"",type:"text",title:"subdomain",placeholder:"janedev",value:N.subdomain||"",disabled:v.submitted,onChange:e=>A((0,r.A)((0,r.A)({},N),{},{subdomain:e.target.value.substring(0,14).toLowerCase()}))})}),(0,w.jsxs)(l.A,{className:"subdomain-label",children:[".harperdbcloud.com"," ",(0,w.jsx)(u.A,{color:"link",onClick:()=>P(!_),children:(0,w.jsx)("i",{className:"fa fa-question-circle"})})]})]})}),_&&(0,w.jsx)("i",{className:"subdomain-explanation",children:"The URL of your Harper Cloud Instances"}),(0,w.jsxs)(i.A,{className:"mb-3 d-block",children:[(0,w.jsx)("span",{className:"mb-2 d-inline-block",children:"Coupon Code (Optional)"}),(0,w.jsx)(s.A,{id:"coupon_code",type:"text",className:"mb-2",name:"coupon_code",title:"coupon code",placeholder:"XXXXXXXXX",value:N.coupon_code||"",onChange:e=>A((0,r.A)((0,r.A)({},N),{},{coupon_code:e.target.value})),disabled:v.submitted})]}),(0,w.jsx)("div",{className:"mt-3 mb-3 d-block",children:(0,w.jsxs)("div",{className:"disclaimer",children:["By creating an account, you agree to the\xa0",(0,w.jsx)("a",{href:"https://harperdb.io/legal/privacy-policy/",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),"\xa0and\xa0",(0,w.jsx)("a",{href:"https://harperdb.io/legal/harperdb-cloud-terms-of-service/",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})]})}),(0,w.jsx)(u.A,{id:"sign-up",block:!0,type:"submit",className:"border-0 rounded-pill btn-gradient-blue",disabled:v.submitted,onClick:()=>k({submitted:!0}),children:v.submitted?(0,w.jsx)("i",{className:"text-white fa fa-spinner fa-spin"}):(0,w.jsx)("span",{children:"Sign Up For Free"})})]}),(0,w.jsx)("div",{className:"px-4 mt-3",children:(0,w.jsx)(f.k2,{to:"/",className:"login-nav-link d-inline-block",children:"Already Have An Account? Sign In Instead."})})]})})}},4701:(e,t,n)=>{n.d(t,{A:()=>r});const r=e=>e.match(/^[a-z0-9]+$/i)},1440:(e,t,n)=>{n.d(t,{A:()=>r});const r=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase())},9708:(e,t,n)=>{n.d(t,{A:()=>g});var r=n(9950),o=n(1942),a=n.n(o),i=n(1497);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var c=["className","cssModule","tag","innerRef"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function p(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}(this,n)}}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var h={children:a().node,tag:i.Wx,innerRef:a().oneOfType([a().object,a().func,a().string]),className:a().string,cssModule:a().object},y=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(s,e);var t,n,o,a=p(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.call(this,e)).getRef=t.getRef.bind(m(t)),t.submit=t.submit.bind(m(t)),t}return t=s,(n=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"submit",value:function(){this.ref&&this.ref.submit()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.cssModule,o=e.tag,a=void 0===o?"form":o,s=e.innerRef,f=u(e,c),d=(0,i.qO)(t,n);return r.createElement(a,l({},f,{ref:s,className:d}))}}])&&f(t.prototype,n),o&&f(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);y.propTypes=h;const g=y},5488:(e,t,n)=>{n.d(t,{A:()=>j});var r=n(9950),o=n(1942),a=n.n(o),i=n(8738),s=n.n(i),c=n(1497);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var u=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function b(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,n)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}var g={children:a().node,type:a().string,size:a().oneOfType([a().number,a().string]),bsSize:a().string,valid:a().bool,invalid:a().bool,tag:c.Wx,innerRef:a().oneOfType([a().object,a().func,a().string]),plaintext:a().bool,addon:a().bool,className:a().string,cssModule:a().object},v=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(i,e);var t,n,o,a=b(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=a.call(this,e)).getRef=t.getRef.bind(h(t)),t.focus=t.focus.bind(h(t)),t}return t=i,(n=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.cssModule,o=e.type,a=void 0===o?"text":o,i=e.bsSize,l=e.valid,p=e.invalid,m=e.tag,b=e.addon,h=e.plaintext,y=e.innerRef,g=d(e,u),v=["switch","radio","checkbox"].indexOf(a)>-1,j="select"===a,O="range"===a,x=m||(j||"textarea"===a?a:"input"),w="form-control";h?(w="".concat(w,"-plaintext"),x=m||"input"):O?w="form-range":j?w="form-select":v&&(w=b?null:"form-check-input"),g.size&&/\D/g.test(g.size)&&((0,c.mc)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),i=g.size,delete g.size);var k=(0,c.qO)(s()(t,p&&"is-invalid",l&&"is-valid",!!i&&(j?"form-select-".concat(i):"form-control-".concat(i)),w),n);return("input"===x||m&&"function"===typeof m)&&(g.type="switch"===a?"checkbox":a),g.children&&!h&&"select"!==a&&"string"===typeof x&&"select"!==x&&((0,c.mc)('Input with a type of "'.concat(a,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete g.children),r.createElement(x,f({},g,{ref:y,className:k,"aria-invalid":p}))}}])&&p(t.prototype,n),o&&p(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(r.Component);v.propTypes=g;const j=v},1646:(e,t,n)=>{n.d(t,{A:()=>v});var r=n(9950),o=n(1942),a=n.n(o),i=n(8738),s=n.n(i),c=n(1497),l=["className","cssModule","hidden","widths","tag","check","size","for"];function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=["xs","sm","md","lg","xl","xxl"],m=a().oneOfType([a().number,a().string]),b=a().oneOfType([a().bool,a().string,a().number,a().shape({size:m,order:m,offset:m})]),h={children:a().node,hidden:a().bool,check:a().bool,size:a().string,for:a().string,tag:c.Wx,className:a().string,cssModule:a().object,xs:b,sm:b,md:b,lg:b,xl:b,xxl:b,widths:a().array},y=function(e,t,n){return!0===n||""===n?e?"col":"col-".concat(t):"auto"===n?e?"col-auto":"col-".concat(t,"-auto"):e?"col-".concat(n):"col-".concat(t,"-").concat(n)};function g(e){var t=e.className,n=e.cssModule,o=e.hidden,a=e.widths,i=void 0===a?p:a,m=e.tag,b=void 0===m?"label":m,h=e.check,g=e.size,v=e.for,j=d(e,l),O=[];i.forEach((function(t,r){var o=e[t];if(delete j[t],o||""===o){var a,i=!r;if((0,c.Gv)(o)){var l,u=i?"-":"-".concat(t,"-");a=y(i,t,o.size),O.push((0,c.qO)(s()((f(l={},a,o.size||""===o.size),f(l,"order".concat(u).concat(o.order),o.order||0===o.order),f(l,"offset".concat(u).concat(o.offset),o.offset||0===o.offset),l))),n)}else a=y(i,t,o),O.push(a)}}));var x=g||O.length,w=!(h||x),k=(0,c.qO)(s()(t,!!o&&"visually-hidden",!!h&&"form-check-label",!!g&&"col-form-label-".concat(g),O,!!x&&"col-form-label",!!w&&"form-label"),n);return r.createElement(b,u({htmlFor:v},j,{className:k}))}g.propTypes=h;const v=g},9163:(e,t,n)=>{var r=n(9950);function o(e,t,n){var o="function"===typeof t;r.useEffect((function(){var n,r=!0,a=e((function(){return r}));return Promise.resolve(a).then((function(e){n=e})),function(){r=!1,o&&t(n)}}),o?n:t)}e.exports=o,e.exports.useAsyncEffect=o}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[5],{4029:(e,t,c)=>{c.r(t),c.d(t,{default:()=>d});var s=c(9950),a=c(6713),n=c(3452),r=c(5077),l=c(5269),u=c(5553),i=c(5900),o=c(4414);const d=function(e){let{label:t="instance",centerText:c=!1}=e;const{compute_stack_id:d}=(0,r.g)(),f=(0,a.O$)(l.A,(e=>e.loading)),h=(0,a.O$)(u.A,(e=>e.instances)),k=(0,a.O$)(l.A,(e=>e.auth)),p=(0,s.useCallback)((()=>{const e=h.find((e=>e.compute_stack_id===d));(0,i.A)({auth:k,url:e.url})}),[k,d,h]);return(0,o.jsx)("span",{className:"structure-reloader ".concat(c?"d-block text-center":""),children:(0,o.jsxs)(n.A,{color:"link",onClick:p,children:[(0,o.jsx)("i",{title:"Refresh Structure",className:"fa me-2 ".concat(f?"fa-spinner fa-spin":"fa-sync-alt")}),t]})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[83],{5928:(e,n,a)=>{a.r(n),a.d(n,{default:()=>x});var i=a(9379),t=a(9950),s=a(2072),l=a(8125),o=a(5746),r=a(3452),c=a(5077),d=a(6713),u=a(9435),g=a(5553),m=a(3628),v=a(3150),b=a(4319),f=a(5996),h=a(5283),p=a(4414);const x=function(e){var n;let{isMaintenance:a,loggedIn:x=!1}=e;const{pathname:j}=(0,c.zy)(),O=(0,c.Zp)(),y=(0,d.O$)(g.A,(e=>e.auth)),k=(0,d.O$)(g.A,(e=>e.customer)),N=(0,d.O$)(g.A,(e=>e.theme)),A=(0,d.O$)(g.A,(e=>e.themes)),[,_]=(0,b.A)({}),[w,z]=(0,h.A)({}),M=null===A||void 0===A?void 0:A.findIndex((e=>e===N)),P=N&&M!==A.length-1?A[M+1]:A[0],S=(0,t.useMemo)((()=>{var e;return null===y||void 0===y||null===(e=y.orgs)||void 0===e?void 0:e.filter((e=>"invited"===e.status)).length}),[y.orgs]),I=(0,t.useMemo)((()=>{var e,n;return"owner"===(null===y||void 0===y||null===(e=y.orgs)||void 0===e||null===(n=e.find((e=>{var n,a;return(null===(n=e.customer_id)||void 0===n?void 0:n.toString())===(null===k||void 0===k||null===(a=k.customer_id)||void 0===a?void 0:a.toString())})))||void 0===n?void 0:n.status)}),[y.orgs,k.customer_id]),T=e=>{z((0,i.A)((0,i.A)({},w),{},{theme:e})),g.A.update((n=>{n.theme=e}))},E=()=>{f.A.is_local_studio?_({local:!1}):(g.A.update((e=>{e.auth=!1})),z({theme:N}),_({})),O("/")};return(0,p.jsx)(u.tH,{onError:(e,n)=>(0,m.A)({error:{message:e.message,componentStack:n},customer_id:null===k||void 0===k?void 0:k.customer_id,compute_stack_id:null}),FallbackComponent:v.A,children:(0,p.jsxs)(s.A,{id:"app-nav",dark:!0,fixed:"top",expand:"xs",children:[(0,p.jsx)("div",{className:"navbar-brand",children:x?(0,p.jsx)(c.k2,{to:f.A.is_local_studio?"o/local/i/local/browse":"/organizations",children:(0,p.jsx)("div",{id:"logo",title:"Go to Organizations Home"})}):(0,p.jsx)(c.k2,{to:"/",children:(0,p.jsx)("div",{id:"logo",title:"Go to sign in page"})})}),(0,p.jsxs)(l.A,{className:"ms-auto",navbar:!0,children:[x&&!a&&!f.A.is_local_studio&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.A,{className:"ms-0",children:(0,p.jsxs)(c.k2,{id:"viewOrganizations",title:"View or Switch Organizations",to:"/organizations",children:[(0,p.jsx)("i",{className:"fa fa-building d-inline-block"}),(0,p.jsx)("span",{className:"d-none d-md-inline-block",children:"Organizations"}),S?(0,p.jsx)("span",{className:"badge",children:S}):null]})}),(0,p.jsxs)("div",{className:"active-org ".concat(k&&-1!==j.indexOf(null===k||void 0===k?void 0:k.customer_id)?"open":""),children:[(0,p.jsx)("div",{className:"text-white org-name",children:k.customer_name}),(0,p.jsxs)("div",{className:"org-actions",children:[(0,p.jsx)(o.A,{className:"ms-0",children:(0,p.jsxs)(c.k2,{id:"viewOrganizationInstances",title:"View Organization Instances",to:"/o/".concat(k.customer_id,"/instances"),children:[(0,p.jsx)("i",{className:"fa fa-th d-inline-block"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block",children:"Instances"})]})}),I&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.A,{children:(0,p.jsxs)(c.k2,{id:"manageOrganizationUsers",title:"Manage Organization Users",to:"/o/".concat(k.customer_id,"/users"),children:[(0,p.jsx)("i",{className:"fa fa-users d-inline-block"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block",children:"Users"})]})}),(0,p.jsx)(o.A,{children:(0,p.jsxs)(c.k2,{id:"manageOrganizationBilling",title:"Manage Organization Billing",to:"/o/".concat(k.customer_id,"/billing"),children:[(0,p.jsx)("i",{className:"fa fa-credit-card d-inline-block"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block",children:"Billing"}),"invoice.payment_failed"===(null===k||void 0===k||null===(n=k.current_payment_status)||void 0===n?void 0:n.status)?(0,p.jsx)("span",{className:"badge",children:"!"}):null]})})]})]})]}),(0,p.jsx)(o.A,{children:(0,p.jsxs)(c.k2,{id:"manageProfile",title:"Manage My Profile",to:"/profile",children:[(0,p.jsx)("i",{className:"fa fa-user"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block",children:"Profile"}),null!==y&&void 0!==y&&y.email_bounced?(0,p.jsx)("span",{className:"badge",children:"!"}):null]})})]}),!f.A.is_local_studio&&(0,p.jsx)("li",{className:"nav-item",children:(0,p.jsxs)("a",{target:"_blank",rel:"noreferrer",href:"https://harperdb.io/docs",id:"viewResources",title:"Harper Documentation",children:[(0,p.jsx)("i",{className:"fas fa-tools"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block",children:"Resources"})]})}),A.length>1&&(0,p.jsx)(o.A,{children:(0,p.jsxs)(r.A,{color:"link",id:"changeTheme",tabIndex:"0",title:"Switch to ".concat(P," theme"),onKeyDown:e=>13!==e.keyCode||T(P),onClick:()=>T(P),children:[(0,p.jsx)("i",{className:"fas fa-palette"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block",children:"Theme"})]})}),(0,p.jsx)(o.A,{children:x?(0,p.jsxs)(r.A,{id:"logOut",tabIndex:"0",color:"link",title:"Log Out",onKeyDown:e=>13!==e.keyCode||E(),onClick:E,children:[(0,p.jsx)("i",{className:"fa fa-sign-out-alt"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block login-text-label",children:"Sign Out"})]}):(0,p.jsxs)(c.k2,{id:"goToLogin",title:"Log In",to:"/",children:[(0,p.jsx)("i",{className:"fa fa-sign-in-alt"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block login-text-label",children:"Sign In"})]})})]})]})})}},4319:(e,n,a)=>{a.d(n,{A:()=>i});const i=(0,a(6997).A)("instanceAuths")},8125:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(9950),t=a(1942),s=a.n(t),l=a(8738),o=a.n(l),r=a(1497),c=["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},d.apply(this,arguments)}function u(e,n){if(null==e)return{};var a,i,t=function(e,n){if(null==e)return{};var a,i,t={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var g={card:s().bool,className:s().string,cssModule:s().object,fill:s().bool,horizontal:s().oneOf(["center","end"]),justified:s().bool,navbar:s().bool,pills:s().bool,tabs:s().bool,tag:r.Wx,vertical:s().oneOfType([s().bool,s().string])};function m(e){var n=e.className,a=e.cssModule,t=e.tabs,s=e.pills,l=e.vertical,g=void 0!==l&&l,m=e.horizontal,v=e.justified,b=e.fill,f=e.navbar,h=e.card,p=e.tag,x=void 0===p?"ul":p,j=u(e,c),O=(0,r.qO)(o()(n,f?"navbar-nav":"nav",!!m&&"justify-content-".concat(m),function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-".concat(e,"-column"))}(g),{"nav-tabs":t,"card-header-tabs":h&&t,"nav-pills":s,"card-header-pills":h&&s,"nav-justified":v,"nav-fill":b}),a);return i.createElement(x,d({},j,{className:O}))}m.propTypes=g;const v=m},5746:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(9950),t=a(1942),s=a.n(t),l=a(8738),o=a.n(l),r=a(1497),c=["className","cssModule","active","tag"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},d.apply(this,arguments)}function u(e,n){if(null==e)return{};var a,i,t=function(e,n){if(null==e)return{};var a,i,t={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var g={active:s().bool,className:s().string,cssModule:s().object,tag:r.Wx};function m(e){var n=e.className,a=e.cssModule,t=e.active,s=e.tag,l=void 0===s?"li":s,g=u(e,c),m=(0,r.qO)(o()(n,"nav-item",!!t&&"active"),a);return i.createElement(l,d({},g,{className:m}))}m.propTypes=g;const v=m},2072:(e,n,a)=>{a.d(n,{A:()=>b});var i=a(9950),t=a(1942),s=a.n(t),l=a(8738),o=a.n(l),r=a(1497),c=["expand","className","cssModule","light","dark","fixed","sticky","color","container","tag","children"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},d.apply(this,arguments)}function u(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function g(e,n){if(null==e)return{};var a,i,t=function(e,n){if(null==e)return{};var a,i,t={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var m={children:s().node,className:s().string,color:s().string,container:s().oneOfType([s().bool,s().string]),cssModule:s().object,dark:s().bool,expand:s().oneOfType([s().bool,s().string]),fixed:s().string,light:s().bool,role:s().string,sticky:s().string,tag:r.Wx};function v(e){var n,a=e.expand,t=void 0!==a&&a,s=e.className,l=e.cssModule,m=e.light,v=e.dark,b=e.fixed,f=e.sticky,h=e.color,p=e.container,x=void 0===p?"fluid":p,j=e.tag,O=void 0===j?"nav":j,y=e.children,k=g(e,c),N=(0,r.qO)(o()(s,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-".concat(e))}(t),(u(n={"navbar-light":m,"navbar-dark":v},"bg-".concat(h),h),u(n,"fixed-".concat(b),b),u(n,"sticky-".concat(f),f),n)),l),A=x&&!0===x?"container":"container-".concat(x);return i.createElement(O,d({},k,{className:N}),x?i.createElement("div",{className:A},y):y)}v.propTypes=m;const b=v}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[607],{2553:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var n=r(9379),o=r(9950),s=r(1646),a=r(5488),c=r(3452),i=r(5077),l=r(6713),u=r(5553),d=r(4127),f=r(4979),p=r(5283),b=r(4414);const h=function(){const e=(0,i.Zp)(),t=(0,l.O$)(u.A,(e=>e.auth)),[r,h]=(0,o.useState)({}),[y,m]=(0,o.useState)({}),[v,g]=(0,p.A)({}),w=()=>{m({}),h({error:!0})};return(0,o.useEffect)((()=>{window.lintrk&&window.lintrk("track",{conversion_id:11485730})}),[]),(0,b.jsx)("div",{className:"d-flex justify-content-center align-items-center auth-centered-container",children:(0,b.jsx)("div",{className:"login-form",children:r.processing?(0,b.jsx)(f.A,{header:"setting account password",spinner:!0,relative:!0}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h2",{className:"mb-2 instructions",children:"Add an account password"}),(0,b.jsx)("span",{className:"text-small text-bold d-inline-block my-2 ".concat(r.error?"text-danger":""),children:(0,b.jsx)("i",{children:"8 char min., 1 lower case, 1 upper case, 1 number, 1 special char."})}),(0,b.jsx)(s.A,{className:"mb-4 d-block",children:(0,b.jsx)(a.A,{id:"password1",onChange:e=>m((0,n.A)((0,n.A)({},y),{},{password:e.target.value})),disabled:r.submitted,className:"mb-2 text-center",type:"password",title:"password",placeholder:"Add Password"})}),(0,b.jsx)(c.A,{type:"submit",id:"updateMyPassword",className:"border-0 rounded-pill btn-gradient-blue",block:!0,onClick:async()=>{h({submitted:!0});const{password:r}=y;if(r&&/^(?=.*[\d])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*])[\w!@#$%^&*]{8,}$/.test(r)){h({processing:!0});const o=await(0,d.A)({auth:t,user_id:t.user_id,password:r});!o||o.passwordError?w():(g((0,n.A)((0,n.A)({},v),{},{pass:r})),setTimeout(e("/"),100))}else w()},disabled:r.submitted||y.processing,title:"Add Account Password",children:"Submit Account Password"})]})})})}},4127:(e,t,r)=>{r.d(t,{A:()=>i});var n=r(9379),o=r(2714),s=r(5553),a=r(3628),c=r(5996);const i=async e=>{let{auth:t,user_id:r,password:i}=e,l=null;try{if(l=await(0,o.A)({endpoint:"updatePassword",method:"POST",payload:{user_id:r,password:i,loggingIn:!0},auth:t}),l.error){const e=(0,n.A)((0,n.A)((0,n.A)({},t),l),{},{passwordError:Date.now()});return s.A.update((t=>{t.auth=e})),e}const e=(0,n.A)((0,n.A)((0,n.A)({},t),{},{passwordSuccess:Date.now(),update_password:!1},l),{},{pass:i});return s.A.update((t=>{t.auth=e})),e}catch(u){return(0,a.A)({type:"lms data",status:"error",url:c.A.lms_api_url,operation:"updatePassword",request:{user_id:r},error:{catch:u.toString()}})}}},5488:(e,t,r)=>{r.d(t,{A:()=>w});var n=r(9950),o=r(1942),s=r.n(o),a=r(8738),c=r.n(a),i=r(1497);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var u=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m(e);if(t){var o=m(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}(this,r)}}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var v={children:s().node,type:s().string,size:s().oneOfType([s().number,s().string]),bsSize:s().string,valid:s().bool,invalid:s().bool,tag:i.Wx,innerRef:s().oneOfType([s().object,s().func,s().string]),plaintext:s().bool,addon:s().bool,className:s().string,cssModule:s().object},g=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(a,e);var t,r,o,s=h(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=s.call(this,e)).getRef=t.getRef.bind(y(t)),t.focus=t.focus.bind(y(t)),t}return t=a,(r=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var e=this.props,t=e.className,r=e.cssModule,o=e.type,s=void 0===o?"text":o,a=e.bsSize,l=e.valid,p=e.invalid,b=e.tag,h=e.addon,y=e.plaintext,m=e.innerRef,v=f(e,u),g=["switch","radio","checkbox"].indexOf(s)>-1,w="select"===s,O="range"===s,j=b||(w||"textarea"===s?s:"input"),x="form-control";y?(x="".concat(x,"-plaintext"),j=b||"input"):O?x="form-range":w?x="form-select":g&&(x=h?null:"form-check-input"),v.size&&/\D/g.test(v.size)&&((0,i.mc)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),a=v.size,delete v.size);var A=(0,i.qO)(c()(t,p&&"is-invalid",l&&"is-valid",!!a&&(w?"form-select-".concat(a):"form-control-".concat(a)),x),r);return("input"===j||b&&"function"===typeof b)&&(v.type="switch"===s?"checkbox":s),v.children&&!y&&"select"!==s&&"string"===typeof j&&"select"!==j&&((0,i.mc)('Input with a type of "'.concat(s,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete v.children),n.createElement(j,d({},v,{ref:m,className:A,"aria-invalid":p}))}}])&&p(t.prototype,r),o&&p(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(n.Component);g.propTypes=v;const w=g},1646:(e,t,r)=>{r.d(t,{A:()=>g});var n=r(9950),o=r(1942),s=r.n(o),a=r(8738),c=r.n(a),i=r(1497),l=["className","cssModule","hidden","widths","tag","check","size","for"];function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=["xs","sm","md","lg","xl","xxl"],b=s().oneOfType([s().number,s().string]),h=s().oneOfType([s().bool,s().string,s().number,s().shape({size:b,order:b,offset:b})]),y={children:s().node,hidden:s().bool,check:s().bool,size:s().string,for:s().string,tag:i.Wx,className:s().string,cssModule:s().object,xs:h,sm:h,md:h,lg:h,xl:h,xxl:h,widths:s().array},m=function(e,t,r){return!0===r||""===r?e?"col":"col-".concat(t):"auto"===r?e?"col-auto":"col-".concat(t,"-auto"):e?"col-".concat(r):"col-".concat(t,"-").concat(r)};function v(e){var t=e.className,r=e.cssModule,o=e.hidden,s=e.widths,a=void 0===s?p:s,b=e.tag,h=void 0===b?"label":b,y=e.check,v=e.size,g=e.for,w=f(e,l),O=[];a.forEach((function(t,n){var o=e[t];if(delete w[t],o||""===o){var s,a=!n;if((0,i.Gv)(o)){var l,u=a?"-":"-".concat(t,"-");s=m(a,t,o.size),O.push((0,i.qO)(c()((d(l={},s,o.size||""===o.size),d(l,"order".concat(u).concat(o.order),o.order||0===o.order),d(l,"offset".concat(u).concat(o.offset),o.offset||0===o.offset),l))),r)}else s=m(a,t,o),O.push(s)}}));var j=v||O.length,x=!(y||j),A=(0,i.qO)(c()(t,!!o&&"visually-hidden",!!y&&"form-check-label",!!v&&"col-form-label-".concat(v),O,!!j&&"col-form-label",!!x&&"form-label"),r);return n.createElement(h,u({htmlFor:g},w,{className:A}))}v.propTypes=y;const g=v}}]);
|
package/utility/hdbTerms.d.ts
CHANGED
|
@@ -552,7 +552,7 @@ export declare const CONFIG_PARAMS: {
|
|
|
552
552
|
readonly REPLICATION_DATABASES: "replication_databases";
|
|
553
553
|
readonly REPLICATION_ENABLEROOTCAS: "replication_enableRootCAs";
|
|
554
554
|
readonly REPLICATION_SHARD: "replication_shard";
|
|
555
|
-
readonly
|
|
555
|
+
readonly REPLICATION_BLOBTIMEOUT: "replication_blobTimeout";
|
|
556
556
|
readonly ROOTPATH: "rootPath";
|
|
557
557
|
readonly SERIALIZATION_BIGINT: "serialization_bigInt";
|
|
558
558
|
readonly STORAGE_WRITEASYNC: "storage_writeAsync";
|