@sikka/hawa 0.0.22 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/AuthForms/NewPasswordForm.js +1 -1
- package/src/blocks/AuthForms/ResetPasswordForm.js +1 -8
- package/src/blocks/AuthForms/SignInForm.js +9 -9
- package/src/blocks/AuthForms/SignUpForm.js +1 -1
- package/src/blocks/Payment/CreditCardForm.js +98 -48
- package/src/elements/HawaAlert.js +1 -1
- package/src/elements/HawaItemCard.js +60 -0
- package/src/elements/HawaPopMenu.js +35 -6
- package/src/elements/index.js +1 -0
- package/src/index.js +2 -0
- package/src/layout/HawaAppBar.js +6 -33
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.06257453.iframe.bundle.js +1 -0
- package/storybook-static/{vendors~main.7097848f.iframe.bundle.js → vendors~main.741b86a0.iframe.bundle.js} +4 -4
- package/storybook-static/{vendors~main.7097848f.iframe.bundle.js.LICENSE.txt → vendors~main.741b86a0.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.741b86a0.iframe.bundle.js.map +1 -0
- package/storybook-static/main.f236f782.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.7097848f.iframe.bundle.js.map +0 -1
package/es/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as e}from"react";import t from"@mui/material/Button";import"@mui/material/Tooltip";import r from"prop-types";import{jsx as l,jsxs as i,Fragment as a}from"react/jsx-runtime";import"@mui/material/FormControlLabel";import"@mui/material/Checkbox";import n from"@mui/material/Container";import o from"@mui/material/Typography";import"@mui/icons-material/CheckCircleOutlined";import d from"@mui/material/Input";import s from"@mui/material/InputLabel";import"@mui/material/Switch";import u from"@mui/icons-material/GitHub";import c from"@mui/icons-material/Twitter";import m from"@mui/icons-material/AccountBalanceWallet";import h from"@mui/material/Select";import p from"@mui/material/Alert";import v from"@mui/material/AlertTitle";import f from"@mui/material/Table";import g from"@mui/material/TableBody";import x from"@mui/material/TableCell";import b from"@mui/material/TableContainer";import y from"@mui/material/TableHead";import w from"@mui/material/TableRow";import"@mui/material/Snackbar";import{useForm as T,FormProvider as P,Controller as W}from"react-hook-form";import C from"@mui/material/InputAdornment";import S from"@mui/icons-material/HttpsOutlined";import k from"@mui/icons-material/MailOutline";import A from"@mui/icons-material/PermIdentityOutlined";import L from"@mui/material/Divider";function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var l,i,a=[],n=!0,o=!1;try{for(r=r.call(e);!(n=(l=r.next()).done)&&(a.push(l.value),!t||a.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==r.return||r.return()}finally{if(o)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return I(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return I(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,l=new Array(t);r<t;r++)l[r]=e[r];return l}r.string,r.bool;var z=function(e){return l(o,N(N({},e),{},{children:e.children}))},j=function(e){return i("div",{style:e.inForm&&{width:"100%"},children:[i("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.label&&l(s,{children:e.label}),e.helperText&&l(o,{variant:"validation",children:e.helperText})]}),l(d,N({disableUnderline:!0},e))]})};r.oneOf(["text","number","password"]),r.string;var B=function(e){var r,a="";switch(null===(r=e.logo)||void 0===r?void 0:r.toLowerCase()){case"google":a=l("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"});break;case"github":a=l(u,{});break;case"twitter":a=l(c,{});break;case"mada":a=l("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:20});break;case"stcpay":a=l("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20});break;case"visa/master":a=l("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30});break;case"paypal":a=l("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25});break;case"googlepay":a=l("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20});break;case"applepay":a=l("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40});break;case"wallet":a=l(m,{})}return i(t,N(N({},e),{},{variant:"withLogo",children:[a,l("div",{style:{width:10}}),l(o,{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))},G=function(e){return i("div",{style:{width:"100%"},children:[i("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[l(s,{children:e.label}),e.helperText&&l(o,{variant:"validation",children:e.helperText})]}),l(h,N(N({},e),{},{children:e.children}))]})},D=function(e){return i(p,{severity:e.severity,children:[e.title&&l(v,{children:e.title}),e.text]})},F=function(e){var t="ar"===e.lang;return l(b,{style:{direction:t?"rtl":"ltr"},children:i(f,{"aria-label":"a dense table",children:[l(y,{children:l(w,{children:e.columns.map((function(e,r){return l(x,{align:t?"right":"left",style:{fontWeight:700},variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})}),l(g,{children:e.rows.map((function(e,r){return l(w,{children:e.map((function(e,r){return l(x,{align:t?"right":"left",component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))},r)}))}),e.end&&l(w,{children:e.end.map((function(e,r){return l(x,{align:t?"right":"left",style:{fontWeight:700},component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})]})})},U=function(e){var r=T(),a=r.formState.errors,o=r.handleSubmit,d=r.control;return l(n,{maxWidth:"sm",children:l(P,N(N({},r),{},{children:i("form",{onSubmit:o(e.handleUpdateProfile),children:[l(W,{control:d,name:"fullName",render:function(t){var r,i,n=t.field;return l(j,N({fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=a.fullName)||void 0===i?void 0:i.message},n))}}),l(W,{control:d,name:"phoneNumber",render:function(e){var t=e.field;return l(j,N({fullWidth:!0,type:"tel",label:"Phone Number",placeholder:"+966"},t))}}),l(W,{control:d,name:"email",render:function(t){var r,i,n=t.field;return l(j,N({fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=a.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder},n))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l(W,{control:d,name:"password",render:function(t){var r,i,n=t.field;return l(j,N({fullWidth:!0,type:"password",value:null!==(r=n.value)&&void 0!==r?r:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=a.password)||void 0===i?void 0:i.message},n))},rules:{required:e.texts.passwordRequiredText}}),l(W,{control:d,name:"confirmPassword",render:function(t){var r,i,n=t.field;return l(j,N({fullWidth:!0,type:"password",value:null!==(r=n.value)&&void 0!==r?r:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(i=a.confirmPassword)||void 0===i?void 0:i.message},n))},rules:{required:e.texts.confirmPasswordRequiredText}}),l(t,{type:"submit",fullWidth:!0,variant:"last",children:"update profile"})," "]})}))})},Z=function(e){return i(n,{maxWidth:"sm",children:[e.children,l(t,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSaveSettings,children:e.saveSettingsText})]})},E=function(r){var a=R(e(""),2);a[0],a[1];var o=R(e(""),2);o[0],o[1];var d=R(e(!1),2),s=d[0],u=d[1],c=T(),m=c.formState.errors,h=c.handleSubmit,p=c.control;return i(n,{maxWidth:"xs",variant:"auth",children:[s&&l(D,{text:r.texts.passwordMatchError,severity:"error"}),r.passwordChanged?l(z,{style:{textAlign:"center",margin:5},children:"Your password has been changed, you'll be redirected to sign in page"}):l(P,N(N({},c),{},{children:i("form",{onSubmit:h((function(e){console.log("handling subb",e),e.password===e.confirmPassword?r.handleNewPassword():u(!0)})),children:[l(W,{control:p,name:"password",render:function(e){var t,i,a=e.field;return l(j,N({fullWidth:!0,type:"password",value:null!==(t=a.value)&&void 0!==t?t:"",label:r.texts.passwordLabel,placeholder:r.texts.passwordPlaceholder,helperText:null===(i=m.password)||void 0===i?void 0:i.message,startAdornment:l(C,{position:"start",children:l(S,{})})},a))},rules:{required:r.texts.passwordRequiredText}}),l(W,{control:p,name:"confirmPassword",render:function(e){var t,i,a=e.field;return l(j,N({fullWidth:!0,type:"password",value:null!==(t=a.value)&&void 0!==t?t:"",label:r.texts.confirmPasswordLabel,placeholder:r.texts.confirmPasswordPlaceholder,helperText:null===(i=m.confirmPassword)||void 0===i?void 0:i.message,startAdornment:l(C,{position:"start",children:l(S,{})})},a))},rules:{required:r.texts.confirmPasswordRequiredText}}),l(t,{type:"submit",fullWidth:!0,variant:"last",children:r.texts.updatePassword})]})}))]})},M=function(e){var r,a=T(),o=a.formState.errors,d=a.handleSubmit;a.register;var s=a.control;return i(n,{maxWidth:"xs",variant:"auth",children:[e.error&&i(Alert,{severity:"error",children:[e.errorTitle&&l(AlertTitle,{children:e.errorTitle}),e.errorText]}),e.sent?l(z,{style:{textAlign:"center",margin:5},children:"An link was sent to your email to reset the password."}):i("form",{onSubmit:d(e.handleResetPassword),children:[console.log("eror ",null===(r=o.email)||void 0===r?void 0:r.message),l(W,{control:s,name:"email",render:function(t){var r,i,a=t.field;return l(j,N({fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=o.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:l(C,{position:"start",children:l(k,{})})},a))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l(t,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.resetPassword})]})]})},$=function(e){var r=T(),a=r.formState.errors,d=r.handleSubmit,s=r.control;return i(n,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.error&&i(p,{severity:"error",children:[e.errorTitle&&l(v,{children:e.errorTitle}),e.errorText]}),l(P,N(N({},r),{},{children:i("form",{onSubmit:d(e.handleSignUp),children:[l(W,{control:s,name:"fullName",render:function(t){var r,i,n=t.field;return l(j,{fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=a.fullName)||void 0===i?void 0:i.message,startAdornment:l(C,{position:"start",children:l(A,{})})})},rules:{required:e.texts.fullNameRequiredText}}),l(W,{control:s,name:"email",render:function(t){var r,i,n=t.field;return l(j,{fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=a.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:l(C,{position:"start",children:l(k,{})})})},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l(W,{control:s,name:"password",render:function(t){var r,i,n,o=t.field;return l(j,N({fullWidth:!0,type:"password",defaultValue:null!==(r=o.value)&&void 0!==r?r:"",value:null!==(i=o.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=a.password)||void 0===n?void 0:n.message,startAdornment:l(C,{position:"start",children:l(S,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),l(t,{fullWidth:!0,variant:"last",type:"submit",children:e.texts.signUpText})]})})),i(o,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.existingUserText," ",l("span",{onClick:e.handleRouteToSignIn,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signInText})]}),l(L,{}),i("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&l(B,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignUp}),e.viaGithub&&l(B,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignUp}),e.viaTwitter&&l(B,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignUp})]})]})};$.propTypes={theme:r.oneOf(["secondary","primary"])};var H=function(e){var r=T(),a=r.formState.errors,d=r.handleSubmit;r.register;var s=r.control;return i(n,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.error&&i(p,{severity:"error",children:[e.errorTitle&&l(v,{children:e.errorTitle}),e.errorText]}),i("form",{onSubmit:d(e.handleSignIn),children:[l(W,{control:s,name:"email",render:function(t){var r,i,n=t.field;return l(j,N({fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=a.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:l(C,{position:"start",children:l(k,{})})},n))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l(W,{control:s,name:"password",render:function(t){var r,i,n,o=t.field;return l(j,N({fullWidth:!0,type:"password",defaultValue:null!==(r=o.value)&&void 0!==r?r:"",value:null!==(i=o.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=a.password)||void 0===n?void 0:n.message,startAdornment:l(C,{position:"start",children:l(S,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),l(o,{style:{cursor:"pointer",marginTop:5,width:"max-content",fontSize:15,padding:5},onClick:e.handleForgotPassword,children:e.texts.forgotPasswordText}),l(t,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.signInText})]}),i(o,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.newUserText," ",l("span",{onClick:e.handleRouteToSignUp,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signUpText})]}),l(L,{}),i("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&l(B,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignIn}),e.viaGithub&&l(B,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignIn}),e.viaTwitter&&l(B,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignIn})]})]})},V=function(e){return i(n,{maxWidth:"xs",children:[l(z,{align:"center",children:"Choose Payment Method"}),e.viaWallet&&l(B,{logo:"wallet",buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&l(B,{logo:"visa/master",buttonText:e.visaMasterLabel,onClick:e.handleCreditCard}),e.viaMada&&l(B,{logo:"mada",buttonText:e.madaLabel,onClick:e.handleMada}),e.viaSTCPay&&l(B,{logo:"stcpay",buttonText:e.stcPayLabel,onClick:e.handleSTCPay}),e.viaPayPal&&l(B,{logo:"paypal",buttonText:e.paypalLabel,onClick:e.handlePayPal}),e.viaGooglePay&&l(B,{logo:"googlepay",buttonText:e.googlePayLabel,onClick:e.handleGooglePay}),e.viaApplePay&&l(B,{logo:"applepay",buttonText:e.applePayLabel,onClick:e.handleApplePay})]})};j.propTypes={theme:r.oneOf(["secondary","primary"]),viaApplePay:r.bool,viaGooglePay:r.bool,viaSTCPay:r.bool,viaCreditCard:r.bool,viaPayPal:r.bool,handleApplePay:r.func};var _=function(e){var r,a,o=T(),d=o.formState.errors,s=o.handleSubmit;return l(n,{maxWidth:"xs",children:l(P,N(N({},o),{},{children:i("form",{onSubmit:s(e.handle),children:[l(j,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"tel",label:"Card Number",rules:{required:"Password is rquired"},helperText:null===(r=d.password)||void 0===r?void 0:r.message}),l(j,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Name On Card",rules:{required:"Password is rquired"},helperText:null===(a=d.password)||void 0===a?void 0:a.message}),l(t,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithCreditCard,children:"Pay with Credit Card"})]})}))})},Y=function(r){var a=R(e(0),2),d=a[0],s=a[1],u=T();u.formState.errors;var c=u.handleSubmit,m=u.control;return i(n,{maxWidth:"xs",children:[i(o,{align:"center",variant:"h2",fontWeight:500,style:{marginBottom:20},children:[Number(d).toLocaleString("en")||"0",l(o,{children:r.currency||"SAR"})]}),l(P,N(N({},u),{},{children:i("form",{onSubmit:c(r.handleChargeWallet),children:[l(W,{control:m,name:"amount",render:function(e){var t,r=e.field;return l(j,N(N({fullWidth:!0,placeholder:"Enter amount",type:"number",value:null!==(t=r.value)&&void 0!==t?t:""},r),{},{inputProps:{inputMode:"numeric",min:"0",max:"9999999",step:"0.01"},onChange:function(e){r.onChange(parseFloat(e.target.value)),console.log("e",e.target.value),s(e.target.value)}}))}}),l(t,{type:"submit",fullWidth:!0,variant:"last",onClick:r.handleSignIn,children:"Charge Wallet"})]})}))]})},J=function(e){return i(n,{maxWidth:"xs",children:[l(o,{align:"center",children:"Wallet Balance"}),i(o,{align:"center",variant:"h1",children:[e.walletBalance||"0",l(o,{children:e.currency||"SAR"})]}),l(t,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithWallet,children:"Pay Now"})]})},K=function(e){var r,a,d,s,u,c,m,h,p,v,f="ar"===e.lang,g=T(),x=g.formState.errors,b=g.handleSubmit;g.register;var y=g.control,w={display:"flex",padding:0,paddingRight:"0px !important",paddingLeft:"0px !important",flexDirection:{xs:"column",sm:"row",md:"row",lg:"row",xl:"row"}};return i(n,{maxWidth:"sm",style:{direction:f?"rtl":"ltr"},children:[l(o,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),l(F,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),l(L,{variant:"middle"}),l(o,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.billingAddress}),l(P,N(N({},g),{},{children:i("form",{onSubmit:b(e.handlePayNow),children:[i(n,{sx:w,children:[l(W,{control:y,name:"firstName",rules:{required:null===(r=e.texts)||void 0===r?void 0:r.required},render:function(t){var r,i,a,n=t.field;return l(j,N({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(i=e.texts)||void 0===i?void 0:i.firstNameLabel)+" *",helperText:null===(a=x.firstName)||void 0===a?void 0:a.message},n))}}),l("div",{style:{width:20}}),l(W,{control:y,name:"lastName",rules:{required:null===(a=e.texts)||void 0===a?void 0:a.required},render:function(t){var r,i,a,n=t.field;return l(j,N({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(i=e.texts)||void 0===i?void 0:i.lastNameLabel)+" *",helperText:null===(a=x.lastName)||void 0===a?void 0:a.message},n))}})]}),l(W,{control:y,name:"email",render:function(t){var r,i,a,n=t.field;return l(j,N({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(i=e.texts)||void 0===i?void 0:i.emailLabel)+" *",helperText:null===(a=x.email)||void 0===a?void 0:a.message},n))},rules:{required:null===(d=e.texts)||void 0===d?void 0:d.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:null===(s=e.texts)||void 0===s?void 0:s.emailInvalidText}}}),i(n,{sx:w,children:[l(W,{control:y,name:"streetAddress",rules:{required:null===(u=e.texts)||void 0===u?void 0:u.required},render:function(t){var r,i,a,n=t.field;return l(j,N({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(i=e.texts)||void 0===i?void 0:i.streetAddressLabel)+" *",helperText:null===(a=x.streetAddress)||void 0===a?void 0:a.message},n))}}),l("div",{style:{width:20}}),l(W,{control:y,name:"buildingNumber",rules:{required:null===(c=e.texts)||void 0===c?void 0:c.required},render:function(t){var r,i,a,n=t.field;return l(j,N({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(i=e.texts)||void 0===i?void 0:i.buildingNumberLabel)+" *",helperText:null===(a=x.buildingNumber)||void 0===a?void 0:a.message},n))}})]}),i(n,{sx:w,children:[l(W,{control:y,name:"province",rules:{required:null===(m=e.texts)||void 0===m?void 0:m.required},render:function(t){var r,i,a,n=t.field;return l(j,N({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(i=e.texts)||void 0===i?void 0:i.stateLabel)+" *",helperText:null===(a=x.province)||void 0===a?void 0:a.message},n))}}),l("div",{style:{width:20}}),l(W,{control:y,name:"city",rules:{required:null===(h=e.texts)||void 0===h?void 0:h.required},render:function(t){var r,i,a,n=t.field;return l(j,N({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(i=e.texts)||void 0===i?void 0:i.cityLabel)+" *",helperText:null===(a=x.city)||void 0===a?void 0:a.message},n))}})]}),i(n,{sx:w,children:[l(W,{control:y,name:"zipCode",rules:{required:null===(p=e.texts)||void 0===p?void 0:p.required},render:function(t){var r,i,a,n=t.field;return l(j,N({inForm:!0,fullWidth:!0,type:"number",variant:"unscrollable",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(i=e.texts)||void 0===i?void 0:i.zipCodeLabel)+" *",helperText:null===(a=x.zipCode)||void 0===a?void 0:a.message},n))}}),l("div",{style:{width:20}}),l(W,{control:y,name:"country",rules:{required:null===(v=e.texts)||void 0===v?void 0:v.required},render:function(t){var r,a,n,o=t.field;return i(G,N(N({fullWidth:!0,native:!0,label:(null===(r=e.texts)||void 0===r?void 0:r.countryLabel)+" *",variant:"standard",value:null!==(a=o.value)&&void 0!==a?a:"",helperText:null===(n=x.country)||void 0===n?void 0:n.message,displayEmpty:!0,disableUnderline:!0,validators:["required"]},o),{},{children:[l("option",{}),e.countriesList.map((function(e,t){return l("option",{children:e},t)}))]}))}})]}),l(t,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.payNow})]})}))]})},Q=function(e){var r="ar"===e.lang,d=T();return d.formState.errors,d.handleSubmit,d.register,d.control,i("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[i(n,{maxWidth:"sm",style:{direction:r?"rtl":"ltr"},children:[l(o,{align:"center",variant:"h3",fontWeight:400,style:{marginBottom:10},children:e.confirmationTitle}),l(L,{variant:"middle"}),i(o,{align:"center",variant:"body1",style:{marginBottom:10},children:[e.texts.successMessage," ",l("strong",{children:e.userEmail})]}),l(o,{align:"center",variant:"body1",children:e.texts.yourOrderNumber}),l(o,{align:"center",variant:"body1",fontWeight:700,style:{marginBottom:10},children:e.orderNumber}),l(L,{variant:"middle"}),e.products&&i(a,{children:[l(o,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),l(F,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),l(L,{variant:"middle"})]}),l(t,{onClick:e.handlePrint,variant:"contained",children:e.texts.print}),l(t,{onClick:e.handleHistory,variant:"last",children:e.texts.history}),l(t,{onClick:e.handleHome,variant:"last",children:e.texts.homePage}),l(o,{align:"center",variant:"body2",style:{marginTop:10},children:e.texts.fasterPaymentNote})]}),l("a",{style:{marginTop:10,paddingTop:10,padding:5,cursor:"pointer"},onClick:e.handleRefundPolicyLink,children:l(o,{align:"center",variant:"caption",fontWeight:500,children:e.texts.refundPolicy})})]})};export{Y as ChargeWalletForm,K as CheckoutForm,Q as ConfirmationPage,_ as CreditCardForm,E as NewPasswordForm,J as PayWithWallet,M as ResetPasswordForm,V as SelectPayment,H as SignInForm,$ as SignUpForm,U as UserProfileForm,Z as UserSettingsForm};
|
|
1
|
+
import e,{useState as t}from"react";import r from"@mui/material/Button";import n from"@mui/material/Tooltip";import i from"prop-types";import{jsxs as l,jsx as a,Fragment as o}from"react/jsx-runtime";import d from"@mui/material/FormControlLabel";import s from"@mui/material/Checkbox";import c from"@mui/material/Container";import u from"@mui/material/Typography";import m from"@mui/icons-material/CheckCircleOutlined";import h from"@mui/material/Input";import p from"@mui/material/InputLabel";import v from"@mui/material/Switch";import f from"@mui/icons-material/GitHub";import g from"@mui/icons-material/Twitter";import x from"@mui/icons-material/AccountBalanceWallet";import y from"@mui/material/Select";import b from"@mui/material/Alert";import w from"@mui/material/AlertTitle";import T from"@mui/material/Table";import C from"@mui/material/TableBody";import P from"@mui/material/TableCell";import k from"@mui/material/TableContainer";import S from"@mui/material/TableHead";import W from"@mui/material/TableRow";import L from"@mui/material/Snackbar";import{useForm as A,FormProvider as O,Controller as q}from"react-hook-form";import I from"@mui/material/InputAdornment";import z from"@mui/icons-material/HttpsOutlined";import R from"@mui/icons-material/MailOutline";import N from"@mui/icons-material/PermIdentityOutlined";import j from"@mui/material/Divider";import{styled as B,useTheme as D}from"@mui/material/styles";import M from"@mui/material/Box";import G from"@mui/material/Drawer";import E from"@mui/material/AppBar";import F from"@mui/material/Toolbar";import U from"@mui/material/List";import Z from"@mui/material/IconButton";import $ from"@mui/icons-material/Menu";import H from"@mui/icons-material/ChevronLeft";import V from"@mui/icons-material/ChevronRight";import _ from"@mui/material/ListItemButton";import X from"@mui/material/ListItemText";import J from"@mui/material/Menu";import K from"@mui/material/Avatar";import Q from"@mui/material/MenuItem";import Y from"@mui/icons-material/Close";import ee from"@mui/material/Dialog";import te from"@mui/material/DialogActions";import re from"@mui/material/DialogContent";import ne from"@mui/material/DialogTitle";import{useTheme as ie,Menu as le,MenuItem as ae,Typography as oe}from"@mui/material";function de(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?de(Object(r),!0).forEach((function(t){ce(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):de(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ce(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ue(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,l=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return l}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return he(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return he(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pe=function(e){return e.showText?l(r,{variant:"adaptive-dark",onClick:e.onClick,children:[e.icon,a("div",{style:{width:10}}),e.buttonText]}):a(n,{title:e.buttonText,placement:"top",children:a(r,{variant:"adaptive-dark",onClick:e.onClick,children:e.icon})})};pe.propTypes={buttonText:i.string,showText:i.bool};var ve=function(e){return a(r,se(se({},e),{},{children:e.text}))},fe=function(t){return console.log("props : ",t),a(e.Fragment,{children:a(d,{label:t.label,control:a(s,{style:{color:t.color||null},defaultChecked:t.defaultValue})})})},ge=function(e){var n=me(t(e.defaultValue),2),i=n[0],l=n[1];return a(c,{variant:e.location||"panelTabs",children:e.options.map((function(t,n){var o;return a(r,{onClick:function(){e.handleChange(t.value),l(t.value)},fullWidth:!0,variant:(null==i?void 0:i.toLowerCase())===(null===(o=t.value)||void 0===o?void 0:o.toLowerCase())?"selected":"unselected",children:t.label},n)}))})},xe=function(e){var t="ar"===e.lang;return l(c,{onClick:function(t){t.stopPropagation(),console.log("clicking parent"),e.onCardClick()},maxWidth:"xs",variant:"card-container",dataValue:"parent",style:{direction:t?"rtl":"ltr"},children:[e.header&&l(c,{style:{zIndex:20},variant:"card-header",children:[e.headerActions&&a("div",{style:{margin:0,marginRight:-20,marginLeft:-20,marginBottom:-20,display:"flex",paddingTop:5,paddingLeft:5,paddingRight:5,justifyContent:"flex-end"},children:e.headerActions}),e.header]}),e.content&&a(c,{style:{zIndex:20},variant:"card-content",children:e.content}),e.actions&&a(c,{style:{zIndex:20},variant:"card-actions",children:e.actions})]})},ye=function(e){var t,n,i="ar"===e.lang,o={monthly:"شهرياً","3-months":"كل 3 أشهر","6-months":"كل 6 أشهر",annually:"سنوياً"},d={monthly:"Monthly","3-months":"3 Months","6-months":"6 Months",annually:"Annually"},s={usd:i?"دولار":"$",sar:i?"ريال":"SAR"},h=i?e.features_ar:e.features;return l(c,{maxWidth:"xs",variant:e.selectedPlan?"selected-plan-card":"plan-card",style:{direction:i?"rtl":"ltr"},children:[l(c,{variant:"plan-header",children:[a(u,{variant:"h3",fontWeight:500,children:i?e.title_ar:e.title}),a(u,{variant:"caption",children:i?e.subtitle_ar:e.subtitle}),a("br",{}),a(u,{variant:"h4",fontWeight:500,style:{display:"flex",alignItems:"center"},children:"ar"===e.lang?l("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l("div",{style:{display:"flex",flexDirection:"row"},children:[e.price,a("div",{style:{width:5}}),a(u,{children:s[null===(t=e.currency)||void 0===t?void 0:t.toLowerCase()]})]}),a(u,{style:{fontSize:14,margin:5},children:i?o[e.cycleText]:d[e.cycleText]})]}):l("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l("div",{style:{display:"flex",flexDirection:"row"},children:[a(u,{children:s[null===(n=e.currency)||void 0===n?void 0:n.toLowerCase()]}),a("div",{style:{width:5}}),e.price]}),a(u,{style:{fontSize:14,margin:5},children:"ar"===e.lang?o[e.cycleText]:d[e.cycleText]})]})})]}),a("div",{style:{padding:20,color:e.selectedPlan?"white":"black"},children:null==h?void 0:h.map((function(e){return l("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",marginTop:10,width:"100%"},children:[a("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",width:"10%"},children:a(m,{fontSize:"small"})}),a("div",{style:{width:10}}),a(u,{variant:"subtitle2",children:e})]})}))}),a(r,{onClick:e.selectPlan,variant:e.selectedPlan?"outlined":"contained",style:{margin:20},children:e.buttonText})]})},be=function(e){return a(u,se(se({},e),{},{children:e.children}))},we=function(e){return l("div",{style:e.inForm&&{width:"100%"},children:[l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.label&&a(p,{children:e.label}),e.helperText&&a(u,{variant:"validation",children:e.helperText})]}),a(h,se({disableUnderline:!0},e))]})},Te=function(e){return a(v,se({},e))},Ce=function(e){return l(c,{variant:"settingsRow",children:[a(be,{children:e.settingsLabel}),"checkbox"===e.settingsType&&a(s,se({},e)),"text"===e.settingsType&&a(we,se({},e)),"radio"===e.settingsType&&a(ge,se({location:"inSettings"},e)),"boolean"===e.settingsType&&a(Te,se({},e))]})};Ce.propTypes={type:i.oneOf(["text","number","password"]),helperText:i.string};var Pe=function(e){var t,n="";switch(null===(t=e.logo)||void 0===t?void 0:t.toLowerCase()){case"google":n=a("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"});break;case"github":n=a(f,{});break;case"twitter":n=a(g,{});break;case"mada":n=a("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:20});break;case"stcpay":n=a("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20});break;case"visa/master":n=a("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30});break;case"paypal":n=a("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25});break;case"googlepay":n=a("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20});break;case"applepay":n=a("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40});break;case"wallet":n=a(x,{})}return l(r,se(se({},e),{},{variant:"withLogo",children:[n,a("div",{style:{width:10}}),a(u,{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))},ke=function(e){return a(r,se(se({},e),{},{children:e.children}))},Se=function(e){return l("div",{style:{width:"100%"},children:[l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[a(p,{children:e.label}),e.helperText&&a(u,{variant:"validation",children:e.helperText})]}),a(y,se(se({},e),{},{children:e.children}))]})},We=function(e){return a(p,{children:a("div",{style:{fontSize:15},children:e.label})})},Le=function(e){return l(b,{severity:e.severity,variant:"inContainer",children:[e.title&&a(w,{children:e.title}),e.text]})},Ae=function(e){var t="ar"===e.lang;return a(k,{style:{direction:t?"rtl":"ltr"},children:l(T,{"aria-label":"a dense table",children:[a(S,{children:a(W,{children:e.columns.map((function(e,r){return a(P,{align:t?"right":"left",style:{fontWeight:700},variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})}),a(C,{children:e.rows.map((function(e,r){return a(W,{children:e.map((function(e,r){return a(P,{align:t?"right":"left",component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))},r)}))}),e.end&&a(W,{children:e.end.map((function(e,r){return a(P,{align:t?"right":"left",style:{fontWeight:700},component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})]})})},Oe=function(e){return a(L,{variant:"danger",open:e.open,onClose:e.handleClose,children:l(b,{icon:!1,severity:"error",variant:"offline",children:[e.title&&a(w,{children:e.title}),e.text]})})},qe=function(e){var t=A(),n=t.formState.errors,i=t.handleSubmit,o=t.control;return a(c,{maxWidth:"sm",children:a(O,se(se({},t),{},{children:l("form",{onSubmit:i(e.handleUpdateProfile),children:[a(q,{control:o,name:"fullName",render:function(t){var r,i,l=t.field;return a(we,se({fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=n.fullName)||void 0===i?void 0:i.message},l))}}),a(q,{control:o,name:"phoneNumber",render:function(e){var t=e.field;return a(we,se({fullWidth:!0,type:"tel",label:"Phone Number",placeholder:"+966"},t))}}),a(q,{control:o,name:"email",render:function(t){var r,i,l=t.field;return a(we,se({fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=n.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder},l))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),a(q,{control:o,name:"password",render:function(t){var r,i,l=t.field;return a(we,se({fullWidth:!0,type:"password",value:null!==(r=l.value)&&void 0!==r?r:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=n.password)||void 0===i?void 0:i.message},l))},rules:{required:e.texts.passwordRequiredText}}),a(q,{control:o,name:"confirmPassword",render:function(t){var r,i,l=t.field;return a(we,se({fullWidth:!0,type:"password",value:null!==(r=l.value)&&void 0!==r?r:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(i=n.confirmPassword)||void 0===i?void 0:i.message},l))},rules:{required:e.texts.confirmPasswordRequiredText}}),a(r,{type:"submit",fullWidth:!0,variant:"last",children:"update profile"})," "]})}))})},Ie=function(e){return l(c,{maxWidth:"sm",children:[e.children,a(r,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSaveSettings,children:e.saveSettingsText})]})},ze=function(e){var n=me(t(""),2);n[0],n[1];var i=me(t(""),2);i[0],i[1];var o=me(t(!1),2),d=o[0],s=o[1],u=A(),m=u.formState.errors,h=u.handleSubmit,p=u.control;return l(c,{maxWidth:"xs",variant:"auth",children:[d&&a(Le,{text:e.texts.passwordMatchError,severity:"error"}),e.passwordChanged?a(be,{style:{textAlign:"center",margin:5},children:e.texts.passwordChanged}):a(O,se(se({},u),{},{children:l("form",{onSubmit:h((function(t){console.log("handling subb",t),t.password===t.confirmPassword?e.handleNewPassword():s(!0)})),children:[a(q,{control:p,name:"password",render:function(t){var r,n,i=t.field;return a(we,se({fullWidth:!0,type:"password",value:null!==(r=i.value)&&void 0!==r?r:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=m.password)||void 0===n?void 0:n.message,startAdornment:a(I,{position:"start",children:a(z,{})})},i))},rules:{required:e.texts.passwordRequiredText}}),a(q,{control:p,name:"confirmPassword",render:function(t){var r,n,i=t.field;return a(we,se({fullWidth:!0,type:"password",value:null!==(r=i.value)&&void 0!==r?r:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(n=m.confirmPassword)||void 0===n?void 0:n.message,startAdornment:a(I,{position:"start",children:a(z,{})})},i))},rules:{required:e.texts.confirmPasswordRequiredText}}),a(r,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.updatePassword})]})}))]})},Re=function(e){var t=A(),n=t.formState.errors,i=t.handleSubmit;t.register;var o=t.control;return a(c,{maxWidth:"xs",variant:"auth",children:e.sent?a(be,{style:{textAlign:"center",margin:5},children:e.emailSentText}):l("form",{onSubmit:i(e.handleResetPassword),children:[a(q,{control:o,name:"email",render:function(t){var r,i,l=t.field;return a(we,se({fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=n.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:a(I,{position:"start",children:a(R,{})})},l))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),a(r,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.resetPassword})]})})},Ne=function(e){var t=A(),n=t.formState.errors,i=t.handleSubmit,o=t.control;return l(c,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.error&&l(b,{severity:"error",variant:"inContainer",children:[e.errorTitle&&a(w,{children:e.errorTitle}),e.errorText]}),a(O,se(se({},t),{},{children:l("form",{onSubmit:i(e.handleSignUp),children:[a(q,{control:o,name:"fullName",render:function(t){var r,i,l=t.field;return a(we,{fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=n.fullName)||void 0===i?void 0:i.message,startAdornment:a(I,{position:"start",children:a(N,{})})})},rules:{required:e.texts.fullNameRequiredText}}),a(q,{control:o,name:"email",render:function(t){var r,i,l=t.field;return a(we,{fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=n.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:a(I,{position:"start",children:a(R,{})})})},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),a(q,{control:o,name:"password",render:function(t){var r,i,l,o=t.field;return a(we,se({fullWidth:!0,type:"password",defaultValue:null!==(r=o.value)&&void 0!==r?r:"",value:null!==(i=o.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(l=n.password)||void 0===l?void 0:l.message,startAdornment:a(I,{position:"start",children:a(z,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),a(r,{fullWidth:!0,variant:"last",type:"submit",children:e.texts.signUpText})]})})),l(u,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.existingUserText," ",a("span",{onClick:e.handleRouteToSignIn,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signInText})]}),a(j,{}),l("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&a(Pe,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignUp}),e.viaGithub&&a(Pe,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignUp}),e.viaTwitter&&a(Pe,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignUp})]})]})};Ne.propTypes={theme:i.oneOf(["secondary","primary"])};var je=function(e){var t=A(),n=t.formState.errors,i=t.handleSubmit,o=t.control;return l(c,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&a(Le,{title:e.errorTitle,text:e.errorText,severity:"error"}),l("form",{onSubmit:i(e.handleSignIn),children:[a(q,{control:o,name:"email",render:function(t){var r,i,l=t.field;return a(we,se({fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=n.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:a(I,{position:"start",children:a(R,{})})},l))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),a(q,{control:o,name:"password",render:function(t){var r,i,l,o=t.field;return a(we,se({fullWidth:!0,type:"password",defaultValue:null!==(r=o.value)&&void 0!==r?r:"",value:null!==(i=o.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(l=n.password)||void 0===l?void 0:l.message,startAdornment:a(I,{position:"start",children:a(z,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),a(u,{style:{cursor:"pointer",marginTop:5,width:"max-content",fontSize:15,padding:5},onClick:e.handleForgotPassword,children:e.texts.forgotPasswordText}),a(r,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.signInText})]}),l(u,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.newUserText," ",a("span",{onClick:e.handleRouteToSignUp,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signUpText})]}),a(j,{}),l("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&a(Pe,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignIn}),e.viaGithub&&a(Pe,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignIn}),e.viaTwitter&&a(Pe,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignIn})]})]})},Be=function(e){return l(c,{maxWidth:"xs",children:[a(be,{align:"center",children:"Choose Payment Method"}),e.viaWallet&&a(Pe,{logo:"wallet",buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&a(Pe,{logo:"visa/master",buttonText:e.visaMasterLabel,onClick:e.handleCreditCard}),e.viaMada&&a(Pe,{logo:"mada",buttonText:e.madaLabel,onClick:e.handleMada}),e.viaSTCPay&&a(Pe,{logo:"stcpay",buttonText:e.stcPayLabel,onClick:e.handleSTCPay}),e.viaPayPal&&a(Pe,{logo:"paypal",buttonText:e.paypalLabel,onClick:e.handlePayPal}),e.viaGooglePay&&a(Pe,{logo:"googlepay",buttonText:e.googlePayLabel,onClick:e.handleGooglePay}),e.viaApplePay&&a(Pe,{logo:"applepay",buttonText:e.applePayLabel,onClick:e.handleApplePay})]})};we.propTypes={theme:i.oneOf(["secondary","primary"]),viaApplePay:i.bool,viaGooglePay:i.bool,viaSTCPay:i.bool,viaCreditCard:i.bool,viaPayPal:i.bool,handleApplePay:i.func};var De=function(e){var t,n=A(),i=n.formState.errors,o=n.handleSubmit,d=n.control;return a(c,{maxWidth:"xs",children:l("form",{onSubmit:o(e.handle),children:[a(we,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"tel",label:"Card Number",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message}),a(q,{control:d,name:"cardName",render:function(e){var t;return e.field,a(we,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Name On Card",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),a(q,{control:d,name:"cardName",render:function(e){var t;return e.field,a(we,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Expiry Date",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),a(q,{control:d,name:"cardName",render:function(e){var t;return e.field,a(we,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"CCV",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),a(r,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithCreditCard,children:"Pay with Credit Card"})]})})},Me=function(e){var n=me(t(0),2),i=n[0],o=n[1],d=A();d.formState.errors;var s=d.handleSubmit,m=d.control;return l(c,{maxWidth:"xs",children:[l(u,{align:"center",variant:"h2",fontWeight:500,style:{marginBottom:20},children:[Number(i).toLocaleString("en")||"0",a(u,{children:e.currency||"SAR"})]}),a(O,se(se({},d),{},{children:l("form",{onSubmit:s(e.handleChargeWallet),children:[a(q,{control:m,name:"amount",render:function(e){var t,r=e.field;return a(we,se(se({fullWidth:!0,placeholder:"Enter amount",type:"number",value:null!==(t=r.value)&&void 0!==t?t:""},r),{},{inputProps:{inputMode:"numeric",min:"0",max:"9999999",step:"0.01"},onChange:function(e){r.onChange(parseFloat(e.target.value)),console.log("e",e.target.value),o(e.target.value)}}))}}),a(r,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSignIn,children:"Charge Wallet"})]})}))]})},Ge=function(e){return l(c,{maxWidth:"xs",children:[a(u,{align:"center",children:"Wallet Balance"}),l(u,{align:"center",variant:"h1",children:[e.walletBalance||"0",a(u,{children:e.currency||"SAR"})]}),a(r,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithWallet,children:"Pay Now"})]})},Ee=function(e){var t,n,i,o,d,s,m,h,p,v,f="ar"===e.lang,g=A(),x=g.formState.errors,y=g.handleSubmit;g.register;var b=g.control,w={display:"flex",padding:0,paddingRight:"0px !important",paddingLeft:"0px !important",flexDirection:{xs:"column",sm:"row",md:"row",lg:"row",xl:"row"}};return l(c,{maxWidth:"sm",style:{direction:f?"rtl":"ltr"},children:[a(u,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),a(Ae,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),a(j,{variant:"middle"}),a(u,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.billingAddress}),a(O,se(se({},g),{},{children:l("form",{onSubmit:y(e.handlePayNow),children:[l(c,{sx:w,children:[a(q,{control:b,name:"firstName",rules:{required:null===(t=e.texts)||void 0===t?void 0:t.required},render:function(t){var r,n,i,l=t.field;return a(we,se({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.firstNameLabel)+" *",helperText:null===(i=x.firstName)||void 0===i?void 0:i.message},l))}}),a("div",{style:{width:20}}),a(q,{control:b,name:"lastName",rules:{required:null===(n=e.texts)||void 0===n?void 0:n.required},render:function(t){var r,n,i,l=t.field;return a(we,se({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.lastNameLabel)+" *",helperText:null===(i=x.lastName)||void 0===i?void 0:i.message},l))}})]}),a(q,{control:b,name:"email",render:function(t){var r,n,i,l=t.field;return a(we,se({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.emailLabel)+" *",helperText:null===(i=x.email)||void 0===i?void 0:i.message},l))},rules:{required:null===(i=e.texts)||void 0===i?void 0:i.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:null===(o=e.texts)||void 0===o?void 0:o.emailInvalidText}}}),l(c,{sx:w,children:[a(q,{control:b,name:"streetAddress",rules:{required:null===(d=e.texts)||void 0===d?void 0:d.required},render:function(t){var r,n,i,l=t.field;return a(we,se({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.streetAddressLabel)+" *",helperText:null===(i=x.streetAddress)||void 0===i?void 0:i.message},l))}}),a("div",{style:{width:20}}),a(q,{control:b,name:"buildingNumber",rules:{required:null===(s=e.texts)||void 0===s?void 0:s.required},render:function(t){var r,n,i,l=t.field;return a(we,se({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.buildingNumberLabel)+" *",helperText:null===(i=x.buildingNumber)||void 0===i?void 0:i.message},l))}})]}),l(c,{sx:w,children:[a(q,{control:b,name:"province",rules:{required:null===(m=e.texts)||void 0===m?void 0:m.required},render:function(t){var r,n,i,l=t.field;return a(we,se({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.stateLabel)+" *",helperText:null===(i=x.province)||void 0===i?void 0:i.message},l))}}),a("div",{style:{width:20}}),a(q,{control:b,name:"city",rules:{required:null===(h=e.texts)||void 0===h?void 0:h.required},render:function(t){var r,n,i,l=t.field;return a(we,se({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=l.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.cityLabel)+" *",helperText:null===(i=x.city)||void 0===i?void 0:i.message},l))}})]}),l(c,{sx:w,children:[a(q,{control:b,name:"zipCode",rules:{required:null===(p=e.texts)||void 0===p?void 0:p.required},render:function(t){var r,n,i,l=t.field;return a(we,se({inForm:!0,fullWidth:!0,type:"number",variant:"unscrollable",value:null!==(r=l.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.zipCodeLabel)+" *",helperText:null===(i=x.zipCode)||void 0===i?void 0:i.message},l))}}),a("div",{style:{width:20}}),a(q,{control:b,name:"country",rules:{required:null===(v=e.texts)||void 0===v?void 0:v.required},render:function(t){var r,n,i,o=t.field;return l(Se,se(se({fullWidth:!0,native:!0,label:(null===(r=e.texts)||void 0===r?void 0:r.countryLabel)+" *",variant:"standard",value:null!==(n=o.value)&&void 0!==n?n:"",helperText:null===(i=x.country)||void 0===i?void 0:i.message,displayEmpty:!0,disableUnderline:!0,validators:["required"]},o),{},{children:[a("option",{}),e.countriesList.map((function(e,t){return a("option",{children:e},t)}))]}))}})]}),a(r,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.payNow})]})}))]})},Fe=function(e){var t="ar"===e.lang,n=A();return n.formState.errors,n.handleSubmit,n.register,n.control,l("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[l(c,{maxWidth:"sm",style:{direction:t?"rtl":"ltr"},children:[a(u,{align:"center",variant:"h3",fontWeight:400,style:{marginBottom:10},children:e.confirmationTitle}),a(j,{variant:"middle"}),l(u,{align:"center",variant:"body1",style:{marginBottom:10},children:[e.texts.successMessage," ",a("strong",{children:e.userEmail})]}),a(u,{align:"center",variant:"body1",children:e.texts.yourOrderNumber}),a(u,{align:"center",variant:"body1",fontWeight:700,style:{marginBottom:10},children:e.orderNumber}),a(j,{variant:"middle"}),e.products&&l(o,{children:[a(u,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),a(Ae,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),a(j,{variant:"middle"})]}),a(r,{onClick:e.handlePrint,variant:"contained",children:e.texts.print}),a(r,{onClick:e.handleHistory,variant:"last",children:e.texts.history}),a(r,{onClick:e.handleHome,variant:"last",children:e.texts.homePage}),a(u,{align:"center",variant:"body2",style:{marginTop:10},children:e.texts.fasterPaymentNote})]}),a("a",{style:{marginTop:10,paddingTop:10,padding:5,cursor:"pointer"},onClick:e.handleRefundPolicyLink,children:a(u,{align:"center",variant:"caption",fontWeight:500,children:e.texts.refundPolicy})})]})},Ue=function(e){return a("div",{children:e.children})},Ze=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},$e=function(e){return ce({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(7)," + 1px)")},e.breakpoints.up("sm"),{width:"calc(".concat(e.spacing(8)," + 1px)")})},He=B("div")((function(e){var t=e.theme;return se({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),Ve=B(E,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return se({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})},r&&{marginLeft:240,width:"calc(100% - ".concat(240,"px)"),transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen})})})),_e=B(G,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return se(se({width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box"},r&&se(se({},Ze(t)),{},{"& .MuiDrawer-paper":Ze(t)})),!r&&se(se({},$e(t)),{},{"& .MuiDrawer-paper":$e(t)}))}));function Xe(t){var r=D(),i=me(e.useState(!0),2),o=i[0],d=i[1],s=me(e.useState(null),2);s[0],s[1];var c=me(e.useState(null),2),m=c[0],h=c[1];return l(M,{sx:{display:"flex"},children:[a(Ve,{variant:"appbar",position:"fixed",open:o,children:l(F,{variant:"appbar",children:[a(Z,{color:"inherit","aria-label":"open drawer",onClick:function(){d(!0)},edge:"start",sx:se({marginRight:5},o&&{display:"none"}),children:a($,{})}),l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",margin:0},children:[a(u,{variant:"h6",noWrap:!0,component:"div",children:t.pageTitle}),l(M,{children:[a(n,{title:"Open settings",children:a(Z,{onClick:function(e){h(e.currentTarget)},sx:{p:0},children:a(K,{alt:"Remy Sharp",src:"/static/images/avatar/2.jpg"})})}),a(J,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:m,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(m),onClose:function(){h(null)},variant:"themed",PaperProps:{style:{boxShadow:"none",borderRadius:r.allBorderRadius,border:"1px solid ".concat(r.primaryActionColor)}},children:t.accountMenu.map((function(e){return l(Q,{onClick:e.action,children:[e.icon&&a(e.icon,{}),a(u,{textAlign:"center",children:e.label})]},e.label)}))})]})]})]})}),l(_e,{variant:"permanent",open:o,children:[l(He,{children:[t.logo,a(Z,{onClick:function(){d(!1)},children:"rtl"===r.direction?a(V,{}):a(H,{})})]}),a(j,{}),a(U,{children:t.pages.map((function(e,r){var i,d;return a(n,{title:e.text,placement:"right",arrow:!0,PopperProps:{style:{opacity:o?0:1}},children:l(_,{variant:(null===(i=t.pageName)||void 0===i?void 0:i.toLowerCase())===(null===(d=e.slug)||void 0===d?void 0:d.toLowerCase())&&"clicked",onClick:e.action,sx:{minHeight:48,justifyContent:o?"initial":"center",px:2.5},children:[a(e.icon,{}),a("div",{style:{width:20}}),a(X,{primary:e.text,sx:{opacity:o?1:0}})]},e.text)},r)}))})]}),l(M,{sx:{flexGrow:1,p:3},children:[a(He,{}),t.children]})]})}var Je=["children","onClose","hideClose"],Ke=function(e){var t=e.children,r=e.onClose,n=e.hideClose,i=ue(e,Je);return l(ne,se(se({sx:{m:0,p:2}},i),{},{children:[t,n?null:a(Z,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}},children:a(Y,{})})]}))};function Qe(e){var r=me(t(!1),2);return r[0],r[1],l(ee,se(se({},e),{},{variant:"main",children:[a(Ke,{onClose:e.onClose,hideClose:e.hideClose,children:e.title}),a(re,{children:e.children}),a(te,{children:e.actions})]}))}var Ye=function(e){var t=ie();return a(le,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:e.anchor,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(e.anchor),onClose:e.handleClose,variant:"themed",PaperProps:{style:{boxShadow:"none",borderRadius:t.allBorderRadius,border:"1px solid ".concat(t.primaryActionColor)}},children:e.menuItems.map((function(e){return l(ae,{onClick:e.action,children:[e.icon&&a(e.icon,{}),a("div",{style:{width:10}}),a(oe,{textAlign:"center",children:e.label})]},e.label)}))})},et=["Products","Pricing","Blog"],tt=function(t){var i=ie(),o=me(e.useState(null),2),d=o[0],s=o[1],m=me(e.useState(null),2),h=m[0],p=m[1],v=function(){s(null)};return console.log("theme is ",i),a(E,{position:"static",variant:"appbar",children:a(c,{maxWidth:"xl",variant:"appbar",children:l(F,{disableGutters:!0,children:[a(u,{variant:"h6",noWrap:!0,component:"div",sx:{mr:2,display:{xs:"none",md:"flex"}},children:"LOGO"}),l(M,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:[a(Z,{size:"large","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:t.handleOpenSideMenu,color:"inherit",children:a($,{})}),a(J,{id:"menu-appbar",anchorEl:d,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"left"},open:Boolean(d),onClose:v,sx:{display:{xs:"block",md:"none"}},children:et.map((function(e){return a(Q,{onClick:v,children:a(u,{textAlign:"center",children:e})},e)}))})]}),a(u,{variant:"h6",noWrap:!0,component:"div",sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:"LOGO"}),a(M,{sx:{flexGrow:1,display:{xs:"none",md:"flex"}},children:et.map((function(e){return a(r,{onClick:v,sx:{my:2,display:"block"},children:e},e)}))}),l(M,{sx:{flexGrow:0},children:[a(n,{title:"Open settings",children:a(Z,{onClick:function(e){p(e.currentTarget)},sx:{p:0},children:a(K,{alt:"Remy Sharp",src:"/static/images/avatar/2.jpg"})})}),a(Ye,{anchor:h,handleClose:function(e){return p(null)},menuItems:t.accountMenu})]})]})})})};export{ve as ActionButton,pe as AdaptiveButton,Ue as Box,Me as ChargeWalletForm,Ee as CheckoutForm,Fe as ConfirmationPage,De as CreditCardForm,Le as HawaAlert,tt as HawaAppBar,Xe as HawaAppLayout,ke as HawaButton,fe as HawaCheckbox,Qe as HawaDialog,We as HawaInputLabel,xe as HawaItemCard,Pe as HawaLogoButton,ye as HawaPricingCard,ge as HawaRadio,Se as HawaSelect,Ce as HawaSettingsRow,Ae as HawaTable,we as HawaTextField,be as HawaTypography,ze as NewPasswordForm,Oe as OfflineBanner,Ge as PayWithWallet,Re as ResetPasswordForm,Be as SelectPayment,je as SignInForm,Ne as SignUpForm,qe as UserProfileForm,Ie as UserSettingsForm};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Button");require("@mui/material/Tooltip");var r=require("prop-types"),l=require("react/jsx-runtime");require("@mui/material/FormControlLabel"),require("@mui/material/Checkbox");var a=require("@mui/material/Container"),i=require("@mui/material/Typography");require("@mui/icons-material/CheckCircleOutlined");var n=require("@mui/material/Input"),o=require("@mui/material/InputLabel");require("@mui/material/Switch");var s=require("@mui/icons-material/GitHub"),d=require("@mui/icons-material/Twitter"),u=require("@mui/icons-material/AccountBalanceWallet"),c=require("@mui/material/Select"),x=require("@mui/material/Alert"),m=require("@mui/material/AlertTitle"),h=require("@mui/material/Table"),f=require("@mui/material/TableBody"),v=require("@mui/material/TableCell"),p=require("@mui/material/TableContainer"),g=require("@mui/material/TableHead"),j=require("@mui/material/TableRow");require("@mui/material/Snackbar");var b=require("react-hook-form"),y=require("@mui/material/InputAdornment"),w=require("@mui/icons-material/HttpsOutlined"),T=require("@mui/icons-material/MailOutline"),P=require("@mui/icons-material/PermIdentityOutlined"),C=require("@mui/material/Divider");function q(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var W=q(t),S=q(r),k=q(a),A=q(i),L=q(n),F=q(o),N=q(s),O=q(d),R=q(u),I=q(c),z=q(x),B=q(m),U=q(h),G=q(f),D=q(v),M=q(p),Z=q(g),E=q(j),$=q(y),H=q(w),_=q(T),V=q(P),Y=q(C);function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l)}return r}function K(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var l,a,i=[],n=!0,o=!1;try{for(r=r.call(e);!(n=(l=r.next()).done)&&(i.push(l.value),!t||i.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==r.return||r.return()}finally{if(o)throw a}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ee(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ee(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,l=new Array(t);r<t;r++)l[r]=e[r];return l}S.default.string,S.default.bool;var te=function(e){return l.jsx(A.default,K(K({},e),{},{children:e.children}))},re=function(e){return l.jsxs("div",{style:e.inForm&&{width:"100%"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.label&&l.jsx(F.default,{children:e.label}),e.helperText&&l.jsx(A.default,{variant:"validation",children:e.helperText})]}),l.jsx(L.default,K({disableUnderline:!0},e))]})};S.default.oneOf(["text","number","password"]),S.default.string;var le=function(e){var t,r="";switch(null===(t=e.logo)||void 0===t?void 0:t.toLowerCase()){case"google":r=l.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"});break;case"github":r=l.jsx(N.default,{});break;case"twitter":r=l.jsx(O.default,{});break;case"mada":r=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:20});break;case"stcpay":r=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20});break;case"visa/master":r=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30});break;case"paypal":r=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25});break;case"googlepay":r=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20});break;case"applepay":r=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40});break;case"wallet":r=l.jsx(R.default,{})}return l.jsxs(W.default,K(K({},e),{},{variant:"withLogo",children:[r,l.jsx("div",{style:{width:10}}),l.jsx(A.default,{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))},ae=function(e){return l.jsxs("div",{style:{width:"100%"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[l.jsx(F.default,{children:e.label}),e.helperText&&l.jsx(A.default,{variant:"validation",children:e.helperText})]}),l.jsx(I.default,K(K({},e),{},{children:e.children}))]})},ie=function(e){return l.jsxs(z.default,{severity:e.severity,children:[e.title&&l.jsx(B.default,{children:e.title}),e.text]})},ne=function(e){var t="ar"===e.lang;return l.jsx(M.default,{style:{direction:t?"rtl":"ltr"},children:l.jsxs(U.default,{"aria-label":"a dense table",children:[l.jsx(Z.default,{children:l.jsx(E.default,{children:e.columns.map((function(e,r){return l.jsx(D.default,{align:t?"right":"left",style:{fontWeight:700},variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})}),l.jsx(G.default,{children:e.rows.map((function(e,r){return l.jsx(E.default,{children:e.map((function(e,r){return l.jsx(D.default,{align:t?"right":"left",component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))},r)}))}),e.end&&l.jsx(E.default,{children:e.end.map((function(e,r){return l.jsx(D.default,{align:t?"right":"left",style:{fontWeight:700},component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})]})})},oe=function(e){var t=b.useForm(),r=t.formState.errors,a=t.handleSubmit,i=t.control;return l.jsxs(k.default,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.error&&l.jsxs(z.default,{severity:"error",children:[e.errorTitle&&l.jsx(B.default,{children:e.errorTitle}),e.errorText]}),l.jsx(b.FormProvider,K(K({},t),{},{children:l.jsxs("form",{onSubmit:a(e.handleSignUp),children:[l.jsx(b.Controller,{control:i,name:"fullName",render:function(t){var a,i,n=t.field;return l.jsx(re,{fullWidth:!0,type:"text",value:null!==(a=n.value)&&void 0!==a?a:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=r.fullName)||void 0===i?void 0:i.message,startAdornment:l.jsx($.default,{position:"start",children:l.jsx(V.default,{})})})},rules:{required:e.texts.fullNameRequiredText}}),l.jsx(b.Controller,{control:i,name:"email",render:function(t){var a,i,n=t.field;return l.jsx(re,{fullWidth:!0,type:"text",value:null!==(a=n.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx($.default,{position:"start",children:l.jsx(_.default,{})})})},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(b.Controller,{control:i,name:"password",render:function(t){var a,i,n,o=t.field;return l.jsx(re,K({fullWidth:!0,type:"password",defaultValue:null!==(a=o.value)&&void 0!==a?a:"",value:null!==(i=o.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=r.password)||void 0===n?void 0:n.message,startAdornment:l.jsx($.default,{position:"start",children:l.jsx(H.default,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(W.default,{fullWidth:!0,variant:"last",type:"submit",children:e.texts.signUpText})]})})),l.jsxs(A.default,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.existingUserText," ",l.jsx("span",{onClick:e.handleRouteToSignIn,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signInText})]}),l.jsx(Y.default,{}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&l.jsx(le,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignUp}),e.viaGithub&&l.jsx(le,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignUp}),e.viaTwitter&&l.jsx(le,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignUp})]})]})};oe.propTypes={theme:S.default.oneOf(["secondary","primary"])};re.propTypes={theme:S.default.oneOf(["secondary","primary"]),viaApplePay:S.default.bool,viaGooglePay:S.default.bool,viaSTCPay:S.default.bool,viaCreditCard:S.default.bool,viaPayPal:S.default.bool,handleApplePay:S.default.func};exports.ChargeWalletForm=function(t){var r=X(e.useState(0),2),a=r[0],i=r[1],n=b.useForm();n.formState.errors;var o=n.handleSubmit,s=n.control;return l.jsxs(k.default,{maxWidth:"xs",children:[l.jsxs(A.default,{align:"center",variant:"h2",fontWeight:500,style:{marginBottom:20},children:[Number(a).toLocaleString("en")||"0",l.jsx(A.default,{children:t.currency||"SAR"})]}),l.jsx(b.FormProvider,K(K({},n),{},{children:l.jsxs("form",{onSubmit:o(t.handleChargeWallet),children:[l.jsx(b.Controller,{control:s,name:"amount",render:function(e){var t,r=e.field;return l.jsx(re,K(K({fullWidth:!0,placeholder:"Enter amount",type:"number",value:null!==(t=r.value)&&void 0!==t?t:""},r),{},{inputProps:{inputMode:"numeric",min:"0",max:"9999999",step:"0.01"},onChange:function(e){r.onChange(parseFloat(e.target.value)),console.log("e",e.target.value),i(e.target.value)}}))}}),l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",onClick:t.handleSignIn,children:"Charge Wallet"})]})}))]})},exports.CheckoutForm=function(e){var t,r,a,i,n,o,s,d,u,c,x="ar"===e.lang,m=b.useForm(),h=m.formState.errors,f=m.handleSubmit;m.register;var v=m.control,p={display:"flex",padding:0,paddingRight:"0px !important",paddingLeft:"0px !important",flexDirection:{xs:"column",sm:"row",md:"row",lg:"row",xl:"row"}};return l.jsxs(k.default,{maxWidth:"sm",style:{direction:x?"rtl":"ltr"},children:[l.jsx(A.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),l.jsx(ne,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),l.jsx(Y.default,{variant:"middle"}),l.jsx(A.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.billingAddress}),l.jsx(b.FormProvider,K(K({},m),{},{children:l.jsxs("form",{onSubmit:f(e.handlePayNow),children:[l.jsxs(k.default,{sx:p,children:[l.jsx(b.Controller,{control:v,name:"firstName",rules:{required:null===(t=e.texts)||void 0===t?void 0:t.required},render:function(t){var r,a,i,n=t.field;return l.jsx(re,K({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.firstNameLabel)+" *",helperText:null===(i=h.firstName)||void 0===i?void 0:i.message},n))}}),l.jsx("div",{style:{width:20}}),l.jsx(b.Controller,{control:v,name:"lastName",rules:{required:null===(r=e.texts)||void 0===r?void 0:r.required},render:function(t){var r,a,i,n=t.field;return l.jsx(re,K({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.lastNameLabel)+" *",helperText:null===(i=h.lastName)||void 0===i?void 0:i.message},n))}})]}),l.jsx(b.Controller,{control:v,name:"email",render:function(t){var r,a,i,n=t.field;return l.jsx(re,K({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.emailLabel)+" *",helperText:null===(i=h.email)||void 0===i?void 0:i.message},n))},rules:{required:null===(a=e.texts)||void 0===a?void 0:a.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:null===(i=e.texts)||void 0===i?void 0:i.emailInvalidText}}}),l.jsxs(k.default,{sx:p,children:[l.jsx(b.Controller,{control:v,name:"streetAddress",rules:{required:null===(n=e.texts)||void 0===n?void 0:n.required},render:function(t){var r,a,i,n=t.field;return l.jsx(re,K({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.streetAddressLabel)+" *",helperText:null===(i=h.streetAddress)||void 0===i?void 0:i.message},n))}}),l.jsx("div",{style:{width:20}}),l.jsx(b.Controller,{control:v,name:"buildingNumber",rules:{required:null===(o=e.texts)||void 0===o?void 0:o.required},render:function(t){var r,a,i,n=t.field;return l.jsx(re,K({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.buildingNumberLabel)+" *",helperText:null===(i=h.buildingNumber)||void 0===i?void 0:i.message},n))}})]}),l.jsxs(k.default,{sx:p,children:[l.jsx(b.Controller,{control:v,name:"province",rules:{required:null===(s=e.texts)||void 0===s?void 0:s.required},render:function(t){var r,a,i,n=t.field;return l.jsx(re,K({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.stateLabel)+" *",helperText:null===(i=h.province)||void 0===i?void 0:i.message},n))}}),l.jsx("div",{style:{width:20}}),l.jsx(b.Controller,{control:v,name:"city",rules:{required:null===(d=e.texts)||void 0===d?void 0:d.required},render:function(t){var r,a,i,n=t.field;return l.jsx(re,K({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.cityLabel)+" *",helperText:null===(i=h.city)||void 0===i?void 0:i.message},n))}})]}),l.jsxs(k.default,{sx:p,children:[l.jsx(b.Controller,{control:v,name:"zipCode",rules:{required:null===(u=e.texts)||void 0===u?void 0:u.required},render:function(t){var r,a,i,n=t.field;return l.jsx(re,K({inForm:!0,fullWidth:!0,type:"number",variant:"unscrollable",value:null!==(r=n.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.zipCodeLabel)+" *",helperText:null===(i=h.zipCode)||void 0===i?void 0:i.message},n))}}),l.jsx("div",{style:{width:20}}),l.jsx(b.Controller,{control:v,name:"country",rules:{required:null===(c=e.texts)||void 0===c?void 0:c.required},render:function(t){var r,a,i,n=t.field;return l.jsxs(ae,K(K({fullWidth:!0,native:!0,label:(null===(r=e.texts)||void 0===r?void 0:r.countryLabel)+" *",variant:"standard",value:null!==(a=n.value)&&void 0!==a?a:"",helperText:null===(i=h.country)||void 0===i?void 0:i.message,displayEmpty:!0,disableUnderline:!0,validators:["required"]},n),{},{children:[l.jsx("option",{}),e.countriesList.map((function(e,t){return l.jsx("option",{children:e},t)}))]}))}})]}),l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.payNow})]})}))]})},exports.ConfirmationPage=function(e){var t="ar"===e.lang,r=b.useForm();return r.formState.errors,r.handleSubmit,r.register,r.control,l.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[l.jsxs(k.default,{maxWidth:"sm",style:{direction:t?"rtl":"ltr"},children:[l.jsx(A.default,{align:"center",variant:"h3",fontWeight:400,style:{marginBottom:10},children:e.confirmationTitle}),l.jsx(Y.default,{variant:"middle"}),l.jsxs(A.default,{align:"center",variant:"body1",style:{marginBottom:10},children:[e.texts.successMessage," ",l.jsx("strong",{children:e.userEmail})]}),l.jsx(A.default,{align:"center",variant:"body1",children:e.texts.yourOrderNumber}),l.jsx(A.default,{align:"center",variant:"body1",fontWeight:700,style:{marginBottom:10},children:e.orderNumber}),l.jsx(Y.default,{variant:"middle"}),e.products&&l.jsxs(l.Fragment,{children:[l.jsx(A.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),l.jsx(ne,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),l.jsx(Y.default,{variant:"middle"})]}),l.jsx(W.default,{onClick:e.handlePrint,variant:"contained",children:e.texts.print}),l.jsx(W.default,{onClick:e.handleHistory,variant:"last",children:e.texts.history}),l.jsx(W.default,{onClick:e.handleHome,variant:"last",children:e.texts.homePage}),l.jsx(A.default,{align:"center",variant:"body2",style:{marginTop:10},children:e.texts.fasterPaymentNote})]}),l.jsx("a",{style:{marginTop:10,paddingTop:10,padding:5,cursor:"pointer"},onClick:e.handleRefundPolicyLink,children:l.jsx(A.default,{align:"center",variant:"caption",fontWeight:500,children:e.texts.refundPolicy})})]})},exports.CreditCardForm=function(e){var t,r,a=b.useForm(),i=a.formState.errors,n=a.handleSubmit;return l.jsx(k.default,{maxWidth:"xs",children:l.jsx(b.FormProvider,K(K({},a),{},{children:l.jsxs("form",{onSubmit:n(e.handle),children:[l.jsx(re,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"tel",label:"Card Number",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message}),l.jsx(re,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Name On Card",rules:{required:"Password is rquired"},helperText:null===(r=i.password)||void 0===r?void 0:r.message}),l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithCreditCard,children:"Pay with Credit Card"})]})}))})},exports.NewPasswordForm=function(t){var r=X(e.useState(""),2);r[0],r[1];var a=X(e.useState(""),2);a[0],a[1];var i=X(e.useState(!1),2),n=i[0],o=i[1],s=b.useForm(),d=s.formState.errors,u=s.handleSubmit,c=s.control;return l.jsxs(k.default,{maxWidth:"xs",variant:"auth",children:[n&&l.jsx(ie,{text:t.texts.passwordMatchError,severity:"error"}),t.passwordChanged?l.jsx(te,{style:{textAlign:"center",margin:5},children:"Your password has been changed, you'll be redirected to sign in page"}):l.jsx(b.FormProvider,K(K({},s),{},{children:l.jsxs("form",{onSubmit:u((function(e){console.log("handling subb",e),e.password===e.confirmPassword?t.handleNewPassword():o(!0)})),children:[l.jsx(b.Controller,{control:c,name:"password",render:function(e){var r,a,i=e.field;return l.jsx(re,K({fullWidth:!0,type:"password",value:null!==(r=i.value)&&void 0!==r?r:"",label:t.texts.passwordLabel,placeholder:t.texts.passwordPlaceholder,helperText:null===(a=d.password)||void 0===a?void 0:a.message,startAdornment:l.jsx($.default,{position:"start",children:l.jsx(H.default,{})})},i))},rules:{required:t.texts.passwordRequiredText}}),l.jsx(b.Controller,{control:c,name:"confirmPassword",render:function(e){var r,a,i=e.field;return l.jsx(re,K({fullWidth:!0,type:"password",value:null!==(r=i.value)&&void 0!==r?r:"",label:t.texts.confirmPasswordLabel,placeholder:t.texts.confirmPasswordPlaceholder,helperText:null===(a=d.confirmPassword)||void 0===a?void 0:a.message,startAdornment:l.jsx($.default,{position:"start",children:l.jsx(H.default,{})})},i))},rules:{required:t.texts.confirmPasswordRequiredText}}),l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",children:t.texts.updatePassword})]})}))]})},exports.PayWithWallet=function(e){return l.jsxs(k.default,{maxWidth:"xs",children:[l.jsx(A.default,{align:"center",children:"Wallet Balance"}),l.jsxs(A.default,{align:"center",variant:"h1",children:[e.walletBalance||"0",l.jsx(A.default,{children:e.currency||"SAR"})]}),l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithWallet,children:"Pay Now"})]})},exports.ResetPasswordForm=function(e){var t,r=b.useForm(),a=r.formState.errors,i=r.handleSubmit;r.register;var n=r.control;return l.jsxs(k.default,{maxWidth:"xs",variant:"auth",children:[e.error&&l.jsxs(Alert,{severity:"error",children:[e.errorTitle&&l.jsx(AlertTitle,{children:e.errorTitle}),e.errorText]}),e.sent?l.jsx(te,{style:{textAlign:"center",margin:5},children:"An link was sent to your email to reset the password."}):l.jsxs("form",{onSubmit:i(e.handleResetPassword),children:[console.log("eror ",null===(t=a.email)||void 0===t?void 0:t.message),l.jsx(b.Controller,{control:n,name:"email",render:function(t){var r,i,n=t.field;return l.jsx(re,K({fullWidth:!0,type:"text",value:null!==(r=n.value)&&void 0!==r?r:"",label:e.texts.emailLabel,helperText:null===(i=a.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx($.default,{position:"start",children:l.jsx(_.default,{})})},n))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.resetPassword})]})]})},exports.SelectPayment=function(e){return l.jsxs(k.default,{maxWidth:"xs",children:[l.jsx(te,{align:"center",children:"Choose Payment Method"}),e.viaWallet&&l.jsx(le,{logo:"wallet",buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&l.jsx(le,{logo:"visa/master",buttonText:e.visaMasterLabel,onClick:e.handleCreditCard}),e.viaMada&&l.jsx(le,{logo:"mada",buttonText:e.madaLabel,onClick:e.handleMada}),e.viaSTCPay&&l.jsx(le,{logo:"stcpay",buttonText:e.stcPayLabel,onClick:e.handleSTCPay}),e.viaPayPal&&l.jsx(le,{logo:"paypal",buttonText:e.paypalLabel,onClick:e.handlePayPal}),e.viaGooglePay&&l.jsx(le,{logo:"googlepay",buttonText:e.googlePayLabel,onClick:e.handleGooglePay}),e.viaApplePay&&l.jsx(le,{logo:"applepay",buttonText:e.applePayLabel,onClick:e.handleApplePay})]})},exports.SignInForm=function(e){var t=b.useForm(),r=t.formState.errors,a=t.handleSubmit;t.register;var i=t.control;return l.jsxs(k.default,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.error&&l.jsxs(z.default,{severity:"error",children:[e.errorTitle&&l.jsx(B.default,{children:e.errorTitle}),e.errorText]}),l.jsxs("form",{onSubmit:a(e.handleSignIn),children:[l.jsx(b.Controller,{control:i,name:"email",render:function(t){var a,i,n=t.field;return l.jsx(re,K({fullWidth:!0,type:"text",value:null!==(a=n.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx($.default,{position:"start",children:l.jsx(_.default,{})})},n))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(b.Controller,{control:i,name:"password",render:function(t){var a,i,n,o=t.field;return l.jsx(re,K({fullWidth:!0,type:"password",defaultValue:null!==(a=o.value)&&void 0!==a?a:"",value:null!==(i=o.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=r.password)||void 0===n?void 0:n.message,startAdornment:l.jsx($.default,{position:"start",children:l.jsx(H.default,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(A.default,{style:{cursor:"pointer",marginTop:5,width:"max-content",fontSize:15,padding:5},onClick:e.handleForgotPassword,children:e.texts.forgotPasswordText}),l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.signInText})]}),l.jsxs(A.default,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.newUserText," ",l.jsx("span",{onClick:e.handleRouteToSignUp,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signUpText})]}),l.jsx(Y.default,{}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&l.jsx(le,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignIn}),e.viaGithub&&l.jsx(le,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignIn}),e.viaTwitter&&l.jsx(le,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignIn})]})]})},exports.SignUpForm=oe,exports.UserProfileForm=function(e){var t=b.useForm(),r=t.formState.errors,a=t.handleSubmit,i=t.control;return l.jsx(k.default,{maxWidth:"sm",children:l.jsx(b.FormProvider,K(K({},t),{},{children:l.jsxs("form",{onSubmit:a(e.handleUpdateProfile),children:[l.jsx(b.Controller,{control:i,name:"fullName",render:function(t){var a,i,n=t.field;return l.jsx(re,K({fullWidth:!0,type:"text",value:null!==(a=n.value)&&void 0!==a?a:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=r.fullName)||void 0===i?void 0:i.message},n))}}),l.jsx(b.Controller,{control:i,name:"phoneNumber",render:function(e){var t=e.field;return l.jsx(re,K({fullWidth:!0,type:"tel",label:"Phone Number",placeholder:"+966"},t))}}),l.jsx(b.Controller,{control:i,name:"email",render:function(t){var a,i,n=t.field;return l.jsx(re,K({fullWidth:!0,type:"text",value:null!==(a=n.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder},n))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(b.Controller,{control:i,name:"password",render:function(t){var a,i,n=t.field;return l.jsx(re,K({fullWidth:!0,type:"password",value:null!==(a=n.value)&&void 0!==a?a:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message},n))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(b.Controller,{control:i,name:"confirmPassword",render:function(t){var a,i,n=t.field;return l.jsx(re,K({fullWidth:!0,type:"password",value:null!==(a=n.value)&&void 0!==a?a:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(i=r.confirmPassword)||void 0===i?void 0:i.message},n))},rules:{required:e.texts.confirmPasswordRequiredText}}),l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",children:"update profile"})," "]})}))})},exports.UserSettingsForm=function(e){return l.jsxs(k.default,{maxWidth:"sm",children:[e.children,l.jsx(W.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSaveSettings,children:e.saveSettingsText})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Button"),r=require("@mui/material/Tooltip"),l=require("prop-types"),a=require("react/jsx-runtime"),n=require("@mui/material/FormControlLabel"),i=require("@mui/material/Checkbox"),o=require("@mui/material/Container"),s=require("@mui/material/Typography"),d=require("@mui/icons-material/CheckCircleOutlined"),u=require("@mui/material/Input"),c=require("@mui/material/InputLabel"),x=require("@mui/material/Switch"),h=require("@mui/icons-material/GitHub"),f=require("@mui/icons-material/Twitter"),m=require("@mui/icons-material/AccountBalanceWallet"),p=require("@mui/material/Select"),v=require("@mui/material/Alert"),g=require("@mui/material/AlertTitle"),j=require("@mui/material/Table"),y=require("@mui/material/TableBody"),b=require("@mui/material/TableCell"),w=require("@mui/material/TableContainer"),C=require("@mui/material/TableHead"),T=require("@mui/material/TableRow"),P=require("@mui/material/Snackbar"),q=require("react-hook-form"),S=require("@mui/material/InputAdornment"),k=require("@mui/icons-material/HttpsOutlined"),W=require("@mui/icons-material/MailOutline"),L=require("@mui/icons-material/PermIdentityOutlined"),A=require("@mui/material/Divider"),O=require("@mui/material/styles"),I=require("@mui/material/Box"),F=require("@mui/material/Drawer"),R=require("@mui/material/AppBar"),z=require("@mui/material/Toolbar"),B=require("@mui/material/List"),N=require("@mui/material/IconButton"),D=require("@mui/icons-material/Menu"),M=require("@mui/icons-material/ChevronLeft"),G=require("@mui/icons-material/ChevronRight"),H=require("@mui/material/ListItemButton"),E=require("@mui/material/ListItemText"),U=require("@mui/material/Menu"),Z=require("@mui/material/Avatar"),$=require("@mui/material/MenuItem"),_=require("@mui/icons-material/Close"),V=require("@mui/material/Dialog"),X=require("@mui/material/DialogActions"),J=require("@mui/material/DialogContent"),K=require("@mui/material/DialogTitle"),Q=require("@mui/material");function Y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var ee=Y(e),te=Y(t),re=Y(r),le=Y(l),ae=Y(n),ne=Y(i),ie=Y(o),oe=Y(s),se=Y(d),de=Y(u),ue=Y(c),ce=Y(x),xe=Y(h),he=Y(f),fe=Y(m),me=Y(p),pe=Y(v),ve=Y(g),ge=Y(j),je=Y(y),ye=Y(b),be=Y(w),we=Y(C),Ce=Y(T),Te=Y(P),Pe=Y(S),qe=Y(k),Se=Y(W),ke=Y(L),We=Y(A),Le=Y(I),Ae=Y(F),Oe=Y(R),Ie=Y(z),Fe=Y(B),Re=Y(N),ze=Y(D),Be=Y(M),Ne=Y(G),De=Y(H),Me=Y(E),Ge=Y(U),He=Y(Z),Ee=Y($),Ue=Y(_),Ze=Y(V),$e=Y(X),_e=Y(J),Ve=Y(K);function Xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach((function(t){Ke(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ke(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qe(e,t){if(null==e)return{};var r,l,a=function(e,t){if(null==e)return{};var r,l,a={},n=Object.keys(e);for(l=0;l<n.length;l++)r=n[l],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(l=0;l<n.length;l++)r=n[l],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Ye(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var l,a,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(l=r.next()).done)&&(n.push(l.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return et(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return et(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,l=new Array(t);r<t;r++)l[r]=e[r];return l}var tt=function(e){return e.showText?a.jsxs(te.default,{variant:"adaptive-dark",onClick:e.onClick,children:[e.icon,a.jsx("div",{style:{width:10}}),e.buttonText]}):a.jsx(re.default,{title:e.buttonText,placement:"top",children:a.jsx(te.default,{variant:"adaptive-dark",onClick:e.onClick,children:e.icon})})};tt.propTypes={buttonText:le.default.string,showText:le.default.bool};var rt=function(t){var r=Ye(e.useState(t.defaultValue),2),l=r[0],n=r[1];return a.jsx(ie.default,{variant:t.location||"panelTabs",children:t.options.map((function(e,r){var i;return a.jsx(te.default,{onClick:function(){t.handleChange(e.value),n(e.value)},fullWidth:!0,variant:(null==l?void 0:l.toLowerCase())===(null===(i=e.value)||void 0===i?void 0:i.toLowerCase())?"selected":"unselected",children:e.label},r)}))})},lt=function(e){return a.jsx(oe.default,Je(Je({},e),{},{children:e.children}))},at=function(e){return a.jsxs("div",{style:e.inForm&&{width:"100%"},children:[a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.label&&a.jsx(ue.default,{children:e.label}),e.helperText&&a.jsx(oe.default,{variant:"validation",children:e.helperText})]}),a.jsx(de.default,Je({disableUnderline:!0},e))]})},nt=function(e){return a.jsx(ce.default,Je({},e))},it=function(e){return a.jsxs(ie.default,{variant:"settingsRow",children:[a.jsx(lt,{children:e.settingsLabel}),"checkbox"===e.settingsType&&a.jsx(ne.default,Je({},e)),"text"===e.settingsType&&a.jsx(at,Je({},e)),"radio"===e.settingsType&&a.jsx(rt,Je({location:"inSettings"},e)),"boolean"===e.settingsType&&a.jsx(nt,Je({},e))]})};it.propTypes={type:le.default.oneOf(["text","number","password"]),helperText:le.default.string};var ot=function(e){var t,r="";switch(null===(t=e.logo)||void 0===t?void 0:t.toLowerCase()){case"google":r=a.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"});break;case"github":r=a.jsx(xe.default,{});break;case"twitter":r=a.jsx(he.default,{});break;case"mada":r=a.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:20});break;case"stcpay":r=a.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20});break;case"visa/master":r=a.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30});break;case"paypal":r=a.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25});break;case"googlepay":r=a.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20});break;case"applepay":r=a.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40});break;case"wallet":r=a.jsx(fe.default,{})}return a.jsxs(te.default,Je(Je({},e),{},{variant:"withLogo",children:[r,a.jsx("div",{style:{width:10}}),a.jsx(oe.default,{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))},st=function(e){return a.jsxs("div",{style:{width:"100%"},children:[a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[a.jsx(ue.default,{children:e.label}),e.helperText&&a.jsx(oe.default,{variant:"validation",children:e.helperText})]}),a.jsx(me.default,Je(Je({},e),{},{children:e.children}))]})},dt=function(e){return a.jsxs(pe.default,{severity:e.severity,variant:"inContainer",children:[e.title&&a.jsx(ve.default,{children:e.title}),e.text]})},ut=function(e){var t="ar"===e.lang;return a.jsx(be.default,{style:{direction:t?"rtl":"ltr"},children:a.jsxs(ge.default,{"aria-label":"a dense table",children:[a.jsx(we.default,{children:a.jsx(Ce.default,{children:e.columns.map((function(e,r){return a.jsx(ye.default,{align:t?"right":"left",style:{fontWeight:700},variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})}),a.jsx(je.default,{children:e.rows.map((function(e,r){return a.jsx(Ce.default,{children:e.map((function(e,r){return a.jsx(ye.default,{align:t?"right":"left",component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))},r)}))}),e.end&&a.jsx(Ce.default,{children:e.end.map((function(e,r){return a.jsx(ye.default,{align:t?"right":"left",style:{fontWeight:700},component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})]})})},ct=function(e){var t=q.useForm(),r=t.formState.errors,l=t.handleSubmit,n=t.control;return a.jsxs(ie.default,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.error&&a.jsxs(pe.default,{severity:"error",variant:"inContainer",children:[e.errorTitle&&a.jsx(ve.default,{children:e.errorTitle}),e.errorText]}),a.jsx(q.FormProvider,Je(Je({},t),{},{children:a.jsxs("form",{onSubmit:l(e.handleSignUp),children:[a.jsx(q.Controller,{control:n,name:"fullName",render:function(t){var l,n,i=t.field;return a.jsx(at,{fullWidth:!0,type:"text",value:null!==(l=i.value)&&void 0!==l?l:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(n=r.fullName)||void 0===n?void 0:n.message,startAdornment:a.jsx(Pe.default,{position:"start",children:a.jsx(ke.default,{})})})},rules:{required:e.texts.fullNameRequiredText}}),a.jsx(q.Controller,{control:n,name:"email",render:function(t){var l,n,i=t.field;return a.jsx(at,{fullWidth:!0,type:"text",value:null!==(l=i.value)&&void 0!==l?l:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:a.jsx(Pe.default,{position:"start",children:a.jsx(Se.default,{})})})},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),a.jsx(q.Controller,{control:n,name:"password",render:function(t){var l,n,i,o=t.field;return a.jsx(at,Je({fullWidth:!0,type:"password",defaultValue:null!==(l=o.value)&&void 0!==l?l:"",value:null!==(n=o.value)&&void 0!==n?n:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message,startAdornment:a.jsx(Pe.default,{position:"start",children:a.jsx(qe.default,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),a.jsx(te.default,{fullWidth:!0,variant:"last",type:"submit",children:e.texts.signUpText})]})})),a.jsxs(oe.default,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.existingUserText," ",a.jsx("span",{onClick:e.handleRouteToSignIn,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signInText})]}),a.jsx(We.default,{}),a.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&a.jsx(ot,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignUp}),e.viaGithub&&a.jsx(ot,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignUp}),e.viaTwitter&&a.jsx(ot,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignUp})]})]})};ct.propTypes={theme:le.default.oneOf(["secondary","primary"])};at.propTypes={theme:le.default.oneOf(["secondary","primary"]),viaApplePay:le.default.bool,viaGooglePay:le.default.bool,viaSTCPay:le.default.bool,viaCreditCard:le.default.bool,viaPayPal:le.default.bool,handleApplePay:le.default.func};var xt=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},ht=function(e){return Ke({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(7)," + 1px)")},e.breakpoints.up("sm"),{width:"calc(".concat(e.spacing(8)," + 1px)")})},ft=O.styled("div")((function(e){var t=e.theme;return Je({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),mt=O.styled(Oe.default,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return Je({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})},r&&{marginLeft:240,width:"calc(100% - ".concat(240,"px)"),transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen})})})),pt=O.styled(Ae.default,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return Je(Je({width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box"},r&&Je(Je({},xt(t)),{},{"& .MuiDrawer-paper":xt(t)})),!r&&Je(Je({},ht(t)),{},{"& .MuiDrawer-paper":ht(t)}))}));var vt=["children","onClose","hideClose"],gt=function(e){var t=e.children,r=e.onClose,l=e.hideClose,n=Qe(e,vt);return a.jsxs(Ve.default,Je(Je({sx:{m:0,p:2}},n),{},{children:[t,l?null:a.jsx(Re.default,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}},children:a.jsx(Ue.default,{})})]}))};var jt=function(e){var t=Q.useTheme();return a.jsx(Q.Menu,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:e.anchor,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(e.anchor),onClose:e.handleClose,variant:"themed",PaperProps:{style:{boxShadow:"none",borderRadius:t.allBorderRadius,border:"1px solid ".concat(t.primaryActionColor)}},children:e.menuItems.map((function(e){return a.jsxs(Q.MenuItem,{onClick:e.action,children:[e.icon&&a.jsx(e.icon,{}),a.jsx("div",{style:{width:10}}),a.jsx(Q.Typography,{textAlign:"center",children:e.label})]},e.label)}))})},yt=["Products","Pricing","Blog"];exports.ActionButton=function(e){return a.jsx(te.default,Je(Je({},e),{},{children:e.text}))},exports.AdaptiveButton=tt,exports.Box=function(e){return a.jsx("div",{children:e.children})},exports.ChargeWalletForm=function(t){var r=Ye(e.useState(0),2),l=r[0],n=r[1],i=q.useForm();i.formState.errors;var o=i.handleSubmit,s=i.control;return a.jsxs(ie.default,{maxWidth:"xs",children:[a.jsxs(oe.default,{align:"center",variant:"h2",fontWeight:500,style:{marginBottom:20},children:[Number(l).toLocaleString("en")||"0",a.jsx(oe.default,{children:t.currency||"SAR"})]}),a.jsx(q.FormProvider,Je(Je({},i),{},{children:a.jsxs("form",{onSubmit:o(t.handleChargeWallet),children:[a.jsx(q.Controller,{control:s,name:"amount",render:function(e){var t,r=e.field;return a.jsx(at,Je(Je({fullWidth:!0,placeholder:"Enter amount",type:"number",value:null!==(t=r.value)&&void 0!==t?t:""},r),{},{inputProps:{inputMode:"numeric",min:"0",max:"9999999",step:"0.01"},onChange:function(e){r.onChange(parseFloat(e.target.value)),console.log("e",e.target.value),n(e.target.value)}}))}}),a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",onClick:t.handleSignIn,children:"Charge Wallet"})]})}))]})},exports.CheckoutForm=function(e){var t,r,l,n,i,o,s,d,u,c,x="ar"===e.lang,h=q.useForm(),f=h.formState.errors,m=h.handleSubmit;h.register;var p=h.control,v={display:"flex",padding:0,paddingRight:"0px !important",paddingLeft:"0px !important",flexDirection:{xs:"column",sm:"row",md:"row",lg:"row",xl:"row"}};return a.jsxs(ie.default,{maxWidth:"sm",style:{direction:x?"rtl":"ltr"},children:[a.jsx(oe.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),a.jsx(ut,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),a.jsx(We.default,{variant:"middle"}),a.jsx(oe.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.billingAddress}),a.jsx(q.FormProvider,Je(Je({},h),{},{children:a.jsxs("form",{onSubmit:m(e.handlePayNow),children:[a.jsxs(ie.default,{sx:v,children:[a.jsx(q.Controller,{control:p,name:"firstName",rules:{required:null===(t=e.texts)||void 0===t?void 0:t.required},render:function(t){var r,l,n,i=t.field;return a.jsx(at,Je({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(l=e.texts)||void 0===l?void 0:l.firstNameLabel)+" *",helperText:null===(n=f.firstName)||void 0===n?void 0:n.message},i))}}),a.jsx("div",{style:{width:20}}),a.jsx(q.Controller,{control:p,name:"lastName",rules:{required:null===(r=e.texts)||void 0===r?void 0:r.required},render:function(t){var r,l,n,i=t.field;return a.jsx(at,Je({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(l=e.texts)||void 0===l?void 0:l.lastNameLabel)+" *",helperText:null===(n=f.lastName)||void 0===n?void 0:n.message},i))}})]}),a.jsx(q.Controller,{control:p,name:"email",render:function(t){var r,l,n,i=t.field;return a.jsx(at,Je({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(l=e.texts)||void 0===l?void 0:l.emailLabel)+" *",helperText:null===(n=f.email)||void 0===n?void 0:n.message},i))},rules:{required:null===(l=e.texts)||void 0===l?void 0:l.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:null===(n=e.texts)||void 0===n?void 0:n.emailInvalidText}}}),a.jsxs(ie.default,{sx:v,children:[a.jsx(q.Controller,{control:p,name:"streetAddress",rules:{required:null===(i=e.texts)||void 0===i?void 0:i.required},render:function(t){var r,l,n,i=t.field;return a.jsx(at,Je({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(l=e.texts)||void 0===l?void 0:l.streetAddressLabel)+" *",helperText:null===(n=f.streetAddress)||void 0===n?void 0:n.message},i))}}),a.jsx("div",{style:{width:20}}),a.jsx(q.Controller,{control:p,name:"buildingNumber",rules:{required:null===(o=e.texts)||void 0===o?void 0:o.required},render:function(t){var r,l,n,i=t.field;return a.jsx(at,Je({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(l=e.texts)||void 0===l?void 0:l.buildingNumberLabel)+" *",helperText:null===(n=f.buildingNumber)||void 0===n?void 0:n.message},i))}})]}),a.jsxs(ie.default,{sx:v,children:[a.jsx(q.Controller,{control:p,name:"province",rules:{required:null===(s=e.texts)||void 0===s?void 0:s.required},render:function(t){var r,l,n,i=t.field;return a.jsx(at,Je({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(l=e.texts)||void 0===l?void 0:l.stateLabel)+" *",helperText:null===(n=f.province)||void 0===n?void 0:n.message},i))}}),a.jsx("div",{style:{width:20}}),a.jsx(q.Controller,{control:p,name:"city",rules:{required:null===(d=e.texts)||void 0===d?void 0:d.required},render:function(t){var r,l,n,i=t.field;return a.jsx(at,Je({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(l=e.texts)||void 0===l?void 0:l.cityLabel)+" *",helperText:null===(n=f.city)||void 0===n?void 0:n.message},i))}})]}),a.jsxs(ie.default,{sx:v,children:[a.jsx(q.Controller,{control:p,name:"zipCode",rules:{required:null===(u=e.texts)||void 0===u?void 0:u.required},render:function(t){var r,l,n,i=t.field;return a.jsx(at,Je({inForm:!0,fullWidth:!0,type:"number",variant:"unscrollable",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(l=e.texts)||void 0===l?void 0:l.zipCodeLabel)+" *",helperText:null===(n=f.zipCode)||void 0===n?void 0:n.message},i))}}),a.jsx("div",{style:{width:20}}),a.jsx(q.Controller,{control:p,name:"country",rules:{required:null===(c=e.texts)||void 0===c?void 0:c.required},render:function(t){var r,l,n,i=t.field;return a.jsxs(st,Je(Je({fullWidth:!0,native:!0,label:(null===(r=e.texts)||void 0===r?void 0:r.countryLabel)+" *",variant:"standard",value:null!==(l=i.value)&&void 0!==l?l:"",helperText:null===(n=f.country)||void 0===n?void 0:n.message,displayEmpty:!0,disableUnderline:!0,validators:["required"]},i),{},{children:[a.jsx("option",{}),e.countriesList.map((function(e,t){return a.jsx("option",{children:e},t)}))]}))}})]}),a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.payNow})]})}))]})},exports.ConfirmationPage=function(e){var t="ar"===e.lang,r=q.useForm();return r.formState.errors,r.handleSubmit,r.register,r.control,a.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[a.jsxs(ie.default,{maxWidth:"sm",style:{direction:t?"rtl":"ltr"},children:[a.jsx(oe.default,{align:"center",variant:"h3",fontWeight:400,style:{marginBottom:10},children:e.confirmationTitle}),a.jsx(We.default,{variant:"middle"}),a.jsxs(oe.default,{align:"center",variant:"body1",style:{marginBottom:10},children:[e.texts.successMessage," ",a.jsx("strong",{children:e.userEmail})]}),a.jsx(oe.default,{align:"center",variant:"body1",children:e.texts.yourOrderNumber}),a.jsx(oe.default,{align:"center",variant:"body1",fontWeight:700,style:{marginBottom:10},children:e.orderNumber}),a.jsx(We.default,{variant:"middle"}),e.products&&a.jsxs(a.Fragment,{children:[a.jsx(oe.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),a.jsx(ut,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),a.jsx(We.default,{variant:"middle"})]}),a.jsx(te.default,{onClick:e.handlePrint,variant:"contained",children:e.texts.print}),a.jsx(te.default,{onClick:e.handleHistory,variant:"last",children:e.texts.history}),a.jsx(te.default,{onClick:e.handleHome,variant:"last",children:e.texts.homePage}),a.jsx(oe.default,{align:"center",variant:"body2",style:{marginTop:10},children:e.texts.fasterPaymentNote})]}),a.jsx("a",{style:{marginTop:10,paddingTop:10,padding:5,cursor:"pointer"},onClick:e.handleRefundPolicyLink,children:a.jsx(oe.default,{align:"center",variant:"caption",fontWeight:500,children:e.texts.refundPolicy})})]})},exports.CreditCardForm=function(e){var t,r=q.useForm(),l=r.formState.errors,n=r.handleSubmit,i=r.control;return a.jsx(ie.default,{maxWidth:"xs",children:a.jsxs("form",{onSubmit:n(e.handle),children:[a.jsx(at,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"tel",label:"Card Number",rules:{required:"Password is rquired"},helperText:null===(t=l.password)||void 0===t?void 0:t.message}),a.jsx(q.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,a.jsx(at,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Name On Card",rules:{required:"Password is rquired"},helperText:null===(t=l.password)||void 0===t?void 0:t.message})}}),a.jsx(q.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,a.jsx(at,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Expiry Date",rules:{required:"Password is rquired"},helperText:null===(t=l.password)||void 0===t?void 0:t.message})}}),a.jsx(q.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,a.jsx(at,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"CCV",rules:{required:"Password is rquired"},helperText:null===(t=l.password)||void 0===t?void 0:t.message})}}),a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithCreditCard,children:"Pay with Credit Card"})]})})},exports.HawaAlert=dt,exports.HawaAppBar=function(e){var t=Q.useTheme(),r=Ye(ee.default.useState(null),2),l=r[0],n=r[1],i=Ye(ee.default.useState(null),2),o=i[0],s=i[1],d=function(){n(null)};return console.log("theme is ",t),a.jsx(Oe.default,{position:"static",variant:"appbar",children:a.jsx(ie.default,{maxWidth:"xl",variant:"appbar",children:a.jsxs(Ie.default,{disableGutters:!0,children:[a.jsx(oe.default,{variant:"h6",noWrap:!0,component:"div",sx:{mr:2,display:{xs:"none",md:"flex"}},children:"LOGO"}),a.jsxs(Le.default,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:[a.jsx(Re.default,{size:"large","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e.handleOpenSideMenu,color:"inherit",children:a.jsx(ze.default,{})}),a.jsx(Ge.default,{id:"menu-appbar",anchorEl:l,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"left"},open:Boolean(l),onClose:d,sx:{display:{xs:"block",md:"none"}},children:yt.map((function(e){return a.jsx(Ee.default,{onClick:d,children:a.jsx(oe.default,{textAlign:"center",children:e})},e)}))})]}),a.jsx(oe.default,{variant:"h6",noWrap:!0,component:"div",sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:"LOGO"}),a.jsx(Le.default,{sx:{flexGrow:1,display:{xs:"none",md:"flex"}},children:yt.map((function(e){return a.jsx(te.default,{onClick:d,sx:{my:2,display:"block"},children:e},e)}))}),a.jsxs(Le.default,{sx:{flexGrow:0},children:[a.jsx(re.default,{title:"Open settings",children:a.jsx(Re.default,{onClick:function(e){s(e.currentTarget)},sx:{p:0},children:a.jsx(He.default,{alt:"Remy Sharp",src:"/static/images/avatar/2.jpg"})})}),a.jsx(jt,{anchor:o,handleClose:function(e){return s(null)},menuItems:e.accountMenu})]})]})})})},exports.HawaAppLayout=function(e){var t=O.useTheme(),r=Ye(ee.default.useState(!0),2),l=r[0],n=r[1],i=Ye(ee.default.useState(null),2);i[0],i[1];var o=Ye(ee.default.useState(null),2),s=o[0],d=o[1];return a.jsxs(Le.default,{sx:{display:"flex"},children:[a.jsx(mt,{variant:"appbar",position:"fixed",open:l,children:a.jsxs(Ie.default,{variant:"appbar",children:[a.jsx(Re.default,{color:"inherit","aria-label":"open drawer",onClick:function(){n(!0)},edge:"start",sx:Je({marginRight:5},l&&{display:"none"}),children:a.jsx(ze.default,{})}),a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",margin:0},children:[a.jsx(oe.default,{variant:"h6",noWrap:!0,component:"div",children:e.pageTitle}),a.jsxs(Le.default,{children:[a.jsx(re.default,{title:"Open settings",children:a.jsx(Re.default,{onClick:function(e){d(e.currentTarget)},sx:{p:0},children:a.jsx(He.default,{alt:"Remy Sharp",src:"/static/images/avatar/2.jpg"})})}),a.jsx(Ge.default,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:s,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(s),onClose:function(){d(null)},variant:"themed",PaperProps:{style:{boxShadow:"none",borderRadius:t.allBorderRadius,border:"1px solid ".concat(t.primaryActionColor)}},children:e.accountMenu.map((function(e){return a.jsxs(Ee.default,{onClick:e.action,children:[e.icon&&a.jsx(e.icon,{}),a.jsx(oe.default,{textAlign:"center",children:e.label})]},e.label)}))})]})]})]})}),a.jsxs(pt,{variant:"permanent",open:l,children:[a.jsxs(ft,{children:[e.logo,a.jsx(Re.default,{onClick:function(){n(!1)},children:"rtl"===t.direction?a.jsx(Ne.default,{}):a.jsx(Be.default,{})})]}),a.jsx(We.default,{}),a.jsx(Fe.default,{children:e.pages.map((function(t,r){var n,i;return a.jsx(re.default,{title:t.text,placement:"right",arrow:!0,PopperProps:{style:{opacity:l?0:1}},children:a.jsxs(De.default,{variant:(null===(n=e.pageName)||void 0===n?void 0:n.toLowerCase())===(null===(i=t.slug)||void 0===i?void 0:i.toLowerCase())&&"clicked",onClick:t.action,sx:{minHeight:48,justifyContent:l?"initial":"center",px:2.5},children:[a.jsx(t.icon,{}),a.jsx("div",{style:{width:20}}),a.jsx(Me.default,{primary:t.text,sx:{opacity:l?1:0}})]},t.text)},r)}))})]}),a.jsxs(Le.default,{sx:{flexGrow:1,p:3},children:[a.jsx(ft,{}),e.children]})]})},exports.HawaButton=function(e){return a.jsx(te.default,Je(Je({},e),{},{children:e.children}))},exports.HawaCheckbox=function(e){return console.log("props : ",e),a.jsx(ee.default.Fragment,{children:a.jsx(ae.default,{label:e.label,control:a.jsx(ne.default,{style:{color:e.color||null},defaultChecked:e.defaultValue})})})},exports.HawaDialog=function(t){var r=Ye(e.useState(!1),2);return r[0],r[1],a.jsxs(Ze.default,Je(Je({},t),{},{variant:"main",children:[a.jsx(gt,{onClose:t.onClose,hideClose:t.hideClose,children:t.title}),a.jsx(_e.default,{children:t.children}),a.jsx($e.default,{children:t.actions})]}))},exports.HawaInputLabel=function(e){return a.jsx(ue.default,{children:a.jsx("div",{style:{fontSize:15},children:e.label})})},exports.HawaItemCard=function(e){var t="ar"===e.lang;return a.jsxs(ie.default,{onClick:function(t){t.stopPropagation(),console.log("clicking parent"),e.onCardClick()},maxWidth:"xs",variant:"card-container",dataValue:"parent",style:{direction:t?"rtl":"ltr"},children:[e.header&&a.jsxs(ie.default,{style:{zIndex:20},variant:"card-header",children:[e.headerActions&&a.jsx("div",{style:{margin:0,marginRight:-20,marginLeft:-20,marginBottom:-20,display:"flex",paddingTop:5,paddingLeft:5,paddingRight:5,justifyContent:"flex-end"},children:e.headerActions}),e.header]}),e.content&&a.jsx(ie.default,{style:{zIndex:20},variant:"card-content",children:e.content}),e.actions&&a.jsx(ie.default,{style:{zIndex:20},variant:"card-actions",children:e.actions})]})},exports.HawaLogoButton=ot,exports.HawaPricingCard=function(e){var t,r,l="ar"===e.lang,n={monthly:"شهرياً","3-months":"كل 3 أشهر","6-months":"كل 6 أشهر",annually:"سنوياً"},i={monthly:"Monthly","3-months":"3 Months","6-months":"6 Months",annually:"Annually"},o={usd:l?"دولار":"$",sar:l?"ريال":"SAR"},s=l?e.features_ar:e.features;return a.jsxs(ie.default,{maxWidth:"xs",variant:e.selectedPlan?"selected-plan-card":"plan-card",style:{direction:l?"rtl":"ltr"},children:[a.jsxs(ie.default,{variant:"plan-header",children:[a.jsx(oe.default,{variant:"h3",fontWeight:500,children:l?e.title_ar:e.title}),a.jsx(oe.default,{variant:"caption",children:l?e.subtitle_ar:e.subtitle}),a.jsx("br",{}),a.jsx(oe.default,{variant:"h4",fontWeight:500,style:{display:"flex",alignItems:"center"},children:"ar"===e.lang?a.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[a.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.price,a.jsx("div",{style:{width:5}}),a.jsx(oe.default,{children:o[null===(t=e.currency)||void 0===t?void 0:t.toLowerCase()]})]}),a.jsx(oe.default,{style:{fontSize:14,margin:5},children:l?n[e.cycleText]:i[e.cycleText]})]}):a.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[a.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[a.jsx(oe.default,{children:o[null===(r=e.currency)||void 0===r?void 0:r.toLowerCase()]}),a.jsx("div",{style:{width:5}}),e.price]}),a.jsx(oe.default,{style:{fontSize:14,margin:5},children:"ar"===e.lang?n[e.cycleText]:i[e.cycleText]})]})})]}),a.jsx("div",{style:{padding:20,color:e.selectedPlan?"white":"black"},children:null==s?void 0:s.map((function(e){return a.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",marginTop:10,width:"100%"},children:[a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",width:"10%"},children:a.jsx(se.default,{fontSize:"small"})}),a.jsx("div",{style:{width:10}}),a.jsx(oe.default,{variant:"subtitle2",children:e})]})}))}),a.jsx(te.default,{onClick:e.selectPlan,variant:e.selectedPlan?"outlined":"contained",style:{margin:20},children:e.buttonText})]})},exports.HawaRadio=rt,exports.HawaSelect=st,exports.HawaSettingsRow=it,exports.HawaTable=ut,exports.HawaTextField=at,exports.HawaTypography=lt,exports.NewPasswordForm=function(t){var r=Ye(e.useState(""),2);r[0],r[1];var l=Ye(e.useState(""),2);l[0],l[1];var n=Ye(e.useState(!1),2),i=n[0],o=n[1],s=q.useForm(),d=s.formState.errors,u=s.handleSubmit,c=s.control;return a.jsxs(ie.default,{maxWidth:"xs",variant:"auth",children:[i&&a.jsx(dt,{text:t.texts.passwordMatchError,severity:"error"}),t.passwordChanged?a.jsx(lt,{style:{textAlign:"center",margin:5},children:t.texts.passwordChanged}):a.jsx(q.FormProvider,Je(Je({},s),{},{children:a.jsxs("form",{onSubmit:u((function(e){console.log("handling subb",e),e.password===e.confirmPassword?t.handleNewPassword():o(!0)})),children:[a.jsx(q.Controller,{control:c,name:"password",render:function(e){var r,l,n=e.field;return a.jsx(at,Je({fullWidth:!0,type:"password",value:null!==(r=n.value)&&void 0!==r?r:"",label:t.texts.passwordLabel,placeholder:t.texts.passwordPlaceholder,helperText:null===(l=d.password)||void 0===l?void 0:l.message,startAdornment:a.jsx(Pe.default,{position:"start",children:a.jsx(qe.default,{})})},n))},rules:{required:t.texts.passwordRequiredText}}),a.jsx(q.Controller,{control:c,name:"confirmPassword",render:function(e){var r,l,n=e.field;return a.jsx(at,Je({fullWidth:!0,type:"password",value:null!==(r=n.value)&&void 0!==r?r:"",label:t.texts.confirmPasswordLabel,placeholder:t.texts.confirmPasswordPlaceholder,helperText:null===(l=d.confirmPassword)||void 0===l?void 0:l.message,startAdornment:a.jsx(Pe.default,{position:"start",children:a.jsx(qe.default,{})})},n))},rules:{required:t.texts.confirmPasswordRequiredText}}),a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",children:t.texts.updatePassword})]})}))]})},exports.OfflineBanner=function(e){return a.jsx(Te.default,{variant:"danger",open:e.open,onClose:e.handleClose,children:a.jsxs(pe.default,{icon:!1,severity:"error",variant:"offline",children:[e.title&&a.jsx(ve.default,{children:e.title}),e.text]})})},exports.PayWithWallet=function(e){return a.jsxs(ie.default,{maxWidth:"xs",children:[a.jsx(oe.default,{align:"center",children:"Wallet Balance"}),a.jsxs(oe.default,{align:"center",variant:"h1",children:[e.walletBalance||"0",a.jsx(oe.default,{children:e.currency||"SAR"})]}),a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithWallet,children:"Pay Now"})]})},exports.ResetPasswordForm=function(e){var t=q.useForm(),r=t.formState.errors,l=t.handleSubmit;t.register;var n=t.control;return a.jsx(ie.default,{maxWidth:"xs",variant:"auth",children:e.sent?a.jsx(lt,{style:{textAlign:"center",margin:5},children:e.emailSentText}):a.jsxs("form",{onSubmit:l(e.handleResetPassword),children:[a.jsx(q.Controller,{control:n,name:"email",render:function(t){var l,n,i=t.field;return a.jsx(at,Je({fullWidth:!0,type:"text",value:null!==(l=i.value)&&void 0!==l?l:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:a.jsx(Pe.default,{position:"start",children:a.jsx(Se.default,{})})},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.resetPassword})]})})},exports.SelectPayment=function(e){return a.jsxs(ie.default,{maxWidth:"xs",children:[a.jsx(lt,{align:"center",children:"Choose Payment Method"}),e.viaWallet&&a.jsx(ot,{logo:"wallet",buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&a.jsx(ot,{logo:"visa/master",buttonText:e.visaMasterLabel,onClick:e.handleCreditCard}),e.viaMada&&a.jsx(ot,{logo:"mada",buttonText:e.madaLabel,onClick:e.handleMada}),e.viaSTCPay&&a.jsx(ot,{logo:"stcpay",buttonText:e.stcPayLabel,onClick:e.handleSTCPay}),e.viaPayPal&&a.jsx(ot,{logo:"paypal",buttonText:e.paypalLabel,onClick:e.handlePayPal}),e.viaGooglePay&&a.jsx(ot,{logo:"googlepay",buttonText:e.googlePayLabel,onClick:e.handleGooglePay}),e.viaApplePay&&a.jsx(ot,{logo:"applepay",buttonText:e.applePayLabel,onClick:e.handleApplePay})]})},exports.SignInForm=function(e){var t=q.useForm(),r=t.formState.errors,l=t.handleSubmit,n=t.control;return a.jsxs(ie.default,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&a.jsx(dt,{title:e.errorTitle,text:e.errorText,severity:"error"}),a.jsxs("form",{onSubmit:l(e.handleSignIn),children:[a.jsx(q.Controller,{control:n,name:"email",render:function(t){var l,n,i=t.field;return a.jsx(at,Je({fullWidth:!0,type:"text",value:null!==(l=i.value)&&void 0!==l?l:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:a.jsx(Pe.default,{position:"start",children:a.jsx(Se.default,{})})},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),a.jsx(q.Controller,{control:n,name:"password",render:function(t){var l,n,i,o=t.field;return a.jsx(at,Je({fullWidth:!0,type:"password",defaultValue:null!==(l=o.value)&&void 0!==l?l:"",value:null!==(n=o.value)&&void 0!==n?n:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message,startAdornment:a.jsx(Pe.default,{position:"start",children:a.jsx(qe.default,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),a.jsx(oe.default,{style:{cursor:"pointer",marginTop:5,width:"max-content",fontSize:15,padding:5},onClick:e.handleForgotPassword,children:e.texts.forgotPasswordText}),a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.signInText})]}),a.jsxs(oe.default,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.newUserText," ",a.jsx("span",{onClick:e.handleRouteToSignUp,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signUpText})]}),a.jsx(We.default,{}),a.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&a.jsx(ot,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignIn}),e.viaGithub&&a.jsx(ot,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignIn}),e.viaTwitter&&a.jsx(ot,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignIn})]})]})},exports.SignUpForm=ct,exports.UserProfileForm=function(e){var t=q.useForm(),r=t.formState.errors,l=t.handleSubmit,n=t.control;return a.jsx(ie.default,{maxWidth:"sm",children:a.jsx(q.FormProvider,Je(Je({},t),{},{children:a.jsxs("form",{onSubmit:l(e.handleUpdateProfile),children:[a.jsx(q.Controller,{control:n,name:"fullName",render:function(t){var l,n,i=t.field;return a.jsx(at,Je({fullWidth:!0,type:"text",value:null!==(l=i.value)&&void 0!==l?l:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(n=r.fullName)||void 0===n?void 0:n.message},i))}}),a.jsx(q.Controller,{control:n,name:"phoneNumber",render:function(e){var t=e.field;return a.jsx(at,Je({fullWidth:!0,type:"tel",label:"Phone Number",placeholder:"+966"},t))}}),a.jsx(q.Controller,{control:n,name:"email",render:function(t){var l,n,i=t.field;return a.jsx(at,Je({fullWidth:!0,type:"text",value:null!==(l=i.value)&&void 0!==l?l:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),a.jsx(q.Controller,{control:n,name:"password",render:function(t){var l,n,i=t.field;return a.jsx(at,Je({fullWidth:!0,type:"password",value:null!==(l=i.value)&&void 0!==l?l:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=r.password)||void 0===n?void 0:n.message},i))},rules:{required:e.texts.passwordRequiredText}}),a.jsx(q.Controller,{control:n,name:"confirmPassword",render:function(t){var l,n,i=t.field;return a.jsx(at,Je({fullWidth:!0,type:"password",value:null!==(l=i.value)&&void 0!==l?l:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(n=r.confirmPassword)||void 0===n?void 0:n.message},i))},rules:{required:e.texts.confirmPasswordRequiredText}}),a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",children:"update profile"})," "]})}))})},exports.UserSettingsForm=function(e){return a.jsxs(ie.default,{maxWidth:"sm",children:[e.children,a.jsx(te.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSaveSettings,children:e.saveSettingsText})]})};
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@ export const NewPasswordForm = (props) => {
|
|
|
33
33
|
)}
|
|
34
34
|
{props.passwordChanged ? (
|
|
35
35
|
<HawaTypography style={{ textAlign: "center", margin: 5 }}>
|
|
36
|
-
|
|
36
|
+
{props.texts.passwordChanged}
|
|
37
37
|
</HawaTypography>
|
|
38
38
|
) : (
|
|
39
39
|
<FormProvider {...methods}>
|
|
@@ -16,15 +16,8 @@ export const ResetPasswordForm = (props) => {
|
|
|
16
16
|
} = methods;
|
|
17
17
|
return (
|
|
18
18
|
<Container maxWidth="xs" variant="auth">
|
|
19
|
-
{props.error && (
|
|
20
|
-
<Alert severity="error">
|
|
21
|
-
{props.errorTitle && <AlertTitle>{props.errorTitle}</AlertTitle>}
|
|
22
|
-
{props.errorText}
|
|
23
|
-
</Alert>
|
|
24
|
-
)}
|
|
25
19
|
{!props.sent ? (
|
|
26
20
|
<form onSubmit={handleSubmit(props.handleResetPassword)}>
|
|
27
|
-
{console.log("eror ", errors.email?.message)}
|
|
28
21
|
<Controller
|
|
29
22
|
control={control}
|
|
30
23
|
name="email"
|
|
@@ -59,7 +52,7 @@ export const ResetPasswordForm = (props) => {
|
|
|
59
52
|
</form>
|
|
60
53
|
) : (
|
|
61
54
|
<HawaTypography style={{ textAlign: "center", margin: 5 }}>
|
|
62
|
-
|
|
55
|
+
{props.emailSentText}
|
|
63
56
|
</HawaTypography>
|
|
64
57
|
)}
|
|
65
58
|
</Container>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { HawaTextField, HawaLogoButton } from "../../elements";
|
|
3
|
-
import { Controller,
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HawaTextField, HawaLogoButton, HawaAlert } from "../../elements";
|
|
3
|
+
import { Controller, useForm } from "react-hook-form";
|
|
4
4
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
5
5
|
import EmailIcon from "@mui/icons-material/MailOutline";
|
|
6
6
|
import PasswordIcon from "@mui/icons-material/HttpsOutlined";
|
|
@@ -16,7 +16,6 @@ export const SignInForm = (props) => {
|
|
|
16
16
|
const {
|
|
17
17
|
formState: { errors },
|
|
18
18
|
handleSubmit,
|
|
19
|
-
register,
|
|
20
19
|
control
|
|
21
20
|
} = methods;
|
|
22
21
|
|
|
@@ -26,11 +25,12 @@ export const SignInForm = (props) => {
|
|
|
26
25
|
variant="auth"
|
|
27
26
|
style={{ direction: props.lang === "ar" ? "rtl" : "ltr" }}
|
|
28
27
|
>
|
|
29
|
-
{props.
|
|
30
|
-
<
|
|
31
|
-
{props.errorTitle
|
|
32
|
-
{props.errorText}
|
|
33
|
-
|
|
28
|
+
{props.showError && (
|
|
29
|
+
<HawaAlert
|
|
30
|
+
title={props.errorTitle}
|
|
31
|
+
text={props.errorText}
|
|
32
|
+
severity="error"
|
|
33
|
+
/>
|
|
34
34
|
)}
|
|
35
35
|
<form onSubmit={handleSubmit(props.handleSignIn)}>
|
|
36
36
|
<Controller
|
|
@@ -28,7 +28,7 @@ export const SignUpForm = (props) => {
|
|
|
28
28
|
style={{ direction: props.lang === "ar" ? "rtl" : "ltr" }}
|
|
29
29
|
>
|
|
30
30
|
{props.error && (
|
|
31
|
-
<Alert severity="error">
|
|
31
|
+
<Alert severity="error" variant="inContainer">
|
|
32
32
|
{props.errorTitle && <AlertTitle>{props.errorTitle}</AlertTitle>}
|
|
33
33
|
{props.errorText}
|
|
34
34
|
</Alert>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { HawaTextField } from "../../elements";
|
|
3
|
-
import { FormProvider, useForm } from "react-hook-form";
|
|
3
|
+
import { Controller, FormProvider, useForm } from "react-hook-form";
|
|
4
4
|
import Button from "@mui/material/Button";
|
|
5
5
|
import Container from "@mui/material/Container";
|
|
6
6
|
|
|
@@ -8,59 +8,109 @@ export const CreditCardForm = (props) => {
|
|
|
8
8
|
const methods = useForm();
|
|
9
9
|
const {
|
|
10
10
|
formState: { errors },
|
|
11
|
-
handleSubmit
|
|
11
|
+
handleSubmit,
|
|
12
|
+
control
|
|
12
13
|
} = methods;
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<Container maxWidth="xs">
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/>
|
|
17
|
+
<form onSubmit={handleSubmit(props.handle)}>
|
|
18
|
+
<HawaTextField
|
|
19
|
+
fullWidth
|
|
20
|
+
name="password"
|
|
21
|
+
placeholder="Enter password"
|
|
22
|
+
type="tel"
|
|
23
|
+
label="Card Number"
|
|
24
|
+
// variant="unscrollable"
|
|
25
|
+
// startAdornment={
|
|
26
|
+
// <InputAdornment position="start">
|
|
27
|
+
// <PasswordIcon />
|
|
28
|
+
// </InputAdornment>
|
|
29
|
+
// }
|
|
30
|
+
rules={{
|
|
31
|
+
required: "Password is rquired"
|
|
32
|
+
}}
|
|
33
|
+
helperText={errors.password?.message}
|
|
34
|
+
/>
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
|
|
37
|
+
<Controller
|
|
38
|
+
control={control}
|
|
39
|
+
name="cardName"
|
|
40
|
+
render={({ field }) => (
|
|
41
|
+
<HawaTextField
|
|
42
|
+
fullWidth
|
|
43
|
+
name="password"
|
|
44
|
+
placeholder="Enter password"
|
|
45
|
+
type="password"
|
|
46
|
+
label="Name On Card"
|
|
47
|
+
// startAdornment={
|
|
48
|
+
// <InputAdornment position="start">
|
|
49
|
+
// <PasswordIcon />
|
|
50
|
+
// </InputAdornment>
|
|
51
|
+
// }
|
|
52
|
+
rules={{
|
|
53
|
+
required: "Password is rquired"
|
|
54
|
+
}}
|
|
55
|
+
helperText={errors.password?.message}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
/>
|
|
59
|
+
<Controller
|
|
60
|
+
control={control}
|
|
61
|
+
name="cardName"
|
|
62
|
+
render={({ field }) => (
|
|
63
|
+
<HawaTextField
|
|
64
|
+
fullWidth
|
|
65
|
+
name="password"
|
|
66
|
+
placeholder="Enter password"
|
|
67
|
+
type="password"
|
|
68
|
+
label="Expiry Date"
|
|
69
|
+
// startAdornment={
|
|
70
|
+
// <InputAdornment position="start">
|
|
71
|
+
// <PasswordIcon />
|
|
72
|
+
// </InputAdornment>
|
|
73
|
+
// }
|
|
74
|
+
rules={{
|
|
75
|
+
required: "Password is rquired"
|
|
76
|
+
}}
|
|
77
|
+
helperText={errors.password?.message}
|
|
78
|
+
/>
|
|
79
|
+
)}
|
|
80
|
+
/>
|
|
81
|
+
<Controller
|
|
82
|
+
control={control}
|
|
83
|
+
name="cardName"
|
|
84
|
+
render={({ field }) => (
|
|
85
|
+
<HawaTextField
|
|
86
|
+
fullWidth
|
|
87
|
+
name="password"
|
|
88
|
+
placeholder="Enter password"
|
|
89
|
+
type="password"
|
|
90
|
+
label="CCV"
|
|
91
|
+
// startAdornment={
|
|
92
|
+
// <InputAdornment position="start">
|
|
93
|
+
// <PasswordIcon />
|
|
94
|
+
// </InputAdornment>
|
|
95
|
+
// }
|
|
96
|
+
rules={{
|
|
97
|
+
required: "Password is rquired"
|
|
98
|
+
}}
|
|
99
|
+
helperText={errors.password?.message}
|
|
100
|
+
/>
|
|
101
|
+
)}
|
|
102
|
+
/>
|
|
52
103
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</FormProvider>
|
|
104
|
+
<Button
|
|
105
|
+
type="submit"
|
|
106
|
+
fullWidth
|
|
107
|
+
variant="last"
|
|
108
|
+
onClick={props.handlePayWithCreditCard}
|
|
109
|
+
>
|
|
110
|
+
{/* {props.texts.signInText} */}
|
|
111
|
+
{"Pay with Credit Card"}
|
|
112
|
+
</Button>
|
|
113
|
+
</form>
|
|
64
114
|
</Container>
|
|
65
115
|
);
|
|
66
116
|
};
|