1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[89605],{308341:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/experimentation-test/v2/login-transition/public",function(){return n(808498)}])},808498:function(t,e,n){"use strict";n.r(e),n.d(e,{__N_SSP:function(){return Z},default:function(){return _}});var r,i,o=n(687800),a=n(827378),u=n(456552),l=n(671718),c=n(447178),s=n(140224),d=n(699219);function f(t,e,n,r,i,o,a){try{var u=t[o](a),l=u.value}catch(t){n(t);return}u.done?e(l):Promise.resolve(l).then(r,i)}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){var r;r=n[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r})}return t}var p=(r=function(t,e){var n=arguments;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}(this,function(r){switch(r.label){case 0:return[4,(n.length>2&&void 0!==n[2]?n[2]:l.Z)("/login",e,{method:"POST",data:{username:t.email,password:t.password},query:{country:t.systemCountry},parentSpan:t.parentSpan,fetchSpanAttributes:{"request.backend_service":"customer-identity-proxy-service","request.backend_action":"login"}},{isAuthRequest:!0,skipGetAuth:!0})];case 1:return[2,r.sent().json()]}})},i=function(){var t=this,e=arguments;return new Promise(function(n,i){var o=r.apply(t,e);function a(t){f(o,n,i,a,u,"next",t)}function u(t){f(o,n,i,a,u,"throw",t)}a(void 0)})},function(t,e){return i.apply(this,arguments)}),g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,u.useQueryClient)(),n=(0,s.O)(),r=(0,c.Z)().fetch,i=[d.Z["auth.login"]];return(0,u.useMutation)(function(t){return p(h({},t,n),i,r)},h({onSuccess:function(){e.clear()}},t))},y=n(43011),v=n(346629),b=n(768587),m=n(581340);function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function w(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,r,i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var o=[],a=!0,u=!1;try{for(i=i.call(t);!(a=(n=i.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){u=!0,r=t}finally{try{a||null==i.return||i.return()}finally{if(u)throw r}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return x(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var S=function(){var t=g(),e=t.mutate,n=t.data,r=t.isLoading,i=t.error,u=w((0,a.useState)(""),2),l=u[0],c=u[1],s=w((0,a.useState)(""),2),d=s[0],f=s[1],h=w((0,a.useState)(!1),2),p=h[0],x=h[1],S=(0,y.Z)(),Z=(0,m.t)();(0,a.useEffect)(function(){n&&((0,v.JS)(n),x(!1),Z.push("/experimentation-test/v2/login-transition/customer"))},[n,Z]),(0,a.useEffect)(function(){i&&x(!1)},[i]);var _=l.length>0&&d.length>0;return(0,o.BX)(b.xu,{children:[!S&&(0,o.tZ)(b.xu,{children:(0,o.tZ)(b.xv,{"data-test-id":"user-type",children:"public"})}),(r||p)&&(0,o.BX)(b.xu,{"data-test-id":"loading-state",children:[(0,o.tZ)(b.$j,{size:"sm"}),(0,o.tZ)(b.xv,{children:"Logging in..."})]}),i&&(0,o.tZ)(b.xu,{"data-test-id":"error-state",children:(0,o.BX)(b.xv,{children:["Login failed: ",i.message||"Unknown error"]})}),!S&&(0,o.BX)(b.xu,{children:[(0,o.tZ)(b.xu,{marginBottom:"xs",children:(0,o.tZ)("input",{"data-test-id":"email",type:"email",placeholder:"Email",value:l,onCh
1ange:function(t){return c(t.target.value)},disabled:p})}),(0,o.tZ)(b.xu,{marginBottom:"xs",children:(0,o.tZ)("input",{"data-test-id":"password",type:"password",placeholder:"Password",value:d,onChange:function(t){return f(t.target.value)},disabled:p})}),(0,o.tZ)(b.zx.Primary,{onClick:function(){l&&d&&(x(!0),e({email:l,password:d}))},"data-test-id":"login",disabled:!_||p,children:p?"Logging in...":"Login this user"})]}),S&&(0,o.tZ)(b.xu,{"data-test-id":"success-state",children:(0,o.tZ)(b.xv,{children:"Login successful! Redirecting..."})}),(0,o.BX)(b.xu,{"data-test-id":"debug-info",display:"none",children:[(0,o.BX)(b.xv,{children:["Is Loading: ",r.toString()]}),(0,o.BX)(b.xv,{children:["Is Submitting: ",p.toString()]}),(0,o.BX)(b.xv,{children:["Is Form Valid: ",_.toString()]}),(0,o.BX)(b.xv,{children:["Has Error: ",(!!i).toString()]}),(0,o.BX)(b.xv,{children:["Is Logged In: ",S.toString()]})]})]})},Z=!0,_=function(){return(0,o.tZ)(o.HY,{children:(0,o.tZ)(S,{})})}}},function(t){t.O(0,[92888,49774,40179],function(){return t(t.s=308341)}),_N_E=t.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.