import{r as n,j as e,u as U,H as _,L as H}from"./app-DP6lEqpE.js";import{M as K,i as F,u as B,a as W,P as G,b as V,L as X,m as i}from"./proxy-DGZQn3R0.js";function A(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}function Y(...t){return r=>{let a=!1;const s=t.map(c=>{const d=A(c,r);return!a&&typeof d=="function"&&(a=!0),d});if(a)return()=>{for(let c=0;c<s.length;c++){const d=s[c];typeof d=="function"?d():A(t[c],null)}}}}function q(...t){return n.useCallback(Y(...t),t)}class J extends n.Component{getSnapshotBeforeUpdate(r){const a=this.props.childRef.current;if(F(a)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=a.offsetParent,c=F(s)&&s.offsetWidth||0,d=F(s)&&s.offsetHeight||0,m=getComputedStyle(a),o=this.props.sizeRef.current;o.height=parseFloat(m.height),o.width=parseFloat(m.width),o.top=a.offsetTop,o.left=a.offsetLeft,o.right=c-o.width-o.left,o.bottom=d-o.height-o.top,o.direction=m.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Q({children:t,isPresent:r,anchorX:a,anchorY:s,root:c,pop:d}){var p;const m=n.useId(),o=n.useRef(null),v=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:C}=n.useContext(K),h=((p=t.props)==null?void 0:p.ref)??(t==null?void 0:t.ref),N=q(o,h);return n.useInsertionEffect(()=>{const{width:x,height:b,top:w,left:u,right:y,bottom:z,direction:P}=v.current;if(r||d===!1||!o.current||!x||!b)return;const j=P==="rtl",M=a==="left"?j?`right: ${y}`:`left: ${u}`:j?`left: ${u}`:`right: ${y}`,L=s==="bottom"?`bottom: ${z}`:`top: ${w}`;o.current.dataset.motionPopId=m;const g=document.createElement("style");C&&(g.nonce=C);const f=c??document.head;return f.appendChild(g),g.sheet&&g.sheet.insertRule(`
          [data-motion-pop-id="${m}"] {
            position: absolute !important;
            width: ${x}px !important;
            height: ${b}px !important;
            ${M}px !important;
            ${L}px !important;
          }
        `),()=>{var l;(l=o.current)==null||l.removeAttribute("data-motion-pop-id"),f.contains(g)&&f.removeChild(g)}},[r]),e.jsx(J,{isPresent:r,childRef:o,sizeRef:v,pop:d,children:d===!1?t:n.cloneElement(t,{ref:N})})}const Z=({children:t,initial:r,isPresent:a,onExitComplete:s,custom:c,presenceAffectsLayout:d,mode:m,anchorX:o,anchorY:v,root:C})=>{const h=B(ee),N=n.useId(),p=n.useRef(a),x=n.useRef(s);W(()=>{p.current=a,x.current=s});let b=!0,w=n.useMemo(()=>(b=!1,{id:N,initial:r,isPresent:a,custom:c,onExitComplete:u=>{h.set(u,!0);for(const y of h.values())if(!y)return;s&&s()},register:u=>(h.set(u,!1),()=>{var y;h.delete(u),!p.current&&!h.size&&((y=x.current)==null||y.call(x))})}),[a,h,s]);return d&&b&&(w={...w}),n.useMemo(()=>{h.forEach((u,y)=>h.set(y,!1))},[a]),n.useEffect(()=>{!a&&!h.size&&s&&s()},[a]),t=e.jsx(Q,{pop:m==="popLayout",isPresent:a,anchorX:o,anchorY:v,root:C,children:t}),e.jsx(G.Provider,{value:w,children:t})};function ee(){return new Map}const S=t=>t.key||"";function O(t){const r=[];return n.Children.forEach(t,a=>{n.isValidElement(a)&&r.push(a)}),r}const $=({children:t,custom:r,initial:a=!0,onExitComplete:s,presenceAffectsLayout:c=!0,mode:d="sync",propagate:m=!1,anchorX:o="left",anchorY:v="top",root:C})=>{const[h,N]=V(m),p=n.useMemo(()=>O(t),[t]),x=m&&!h?[]:p.map(S),b=n.useRef(!0),w=n.useRef(p),u=B(()=>new Map),y=n.useRef(new Set),[z,P]=n.useState(p),[j,M]=n.useState(p);W(()=>{b.current=!1,w.current=p;for(let f=0;f<j.length;f++){const l=S(j[f]);x.includes(l)?(u.delete(l),y.current.delete(l)):u.get(l)!==!0&&u.set(l,!1)}},[j,x.length,x.join("-")]);const L=[];if(p!==z){let f=[...p];for(let l=0;l<j.length;l++){const k=j[l],I=S(k);x.includes(I)||(f.splice(l,0,k),L.push(k))}return d==="wait"&&L.length&&(f=L),M(O(f)),P(p),null}const{forceRender:g}=n.useContext(X);return e.jsx(e.Fragment,{children:j.map(f=>{const l=S(f),k=m&&!h?!1:p===j||x.includes(l),I=()=>{if(y.current.has(l))return;if(u.has(l))y.current.add(l),u.set(l,!0);else return;let D=!0;u.forEach(T=>{T||(D=!1)}),D&&(g==null||g(),M(w.current),m&&(N==null||N()),s&&s())};return e.jsx(Z,{isPresent:k,initial:!b.current||a?void 0:!1,custom:r,presenceAffectsLayout:c,mode:d,root:C,onExitComplete:k?void 0:I,anchorX:o,anchorY:v,children:f},l)})})},E="easeOut",R={hidden:{opacity:0,y:22},show:{opacity:1,y:0}},te={hidden:{},show:{transition:{staggerChildren:.09,delayChildren:.28}}},se=[{size:320,dur:22,color:"rgba(14,166,120,0.28)",dot:"#0EA678",ccw:!1},{size:228,dur:15,color:"rgba(56,189,248,0.22)",dot:"#38BDF8",ccw:!0},{size:148,dur:34,color:"rgba(139,92,246,0.20)",dot:"#818CF8",ccw:!1}];function ae(){return e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function ne(){return e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:`M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94
               M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19
               m-6.72-1.07a3 3 0 11-4.24-4.24`}),e.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})}function oe(){const t=U({username:"",password:"",remember:!1}),[r,a]=n.useState(!1);return e.jsxs("div",{className:"al",children:[e.jsxs(_,{title:"ورود",children:[e.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),e.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:""}),e.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&display=swap",rel:"stylesheet"})]}),e.jsx("div",{className:"al-orb al-orb--1"}),e.jsx("div",{className:"al-orb al-orb--2"}),e.jsx("div",{className:"al-orb al-orb--3"}),e.jsxs(i.section,{className:"al-right",initial:{opacity:0,x:-60},animate:{opacity:1,x:0},transition:{duration:.8,ease:E,delay:.12},"aria-hidden":"true",children:[e.jsx("div",{className:"al-grid-bg"}),e.jsxs("div",{className:"al-solar",children:[se.map((s,c)=>e.jsx(i.div,{className:"al-ring",style:{width:s.size,height:s.size,borderColor:s.color},animate:{rotate:s.ccw?-360:360},transition:{duration:s.dur,repeat:1/0,ease:"linear"},children:e.jsx("span",{className:"al-ring-dot",style:{background:s.dot,boxShadow:`0 0 14px 3px ${s.dot}`}})},c)),e.jsx(i.div,{className:"al-core",initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.9,delay:.55,ease:[.34,1.56,.64,1]},children:e.jsx(i.div,{className:"al-core-inner",animate:{boxShadow:["0 0 40px rgba(14,166,120,0.45)","0 0 85px rgba(14,166,120,0.78)","0 0 40px rgba(14,166,120,0.45)"]},transition:{duration:3.2,repeat:1/0,ease:"easeInOut"},children:e.jsx("span",{children:"د"})})})]}),e.jsxs(i.div,{className:"al-right-brand",initial:{opacity:0,y:22},animate:{opacity:1,y:0},transition:{duration:.65,delay:.78,ease:E},children:[e.jsx("h2",{children:"دانشیار من"}),e.jsx("p",{children:"هوشمندترین پنل مدیریت مدارس ایران"})]}),e.jsx("div",{className:"al-feats",children:[{icon:"bi-mortarboard-fill",label:"مدیریت کامل مدرسه",delay:.95},{icon:"bi-shield-fill-check",label:"امنیت و رمزنگاری",delay:1.1},{icon:"bi-headset",label:"پشتیبانی ۲۴/۷",delay:1.25}].map(({icon:s,label:c,delay:d})=>e.jsxs(i.div,{className:"al-feat",initial:{opacity:0,x:-22},animate:{opacity:1,x:0},transition:{duration:.5,delay:d,ease:E},children:[e.jsx("span",{className:"al-feat-icon",children:e.jsx("i",{className:`bi ${s}`})}),e.jsx("span",{children:c})]},c))})]}),e.jsxs(i.section,{className:"al-left",initial:{opacity:0,x:60},animate:{opacity:1,x:0},transition:{duration:.65,ease:E},children:[e.jsxs(i.a,{href:"/",className:"al-brand",initial:{opacity:0,y:-16},animate:{opacity:1,y:0},transition:{duration:.5,delay:.12,ease:E},children:[e.jsx("span",{className:"al-brand-icon",children:"د"}),e.jsxs("span",{className:"al-brand-name",children:[e.jsx("strong",{children:"دانشیار من"}),e.jsx("small",{children:"اتوماسیون مدارس"})]})]}),e.jsxs(i.div,{className:"al-form-wrap",variants:te,initial:"hidden",animate:"show",children:[e.jsxs(i.div,{variants:R,transition:{duration:.5},children:[e.jsx("span",{className:"al-eyebrow",children:"به سامانه خوش آمدید"}),e.jsx("h1",{className:"al-title",children:"ورود به حساب"}),e.jsx("p",{className:"al-sub",children:"اطلاعات کاربری خود را وارد کنید"})]}),e.jsxs("form",{className:"al-form",onSubmit:s=>{s.preventDefault(),t.post("/login")},children:[e.jsxs(i.div,{variants:R,transition:{duration:.45},className:"al-field",children:[e.jsxs("div",{className:"al-field-inner",children:[e.jsx("input",{id:"al-un",className:"al-input",type:"text",placeholder:" ",value:t.data.username,onChange:s=>t.setData("username",s.target.value),autoComplete:"username"}),e.jsx("label",{htmlFor:"al-un",className:"al-label",children:"نام کاربری"})]}),e.jsx($,{children:t.errors.username&&e.jsx(i.p,{className:"al-error",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.2},children:t.errors.username})})]}),e.jsxs(i.div,{variants:R,transition:{duration:.45},className:"al-field",children:[e.jsxs("div",{className:"al-field-inner",children:[e.jsx("input",{id:"al-pw",className:"al-input",type:r?"text":"password",placeholder:" ",value:t.data.password,onChange:s=>t.setData("password",s.target.value),autoComplete:"current-password"}),e.jsx("label",{htmlFor:"al-pw",className:"al-label",children:"رمز عبور"}),e.jsx("button",{type:"button",className:"al-eye",onClick:()=>a(s=>!s),tabIndex:-1,"aria-label":r?"مخفی کردن رمز":"نمایش رمز",children:e.jsx($,{mode:"wait",children:r?e.jsx(i.span,{initial:{opacity:0,scale:.6},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.6},transition:{duration:.15},children:e.jsx(ae,{})},"open"):e.jsx(i.span,{initial:{opacity:0,scale:.6},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.6},transition:{duration:.15},children:e.jsx(ne,{})},"closed")})})]}),e.jsx($,{children:t.errors.password&&e.jsx(i.p,{className:"al-error",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.2},children:t.errors.password})})]}),e.jsxs(i.div,{variants:R,transition:{duration:.4},className:"al-row",children:[e.jsxs("label",{className:"al-check",children:[e.jsx("input",{type:"checkbox",checked:t.data.remember,onChange:s=>t.setData("remember",s.target.checked)}),e.jsx("span",{className:"al-check-box"}),e.jsx("span",{className:"al-check-label",children:"مرا به خاطر بسپار"})]}),e.jsx(H,{href:"/forgot-password",className:"al-forgot",children:"فراموشی رمز"})]}),e.jsx(i.div,{variants:R,transition:{duration:.4},children:e.jsx(i.button,{className:"al-submit",type:"submit",disabled:t.processing,whileHover:t.processing?{}:{scale:1.016,boxShadow:"0 20px 56px rgba(14,166,120,0.62)"},whileTap:t.processing?{}:{scale:.984},children:e.jsx($,{mode:"wait",children:t.processing?e.jsx(i.span,{className:"al-spin",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"spin"):e.jsx(i.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:"ورود به سامانه"},"txt")})})})]}),e.jsx(i.div,{variants:R,transition:{duration:.4},className:"al-foot",children:e.jsxs(H,{href:"/",className:"al-back",children:[e.jsx("i",{className:"bi bi-arrow-right"}),"بازگشت به صفحه اصلی"]})})]})]})]})}export{oe as default};
