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

2 lines
27 KiB
JavaScript

import{m as X,g as z,a as p,w as K,l as q,a3 as he,x as ee,a8 as qe,h as Re,O as ae,y as Y,z as Ve,A as Ee}from"./chunk-DhYw-kuD.js";import{e as Fe,v as ue,a as _e,b as Ae,c as Be,p as ie,d as Te,r as se,s as Pe}from"./chunk-CCQf9h9p.js";import{u as Oe,c as Ie,s as De,a as Ke,d as $e,b as je,e as Le,g as Ne,h as ze,i as re,r as He}from"./chunk-DBKH8df9.js";import{u as be,a as ke}from"./chunk-8e5kB75k.js";import{u as Ue,a as Ze}from"./chunk-xwEmqXCW.js";import{B as ye,U as Qe,C as pe,Y as We,F as Ye,X as xe,G,K as Xe,J as ce}from"./app-CPb3bToC.js";import{b as J,Q as de}from"./chunk-CusLMHK2.js";import{a as Ge,r as fe,b as Je,c as et}from"./chunk-CUANlmUG.js";import{c as tt}from"./chunk-DfTn_VfD.js";import{a as lt}from"./chunk-C2blguT0.js";import{u as nt}from"./chunk-C3G_4NHG.js";import{t as ne}from"./chunk-BX7XdaCY.js";import{u as ot,b as at}from"./chunk-GYMadCV3.js";const Tt=ye({name:"QMenu",inheritAttrs:!1,props:{...Fe,...Oe,...be,...Ie,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:ue},self:{type:String,validator:ue},offset:{type:Array,validator:_e},scrollTarget:De,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...Ke,"click","escapeKey"],setup(e,{slots:t,emit:s,attrs:u}){let c=null,d,f,w;const A=X(),{proxy:M}=A,{$q:y}=M,v=z(null),H=z(!1),P=p(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),D=ke(e,y),{registerTick:$,removeTick:I}=Ue(),{registerTimeout:j}=Ze(),{transitionProps:_,transitionStyle:W}=$e(e),{localScrollTarget:L,changeScrollEvent:N,unconfigureScrollTarget:R}=Ae(e,E),{anchorEl:x,canShow:B}=Be({showing:H}),{hide:o}=je({showing:H,canShow:B,handleShow:S,handleHide:F,hideOnRouteChange:P,processOnMount:!0}),{showPortal:n,hidePortal:i,renderPortal:a}=Le(A,v,we,"menu"),m={anchorEl:x,innerRef:v,onClickOutside(k){if(e.persistent!==!0&&H.value===!0)return o(k),(k.type==="touchstart"||k.target.classList.contains("q-dialog__backdrop"))&&pe(k),!0}},h=p(()=>ie(e.anchor||(e.cover===!0?"center middle":"bottom start"),y.lang.rtl)),V=p(()=>e.cover===!0?h.value:ie(e.self||"top start",y.lang.rtl)),b=p(()=>(e.square===!0?" q-menu--square":"")+(D.value===!0?" q-menu--dark q-dark":"")),C=p(()=>e.autoClose===!0?{onClick:Q}:{}),r=p(()=>H.value===!0&&e.persistent!==!0);K(r,k=>{k===!0?(Ge(O),Te(m)):(fe(O),se(m))});function g(){re(()=>{let k=v.value;k&&k.contains(document.activeElement)!==!0&&(k=k.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||k.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||k.querySelector("[autofocus], [data-autofocus]")||k,k.focus({preventScroll:!0}))})}function S(k){if(c=e.noRefocus===!1?document.activeElement:null,Je(U),n(),E(),d=void 0,k!==void 0&&(e.touchPosition||e.contextMenu)){const le=Qe(k);if(le.left!==void 0){const{top:Se,left:Me}=x.value.getBoundingClientRect();d={left:le.left-Me,top:le.top-Se}}}f===void 0&&(f=K(()=>y.screen.width+"|"+y.screen.height+"|"+e.self+"|"+e.anchor+"|"+y.lang.rtl,Z)),e.noFocus!==!0&&document.activeElement.blur(),$(()=>{Z(),e.noFocus!==!0&&g()}),j(()=>{y.platform.is.ios===!0&&(w=e.autoClose,v.value.click()),Z(),n(!0),s("show",k)},e.transitionDuration)}function F(k){I(),i(),l(!0),c!==null&&(k===void 0||k.qClickOutside!==!0)&&(((k&&k.type.indexOf("key")===0?c.closest('[tabindex]:not([tabindex^="-"])'):void 0)||c).focus(),c=null),j(()=>{i(!0),s("hide",k)},e.transitionDuration)}function l(k){d=void 0,f!==void 0&&(f(),f=void 0),(k===!0||H.value===!0)&&(et(U),R(),se(m),fe(O)),k!==!0&&(c=null)}function E(){(x.value!==null||e.scrollTarget!==void 0)&&(L.value=Ne(x.value,e.scrollTarget),N(L.value,Z))}function Q(k){w!==!0?(ze(M,k),s("click",k)):w=!1}function U(k){r.value===!0&&e.noFocus!==!0&&tt(v.value,k.target)!==!0&&g()}function O(k){s("escapeKey"),o(k)}function Z(){Pe({targetEl:v.value,offset:e.offset,anchorEl:x.value,anchorOrigin:h.value,selfOrigin:V.value,absoluteOffset:d,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function we(){return q(he,_.value,()=>H.value===!0?q("div",{role:"menu",...u,ref:v,tabindex:-1,class:["q-menu q-position-engine scroll"+b.value,u.class],style:[u.style,W.value],...C.value},J(t.default)):null)}return ee(l),Object.assign(M,{focus:g,updatePosition:Z}),a}}),ve=/^on[A-Z]/;function rt(){const{attrs:e,vnode:t}=X(),s={listeners:z({}),attributes:z({})};function u(){const c={},d={};for(const f in e)f!=="class"&&f!=="style"&&ve.test(f)===!1&&(c[f]=e[f]);for(const f in t.props)ve.test(f)===!0&&(d[f]=t.props[f]);s.attributes.value=c,s.listeners.value=d}return qe(u),u(),s}function ut({validate:e,resetValidation:t,requiresQForm:s}){const u=Re(We,!1);if(u!==!1){const{props:c,proxy:d}=X();Object.assign(d,{validate:e,resetValidation:t}),K(()=>c.disable,f=>{f===!0?(typeof t=="function"&&t(),u.unbindComponent(d)):u.bindComponent(d)}),ae(()=>{c.disable!==!0&&u.bindComponent(d)}),ee(()=>{c.disable!==!0&&u.unbindComponent(d)})}else s===!0&&console.error("Parent QForm not found on useFormChild()!")}const it=[!0,!1,"ondemand"],st={modelValue:{},error:{type:Boolean,default:null},errorMessage:String,noErrorIcon:Boolean,rules:Array,reactiveRules:Boolean,lazyRules:{type:[Boolean,String],default:!1,validator:e=>it.includes(e)}};function ct(e,t){const{props:s,proxy:u}=X(),c=z(!1),d=z(null),f=z(!1);ut({validate:$,resetValidation:D});let w=0,A;const M=p(()=>s.rules!==void 0&&s.rules!==null&&s.rules.length!==0),y=p(()=>s.disable!==!0&&M.value===!0&&t.value===!1),v=p(()=>s.error===!0||c.value===!0),H=p(()=>typeof s.errorMessage=="string"&&s.errorMessage.length!==0?s.errorMessage:d.value);K(()=>s.modelValue,()=>{f.value=!0,y.value===!0&&s.lazyRules===!1&&I()});function P(){s.lazyRules!=="ondemand"&&y.value===!0&&f.value===!0&&I()}K(()=>s.reactiveRules,j=>{j===!0?A===void 0&&(A=K(()=>s.rules,P,{immediate:!0,deep:!0})):A!==void 0&&(A(),A=void 0)},{immediate:!0}),K(()=>s.lazyRules,P),K(e,j=>{j===!0?f.value=!0:y.value===!0&&s.lazyRules!=="ondemand"&&I()});function D(){w++,t.value=!1,f.value=!1,c.value=!1,d.value=null,I.cancel()}function $(j=s.modelValue){if(s.disable===!0||M.value===!1)return!0;const _=++w,W=t.value!==!0?()=>{f.value=!0}:()=>{},L=(R,x)=>{R===!0&&W(),c.value=R,d.value=x||null,t.value=!1},N=[];for(let R=0;R<s.rules.length;R++){const x=s.rules[R];let B;if(typeof x=="function"?B=x(j,ne):typeof x=="string"&&ne[x]!==void 0&&(B=ne[x](j)),B===!1||typeof B=="string")return L(!0,B),!1;B!==!0&&B!==void 0&&N.push(B)}return N.length===0?(L(!1),!0):(t.value=!0,Promise.all(N).then(R=>{if(R===void 0||Array.isArray(R)===!1||R.length===0)return _===w&&L(!1),!0;const x=R.find(B=>B===!1||typeof B=="string");return _===w&&L(x!==void 0,x),x===void 0},R=>(_===w&&(console.error(R),L(!0)),!1)))}const I=Ye($,0);return ee(()=>{A!==void 0&&A(),I.cancel()}),Object.assign(u,{resetValidation:D,validate:$}),xe(u,"hasError",()=>v.value),{isDirtyModel:f,hasRules:M,hasError:v,errorMessage:H,validate:$,resetValidation:D}}function oe(e){return e!=null&&(""+e).length!==0}const dt={...be,...st,label:String,stackLabel:Boolean,hint:String,hideHint:Boolean,prefix:String,suffix:String,labelColor:String,color:String,bgColor:String,filled:Boolean,outlined:Boolean,borderless:Boolean,standout:[Boolean,String],square:Boolean,loading:Boolean,labelSlot:Boolean,bottomSlots:Boolean,hideBottomSpace:Boolean,rounded:Boolean,dense:Boolean,itemAligned:Boolean,counter:Boolean,clearable:Boolean,clearIcon:String,disable:Boolean,readonly:Boolean,autofocus:Boolean,for:String},ft={...dt,maxlength:[Number,String]},vt=["update:modelValue","clear","focus","blur"];function gt({requiredForAttr:e=!0,tagProp:t,changeEvent:s=!1}={}){const{props:u,proxy:c}=X(),d=ke(u,c.$q),f=nt({required:e,getValue:()=>u.for});return{requiredForAttr:e,changeEvent:s,tag:t===!0?p(()=>u.tag):{value:"label"},isDark:d,editable:p(()=>u.disable!==!0&&u.readonly!==!0),innerLoading:z(!1),focused:z(!1),hasPopupOpen:!1,splitAttrs:rt(),targetUid:f,rootRef:z(null),targetRef:z(null),controlRef:z(null)}}function mt(e){const{props:t,emit:s,slots:u,attrs:c,proxy:d}=X(),{$q:f}=d;let w=null;e.hasValue===void 0&&(e.hasValue=p(()=>oe(t.modelValue))),e.emitValue===void 0&&(e.emitValue=r=>{s("update:modelValue",r)}),e.controlEvents===void 0&&(e.controlEvents={onFocusin:o,onFocusout:n}),Object.assign(e,{clearValue:i,onControlFocusin:o,onControlFocusout:n,focus:x}),e.computedCounter===void 0&&(e.computedCounter=p(()=>{if(t.counter!==!1){const r=typeof t.modelValue=="string"||typeof t.modelValue=="number"?(""+t.modelValue).length:Array.isArray(t.modelValue)===!0?t.modelValue.length:0,g=t.maxlength!==void 0?t.maxlength:t.maxValues;return r+(g!==void 0?" / "+g:"")}}));const{isDirtyModel:A,hasRules:M,hasError:y,errorMessage:v,resetValidation:H}=ct(e.focused,e.innerLoading),P=e.floatingLabel!==void 0?p(()=>t.stackLabel===!0||e.focused.value===!0||e.floatingLabel.value===!0):p(()=>t.stackLabel===!0||e.focused.value===!0||e.hasValue.value===!0),D=p(()=>t.bottomSlots===!0||t.hint!==void 0||M.value===!0||t.counter===!0||t.error!==null),$=p(()=>t.filled===!0?"filled":t.outlined===!0?"outlined":t.borderless===!0?"borderless":t.standout?"standout":"standard"),I=p(()=>`q-field row no-wrap items-start q-field--${$.value}`+(e.fieldClass!==void 0?` ${e.fieldClass.value}`:"")+(t.rounded===!0?" q-field--rounded":"")+(t.square===!0?" q-field--square":"")+(P.value===!0?" q-field--float":"")+(_.value===!0?" q-field--labeled":"")+(t.dense===!0?" q-field--dense":"")+(t.itemAligned===!0?" q-field--item-aligned q-item-type":"")+(e.isDark.value===!0?" q-field--dark":"")+(e.getControl===void 0?" q-field--auto-height":"")+(e.focused.value===!0?" q-field--focused":"")+(y.value===!0?" q-field--error":"")+(y.value===!0||e.focused.value===!0?" q-field--highlighted":"")+(t.hideBottomSpace!==!0&&D.value===!0?" q-field--with-bottom":"")+(t.disable===!0?" q-field--disabled":t.readonly===!0?" q-field--readonly":"")),j=p(()=>"q-field__control relative-position row no-wrap"+(t.bgColor!==void 0?` bg-${t.bgColor}`:"")+(y.value===!0?" text-negative":typeof t.standout=="string"&&t.standout.length!==0&&e.focused.value===!0?` ${t.standout}`:t.color!==void 0?` text-${t.color}`:"")),_=p(()=>t.labelSlot===!0||t.label!==void 0),W=p(()=>"q-field__label no-pointer-events absolute ellipsis"+(t.labelColor!==void 0&&y.value!==!0?` text-${t.labelColor}`:"")),L=p(()=>({id:e.targetUid.value,editable:e.editable.value,focused:e.focused.value,floatingLabel:P.value,modelValue:t.modelValue,emitValue:e.emitValue})),N=p(()=>{const r={};return e.targetUid.value&&(r.for=e.targetUid.value),t.disable===!0&&(r["aria-disabled"]="true"),r});function R(){const r=document.activeElement;let g=e.targetRef!==void 0&&e.targetRef.value;g&&(r===null||r.id!==e.targetUid.value)&&(g.hasAttribute("tabindex")===!0||(g=g.querySelector("[tabindex]")),g&&g!==r&&g.focus({preventScroll:!0}))}function x(){re(R)}function B(){He(R);const r=document.activeElement;r!==null&&e.rootRef.value.contains(r)&&r.blur()}function o(r){w!==null&&(clearTimeout(w),w=null),e.editable.value===!0&&e.focused.value===!1&&(e.focused.value=!0,s("focus",r))}function n(r,g){w!==null&&clearTimeout(w),w=setTimeout(()=>{w=null,!(document.hasFocus()===!0&&(e.hasPopupOpen===!0||e.controlRef===void 0||e.controlRef.value===null||e.controlRef.value.contains(document.activeElement)!==!1))&&(e.focused.value===!0&&(e.focused.value=!1,s("blur",r)),g!==void 0&&g())})}function i(r){pe(r),f.platform.is.mobile!==!0?(e.targetRef!==void 0&&e.targetRef.value||e.rootRef.value).focus():e.rootRef.value.contains(document.activeElement)===!0&&document.activeElement.blur(),t.type==="file"&&(e.inputRef.value.value=null),s("update:modelValue",null),e.changeEvent===!0&&s("change",null),s("clear",t.modelValue),Y(()=>{const g=A.value;H(),A.value=g})}function a(r){[13,32].includes(r.keyCode)&&i(r)}function m(){const r=[];return u.prepend!==void 0&&r.push(q("div",{class:"q-field__prepend q-field__marginal row no-wrap items-center",key:"prepend",onClick:G},u.prepend())),r.push(q("div",{class:"q-field__control-container col relative-position row no-wrap q-anchor--skip"},h())),y.value===!0&&t.noErrorIcon===!1&&r.push(b("error",[q(de,{name:f.iconSet.field.error,color:"negative"})])),t.loading===!0||e.innerLoading.value===!0?r.push(b("inner-loading-append",u.loading!==void 0?u.loading():[q(lt,{color:t.color})])):t.clearable===!0&&e.hasValue.value===!0&&e.editable.value===!0&&r.push(b("inner-clearable-append",[q(de,{class:"q-field__focusable-action",name:t.clearIcon||f.iconSet.field.clear,tabindex:0,role:"button","aria-hidden":"false","aria-label":f.lang.label.clear,onKeyup:a,onClick:i})])),u.append!==void 0&&r.push(q("div",{class:"q-field__append q-field__marginal row no-wrap items-center",key:"append",onClick:G},u.append())),e.getInnerAppend!==void 0&&r.push(b("inner-append",e.getInnerAppend())),e.getControlChild!==void 0&&r.push(e.getControlChild()),r}function h(){const r=[];return t.prefix!==void 0&&t.prefix!==null&&r.push(q("div",{class:"q-field__prefix no-pointer-events row items-center"},t.prefix)),e.getShadowControl!==void 0&&e.hasShadow.value===!0&&r.push(e.getShadowControl()),e.getControl!==void 0?r.push(e.getControl()):u.rawControl!==void 0?r.push(u.rawControl()):u.control!==void 0&&r.push(q("div",{ref:e.targetRef,class:"q-field__native row",tabindex:-1,...e.splitAttrs.attributes.value,"data-autofocus":t.autofocus===!0||void 0},u.control(L.value))),_.value===!0&&r.push(q("div",{class:W.value},J(u.label,t.label))),t.suffix!==void 0&&t.suffix!==null&&r.push(q("div",{class:"q-field__suffix no-pointer-events row items-center"},t.suffix)),r.concat(J(u.default))}function V(){let r,g;y.value===!0?v.value!==null?(r=[q("div",{role:"alert"},v.value)],g=`q--slot-error-${v.value}`):(r=J(u.error),g="q--slot-error"):(t.hideHint!==!0||e.focused.value===!0)&&(t.hint!==void 0?(r=[q("div",t.hint)],g=`q--slot-hint-${t.hint}`):(r=J(u.hint),g="q--slot-hint"));const S=t.counter===!0||u.counter!==void 0;if(t.hideBottomSpace===!0&&S===!1&&r===void 0)return;const F=q("div",{key:g,class:"q-field__messages col"},r);return q("div",{class:"q-field__bottom row items-start q-field__bottom--"+(t.hideBottomSpace!==!0?"animated":"stale"),onClick:G},[t.hideBottomSpace===!0?F:q(he,{name:"q-transition--field-message"},()=>F),S===!0?q("div",{class:"q-field__counter"},u.counter!==void 0?u.counter():e.computedCounter.value):null])}function b(r,g){return g===null?null:q("div",{key:r,class:"q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"},g)}let C=!1;return Ve(()=>{C=!0}),Ee(()=>{C===!0&&t.autofocus===!0&&d.focus()}),t.autofocus===!0&&ae(()=>{d.focus()}),ee(()=>{w!==null&&clearTimeout(w)}),Object.assign(d,{focus:x,blur:B}),function(){const g=e.getControl===void 0&&u.control===void 0?{...e.splitAttrs.attributes.value,"data-autofocus":t.autofocus===!0||void 0,...N.value}:N.value;return q(e.tag.value,{ref:e.rootRef,class:[I.value,c.class],style:c.style,...g},[u.before!==void 0?q("div",{class:"q-field__before q-field__marginal row no-wrap items-center",onClick:G},u.before()):null,q("div",{class:"q-field__inner relative-position col self-stretch"},[q("div",{ref:e.controlRef,class:j.value,tabindex:-1,...e.controlEvents},m()),D.value===!0?V():null]),u.after!==void 0?q("div",{class:"q-field__after q-field__marginal row no-wrap items-center",onClick:G},u.after()):null])}}const ge={date:"####/##/##",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"},te={"#":{pattern:"[\\d]",negate:"[^\\d]"},S:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]"},N:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]"},A:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]",transform:e=>e.toLocaleUpperCase()},a:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]",transform:e=>e.toLocaleLowerCase()},X:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]",transform:e=>e.toLocaleUpperCase()},x:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]",transform:e=>e.toLocaleLowerCase()}},Ce=Object.keys(te);Ce.forEach(e=>{te[e].regex=new RegExp(te[e].pattern)});const ht=new RegExp("\\\\([^.*+?^${}()|([\\]])|([.*+?^${}()|[\\]])|(["+Ce.join("")+"])|(.)","g"),me=/[.*+?^${}()|[\]\\]/g,T="",bt={mask:String,reverseFillMask:Boolean,fillMask:[Boolean,String],unmaskedValue:Boolean};function kt(e,t,s,u){let c,d,f,w,A,M;const y=z(null),v=z(P());function H(){return e.autogrow===!0||["textarea","text","search","url","tel","password"].includes(e.type)}K(()=>e.type+e.autogrow,$),K(()=>e.mask,o=>{if(o!==void 0)I(v.value,!0);else{const n=x(v.value);$(),e.modelValue!==n&&t("update:modelValue",n)}}),K(()=>e.fillMask+e.reverseFillMask,()=>{y.value===!0&&I(v.value,!0)}),K(()=>e.unmaskedValue,()=>{y.value===!0&&I(v.value)});function P(){if($(),y.value===!0){const o=N(x(e.modelValue));return e.fillMask!==!1?B(o):o}return e.modelValue}function D(o){if(o<c.length)return c.slice(-o);let n="",i=c;const a=i.indexOf(T);if(a!==-1){for(let m=o-i.length;m>0;m--)n+=T;i=i.slice(0,a)+n+i.slice(a)}return i}function $(){if(y.value=e.mask!==void 0&&e.mask.length!==0&&H(),y.value===!1){w=void 0,c="",d="";return}const o=ge[e.mask]===void 0?e.mask:ge[e.mask],n=typeof e.fillMask=="string"&&e.fillMask.length!==0?e.fillMask.slice(0,1):"_",i=n.replace(me,"\\$&"),a=[],m=[],h=[];let V=e.reverseFillMask===!0,b="",C="";o.replace(ht,(F,l,E,Q,U)=>{if(Q!==void 0){const O=te[Q];h.push(O),C=O.negate,V===!0&&(m.push("(?:"+C+"+)?("+O.pattern+"+)?(?:"+C+"+)?("+O.pattern+"+)?"),V=!1),m.push("(?:"+C+"+)?("+O.pattern+")?")}else if(E!==void 0)b="\\"+(E==="\\"?"":E),h.push(E),a.push("([^"+b+"]+)?"+b+"?");else{const O=l!==void 0?l:U;b=O==="\\"?"\\\\\\\\":O.replace(me,"\\\\$&"),h.push(O),a.push("([^"+b+"]+)?"+b+"?")}});const r=new RegExp("^"+a.join("")+"("+(b===""?".":"[^"+b+"]")+"+)?"+(b===""?"":"["+b+"]*")+"$"),g=m.length-1,S=m.map((F,l)=>l===0&&e.reverseFillMask===!0?new RegExp("^"+i+"*"+F):l===g?new RegExp("^"+F+"("+(C===""?".":C)+"+)?"+(e.reverseFillMask===!0?"$":i+"*")):new RegExp("^"+F));f=h,w=F=>{const l=r.exec(e.reverseFillMask===!0?F:F.slice(0,h.length+1));l!==null&&(F=l.slice(1).join(""));const E=[],Q=S.length;for(let U=0,O=F;U<Q;U++){const Z=S[U].exec(O);if(Z===null)break;O=O.slice(Z.shift().length),E.push(...Z)}return E.length!==0?E.join(""):F},c=h.map(F=>typeof F=="string"?F:T).join(""),d=c.split(T).join(n)}function I(o,n,i){const a=u.value,m=a.selectionEnd,h=a.value.length-m,V=x(o);n===!0&&$();const b=N(V),C=e.fillMask!==!1?B(b):b,r=v.value!==C;a.value!==C&&(a.value=C),r===!0&&(v.value=C),document.activeElement===a&&Y(()=>{if(C===d){const S=e.reverseFillMask===!0?d.length:0;a.setSelectionRange(S,S,"forward");return}if(i==="insertFromPaste"&&e.reverseFillMask!==!0){const S=a.selectionEnd;let F=m-1;for(let l=A;l<=F&&l<S;l++)c[l]!==T&&F++;_.right(a,F);return}if(["deleteContentBackward","deleteContentForward"].indexOf(i)!==-1){const S=e.reverseFillMask===!0?m===0?C.length>b.length?1:0:Math.max(0,C.length-(C===d?0:Math.min(b.length,h)+1))+1:m;a.setSelectionRange(S,S,"forward");return}if(e.reverseFillMask===!0)if(r===!0){const S=Math.max(0,C.length-(C===d?0:Math.min(b.length,h+1)));S===1&&m===1?a.setSelectionRange(S,S,"forward"):_.rightReverse(a,S)}else{const S=C.length-h;a.setSelectionRange(S,S,"backward")}else if(r===!0){const S=Math.max(0,c.indexOf(T),Math.min(b.length,m)-1);_.right(a,S)}else{const S=m-1;_.right(a,S)}});const g=e.unmaskedValue===!0?x(C):C;String(e.modelValue)!==g&&(e.modelValue!==null||g!=="")&&s(g,!0)}function j(o,n,i){const a=N(x(o.value));n=Math.max(0,c.indexOf(T),Math.min(a.length,n)),A=n,o.setSelectionRange(n,i,"forward")}const _={left(o,n){const i=c.slice(n-1).indexOf(T)===-1;let a=Math.max(0,n-1);for(;a>=0;a--)if(c[a]===T){n=a,i===!0&&n++;break}if(a<0&&c[n]!==void 0&&c[n]!==T)return _.right(o,0);n>=0&&o.setSelectionRange(n,n,"backward")},right(o,n){const i=o.value.length;let a=Math.min(i,n+1);for(;a<=i;a++)if(c[a]===T){n=a;break}else c[a-1]===T&&(n=a);if(a>i&&c[n-1]!==void 0&&c[n-1]!==T)return _.left(o,i);o.setSelectionRange(n,n,"forward")},leftReverse(o,n){const i=D(o.value.length);let a=Math.max(0,n-1);for(;a>=0;a--)if(i[a-1]===T){n=a;break}else if(i[a]===T&&(n=a,a===0))break;if(a<0&&i[n]!==void 0&&i[n]!==T)return _.rightReverse(o,0);n>=0&&o.setSelectionRange(n,n,"backward")},rightReverse(o,n){const i=o.value.length,a=D(i),m=a.slice(0,n+1).indexOf(T)===-1;let h=Math.min(i,n+1);for(;h<=i;h++)if(a[h-1]===T){n=h,n>0&&m===!0&&n--;break}if(h>i&&a[n-1]!==void 0&&a[n-1]!==T)return _.leftReverse(o,i);o.setSelectionRange(n,n,"forward")}};function W(o){t("click",o),M=void 0}function L(o){if(t("keydown",o),Xe(o)===!0||o.altKey===!0)return;const n=u.value,i=n.selectionStart,a=n.selectionEnd;if(o.shiftKey||(M=void 0),o.keyCode===37||o.keyCode===39){o.shiftKey&&M===void 0&&(M=n.selectionDirection==="forward"?i:a);const m=_[(o.keyCode===39?"right":"left")+(e.reverseFillMask===!0?"Reverse":"")];if(o.preventDefault(),m(n,M===i?a:i),o.shiftKey){const h=n.selectionStart;n.setSelectionRange(Math.min(M,h),Math.max(M,h),"forward")}}else o.keyCode===8&&e.reverseFillMask!==!0&&i===a?(_.left(n,i),n.setSelectionRange(n.selectionStart,a,"backward")):o.keyCode===46&&e.reverseFillMask===!0&&i===a&&(_.rightReverse(n,a),n.setSelectionRange(i,n.selectionEnd,"forward"))}function N(o){if(o==null||o==="")return"";if(e.reverseFillMask===!0)return R(o);const n=f;let i=0,a="";for(let m=0;m<n.length;m++){const h=o[i],V=n[m];if(typeof V=="string")a+=V,h===V&&i++;else if(h!==void 0&&V.regex.test(h))a+=V.transform!==void 0?V.transform(h):h,i++;else return a}return a}function R(o){const n=f,i=c.indexOf(T);let a=o.length-1,m="";for(let h=n.length-1;h>=0&&a!==-1;h--){const V=n[h];let b=o[a];if(typeof V=="string")m=V+m,b===V&&a--;else if(b!==void 0&&V.regex.test(b))do m=(V.transform!==void 0?V.transform(b):b)+m,a--,b=o[a];while(i===h&&b!==void 0&&V.regex.test(b));else return m}return m}function x(o){return typeof o!="string"||w===void 0?typeof o=="number"?w(""+o):o:w(o)}function B(o){return d.length-o.length<=0?o:e.reverseFillMask===!0&&o.length!==0?d.slice(0,-o.length)+o:o+d.slice(o.length)}return{innerValue:v,hasMask:y,moveCursorForPaste:j,updateMaskValue:I,onMaskedKeydown:L,onMaskedClick:W}}function yt(e,t){function s(){const u=e.modelValue;try{const c="DataTransfer"in window?new DataTransfer:"ClipboardEvent"in window?new ClipboardEvent("").clipboardData:void 0;return Object(u)===u&&("length"in u?Array.from(u):[u]).forEach(d=>{c.items.add(d)}),{files:c.files}}catch{return{files:void 0}}}return t===!0?p(()=>{if(e.type==="file")return s()}):p(s)}function pt(e){return function(s){if(s.type==="compositionend"||s.type==="change"){if(s.target.qComposing!==!0)return;s.target.qComposing=!1,e(s)}else s.type==="compositionstart"&&(s.target.qComposing=!0)}}const Pt=ye({name:"QInput",inheritAttrs:!1,props:{...ft,...bt,...ot,modelValue:[String,Number,FileList],shadowText:String,type:{type:String,default:"text"},debounce:[String,Number],autogrow:Boolean,inputClass:[Array,String,Object],inputStyle:[Array,String,Object]},emits:[...vt,"paste","change","keydown","click","animationend"],setup(e,{emit:t,attrs:s}){const{proxy:u}=X(),{$q:c}=u,d={};let f=NaN,w,A,M=null,y;const v=z(null),H=at(e),{innerValue:P,hasMask:D,moveCursorForPaste:$,updateMaskValue:I,onMaskedKeydown:j,onMaskedClick:_}=kt(e,t,b,v),W=yt(e,!0),L=p(()=>oe(P.value)),N=pt(h),R=gt({changeEvent:!0}),x=p(()=>e.type==="textarea"||e.autogrow===!0),B=p(()=>x.value===!0||["text","search","url","tel","password"].includes(e.type)),o=p(()=>{const l={...R.splitAttrs.listeners.value,onInput:h,onPaste:m,onChange:r,onBlur:g,onFocus:ce};return l.onCompositionstart=l.onCompositionupdate=l.onCompositionend=N,D.value===!0&&(l.onKeydown=j,l.onClick=_),e.autogrow===!0&&(l.onAnimationend=V),l}),n=p(()=>{const l={tabindex:0,"data-autofocus":e.autofocus===!0||void 0,rows:e.type==="textarea"?6:void 0,"aria-label":e.label,name:H.value,...R.splitAttrs.attributes.value,id:R.targetUid.value,maxlength:e.maxlength,disabled:e.disable===!0,readonly:e.readonly===!0};return x.value===!1&&(l.type=e.type),e.autogrow===!0&&(l.rows=1),l});K(()=>e.type,()=>{v.value&&(v.value.value=e.modelValue)}),K(()=>e.modelValue,l=>{if(D.value===!0){if(A===!0&&(A=!1,String(l)===f))return;I(l)}else P.value!==l&&(P.value=l,e.type==="number"&&d.hasOwnProperty("value")===!0&&(w===!0?w=!1:delete d.value));e.autogrow===!0&&Y(C)}),K(()=>e.autogrow,l=>{l===!0?Y(C):v.value!==null&&s.rows>0&&(v.value.style.height="auto")}),K(()=>e.dense,()=>{e.autogrow===!0&&Y(C)});function i(){re(()=>{const l=document.activeElement;v.value!==null&&v.value!==l&&(l===null||l.id!==R.targetUid.value)&&v.value.focus({preventScroll:!0})})}function a(){v.value!==null&&v.value.select()}function m(l){if(D.value===!0&&e.reverseFillMask!==!0){const E=l.target;$(E,E.selectionStart,E.selectionEnd)}t("paste",l)}function h(l){if(!l||!l.target)return;if(e.type==="file"){t("update:modelValue",l.target.files);return}const E=l.target.value;if(l.target.qComposing===!0){d.value=E;return}if(D.value===!0)I(E,!1,l.inputType);else if(b(E),B.value===!0&&l.target===document.activeElement){const{selectionStart:Q,selectionEnd:U}=l.target;Q!==void 0&&U!==void 0&&Y(()=>{l.target===document.activeElement&&E.indexOf(l.target.value)===0&&l.target.setSelectionRange(Q,U)})}e.autogrow===!0&&C()}function V(l){t("animationend",l),C()}function b(l,E){y=()=>{M=null,e.type!=="number"&&d.hasOwnProperty("value")===!0&&delete d.value,e.modelValue!==l&&f!==l&&(f=l,E===!0&&(A=!0),t("update:modelValue",l),Y(()=>{f===l&&(f=NaN)})),y=void 0},e.type==="number"&&(w=!0,d.value=l),e.debounce!==void 0?(M!==null&&clearTimeout(M),d.value=l,M=setTimeout(y,e.debounce)):y()}function C(){requestAnimationFrame(()=>{const l=v.value;if(l!==null){const E=l.parentNode.style,{scrollTop:Q}=l,{overflowY:U,maxHeight:O}=c.platform.is.firefox===!0?{}:window.getComputedStyle(l),Z=U!==void 0&&U!=="scroll";Z===!0&&(l.style.overflowY="hidden"),E.marginBottom=l.scrollHeight-1+"px",l.style.height="1px",l.style.height=l.scrollHeight+"px",Z===!0&&(l.style.overflowY=parseInt(O,10)<l.scrollHeight?"auto":"hidden"),E.marginBottom="",l.scrollTop=Q}})}function r(l){N(l),M!==null&&(clearTimeout(M),M=null),y!==void 0&&y(),t("change",l.target.value)}function g(l){l!==void 0&&ce(l),M!==null&&(clearTimeout(M),M=null),y!==void 0&&y(),w=!1,A=!1,delete d.value,e.type!=="file"&&setTimeout(()=>{v.value!==null&&(v.value.value=P.value!==void 0?P.value:"")})}function S(){return d.hasOwnProperty("value")===!0?d.value:P.value!==void 0?P.value:""}ee(()=>{g()}),ae(()=>{e.autogrow===!0&&C()}),Object.assign(R,{innerValue:P,fieldClass:p(()=>`q-${x.value===!0?"textarea":"input"}`+(e.autogrow===!0?" q-textarea--autogrow":"")),hasShadow:p(()=>e.type!=="file"&&typeof e.shadowText=="string"&&e.shadowText.length!==0),inputRef:v,emitValue:b,hasValue:L,floatingLabel:p(()=>L.value===!0&&(e.type!=="number"||isNaN(P.value)===!1)||oe(e.displayValue)),getControl:()=>q(x.value===!0?"textarea":"input",{ref:v,class:["q-field__native q-placeholder",e.inputClass],style:e.inputStyle,...n.value,...o.value,...e.type!=="file"?{value:S()}:W.value}),getShadowControl:()=>q("div",{class:"q-field__native q-field__shadow absolute-bottom no-pointer-events"+(x.value===!0?"":" text-no-wrap")},[q("span",{class:"invisible"},S()),q("span",e.shadowText)])});const F=mt(R);return Object.assign(u,{focus:i,select:a,getNativeElement:()=>v.value}),xe(u,"nativeEl",()=>v.value),F}});export{Pt as Q,Tt as a,vt as b,mt as c,gt as d,pt as e,oe as f,ft as u};