https://www.florista.ph/_next/static/chunks/pages/user-dashboard/change-password-7827da50a0574ab4.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4211],{2092:function(e,s,t){"use strict";t.d(s,{Z:function(){return n}});var a=t(7294);function n(){return(0,a.useState)(null)}},6655:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user-dashboard/change-password",function(){return t(1813)}])},7270:function(e,s,t){"use strict";var a=t(5893);t(7294),t(822),s.Z=function(e){let{messageData:s}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{style:{zIndex:1},children:(0,a.jsx)("div",{className:"alert alert-info developer-send-otp-msg",role:"alert",children:(0,a.jsx)("p",{children:(0,a.jsx)("small",{children:(0,a.jsx)("span",{className:"developer-msg",children:"OTP has been sent your email & mobile no."})})})})})})}},5781:function(e,s,t){"use strict";var a=t(5893);t(7294);var n=t(8172),r=t.n(n);let l=e=>{let{name:s,loading:t,progress:l,type:i,classname:o,buttonClick:d,id:c,buttonSize:u}=e,p=e=>{d&&d(e)};return"submit"===i?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(r(),{progress:l,loading:t,type:i,className:o,"data-size":u&&"m"!==u?u:n.S,"data-style":n.SLIDE_UP,onClick:p,"data-spinner-size":40,children:s})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(r(),{progress:l,loading:t,type:i,className:o,"data-size":u&&"m"!==u?u:n.S,"data-style":n.SLIDE_UP,onClick(e){d(e)},id:c,children:s})})};s.Z=l},6679:function(e,s,t){"use strict";var a=t(5893),n=t(7294),r=t(6188),l=t(9359),i=t(822);t(1664);let o=e=>{let{redirectData:s,setOTP:t,reset:o}=e,[d,c]=(0,n.useState)(30),[u,p]=(0,n.useState)(!1),[m,v]=(0,n.useState)(!1),[f,h]=(0,n.useState)(!1),g=async()=>{if(h(!0),d>=30||d<=0){let e={};e.data={},e.data.validate_string=null==s?void 0:s.email,e.data.page=null==s?void 0:s.page;let a=await new r.Z().customerResendOTP(e);(null==a?void 0:a.status)===l.Z.SUCCESS_STATUS?(p(!0),v(!m),t(null),i.Z.Message({message:a.message,type:"success"}),c(30),o()):(i.Z.Message({message:a.message,type:"error"}),h(!1))}};return(0,n.useEffect)(()=>{let e;return u&&d>0?e=setInterval(()=>{c(e=>e-1)},1e3):0===d&&(clearInterval(e),h(!1)),()=>clearInterval(e)},[u,d,m]),(0,a.jsxs)(a.Fragment,{children:[(d>=30||d<=0)&&(0,a.jsxs)("button",{style:{cursor:"pointer",border:"0px",backgroundColor:"white"},onClick:g,className:"resend-otp devloper-decoration cursor",disabled:!!f,children:[(0,a.jsx)("i",{className:"fa-solid fa-rotate"})," Resend OTP"]}),d<30&&d>0&&(0,a.jsxs)("small",{children:["Resend in ",d," seconds"]})]})};s.Z=o},4758:function(e,s,t){"use strict";var a=t(5893);t(7294);var n=t(6080),r=t(3489);s.Z=function(e){let{marginRegister:s}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(n.Z,{placement:"bottom",overlay:(0,a.jsx)(r.Z,{id:"tooltip-bottom",children:(0,a.jsxs)("div",{className:"password-description",style:{backgroundColor:"black"},children:[(0,a.jsx)("h3",{children:"Password Must"}),(0,a.jsx)("p",{children:"Be at least 8 characters long."}),(0,a.jsx)("p",{children:"Contain at least one uppercase letter."}),(0,a.jsx)("p",{children:"Contain at least one lowercase letter."}),(0,a.jsx)("p",{children:"Contain at least one number."}),(0,a.jsx)("p",{children:"Contain at least one special character(!@#$%^&*)."})]})}),children:(0,a.jsx)("div",{style:{margin:s?s.margin:"-34px 4px",position:(null==s?void 0:s.position)?s.position:"relative",display:(null==s?void 0:s.display)?null==s?void 0:s.display:""},children:(0,a.jsx)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42
118.841-42 42-42 42 18.841 42 42z"})})})},"bottom")})}},1813:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return y}});var a=t(5893),n=t(7294),r=t(7536),l=t(6188),i=t(822),o=t(1163),d=t(9359),c=function(e){return"object"==typeof e&&null!==e},u=function(e){var s=e.value,t=void 0===s?"":s,a=e.numInputs,r=void 0===a?4:a,l=e.onChange,i=e.renderInput,o=e.shouldAutoFocus,d=void 0!==o&&o,u=e.inputType,p=void 0===u?"text":u,m=e.renderSeparator,v=e.placeholder,f=e.containerStyle,h=e.inputStyle,g=n.useState(0),x=g[0],j=g[1],w=n.useRef([]),y=function(){return t?t.toString().split(""):[]},S="number"===p||"tel"===p;n.useEffect(function(){w.current=w.current.slice(0,r)},[r]),n.useEffect(function(){var e;d&&(null===(e=w.current[0])||void 0===e||e.focus())},[d]);var N=function(){if("string"==typeof v){if(v.length===r)return v;v.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},b=function(e){return(S?!isNaN(Number(e)):"string"==typeof e)&&1===e.trim().length},C=function(e){var s=e.target.value;if(b(s))Z(s),P(x+1);else{var t=e.nativeEvent;null===t.data&&"deleteContentBackward"===t.inputType&&(e.preventDefault(),Z(""),P(x-1))}},_=function(){j(x-1)},E=function(e){var s=y();[e.code,e.key].includes("Backspace")?(e.preventDefault(),Z(""),P(x-1)):"Delete"===e.code?(e.preventDefault(),Z("")):"ArrowLeft"===e.code?(e.preventDefault(),P(x-1)):"ArrowRight"===e.code?(e.preventDefault(),P(x+1)):e.key===s[x]?(e.preventDefault(),P(x+1)):"Spacebar"===e.code||"Space"===e.code||"ArrowUp"===e.code||"ArrowDown"===e.code?e.preventDefault():S&&!b(e.key)&&e.preventDefault()},P=function(e){var s,t,a=Math.max(Math.min(r-1,e),0);w.current[a]&&(null===(s=w.current[a])||void 0===s||s.focus(),null===(t=w.current[a])||void 0===t||t.select(),j(a))},Z=function(e){var s=y();s[x]=e[0],R(s)},R=function(e){l(e.join(""))},D=function(e){e.preventDefault();var s,t=y(),a=x,n=e.clipboardData.getData("text/plain").slice(0,r-x).split("");if(!(S&&n.some(function(e){return isNaN(Number(e))}))){for(var l=0;l<r;++l)l>=x&&n.length>0&&(t[l]=null!==(s=n.shift())&&void 0!==s?s:"",a++);P(a),R(t)}};return n.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},c(f)&&f),className:"string"==typeof f?f:void 0},Array.from({length:r},function(e,s){return s}).map(function(e){var s,t,a;return n.createElement(n.Fragment,{key:e},i({value:null!==(s=y()[e])&&void 0!==s?s:"",placeholder:null!==(a=null===(t=N())||void 0===t?void 0:t[e])&&void 0!==a?a:void 0,ref:function(s){return w.current[e]=s},onChange:C,onFocus:function(s){j(e),s.target.select()},onBlur:_,onKeyDown:E,onPaste:D,autoComplete:"off",maxLength:1,"aria-label":"Please enter OTP character ".concat(e+1),style:Object.assign({width:"1em",textAlign:"center"},c(h)&&h),className:"string"==typeof h?h:void 0,type:p},e),e<r-1&&("function"==typeof m?m(e):m))}))},p=t(5781),m=t(6679),v=t(7270),f=t(4758),h=t(3299),g=t(9008),x=t.n(g),j=t(9734);let w=e=>{var s,t,c,g;let{}=e,[w,y]=(0,n.useState)(),[S,N]=(0,n.useState)(!1),[b,C]=(0,n.useState)(0),[_,E]=(0,n.useState)(),{push:P}=(0,o.useRouter)(),{register:Z,handleSubmit:R,setError:D,clearErrors:T,watch:A,reset:O,formState:{errors:k}}=(0,r.cI)(),[I,U]=(0,n.useState)(null),{data:F}=(0,h.useSession)(),{data:M,error:z}=(0,j.ZP)("/CustomerForgetPassword",async()=>{var e;return new l.Z().CustomerForgetPassword({data:{email:null==F?void 0:null===(e=F.user)||void 0===e?void 0:e.email}})},{revalidateOnFocus:!1});(0,n.useEffect)(()=>{E(null==JSON?void 0:JSON.parse(localStorage.getItem("userData")))},[]),(0,n.useEffect)(()=>{y(null==F?void 0:F.user)},[]),(0,n.useEffect)(()=>{if(null==_?void 0:_.email){let e={};e.data={},e.data.validate_string=null==_?void 0:_.email,e.data.page="forgot_password",new l.Z().customerResendOTP(e)}},[null==_?void 0:_.email]);let[B,L]=(0,n.useState)(!1),W=()=>{L(!B)}
1,[$,q]=(0,n.useState)(!1),Q=()=>{q(!$)},X=async e=>{if(null===I||""===I)D("otp",{type:"custom",message:d.Z.OTP_REQUIRED});else{var s,t,a,n;N(!0),C(0);let r=setInterval(()=>{C(e=>e+.1)},500),o={};o.data=e,o.data.validate_string=null==F?void 0:null===(s=F.user)||void 0===s?void 0:s.email,o.data.otp=I;let c=await new l.Z().customerResetPassword(o);(null==c?void 0:c.status)===d.Z.SUCCESS_STATUS?(N(!1),C(1),clearInterval(r),i.Z.Message({message:c.message,type:d.Z.SUCCESS_STATUS}),P("/user-dashboard/dashboard")):(N(!1),D("otp",{type:"custom",message:Array.isArray(null==c?void 0:null===(t=c.message)||void 0===t?void 0:t.otp)?null==c?void 0:c.message.otp[0]:""}),D("password",{type:"custom",message:Array.isArray(null==c?void 0:null===(a=c.message)||void 0===a?void 0:a.password)?null==c?void 0:c.message.password[0]:""}),D("confirm_password",{type:"custom",message:Array.isArray(null==c?void 0:null===(n=c.message)||void 0===n?void 0:n.confirm_password)?null==c?void 0:c.message.confirm_password[0]:""}),i.Z.Message({message:c.message,type:d.Z.ERROR_STATUS}))}},J=e=>{U(e),T("otp")};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(x(),{children:[(0,a.jsx)("title",{children:"Change Password"}),(0,a.jsx)("meta",{property:"og:title",content:"Change Password"},"title")]}),(0,a.jsx)("div",{className:"container-fluid",children:(0,a.jsx)("div",{className:"col-md-12",children:(0,a.jsxs)("div",{className:"change-password-section",children:[(0,a.jsxs)("form",{id:"change-password-form",onSubmit:R(X),children:[(0,a.jsx)(v.Z,{messageData:null==F?void 0:null===(s=F.user)||void 0===s?void 0:s.email}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsxs)("label",{children:["OTP",(0,a.jsx)("span",{className:"text-danger",children:"*"})]}),(0,a.jsx)(u,{onChange:J,value:I,inputStyle:{width:"40px"},numInputs:6,inputType:"tel",containerStyle:"developer-otp-section",renderInput:e=>(0,a.jsx)("input",{...e})}),(0,a.jsx)("div",{style:{marginLeft:"39%"},children:(0,a.jsx)(m.Z,{redirectData:{...null==F?void 0:F.user,page:"forgot_password"},setOTP:U,reset:O})}),(null==k?void 0:k.otp)&&(0,a.jsx)("small",{className:"text-danger",children:null==k?void 0:null===(t=k.otp)||void 0===t?void 0:t.message})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsxs)("label",{children:["New Password",(0,a.jsx)("span",{className:"text-danger",children:"*"}),(0,a.jsx)(f.Z,{marginRegister:{margin:"5px 4px",position:"absolute",display:"inline-grid"}})]}),(0,a.jsx)("div",{children:(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("input",{autoComplete:"new-password",...Z("password",{required:d.Z.PASSWORD_REQUIRED,pattern:{value:d.Z.PASSWORD_REGEX,message:d.Z.PASSWORD_PATTERN}}),type:"".concat(B?"text":"password"),placeholder:"Enter New Password"}),(0,a.jsx)("div",{style:{position:"absolute",top:"12px",right:"15px"},onClick:()=>W(),children:B?(0,a.jsx)("i",{className:"fa-solid fa-eye fa-lg"}):(0,a.jsx)("i",{className:"fa-sharp fa-solid fa-eye-slash fa-lg"})})]})}),(null==k?void 0:k.password)&&(0,a.jsx)("small",{className:"text-danger",children:null==k?void 0:null===(c=k.password)||void 0===c?void 0:c.message})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsxs)("label",{children:["Re-type Password",(0,a.jsx)("span",{className:"text-danger",children:"*"})]}),(0,a.jsxs)("div",{style:{width:"100%",position:"relative"},children:[(0,a.jsx)("input",{autoComplete:"new-password",...Z("confirm_password",{required:d.Z.CONFIRMED_PASSWORD_REQUIRED,validate(e){if(A("password")!=e)return d.Z.PASSWORD_MATCH}}),type:"".concat($?"text":"password"),placeholder:"Re-Enter New Password"}),(0,a.jsx)("div",{style:{position:"absolute",top:"12px",right:"15px"},onClick:()=>Q(),children:$?(0,a.jsx)("i",{className:"fa-solid fa-eye fa-lg"}):(0,a.jsx)("i",{className:"fa-sharp fa-solid fa-eye-slash fa-lg"})})]}),(null==k?void 0:k.confirm_password)&&(0,a.jsx)("small",{className:"text-danger",children:null==k?void 0:null===(g=k.confirm_password)||void 0===g?void 0:g.message})]}),(0,a.jsx)(p.Z,{name:"SUBMIT",type:"submit",progress:b,loading:S,classname:"btn btn-primary black-btn"})]}),(0,a.jsxs)("div",{className:"password-description",children:[(0,a.jsx)("h3",{children:"Password Must"}),(0,a.jsx)("p",{children:"Be at least 8 characters long."}),(0,a.jsx)("p",{children:"Contain at least one uppercase letter."}),(0,a.jsx)("p",{children:"Contain at least one lowercase letter."}),(0,a.jsx)("p",{children:"Contain at least one number."}),(0,a.jsx)("p",{children:"Contain at least one special character(!@#$%^&*)."})]})]})})})]})};var y=w},3489:function(e,s,t){"use strict";var a=t(4184),n=t.n(a),r=t(7294),l=t(6792),i=t(9883),o=t(3706),d=t(5893);let c=r.forwardRef(({bsPrefix:e,placement:s,className:t,style:a,children:r,arrowProps:c,hasDoneInitialMeasure:u,popper:p,show:m,...v},f)=>{e=(0,l.vE)(e,"tooltip");let h=(0,l.SC)(),[g]=(null==s?void 0:s.split("-"))||[],x=(0,i.z)(g,h),j=a;return m&&!u&&(j={...a,...(0,o.Z)(null==p?void 0:p.strategy)}),(0,d.jsxs)("div",{ref:f,style:j,role:"tooltip","x-placement":g,className:n()(t,e,`bs-tooltip-${x}`),...v,children:[(0,d.jsx)("div",{className:"tooltip-arrow",...c}),(0,d.jsx)("div",{className:`${e}-inner`,children:r})]})});c.defaultProps={placement:"right"},c.displayName="Tooltip",s.Z=c}},function(e){e.O(0,[8172,7536,6080,9774,2888,179],function(){return e(e.s=6655)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.