PageSourceSearch

https://osirus.ai/_next/static/chunks/pages/settings/profile/change-password-1496e720cd55a5e3.js

js osirus.ai collected 2026-10-05 12:25:12 UTC 14,283 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2550],{8196:(e,s,t)=>{"use strict";t.d(s,{k:()=>o});var r=t(14232),i=t(4847),n=t(63408),a=t(79641);let l=[{label:"Profile",href:"/settings/profile",icon:"bi bi-person-circle"},{label:"Billing",href:"/settings/billing",icon:"bi bi-wallet2",businessAdminOnly:!0},{label:"Usage",href:"/settings/usage",icon:"bi bi-bar-chart-line",businessAdminOnly:!0},{label:"Organizations",href:"/settings/organizations",icon:"bi bi-buildings",personalOnly:!0,businessAdminOnly:!0},{label:"Sites",href:"/settings/sites",icon:"bi bi-globe2",businessAdminOnly:!0},{label:"Subscriptions",href:"/settings/subscriptions",icon:"bi bi-collection",businessAdminOnly:!0},{label:"Tokens",href:"/settings/tokens",icon:"bi bi-key"}],o=()=>{let{activeOrgId:e,user:s,isConnected:t,isDataLoaded:o}=(0,i.G)(n.Fk),c=!s?.id||!t||!o,{data:d}=(0,a.le)(void 0,{skip:c,refetchOnMountOrArgChange:!0}),{data:u}=(0,a.u8)(void 0,{skip:c,refetchOnMountOrArgChange:!0});return(0,r.useMemo)(()=>{let t=u?.orgId??e??null;if(!t)return[];let r=(d??[]).find(e=>e.orgId===t),i=r?.org,n=i?.orgType??i?.org_type;if(!r)return[];if("personal"===n)return l;let a=!!i?.ownerId&&i.ownerId===s?.id,o=s?.isSystemAdmin===!0||"ADMIN"===String(s?.systemRole||"").toUpperCase(),c=a||o;return c?l.filter(e=>!e.personalOnly&&(!e.businessAdminOnly||!!c)):[]},[e,u?.orgId,d,s?.id,s?.isSystemAdmin,s?.systemRole,t,o])}},31480:(e,s,t)=>{"use strict";t.d(s,{A:()=>m});var r=t(37876),i=t(14232),n=t(89099),a=t(91291),l=t(98043);function o(...e){return(...s)=>{for(let t of e)"function"==typeof t&&t(...s)}}function c(e,s){e.value=s,e.dispatchEvent(new Event("input",{bubbles:!0}))}function d(e,s=2){if(null==e)return"";let t=e.replace(/,/g,".").replace(/[^\d.]/g,""),r=t.indexOf(".");-1!==r&&(t=t.slice(0,r+1)+t.slice(r+1).replace(/\./g,""));let i=t.match(/^(\d*)(?:\.(\d*))?$/);if(!i)return t;let[,n="",a=""]=i;return a.length>s?`${n}.${a.slice(0,s)}`:""===n&&("."===t||""===t)?t:a?`${n}.${a}`:n}let u=e=>{if(e.ctrlKey||e.metaKey||e.altKey||["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","Home","End"].includes(e.key))return;let s=e.currentTarget;if(!/^\d$/.test(e.key)){if("."===e.key||"Decimal"===e.key||"NumpadDecimal"===e.code){s.value.includes(".")&&e.preventDefault();return}if(","===e.key){e.preventDefault(),s.value.includes(".")||function(e,s){let t=e.selectionStart??e.value.length,r=e.selectionEnd??e.value.length,i=e.value.slice(0,t)+"."+e.value.slice(r);c(e,i);let n=t+1;try{e.setSelectionRange(n,n)}catch{}}(s,0);return}e.preventDefault()}},m=({label:e,register:s,errors:t,placeholder:m,inputRef:p,getValues:h,customErrorMessage:f,type:b="text",isPassword:g=!1,helperText:x,prependInput:w,appendInput:j,className:v,inputProps:y,allowDecimal:N=!1,maxDecimals:k=2,padDecimalsOnBlur:A=!0,enableAssistant:S=!0,assistantContext:P,...I})=>{var C;let E,R=(0,n.useRouter)(),[$,T]=(0,i.useState)(!1),[F,O]=(0,i.useState)(!1),[D,M]=(0,i.useState)(!1),[_,B]=(0,i.useState)(!1),L=(0,i.useRef)(null),[K,W]=(0,i.useState)(void 0),[q,z]=(0,i.useState)(void 0),U=(0,i.useCallback)(e=>{e&&W(e.clientWidth?`${e.clientWidth-2}px`:void 0)},[]),V=(0,i.useCallback)(e=>{e&&z(e.clientWidth?`${e.clientWidth-2}px`:void 0)},[]),G=(C=s?.name||"",!(E=t?t[C]:null)&&C.includes(".")&&(E=C.split(".").reduce((e,s)=>e&&e[s],t)),E?E.message||f:null),Y=(0,i.useMemo)(()=>{let e=o(s?.onKeyDown,I.onKeyDown,y?.onKeyDown);return N?o(u,e):e},[s,I.onKeyDown,y?.onKeyDown,N]),H=(0,i.useMemo)(()=>o(N?e=>{let s=e.currentTarget,t=d(s.value,k);t!==s.value&&c(s,t)}:void 0,s?.onInput,I.onInput,y?.onInput),[s,I.onInput,y?.onInput,N,k]),X=(0,i.useMemo)(()=>o(N&&A?e=>{let s=e.currentTarget,t=function(e,s=2){let t=d(e,s);if(""===t||"."===t||"0."===t)return"";let r=Number(t);return Number.isFinite(r)&&0!==r?r.toFixed(s):""}(s.value,k);t!==s.value&&c(s,t)}:void 0,e=>s?.onBlur?.(e),I.onBlur,y?.onBlur,()=>M(!1)),[s,I.onBlur,y?.onBlur,N,A,k]),J=(0,i.useCallback)(e=>{L.current=e,p&&(p.current=e);let t=s?.ref;if(t){if("function"==typeof t)return void t(e);t.current=e}},[p,s]);(0,i.useEffect)(()=>{let e=L.current;if(!e)return;let s=()=>O(e.matches(":-webkit-autofill, :autofill")||""!==e.value);s();let t=setInterval(s,100);return()=>clearInterval(t)},[s?.name]);let Q=String(R?.asPath||R?.pathname||"").startsWith("/admin")&&S&&!N&&!g&&!I.disabled&&["text","search","email","url"].includes(String(b||"").toLowerCase()),Z=Q&&(D||_),ee=s?(({ref:e,...s})=>s)(s):void 0;return(0,r.jsxs)("div",{className:`field-container field-container--${D?"labelFloating":"labelResting"} ${G?"is-invalid":""}
1`,children:[Q&&(0,r.jsx)(l.A,{targetRef:L,visible:Z,fieldName:s?.name||e,context:P,getFormContext:h?()=>h():void 0,onFocusWithinChange:B}),(0,r.jsx)("label",{className:`field-label ${s?.name&&h&&["",null,void 0].includes(h(s.name))?"field-label--empty":""} field-label--${D||F?"floating":"resting"} ${w?"field-label--has-prepend":""}`,htmlFor:s?.name,children:e}),(0,r.jsxs)("div",{className:"position-relative",children:[w&&(0,r.jsx)("div",{ref:U,className:"field-prepend d-flex align-items-end position-absolute start-0 bottom-0 top-0 p-2 ms-1",children:w}),(0,r.jsx)("input",{ref:J,type:g?$?"text":"password":b,placeholder:m,className:`Input ${D?"Input--focused":""} ${v||""}`,style:{paddingLeft:K,paddingRight:q},...ee,...I,...y,onFocus:o("onFocus",I.onFocus,y?.onFocus,()=>M(!0)),onBlur:X,onKeyDown:Y,onInput:H}),g&&(0,r.jsx)(a.A,{onClick:()=>T(!$),className:"toggle-password no-min-size text-dark position-absolute end-0 bottom-0 top-0 p-2 me-1 z-index-1",children:(0,r.jsx)("span",{className:`bi bi-eye${$?"-slash":""}`})}),j&&(0,r.jsx)("div",{ref:V,className:"field-append d-flex align-items-center position-absolute end-0 bottom-0 top-0 p-2 me-1 z-index-1",children:j})]}),G&&(0,r.jsx)("span",{className:"invalid-feedback",children:`${G}`}),x&&(0,r.jsx)("span",{className:"small d-block mt-2",children:x})]})}},49757:(e,s,t)=>{"use strict";t.d(s,{A:()=>c});var r=t(37876),i=t(14232),n=t(89099),a=t(91291),l=t(58862),o=t(5960);let c=({messageTitle:e,showMessage:s=!1,actionLabel:t,action:c,callActionOnInit:d=!1,showCancelAction:u=!0,showSpinner:m=!0,bottomMessage:p})=>{let h=(0,n.useRouter)();return(0,i.useEffect)(()=>{d&&c&&c()},[c,d]),(0,r.jsx)("div",{className:"h-fix-screen d-flex align-items-center justify-content-center",children:(0,r.jsxs)("div",{className:`minw-md-450p d-flex align-items-center justify-content-center flex-column p-4 rounded-md position-relative ${s?"shadow bg-white":""}`,children:[u&&s&&(0,r.jsx)(a.A,{ariaLabel:"Navigate back to home",className:"no-min-size position-absolute top-0 right-0 m-2 text-white",onClick:()=>h.back(),children:(0,r.jsx)("span",{className:"bi bi-x"})}),s&&(0,r.jsx)("img",{alt:"Osirus AI Logo",src:o.PM,className:"w-xs-220p img-fluid"}),m&&(0,r.jsx)("div",{className:"my-3",children:(0,r.jsx)(l.A,{})}),s&&(0,r.jsxs)("div",{className:"text-center mt-4 mw-xs-500p",children:[(0,r.jsx)("h4",{className:"mb-4",children:e}),(0,r.jsx)(a.A,{ariaLabel:"sign up",className:"ms-2 text-white fw-bold h-50 rounded-xl",color:"primary",onClick:()=>c&&c(),children:t})]}),(0,r.jsx)("div",{className:"mt-3",children:p})]})})}},60685:(e,s,t)=>{"use strict";t.d(s,{A:()=>u});var r=t(37876),i=t(14232),n=t(48230),a=t.n(n),l=t(89099),o=t(4847),c=t(63408),d=t(49757);let u=(e,s)=>{let t=t=>{let n=(0,l.useRouter)(),{isDataLoaded:u,isConnected:m,user:p}=(0,o.G)(c.Fk),h="string"==typeof n.asPath&&n.asPath.trim().length>0?n.asPath:"/",f="/"===h?"/login":`/login?redirect=${encodeURIComponent(h)}`,[b,g]=(0,i.useState)(!1);return((0,i.useEffect)(()=>g(!0),[]),b&&u)?m?s?.needSystemAdminRole&&p?.isSystemAdmin!==!0?(0,r.jsx)(d.A,{showMessage:!0,messageTitle:"You do not have sufficient permission to access this page",actionLabel:"Go Back",action:()=>n.back(),showSpinner:!1,showCancelAction:!1}):(0,r.jsx)(e,{...t}):(0,r.jsx)(d.A,{showMessage:!0,showSpinner:!1,messageTitle:"Please sign up to continue",actionLabel:"Sign Up",action:()=>n.push("/signup"),bottomMessage:(0,r.jsxs)("div",{className:"d-flex gap-1",children:[(0,r.jsx)("span",{children:"Already have an account?"}),(0,r.jsx)(a(),{href:f,className:"text-decoration-underline text-dark fw-bold",children:"Login"})]})}):(0,r.jsx)(d.A,{})};return e.getInitialProps&&(t.getInitialProps=e.getInitialProps),t}},66267:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>x});var r=t(37876),i=t(60685);t(14232);var n=t(48230),a=t.n(n),l=t(89099),o=t(88992),c=t(4301),d=t(10323),u=t(91291),m=t(31480),p=t(85373),h=t(47701);let f=()=>{let e=(0,l.useRouter)(),[s]=(0,d.SV)(),{register:t,handleSubmit:i,getValues:n,setError:f,clearErrors:b,formState:{errors:g,isSubmitting:x,isSubmitSuccessful:w}}=(0,o.mN)(),j=async t=>{try{await s({currentPassword:t.currentPassword,newPassword:t.newPassword}).unwrap(),c.oR.success("Your password has been updated successfully"),e.push("/settings/profile")}catch(e){f("server-error",{type:"custom",message:"server-error"}),c.oR.error(e.status===p.H.UNPROCESSABLE_ENTITY?e.data.message:h.Rb)}};return(0,r.jsxs)("form",{onSubmit:i(j),children:[(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)(m.A,{register:t("currentPassword",{required:"This field is required"}),getValues:n,placeholder:"Enter your current password",label:"Current Password",type:"password",isPassword:!0,errors:g}),(0,r.jsx)(a(),{href:"/forgot",className:"text-primary mt-3 d-block",children:"Forgot Password"})]}),(0,r.jsx)("p",{children:"Passwords must be at least 6 characters long, and must contain letters (at least one uppercase), numbers and special characters."}),(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(m.A,{register:t("newPassword",{required:"This field is required",pattern:{value:h.A9,message:"Invalid password. Must be at least 6 characters long, and must contain letters (at least one uppercase), numbers and special characters."}}),getValues:n,placeholder:"Enter New Password",label:"New Password",type:"password",isPassword:!0,errors:g})}),(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(m.A,{register:t("confirmPassword",{required:"This field is required",validate:e=>e===n("newPassword")||"The passwords do not match"}),getValues:n,placeholder:"Enter New Password",label:"Confirm new password",type:"password",isPassword:!0,errors:g})}),(0,r.jsx)("div",{className:"d-flex justify-content-center mt-5",children:(0,r.jsx)(u.A,{type:"submit",className:"btn-lg text-white w-100 mw-md-170p",ariaLabel:"Update Password",color:"primary",isLoading:x,disabled:x||w,onClick:()=>b("server-error"),children:"Change"})})]})};var b=t(78867);let g=()=>(0,r.jsx)(b.C,{children:(0,r.jsxs)("div",{className:"container p-4",children:[(0,r.jsx)("div",{className:"d-flex align-items-center justify-content-between mb-4",children:(0,r.jsx)("h1",{className:"h4 mb-0",children:"Change Password"})}),(0,r.jsx)("div",{className:"mw-xs-700p",children:(0,r.jsx)(f,{})})]})});g.getInitialProps=async()=>({pageTitle:"Change Password"});let x=(0,i.A)(g)},78867:(e,s,t)=>{"use strict";t.d(s,{C:()=>m});var r=t(37876),i=t(76629),n=t(94208),a=t.n(n),l=t(48230),o=t.n(l),c=t(89099),d=t(8196);let u=()=>{let{pathname:e}
1=(0,c.useRouter)(),s=(0,d.k)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"jsx-9c5c1e64d32bf150 sidebar-heading",children:"Main"}),(0,r.jsx)("ul",{className:"jsx-9c5c1e64d32bf150 sidebar-list mb-2",children:(0,r.jsx)("li",{className:"jsx-9c5c1e64d32bf150 sidebar-item",children:(0,r.jsxs)(o(),{href:"/",className:"sidebar-link",children:[(0,r.jsx)("i",{className:"jsx-9c5c1e64d32bf150 bi bi-arrow-left-circle"}),(0,r.jsx)("span",{className:"jsx-9c5c1e64d32bf150",children:"Back"})]})})}),s.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"jsx-9c5c1e64d32bf150 sidebar-heading",children:"Settings"}),(0,r.jsx)("ul",{className:"jsx-9c5c1e64d32bf150 sidebar-list",children:s.map(s=>{let t;return(0,r.jsx)("li",{title:s.label,className:`jsx-9c5c1e64d32bf150 sidebar-item ${e===(t=s.href)||e.startsWith(`${t}/`)?"settings-sidebar-item-active":""}`,children:(0,r.jsxs)(o(),{href:s.href,className:"sidebar-link",children:[(0,r.jsx)("i",{className:"jsx-9c5c1e64d32bf150 "+(s.icon||"")}),(0,r.jsx)("span",{className:"jsx-9c5c1e64d32bf150",children:s.label})]})},s.href)})})]}),(0,r.jsx)(a(),{id:"9c5c1e64d32bf150",children:".settings-sidebar-item-active.jsx-9c5c1e64d32bf150{background-color:rgba(var(--bs-primary-rgb,13,110,253),.12)}.settings-sidebar-item-active.jsx-9c5c1e64d32bf150 .sidebar-link.jsx-9c5c1e64d32bf150{color:var(--bs-primary,#0d6efd);font-weight:600}"})]})},m=({children:e})=>(0,r.jsx)(i.A,{sidebarTopContent:()=>(0,r.jsx)(u,{}),renderMainNav:()=>null,children:e})},90432:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/profile/change-password",function(){return t(66267)}])},98043:(e,s,t)=>{"use strict";t.d(s,{A:()=>c});var r=t(37876),i=t(14232),n=t(4301),a=t(38831),l=t(47701),o=t(68480);let c=({targetRef:e,visible:s,fieldName:t,context:c,getFormContext:d,onFocusWithinChange:u})=>{let[m]=(0,o.dD)(),p=(0,i.useCallback)(async e=>{let s=String(l.mD||"").trim();if(!s)throw Error("agentId is required for field assistant actions.");let r=await m({mode:e.mode,text:e.text,prompt:"prompt"===e.mode?String(e.prompt||"").trim():void 0,fieldName:e.fieldName||t,entityType:String((e.context||c)?.entityType||""),entityId:String((e.context||c)?.entityId||"").trim()||void 0,formContext:e.formContext??d?.()??null,providerSettingId:String((e.context||c)?.providerSettingId||"").trim()||null,modelSlug:String((e.context||c)?.modelSlug||"").trim()||null,projectId:String((e.context||c)?.projectId||"").trim()||null,agentId:s}).unwrap(),i=String(r?.text||"");if(!i.trim())throw Error("No text returned by assistant.");return{text:i}},[m,c,t,d]);return(0,r.jsx)(a.sc,{targetRef:e,visible:s,fieldName:t,context:c,getFormContext:d,onFocusWithinChange:u,onAssist:p,onModeSuccess:e=>{"spell"===e&&n.oR.success("Spell check applied."),"ada"===e&&n.oR.success("ADA readability check applied.")},onError:e=>{n.oR.error(((e,s)=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){let s=e.data;if(s&&"object"==typeof s){let e=s.message;if("string"==typeof e)return e}let t=e.message;if("string"==typeof t)return t}return s})(e,"Failed to run text assistant."))}})}}},e=>{e.O(0,[8992,8831,6629,636,6593,8792],()=>e(e.s=90432)),_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.