harperdb 4.3.20 → 4.4.0-alpha.1

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.
Files changed (98) hide show
  1. package/README.md +1 -1
  2. package/bin/harperdb.js +85 -72
  3. package/bin/lite.js +32 -22
  4. package/config/yaml/defaultConfig.yaml +9 -41
  5. package/config/yaml/defaultNatsConfig.yaml +36 -0
  6. package/index.d.ts +1 -0
  7. package/json/systemSchema.json +32 -79
  8. package/launchServiceScripts/launchInstallNATSServer.js +4 -4
  9. package/launchServiceScripts/launchNatsIngestService.js +32 -22
  10. package/launchServiceScripts/launchNatsReplyService.js +32 -22
  11. package/launchServiceScripts/launchUpdateNodes4-0-0.js +32 -22
  12. package/npm-shrinkwrap.json +1650 -1330
  13. package/package.json +30 -20
  14. package/resources/DatabaseTransaction.d.ts +1 -0
  15. package/resources/RecordEncoder.d.ts +3 -1
  16. package/resources/Resource.d.ts +8 -2
  17. package/resources/ResourceInterface.d.ts +7 -3
  18. package/resources/Resources.d.ts +5 -4
  19. package/resources/Table.d.ts +619 -0
  20. package/resources/auditStore.d.ts +45 -1
  21. package/resources/databases.d.ts +454 -0
  22. package/resources/search.d.ts +6 -0
  23. package/resources/transactionBroadcast.d.ts +2 -1
  24. package/server/Server.d.ts +1 -1
  25. package/server/jobs/jobProcess.js +32 -22
  26. package/server/serverHelpers/Headers.d.ts +8 -0
  27. package/server/threads/threadServer.js +32 -22
  28. package/studio/build-local/asset-manifest.json +36 -36
  29. package/studio/build-local/index.html +1 -1
  30. package/studio/build-local/static/css/main.6c0f1b63.css +13 -0
  31. package/studio/build-local/static/js/{424.7d57284b.chunk.js → 424.ad87c8fd.chunk.js} +1 -1
  32. package/studio/build-local/static/js/{662.02ce7b65.chunk.js → 662.92e32ffc.chunk.js} +1 -1
  33. package/studio/build-local/static/js/723.c58acced.chunk.js +2 -0
  34. package/studio/build-local/static/js/807.510f66df.chunk.js +2 -0
  35. package/studio/build-local/static/js/browse-csvupload.453237f3.chunk.js +1 -0
  36. package/studio/build-local/static/js/browse-datatable.b9ef2d28.chunk.js +1 -0
  37. package/studio/build-local/static/js/browse-entitymanager.50827a5a.chunk.js +1 -0
  38. package/studio/build-local/static/js/browse-jsonviewer.a2534004.chunk.js +1 -0
  39. package/studio/build-local/static/js/custom-functions.dd7e182c.chunk.js +1 -0
  40. package/studio/build-local/static/js/instance-charts.34d15f02.chunk.js +1 -0
  41. package/studio/build-local/static/js/instance-cluster.5bce430c.chunk.js +1 -0
  42. package/studio/build-local/static/js/instance-config.70c17b53.chunk.js +1 -0
  43. package/studio/build-local/static/js/instance-query.4f6eec62.chunk.js +1 -0
  44. package/studio/build-local/static/js/instance-roles.507a4ed0.chunk.js +1 -0
  45. package/studio/build-local/static/js/instance-status.ce9d7f64.chunk.js +1 -0
  46. package/studio/build-local/static/js/instance-users-datatable.190640fd.chunk.js +1 -0
  47. package/studio/build-local/static/js/{instance-users-edit.436e0908.chunk.js → instance-users-edit.d2444479.chunk.js} +1 -1
  48. package/studio/build-local/static/js/instance-users.eabfbbde.chunk.js +1 -0
  49. package/studio/build-local/static/js/instance.a163623f.chunk.js +1 -0
  50. package/studio/build-local/static/js/instances.6b88a87c.chunk.js +1 -0
  51. package/studio/build-local/static/js/main.4fd117ad.js +2 -0
  52. package/studio/build-local/static/js/offline-app.7371216b.chunk.js +1 -0
  53. package/studio/build-local/static/js/online-app.db436eec.chunk.js +1 -0
  54. package/studio/build-local/static/js/organization-billing.b2f260f0.chunk.js +1 -0
  55. package/studio/build-local/static/js/organization-users.b6171b18.chunk.js +1 -0
  56. package/studio/build-local/static/js/organization.7800f16a.chunk.js +1 -0
  57. package/studio/build-local/static/js/organizations.8bb505f2.chunk.js +1 -0
  58. package/studio/build-local/static/js/profile.292bdd86.chunk.js +1 -0
  59. package/studio/build-local/static/js/roles-jsonviewer.c11f1816.chunk.js +1 -0
  60. package/studio/build-local/static/js/signIn.b11bdc50.chunk.js +1 -0
  61. package/studio/build-local/static/js/signUp.564d4e0b.chunk.js +1 -0
  62. package/studio/build-local/static/js/structure-reloader.b6de4091.chunk.js +1 -0
  63. package/studio/build-local/static/js/topnav.4fd41d60.chunk.js +1 -0
  64. package/utility/scripts/restartHdb.js +32 -22
  65. package/studio/build-local/static/css/main.038ec116.css +0 -13
  66. package/studio/build-local/static/js/723.36068040.chunk.js +0 -2
  67. package/studio/build-local/static/js/807.3473ab0a.chunk.js +0 -2
  68. package/studio/build-local/static/js/browse-csvupload.5e77eb8a.chunk.js +0 -1
  69. package/studio/build-local/static/js/browse-datatable.cd71d518.chunk.js +0 -1
  70. package/studio/build-local/static/js/browse-entitymanager.09237801.chunk.js +0 -1
  71. package/studio/build-local/static/js/browse-jsonviewer.fcccabdc.chunk.js +0 -1
  72. package/studio/build-local/static/js/custom-functions.98af4a5e.chunk.js +0 -1
  73. package/studio/build-local/static/js/instance-charts.f1a1969d.chunk.js +0 -1
  74. package/studio/build-local/static/js/instance-cluster.0dc3ac1b.chunk.js +0 -1
  75. package/studio/build-local/static/js/instance-config.19223fab.chunk.js +0 -1
  76. package/studio/build-local/static/js/instance-query.ed7e59f5.chunk.js +0 -1
  77. package/studio/build-local/static/js/instance-roles.9c3f140d.chunk.js +0 -1
  78. package/studio/build-local/static/js/instance-status.1687cd77.chunk.js +0 -1
  79. package/studio/build-local/static/js/instance-users-datatable.ced7813f.chunk.js +0 -1
  80. package/studio/build-local/static/js/instance-users.12c0c117.chunk.js +0 -1
  81. package/studio/build-local/static/js/instance.b8863754.chunk.js +0 -1
  82. package/studio/build-local/static/js/instances.5bd051eb.chunk.js +0 -1
  83. package/studio/build-local/static/js/main.35352915.js +0 -2
  84. package/studio/build-local/static/js/offline-app.b3ad12ac.chunk.js +0 -1
  85. package/studio/build-local/static/js/online-app.2ac03c15.chunk.js +0 -1
  86. package/studio/build-local/static/js/organization-billing.a8014c6f.chunk.js +0 -1
  87. package/studio/build-local/static/js/organization-users.523136d9.chunk.js +0 -1
  88. package/studio/build-local/static/js/organization.0abc89ca.chunk.js +0 -1
  89. package/studio/build-local/static/js/organizations.e536b86f.chunk.js +0 -1
  90. package/studio/build-local/static/js/profile.92f9be59.chunk.js +0 -1
  91. package/studio/build-local/static/js/roles-jsonviewer.5fe72bc9.chunk.js +0 -1
  92. package/studio/build-local/static/js/signIn.97bded2f.chunk.js +0 -1
  93. package/studio/build-local/static/js/signUp.482f9fe4.chunk.js +0 -1
  94. package/studio/build-local/static/js/structure-reloader.9322abd3.chunk.js +0 -1
  95. package/studio/build-local/static/js/topnav.5e7913a5.chunk.js +0 -1
  96. /package/studio/build-local/static/js/{723.36068040.chunk.js.LICENSE.txt → 723.c58acced.chunk.js.LICENSE.txt} +0 -0
  97. /package/studio/build-local/static/js/{807.3473ab0a.chunk.js.LICENSE.txt → 807.510f66df.chunk.js.LICENSE.txt} +0 -0
  98. /package/studio/build-local/static/js/{main.35352915.js.LICENSE.txt → main.4fd117ad.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[422],{8527:(e,t,a)=>{a.r(t),a.d(t,{default:()=>B});var r=a(7313),n=a(8467),o=a(7786),s=a(7387),i=a(4122),l=a(6160),c=a(9842),d=a(5733),u=a(6449),p=a(9266),m=a(511),_=a(7377),v=a(6417);const h=function(){return(0,v.jsx)(_.Z,{header:"HarperDB Studio Is Being Updated",body:"Please check back in a few minutes and get ready for a whole new batch of awesome!"})};var g=a(4220),Z=a(6140),x=a(2227),y=a(2982),j=a(9476),w=a(1007);var b=a(1337),f=a(8149),k=a(3295),S=a(6005);const E=(0,r.lazy)((()=>a.e(467).then(a.bind(a,2471)))),A=(0,r.lazy)((()=>a.e(150).then(a.bind(a,5313)))),N=(0,r.lazy)((()=>a.e(803).then(a.bind(a,3929)))),T=(0,r.lazy)((()=>a.e(58).then(a.bind(a,7661)))),O=(0,r.lazy)((()=>a.e(578).then(a.bind(a,4904)))),I=(0,r.lazy)((()=>Promise.all([a.e(409),a.e(26)]).then(a.bind(a,9924)))),z=(0,r.lazy)((()=>Promise.all([a.e(287),a.e(250)]).then(a.bind(a,1412)))),P=(0,r.lazy)((()=>Promise.all([a.e(287),a.e(228),a.e(926),a.e(620)]).then(a.bind(a,2829)))),U=(0,r.lazy)((()=>Promise.all([a.e(409),a.e(896)]).then(a.bind(a,5920)))),C=(0,r.lazy)((()=>Promise.all([a.e(409),a.e(845)]).then(a.bind(a,7875)))),R={timeout:0,position:l.m7.BOTTOM_CENTER};let F;function q(e){const{customer_id:t}=(0,n.UO)();return e.auth.orgs.some((e=>e.customer_id===t))?(0,v.jsx)(n.j3,{}):(0,v.jsx)(n.Fg,{to:"/organization",replace:!0})}const B=function(){const e=document.querySelector('link[rel="canonical"]'),t=(0,n.s0)(),a=(0,l.VY)(),B=(0,n.TH)(),{search:D,pathname:G}=B,{redirect:W}=d.Z.parse(D),K=(0,s.Kw)(u.Z,(e=>e.auth)),L=(0,s.Kw)(u.Z,(e=>e.theme)),H=(0,s.Kw)(u.Z,(e=>e.products)),J=(0,s.Kw)(u.Z,(e=>e.regions)),M=(0,s.Kw)(u.Z,(e=>e.wavelengthRegions)),V=(0,s.Kw)(u.Z,(e=>e.akamaiRegions)),X=(0,s.Kw)(u.Z,(e=>e.version)),[Y,Q]=(0,r.useState)(!0),[$,ee]=(0,r.useState)(!1),[te,ae]=(0,p.Z)({}),re=null===K||void 0===K?void 0:K.user_id,ne=re&&-1===(null===K||void 0===K?void 0:K.email.indexOf("harperdb.io"))&&-1===(null===K||void 0===K?void 0:K.email.indexOf("deliciousmonster.com")),oe=(null===X||void 0===X?void 0:X.maintenance)&&ne;return o.ZP.initialize(m.Z.google_analytics_code),(0,r.useEffect)((()=>{o.ZP.send({hitType:"pageview",page:window.location.pathname+window.location.search})}),[B.pathname]),(0,r.useEffect)((()=>{(0,k.Z)(null===te||void 0===te?void 0:te.theme)}),[null===te||void 0===te?void 0:te.theme]),(0,r.useEffect)((()=>{ee((e=>{let{apiVersion:t}=e;if(t){let e=!1;try{const a=m.Z.studio_version.split("."),r=t.split("."),n=parseInt(a[0],10)<parseInt(r[0],10),o=parseInt(a[0],10)===parseInt(r[0],10)&&parseInt(a[1],10)<parseInt(r[1],10),s=parseInt(a[0],10)===parseInt(r[0],10)&&parseInt(a[1],10)===parseInt(r[1],10)&&parseInt(a[2],10)<parseInt(r[2],10);(n||o||s)&&(e=t)}catch(a){return!1}return e}return!1})({apiVersion:X.studio}))}),[X.studio]),(0,r.useEffect)((()=>{null!==K&&void 0!==K&&K.email&&(window._kmq&&window._kmq.push(["identify",K.email]),null!==K&&void 0!==K&&K.update_password&&t("/update-password"),W&&t(W))}),[null===K||void 0===K?void 0:K.email]),(0,r.useEffect)((()=>{$&&a.info("HarperDB Studio v".concat($," is now available. Refresh to update."),R)}),[$]),(0,r.useEffect)((()=>{e.href=window.location.href}),[B,e]),(0,r.useEffect)((()=>{(0,b.Z)({currentPath:B.pathname,navigate:t,persistedUser:te,setPersistedUser:ae,setFetchingUser:Q,controller:F})}),[]),(0,i.Z)((()=>{H||(0,x.Z)(),J||(0,y.Z)(),M||(0,j.Z)(),V||(0,S.Z)()}),m.Z.refresh_content_interval),(0,i.Z)((()=>{(0,w.Z)(),(0,f.Z)({auth:K,controller:F})}),m.Z.check_version_interval),(0,v.jsxs)("div",{className:"".concat(L," ").concat(m.Z.maintenance?"maintenance":""),children:[(0,v.jsxs)("div",{id:"app-container",children:[(0,v.jsx)(r.Suspense,{fallback:(0,v.jsx)(_.Z,{header:" ",spinner:!0}),children:(0,v.jsx)(E,{isMaintenance:oe,loggedIn:!0})}),Y?(0,v.jsx)(_.Z,{header:"signing in",spinner:!0}):re?(0,v.jsx)(c.SV,{FallbackComponent:g.Z,children:(0,v.jsx)(r.Suspense,{fallback:(0,v.jsx)(_.Z,{header:" ",spinner:!0}),children:(0,v.jsxs)(n.Z5,{children:[(0,v.jsx)(n.AW,{element:oe?(0,v.jsx)(h,{}):(0,v.jsx)(O,{}),path:"/update-password"}),(0,v.jsx)(n.AW,{element:oe?(0,v.jsx)(h,{}):(0,v.jsx)(C,{}),path:"/profile/*"}),(0,v.jsxs)(n.AW,{element:oe?(0,v.jsx)(h,{}):(0,v.jsx)(q,{auth:K}),children:[(0,v.jsx)(n.AW,{element:(0,v.jsx)(U,{}),path:"/o/:customer_id/i/:compute_stack_id/*"}),(0,v.jsx)(n.AW,{element:(0,v.jsx)(P,{}),path:"/o/:customer_id/instances/:action?/:purchaseStep?"}),(0,v.jsx)(n.AW,{element:(0,v.jsx)(I,{}),path:"/o/:customer_id/*"})]}),(0,v.jsx)(n.AW,{element:oe?(0,v.jsx)(h,{}):(0,v.jsx)(z,{}),path:"/:list?/:action?"}),(0,v.jsx)(n.AW,{element:(0,v.jsx)(n.Fg,{to:"/",replace:!0})})]})})}):(0,v.jsx)(c.SV,{FallbackComponent:Z.Z,children:(0,v.jsx)(r.Suspense,{fallback:(0,v.jsx)(_.Z,{header:" ",spinner:!0}),children:(0,v.jsxs)(n.Z5,{children:[(0,v.jsx)(n.AW,{element:(0,v.jsx)(N,{}),path:"/"}),(0,v.jsx)(n.AW,{element:m.Z.maintenance?(0,v.jsx)(h,{}):(0,v.jsx)(A,{}),path:"/sign-up"}),(0,v.jsx)(n.AW,{element:oe?(0,v.jsx)(h,{}):(0,v.jsx)(T,{}),path:"/reset-password"}),(0,v.jsx)(n.AW,{path:"*",element:(0,v.jsx)(n.Fg,{to:"/?redirect=".concat(G).concat(D),replace:!0})})]})})})]}),(0,v.jsx)("div",{id:"app-bg-color"}),(0,v.jsxs)("div",{className:"version",children:["HarperDB Studio v",m.Z.studio_version,X.maintenance&&" - MAINTENANCE MODE"]})]})}},4220:(e,t,a)=>{a.d(t,{Z:()=>c});a(7313);var r=a(238),n=a(3516),o=a(6782),s=a(5399),i=a(9327),l=a(6417);const c=function(e){let{error:t,componentStack:a,resetErrorBoundary:c,extraClass:d}=e;return(0,l.jsx)(r.Z,{className:"error-boundary mb-3 ".concat(d),children:(0,l.jsxs)(n.Z,{children:[(0,l.jsxs)("b",{children:["Component Error ",(new Date).toLocaleTimeString()]}),(0,l.jsx)("hr",{className:"my-1"}),(0,l.jsx)("div",{className:"error-message",children:t.message}),(0,l.jsx)("hr",{className:"my-1"}),(0,l.jsx)("div",{className:"stack-trace",children:(0,l.jsx)("pre",{children:a})}),(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(s.Z,{children:(0,l.jsx)(i.Z,{color:"danger",block:!0,href:"https://harperdbhelp.zendesk.com/hc/en-us/requests/new",target:"_blank",rel:"noopener noreferrer",children:"Create A Support Ticket"})}),(0,l.jsx)(s.Z,{children:(0,l.jsx)(i.Z,{color:"success",block:!0,onClick:c,children:"Retry Component Load"})})]})]})})}},6140:(e,t,a)=>{a.d(t,{Z:()=>i});a(7313);var r=a(2135),n=a(4220),o=a(511),s=a(6417);const i=function(e){let{error:t,componentStack:a,resetErrorBoundary:i}=e;return(0,s.jsxs)("div",{id:"login-form",children:[(0,s.jsx)("div",{id:"login-logo",title:"HarperDB Logo"}),(0,s.jsxs)("div",{className:"version",children:["Studio v",o.Z.studio_version]}),(0,s.jsx)(n.Z,{error:t,componentStack:a}),(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)(r.OL,{to:"/",className:"login-nav-link",onClick:i,children:"Back to Login"})})]})}},7377:(e,t,a)=>{a.d(t,{Z:()=>c});var r=a(238),n=a(3516),o=a(6782),s=a(5399),i=(a(7313),a(2135)),l=a(6417);const c=function(e){let{header:t,body:a,spinner:c,links:d=!1,relative:u=!1}=e;return(0,l.jsxs)("div",{className:"loader ".concat(u?"relative":""),children:[(0,l.jsx)(r.Z,{className:"mb-3",children:(0,l.jsxs)(n.Z,{className:"text-center",children:[(0,l.jsxs)("div",{className:"mb-3",children:["\xa0",t,"\xa0"]}),(0,l.jsxs)("div",{className:"mt-2",children:["\xa0",c&&(0,l.jsx)("i",{className:"fa fa-spinner fa-spin"}),"\xa0"]}),(0,l.jsxs)("div",{className:"mt-2",children:["\xa0",a,"\xa0"]})]})}),d?(0,l.jsx)(o.Z,{children:d.map((e=>(0,l.jsx)(s.Z,{className:"login-nav-link-holder ".concat(e.className||""),children:(0,l.jsx)(i.OL,{to:e.to,className:"login-nav-link",children:e.text})},e.to)))}):(0,l.jsx)("div",{className:"login-nav-link",children:"\xa0"})]})}},2261:(e,t,a)=>{a.d(t,{Z:()=>o});var r=a(8093),n=a(511);const o=async e=>{let{type:t="studio component",status:a="warn",url:o,operation:s,request:i,error:l,customer_id:c,compute_stack_id:d}=e,u=!1;try{var p;u=JSON.parse(localStorage.getItem("persistedUser"));const e={type:t,status:"studio component"===t?"warn":a,environment:n.Z.env,user:(null===(p=u)||void 0===p?void 0:p.email)||"unknown",customer_id:c,compute_stack_id:d,url:o,operation:s,request:{...i,password:null!==i&&void 0!==i&&i.password?"xxxxxxxxx":void 0},error:l,timestamp:Date.now()},m=await(0,r.he)("".concat(n.Z.lms_api_url,"addError"),{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",authorization:void 0}}),_=await m.json();(_.body||_).error||console.log("Reported ",n.Z.env,e.status,t,s)}catch(m){console.log(m)}}},6005:(e,t,a)=>{a.d(t,{Z:()=>s});var r=a(6449),n=a(2261),o=a(511);const s=async()=>{let e=null;try{e=[{value:"ap-west",label:"Mumbai, IN",country:"in"},{value:"ca-central",label:"Toronto, CA",country:"ca"},{value:"ap-southeast",label:"Sydney, AU",country:"au"},{value:"us-central",label:"Dallas, TX",country:"us"},{value:"us-west",label:"Fremont, CA",country:"us"},{value:"us-southeast",label:"Atlanta, GA",country:"us"},{value:"us-east",label:"Newark, NJ",country:"us"},{value:"eu-west",label:"London, UK",country:"uk"},{value:"ap-south",label:"Singapore, SG",country:"sg"},{value:"eu-central",label:"Frankfurt, DE",country:"de"},{value:"ap-northeast",label:"Tokyo, JP",country:"jp"}].sort(((e,t)=>e.label<t.label?-1:1));let t=[];return Array.isArray(e)&&(t=e),r.Z.update((e=>{e.akamaiRegions=t}))}catch(t){return(0,n.Z)({type:"lms data",status:"error",url:o.Z.lms_api_url,operation:"getAkamaiRegions",error:{catch:t.toString()}})}}},1007:(e,t,a)=>{a.d(t,{Z:()=>i});var r=a(576),n=a(6449),o=a(511),s=a(2261);const i=async()=>{let e=null;try{return e=await(0,r.Z)({endpoint:"getCurrentVersion",method:"POST"}),e.number?(e.studio||(e.studio=o.Z.studio_version),n.Z.update((t=>{t.version=e}))):!1}catch(t){return(0,s.Z)({type:"lms data",status:"error",url:o.Z.lms_api_url,operation:"getCurrentVersion",error:{catch:t.toString()}})}}},2227:(e,t,a)=>{a.d(t,{Z:()=>d});var r=a(576),n=a(6449),o=a(2261),s=a(8329),i=a(9274),l=a(511);const c={dev:{cloud_compute:"prod_Gh1XXQx6J8YaJl",local_compute:"prod_GoB3yLzygPeGMu",wavelength_compute:"prod_KloxOQofDaLs7q",akamai_compute:"prod_O2DOH61yn3qP6g",cloud_storage:"prod_GoUJnVwOYvTjU9"},stage:{cloud_compute:"prod_Gh1XXQx6J8YaJl",local_compute:"prod_GoB3yLzygPeGMu",wavelength_compute:"prod_KloxOQofDaLs7q",akamai_compute:"prod_O2DOH61yn3qP6g",cloud_storage:"prod_GoUJnVwOYvTjU9"},prod:{cloud_compute:"prod_GdDIHGH6lzEqgv",local_compute:"prod_H0Xx9dKkQqhMx9",wavelength_compute:"prod_KlorPRd9r1RKcz",akamai_compute:"prod_O7j9wiS1g7kPZU",cloud_storage:"prod_H0XnsrToBa7a7G"}},d=async()=>{try{const e=await(0,r.Z)({endpoint:"getProducts",method:"POST"});return!e.error&&n.Z.update((t=>{var a,r,n,o,d;t.products={cloud_storage:(0,i.Z)((null===(a=e.find((e=>e.id===c[l.Z.env].cloud_storage)))||void 0===a?void 0:a.plans.filter((e=>!e.metadata.prepaid)))||[]),cloud_compute:(0,s.Z)((null===(r=e.find((e=>e.id===c[l.Z.env].cloud_compute)))||void 0===r?void 0:r.plans.filter((e=>!e.metadata.prepaid)))||[]),wavelength_compute:(0,s.Z)((null===(n=e.find((e=>e.id===c[l.Z.env].wavelength_compute)))||void 0===n?void 0:n.plans.filter((e=>!e.metadata.prepaid)))||[]),akamai_compute:(0,s.Z)((null===(o=e.find((e=>e.id===c[l.Z.env].akamai_compute)))||void 0===o?void 0:o.plans.filter((e=>!e.metadata.prepaid)))||[]),local_compute:(0,s.Z)((null===(d=e.find((e=>e.id===c[l.Z.env].local_compute)))||void 0===d?void 0:d.plans.filter((e=>!e.metadata.prepaid)))||[])}}))}catch(e){return(0,o.Z)({type:"lms data",status:"error",url:l.Z.lms_api_url,operation:"getProducts",error:{catch:e.toString()}})}}},2982:(e,t,a)=>{a.d(t,{Z:()=>i});var r=a(576),n=a(6449),o=a(2261),s=a(511);const i=async()=>{let e=null;try{e=await(0,r.Z)({endpoint:"getRegions",method:"POST"});let t=[];return Array.isArray(e)&&(t=e),n.Z.update((e=>{e.regions=t}))}catch(t){return(0,o.Z)({type:"lms data",status:"error",url:s.Z.lms_api_url,operation:"getRegions",error:{catch:t.toString()}})}}},6345:(e,t,a)=>{a.d(t,{Z:()=>i});var r=a(576),n=a(6449),o=a(2261),s=a(511);const i=async e=>{let{email:t,pass:a,loggingIn:i=!1,signal:l}=e,c=null;try{return c=await(0,r.Z)({endpoint:"getUser",method:"POST",signal:l,payload:{email:t,password:a,loggingIn:i}}),c.error&&i?n.Z.update((e=>{e.auth={...c,time:Date.now()}})):!c.error&&(c.orgs?Array.isArray(c.orgs)||(c.orgs=[c.orgs]):c.orgs=[{customer_id:c.customer_id.toString(),customer_name:"".concat(c.firstname,"'s Org"),status:"owner"}],n.Z.update((e=>{e.auth={email:t,pass:a,...c}})))}catch(d){return i||(0,o.Z)({type:"lms data",status:"error",url:s.Z.lms_api_url,operation:"getUser",error:{catch:d.message}}),n.Z.update((e=>{e.auth={error:!0,message:d.message,time:Date.now()}}))}}},9476:(e,t,a)=>{a.d(t,{Z:()=>i});var r=a(576),n=a(6449),o=a(2261),s=a(511);const i=async()=>{let e=null;try{e=await(0,r.Z)({endpoint:"wl/getWavelengthRegions",method:"POST"});let t=[];return Array.isArray(e)&&(t=e.map((e=>({label:"".concat(e.communications_service_provider.replace(/(^\w{1})|(\s+\w{1})/g,(e=>e.toUpperCase()))," / ").concat(e.location.replace(/(^\w{1})|(\s+\w{1})/g,(e=>e.toUpperCase()))),value:e.wavelength_zone_id})))),n.Z.update((e=>{e.wavelengthRegions=t}))}catch(t){return(0,o.Z)({type:"lms data",status:"error",url:s.Z.lms_api_url,operation:"getWavelengthRegions",error:{catch:t.toString()}})}}},576:(e,t,a)=>{a.d(t,{Z:()=>s});var r=a(8093),n=a(511),o=a(2261);const s=async e=>{let{endpoint:t,payload:a,auth:s,signal:i}=e;const l={type:"lms api",status:"error",url:n.Z.lms_api_url,operation:t,request:a,customer_id:null===a||void 0===a?void 0:a.customer_id,compute_stack_id:null===a||void 0===a?void 0:a.compute_stack_id};try{const e=await(0,r.he)("".concat(n.Z.lms_api_url).concat(t),{signal:i,method:"POST",body:JSON.stringify(a),headers:null!==s&&void 0!==s&&s.email&&null!==s&&void 0!==s&&s.pass?{"Content-Type":"application/json",authorization:"Basic ".concat(btoa("".concat(s.email,":").concat(s.pass)))}:{"Content-Type":"application/json"}}),c=await e.json(),d=c.body||c;return d.errorType?((0,o.Z)({...l,status:"warn",error:d}),{error:!0,message:d.errorMessage}):d.error||"Internal server error"===d.message?(a.loggingIn||(0,o.Z)({...l,error:d}),{error:!0,message:d.message.replace(/Validation error:|Throttling error:|Bad request:|Internal Server Error:|Unauthorized:|StripeInvalidRequestError:|TypeError:/g,"").trim()||"The server did not respond"}):d}catch(c){return["Aborted","Network request failed"].includes(c.message)||"TypeError: Network request failed"===c||(0,o.Z)({...l,error:{catch:c.message}}),{error:!0,message:c.message}}}},3295:(e,t,a)=>{a.d(t,{Z:()=>r});const r=e=>{document.getElementById("dynamic-favicon").href="/images/favicon_".concat(e||"purple",".png")}},1337:(e,t,a)=>{a.d(t,{Z:()=>u});var r=a(1007),n=a(2227),o=a(2982),s=a(9476),i=a(6005),l=a(6449),c=a(8149),d=a(511);const u=e=>{var t;let{currentPath:a,navigate:u,setFetchingUser:p,persistedUser:m,setPersistedUser:_,instanceAuths:v,controller:h}=e;return(e=>{const t=window.location.host.indexOf("lumen")>=0,a=window.location.host.indexOf("verizon")>=0,r=window.location.host.indexOf("akamai")>=0,n=t?["lumen"]:a?["verizon"]:r?["akamai"]:["purple","light","dark"];l.Z.update((o=>{o.theme=1===n.length?n[0]:n.indexOf(e)>=0?e:"dark",o.themes=n,o.is_lumen=t,o.is_verizon=a,o.is_akamai=r}))})(m.theme),d.Z.is_local_studio?(l.Z.update((e=>{e.instances=[{compute_stack_id:"local",url:d.Z.local_studio_dev_url||"/",instance_name:"local"}]})),p(!1),null!==v&&void 0!==v&&null!==(t=v.local)&&void 0!==t&&t.valid?(p(!1),setTimeout(u("/o/local/i/local/browse"),10)):u("/")):["/sign-up","/reset-password","/resend-registration-email"].includes(a)?(p(!1),_({})):["/sign-in"].includes(a)?u("/"):(null!==m&&void 0!==m&&m.email?(0,c.Z)({auth:m,controller:h,setFetchingUser:p,loggingIn:!0}):p(!1),(0,r.Z)(),(0,n.Z)(),(0,o.Z)(),(0,s.Z)(),(0,i.Z)(),l.Z.update((e=>{e.auth={email:null===m||void 0===m?void 0:m.email,pass:null===m||void 0===m?void 0:m.pass}})))}},8149:(e,t,a)=>{a.d(t,{Z:()=>n});var r=a(6345);const n=async e=>{let{auth:t,loggingIn:a=!1,controller:n,setFetchingUser:o=!1}=e;null!==t&&void 0!==t&&t.email&&null!==t&&void 0!==t&&t.pass&&(n=new AbortController,o&&o(!0),await(0,r.Z)({...t,loggingIn:a,signal:n.signal}),o&&o(!1))}},8329:(e,t,a)=>{a.d(t,{Z:()=>n});var r=a(1842);const n=e=>{const t=[];return e.map((e=>{let{id:a,amount_decimal:n,interval:o,amount:s,active:i,subscription_id:l,name:c,quantity:d,available:u,trial_period_days:p=null,metadata:{ram_allocation:m,instance_type:_,has_gpus:v}}=e;const h=l?0:parseInt(n,10)/100,g=(0,r.Z)(s),Z=l?c:"0"===n?"FREE":"".concat(g),x=l?c:"0"===n?"FREE":"".concat(g,"/").concat(o),y=!!m&&parseInt(m,10),j="".concat(y/1024,"GB"),w="".concat(j," RAM ").concat(v?"+ GPU Support ":"","\u2022 ").concat(l?"".concat(c," \u2022 ").concat(u," remaining"):"0"!==n?"".concat(g,"/").concat(o):"FREE"," ").concat(i?"":"(legacy)"," ").concat(p?"\u2022 ".concat(p," DAY FREE TRIAL"):"");return y&&t.push({label:w,value:{active:i,instance_type:_,trial_period_days:p,stripe_plan_id:a,compute_interval:o,compute_subscription_name:c,compute_subscription_id:l,compute_quantity:d,compute_quantity_available:u,compute_ram:y,compute_ram_string:j,compute_price:h,compute_comma_amount:g,compute_price_string:Z,compute_price_string_with_interval:x}})})),t.sort(((e,t)=>e.value.compute_ram===t.value.compute_ram?e.value.compute_subscription_name>t.value.compute_subscription_name?1:-1:e.value.compute_ram-t.value.compute_ram))}},9274:(e,t,a)=>{a.d(t,{Z:()=>n});var r=a(1842);const n=e=>{const t=[];return e.map((e=>{let{tiers:a,interval:n,active:o,id:s,subscription_id:i,name:l,available:c}=e;const d=a.find((e=>!!e.up_to)).up_to;return[...new Set([d,10,100,250,500,1e3,1500,2e3,2500,3e3,3500,4e3,4500,5e3,5500,6e3,6500,7e3,7500,8e3,8500,9e3,9500,1e4])].filter((e=>!i||e!==d)).map((e=>{const d=a.find((t=>t.up_to&&e<=t.up_to||!t.up_to)),u=i?0:e*(d.unit_amount/100),p=i?l:u?"$".concat((0,r.Z)(u.toFixed(2))):"FREE",m=i?l:u?"$".concat((0,r.Z)(u.toFixed(2)),"/").concat(n):"FREE",_=e>=1e3?"".concat(e/1e3,"TB"):"".concat(e,"GB"),v=c?c>1e3?"".concat((c/1024).toFixed(2),"TB"):"".concat(c,"GB"):0,h="".concat(_," \u2022 ").concat(i?"".concat(l," \u2022 ").concat(v," remaining"):u?"$".concat((0,r.Z)(u.toFixed(2)),"/").concat(n):"FREE"," ").concat(o?"":"(legacy)");return t.push({label:h,value:{active:o,data_volume_size:e,iops:3e3,storage_interval:n,stripe_storage_plan_id:s,storage_subscription_id:i,storage_subscription_name:l,storage_quantity_available:c,storage_price:u,storage_price_string:p,storage_price_string_with_interval:m,data_volume_size_string:_}})}))})),t.sort(((e,t)=>e.value.data_volume_size===t.value.data_volume_size?e.value.storage_subscription_name>t.value.storage_subscription_name?1:-1:e.value.data_volume_size-t.value.data_volume_size))}},6449:(e,t,a)=>{a.d(t,{Z:()=>r});const r=new(a(7387).yh)({auth:!1,customer:!1,users:!1,products:!1,regions:!1,integrations:!1,subscriptions:!1,instances:!1,alarms:!1,alarmsError:!1,hasCard:!1,lastUpdate:!1,orgSearch:"",filterSearch:"",filterLocal:!0,filterCloud:!0,version:!1,theme:"dark",postmanCollection:!1})},9266:(e,t,a)=>{a.d(t,{Z:()=>r});const r=(0,a(8131).Z)("persistedUser")},1842:(e,t,a)=>{a.d(t,{Z:()=>r});const r=e=>e&&e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[502],{448:(e,t,s)=>{s.r(t),s.d(t,{default:()=>z});var r=s(7313),n=s(6782),a=s(5399),o=s(8467),c=s(7387),i=s(3672),d=s.n(i),l=s(6449),u=s(238),m=s(3516),p=s(9327),x=s(9842),h=s(576);var v=s(1891),j=s(1216),f=s(6047),_=s(4220),Z=s(2261),b=s(6417);const y=function(e){var t,s,i,y,g,N,w,C,S,k,O,P,E,T,R;let{setEditingCard:A,customerCard:F,formStateHeight:z,badCard:K}=e;const{customer_id:U}=(0,o.UO)(),I=(0,c.Kw)(l.Z,(e=>e.auth)),V=(0,c.Kw)(l.Z,(e=>e.instances)),q=(0,c.Kw)(l.Z,(e=>{var t;return null===(t=e.customer)||void 0===t?void 0:t.stripe_id})),[D,M]=(0,r.useState)({});return d()((async()=>{const{submitted:e}=D;if(e){if(V.find((e=>e.totalPrice)))M({error:"You have active, non-free instances."}),setTimeout((()=>M({})),2e3);else{M({processing:!0});const e=await(async e=>{let{auth:t,payment_method_id:s,stripe_id:r,customer_id:n}=e;return(0,h.Z)({endpoint:"removePaymentMethod",method:"POST",payload:{payment_method_id:s,stripe_id:r,customer_id:n},auth:t})})({auth:I,stripe_id:q,payment_method_id:F.id,customer_id:U});e.error?(M({error:e.message}),setTimeout((()=>M({})),2e3)):(M({success:!0}),await(0,f.Z)({auth:I,customer_id:U}),M({}),setTimeout((()=>A(!1)),0))}}}),[D]),(0,b.jsx)(x.SV,{onError:(e,t)=>(0,Z.Z)({error:{message:e.message,componentStack:t},customer_id:U}),FallbackComponent:_.Z,children:D.processing?(0,b.jsx)(v.Z,{height:z,status:"processing",header:"Removing Card From Account",subhead:"The Credit Schnauzer is securely contacting Stripe."}):D.success?(0,b.jsx)(v.Z,{height:z,status:"success",header:"Card Removed Successfully",subhead:"Your account is now limited to free products."}):D.error?(0,b.jsx)(v.Z,{height:z,status:"error",header:D.error,subhead:"You must remove them to remove your card."}):(0,b.jsx)(u.Z,{children:(0,b.jsxs)(m.Z,{children:[K&&(0,b.jsx)(j.Z,{}),(0,b.jsxs)(n.Z,{children:[(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"card number"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsxs)("div",{className:"input-static",children:["**** **** ****",null===F||void 0===F||null===(t=F.card)||void 0===t?void 0:t.last4]})}),(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)("hr",{className:"my-2"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"expiration"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsx)("div",{className:"input-static",children:"".concat(null===F||void 0===F||null===(s=F.card)||void 0===s?void 0:s.exp_month," / ").concat(null===F||void 0===F||null===(i=F.card)||void 0===i?void 0:i.exp_year)})}),(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)("hr",{className:"my-2"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"cvcc"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsx)("div",{className:"input-static",children:"***"})}),(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)("hr",{className:"my-2"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"country"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsx)("div",{className:"input-static",children:null===F||void 0===F||null===(y=F.billing_details)||void 0===y||null===(g=y.address)||void 0===g?void 0:g.country})}),(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)("hr",{className:"my-2"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"state/province"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsx)("div",{className:"input-static",children:null===F||void 0===F||null===(N=F.billing_details)||void 0===N||null===(w=N.address)||void 0===w?void 0:w.state})}),(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)("hr",{className:"my-2"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"address"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsx)("div",{className:"input-static",children:null===F||void 0===F||null===(C=F.billing_details)||void 0===C||null===(S=C.address)||void 0===S?void 0:S.line1})}),(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)("hr",{className:"my-2"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"apt/unit"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsx)("div",{className:"input-static",children:null===F||void 0===F||null===(k=F.billing_details)||void 0===k||null===(O=k.address)||void 0===O?void 0:O.line2})}),(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)("hr",{className:"my-2"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"city"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsx)("div",{className:"input-static",children:null===F||void 0===F||null===(P=F.billing_details)||void 0===P||null===(E=P.address)||void 0===E?void 0:E.city})}),(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)("hr",{className:"my-2"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"billing postal code"}),(0,b.jsx)(a.Z,{md:"6",xs:"12",children:(0,b.jsx)("div",{className:"input-static",children:null===F||void 0===F||null===(T=F.billing_details)||void 0===T||null===(R=T.address)||void 0===R?void 0:R.postal_code})})]}),(0,b.jsx)("hr",{className:"my-2"}),(0,b.jsxs)(n.Z,{children:[(0,b.jsx)(a.Z,{sm:"6",children:(0,b.jsx)(p.Z,{id:"removeCard",title:"Remove Card",disabled:D.submitted,onClick:()=>M({submitted:!0}),block:!0,className:"mt-3",color:"danger",children:"Remove Card"})}),(0,b.jsx)(a.Z,{sm:"6",children:(0,b.jsx)(p.Z,{id:"updateCard",block:!0,color:"success",className:"mt-3",onClick:()=>A(!0),children:"Update Card"})})]})]})})})};var g=s(4696),N=s(5733),w=s(2660),C=s(9537);const S=function(e){let{setEditingCard:t,customerCard:s,formStateHeight:i,badCard:h}=e;const{customer_id:y}=(0,o.UO)(),S=(0,c.Kw)(l.Z,(e=>e.auth)),k=(0,c.Kw)(l.Z,(e=>{var t;return null===(t=e.customer)||void 0===t?void 0:t.stripe_id})),[O,P]=(0,r.useState)({postal_code:!1,card:!1,expire:!1,cvc:!1}),[E,T]=(0,r.useState)({}),R=(0,g.useStripe)(),A=(0,g.useElements)(),F=(0,o.s0)(),{search:z}=(0,o.TH)(),{returnURL:K}=N.Z.parse(z);return d()((async()=>{const{submitted:e,processing:s}=E;if(e&&!s){const{card:e,expire:s,cvc:r,postal_code:n,line1:a,line2:o,state:c,city:i,country:d}=O;if(e&&s&&r&&n&&a&&c&&i&&d){const e=await R.createPaymentMethod({type:"card",card:A.getElement(g.CardNumberElement),billing_details:{address:{postal_code:n,line1:a,line2:o,state:c,city:i,country:d}}});if(T({processing:!0}),e.error)T({...E,error:e.error.message}),setTimeout((()=>T({...E,error:!1})),2e3);else{const s=await(0,w.Z)({auth:S,payment_method_id:e.paymentMethod.id,stripe_id:k,customer_id:y});s.error?(T({...E,error:s.message}),setTimeout((()=>T({...E,error:!1})),2e3)):(window._kmq&&window._kmq.push(["record","added credit card - billing page"]),T({success:s.message}),await(0,f.Z)({auth:S,customer_id:y}),K?F(K):t(!1))}}else T({error:"All fields are required"})}}),[E]),(0,b.jsx)(x.SV,{onError:(e,t)=>(0,Z.Z)({error:{message:e.message,componentStack:t},customer_id:y}),FallbackComponent:_.Z,children:E.processing?(0,b.jsx)(v.Z,{height:i,status:"processing",header:"Adding Card To Your Account",subhead:"The Credit Schnauzer is securely contacting Stripe."}):E.success?(0,b.jsx)(v.Z,{height:i,status:"success",header:"Success!",subhead:"Credit Card was successfully added to your account."}):E.error?(0,b.jsx)(v.Z,{height:i,status:"error",header:E.error,subhead:"Please try again"}):(0,b.jsx)(u.Z,{children:(0,b.jsxs)(m.Z,{children:[h&&(0,b.jsx)(j.Z,{}),(0,b.jsx)(C.Z,{setFormData:P,formData:O}),(0,b.jsx)("hr",{className:"my-2"}),(0,b.jsxs)(n.Z,{children:[s&&(0,b.jsx)(a.Z,{sm:"6",children:(0,b.jsx)(p.Z,{id:"editCard",onClick:()=>t(!1),block:!0,color:"danger",className:"mt-3",children:"Cancel"})}),(0,b.jsx)(a.Z,{children:(0,b.jsx)(p.Z,{id:s?"saveNewCard":"addCardToAccount",title:s?"Save New Card":"Add Card To Account",disabled:E.submitted||!O.card||!O.expire||!O.cvc||!O.postal_code||!R||!A,onClick:()=>T({submitted:!0}),block:!0,className:"mt-3",color:"success",children:s?"Save New Card":"Add Card To Account"})})]})]})})})};const k=function(){const[e,t]=(0,r.useState)(!1),s=(0,c.Kw)(l.Z,(e=>e.hasCard),[e]),n=(0,c.Kw)(l.Z,(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,b.jsx)("div",{className:"mt-3 mb-4",children:e||!s?(0,b.jsx)(S,{formStateHeight:a,setEditingCard:t,customerCard:s,badCard:n}):(0,b.jsx)(y,{formStateHeight:a,setEditingCard:t,customerCard:s,badCard:n})})};var O=s(511);let P;const E=function(){const{customer_id:e}=(0,o.UO)(),t=(0,c.Kw)(l.Z,(e=>e.auth)),s=(0,c.Kw)(l.Z,(e=>e.invoices));return d()((()=>{P=new AbortController,(async e=>{let{auth:t,signal:s,customer_id:r}=e,n=null;try{n=await(0,h.Z)({endpoint:"getInvoices",method:"POST",payload:{customer_id:r},signal:s,auth:t});let e=[];return Array.isArray(n)&&(e=n),l.Z.update((t=>{t.invoices=e.filter((e=>e.amount_paid))}))}catch(a){return(0,Z.Z)({type:"lms data",status:"error",url:O.Z.lms_api_url,operation:"getInvoices",request:{customer_id:r},error:{catch:a.toString()},customer_id:r})}})({auth:t,signal:P.signal,customer_id:e})}),(()=>{var e;return null===(e=P)||void 0===e?void 0:e.abort()}),[]),(0,b.jsx)(x.SV,{onError:(t,s)=>(0,Z.Z)({error:{message:t.message,componentStack:s},customer_id:e}),FallbackComponent:_.Z,children:(0,b.jsx)(u.Z,{className:"my-3",children:(0,b.jsx)(m.Z,{children:s?s.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(n.Z,{children:[(0,b.jsx)(a.Z,{xs:"6",className:"text text-bold text-small",children:"date"}),(0,b.jsx)(a.Z,{xs:"3",className:"text-end text-bold text-small",children:"amount"}),(0,b.jsx)(a.Z,{xs:"3",className:"text-end text-bold text-small",children:"print"})]}),s.map((e=>(0,b.jsxs)(r.Fragment,{children:[(0,b.jsx)("hr",{className:"mt-2"}),(0,b.jsxs)(n.Z,{className:"pb-2",children:[(0,b.jsx)(a.Z,{xs:"6",className:"text text-nowrap",children:new Date(1e3*e.created).toLocaleString()}),(0,b.jsxs)(a.Z,{xs:"3",className:"text-end text text-nowrap",children:["$",(e.total/100).toFixed(2)]}),(0,b.jsx)(a.Z,{xs:"3",className:"text-end text text-nowrap",children:(0,b.jsx)("a",{title:"print invoice",href:e.hosted_invoice_url,target:"_blank",rel:"noopener noreferrer",children:(0,b.jsx)("i",{className:"fa fa-print text-purple"})})})]})]},e.id)))]}):(0,b.jsx)("div",{className:"py-5 text-center",children:"You have not yet received an invoice."}):(0,b.jsx)("div",{className:"py-5 text-center",children:(0,b.jsx)("i",{className:"fa fa-spinner fa-spin text-purple"})})})})})};var T=s(3903);const R=function(){const{customer_id:e}=(0,o.UO)(),t=(0,c.Kw)(l.Z,(e=>e.customer.stripe_coupons));return(0,b.jsx)(x.SV,{onError:(t,s)=>(0,Z.Z)({error:{message:t.message,componentStack:s},customer_id:e}),FallbackComponent:_.Z,children:(0,b.jsx)(u.Z,{className:"my-3",children:(0,b.jsxs)(m.Z,{children:[(0,b.jsx)(T.Z,{}),null!==t&&void 0!==t&&t.length?(0,b.jsxs)("div",{className:"mt-2",children:[t.map((e=>(0,b.jsxs)(r.Fragment,{children:[(0,b.jsx)("hr",{className:"my-2"}),(0,b.jsxs)(n.Z,{children:[(0,b.jsx)(a.Z,{xs:"6",children:e.name}),(0,b.jsxs)(a.Z,{xs:"6",className:"text-end",children:["$",parseInt(e.amount_off/100,10)]})]})]},e.id))),(0,b.jsx)("hr",{className:"my-2"}),(0,b.jsxs)(n.Z,{children:[(0,b.jsx)(a.Z,{xs:"6",children:(0,b.jsx)("b",{children:"Total Credit"})}),(0,b.jsx)(a.Z,{xs:"6",className:"text-end",children:(0,b.jsxs)("b",{children:["$",t.reduce(((e,t)=>e+parseInt(t.amount_off/100,10)),0)]})})]})]}):null]})})})};var A=s(5085),F=s(3230);const z=function(){const{customer_id:e}=(0,o.UO)(),t=(0,c.Kw)(l.Z,(e=>e.auth)),s=(0,c.Kw)(l.Z,(e=>e.products)),i=(0,c.Kw)(l.Z,(e=>e.regions)),u=(0,c.Kw)(l.Z,(e=>e.subscriptions)),m=(0,c.Kw)(l.Z,(e=>e.instances)),p=(0,c.Kw)(l.Z,(e=>e.customer.is_unpaid));return(0,r.useEffect)((()=>{(0,f.Z)({auth:t,customer_id:e})}),[]),d()((()=>{t&&s&&i&&u&&e&&(null===m||void 0===m||!m.length)&&(0,F.Z)({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,b.jsxs)(n.Z,{children:[p&&(0,b.jsx)(a.Z,{xs:"12",children:(0,b.jsx)(A.Z,{})}),(0,b.jsxs)(a.Z,{md:"6",children:[(0,b.jsx)("span",{className:"floating-card-header",children:"card"}),(0,b.jsx)(k,{})]}),(0,b.jsxs)(a.Z,{md:"6",children:[(0,b.jsx)("span",{className:"floating-card-header",children:"coupons"}),(0,b.jsx)(R,{}),(0,b.jsx)("br",{}),(0,b.jsx)("span",{className:"floating-card-header",children:"invoices"}),(0,b.jsx)(E,{})]})]})}},1216:(e,t,s)=>{s.d(t,{Z:()=>n});s(7313);var r=s(6417);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"})]})}},3903:(e,t,s)=>{s.d(t,{Z:()=>b});var r=s(7313),n=s(6782),a=s(5399),o=s(1781),c=s(9327),i=s(3672),d=s.n(i),l=s(7387),u=s(9842),m=s(8467),p=s(5733),x=s(6449),h=s(576);var v=s(6047),j=s(4220),f=s(2261),_=s(6417);let Z;const b=function(){const{customer_id:e}=(0,m.UO)(),{search:t}=(0,m.TH)(),{code:s}=p.Z.parse(t),i=(0,l.Kw)(x.Z,(e=>e.auth)),[b,y]=(0,r.useState)({coupon_code:s||""}),[g,N]=(0,r.useState)({}),[w,C]=(0,r.useState)(!1);return d()((async()=>{if(g.submitted){const{coupon_code:t}=b;if(t){Z=new AbortController;const s=await(async e=>{let{auth:t,customer_id:s,coupon_code:r}=e;return(0,h.Z)({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,v.Z)({auth:i,customer_id:e}),w&&(y({coupon_code:""}),N({})))}else N({error:"Please enter a valid coupon code"})}}),(()=>{var e;return null===(e=Z)||void 0===e?void 0:e.abort()}),[g]),d()((()=>{g.submitted||N({})}),[b]),d()((()=>{C(!0),b.coupon_code&&N({submitted:!0})}),(()=>C(!1)),[]),(0,_.jsx)(u.SV,{onError:(t,s)=>(0,f.Z)({error:{message:t.message,componentStack:s},customer_id:e}),FallbackComponent:j.Z,children:(0,_.jsxs)(n.Z,{children:[(0,_.jsx)(a.Z,{md:"6",children:(0,_.jsx)(o.Z,{id:"coupon_code",className:"mb-2",type:"text",value:b.coupon_code,invalid:!!g.error,disabled:g.submitted,placeholder:"coupon code",onChange:e=>y({coupon_code:e.target.value.toUpperCase()})})}),(0,_.jsx)(a.Z,{md:"6",children:(0,_.jsx)(c.Z,{id:"addCoupon",color:"success",disabled:g.submitted,block:!0,onClick:()=>N({submitted:!0}),children:g.submitted?(0,_.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,_.jsx)("span",{children:"Add Coupon"})})}),(0,_.jsxs)(a.Z,{xs:"12",className:"text-center text-danger text-small",children:[g.error,"\xa0"]})]})})}},9537:(e,t,s)=>{s.d(t,{Z:()=>v});var r=s(7313),n=s(6782),a=s(5399),o=s(1781),c=s(4696),i=s(1410),d=s(7387),l=s(8467),u=s(9842);var m=s(6449),p=s(4220),x=s(2261),h=s(6417);const v=function(e){let{setFormData:t,formData:s}=e;const{customer_id:v}=(0,l.UO)(),[j,f]=(0,r.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,d.Kw)(m.Z,(e=>e.theme))});return(0,h.jsx)(u.SV,{onError:(e,t)=>(0,x.Z)({error:{message:e.message,componentStack:t},customer_id:v}),FallbackComponent:p.Z,children:(0,h.jsxs)(n.Z,{children:[(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"card number"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)("div",{className:"fake-input ".concat(j.cardError?"error":""),children:(0,h.jsx)(c.CardNumberElement,{options:_,id:"ccCardNumber",onChange:e=>{var r;f({...j,cardError:null===(r=e.error)||void 0===r?void 0:r.message}),t({...s,card:e.complete})}})})}),(0,h.jsx)(a.Z,{xs:"12",children:(0,h.jsx)("hr",{className:"my-2"})}),(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"expiration"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)("div",{className:"fake-input ".concat(j.expError?"error":""),children:(0,h.jsx)(c.CardExpiryElement,{options:_,id:"ccExpire",onChange:e=>{var r;f({...j,expError:null===(r=e.error)||void 0===r?void 0:r.message}),t({...s,expire:e.complete})}})})}),(0,h.jsx)(a.Z,{xs:"12",children:(0,h.jsx)("hr",{className:"my-2"})}),(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"cvcc"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)("div",{className:"fake-input ".concat(j.cvcError?"error":""),children:(0,h.jsx)(c.CardCvcElement,{id:"ccCVC",options:_,onChange:e=>{var r;f({...j,cvcError:null===(r=e.error)||void 0===r?void 0:r.message}),t({...s,cvc:e.complete})}})})}),(0,h.jsx)(a.Z,{xs:"12",children:(0,h.jsx)("hr",{className:"my-2"})}),(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"country"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)(i.Px,{id:"ccCountry",valueType:"short",value:s.country,priorityOptions:["CA","US","GB"],defaultOptionLabel:"select your country",onChange:e=>t({...s,country:e})})}),(0,h.jsx)(a.Z,{xs:"12",children:(0,h.jsx)("hr",{className:"my-2"})}),(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"state/province"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)(i.Xz,{id:"ccRegion",blankOptionLabel:"select country first",defaultOptionLabel:"select state / province",valueType:"short",countryValueType:"short",country:s.country,value:s.state,onChange:e=>t({...s,state:e})})}),(0,h.jsx)(a.Z,{xs:"12",children:(0,h.jsx)("hr",{className:"my-2"})}),(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"address"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)(o.Z,{id:"ccLine1",onChange:e=>t({...s,line1:e.target.value})})}),(0,h.jsx)(a.Z,{xs:"12",children:(0,h.jsx)("hr",{className:"my-2"})}),(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"apt/unit"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)(o.Z,{id:"ccApt",onChange:e=>t({...s,line2:e.target.value})})}),(0,h.jsx)(a.Z,{xs:"12",children:(0,h.jsx)("hr",{className:"my-2"})}),(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"city"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)(o.Z,{id:"ccCity",onChange:e=>t({...s,city:e.target.value})})}),(0,h.jsx)(a.Z,{xs:"12",children:(0,h.jsx)("hr",{className:"my-2"})}),(0,h.jsx)(a.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"billing postal code"}),(0,h.jsx)(a.Z,{md:"6",xs:"12",className:"text-md-end text-center",children:(0,h.jsx)(o.Z,{id:"ccPostalCode",onChange:e=>t({...s,postal_code:e.target.value})})})]})})}},1891:(e,t,s)=>{s.d(t,{Z:()=>o});s(7313);var r=s(238),n=s(3516),a=s(6417);const o=function(e){let{header:t,subhead:s=" ",height:o,status:c,className:i}=e;return(0,a.jsx)(r.Z,{className:"form-status ".concat(i),children:(0,a.jsxs)(n.Z,{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})]})})}},5085:(e,t,s)=>{s.d(t,{Z:()=>o});s(7313);var r=s(238),n=s(3516),a=s(6417);const o=function(){return(0,a.jsx)(r.Z,{color:"danger",className:"mb-4",children:(0,a.jsx)(n.Z,{className:"text-center text-danger",children:"This Organization Will Not Be Billed"})})}},2660:(e,t,s)=>{s.d(t,{Z:()=>n});var r=s(576);const n=async e=>{let{auth:t,payment_method_id:s,stripe_id:n,customer_id:a}=e;return(0,r.Z)({endpoint:"addPaymentMethod",method:"POST",payload:{payment_method_id:s,stripe_id:n,customer_id:a},auth:t})}},6047:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(576),n=s(6449),a=s(2261),o=s(511),c=s(2174);const i=async e=>{let{auth:t,customer_id:s}=e,i=null;try{var d;return i=await(0,r.Z)({endpoint:"getCustomer",method:"POST",payload:{customer_id:s},auth:t}),(0,c.Z)({auth:t,customer_id:s,stripe_id:null===(d=i)||void 0===d?void 0:d.stripe_id}),i.error||n.Z.update((e=>{var t;e.customer={...i,customer_id:s},e.hasCard=null===(t=i.stripe_payment_methods)||void 0===t?void 0:t[0]})),i}catch(l){return(0,a.Z)({type:"lms data",status:"error",url:o.Z.lms_api_url,operation:"getCustomer",request:{customer_id:s},error:{catch:l.toString()},customer_id:s})}}},3230:(e,t,s)=>{s.d(t,{Z:()=>d});var r=s(576),n=s(6449),a=s(1842);const o=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 c=s(2261),i=s(511);const d=async e=>{let{auth:t,customer_id:s,products:d,regions:l,subscriptions:u,instanceCount:m=0}=e,p=null;try{if(p=await(0,r.Z)({endpoint:"getInstances",method:"POST",payload:{customer_id:s,user_id:t.user_id},auth:t}),Array.isArray(p)){const e=p.map((e=>{const t=(e=>{let{instance:t,products:s,regions:r,subscriptions:n}=e;try{var c,i;const e=t.compute_subscription_id?n[o(t)]:s[o(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===(c=d.value)||void 0===c?void 0:c.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,a.Z)(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:d,regions:l,subscriptions:u});return{...e,...t}})),t=e.sort(((e,t)=>e.instance_name>t.instance_name?1:-1));return n.Z.update((e=>{e.instances=t})),t}return!m&&n.Z.update((e=>{e.instances=[]}))}catch(x){return(0,c.Z)({type:"lms data",status:"error",url:i.Z.lms_api_url,operation:"getInstances",request:{customer_id:s},error:{catch:x.toString()},customer_id:s})}}},2174:(e,t,s)=>{s.d(t,{Z:()=>d});var r=s(576),n=s(6449),a=s(2261),o=s(8329),c=s(9274),i=s(511);const d=async e=>{let{auth:t,customer_id:s,stripe_id:d}=e;try{const e=await(0,r.Z)({endpoint:"getPrepaidSubscriptions",method:"POST",payload:{customer_id:s,stripe_id:d},auth:t});return!e.error&&n.Z.update((t=>{t.subscriptions={cloud_storage:(0,c.Z)(e.cloud_storage||[]),cloud_compute:(0,o.Z)(e.cloud_compute||[]),wavelength_compute:(0,o.Z)(e.wavelength_compute||[]),local_compute:(0,o.Z)(e.local_compute||[])}}))}catch(l){return(0,a.Z)({type:"lms data",status:"error",url:i.Z.lms_api_url,operation:"getPrepaidSubscriptions",error:{catch:l.toString()}})}}},1781:(e,t,s)=>{s.d(t,{Z:()=>Z});var r=s(7313),n=s(5192),a=s.n(n),o=s(6123),c=s.n(o),i=s(986);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=j(e);if(t){var n=j(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 v(e)}(this,s)}}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}var f={children:a().node,type:a().string,size:a().oneOfType([a().number,a().string]),bsSize:a().string,valid:a().bool,invalid:a().bool,tag:i.iC,innerRef:a().oneOfType([a().object,a().func,a().string]),plaintext:a().bool,addon:a().bool,className:a().string,cssModule:a().object},_=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(v(t)),t.focus=t.focus.bind(v(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,v=e.plaintext,j=e.innerRef,f=m(e,l),_=["switch","radio","checkbox"].indexOf(a)>-1,Z="select"===a,b="range"===a,y=x||(Z||"textarea"===a?a:"input"),g="form-control";v?(g="".concat(g,"-plaintext"),y=x||"input"):b?g="form-range":Z?g="form-select":_&&(g=h?null:"form-check-input"),f.size&&/\D/g.test(f.size)&&((0,i.O4)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),o=f.size,delete f.size);var N=(0,i.mx)(c()(t,p&&"is-invalid",d&&"is-valid",!!o&&(Z?"form-select-".concat(o):"form-control-".concat(o)),g),s);return("input"===y||x&&"function"===typeof x)&&(f.type="switch"===a?"checkbox":a),f.children&&!v&&"select"!==a&&"string"===typeof y&&"select"!==y&&((0,i.O4)('Input with a type of "'.concat(a,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete f.children),r.createElement(y,u({},f,{ref:j,className:N,"aria-invalid":p}))}}])&&p(t.prototype,s),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(r.Component);_.propTypes=f;const Z=_}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[583],{7389:(e,s,a)=>{a.r(s),a.d(s,{default:()=>R});var t=a(7313),r=a(6782),n=a(5399),i=a(7387),l=a(4122),o=a(8467),c=a(6449),d=a(9327),u=a(238),m=a(3516),h=a(6160),g=a(6855),x=a(6417);const p={tableData:!1,dataTableColumns:[],filtered:[],sorted:[{id:"email",desc:!1}],page:0,loading:!1,totalPages:1,pageSize:20,autoRefresh:!1,showFilter:!1,lastUpdate:!1};const j=function(){var e,s;const{customer_id:a}=(0,o.UO)(),l=(0,h.VY)(),j=(0,o.s0)(),[f,v]=(0,t.useState)(p),Z=null===(e=f.sorted[0])||void 0===e?void 0:e.id,b=null===(s=f.sorted[0])||void 0===s?void 0:s.desc,N=(0,i.Kw)(c.Z,(e=>e.auth)),_=(0,i.Kw)(c.Z,(e=>e.users)),w=[{Header:"email address",accessor:"email"},{Header:"status",accessor:"orgs[0].status"}],C=(0,t.useCallback)((e=>{N.user_id===e?l.error("Edit your own profile by clicking the user icon in the top nav"):j("/o/".concat(a,"/users/").concat(e))}),[N.user_id,a]);return(0,t.useEffect)((()=>{if(f.tableData.length&&Z){const e=[...[...f.tableData]].sort(((e,s)=>e[Z]>s[Z]&&b?-1:e[Z]>s[Z]||b?1:-1));v({...f,tableData:e})}}),[Z,b]),(0,t.useEffect)((()=>{_&&w&&v({...f,tableData:_,dataTableColumns:w,totalPages:Math.ceil((_.length||f.pageSize)/f.pageSize)})}),[_,v,f.pageSize]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(r.Z,{className:"floating-card-header",children:[(0,x.jsx)(n.Z,{children:"existing org users"}),(0,x.jsx)(n.Z,{className:"text-end",children:(0,x.jsx)(d.Z,{color:"link",tabIndex:"0",title:"Filter Users",className:"me-3",onClick:()=>v({...f,filtered:f.showFilter?[]:f.filtered,showFilter:!f.showFilter}),children:(0,x.jsx)("i",{className:"fa fa-search"})})})]}),(0,x.jsx)(u.Z,{className:"my-3",children:(0,x.jsx)(m.Z,{className:"react-table-holder",children:(0,x.jsx)(g.Z,{columns:f.dataTableColumns,data:f.tableData,currentPage:f.page,pageSize:f.pageSize,totalPages:f.totalPages,showFilter:f.showFilter,sorted:f.sorted,loading:!_||f.loading&&!f.autoRefresh,onFilteredChange:e=>v({...f,filtered:e}),onSortedChange:e=>v({...f,sorted:e}),onPageChange:e=>v({...f,pageSize:e}),onPageSizeChange:e=>v({...f,page:0,pageSize:e}),onRowClick:e=>C(e.user_id)})})})]})};var f=a(3672),v=a.n(f),Z=a(9842),b=a(2274),N=a(576);const _=async e=>{let{auth:s,customer_id:a,user_id:t,user_id_owner:r,status:n}=e;return(0,N.Z)({endpoint:"updateOrgUser",method:"POST",payload:{customer_id:a,user_id:t,user_id_owner:r,status:n},auth:s})};var w=a(2261),C=a(511);const S=async e=>{let{auth:s,customer_id:a}=e,t=null;try{t=await(0,N.Z)({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.Z.update((s=>{s.users=e}))}catch(r){return(0,w.Z)({type:"lms data",status:"error",url:C.Z.lms_api_url,operation:"getUsers",request:{customer_id:a},error:{catch:r.toString()},customer_id:a})}};var y=a(4220);const P=function(){const{user_id:e}=(0,o.UO)(),{customer_id:s}=(0,o.UO)(),a=(0,h.VY)(),l=(0,i.Kw)(c.Z,(e=>e.auth)),u=(0,i.Kw)(c.Z,(s=>s.users&&s.users.find((s=>s.user_id===e))),[e]),[m,g]=(0,t.useState)(!1),[p,j]=(0,t.useState)({});return v()((()=>{var e,a;g(u&&(null===(e=u.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))}),[u,s]),v()((async()=>{const{submitted:t,processing:r}=p;if(t&&!r){const t="declined"===m?"invited":"accepted"===m?"owner":"owner"===m?"accepted":"invited";g(t);const r=await _({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}))}}),[p]),(0,x.jsx)(Z.SV,{onError:(e,a)=>(0,w.Z)({error:{message:e.message,componentStack:a},customer_id:s}),FallbackComponent:y.Z,children:["invited","declined"].includes(m)?"declined"===m?(0,x.jsxs)(r.Z,{children:[(0,x.jsxs)(n.Z,{xs:"8",className:"py-1",children:["User declined invitation to join",(0,x.jsx)("br",{}),(0,x.jsx)("span",{className:"text-small",children:"reinvite them by clicking this button"})]}),(0,x.jsx)(n.Z,{xs:"4",children:(0,x.jsx)(d.Z,{id:"reinviteOrganizationUser",block:!0,color:"success",onClick:()=>j({submitted:!0}),disabled:p.submitted,children:p.submitted?(0,x.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,x.jsx)("span",{children:"Reinvite User"})})})]}):(0,x.jsx)(r.Z,{children:(0,x.jsxs)(n.Z,{className:"py-1",children:["User has not yet accepted invitation",(0,x.jsx)("br",{}),(0,x.jsx)("span",{className:"text-small",children:"You must wait for them to accept before modifying them"})]})}):(0,x.jsxs)(r.Z,{children:[(0,x.jsxs)(n.Z,{xs:"8",className:"py-1",children:["Is Owner",(0,x.jsx)("br",{}),(0,x.jsx)("span",{className:"text-small",children:"can invite other users, add instances"})]}),(0,x.jsx)(n.Z,{xs:"4",children:(0,x.jsx)("div",{className:"role-toggle-holder",children:(0,x.jsx)(b.Z,{checked:"owner"===m,onChange:()=>j({submitted:!0})})})})]})})};var k=a(1781),U=a(5447);const E=function(){const{user_id:e,customer_id:s}=(0,o.UO)(),{pathname:a}=(0,o.TH)(),l=(0,o.s0)(),u=(0,h.VY)(),[m,g]=(0,t.useState)({}),[p,j]=(0,t.useState)({}),f=(0,i.Kw)(c.Z,(e=>e.auth));return(0,x.jsx)(Z.SV,{onError:(e,a)=>(0,w.Z)({error:{message:e.message,componentStack:a},customer_id:s}),FallbackComponent:y.Z,children:(0,x.jsxs)(r.Z,{children:[(0,x.jsxs)(n.Z,{xs:"4",className:"py-1",children:["Delete Org User",(0,x.jsx)("br",{}),(0,x.jsx)("span",{className:"text-small",children:"user will be removed from this organization"})]}),(0,x.jsx)(n.Z,{xs:"4",children:(0,x.jsx)(k.Z,{id:"delete_username",onChange:e=>g({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,x.jsx)(n.Z,{xs:"4",children:(0,x.jsx)(d.Z,{id:"deleteUser",block:!0,color:"danger",onClick:async()=>{if("DELETE"!==m.delete_username)u.error("Please type DELETE to delete this user");else{j({submitted:!0});const t=await _({auth:f,user_id:e,user_id_owner:f.user_id,customer_id:s,status:"removed"});-1!==t.message.indexOf("successfully")?(u.success(t.message),U.Z.update((e=>{e.lastUpdate=Date.now()})),j({}),setTimeout((()=>l(a.replace("/".concat(e),""))),100)):(u.error(t.message),j({}))}},disabled:"DELETE"!==m.delete_username||p.submitted,children:p.submitted?(0,x.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,x.jsx)("span",{children:"Delete User"})})})]})})};const O=function(e){let{userEmail:s}=e;const{user_id:a}=(0,o.UO)(),{pathname:t}=(0,o.TH)(),i=(0,o.s0)();return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"floating-card-header",children:["existing org users > edit > ",(0,x.jsx)("b",{children:s})]}),(0,x.jsx)(u.Z,{className:"my-3",children:(0,x.jsxs)(m.Z,{children:[(0,x.jsx)(P,{}),(0,x.jsx)("hr",{className:"my-3"}),(0,x.jsx)(E,{}),(0,x.jsx)("hr",{className:"my-3"}),(0,x.jsxs)(r.Z,{children:[(0,x.jsxs)(n.Z,{xs:"8",className:"py-1",children:["Return to User List",(0,x.jsx)("br",{}),(0,x.jsx)("span",{className:"text-small",children:"make no further changes to this user"})]}),(0,x.jsx)(n.Z,{xs:"4",children:(0,x.jsx)(d.Z,{id:"returnToOrganizationUserList",block:!0,color:"grey",onClick:()=>i(t.replace("/".concat(a),"")),children:"Return to User List"})})]})]})})]})};var z=a(4757),F=a(1891);const T=function(e){let{refreshUsers:s,userEmails:a}=e;const r=(0,o.s0)(),{customer_id:n}=(0,o.UO)(),l=(0,i.Kw)(c.Z,(e=>e.auth)),[h,g]=(0,t.useState)({}),[p,j]=(0,t.useState)({}),f="132px";return v()((async()=>{const{email:e}=p,{submitted:t}=h;if(t){if((0,z.Z)(e))if(a&&a.includes(e))g({error:"This user has already been invited"});else if(e===l.email)g({error:"You cannot invite yourself"});else{g({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.Z)({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:n});a.error?g({error:a.message}):(window._kmq&&window._kmq.push(["record","added org user"]),s(),g({success:a.message}))}else g({error:"Please enter a valid email"});setTimeout((()=>j({})),2e3)}}),[h]),v()((()=>g({})),[p]),(0,x.jsx)(Z.SV,{onError:(e,s)=>(0,w.Z)({error:{message:e.message,componentStack:s},customer_id:n}),FallbackComponent:y.Z,children:(0,x.jsx)("div",{className:"mt-3 mb-4",children:l.email_bounced?(0,x.jsx)(u.Z,{children:(0,x.jsxs)(m.Z,{children:[(0,x.jsx)("b",{children:"Unable to Add New Org User"}),(0,x.jsx)("br",{}),(0,x.jsx)("br",{}),"Your email address seems to be unreachable. Please update it to ensure billing, upgrade, and other critical system announcements reach you.",(0,x.jsx)("br",{}),(0,x.jsx)("br",{}),(0,x.jsx)(d.Z,{id:"updateEmail",onClick:()=>r("/profile"),title:"Update My Email",block:!0,className:"mt-3",color:"danger",children:"Update My Email"})]})}):h.processing?(0,x.jsx)(F.Z,{height:f,status:"processing",header:"Adding User",subhead:"The Account Airedale Is A Good Boy"}):h.success?(0,x.jsx)(F.Z,{height:f,status:"success",header:"Success!",subhead:h.success}):h.error?(0,x.jsx)(F.Z,{height:f,status:"error",header:h.error,subhead:"Please try again"}):(0,x.jsx)(u.Z,{children:(0,x.jsxs)(m.Z,{children:[(0,x.jsx)(k.Z,{id:"email",type:"text",className:"mb-3 text-center",name:"email",placeholder:"email address",onChange:e=>j({...p,email:e.target.value.toLowerCase()}),disabled:h.submitted}),(0,x.jsx)(d.Z,{id:"addOrganizationUser",color:"success",block:!0,onClick:()=>g({submitted:!0}),disabled:h.submitted,children:"Add Org User"})]})})})})};var D=a(6047);const R=function(){const{user_id:e,customer_id:s}=(0,o.UO)(),a=(0,i.Kw)(c.Z,(e=>e.auth)),d=(0,i.Kw)(c.Z,(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,D.Z)({auth:a,customer_id:s})}),[]),(0,l.Z)((()=>m()),C.Z.refresh_content_interval),(0,x.jsxs)(r.Z,{children:[(0,x.jsxs)(n.Z,{xl:"3",lg:"4",md:"5",xs:"12",children:[(0,x.jsx)("span",{className:"floating-card-header",children:"add org user"}),(0,x.jsx)(T,{refreshUsers:m,userEmails:d&&d.map((e=>"declined"!==e.orgs[0].status&&e))})]}),(0,x.jsx)(n.Z,{xl:"9",lg:"8",md:"7",xs:"12",className:"pb-5",children:u?(0,x.jsx)(O,{userEmail:u.email}):(0,x.jsx)(j,{refreshUsers:m})})]})}},6855:(e,s,a)=>{a.d(s,{Z:()=>Z});var t=a(7313),r=a(5110),n=a(1781),i=a(9842),l=a(6782),o=a(5399),c=a(6417);const d=e=>{let{headerGroups:s,onSortedChange:a,sorted:t,showFilter:r}=e;return s.map((e=>(0,c.jsxs)("div",{...e.getHeaderGroupProps(),children:[(0,c.jsx)(l.Z,{className:"header g-0",children:e.headers.map((e=>{var s,r;return(0,c.jsx)(o.Z,{onClick:()=>{var s,r;return 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"),children:(0,c.jsx)("div",{className:"text-renderer",children:e.render("Header")})},e.id)}))}),r&&(0,c.jsx)(l.Z,{className:"filter g-0",children:e.headers.map((e=>(0,c.jsx)(o.Z,{className:-1!==e.id.indexOf("hdb-narrow")?"action":"",children:e.render("Filter")},e.id)))})]})))};var u=a(9327);const m=function(e){let{page:s,pageSize:a,totalPages:t,onPageChange:r,onPageSizeChange:i,loading:d}=e;return(0,c.jsxs)(l.Z,{className:"pagination",children:[(0,c.jsx)(o.Z,{xs:"12",sm:"2",className:"previous",children:(0,c.jsx)(u.Z,{className:"mb-2 btn-pagination",color:"purple",block:!0,onClick:()=>r(s-1),disabled:!t||0===s,children:(0,c.jsx)("i",{className:"fa fa-chevron-left"})})}),(0,c.jsxs)(o.Z,{xs:"12",sm:"4",className:"paginator",children:[(0,c.jsx)("i",{className:"fa fa-book me-2"}),(0,c.jsx)(n.Z,{className:"mb-2",type:"number",value:s+1,min:1,max:t,onChange:e=>r(e.target.value-1)}),(0,c.jsxs)("div",{className:"page-count",children:["\xa0/\xa0",d?(0,c.jsx)("i",{className:"fa fa-spinner fa-spin"}):t]})]}),(0,c.jsx)(o.Z,{xs:"12",sm:"4",className:"page-size",children:(0,c.jsx)(n.Z,{className:"mb-2",type:"select",value:a,onChange:e=>i(e.target.value),children:[20,50,100,250].map((e=>(0,c.jsxs)("option",{value:e,children:[e," rows"]},e)))})}),(0,c.jsx)(o.Z,{xs:"12",sm:"2",className:"next",children:(0,c.jsx)(u.Z,{className:"mb-2 pull-right btn-pagination",block:!0,color:"purple",onClick:()=>r(s+1),disabled:!t||s+1===t,children:(0,c.jsx)("i",{className:"fa fa-chevron-right"})})})]})};const h=function(e){let{previousPage:s,canPreviousPage:a,pageIndex:t,gotoPage:r,setPageSize:i,pageCount:d,nextPage:m,canNextPage:h,loading:g}=e;return(0,c.jsxs)(l.Z,{className:"pagination",children:[(0,c.jsx)(o.Z,{xs:"12",sm:"2",className:"previous",children:(0,c.jsx)(u.Z,{className:"mb-2 btn-pagination",color:"purple",block:!0,onClick:s,disabled:!d||!a,children:(0,c.jsx)("i",{className:"fa fa-chevron-left"})})}),(0,c.jsxs)(o.Z,{xs:"12",sm:"4",className:"paginator",children:[(0,c.jsx)("i",{className:"fa fa-book me-2"}),(0,c.jsx)(n.Z,{className:"mb-2",type:"number",value:t+1||1,min:1,max:d,onChange:e=>r(e.target.value?Number(e.target.value)-1:0)}),(0,c.jsxs)("div",{className:"page-count",children:["\xa0/\xa0",g?(0,c.jsx)("i",{className:"fa fa-spinner fa-spin"}):d]})]}),(0,c.jsx)(o.Z,{xs:"12",sm:"4",className:"page-size",children:(0,c.jsx)(n.Z,{className:"mb-2",type:"select",onChange:e=>{r(0),setTimeout((()=>i(e.target.value)),1e3)},children:[20,50,100,250].map((e=>(0,c.jsxs)("option",{value:e,children:[e," rows"]},e)))})}),(0,c.jsx)(o.Z,{xs:"12",sm:"2",className:"next",children:(0,c.jsx)(u.Z,{className:"mb-2 pull-right btn-pagination",block:!0,color:"purple",onClick:m,disabled:!d||!h,children:(0,c.jsx)("i",{className:"fa fa-chevron-right"})})})]})};const g=function(e){let{prepareRow:s,row:a,onRowClick:t=!1}=e;return s(a),(0,c.jsx)(l.Z,{onClick:()=>t&&t(a.original),className:"g-0",children:a.cells.map((e=>(0,c.jsx)(o.Z,{className:-1!==e.column.id.indexOf("hdb-narrow")?"action":"",children:e.render("Cell")},"".concat(e.row.id,"-").concat(e.column.id))))})};var x=a(2261),p=a(4220);function j(e){let{value:s}=e;return(0,c.jsx)("div",{className:"text-renderer",children:s})}function f(e){let{src:s}=e;const[a,r]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1);return(0,c.jsxs)("div",{className:"image-renderer",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,c.jsx)("i",{className:"fa fa-image"}),a&&n?(0,c.jsxs)("div",{className:"preview-image no-image",children:[(0,c.jsx)("i",{className:"fa fa-ban text-danger"}),(0,c.jsx)("div",{className:"mt-2",children:"image failed to load"})]}):a?(0,c.jsx)("img",{onError:i,alt:s,src:s,className:"preview-image"}):null]})}const v={Filter:e=>{let{column:{filterValue:s,setFilter:a}}=e;return(0,c.jsx)(n.Z,{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,c.jsx)(j,{value:JSON.stringify(e)});case"[object Boolean]":return(0,c.jsx)(j,{value:e?"true":"false"});case"[object String]":return(s=e)&&(s.match(/^https?.*\.(jpeg|jpg|gif|png)$/)||-1!==s.indexOf("data:image"))?(0,c.jsx)(f,{src:e}):(0,c.jsx)(j,{value:e});default:return(0,c.jsx)(j,{value:e})}var s})(s)}};const Z=function(e){let{columns:s,data:a,currentPage:n,pageSize:l,totalPages:o,onFilteredChange:u,onSortedChange:j,onPageChange:f,onPageSizeChange:Z,showFilter:b,onRowClick:N,sorted:_,loading:w,manual:C=!1}=e;const{headerGroups:S,page:y,rows:P,prepareRow:k,state:U,setAllFilters:E,canPreviousPage:O,canNextPage:z,pageOptions:F,pageCount:T,gotoPage:D,nextPage:R,previousPage:A,setPageSize:L}=(0,r.useTable)({columns:s,data:a,defaultColumn:v,onFilteredChange:u,onSortedChange:j,onPageChange:f,onPageSizeChange:Z,onRowClick:N,manualPagination:C,manualFilters:C,initialState:{pageIndex:n,pageSize:l}},r.useFilters,r.usePagination),[K,V]=(0,t.useState)(!0),I=C||!y.length?P:y;return(0,t.useEffect)((()=>{!b&&U.filters.length?E([]):u(U.filters)}),[U.filters,b]),(0,t.useEffect)((()=>{setTimeout((()=>V(!1)),100)}),[null===I||void 0===I?void 0:I.length]),(0,c.jsxs)(i.SV,{onError:(e,s)=>(0,x.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:p.Z,children:[(0,c.jsxs)("div",{className:"react-table-scroller",children:[(0,c.jsx)(d,{headerGroups:S,onSortedChange:j,sorted:_,showFilter:b}),w||K?(0,c.jsx)("div",{className:"centered text-center",children:(0,c.jsx)("i",{className:"fa fa-spinner fa-spin"})}):I.length?I.map((e=>(0,c.jsx)(g,{row:e,prepareRow:k,onRowClick:N},e.id))):(0,c.jsxs)("div",{className:"centered text-center",children:[(0,c.jsx)("i",{className:"fa fa-exclamation-triangle text-danger"}),(0,c.jsx)("div",{className:"mt-2 text-darkgrey",children:"no records"})]})]}),C?(0,c.jsx)(m,{page:n,pageSize:l,totalPages:o,onPageChange:f,onPageSizeChange:Z,loading:w}):(0,c.jsx)(h,{previousPage:A,pageSize:l,canPreviousPage:O,pageIndex:U.pageIndex,pageOptions:F,gotoPage:D,setPageSize:L,pageCount:T,nextPage:R,canNextPage:z,loading:w})]})}},1891:(e,s,a)=>{a.d(s,{Z:()=>i});a(7313);var t=a(238),r=a(3516),n=a(6417);const i=function(e){let{header:s,subhead:a=" ",height:i,status:l,className:o}=e;return(0,n.jsx)(t.Z,{className:"form-status ".concat(o),children:(0,n.jsxs)(r.Z,{className:"text-center",style:{height:i},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"===l?"fa-spinner fa-spin text-purple":"success"===l?"fa-check-circle text-purple":"fa-exclamation-triangle text-danger")})}),(0,n.jsx)("div",{className:"text-grey",children:a})]})})}},6047:(e,s,a)=>{a.d(s,{Z:()=>o});var t=a(576),r=a(6449),n=a(2261),i=a(511),l=a(2174);const o=async e=>{let{auth:s,customer_id:a}=e,o=null;try{var c;return o=await(0,t.Z)({endpoint:"getCustomer",method:"POST",payload:{customer_id:a},auth:s}),(0,l.Z)({auth:s,customer_id:a,stripe_id:null===(c=o)||void 0===c?void 0:c.stripe_id}),o.error||r.Z.update((e=>{var s;e.customer={...o,customer_id:a},e.hasCard=null===(s=o.stripe_payment_methods)||void 0===s?void 0:s[0]})),o}catch(d){return(0,n.Z)({type:"lms data",status:"error",url:i.Z.lms_api_url,operation:"getCustomer",request:{customer_id:a},error:{catch:d.toString()},customer_id:a})}}},2174:(e,s,a)=>{a.d(s,{Z:()=>c});var t=a(576),r=a(6449),n=a(2261),i=a(8329),l=a(9274),o=a(511);const c=async e=>{let{auth:s,customer_id:a,stripe_id:c}=e;try{const e=await(0,t.Z)({endpoint:"getPrepaidSubscriptions",method:"POST",payload:{customer_id:a,stripe_id:c},auth:s});return!e.error&&r.Z.update((s=>{s.subscriptions={cloud_storage:(0,l.Z)(e.cloud_storage||[]),cloud_compute:(0,i.Z)(e.cloud_compute||[]),wavelength_compute:(0,i.Z)(e.wavelength_compute||[]),local_compute:(0,i.Z)(e.local_compute||[])}}))}catch(d){return(0,n.Z)({type:"lms data",status:"error",url:o.Z.lms_api_url,operation:"getPrepaidSubscriptions",error:{catch:d.toString()}})}}},5447:(e,s,a)=>{a.d(s,{Z:()=>t});const t=new(a(7387).yh)({})},4757:(e,s,a)=>{a.d(s,{Z:()=>t});const t=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase())}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[26],{9924:(e,n,a)=>{a.r(n),a.d(n,{default:()=>h});var l=a(7313),s=a(8467),i=a(7387),r=a(6417);const t=(0,l.lazy)((()=>Promise.all([a.e(110),a.e(731),a.e(583)]).then(a.bind(a,7389)))),c=(0,l.lazy)((()=>Promise.all([a.e(228),a.e(502)]).then(a.bind(a,448)))),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(187),u=a(6449),m=a(7377);const h=function(){const e=(0,s.TH)(),{customer_id:n}=(0,s.UO)(),a=o(),t=(0,i.Kw)(u.Z,(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),h=(0,i.Kw)(u.Z,(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(h).concat(e.pathname.split("primary")[1]).concat(e.search);return c?(0,r.jsxs)("main",{id:"organization",children:[(0,r.jsx)(d.Z,{}),(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(m.Z,{header:" ",spinner:!0}),children:(0,r.jsxs)(s.Z5,{children:[a.map((e=>(0,r.jsx)(s.AW,{path:e.path,element:e.element},e.path))),(0,r.jsx)(s.AW,{path:"*",element:(0,r.jsx)(s.Fg,{to:"users",replace:!0})})]})})]}):t?(0,r.jsx)(s.Z5,{children:(0,r.jsx)(s.AW,{path:"*",element:(0,r.jsx)(s.Fg,{to:"instances",replace:!0})})}):p?(0,r.jsx)(s.Z5,{children:(0,r.jsx)(s.AW,{path:"*",element:(0,r.jsx)(s.Fg,{to:p,replace:!0})})}):null}},187:(e,n,a)=>{a.d(n,{Z:()=>h});a(7313);var l=a(5708),s=a(2742),i=a(1613),r=a(8212),t=a(8467),c=a(2135),o=a(9842),d=a(4220),u=a(2261),m=a(6417);const h=function(e){let{routes:n=[]}=e;const a=(0,t.s0)(),h=(0,t.TH)(),p=(null===n||void 0===n?void 0:n.find((e=>e.link===h.pathname)))||n[0];return(0,m.jsx)(o.SV,{onError:(e,n)=>(0,u.Z)({error:{message:e.message,componentStack:n}}),FallbackComponent:d.Z,children:(0,m.jsx)(l.Z,{className:"app-subnav",children:p&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(s.Z,{navbar:!0,className:"instance-nav d-none d-md-flex",children:n.map((e=>e.external?(0,m.jsx)("li",{className:"nav-item",children:(0,m.jsxs)("a",{className:"nav-link",href:e.url,target:"_blank",rel:"noreferrer",children:[(0,m.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]})},e.path):(0,m.jsx)(i.Z,{children:(0,m.jsxs)(c.OL,{title:e.link,className:"nav-link",to:e.link||e.path,children:[(0,m.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]})},e.path)))}),(0,m.jsx)(s.Z,{navbar:!0,className:"d-flex d-md-none",children:(0,m.jsx)(r.ZP,{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,m.jsxs)("span",{children:[(0,m.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:{...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})})]})})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[250],{1412:(e,t,s)=>{s.r(t),s.d(t,{default:()=>B});var r=s(7313),a=s(6782),n=s(8467),i=s(7387),c=s(9842),o=s(6449),l=s(5708),d=s(2742),u=s(1781),m=s(9327);const x=e=>{o.Z.update((t=>{t.orgSearch=e.target.value}))},h=()=>{o.Z.update((e=>{e.orgSearch=""}))};var g=s(6417);const p=function(){const e=(0,i.Kw)(o.Z,(e=>e.orgSearch));return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(u.Z,{id:"filter_orgs",type:"text",className:"text-center",onChange:x,placeholder:"filter your organizations",value:e||""}),e&&(0,g.jsx)(m.Z,{className:"clear-filter",onClick:h,children:(0,g.jsx)("i",{className:"fa fa-times"})})]})};var j=s(4220),f=s(2261);const b=function(){return(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:j.Z,children:(0,g.jsx)(l.Z,{className:"app-subnav",children:(0,g.jsx)(d.Z,{navbar:!0,children:(0,g.jsx)("div",{className:"filter-holder",children:(0,g.jsx)(p,{})})})})})};var Z=s(5399),v=s(238),N=s(3516),y=s(6160),S=s(576);const _=async e=>{let{auth:t,customer_id:s,user_id:r,status:a}=e;return(0,S.Z)({endpoint:"updateUserOrgs",method:"POST",payload:{customer_id:s,user_id:r,status:a},auth:t})};var k=s(8564),C=s(6345);const w=function(e){let{loading:t,status:s,customer_name:a,setFlipState:n,total_instance_count:i}=e;const c=(0,y.VY)(),o=(0,r.useCallback)((e=>{e.stopPropagation();const t=e.currentTarget.getAttribute("data-action");"delete"===t&&i?c.error("You must remove all instances from an Organization before deleting it."):n(t)}),[i,c,n]);return t?(0,g.jsx)("i",{className:"status-icon fa fa-spinner fa-spin text-purple"}):"accepted"===s?(0,g.jsx)(m.Z,{"data-action":"leave",className:"status-icon",color:"link",title:"Leave ".concat(a," organization"),onClick:o,children:(0,g.jsx)("i",{className:"fa fa-times-circle text-purple"})}):"owner"===s?(0,g.jsx)(m.Z,{"data-action":"delete",className:"status-icon",color:"link",title:"Delete ".concat(a," organization"),onClick:o,children:(0,g.jsx)("i",{className:"fa fa-trash delete text-purple ".concat(i?"disabled":"")})}):null};const O=function(e){let{customer_name:t,customer_id:s,total_instance_count:l,status:d,setFlipState:u}=e;const x=(0,i.Kw)(o.Z,(e=>e.auth)),[h,p]=(0,r.useState)(!1),b=(0,n.s0)(),S=(0,y.VY)(),O=!h&&["owner","accepted"].includes(d),E=async e=>{const t=e.currentTarget.getAttribute("data-status");p(t);const r=await _({auth:x,customer_id:s,user_id:x.user_id,status:t});r.error?(S.error(r.message),p(!1)):(await(0,C.Z)(x),"declined"!==t&&p(!1),S.success("Organization ".concat(t," successfully")))};return(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t},customer_id:s}),FallbackComponent:j.Z,children:(0,g.jsx)(v.Z,{className:"instance ".concat(O?"clickable":""),onClick:async()=>O&&b("/o/".concat(s,"/instances")),children:(0,g.jsxs)(N.Z,{children:[(0,g.jsxs)(a.Z,{className:"g-0",children:[(0,g.jsx)(Z.Z,{xs:"10",className:"org-name",children:t}),(0,g.jsx)(Z.Z,{xs:"2",className:"status-icons text-end",children:(0,g.jsx)(w,{status:d,loading:h,customer_name:t,setFlipState:u,total_instance_count:l})})]}),(0,g.jsxs)("div",{className:"org-status",children:["ORG ID: ",s]}),(0,g.jsx)(k.Z,{textClass:"text-bold",label:"ROLE",isReady:!0,value:"accepted"===d?"USER":d.toUpperCase(),bottomDivider:!0}),(0,g.jsx)(k.Z,{label:"INSTANCES",isReady:!0,value:l||"..."}),(0,g.jsx)("div",{className:"action-buttons",children:"invited"===d&&(0,g.jsxs)(a.Z,{className:"g-0",children:[(0,g.jsx)(Z.Z,{xs:"6",className:"pe-1",children:(0,g.jsx)(m.Z,{title:"Decline invitation to ".concat(t," organization"),disabled:!!h,color:"danger",block:!0,"data-status":"declined",onClick:E,children:"declined"===h?(0,g.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,g.jsx)("span",{children:"Decline"})})}),(0,g.jsx)(Z.Z,{xs:"6",className:"ps-1",children:(0,g.jsx)(m.Z,{title:"Accept invitation to ".concat(t," organization"),disabled:!!h,color:"success",block:!0,"data-status":"accepted",onClick:E,children:"accepted"===h?(0,g.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,g.jsx)("span",{children:"Join"})})})]})})]})})})};var E=s(3672),z=s.n(E);const F=function(e){var t;let{customer_id:s,customer_name:n,setFlipState:l,flipState:d}=e;const x=(0,y.VY)(),h=(0,i.Kw)(o.Z,(e=>e.auth)),[p,b]=(0,r.useState)({}),[S,k]=(0,r.useState)({});return z()((async()=>{const{submitted:e}=p;if(e){const{delete_customer_name:e}=S;if(n.toString()!==(null===e||void 0===e?void 0:e.toString()))b({error:"organization name is not correct"});else{const e=await _({auth:h,customer_id:s,user_id:h.user_id,status:"removed"});e.error?x.error(e.message):(await(0,C.Z)(h),x.success("Organization removed from your profile successfully"))}}}),[p]),(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t},customer_id:s}),FallbackComponent:j.Z,children:(0,g.jsx)(v.Z,{className:"instance",children:d&&(0,g.jsxs)(N.Z,{children:[(0,g.jsxs)("ul",{className:"text-small my-0 text-nowrap",children:[(0,g.jsxs)("li",{children:[(0,g.jsx)("b",{children:"YOU"})," will be removed from the org."]}),(0,g.jsxs)("li",{children:[(0,g.jsx)("b",{children:"THE ORG"})," will not be removed."]})]}),(0,g.jsx)(u.Z,{id:"customer_name",onChange:e=>k({delete_customer_name:e.target.value}),type:"text",title:"customer name",className:"my-3",placeholder:'Enter "'.concat(n,'" here to confirm.'),value:S.customer_name}),(0,g.jsxs)(a.Z,{children:[(0,g.jsx)(Z.Z,{children:(0,g.jsx)(m.Z,{onClick:()=>l(!1),title:"Cancel",block:!0,disabled:p.submitted,color:"grey",children:"Cancel"})}),(0,g.jsx)(Z.Z,{children:(0,g.jsx)(m.Z,{onClick:()=>b({submitted:!0}),title:"Confirm Organization Details",block:!0,disabled:p.submitted||(null===n||void 0===n?void 0:n.toString())!==(null===(t=S.delete_customer_name)||void 0===t?void 0:t.toString()),color:"danger",children:p.submitted?(0,g.jsx)("i",{className:"fa fa-spinner fa-spin"}):(0,g.jsx)("span",{children:"Do It"})})})]})]})})})};const T=function(e){var t;let{customer_id:s,customer_name:n,setFlipState:l,flipState:d}=e;const x=(0,y.VY)(),h=(0,i.Kw)(o.Z,(e=>e.auth)),[p,b]=(0,r.useState)({}),[_,k]=(0,r.useState)({});return z()((async()=>{const{submitted:e}=p;if(e){const{delete_customer_name:e}=_;if(n.toString()!==(null===e||void 0===e?void 0:e.toString()))b({error:"organization name is not correct"});else{const e=await(async e=>{let{auth:t,user_id:s,customer_id:r}=e;return(0,S.Z)({endpoint:"removeOrg",method:"POST",payload:{user_id:s,customer_id:r},auth:t})})({auth:h,customer_id:s.toString(),user_id:h.user_id});e.error?b({error:e.message}):(await(0,C.Z)(h),x.success("Organization removed successfully"))}}}),[p]),(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t},customer_id:s}),FallbackComponent:j.Z,children:(0,g.jsx)(v.Z,{className:"instance",children:d&&(0,g.jsx)(N.Z,{children:p.error?(0,g.jsxs)(g.Fragment,{children:["There was an error processing your request:",(0,g.jsx)("hr",{className:"mt-3 mb-2"}),(0,g.jsx)("div",{className:"text-danger text-small",children:p.error}),(0,g.jsx)("hr",{className:"mt-2 mb-3"}),(0,g.jsx)(m.Z,{onClick:()=>l(!1),title:"Cancel",block:!0,disabled:p.submitted,color:"grey",children:"Cancel"})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("ul",{className:"text-small text-nowrap my-0",children:[(0,g.jsxs)("li",{children:[(0,g.jsx)("b",{children:"INSTANCES"})," must first be removed."]}),(0,g.jsxs)("li",{children:[(0,g.jsx)("b",{children:"USERS"})," will no longer see this org."]})]}),(0,g.jsx)(u.Z,{id:"customer_name",onChange:e=>k({delete_customer_name:e.target.value}),type:"text",title:"customer name",className:"my-3",placeholder:'Enter "'.concat(n,'" here to confirm.'),value:_.customer_name}),(0,g.jsxs)(a.Z,{children:[(0,g.jsx)(Z.Z,{children:(0,g.jsx)(m.Z,{onClick:()=>l(!1),title:"Cancel",block:!0,disabled:p.submitted,color:"grey",children:"Cancel"})}),(0,g.jsx)(Z.Z,{children:(0,g.jsx)(m.Z,{id:"deleteOrganization",onClick:()=>b({submitted:!0}),title:"Confirm Organization Details",block:!0,disabled:p.submitted||(null===n||void 0===n?void 0:n.toString())!==(null===(t=_.delete_customer_name)||void 0===t?void 0:t.toString()),color:"danger",children:p.submitted?(0,g.jsx)("i",{className:"fa fa-spinner fa-spin"}):(0,g.jsx)("span",{children:"Do It"})})})]})]})})})})};const A=function(e){return"leave"===e.flipState?(0,g.jsx)(F,{...e}):(0,g.jsx)(T,{...e})};var D=s(1554);const I=function(e){let{flippedCard:t,setFlippedCard:s,customer_id:a,...n}=e;const[i,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t!==a&&o(!1)}),[t]),(0,r.useEffect)((()=>{i&&s(a)}),[i]),(0,g.jsx)(Z.Z,{xs:"12",md:"6",lg:"4",xl:"3",className:"mb-4",children:(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t},customer_id:a}),FallbackComponent:D.Z,children:i?(0,g.jsx)(A,{setFlipState:o,flipState:i,customer_id:a,...n}):(0,g.jsx)(O,{setFlipState:o,flipState:i,customer_id:a,...n})})})},P=()=>{const[e,t]=(0,r.useState)(!1);return(0,i.Kw)(o.Z,(e=>(e=>{let{orgSearch:t,orgs:s}=e;if(!s)return[];const r=((e,t)=>{const s={};return e.filter((e=>!s[e[t]]&&(s[e[t]]=!0,!0)))})(s,"customer_id");return t&&""!==t?r.filter((e=>e.customer_name&&-1!==e.customer_name.toLowerCase().indexOf(t.toLowerCase()))):r})({orgSearch:e.orgSearch,orgs:e.auth.orgs}))).map((s=>(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:D.Z,children:(0,g.jsx)(I,{...s,flippedCard:e,setFlippedCard:t})},s.customer_id)))};const V=function(){const e=(0,n.s0)(),t=()=>{window._kmq&&window._kmq.push(["record","clicked new org card"]),e("/organizations/new")};return(0,g.jsx)(Z.Z,{xs:"12",md:"6",lg:"4",xl:"3",className:"mb-4",children:(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:j.Z,children:(0,g.jsx)(v.Z,{tabIndex:"0",id:"newOrgCard",title:"Add New Organization",className:"instance new",onKeyDown:e=>13!==e.keyCode||t(),onClick:t,children:(0,g.jsxs)(N.Z,{className:"d-flex flex-column align-items-center justify-content-center",children:[(0,g.jsx)("span",{children:"Create A New Organization"}),(0,g.jsx)("div",{className:"my-4",children:(0,g.jsx)("i",{className:"fa fa-2x fa-plus-circle new-org-plus"})}),(0,g.jsx)("span",{children:"With Its Own Instances And Billing"})]})})})})};var M=s(1446),U=s(8642),K=s(2020),R=s(2589);var Y=s(7360);const L=async e=>{let{formData:t,auth:s}=e;const{org:r,subdomain:a}=t;if(!r||!a)return{error:"All fields must be filled out"};if(!(0,Y.Z)(a))return{error:"subdomain: alphanumeric characters only"};if(a.length>16)return{error:"subdomain: max 16 characters"};const n=await(async e=>{let{auth:t,org:s,subdomain:r}=e;return(0,S.Z)({endpoint:"addOrg",method:"POST",auth:t,payload:{org:s,subdomain:r,user_id:t.user_id}})})({auth:s,org:r,subdomain:a});return n.error?{error:n.message.replace("Bad request: ","").replace(/['"]+/g,"")}:{success:!0}};const H=function(){const e=(0,i.Kw)(o.Z,(e=>e.auth)),t=(0,i.Kw)(o.Z,(e=>e.theme)),s=(0,n.s0)(),[l,d]=(0,r.useState)({}),[x,h]=(0,r.useState)({}),[p,b]=(0,r.useState)(!1),y=()=>s("/organizations");return z()((async()=>{if(x.submitted){b(!1);const t=await L({formData:l,auth:e});h(t),t.error||(await(0,C.Z)(e),y())}}),[x]),(0,r.useEffect)((()=>{x.submitted||h({})}),[l]),(0,g.jsx)(M.Z,{id:"new-org-modal",isOpen:!0,className:t,centered:!0,fade:!1,children:(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:j.Z,children:e.email_bounced?(0,g.jsx)(U.Z,{children:(0,g.jsx)(v.Z,{children:(0,g.jsxs)(N.Z,{children:[(0,g.jsxs)("div",{className:"p-4 pb-0 text-center",children:[(0,g.jsx)("b",{children:"Unable to Create New Organization"}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),"Your email address seems to be unreachable. Please update it to ensure billing, upgrade, and other critical system announcements reach you."]}),(0,g.jsxs)(a.Z,{children:[(0,g.jsx)(Z.Z,{sm:"6",children:(0,g.jsx)(m.Z,{id:"cancelNewOrg",onClick:()=>s("/organizations"),title:"Cancel New Org",block:!0,className:"mt-3",color:"grey",children:"Cancel"})}),(0,g.jsx)(Z.Z,{sm:"6",children:(0,g.jsx)(m.Z,{id:"updateEmail",onClick:()=>s("/profile"),title:"Update My Email",block:!0,className:"mt-3",color:"danger",children:"Update My Email"})})]})]})})}):x.submitted?(0,g.jsx)(U.Z,{children:(0,g.jsx)(v.Z,{children:(0,g.jsx)(N.Z,{children:(0,g.jsxs)("div",{className:"p-4 text-center",children:[(0,g.jsx)("b",{children:"Creating Your Organization"}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),(0,g.jsx)("i",{className:"fa fa-lg fa-spinner fa-spin text-purple mb-4"}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),"The Organization Otterhound is fetching your stuff."]})})})}):x.success?(0,g.jsx)(U.Z,{children:(0,g.jsx)(v.Z,{children:(0,g.jsx)(N.Z,{children:(0,g.jsxs)("div",{className:"p-4 text-center",children:[(0,g.jsx)("b",{children:"Success"}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),(0,g.jsx)("i",{className:"fa fa-lg fa-thumbs-up text-purple mb-4"}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),"Your organization was created successfully."]})})})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(K.Z,{toggle:y,children:"Add New Organization"}),(0,g.jsxs)(U.Z,{children:[(0,g.jsx)(v.Z,{className:"mb-3",children:(0,g.jsxs)(N.Z,{children:[(0,g.jsx)(R.Z,{header:"Name",children:(0,g.jsxs)(a.Z,{children:[(0,g.jsx)(Z.Z,{sm:"4",className:"pt-2 text-nowrap text-grey",children:'Ex: "My Org"'}),(0,g.jsx)(Z.Z,{sm:"8",children:(0,g.jsx)(u.Z,{id:"org_name",className:"text-center",onChange:e=>d({...l,org:e.target.value}),type:"text",title:"name",value:l.org||""})})]})}),(0,g.jsxs)(R.Z,{header:"Subdomain",subheader:"alphanumeric only. 16 char max.",children:[(0,g.jsxs)(a.Z,{children:[(0,g.jsxs)(Z.Z,{sm:"4",className:"pt-2 text-nowrap text-grey",children:['Ex: "myorg"\xa0',(0,g.jsx)(m.Z,{color:"link",title:"Learn more",onClick:()=>b(!p),children:(0,g.jsx)("i",{className:"fa fa-question-circle text-purple"})})]}),(0,g.jsx)(Z.Z,{sm:"8",children:(0,g.jsx)(u.Z,{id:"subdomain",className:"text-center",type:"text",title:"subdomain",value:l.subdomain||"",disabled:x.submitted,onChange:e=>d({...l,subdomain:e.target.value.substring(0,15).toLowerCase()})})})]}),p&&(0,g.jsx)("div",{className:"text-center pt-2 pb-1 text-lightpurple text-small",children:(0,g.jsx)("i",{children:"Part of the URL of your HarperDB Cloud Instances- see below."})}),(0,g.jsx)("hr",{className:"my-2 d-none d-sm-block"}),(0,g.jsx)(a.Z,{children:(0,g.jsx)(Z.Z,{xs:"12",className:"pt-2 text-center text-nowrap overflow-hidden text-truncate",children:l.subdomain?(0,g.jsxs)("i",{className:"text-grey",children:["INSTANCE_NAME-",l.subdomain,".harperdbcloud.com"]}):(0,g.jsx)("span",{className:"text-lightgrey",children:"INSTANCE_NAME-SUBDOMAIN.harperdbcloud.com"})})})]})]})}),(0,g.jsx)(m.Z,{id:"createOrganization",onClick:()=>h({submitted:!0}),title:"Create Organization",block:!0,className:"mt-3",color:"success",children:"Create Organization"}),x.error&&(0,g.jsx)(v.Z,{className:"mt-3 error",children:(0,g.jsx)(N.Z,{children:x.error})})]})]})})})};var q=s(7377);const B=function(){const{list:e,action:t}=(0,n.UO)(),s=(0,n.s0)(),l=(0,i.Kw)(o.Z,(e=>e.auth));return(0,r.useEffect)((()=>o.Z.update((e=>{e.users=!1,e.instances=!1,e.hasCard=!1,e.lastUpdate=!1})))),(0,r.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,g.jsxs)("div",{id:"organizations",children:[(0,g.jsx)(b,{}),null!==l&&void 0!==l&&l.orgs?(0,g.jsxs)(a.Z,{children:[(0,g.jsx)(c.SV,{onError:(e,t)=>(0,f.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:D.Z,children:(0,g.jsx)(V,{})}),(0,g.jsx)(P,{})]}):(0,g.jsx)(q.Z,{header:"loading organizations",spinner:!0}),"new"===t&&(0,g.jsx)(H,{})]})}},8564:(e,t,s)=>{s.d(t,{Z:()=>i});s(7313);var r=s(6782),a=s(5399),n=s(6417);const i=function(e){let{label:t,value:s,textClass:i="",isReady:c,bottomDivider:o=!1}=e;return(0,n.jsxs)(r.Z,{className:"card-front-status-row text-darkgrey",children:[(0,n.jsx)(a.Z,{xs:"4",children:t}),(0,n.jsx)(a.Z,{xs:"8",className:i,children:c?s:""}),o&&(0,n.jsx)(a.Z,{xs:"12",children:(0,n.jsx)("hr",{})})]})}},2589:(e,t,s)=>{s.d(t,{Z:()=>a});s(7313);var r=s(6417);const a=function(e){let{children:t,header:s,subheader:a,maxHeight:n="auto",minHeight:i="auto",className:c}=e;return(0,r.jsxs)("div",{className:"content-container ".concat(c),children:[(0,r.jsxs)("div",{className:"header-container",children:[(0,r.jsx)("span",{className:"header",children:s}),(0,r.jsx)("span",{className:"subheader",children:a})]}),(0,r.jsx)("div",{className:"auto"!==n?"scrollable":"",style:{maxHeight:n,minHeight:i},children:t})]})}},1554:(e,t,s)=>{s.d(t,{Z:()=>n});s(7313);var r=s(4220),a=s(6417);const n=function(e){return(0,a.jsx)(r.Z,{...e,extraClass:"entity-card"})}},7360:(e,t,s)=>{s.d(t,{Z:()=>r});const r=e=>e.match(/^[a-z0-9]+$/i)},2742:(e,t,s)=>{s.d(t,{Z:()=>h});var r=s(7313),a=s(5192),n=s.n(a),i=s(6123),c=s.n(i),o=s(986),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 r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},d.apply(this,arguments)}function u(e,t){if(null==e)return{};var s,r,a=function(e,t){if(null==e)return{};var s,r,a={},n=Object.keys(e);for(r=0;r<n.length;r++)s=n[r],t.indexOf(s)>=0||(a[s]=e[s]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)s=n[r],t.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(a[s]=e[s])}return a}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.iC,vertical:n().oneOfType([n().bool,n().string])};function x(e){var t=e.className,s=e.cssModule,a=e.tabs,n=e.pills,i=e.vertical,m=void 0!==i&&i,x=e.horizontal,h=e.justified,g=e.fill,p=e.navbar,j=e.card,f=e.tag,b=void 0===f?"ul":f,Z=u(e,l),v=(0,o.mx)(c()(t,p?"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":a,"card-header-tabs":j&&a,"nav-pills":n,"card-header-pills":j&&n,"nav-justified":h,"nav-fill":g}),s);return r.createElement(b,d({},Z,{className:v}))}x.propTypes=m;const h=x},5708:(e,t,s)=>{s.d(t,{Z:()=>g});var r=s(7313),a=s(5192),n=s.n(a),i=s(6123),c=s.n(i),o=s(986),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 r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}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,r,a=function(e,t){if(null==e)return{};var s,r,a={},n=Object.keys(e);for(r=0;r<n.length;r++)s=n[r],t.indexOf(s)>=0||(a[s]=e[s]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)s=n[r],t.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(a[s]=e[s])}return a}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.iC};function h(e){var t,s=e.expand,a=void 0!==s&&s,n=e.className,i=e.cssModule,x=e.light,h=e.dark,g=e.fixed,p=e.sticky,j=e.color,f=e.container,b=void 0===f?"fluid":f,Z=e.tag,v=void 0===Z?"nav":Z,N=e.children,y=m(e,l),S=(0,o.mx)(c()(n,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-".concat(e))}(a),(u(t={"navbar-light":x,"navbar-dark":h},"bg-".concat(j),j),u(t,"fixed-".concat(g),g),u(t,"sticky-".concat(p),p),t)),i),_=b&&!0===b?"container":"container-".concat(b);return r.createElement(v,d({},y,{className:S}),b?r.createElement("div",{className:_},N):N)}h.propTypes=x;const g=h},3672:(e,t,s)=>{var r=s(7313);function a(e,t,s){var a="function"===typeof t;r.useEffect((function(){var s,r=!0,n=e((function(){return r}));return Promise.resolve(n).then((function(e){s=e})),function(){r=!1,a&&t(s)}}),a?s:t)}e.exports=a,e.exports.useAsyncEffect=a}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[845],{7875:(e,s,t)=>{t.r(s),t.d(s,{default:()=>d});var r=t(7313),a=t(8467),n=t(6417);const o=(0,r.lazy)((()=>Promise.all([t.e(409),t.e(845)]).then(t.bind(t,6043)))),l=[{element:(0,n.jsx)(o,{}),path:"",link:"profile",label:"profile",icon:"user",iconCode:"f007"}];var i=t(187),c=t(7377);const d=function(){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Z,{}),(0,n.jsx)(r.Suspense,{fallback:(0,n.jsx)(c.Z,{header:" ",spinner:!0}),children:(0,n.jsxs)(a.Z5,{children:[l.map((e=>(0,n.jsx)(a.AW,{path:e.path,element:e.element},e.path))),(0,n.jsx)(a.AW,{path:"*",element:(0,n.jsx)(a.Fg,{to:"/profile",replace:!0})},"*")]})})]})}},6043:(e,s,t)=>{t.r(s),t.d(s,{default:()=>N});var r=t(7313),a=t(6782),n=t(5399),o=t(238),l=t(3516),i=t(1781),c=t(9327),d=t(7387),u=t(9842),p=t(6449),m=t(576),h=t(2261),f=t(511),x=t(6345);var b=t(1891),g=t(4220),j=t(3263),v=t(6417);const y=function(){const e=(0,d.Kw)(p.Z,(e=>e.auth)),[s,t]=(0,r.useState)({}),[y,w]=(0,r.useState)(e),Z="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)(u.SV,{onError:(e,s)=>(0,h.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:g.Z,children:(0,v.jsx)("div",{className:"my-3",children:s.processing?(0,v.jsx)(b.Z,{height:Z,status:"processing",header:"Updating Profile",subhead:"The Profile Poodle is doing his thing."}):s.success?(0,v.jsx)(b.Z,{height:Z,status:"success",header:"Success!",subhead:s.success}):s.error?(0,v.jsx)(b.Z,{height:Z,status:"error",header:s.error,subhead:"Please try again"}):(0,v.jsx)(o.Z,{className:"mb-3",children:(0,v.jsxs)(l.Z,{children:[(0,v.jsxs)(a.Z,{children:[(0,v.jsx)(n.Z,{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.Z,{md:"6",xs:"12",children:(0,v.jsx)(i.Z,{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({...y,email:e.target.value}),value:y.email||"",disabled:s.submitted})}),(0,v.jsx)(n.Z,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"first name"}),(0,v.jsx)(n.Z,{md:"6",xs:"12",children:(0,v.jsx)(i.Z,{id:"firstname",type:"text",className:"mb-0 text-center",name:"fname",placeholder:"first name",onChange:e=>w({...y,firstname:e.target.value}),value:y.firstname||"",disabled:s.submitted})}),(0,v.jsx)(n.Z,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"last name"}),(0,v.jsx)(n.Z,{md:"6",xs:"12",children:(0,v.jsx)(i.Z,{id:"lastname",type:"text",className:"mb-0 text-center",name:"lname",placeholder:"last name",onChange:e=>w({...y,lastname:e.target.value}),value:y.lastname||"",disabled:s.submitted})}),(0,v.jsx)(n.Z,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"github repo"}),(0,v.jsx)(n.Z,{md:"6",xs:"12",children:(0,v.jsx)(i.Z,{id:"github_repo",type:"text",className:"mb-0 text-center",name:"github_repo",placeholder:"github repo",onChange:e=>w({...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)(c.Z,{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,j.Z)(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:o,email:l}=e,i=null;try{return i=await(0,m.Z)({endpoint:"updateUser",method:"POST",payload:{firstname:t,lastname:r,customer_id:a,user_id:n,github_repo:o,email:l},auth:s}),i.error?p.Z.update((e=>{e.auth={...s,...i,profileError:Date.now()}})):(p.Z.update((e=>{e.auth={...s,profileSuccess:Date.now(),...i}})),(0,x.Z)({email:l,pass:s.pass,loggingIn:!0}))}catch(c){return(0,h.Z)({type:"lms data",status:"error",url:f.Z.lms_api_url,operation:"updateUser",request:{firstname:t,lastname:r,customer_id:a,user_id:n,github_repo:o},error:{catch:c.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(9395);const Z=function(){const e=(0,d.Kw)(p.Z,(e=>e.auth)),[s,t]=(0,r.useState)({}),[m,f]=(0,r.useState)({}),x="259px";return(0,r.useEffect)((()=>{null!==e&&void 0!==e&&e.passwordError?t({error:e.message}):null!==e&&void 0!==e&&e.passwordSuccess&&t({success:e.message})}),[e.passwordError,e.passwordSuccess]),(0,r.useEffect)((()=>{let e=!0;return(s.error||s.success)&&setTimeout((()=>{e&&t({})}),2e3),()=>{e=!1}}),[s.error,s.success]),(0,v.jsx)(u.SV,{onError:(e,s)=>(0,h.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:g.Z,children:(0,v.jsx)("div",{className:"my-3",children:s.processing?(0,v.jsx)(b.Z,{height:x,status:"processing",header:"Updating Password",subhead:"The Security Shepherd is mad-hashing."}):s.success?(0,v.jsx)(b.Z,{height:x,status:"success",header:"Success!",subhead:s.success}):s.error?(0,v.jsx)(b.Z,{height:x,status:"error",header:s.error,subhead:"Please try again"}):(0,v.jsx)(o.Z,{children:(0,v.jsxs)(l.Z,{children:[(0,v.jsxs)(a.Z,{children:[(0,v.jsx)(n.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"current password"}),(0,v.jsx)(n.Z,{md:"6",xs:"12",children:(0,v.jsx)(i.Z,{id:"oldpassword",type:"password",className:"mb-0 text-center",name:"current password",placeholder:"current password",onChange:e=>f({...m,oldpassword:e.target.value}),value:m.oldpassword||"",disabled:s.submitted})}),(0,v.jsx)(n.Z,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"new password"}),(0,v.jsx)(n.Z,{md:"6",xs:"12",children:(0,v.jsx)(i.Z,{id:"newpassword1",type:"password",className:"mb-0 text-center",name:"new password",placeholder:"new password",onChange:e=>f({...m,newpassword:e.target.value}),value:m.newpassword||"",disabled:s.submitted})}),(0,v.jsx)(n.Z,{xs:"12",children:(0,v.jsx)("hr",{className:"my-2"})}),(0,v.jsx)(n.Z,{xs:"6",className:"text text-nowrap d-none d-md-block pt-2",children:"verify password"}),(0,v.jsx)(n.Z,{md:"6",xs:"12",children:(0,v.jsx)(i.Z,{id:"newpassword2",type:"password",className:"mb-0 text-center",name:"verify password",placeholder:"verify password",onChange:e=>f({...m,newpassword2:e.target.value}),value:m.newpassword2||"",disabled:s.submitted})})]}),(0,v.jsx)("hr",{className:"mt-2 mb-4"}),(0,v.jsx)(c.Z,{id:"updatePassword",color:"purple",block:!0,onClick:()=>{t({submitted:!0});const{oldpassword:s,newpassword:r,newpassword2:a}=m;s!==e.pass?t({error:"old password is incorrect"}):r!==a?t({error:"new passwords do not match"}):s&&r&&a?(t({processing:!0}),(0,w.Z)({auth:e,user_id:e.user_id,password:r})):t({error:"all fields are required"})},disabled:s.submitted,children:"Update Password"})]})})})})};const N=function(){return(0,v.jsxs)(a.Z,{children:[(0,v.jsxs)(n.Z,{md:"6",className:"mb-4",children:[(0,v.jsx)("span",{className:"floating-card-header",children:"profile"}),(0,v.jsx)(y,{})]}),(0,v.jsxs)(n.Z,{md:"6",className:"mb-4",children:[(0,v.jsx)("span",{className:"floating-card-header",children:"password"}),(0,v.jsx)(Z,{})]})]})}},1891:(e,s,t)=>{t.d(s,{Z:()=>o});t(7313);var r=t(238),a=t(3516),n=t(6417);const o=function(e){let{header:s,subhead:t=" ",height:o,status:l,className:i}=e;return(0,n.jsx)(r.Z,{className:"form-status ".concat(i),children:(0,n.jsxs)(a.Z,{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"===l?"fa-spinner fa-spin text-purple":"success"===l?"fa-check-circle text-purple":"fa-exclamation-triangle text-danger")})}),(0,n.jsx)("div",{className:"text-grey",children:t})]})})}},187:(e,s,t)=>{t.d(s,{Z:()=>m});t(7313);var r=t(5708),a=t(2742),n=t(1613),o=t(8212),l=t(8467),i=t(2135),c=t(9842),d=t(4220),u=t(2261),p=t(6417);const m=function(e){let{routes:s=[]}=e;const t=(0,l.s0)(),m=(0,l.TH)(),h=(null===s||void 0===s?void 0:s.find((e=>e.link===m.pathname)))||s[0];return(0,p.jsx)(c.SV,{onError:(e,s)=>(0,u.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:d.Z,children:(0,p.jsx)(r.Z,{className:"app-subnav",children:h&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(a.Z,{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)(n.Z,{children:(0,p.jsxs)(i.OL,{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)(a.Z,{navbar:!0,className:"d-flex d-md-none",children:(0,p.jsx)(o.ZP,{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:{...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})})]})})})}},9395:(e,s,t)=>{t.d(s,{Z:()=>l});var r=t(576),a=t(6449),n=t(2261),o=t(511);const l=async e=>{let{auth:s,user_id:t,password:l}=e,i=null;try{return i=await(0,r.Z)({endpoint:"updatePassword",method:"POST",payload:{user_id:t,password:l,loggingIn:!0},auth:s}),i.error?a.Z.update((e=>{e.auth={...s,...i,passwordError:Date.now()}})):a.Z.update((e=>{e.auth={...s,passwordSuccess:Date.now(),update_password:!1,...i,pass:l}}))}catch(c){return(0,n.Z)({type:"lms data",status:"error",url:o.Z.lms_api_url,operation:"updatePassword",request:{user_id:t},error:{catch:c.toString()}})}}},3263:(e,s,t)=>{t.d(s,{Z:()=>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)},1781:(e,s,t)=>{t.d(s,{Z:()=>v});var r=t(7313),a=t(5192),n=t.n(a),o=t(6123),l=t.n(o),i=t(986);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:i.iC,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,v="select"===n,y="range"===n,w=h||(v||"textarea"===n?n:"input"),Z="form-control";x?(Z="".concat(Z,"-plaintext"),w=h||"input"):y?Z="form-range":v?Z="form-select":j&&(Z=f?null:"form-check-input"),g.size&&/\D/g.test(g.size)&&((0,i.O4)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),o=g.size,delete g.size);var N=(0,i.mx)(l()(s,m&&"is-invalid",c&&"is-valid",!!o&&(v?"form-select-".concat(o):"form-control-".concat(o)),Z),t);return("input"===w||h&&"function"===typeof h)&&(g.type="switch"===n?"checkbox":n),g.children&&!x&&"select"!==n&&"string"===typeof w&&"select"!==w&&((0,i.O4)('Input with a type of "'.concat(n,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete g.children),r.createElement(w,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 v=j}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[500],{5365:(e,t,a)=>{a.r(t),a.d(t,{default:()=>j});var r=a(7313),s=a(8190),i=a(2274),n=a(4130),l=a(6782),o=a(5399),c=a(1781),u=a(9327),d=a(8467),h=a(7387),p=a(6160),f=a(3672),v=a.n(f),b=a(9842),m=a(6449),k=a(5447),g=a(9859);var y=a(1343);var _=a(4220),x=a(2261),w=a(6417);const j=function(e){let{showAttributes:t,fetchRoles:a}=e;const f=(0,p.VY)(),{role_id:j}=(0,d.UO)(),C=(0,h.Kw)(k.Z,(e=>e.roles)),O=(0,h.Kw)(k.Z,(e=>{var t;return null===(t=e.registration)||void 0===t?void 0:t.version})),[S,P]=(null===O||void 0===O?void 0:O.split("."))||[],T=parseFloat("".concat(S,".").concat(P)),E=(0,h.Kw)(k.Z,(e=>e.lastUpdate)),Z=(0,h.Kw)(k.Z,(e=>e.auth)),N=(0,h.Kw)(k.Z,(e=>e.url)),F=(0,h.Kw)(m.Z,(e=>e.theme)),[M,X]=(0,r.useState)({}),[A,B]=(0,r.useState)({}),[R,K]=(0,r.useState)({}),[D,U]=(0,r.useState)({}),[L,I]=(0,r.useState)(!1),[J,Y]=(0,r.useState)(!1),[V,G]=(0,r.useState)(!0),q=S>=3&&(S>3||P>=3),z=q?"calc(100vh - 440px)":"calc(100vh - 340px)",H={checked:(0,w.jsxs)("div",{style:{width:"100%",textAlign:"center"},children:["manage ",T>=4.2?"databases":"schemas","/tables"]}),unchecked:(0,w.jsxs)("div",{style:{width:"100%",textAlign:"center"},children:["manage ",T>=4.2?"databases":"schemas","/tables"]})};return v()((async()=>{var e;if(j&&C&&null!==(e=C.find((e=>e.id===j)))&&void 0!==e&&e.permission){var a;const e=null===(a=C.find((e=>e.id===j)))||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,y.Z)({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:Z,url:N,version:O,currentRolePermissions:e,showAttributes:t});B(s),X(s),U(r),K(r)}}),[j,C,E,t]),(0,w.jsxs)(b.SV,{onError:(e,t)=>(0,x.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:_.Z,children:[q&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(l.Z,{children:[(0,w.jsx)(o.Z,{xs:"12",sm:"6",md:"12",lg:"5",xl:"4",className:"pt-2 pb-2",children:(0,w.jsx)(i.Z,{width:"100%",checked:!!R,onChange:()=>{K(!R&&(!1!==R||!D||D)),Y(!0)},icons:H})}),R&&(0,w.jsx)(o.Z,{xs:"12",sm:"6",md:"12",lg:"7",xl:"8",children:(0,w.jsx)(c.Z,{onChange:e=>{K(!e.target.value||e.target.value),Y(!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===R?"":R,disabled:L})})]}),(0,w.jsx)("hr",{})]}),(0,w.jsx)(s.Z,{placeholder:A,height:z,theme:"light_mitsuketa_tribute",colors:{background:"transparent",default:"dark"===F?"#aaa":"#000",colon:"dark"===F?"#aaa":"#000",keys:"dark"===F?"#aaa":"#000",string:"#13c664",number:"#ea4c89",primitive:"#ffa500"},style:{warningBox:{display:"none"}},locale:n.Z,width:"100%",waitAfterKeyPress:1e3,confirmGood:!1,onChange:e=>{G(!e.error),Y(JSON.stringify(e.jsObject)!==JSON.stringify(A)),X(e.jsObject)}}),(0,w.jsx)("hr",{}),(0,w.jsx)(u.Z,{id:"updateRolePermissions",block:!0,color:"success",disabled:L||!J||!V,onClick:async e=>{if(e.preventDefault(),!M)return f.error("Please insert valid JSON to proceed"),!1;I(!0),Y(!1);const t={super_user:!1,...M};q&&(t.structure_user=!0===R||!!R&&R.split(/[ ,]+/).filter((e=>""!==e)));const r=await(async e=>{let{auth:t,url:a,id:r,permission:s}=e;return(0,g.Z)({operation:{operation:"alter_role",id:r,permission:s},auth:t,url:a})})({permission:t,id:j,auth:Z,url:N});if(I(!1),r.error){let e=r.role_errors||r.message;return e+=". Permissions reset.",f.error(e),K(D),X(A)}return f.success("Permissions updated successfully"),a(),k.Z.update((e=>{e.lastUpdate=Date.now()}))},children:L?(0,w.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,w.jsx)("span",{children:"Update Role Permissions"})})]})}},6194:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});var r,s=a(7313),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"}))}},2274:(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(7313),n=h(i),l=h(a(6123)),o=h(a(5192)),c=h(a(6194)),u=h(a(2808)),d=a(8354);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.Z=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})])}},8354:(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}}},2808:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});var r,s=a(7313),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"}))}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[803],{2717:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var n=r(7313),o=r(238),i=r(3516),s=r(6597),a=r(1781),c=r(9327),l=r(8467),u=r(7387),p=r(7377),f=r(2190),d=r(2230),m=r(6449),y=r(6417);const b=function(){const e=(0,u.Kw)(m.Z,(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,n.useState)({}),[b,g]=(0,n.useState)({}),[h,v]=(0,f.Z)({}),j=(0,l.s0)(),x=async()=>{r({submitted:!0});const{user:t,pass:n}=b;if(t&&n){const o=await(0,d.Z)({auth:{user:t,pass:n},url:e});o.error&&"catch"===o.type?r({error:"SSL ERROR. ACCEPT SELF-SIGNED CERT?",url:e}):o.error&&"Login failed"===o.message||"Login failed"===o.error?r({error:"Login failed. Using instance credentials?",url:"https://harperdb.io/docs/harperdb-studio/instances/#instance-login"}):o.error?r({error:o.message||o.error}):(v({...h,local:{valid:!0,user:b.user,pass:b.pass,super:o.role.permission.super_user,structure:o.role.permission.structure_user}}),setTimeout(j("/o/local/i/local/browse"),0))}else r({error:"All fields are required"})},O=e=>{"Enter"===e.code&&r({submitted:!0})};return(0,y.jsx)("div",{id:"login-form",children:t.submitted?(0,y.jsx)(p.Z,{header:"signing in",spinner:!0,relative:!0}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o.Z,{className:"mb-3",children:(0,y.jsx)(i.Z,{onKeyDown:e=>13!==e.keyCode||x(),children:(0,y.jsxs)(s.Z,{children:[(0,y.jsx)("div",{className:"instructions",children:"Please sign into HarperDB"}),(0,y.jsx)(a.Z,{id:"username",autoComplete:"username",onChange:e=>g({...b,user:e.target.value}),className:"text-center mb-1",type:"text",title:"instance user",placeholder:"instance user",value:b.user||"",disabled:t.submitted,onKeyDown:O}),(0,y.jsx)(a.Z,{id:"password",name:"password",autoComplete:"current-password",onChange:e=>g({...b,pass:e.target.value}),className:"text-center mb-2",type:"password",title:"instance password",placeholder:"instance password",disabled:t.submitted,value:b.pass||"",onKeyDown:O}),(0,y.jsx)(c.Z,{id:"signIn",onClick:x,title:"Sign In My Account",block:!0,color:"purple",disabled:t.submitted,children:"Sign In"})]})})}),t.error&&(0,y.jsxs)("a",{href:t.url||null,target:"_blank",rel:"noopener noreferrer",className:"text-bold text-center text-small text-danger d-block mt-2 text-nowrap text-decoration-none",children:[(0,y.jsx)("span",{className:"text-danger",children:t.error}),t.url&&(0,y.jsx)("i",{className:"ms-2 fa fa-lg fa-external-link-square text-danger"})]})]})})}},3929:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(7313),o=r(238),i=r(3516),s=r(6597),a=r(1781),c=r(9327),l=r(6782),u=r(5399),p=r(8467),f=r(2135),d=r(7387),m=r(5733),y=r(6449),b=r(6345),g=r(4757),h=r(7377),v=r(9266),j=r(6417);const x=function(){const{search:e}=(0,p.TH)(),{user:t,token:r}=m.Z.parse(e,{decode:!1}),x=(0,d.Kw)(y.Z,(e=>e.auth)),O=(0,d.Kw)(y.Z,(e=>e.theme)),[w,k]=(0,n.useState)({}),[S,R]=(0,n.useState)({}),[_,N]=(0,v.Z)({}),C=()=>{k({submitted:!0});const{email:e,pass:t}=S;(0,g.Z)(e)?t?"akamai"===O&&-1===S.email.indexOf("harperdb.io")&&-1===S.email.indexOf("akamai.com")?k({error:"portal access denied"}):(k({processing:!0}),N({..._,email:e,pass:t}),(0,b.Z)({email:e,pass:t,loggingIn:!0})):k({error:"password is required"}):k({error:"a valid email is required"})};return(0,n.useEffect)((()=>{null!==x&&void 0!==x&&x.error&&(k({error:["Unauthorized","User does not exist"].includes(x.message)?"Login Failed":x.message}),setTimeout((()=>k({})),3e3))}),[x]),(0,n.useEffect)((()=>!w.submitted&&k({})),[S]),(0,n.useEffect)((()=>{t&&r&&(0,b.Z)({email:t,pass:r,loggingIn:!0})}),[t,r]),(0,j.jsx)("div",{id:"login-form",children:w.processing?(0,j.jsx)(h.Z,{header:"signing in",spinner:!0,relative:!0}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.Z,{className:"mb-3",children:(0,j.jsx)(i.Z,{onKeyDown:e=>13!==e.keyCode||C(),children:(0,j.jsxs)(s.Z,{children:[(0,j.jsx)("div",{className:"instructions",children:"Please sign into HarperDB Studio"}),(0,j.jsx)(a.Z,{name:"email",autoComplete:"email",id:"email",onChange:e=>{e.currentTarget.focus(),R({...S,email:e.target.value.trim().toLowerCase()})},value:S.email||"",disabled:w.submitted,className:"mb-2 text-center",type:"text",title:"email",placeholder:"email address"}),(0,j.jsx)(a.Z,{id:"password",onChange:e=>{e.currentTarget.focus(),R({...S,pass:e.target.value})},value:S.pass||"",disabled:w.submitted,className:"mb-2 text-center",type:"password",title:"password",name:"password",autoComplete:"current-password",placeholder:"password"}),(0,j.jsx)(c.Z,{id:"signIn",onClick:C,title:"Sign In My Account",block:!0,color:"purple",disabled:w.submitted,children:"Sign In"})]})})}),w.error?(0,j.jsx)("div",{className:"login-nav-link error",children:w.error}):(0,j.jsxs)(l.Z,{children:[(0,j.jsx)(u.Z,{xs:"6",children:(0,j.jsx)(f.OL,{to:"/sign-up",className:"login-nav-link",children:"Sign Up for Free"})}),(0,j.jsx)(u.Z,{xs:"6",className:"text-end",children:(0,j.jsx)(f.OL,{to:"/reset-password",className:"login-nav-link",children:"Reset Password"})})]})]})})}},2230:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(9859);const o=async e=>{let{auth:t,url:r}=e;return(0,n.Z)({operation:{operation:"user_info"},auth:t,url:r,timeout:5e3})}},9859:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(8093);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),p=await(0,n.he)(o,{signal:a||e.signal,method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",authorization:"token"===s?"Bearer ".concat(r.token):"Basic ".concat(btoa("".concat(r.user,":").concat(r.pass)))}});clearTimeout(u);const f=await p.json();var c,l;return f.error?{error:!0,message:f.error,type:"response",role_errors:null===(c=f.main_permissions)||void 0===c?void 0:c.join(", "),access_errors:null===(l=f.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"}:f}catch(u){return{error:!0,message:u.message,type:"catch"}}}},2190:(e,t,r)=>{r.d(t,{Z:()=>n});const n=(0,r(8131).Z)("instanceAuths")},4757:(e,t,r)=>{r.d(t,{Z:()=>n});const n=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase())},6597:(e,t,r)=>{r.d(t,{Z:()=>h});var n=r(7313),o=r(5192),i=r.n(o),s=r(986);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 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 f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(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=y(e);if(t){var o=y(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 y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}var b={children:i().node,tag:s.iC,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&&f(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,p=u(e,c),f=(0,s.mx)(t,r);return n.createElement(i,l({},p,{ref:a,className:f}))}}])&&p(t.prototype,r),o&&p(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(n.Component);g.propTypes=b;const h=g},1781:(e,t,r)=>{r.d(t,{Z:()=>j});var n=r(7313),o=r(5192),i=r.n(o),s=r(6123),a=r.n(s),c=r(986);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 p(){return p=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},p.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={},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 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 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 b(e)}(this,r)}}function b(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.iC,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=y(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.focus=t.focus.bind(b(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,y=e.addon,b=e.plaintext,g=e.innerRef,h=f(e,u),v=["switch","radio","checkbox"].indexOf(i)>-1,j="select"===i,x="range"===i,O=m||(j||"textarea"===i?i:"input"),w="form-control";b?(w="".concat(w,"-plaintext"),O=m||"input"):x?w="form-range":j?w="form-select":v&&(w=y?null:"form-check-input"),h.size&&/\D/g.test(h.size)&&((0,c.O4)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),s=h.size,delete h.size);var k=(0,c.mx)(a()(t,d&&"is-invalid",l&&"is-valid",!!s&&(j?"form-select-".concat(s):"form-control-".concat(s)),w),r);return("input"===O||m&&"function"===typeof m)&&(h.type="switch"===i?"checkbox":i),h.children&&!b&&"select"!==i&&"string"===typeof O&&"select"!==O&&((0,c.O4)('Input with a type of "'.concat(i,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete h.children),n.createElement(O,p({},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},5733:(e,t,r)=>{r.d(t,{Z:()=>N});var n={};r.r(n),r.d(n,{exclude:()=>_,extract:()=>x,parse:()=>O,parseUrl:()=>k,pick:()=>R,stringify:()=>w,stringifyUrl:()=>S});const o="%[a-f0-9]{2}",i=new RegExp("("+o+")|([^%]+?)","gi"),s=new RegExp("("+o+")+","gi");function a(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;const r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],a(r),a(n))}function c(e){try{return decodeURIComponent(e)}catch{let t=e.match(i)||[];for(let r=1;r<t.length;r++)t=(e=a(t,r).join("")).match(i)||[];return e}}function l(e){if("string"!==typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return function(e){const t={"%FE%FF":"\ufffd\ufffd","%FF%FE":"\ufffd\ufffd"};let r=s.exec(e);for(;r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{const e=c(r[0]);e!==r[0]&&(t[r[0]]=e)}r=s.exec(e)}t["%C2"]="\ufffd";const n=Object.keys(t);for(const o of n)e=e.replace(new RegExp(o,"g"),t[o]);return e}(e)}}function u(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)]}function p(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}const f=e=>null===e||void 0===e,d=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>"%".concat(e.charCodeAt(0).toString(16).toUpperCase()))),m=Symbol("encodeFragmentIdentifier");function y(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function b(e,t){return t.encode?t.strict?d(e):encodeURIComponent(e):e}function g(e,t){return t.decode?l(e):e}function h(e){return Array.isArray(e)?e.sort():"object"===typeof e?h(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function v(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function j(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function x(e){const t=(e=v(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function O(e,t){y((t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...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&&g(r,e).includes(e.arrayFormatSeparator);r=i?g(r,e):r;const s=o||i?r.split(e.arrayFormatSeparator).map((t=>g(t,e))):null===r?r:g(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?g(r,e):r);const i=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>g(t,e)));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.replace(/\+/g," "):o;let[i,s]=u(e,"=");void 0===i&&(i=e),s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:g(s,t),r(g(i,t),s,n)}for(const[o,i]of Object.entries(n))if("object"===typeof i&&null!==i)for(const[e,r]of Object.entries(i))i[e]=j(r,t);else n[o]=j(i,t);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 Boolean(r)&&"object"===typeof r&&!Array.isArray(r)?e[t]=h(r):e[t]=r,e}),Object.create(null))}function w(e,t){if(!e)return"";y((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);const r=r=>t.skipNull&&f(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,[b(t,e),"[",o,"]"].join("")]:[...r,[b(t,e),"[",b(o,e),"]=",b(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[b(t,e),"[]"].join("")]:[...r,[b(t,e),"[]=",b(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,[b(t,e),":list="].join("")]:[...r,[b(t,e),":list=",b(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?[[b(r,e),t,b(o,e)].join("")]:[[n,b(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,b(t,e)]:[...r,[b(t,e),"=",b(n,e)].join("")]}}(t),o={};for(const[s,a]of Object.entries(e))r(s)||(o[s]=a);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((r=>{const o=e[r];return void 0===o?"":null===o?b(r,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?b(r,t)+"[]":o.reduce(n(r),[]).join("&"):b(r,t)+"="+b(o,t)})).filter((e=>e.length>0)).join("&")}function k(e,t){var r,n;t={decode:!0,...t};let[o,i]=u(e,"#");return void 0===o&&(o=e),{url:null!==(r=null===(n=o)||void 0===n||null===(n=n.split("?"))||void 0===n?void 0:n[0])&&void 0!==r?r:"",query:O(x(e),t),...t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:g(i,t)}:{}}}function S(e,t){t={encode:!0,strict:!0,[m]:!0,...t};const r=v(e.url).split("?")[0]||"";let n=w({...O(x(e.url),{sort:!1}),...e.query},t);n&&(n="?".concat(n));let o=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);if(e.fragmentIdentifier){const n=new URL(r);n.hash=e.fragmentIdentifier,o=t[m]?n.hash:"#".concat(e.fragmentIdentifier)}return"".concat(r).concat(n).concat(o)}function R(e,t,r){r={parseFragmentIdentifier:!0,[m]:!1,...r};const{url:n,query:o,fragmentIdentifier:i}=k(e,r);return S({url:n,query:p(o,t),fragmentIdentifier:i},r)}function _(e,t,r){return R(e,Array.isArray(t)?e=>!t.includes(e):(e,r)=>!t(e,r),r)}const N=n}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[150],{5313:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var r=n(7313),o=n(238),a=n(3516),i=n(6782),s=n(5399),c=n(6597),l=n(1781),u=n(9327),f=n(8467),d=n(2135),p=n(3672),m=n.n(p),b=n(5733),h=n(7387),y=n(4757),g=n(576);var v=n(7360),x=n(6345);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,y.Z)(a))return{error:"Please provide a valid email"};if(!(0,v.Z)(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"))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,g.Z)({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,x.Z)({email:a,pass:f.temp_password,loggingIn:!0}):{success:!0})};var O=n(7377),w=n(6449),k=n(6417);const _=function(){const{search:e}=(0,f.TH)(),{code:t,htuk:n,pageName:p,pageUri:y}=b.Z.parse(e),g=(0,h.Kw)(w.Z,(e=>e.auth)),v=(0,h.Kw)(w.Z,(e=>e.theme)),[x,_]=(0,r.useState)({}),[N,S]=(0,r.useState)({coupon_code:t,htuk:n,pageName:p,pageUri:y}),[P,C]=(0,r.useState)(!1);return m()((async()=>{if(x.submitted){const e=await j({formData:N,theme:v});!g.email&&e&&_(e)}}),[x]),(0,r.useEffect)((()=>{x.submitted||_({})}),[N]),x.submitted?(0,k.jsx)("div",{id:"login-form",children:(0,k.jsx)(O.Z,{header:"creating your account",spinner:!0,relative:!0})}):(0,k.jsxs)("div",{id:"login-form",className:"sign-up",children:[(0,k.jsx)(o.Z,{className:"mb-3",children:(0,k.jsxs)(a.Z,{className:"px-3",onKeyDown:e=>13!==e.keyCode||_({submitted:!0}),children:[(0,k.jsx)("div",{className:"sign-up-header",children:"Sign Up And Launch Your Free HarperDB Cloud Instance Today"}),(0,k.jsxs)(i.Z,{children:[(0,k.jsxs)(s.Z,{xs:"12",md:"8",children:[(0,k.jsxs)("div",{className:"sign-up-content",children:[(0,k.jsxs)("ul",{children:[(0,k.jsx)("li",{children:"Provision HarperDB Cloud and user-installed instances"}),(0,k.jsx)("li",{children:"Configure instance databases, tables, users, roles, and clustering"}),(0,k.jsx)("li",{children:"Create and monitor real-time charts based on custom queries"}),(0,k.jsx)("li",{children:"Bulk data import via CSV upload or URL"})]}),(0,k.jsx)("h3",{children:"Check Out Our Developer Resources Above"}),(0,k.jsxs)("ul",{className:"mt-3",children:[(0,k.jsx)("li",{children:"SDKs, Drivers, and language-specific Code Snippets"}),(0,k.jsx)("li",{children:"Video Tutorials"}),(0,k.jsx)("li",{children:"HarperDB Migrator"})]}),(0,k.jsx)("hr",{className:"mt-4 mb-3"}),(0,k.jsx)("div",{className:"d-none d-md-block",children:(0,k.jsxs)("div",{className:"disclaimer",children:["By creating an account, you agree to the\xa0",(0,k.jsx)("a",{href:"https://harperdb.io/legal/privacy-policy/",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),"\xa0and\xa0",(0,k.jsx)("a",{href:"https://harperdb.io/legal/harperdb-cloud-terms-of-service/",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})]})})]}),(0,k.jsx)("hr",{className:"mt-4 mb-3 d-block d-md-none"})]}),(0,k.jsx)(s.Z,{xs:"12",md:"4",children:(0,k.jsxs)(c.Z,{className:"sign-up-form",children:[(0,k.jsx)(l.Z,{id:"firstname",name:"fname",autoComplete:"given-name",className:"text-center mb-2",type:"text",title:"first name",placeholder:"first name",value:N.firstname||"",disabled:x.submitted,onChange:e=>S({...N,firstname:e.target.value})}),(0,k.jsx)(l.Z,{id:"lastname",name:"lname",autoComplete:"family-name",className:"text-center mb-2",type:"text",title:"last name",placeholder:"last name",value:N.lastname||"",disabled:x.submitted,onChange:e=>S({...N,lastname:e.target.value})}),(0,k.jsx)(l.Z,{id:"email",autoComplete:"email",name:"email",className:"text-center mb-2",type:"text",title:"email",placeholder:"email",value:N.email||"",disabled:x.submitted,onChange:e=>S({...N,email:e.target.value.toLowerCase()})}),(0,k.jsxs)(i.Z,{children:[(0,k.jsx)(s.Z,{className:"subdomain-form",children:(0,k.jsx)(l.Z,{id:"subdomain",name:"subdomain",className:"text-center mb-2",type:"text",title:"subdomain",placeholder:"subdomain",value:N.subdomain||"",disabled:x.submitted,onChange:e=>S({...N,subdomain:e.target.value.substring(0,15).toLowerCase()})})}),(0,k.jsxs)(s.Z,{className:"subdomain-label",children:[".harperdbcloud.com"," ",(0,k.jsx)(u.Z,{color:"link",onClick:()=>C(!P),children:(0,k.jsx)("i",{className:"fa fa-question-circle"})})]})]}),P&&(0,k.jsx)("i",{className:"subdomain-explanation",children:"The URL of your HarperDB Cloud Instances"}),(0,k.jsx)(l.Z,{id:"coupon_code",type:"text",className:"text-center mb-2",name:"coupon_code",title:"coupon code",placeholder:"coupon code (optional)",value:N.coupon_code||"",onChange:e=>S({...N,coupon_code:e.target.value}),disabled:x.submitted}),(0,k.jsxs)("div",{className:"d-block d-md-none",children:[(0,k.jsx)("hr",{}),(0,k.jsxs)("div",{className:"disclaimer text-center",children:["By creating an account, you agree to the\xa0",(0,k.jsx)("a",{href:"https://harperdb.io/legal/privacy-policy/",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),"\xa0and\xa0",(0,k.jsx)("a",{href:"https://harperdb.io/legal/harperdb-cloud-terms-of-service/",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})]}),(0,k.jsx)("hr",{})]}),(0,k.jsx)(u.Z,{id:"sign-up",color:"purple",block:!0,disabled:x.submitted,onClick:()=>_({submitted:!0}),children:x.submitted?(0,k.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,k.jsx)("span",{children:"Sign Up For Free"})})]})})]})]})}),(0,k.jsx)("div",{className:"text-center",children:x.error?(0,k.jsxs)("div",{className:"login-nav-link error",children:[x.error,"\xa0"]}):(0,k.jsx)(d.OL,{to:"/",className:"login-nav-link",children:"Already Have An Account? Sign In Instead."})})]})}},7360:(e,t,n)=>{n.d(t,{Z:()=>r});const r=e=>e.match(/^[a-z0-9]+$/i)},4757:(e,t,n)=>{n.d(t,{Z:()=>r});const r=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase())},6597:(e,t,n)=>{n.d(t,{Z:()=>g});var r=n(7313),o=n(5192),a=n.n(o),i=n(986);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.iC,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.mx)(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},1781:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(7313),o=n(5192),a=n.n(o),i=n(6123),s=n.n(i),c=n(986);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.iC,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,x="select"===a,j="range"===a,O=m||(x||"textarea"===a?a:"input"),w="form-control";h?(w="".concat(w,"-plaintext"),O=m||"input"):j?w="form-range":x?w="form-select":v&&(w=b?null:"form-check-input"),g.size&&/\D/g.test(g.size)&&((0,c.O4)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),i=g.size,delete g.size);var k=(0,c.mx)(s()(t,p&&"is-invalid",l&&"is-valid",!!i&&(x?"form-select-".concat(i):"form-control-".concat(i)),w),n);return("input"===O||m&&"function"===typeof m)&&(g.type="switch"===a?"checkbox":a),g.children&&!h&&"select"!==a&&"string"===typeof O&&"select"!==O&&((0,c.O4)('Input with a type of "'.concat(a,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete g.children),r.createElement(O,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 x=v},3672:(e,t,n)=>{var r=n(7313);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}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[6],{2122:(e,t,c)=>{c.r(t),c.d(t,{default:()=>d});var s=c(7313),a=c(7387),n=c(9327),r=c(8467),l=c(5447),u=c(6449),i=c(8659),o=c(6417);const d=function(e){let{label:t="instance",centerText:c=!1}=e;const{compute_stack_id:d}=(0,r.UO)(),f=(0,a.Kw)(l.Z,(e=>e.loading)),h=(0,a.Kw)(u.Z,(e=>e.instances)),k=(0,a.Kw)(l.Z,(e=>e.auth)),p=(0,s.useCallback)((()=>{const e=h.find((e=>e.compute_stack_id===d));(0,i.Z)({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.Z,{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]})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[467],{2471:(e,n,a)=>{a.r(n),a.d(n,{default:()=>x});var i=a(7313),l=a(5708),s=a(2742),t=a(1613),o=a(9327),r=a(8467),c=a(2135),d=a(7387),u=a(9842),g=a(6449),m=a(2261),b=a(4220),f=a(2190),v=a(511),h=a(9266),p=a(6417);const x=function(e){var n;let{isMaintenance:a,loggedIn:x=!1}=e;const{pathname:j}=(0,r.TH)(),O=(0,r.s0)(),y=(0,d.Kw)(g.Z,(e=>e.auth)),N=(0,d.Kw)(g.Z,(e=>e.customer)),k=(0,d.Kw)(g.Z,(e=>e.theme)),Z=(0,d.Kw)(g.Z,(e=>e.themes)),[,w]=(0,f.Z)({}),[_,M]=(0,h.Z)({}),z=null===Z||void 0===Z?void 0:Z.findIndex((e=>e===k)),P=k&&z!==Z.length-1?Z[z+1]:Z[0],S=(0,i.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]),C=(0,i.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===N||void 0===N||null===(a=N.customer_id)||void 0===a?void 0:a.toString())})))||void 0===n?void 0:n.status)}),[y.orgs,N.customer_id]),I=e=>{M({..._,theme:e}),g.Z.update((n=>{n.theme=e}))},L=()=>{v.Z.is_local_studio?w({local:!1}):g.Z.update((e=>{e.auth=!1})),O("/")};return(0,p.jsx)(u.SV,{onError:(e,n)=>(0,m.Z)({error:{message:e.message,componentStack:n},customer_id:null===N||void 0===N?void 0:N.customer_id,compute_stack_id:null}),FallbackComponent:b.Z,children:(0,p.jsxs)(l.Z,{id:"app-nav",dark:!0,fixed:"top",expand:"xs",children:[(0,p.jsx)("div",{className:"navbar-brand",children:(0,p.jsx)(c.OL,{to:v.Z.is_local_studio?"o/local/i/local/browse":"/organizations",children:(0,p.jsx)("div",{id:"logo",title:"Go to Organizations Home"})})}),(0,p.jsxs)(s.Z,{className:"ms-auto",navbar:!0,children:[x&&!a&&!v.Z.is_local_studio&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(t.Z,{className:"ms-0",children:(0,p.jsxs)(c.OL,{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-lg-inline-block",children:"\xa0all organizations"}),S?(0,p.jsx)("span",{className:"badge",children:S}):null]})}),(0,p.jsxs)("div",{className:"active-org ".concat(N&&-1!==j.indexOf(null===N||void 0===N?void 0:N.customer_id)?"open":""),children:[(0,p.jsx)("div",{className:"text-white org-name",children:N.customer_name}),(0,p.jsxs)("div",{className:"org-actions",children:[(0,p.jsx)(t.Z,{className:"ms-0",children:(0,p.jsxs)(c.OL,{id:"viewOrganizationInstances",title:"View Organization Instances",to:"/o/".concat(N.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:"\xa0instances"})]})}),C&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(t.Z,{children:(0,p.jsxs)(c.OL,{id:"manageOrganizationUsers",title:"Manage Organization Users",to:"/o/".concat(N.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:"\xa0users"})]})}),(0,p.jsx)(t.Z,{children:(0,p.jsxs)(c.OL,{id:"manageOrganizationBilling",title:"Manage Organization Billing",to:"/o/".concat(N.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:"\xa0billing"}),"invoice.payment_failed"===(null===N||void 0===N||null===(n=N.current_payment_status)||void 0===n?void 0:n.status)?(0,p.jsx)("span",{className:"badge",children:"!"}):null]})})]})]})]}),(0,p.jsx)(t.Z,{children:(0,p.jsxs)(c.OL,{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-lg-inline-block",children:"\xa0profile"}),null!==y&&void 0!==y&&y.email_bounced?(0,p.jsx)("span",{className:"badge",children:"!"}):null]})})]}),Z.length>1&&(0,p.jsx)(t.Z,{children:(0,p.jsxs)(o.Z,{color:"link",id:"changeTheme",tabIndex:"0",title:"Switch to ".concat(P," theme"),onKeyDown:e=>13!==e.keyCode||I(P),onClick:()=>I(P),children:[(0,p.jsx)("i",{className:"fas fa-palette"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block",children:"\xa0theme"})]})}),!v.Z.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:"HarperDB Documentation",children:[(0,p.jsx)("i",{className:"fas fa-tools"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block",children:"\xa0docs"})]})}),(0,p.jsx)(t.Z,{children:x?(0,p.jsxs)(o.Z,{id:"logOut",tabIndex:"0",color:"link",title:"Log Out",onKeyDown:e=>13!==e.keyCode||L(),onClick:L,children:[(0,p.jsx)("i",{className:"fa fa-sign-out-alt"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block login-text-label",children:"\xa0sign out"})]}):(0,p.jsxs)(c.OL,{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-lg-inline-block login-text-label",children:"\xa0sign in"})]})})]})]})})}},2190:(e,n,a)=>{a.d(n,{Z:()=>i});const i=(0,a(8131).Z)("instanceAuths")},2742:(e,n,a)=>{a.d(n,{Z:()=>b});var i=a(7313),l=a(5192),s=a.n(l),t=a(6123),o=a.n(t),r=a(986),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,l=function(e,n){if(null==e)return{};var a,i,l={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(l[a]=e[a]);return l}(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)&&(l[a]=e[a])}return l}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.iC,vertical:s().oneOfType([s().bool,s().string])};function m(e){var n=e.className,a=e.cssModule,l=e.tabs,s=e.pills,t=e.vertical,g=void 0!==t&&t,m=e.horizontal,b=e.justified,f=e.fill,v=e.navbar,h=e.card,p=e.tag,x=void 0===p?"ul":p,j=u(e,c),O=(0,r.mx)(o()(n,v?"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":l,"card-header-tabs":h&&l,"nav-pills":s,"card-header-pills":h&&s,"nav-justified":b,"nav-fill":f}),a);return i.createElement(x,d({},j,{className:O}))}m.propTypes=g;const b=m},1613:(e,n,a)=>{a.d(n,{Z:()=>b});var i=a(7313),l=a(5192),s=a.n(l),t=a(6123),o=a.n(t),r=a(986),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,l=function(e,n){if(null==e)return{};var a,i,l={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(l[a]=e[a]);return l}(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)&&(l[a]=e[a])}return l}var g={active:s().bool,className:s().string,cssModule:s().object,tag:r.iC};function m(e){var n=e.className,a=e.cssModule,l=e.active,s=e.tag,t=void 0===s?"li":s,g=u(e,c),m=(0,r.mx)(o()(n,"nav-item",!!l&&"active"),a);return i.createElement(t,d({},g,{className:m}))}m.propTypes=g;const b=m},5708:(e,n,a)=>{a.d(n,{Z:()=>f});var i=a(7313),l=a(5192),s=a.n(l),t=a(6123),o=a.n(t),r=a(986),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,l=function(e,n){if(null==e)return{};var a,i,l={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(l[a]=e[a]);return l}(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)&&(l[a]=e[a])}return l}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.iC};function b(e){var n,a=e.expand,l=void 0!==a&&a,s=e.className,t=e.cssModule,m=e.light,b=e.dark,f=e.fixed,v=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,N=g(e,c),k=(0,r.mx)(o()(s,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-".concat(e))}(l),(u(n={"navbar-light":m,"navbar-dark":b},"bg-".concat(h),h),u(n,"fixed-".concat(f),f),u(n,"sticky-".concat(v),v),n)),t),Z=x&&!0===x?"container":"container-".concat(x);return i.createElement(O,d({},N,{className:k}),x?i.createElement("div",{className:Z},y):y)}b.propTypes=m;const f=b}}]);