Files
aula-manager/chunk-CUANlmUG.js
T
2026-07-05 17:54:50 +07:00

2 lines
8.8 KiB
JavaScript

import{x as le,m as Ee,g as M,a as w,w as Q,l as x,a3 as U}from"./chunk-DhYw-kuD.js";import{a0 as u,I as Te,ae as G,$ as f,C as qe,af as Se,B as Le}from"./app-CPb3bToC.js";import{a as Ce,u as Be}from"./chunk-xwEmqXCW.js";import{l as He,k as Pe,t as _e,u as Fe,c as ze,a as Me,d as $e,e as De,b as Ve,i as Ke}from"./chunk-DBKH8df9.js";import{c as Oe}from"./chunk-DfTn_VfD.js";import{b as Re}from"./chunk-CusLMHK2.js";const v=[];let y;function Ae(e){y=e.keyCode===27}function We(){y===!0&&(y=!1)}function Ie(e){y===!0&&(y=!1,Te(e,27)===!0&&v[v.length-1](e))}function se(e){window[e]("keydown",Ae),window[e]("blur",We),window[e]("keyup",Ie),y=!1}function Xe(e){u.is.desktop===!0&&(v.push(e),v.length===1&&se("addEventListener"))}function J(e){const t=v.indexOf(e);t!==-1&&(v.splice(t,1),v.length===0&&se("removeEventListener"))}const h=[];function re(e){h[h.length-1](e)}function Ye(e){u.is.desktop===!0&&(h.push(e),h.length===1&&document.body.addEventListener("focusin",re))}function N(e){const t=h.indexOf(e);t!==-1&&(h.splice(t,1),h.length===0&&document.body.removeEventListener("focusin",re))}function je(e,t,s){let i;function r(){i!==void 0&&(G.remove(i),i=void 0)}return le(()=>{e.value===!0&&r()}),{removeFromHistory:r,addToHistory(){i={condition:()=>s.value===!0,handler:t},G.add(i)}}}let k=0,$,D,E,V=!1,Z,ee,te,m=null;function Qe(e){Ue(e)&&qe(e)}function Ue(e){if(e.target===document.body||e.target.classList.contains("q-layout__backdrop"))return!0;const t=Se(e),s=e.shiftKey&&!e.deltaX,i=!s&&Math.abs(e.deltaX)<=Math.abs(e.deltaY),r=s||i?e.deltaY:e.deltaX;for(let a=0;a<t.length;a++){const n=t[a];if(_e(n,i))return i?r<0&&n.scrollTop===0?!0:r>0&&n.scrollTop+n.clientHeight===n.scrollHeight:r<0&&n.scrollLeft===0?!0:r>0&&n.scrollLeft+n.clientWidth===n.scrollWidth}return!0}function oe(e){e.target===document&&(document.scrollingElement.scrollTop=document.scrollingElement.scrollTop)}function L(e){V!==!0&&(V=!0,requestAnimationFrame(()=>{V=!1;const{height:t}=e.target,{clientHeight:s,scrollTop:i}=document.scrollingElement;(E===void 0||t!==window.innerHeight)&&(E=s-t,document.scrollingElement.scrollTop=i),i>E&&(document.scrollingElement.scrollTop-=Math.ceil((i-E)/8))}))}function ie(e){const t=document.body,s=window.visualViewport!==void 0;if(e==="add"){const{overflowY:i,overflowX:r}=window.getComputedStyle(t);$=He(window),D=Pe(window),Z=t.style.left,ee=t.style.top,te=window.location.href,t.style.left=`-${$}px`,t.style.top=`-${D}px`,r!=="hidden"&&(r==="scroll"||t.scrollWidth>window.innerWidth)&&t.classList.add("q-body--force-scrollbar-x"),i!=="hidden"&&(i==="scroll"||t.scrollHeight>window.innerHeight)&&t.classList.add("q-body--force-scrollbar-y"),t.classList.add("q-body--prevent-scroll"),document.qScrollPrevented=!0,u.is.ios===!0&&(s===!0?(window.scrollTo(0,0),window.visualViewport.addEventListener("resize",L,f.passiveCapture),window.visualViewport.addEventListener("scroll",L,f.passiveCapture),window.scrollTo(0,0)):window.addEventListener("scroll",oe,f.passiveCapture))}u.is.desktop===!0&&u.is.mac===!0&&window[`${e}EventListener`]("wheel",Qe,f.notPassive),e==="remove"&&(u.is.ios===!0&&(s===!0?(window.visualViewport.removeEventListener("resize",L,f.passiveCapture),window.visualViewport.removeEventListener("scroll",L,f.passiveCapture)):window.removeEventListener("scroll",oe,f.passiveCapture)),t.classList.remove("q-body--prevent-scroll"),t.classList.remove("q-body--force-scrollbar-x"),t.classList.remove("q-body--force-scrollbar-y"),document.qScrollPrevented=!1,t.style.left=Z,t.style.top=ee,window.location.href===te&&window.scrollTo($,D),E=void 0)}function Ge(e){let t="add";if(e===!0){if(k++,m!==null){clearTimeout(m),m=null;return}if(k>1)return}else{if(k===0||(k--,k>0))return;if(t="remove",u.is.ios===!0&&u.is.nativeMobile===!0){m!==null&&clearTimeout(m),m=setTimeout(()=>{ie(t),m=null},100);return}}ie(t)}function Je(){let e;return{preventBodyScroll(t){t!==e&&(e!==void 0||t===!0)&&(e=t,Ge(t))}}}let C=0;const Ne={standard:"fixed-full flex-center",top:"fixed-top justify-center",bottom:"fixed-bottom justify-center",right:"fixed-right items-center",left:"fixed-left items-center"},ne={standard:["scale","scale"],top:["slide-down","slide-up"],bottom:["slide-up","slide-down"],right:["slide-left","slide-right"],left:["slide-right","slide-left"]},lt=Le({name:"QDialog",inheritAttrs:!1,props:{...Fe,...ze,transitionShow:String,transitionHide:String,persistent:Boolean,autoClose:Boolean,allowFocusOutside:Boolean,noEscDismiss:Boolean,noBackdropDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,noShake:Boolean,seamless:Boolean,maximized:Boolean,fullWidth:Boolean,fullHeight:Boolean,square:Boolean,backdropFilter:String,position:{type:String,default:"standard",validator:e=>["standard","top","bottom","left","right"].includes(e)}},emits:[...Me,"shake","click","escapeKey"],setup(e,{slots:t,emit:s,attrs:i}){const r=Ee(),a=M(null),n=M(!1),p=M(!1);let c=null,d=null,T,B;const K=w(()=>e.persistent!==!0&&e.noRouteDismiss!==!0&&e.seamless!==!0),{preventBodyScroll:O}=Je(),{registerTimeout:R}=Ce(),{registerTick:ae,removeTick:A}=Be(),{transitionProps:ue,transitionStyle:W}=$e(e,()=>ne[e.position][0],()=>ne[e.position][1]),ce=w(()=>W.value+(e.backdropFilter!==void 0?`;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}`:"")),{showPortal:I,hidePortal:X,portalIsAccessible:de,renderPortal:fe}=De(r,a,ke,"dialog"),{hide:q}=Ve({showing:n,hideOnRouteChange:K,handleShow:ye,handleHide:pe,processOnMount:!0}),{addToHistory:me,removeFromHistory:ve}=je(n,q,K),he=w(()=>`q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized===!0?"maximized":"minimized"} q-dialog__inner--${e.position} ${Ne[e.position]}`+(p.value===!0?" q-dialog__inner--animating":"")+(e.fullWidth===!0?" q-dialog__inner--fullwidth":"")+(e.fullHeight===!0?" q-dialog__inner--fullheight":"")+(e.square===!0?" q-dialog__inner--square":"")),S=w(()=>n.value===!0&&e.seamless!==!0),ge=w(()=>e.autoClose===!0?{onClick:be}:{}),we=w(()=>[`q-dialog fullscreen no-pointer-events q-dialog--${S.value===!0?"modal":"seamless"}`,i.class]);Q(()=>e.maximized,o=>{n.value===!0&&_(o)}),Q(S,o=>{O(o),o===!0?(Ye(F),Xe(P)):(N(F),J(P))});function ye(o){me(),d=e.noRefocus===!1&&document.activeElement!==null?document.activeElement:null,_(e.maximized),I(),p.value=!0,e.noFocus!==!0?(document.activeElement!==null&&document.activeElement.blur(),ae(b)):A(),R(()=>{if(r.proxy.$q.platform.is.ios===!0){if(e.seamless!==!0&&document.activeElement){const{top:l,bottom:g}=document.activeElement.getBoundingClientRect(),{innerHeight:j}=window,z=window.visualViewport!==void 0?window.visualViewport.height:j;l>0&&g>z/2&&(document.scrollingElement.scrollTop=Math.min(document.scrollingElement.scrollHeight-z,g>=j?1/0:Math.ceil(document.scrollingElement.scrollTop+g-z/2))),document.activeElement.scrollIntoView()}B=!0,a.value.click(),B=!1}I(!0),p.value=!1,s("show",o)},e.transitionDuration)}function pe(o){A(),ve(),Y(!0),p.value=!0,X(),d!==null&&(((o&&o.type.indexOf("key")===0?d.closest('[tabindex]:not([tabindex^="-"])'):void 0)||d).focus(),d=null),R(()=>{X(!0),p.value=!1,s("hide",o)},e.transitionDuration)}function b(o){Ke(()=>{let l=a.value;if(l!==null){if(o!==void 0){const g=l.querySelector(o);if(g!==null){g.focus({preventScroll:!0});return}}l.contains(document.activeElement)!==!0&&(l=l.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||l.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||l.querySelector("[autofocus], [data-autofocus]")||l,l.focus({preventScroll:!0}))}})}function H(o){o&&typeof o.focus=="function"?o.focus({preventScroll:!0}):b(),s("shake");const l=a.value;l!==null&&(l.classList.remove("q-animate--scale"),l.classList.add("q-animate--scale"),c!==null&&clearTimeout(c),c=setTimeout(()=>{c=null,a.value!==null&&(l.classList.remove("q-animate--scale"),b())},170))}function P(){e.seamless!==!0&&(e.persistent===!0||e.noEscDismiss===!0?e.maximized!==!0&&e.noShake!==!0&&H():(s("escapeKey"),q()))}function Y(o){c!==null&&(clearTimeout(c),c=null),(o===!0||n.value===!0)&&(_(!1),e.seamless!==!0&&(O(!1),N(F),J(P))),o!==!0&&(d=null)}function _(o){o===!0?T!==!0&&(C<1&&document.body.classList.add("q-body--dialog"),C++,T=!0):T===!0&&(C<2&&document.body.classList.remove("q-body--dialog"),C--,T=!1)}function be(o){B!==!0&&(q(o),s("click",o))}function xe(o){e.persistent!==!0&&e.noBackdropDismiss!==!0?q(o):e.noShake!==!0&&H()}function F(o){e.allowFocusOutside!==!0&&de.value===!0&&Oe(a.value,o.target)!==!0&&b('[tabindex]:not([tabindex="-1"])')}Object.assign(r.proxy,{focus:b,shake:H,__updateRefocusTarget(o){d=o||null}}),le(Y);function ke(){return x("div",{role:"dialog","aria-modal":S.value===!0?"true":"false",...i,class:we.value},[x(U,{name:"q-transition--fade",appear:!0},()=>S.value===!0?x("div",{class:"q-dialog__backdrop fixed-full",style:ce.value,"aria-hidden":"true",tabindex:-1,onClick:xe}):null),x(U,ue.value,()=>n.value===!0?x("div",{ref:a,class:he.value,style:W.value,tabindex:-1,...ge.value},Re(t.default)):null)])}return fe}});export{lt as Q,Xe as a,Ye as b,N as c,J as r};