PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/login-ddf7b69641652ed3.js

js lidomatrip.com collected 2026-09-25 07:11:01 UTC 8,830 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2300],{26177:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/login",function(){return t(4412)}])},84858:function(n,e,t){"use strict";t.d(e,{LP:function(){return h},MS:function(){return v},Px:function(){return x},SC:function(){return _},YV:function(){return p},d0:function(){return m},qz:function(){return y}});var r=t(47568),i=t(51438),u=t(28668),o=t(26042),a=t(69396),s=t(25892),l=t(91224),c=t(70655),f="lidoma_admin_token",d="lidoma_admin_refresh_token";function h(){return window.localStorage.getItem(f)}function p(){return window.localStorage.getItem(d)}function m(n,e){window.localStorage.setItem(f,n),window.localStorage.setItem(d,e)}function y(){window.localStorage.removeItem(f),window.localStorage.removeItem(d)}var v=function(n){(0,u.Z)(t,n);var e=(0,l.Z)(t);function t(n,r,u,o){var a;return(0,i.Z)(this,t),(a=e.call(this,r)).status=n,a.code=u,a.details=o,a}return t}((0,s.Z)(Error)),g=null;function w(){return b.apply(this,arguments)}function b(){return(b=(0,r.Z)(function(){return(0,c.__generator)(this,function(n){return g||(g=(0,r.Z)(function(){var n,e,t,r,i,u,o;return(0,c.__generator)(this,function(a){switch(a.label){case 0:if(!(n=p()))return[2,null];a.label=1;case 1:return a.trys.push([1,4,,5]),[4,fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:n})})];case 2:if(!(r=a.sent()).ok)return[2,null];return[4,r.json().catch(function(){return{}})];case 3:if(u=null==(i=a.sent())?void 0:null===(e=i.data)||void 0===e?void 0:e.accessToken,o=null==i?void 0:null===(t=i.data)||void 0===t?void 0:t.refreshToken,!u||!o)return[2,null];return m(u,o),[2,u];case 4:return a.sent(),[2,null];case 5:return[2]}})})().finally(function(){g=null})),[2,g]})})).apply(this,arguments)}function _(n){return S.apply(this,arguments)}function S(){return(S=(0,r.Z)(function(n){var e,t,i,u,s,l,f,d=arguments;function m(n){return g.apply(this,arguments)}function g(){return(g=(0,r.Z)(function(r){return(0,c.__generator)(this,function(i){return[2,fetch(n,(0,a.Z)((0,o.Z)({},e),{headers:(0,o.Z)({},t?{}:{"Content-Type":"application/json"},r?{Authorization:"Bearer ".concat(r)}:{},e.headers)}))]})})).apply(this,arguments)}return(0,c.__generator)(this,function(r){switch(r.label){case 0:return e=d.length>1&&void 0!==d[1]?d[1]:{},t="undefined"!=typeof FormData&&e.body instanceof FormData,[4,m(h())];case 1:if(!(401===(i=r.sent()).status&&p()&&!n.startsWith("/api/auth/")))return[3,4];return[4,w()];case 2:if(!(u=r.sent()))return[3,4];return[4,m(u)];case 3:i=r.sent(),r.label=4;case 4:return[4,i.json().catch(function(){return{}})];case 5:if(s=r.sent(),!i.ok)throw 401===i.status&&(y(),window.location.href="/admin/login"),new v(i.status,null!==(l=null==s?void 0:s.message)&&void 0!==l?l:"خطای غیرمنتظره",null==s?void 0:s.code,null==s?void 0:s.details);return[2,null!==(f=s.data)&&void 0!==f?f:s]}})})).apply(this,arguments)}function x(n){return j.apply(this,arguments)}function j(){return(j=(0,r.Z)(function(n){var e,t,i,u,s,l=arguments;function f(n){return d.apply(this,arguments)}function d(){return(d=(0,r.Z)(function(t){return(0,c.__generator)(this,function(r){return[2,fetch(n,(0,a.Z)((0,o.Z)({},e),{headers:(0,o.Z)({"Content-Type":"application/json"},t?{Authorization:"Bearer ".concat(t)}:{},e.headers)}))]})})).apply(this,arguments)}return(0,c.__generator)(this,function(n){switch(n.label){case 0:return e=l.length>1&&void 0!==l[1]?l[1]:{},[4,f(h())];case 1:if(!(401===(t=n.sent()).status&&p()))return[3,4];return[4,w()];case 2:if(!(i=n.sent()))return[3,4];return[4,f(i)];case 3:t=n.sent(),n.label=4;case 4:return[4,t.json()];case 5:if(u=n.sent(),!t.ok)throw 401===t.status&&(y(),window.location.href="/admin/login"),new v(t.status,null!==(s=null==u?void 0:u.message)&&void 0!==s?s:"خطا",null==u?void 0:u.code);return[2,{items:u.data,meta:u.meta}]}})})).apply(this,arguments)}},4412:function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return c}});var r=t(47568),i=t(10253),u=t(70655),o=t(85893),a=t(67294),s=t(11163),l=t(84858);function c(){var n=(0,s.useRouter)(),e=(0,i.Z)((0,a.useState)(""),2),t=e[0],c=e[1],f=(0,i.Z)((0,a.useState)(""),2),d=f[0],h=f[1],p=(0,i.Z)((0,a.useState)(""),2),m=p[0],y=p[1],v=(0,i.Z)((0,a.useState)(null),2),g=v[0],w=v[1],b=(0,i.Z)((0,a.useState)(null),2),_=b[0],S=b[1],x=(0,i.Z)((0,a.useState)(!1),2),j=x[0],Z=x[1];function N(){return(N=(0,r.Z)(function(e){var r,i;return(0,u.__generator)(this,function(u){switch(u.label){case 0:e.preventDefault(),S(null),Z(!0),u.label=1;case 1:return u.trys.push([1,3,4,5]),[4,(0,l.SC)("/api/auth/login/password",{method:"POST",body:JSON.stringify({phone:t,password:d})})];case 2:if("otpRequired"in(r=u.sent()))return w(r),[2];if("ADMIN"!==r.user.role)return S("این حساب دسترسی ادمین ندارد"),[2];return(0,l.d0)(r.accessToken,r.refreshToken),n.replace("/admin"),[3,5];case 3:return S((i=u.sent())instanceof l.MS?i.message:"خطا در ورود"),[3,5];case 4:return Z(!1),[7];case 5:return[2]}})})).apply(this,arguments)}function k(){return(k=(0,r.Z)(function(e){var t,r;return(0,u.__generator)(this,function(i){switch(i.label){case 0:if(e.preventDefault(),!g)return[2];S(null),Z(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,(0,l.SC)("/api/auth/login/admin/otp",{method:"POST",body:JSON.stringify({challengeToken:g.challengeToken,code:m})})];case 2:return t=i.sent(),(0,l.d0)(t.accessToken,t.refreshToken),n.replace("/admin"),[3,5];case 3:return S((r=i.sent())instanceof l.MS?r.message:"خطا در تأیید کد"),[3,5];case 4:return Z(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return g?(0,o.jsx)("div",{className:"admin-panel",children:(0,o.jsx)("div",{className:"login-wrap",children:(0,o.jsxs)("form",{className:"login-box",onSubmit:function(n){return k.apply(this,arguments)},children:[(0,o.jsx)("h1",{style:{fontSize:18,marginBottom:8},children:"کد تأیید پیامک‌شده"}),(0,o.jsx)("p",{style:{fontSize:13,color:"#666",marginBottom:20},children:"رمز درست بود. کدی به همین شماره پیامک شد — آن را اینجا وارد کن."}),(0,o.jsxs)("div",{className:"field",children:[(0,o.jsx)("label",{children:"کد تأیید"}),(0,o.jsx)("input",{value:m,onChange:function(n){return y(n.target.value)},inputMode:"numeric",autoFocus:!0,required:!0})]}),(0,o.jsx)("button",{className:"btn",style:{width:"100%"},type:"submit",disabled:j,children:j?"در حال بررسی...":"تأیید و ورود"}),(0,o.jsx)("button",{type:"button",className:"btn-link",style:{width:"100%",marginTop:8},onClick:function(){w(null),y(""),S(null)},children:"بازگشت"}),_&&(0,o.jsx)("p",{className:"error-text",children:_})]})})}):(0,o.jsx)("div",{className:"admin-panel",children:(0,o.jsx)("div",{className:"login-wrap",children:(0,o.jsxs)("form",{className:"login-box",onSubmit:function(n){return N.apply(this,arguments)},children:[(0,o.jsx)("h1",{style:{fontSize:18,marginBottom:20},children:"ورود به پنل مدیریت"}),(0,o.jsxs)("div",{className:"field",children:[(0,o.jsx)("label",{children:"شماره موبایل"}),(0,o.jsx)("input",{value:t,onChange:function(n){return c(n.target.value)},placeholder:"09120000000",required:!0})]}),(0,o.jsxs)("div",{className:"field",children:[(0,o.jsx)("label",{children:"رمز عبور"}),(0,o.jsx)("input",{type:"password",value:d,onChange:function(n){return h(n.target.value)},required:!0})]}),(0,o.jsx)("button",{className:"btn",style:{width:"100%"},type:"submit",disabled:j,children:j?"در حال ورود...":"ورود"}),_&&(0,o.jsx)("p",{className:"error-text",children:_})]})})})}},25892:function(n,e,t){"use strict";t.d(e,{Z:function(){return a}});var r=t(44998);function i(n,e,t){return(i=!function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}()?function(n,e,t){var i=[null];i.push.apply(i,e);var u=new(Function.bind.apply(n,i));return t&&(0,r.Z)(u,t.prototype),u}:Reflect.construct).apply(null,arguments)}var u=t(82662);function o(n){var e="function"==typeof Map?new Map:void 0;return(o=function(n){if(null===n||-1===Function.toString.call(n).indexOf("[native code]"))return n;if("function"!=typeof n)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(n))return e.get(n);e.set(n,t)}function t(){return function(n,e,t){return i.apply(null,arguments)}(n,arguments,(0,u.Z)(this).constructor)}return t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),(0,r.Z)(t,n)})(n)}function a(n){return o(n)}}},function(n){n.O(0,[9774,2888,179],function(){return n(n.s=26177)}),_N_E=n.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.