1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[9825],{19825(e,n,t){t.r(n),t.d(n,{default:()=>j});var r=t(96540),i=t(53494),o=t(82836),a=t(83182),l=t(54996),c=t(24961),u=t(19660),s=t(54490),f=t(81963),d=t(71999),m=t(92334),p=t(96488),A=t(47767),v=t(54815),h=t(75811),g=t(42547),y=t(60047),E=t(78939),b=t(80235);function w(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,o,a,l=[],c=!0,u=!1;try{if(o=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=o.call(t)).done)&&(l.push(r.value),l.length!==n);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return _(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_(e,n):void 0}}(e,n)||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 _(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var S=function(e){(0,E.TV)("impersonation_id",e,{domain:".polestar.com",expiration:3600})},C=function(e){return function(e){return e.replace(/^\/*/,"")}(function(e){return e.replace(/\/\/*/g,"/").replace(/\/+$/,"")}(e))},O=function(e){var n,t,r;S(e.psid),sessionStorage.removeItem("direct_login"),location.href=(t=null!==(n=null==e?void 0:e.path)&&void 0!==n?n:"login/profile","/".concat(null!==(r=function(){var e,n=null===(e=h.A.find(function(e){return"AdminCallbackView"===e.view}))||void 0===e?void 0:e.name;if(n)return C(window.location.pathname.replace("login/".concat(n),""))}())&&void 0!==r?r:C(window.location.pathname.split("/").slice(0,-2).join("/")),"/").concat(t).replace(/[\/]{2,}/,"/"))};const j=function(){var e,n=(0,v.sq)(),t=w((0,r.useState)(null!==(e=n.get("psid"))&&void 0!==e?e:""),2),E=t[0],_=t[1],C=w((0,r.useState)(""),2),j=C[0],I=C[1],k=(0,g.At)().currentMarket,D=(0,A.Zp)(),L=(0,v.yG)(),x=L.loading,U=L.isAuthenticated,H=L.logout,M=(0,v.$i)().validatePsid;return(0,r.useEffect)(function(){if(!x&&U){var e=sessionStorage.getItem("direct_login");if(e){var n=JSON.parse(e),t=M(n.psid);if(t)return I(t),_(n.psid);O(n)}}},[x,U,M]),(0,r.useEffect)(function(){x||U||D((0,y.M)(h.A,"admin",{locale:(null==k?void 0:k.locale)||""}))},[D,k,x,U]),r.createElement(u.Ay,null,x?r.createElement(b.aH,null):r.createElement(o.A,null,r.createElement(a.A,{style:{maxWidth:"500px",width:"100%"}},r.createElement(i.jn,{onClick:function(){S("customer-care"),location.href="".concat(location.origin,"/").concat(null==k?void 0:k.locale,"/checkout/customer-care")},icon:d.A},"Order Changes"),r.createElement(c.A,null),r.createElement(l.H1,null,"User Impersonation"),r.createElement(s.A,{spacing:p.A.medium}),r.createElement(f.A,{label:"Polestar system-ID",hint:"Enter the Polestar system-ID that you want to impersonate",value:E,onChange:function(e){var n=e.trim(),t=M(n);I(t),_(n)},error:j,required:!0}),r.createElement(s.A,{spacing:p.A.medium}),r.createElement(i.jn,{disabled:!!j,onClick:function(){E&&!j?O({psid:E}):I("Field is required")},icon:d.A},"Impersonate"),r.createElement(c.A,{size:m.A.small}),r.createElement(i.jn,{onClick:H,icon:d.A},"Sign out"),r.createElement(c.A,null))))}},60047(e,n,t){t.d(n,{M:()=>r});var r=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.find(function(e){return e.name===n});if(!r)throw new Error("Cannot build URL for unknown route ".concat(n,"."));return Object.keys(t).reduce(function(e,n){return e.replace(new RegExp(":".concat(n),"gi"),t[n])},r.path)}},75811(e,n,t){t.d(n,{A:()=>r});const r=t(28422).Ay}}]);
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.