ray-template/assets/index.0930e28c.js
2022-11-23 16:14:12 +08:00

326 lines
58 KiB
JavaScript

import{i as ce,g as Jt,w as we,o as Zt,a as Qt,d as Q,r as q,u as en,c as tn,h as x,b as Qe,e as nn,f as Ae,j as rn,k as P,l as _,m as j,n as Ke,p as Oe,q as le,s as Ee,t as Rt,v as et,x as z,y as ze,z as St,A as an,B as J,C as Z,D as tt,E as on,F as sn,G as Je,T as ln,H as Ve,I as B,J as nt,K as dn,L as ye,M as fn,N as cn,O as un,P as bn,Q as gn,R as mn,S as hn,U as pn,V as rt,W as je,X as vn,Y as yn,Z as xn,_ as at,$ as Fe,a0 as We,a1 as wn,a2 as Rn,a3 as Sn,a4 as Pn,a5 as kn,a6 as Pt,a7 as M,a8 as $n,a9 as it,aa as Cn,ab as Fn,ac as _n,ad as zn,ae as Tn,af as An,ag as En,ah as On,ai as Ln,aj as qn,ak as jn,al as Wn,am as In,an as Mn}from"./index.c3f05d90.js";import{N as Bn}from"./Result.73c7407c.js";function Nn(t,e,n){var r;const a=ce(t,null);if(a===null)return;const i=(r=Jt())===null||r===void 0?void 0:r.proxy;we(n,o),o(n.value),Zt(()=>{o(void 0,n.value)});function o(d,f){const c=a[e];f!==void 0&&s(c,f),d!==void 0&&l(c,d)}function s(d,f){d[f]||(d[f]=[]),d[f].splice(d[f].findIndex(c=>c===i),1)}function l(d,f){d[f]||(d[f]=[]),~d[f].findIndex(c=>c===i)||d[f].push(i)}}let ot=!1;function Vn(){if(!!Qt&&!!window.CSS&&!ot&&(ot=!0,"registerProperty"in(window==null?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"<color>",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"<color>",inherits:!1,initialValue:"#0000"})}catch{}}const Dn=Qe(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[Qe("&::-webkit-scrollbar",{width:0,height:0})]),Hn=Q({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const t=q(null);function e(a){!(a.currentTarget.offsetWidth<a.currentTarget.scrollWidth)||a.deltaY===0||(a.currentTarget.scrollLeft+=a.deltaY+a.deltaX,a.preventDefault())}const n=en();return Dn.mount({id:"vueuc/x-scroll",head:!0,anchorMetaName:tn,ssr:n}),Object.assign({selfRef:t,handleWheel:e},{scrollTo(...a){var i;(i=t.value)===null||i===void 0||i.scrollTo(...a)}})},render(){return x("div",{ref:"selfRef",onScroll:this.onScroll,onWheel:this.disabled?void 0:this.handleWheel,class:"v-x-scroll"},this.$slots)}});var Un=/\s/;function Yn(t){for(var e=t.length;e--&&Un.test(t.charAt(e)););return e}var Gn=/^\s+/;function Xn(t){return t&&t.slice(0,Yn(t)+1).replace(Gn,"")}var st=0/0,Kn=/^[-+]0x[0-9a-f]+$/i,Jn=/^0b[01]+$/i,Zn=/^0o[0-7]+$/i,Qn=parseInt;function lt(t){if(typeof t=="number")return t;if(nn(t))return st;if(Ae(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ae(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Xn(t);var n=Jn.test(t);return n||Zn.test(t)?Qn(t.slice(2),n?2:8):Kn.test(t)?st:+t}var er=function(){return rn.Date.now()};const Ie=er;var tr="Expected a function",nr=Math.max,rr=Math.min;function ar(t,e,n){var r,a,i,o,s,l,d=0,f=!1,c=!1,h=!0;if(typeof t!="function")throw new TypeError(tr);e=lt(e)||0,Ae(n)&&(f=!!n.leading,c="maxWait"in n,i=c?nr(lt(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h);function u(R){var A=r,L=a;return r=a=void 0,d=R,o=t.apply(L,A),o}function w(R){return d=R,s=setTimeout(g,e),f?u(R):o}function m(R){var A=R-l,L=R-d,Y=e-A;return c?rr(Y,i-L):Y}function v(R){var A=R-l,L=R-d;return l===void 0||A>=e||A<0||c&&L>=i}function g(){var R=Ie();if(v(R))return T(R);s=setTimeout(g,m(R))}function T(R){return s=void 0,h&&r?u(R):(r=a=void 0,o)}function y(){s!==void 0&&clearTimeout(s),d=0,r=l=a=s=void 0}function C(){return s===void 0?o:T(Ie())}function O(){var R=Ie(),A=v(R);if(r=arguments,a=this,l=R,A){if(s===void 0)return w(l);if(c)return clearTimeout(s),s=setTimeout(g,e),u(l)}return s===void 0&&(s=setTimeout(g,e)),o}return O.cancel=y,O.flush=C,O}var ir="Expected a function";function Me(t,e,n){var r=!0,a=!0;if(typeof t!="function")throw new TypeError(ir);return Ae(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),ar(t,e,{leading:r,maxWait:e,trailing:a})}const or=Q({name:"Add",render(){return x("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}}),sr=P("form",[_("inline",`
width: 100%;
display: inline-flex;
align-items: flex-start;
align-content: space-around;
`,[P("form-item",{width:"auto",marginRight:"18px"},[j("&:last-child",{marginRight:0})])])]),Pe=Ke("n-form"),kt=Ke("n-form-item-insts");var lr=globalThis&&globalThis.__awaiter||function(t,e,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(f){try{d(r.next(f))}catch(c){o(c)}}function l(f){try{d(r.throw(f))}catch(c){o(c)}}function d(f){f.done?i(f.value):a(f.value).then(s,l)}d((r=r.apply(t,e||[])).next())})};const dr=Object.assign(Object.assign({},le.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:t=>t.preventDefault()},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),fr=Q({name:"Form",props:dr,setup(t){const{mergedClsPrefixRef:e}=Oe(t);le("Form","-form",sr,Rt,t,e);const n={},r=q(void 0),a=l=>{const d=r.value;(d===void 0||l>=d)&&(r.value=l)};function i(l,d=()=>!0){return lr(this,void 0,void 0,function*(){return yield new Promise((f,c)=>{const h=[];for(const u of et(n)){const w=n[u];for(const m of w)m.path&&h.push(m.internalValidate(null,d))}Promise.all(h).then(u=>{if(u.some(w=>!w.valid)){const w=u.filter(m=>m.errors).map(m=>m.errors);l&&l(w),c(w)}else l&&l(),f()})})})}function o(){for(const l of et(n)){const d=n[l];for(const f of d)f.restoreValidation()}}return Ee(Pe,{props:t,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:a}),Ee(kt,{formItems:n}),Object.assign({validate:i,restoreValidation:o},{mergedClsPrefix:e})},render(){const{mergedClsPrefix:t}=this;return x("form",{class:[`${t}-form`,this.inline&&`${t}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function fe(){return fe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},fe.apply(this,arguments)}function cr(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Se(t,e)}function De(t){return De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},De(t)}function Se(t,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Se(t,e)}function ur(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Te(t,e,n){return ur()?Te=Reflect.construct.bind():Te=function(a,i,o){var s=[null];s.push.apply(s,i);var l=Function.bind.apply(a,s),d=new l;return o&&Se(d,o.prototype),d},Te.apply(null,arguments)}function br(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function He(t){var e=typeof Map=="function"?new Map:void 0;return He=function(r){if(r===null||!br(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,a)}function a(){return Te(r,arguments,De(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Se(a,r)},He(t)}var gr=/%[sdj%]/g,mr=function(){};typeof process<"u"&&process.env;function Ue(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var r=n.field;e[r]=e[r]||[],e[r].push(n)}),e}function X(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var a=0,i=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var o=t.replace(gr,function(s){if(s==="%%")return"%";if(a>=i)return s;switch(s){case"%s":return String(n[a++]);case"%d":return Number(n[a++]);case"%j":try{return JSON.stringify(n[a++])}catch{return"[Circular]"}break;default:return s}});return o}return t}function hr(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function I(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||hr(e)&&typeof t=="string"&&!t)}function pr(t,e,n){var r=[],a=0,i=t.length;function o(s){r.push.apply(r,s||[]),a++,a===i&&n(r)}t.forEach(function(s){e(s,o)})}function dt(t,e,n){var r=0,a=t.length;function i(o){if(o&&o.length){n(o);return}var s=r;r=r+1,s<a?e(t[s],i):n([])}i([])}function vr(t){var e=[];return Object.keys(t).forEach(function(n){e.push.apply(e,t[n]||[])}),e}var ft=function(t){cr(e,t);function e(n,r){var a;return a=t.call(this,"Async Validation Error")||this,a.errors=n,a.fields=r,a}return e}(He(Error));function yr(t,e,n,r,a){if(e.first){var i=new Promise(function(h,u){var w=function(g){return r(g),g.length?u(new ft(g,Ue(g))):h(a)},m=vr(t);dt(m,n,w)});return i.catch(function(h){return h}),i}var o=e.firstFields===!0?Object.keys(t):e.firstFields||[],s=Object.keys(t),l=s.length,d=0,f=[],c=new Promise(function(h,u){var w=function(v){if(f.push.apply(f,v),d++,d===l)return r(f),f.length?u(new ft(f,Ue(f))):h(a)};s.length||(r(f),h(a)),s.forEach(function(m){var v=t[m];o.indexOf(m)!==-1?dt(v,n,w):pr(v,n,w)})});return c.catch(function(h){return h}),c}function xr(t){return!!(t&&t.message!==void 0)}function wr(t,e){for(var n=t,r=0;r<e.length;r++){if(n==null)return n;n=n[e[r]]}return n}function ct(t,e){return function(n){var r;return t.fullFields?r=wr(e,t.fullFields):r=e[n.field||t.fullField],xr(n)?(n.field=n.field||t.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||t.fullField}}}function ut(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];typeof r=="object"&&typeof t[n]=="object"?t[n]=fe({},t[n],r):t[n]=r}}return t}var $t=function(e,n,r,a,i,o){e.required&&(!r.hasOwnProperty(e.field)||I(n,o||e.type))&&a.push(X(i.messages.required,e.fullField))},Rr=function(e,n,r,a,i){(/^\s+$/.test(n)||n==="")&&a.push(X(i.messages.whitespace,e.fullField))},_e,Sr=function(){if(_e)return _e;var t="[a-fA-F\\d:]",e=function(C){return C&&C.includeBoundaries?"(?:(?<=\\s|^)(?="+t+")|(?<="+t+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",a=(`
(?:
(?:`+r+":){7}(?:"+r+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
(?:`+r+":){6}(?:"+n+"|:"+r+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
(?:`+r+":){5}(?::"+n+"|(?::"+r+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
(?:`+r+":){4}(?:(?::"+r+"){0,1}:"+n+"|(?::"+r+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
(?:`+r+":){3}(?:(?::"+r+"){0,2}:"+n+"|(?::"+r+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
(?:`+r+":){2}(?:(?::"+r+"){0,3}:"+n+"|(?::"+r+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
(?:`+r+":){1}(?:(?::"+r+"){0,4}:"+n+"|(?::"+r+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
(?::(?:(?::`+r+"){0,5}:"+n+"|(?::"+r+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),i=new RegExp("(?:^"+n+"$)|(?:^"+a+"$)"),o=new RegExp("^"+n+"$"),s=new RegExp("^"+a+"$"),l=function(C){return C&&C.exact?i:new RegExp("(?:"+e(C)+n+e(C)+")|(?:"+e(C)+a+e(C)+")","g")};l.v4=function(y){return y&&y.exact?o:new RegExp(""+e(y)+n+e(y),"g")},l.v6=function(y){return y&&y.exact?s:new RegExp(""+e(y)+a+e(y),"g")};var d="(?:(?:[a-z]+:)?//)",f="(?:\\S+(?::\\S*)?@)?",c=l.v4().source,h=l.v6().source,u="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",w="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",m="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",v="(?::\\d{2,5})?",g='(?:[/?#][^\\s"]*)?',T="(?:"+d+"|www\\.)"+f+"(?:localhost|"+c+"|"+h+"|"+u+w+m+")"+v+g;return _e=new RegExp("(?:^"+T+"$)","i"),_e},bt={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},xe={integer:function(e){return xe.number(e)&&parseInt(e,10)===e},float:function(e){return xe.number(e)&&!xe.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!xe.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(bt.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Sr())},hex:function(e){return typeof e=="string"&&!!e.match(bt.hex)}},Pr=function(e,n,r,a,i){if(e.required&&n===void 0){$t(e,n,r,a,i);return}var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=e.type;o.indexOf(s)>-1?xe[s](n)||a.push(X(i.messages.types[s],e.fullField,e.type)):s&&typeof n!==e.type&&a.push(X(i.messages.types[s],e.fullField,e.type))},kr=function(e,n,r,a,i){var o=typeof e.len=="number",s=typeof e.min=="number",l=typeof e.max=="number",d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=n,c=null,h=typeof n=="number",u=typeof n=="string",w=Array.isArray(n);if(h?c="number":u?c="string":w&&(c="array"),!c)return!1;w&&(f=n.length),u&&(f=n.replace(d,"_").length),o?f!==e.len&&a.push(X(i.messages[c].len,e.fullField,e.len)):s&&!l&&f<e.min?a.push(X(i.messages[c].min,e.fullField,e.min)):l&&!s&&f>e.max?a.push(X(i.messages[c].max,e.fullField,e.max)):s&&l&&(f<e.min||f>e.max)&&a.push(X(i.messages[c].range,e.fullField,e.min,e.max))},he="enum",$r=function(e,n,r,a,i){e[he]=Array.isArray(e[he])?e[he]:[],e[he].indexOf(n)===-1&&a.push(X(i.messages[he],e.fullField,e[he].join(", ")))},Cr=function(e,n,r,a,i){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||a.push(X(i.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var o=new RegExp(e.pattern);o.test(n)||a.push(X(i.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},$={required:$t,whitespace:Rr,type:Pr,range:kr,enum:$r,pattern:Cr},Fr=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n,"string")&&!e.required)return r();$.required(e,n,a,o,i,"string"),I(n,"string")||($.type(e,n,a,o,i),$.range(e,n,a,o,i),$.pattern(e,n,a,o,i),e.whitespace===!0&&$.whitespace(e,n,a,o,i))}r(o)},_r=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n)&&!e.required)return r();$.required(e,n,a,o,i),n!==void 0&&$.type(e,n,a,o,i)}r(o)},zr=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(n===""&&(n=void 0),I(n)&&!e.required)return r();$.required(e,n,a,o,i),n!==void 0&&($.type(e,n,a,o,i),$.range(e,n,a,o,i))}r(o)},Tr=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n)&&!e.required)return r();$.required(e,n,a,o,i),n!==void 0&&$.type(e,n,a,o,i)}r(o)},Ar=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n)&&!e.required)return r();$.required(e,n,a,o,i),I(n)||$.type(e,n,a,o,i)}r(o)},Er=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n)&&!e.required)return r();$.required(e,n,a,o,i),n!==void 0&&($.type(e,n,a,o,i),$.range(e,n,a,o,i))}r(o)},Or=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n)&&!e.required)return r();$.required(e,n,a,o,i),n!==void 0&&($.type(e,n,a,o,i),$.range(e,n,a,o,i))}r(o)},Lr=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(n==null&&!e.required)return r();$.required(e,n,a,o,i,"array"),n!=null&&($.type(e,n,a,o,i),$.range(e,n,a,o,i))}r(o)},qr=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n)&&!e.required)return r();$.required(e,n,a,o,i),n!==void 0&&$.type(e,n,a,o,i)}r(o)},jr="enum",Wr=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n)&&!e.required)return r();$.required(e,n,a,o,i),n!==void 0&&$[jr](e,n,a,o,i)}r(o)},Ir=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n,"string")&&!e.required)return r();$.required(e,n,a,o,i),I(n,"string")||$.pattern(e,n,a,o,i)}r(o)},Mr=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n,"date")&&!e.required)return r();if($.required(e,n,a,o,i),!I(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),$.type(e,l,a,o,i),l&&$.range(e,l.getTime(),a,o,i)}}r(o)},Br=function(e,n,r,a,i){var o=[],s=Array.isArray(n)?"array":typeof n;$.required(e,n,a,o,i,s),r(o)},Be=function(e,n,r,a,i){var o=e.type,s=[],l=e.required||!e.required&&a.hasOwnProperty(e.field);if(l){if(I(n,o)&&!e.required)return r();$.required(e,n,a,s,i,o),I(n,o)||$.type(e,n,a,s,i)}r(s)},Nr=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(I(n)&&!e.required)return r();$.required(e,n,a,o,i)}r(o)},Re={string:Fr,method:_r,number:zr,boolean:Tr,regexp:Ar,integer:Er,float:Or,array:Lr,object:qr,enum:Wr,pattern:Ir,date:Mr,url:Be,hex:Be,email:Be,required:Br,any:Nr};function Ye(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Ge=Ye(),ke=function(){function t(n){this.rules=null,this._messages=Ge,this.define(n)}var e=t.prototype;return e.define=function(r){var a=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(i){var o=r[i];a.rules[i]=Array.isArray(o)?o:[o]})},e.messages=function(r){return r&&(this._messages=ut(Ye(),r)),this._messages},e.validate=function(r,a,i){var o=this;a===void 0&&(a={}),i===void 0&&(i=function(){});var s=r,l=a,d=i;if(typeof l=="function"&&(d=l,l={}),!this.rules||Object.keys(this.rules).length===0)return d&&d(null,s),Promise.resolve(s);function f(m){var v=[],g={};function T(C){if(Array.isArray(C)){var O;v=(O=v).concat.apply(O,C)}else v.push(C)}for(var y=0;y<m.length;y++)T(m[y]);v.length?(g=Ue(v),d(v,g)):d(null,s)}if(l.messages){var c=this.messages();c===Ge&&(c=Ye()),ut(c,l.messages),l.messages=c}else l.messages=this.messages();var h={},u=l.keys||Object.keys(this.rules);u.forEach(function(m){var v=o.rules[m],g=s[m];v.forEach(function(T){var y=T;typeof y.transform=="function"&&(s===r&&(s=fe({},s)),g=s[m]=y.transform(g)),typeof y=="function"?y={validator:y}:y=fe({},y),y.validator=o.getValidationMethod(y),y.validator&&(y.field=m,y.fullField=y.fullField||m,y.type=o.getType(y),h[m]=h[m]||[],h[m].push({rule:y,value:g,source:s,field:m}))})});var w={};return yr(h,l,function(m,v){var g=m.rule,T=(g.type==="object"||g.type==="array")&&(typeof g.fields=="object"||typeof g.defaultField=="object");T=T&&(g.required||!g.required&&m.value),g.field=m.field;function y(R,A){return fe({},A,{fullField:g.fullField+"."+R,fullFields:g.fullFields?[].concat(g.fullFields,[R]):[R]})}function C(R){R===void 0&&(R=[]);var A=Array.isArray(R)?R:[R];!l.suppressWarning&&A.length&&t.warning("async-validator:",A),A.length&&g.message!==void 0&&(A=[].concat(g.message));var L=A.map(ct(g,s));if(l.first&&L.length)return w[g.field]=1,v(L);if(!T)v(L);else{if(g.required&&!m.value)return g.message!==void 0?L=[].concat(g.message).map(ct(g,s)):l.error&&(L=[l.error(g,X(l.messages.required,g.field))]),v(L);var Y={};g.defaultField&&Object.keys(m.value).map(function(W){Y[W]=g.defaultField}),Y=fe({},Y,m.rule.fields);var ee={};Object.keys(Y).forEach(function(W){var S=Y[W],D=Array.isArray(S)?S:[S];ee[W]=D.map(y.bind(null,W))});var G=new t(ee);G.messages(l.messages),m.rule.options&&(m.rule.options.messages=l.messages,m.rule.options.error=l.error),G.validate(m.value,m.rule.options||l,function(W){var S=[];L&&L.length&&S.push.apply(S,L),W&&W.length&&S.push.apply(S,W),v(S.length?S:null)})}}var O;if(g.asyncValidator)O=g.asyncValidator(g,m.value,C,m.source,l);else if(g.validator){try{O=g.validator(g,m.value,C,m.source,l)}catch(R){console.error==null||console.error(R),l.suppressValidatorError||setTimeout(function(){throw R},0),C(R.message)}O===!0?C():O===!1?C(typeof g.message=="function"?g.message(g.fullField||g.field):g.message||(g.fullField||g.field)+" fails"):O instanceof Array?C(O):O instanceof Error&&C(O.message)}O&&O.then&&O.then(function(){return C()},function(R){return C(R)})},function(m){f(m)},s)},e.getType=function(r){if(r.type===void 0&&r.pattern instanceof RegExp&&(r.type="pattern"),typeof r.validator!="function"&&r.type&&!Re.hasOwnProperty(r.type))throw new Error(X("Unknown rule type %s",r.type));return r.type||"string"},e.getValidationMethod=function(r){if(typeof r.validator=="function")return r.validator;var a=Object.keys(r),i=a.indexOf("message");return i!==-1&&a.splice(i,1),a.length===1&&a[0]==="required"?Re.required:Re[this.getType(r)]||void 0},t}();ke.register=function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");Re[e]=n};ke.warning=mr;ke.messages=Ge;ke.validators=Re;function Vr(t){const e=ce(Pe,null);return{mergedSize:z(()=>t.size!==void 0?t.size:(e==null?void 0:e.props.size)!==void 0?e.props.size:"medium")}}function Dr(t){const e=ce(Pe,null),n=z(()=>{const{labelPlacement:u}=t;return u!==void 0?u:e!=null&&e.props.labelPlacement?e.props.labelPlacement:"top"}),r=z(()=>n.value==="left"&&(t.labelWidth==="auto"||(e==null?void 0:e.props.labelWidth)==="auto")),a=z(()=>{if(n.value==="top")return;const{labelWidth:u}=t;if(u!==void 0&&u!=="auto")return ze(u);if(r.value){const w=e==null?void 0:e.maxChildLabelWidthRef.value;return w!==void 0?ze(w):void 0}if((e==null?void 0:e.props.labelWidth)!==void 0)return ze(e.props.labelWidth)}),i=z(()=>{const{labelAlign:u}=t;if(u)return u;if(e!=null&&e.props.labelAlign)return e.props.labelAlign}),o=z(()=>{var u;return[(u=t.labelProps)===null||u===void 0?void 0:u.style,t.labelStyle,{width:a.value}]}),s=z(()=>{const{showRequireMark:u}=t;return u!==void 0?u:e==null?void 0:e.props.showRequireMark}),l=z(()=>{const{requireMarkPlacement:u}=t;return u!==void 0?u:(e==null?void 0:e.props.requireMarkPlacement)||"right"}),d=q(!1),f=z(()=>{const{validationStatus:u}=t;if(u!==void 0)return u;if(d.value)return"error"}),c=z(()=>{const{showFeedback:u}=t;return u!==void 0?u:(e==null?void 0:e.props.showFeedback)!==void 0?e.props.showFeedback:!0}),h=z(()=>{const{showLabel:u}=t;return u!==void 0?u:(e==null?void 0:e.props.showLabel)!==void 0?e.props.showLabel:!0});return{validationErrored:d,mergedLabelStyle:o,mergedLabelPlacement:n,mergedLabelAlign:i,mergedShowRequireMark:s,mergedRequireMarkPlacement:l,mergedValidationStatus:f,mergedShowFeedback:c,mergedShowLabel:h,isAutoLabelWidth:r}}function Hr(t){const e=ce(Pe,null),n=z(()=>{const{rulePath:o}=t;if(o!==void 0)return o;const{path:s}=t;if(s!==void 0)return s}),r=z(()=>{const o=[],{rule:s}=t;if(s!==void 0&&(Array.isArray(s)?o.push(...s):o.push(s)),e){const{rules:l}=e.props,{value:d}=n;if(l!==void 0&&d!==void 0){const f=St(l,d);f!==void 0&&(Array.isArray(f)?o.push(...f):o.push(f))}}return o}),a=z(()=>r.value.some(o=>o.required)),i=z(()=>a.value||t.required);return{mergedRules:r,mergedRequired:i}}const{cubicBezierEaseInOut:gt}=an;function Ur({name:t="fade-down",fromOffset:e="-4px",enterDuration:n=".3s",leaveDuration:r=".3s",enterCubicBezier:a=gt,leaveCubicBezier:i=gt}={}){return[j(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0,transform:`translateY(${e})`}),j(`&.${t}-transition-enter-to, &.${t}-transition-leave-from`,{opacity:1,transform:"translateY(0)"}),j(`&.${t}-transition-leave-active`,{transition:`opacity ${r} ${i}, transform ${r} ${i}`}),j(`&.${t}-transition-enter-active`,{transition:`opacity ${n} ${a}, transform ${n} ${a}`})]}const Yr=P("form-item",`
display: grid;
line-height: var(--n-line-height);
`,[P("form-item-label",`
grid-area: label;
align-items: center;
line-height: 1.25;
text-align: var(--n-label-text-align);
font-size: var(--n-label-font-size);
min-height: var(--n-label-height);
padding: var(--n-label-padding);
color: var(--n-label-text-color);
transition: color .3s var(--n-bezier);
box-sizing: border-box;
`,[J("asterisk",`
white-space: nowrap;
user-select: none;
-webkit-user-select: none;
color: var(--n-asterisk-color);
transition: color .3s var(--n-bezier);
`),J("asterisk-placeholder",`
grid-area: mark;
user-select: none;
-webkit-user-select: none;
visibility: hidden;
`)]),P("form-item-blank",`
grid-area: blank;
min-height: var(--n-blank-height);
`),_("auto-label-width",[P("form-item-label","white-space: nowrap;")]),_("left-labelled",`
grid-template-areas:
"label blank"
"label feedback";
grid-template-columns: auto minmax(0, 1fr);
grid-template-rows: auto 1fr;
align-items: start;
`,[P("form-item-label",`
display: grid;
grid-template-columns: 1fr auto;
min-height: var(--n-blank-height);
height: auto;
box-sizing: border-box;
flex-shrink: 0;
flex-grow: 0;
`,[_("reverse-columns-space",`
grid-template-columns: auto 1fr;
`),_("left-mark",`
grid-template-areas:
"mark text"
". text";
`),_("right-mark",`
grid-template-areas:
"text mark"
"text .";
`),_("right-hanging-mark",`
grid-template-areas:
"text mark"
"text .";
`),J("text",`
grid-area: text;
`),J("asterisk",`
grid-area: mark;
align-self: end;
`)])]),_("top-labelled",`
grid-template-areas:
"label"
"blank"
"feedback";
grid-template-rows: minmax(var(--n-label-height), auto) 1fr;
grid-template-columns: minmax(0, 100%);
`,[_("no-label",`
grid-template-areas:
"blank"
"feedback";
grid-template-rows: 1fr;
`),P("form-item-label",`
display: flex;
align-items: flex-start;
justify-content: var(--n-label-text-align);
`)]),P("form-item-blank",`
box-sizing: border-box;
display: flex;
align-items: center;
position: relative;
`),P("form-item-feedback-wrapper",`
grid-area: feedback;
box-sizing: border-box;
min-height: var(--n-feedback-height);
font-size: var(--n-feedback-font-size);
line-height: 1.25;
transform-origin: top left;
`,[j("&:not(:empty)",`
padding: var(--n-feedback-padding);
`),P("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[_("warning",{color:"var(--n-feedback-text-color-warning)"}),_("error",{color:"var(--n-feedback-text-color-error)"}),Ur({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var mt=globalThis&&globalThis.__awaiter||function(t,e,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(f){try{d(r.next(f))}catch(c){o(c)}}function l(f){try{d(r.throw(f))}catch(c){o(c)}}function d(f){f.done?i(f.value):a(f.value).then(s,l)}d((r=r.apply(t,e||[])).next())})};const Gr=Object.assign(Object.assign({},le.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,showLabel:{type:Boolean,default:void 0},labelProps:Object});function ht(t,e){return(...n)=>{try{const r=t(...n);return!e&&(typeof r=="boolean"||r instanceof Error||Array.isArray(r))||(r==null?void 0:r.then)?r:(r===void 0||nt("form-item/validate",`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use `+(e?"`Promise`":"`boolean`, `Error` or `Promise`")+" typed value instead."),!0)}catch(r){nt("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(r);return}}}const pt=Q({name:"FormItem",props:Gr,setup(t){Nn(kt,"formItems",Z(t,"path"));const{mergedClsPrefixRef:e,inlineThemeDisabled:n}=Oe(t),r=ce(Pe,null),a=Vr(t),i=Dr(t),{validationErrored:o}=i,{mergedRequired:s,mergedRules:l}=Hr(t),{mergedSize:d}=a,{mergedLabelPlacement:f,mergedLabelAlign:c,mergedRequireMarkPlacement:h}=i,u=q([]),w=q(tt()),m=r?Z(r.props,"disabled"):q(!1),v=le("Form","-form-item",Yr,Rt,t,e);we(Z(t,"path"),()=>{t.ignorePathChange||g()});function g(){u.value=[],o.value=!1,t.feedback&&(w.value=tt())}function T(){A("blur")}function y(){A("change")}function C(){A("focus")}function O(){A("input")}function R(S,D){return mt(this,void 0,void 0,function*(){let H,N,te,ie;return typeof S=="string"?(H=S,N=D):S!==null&&typeof S=="object"&&(H=S.trigger,N=S.callback,te=S.shouldRuleBeApplied,ie=S.options),yield new Promise((oe,se)=>{A(H,te,ie).then(({valid:re,errors:ne})=>{re?(N&&N(),oe()):(N&&N(ne),se(ne))})})})}const A=(S=null,D=()=>!0,H={suppressWarning:!0})=>mt(this,void 0,void 0,function*(){const{path:N}=t;H?H.first||(H.first=t.first):H={};const{value:te}=l,ie=r?St(r.props.model,N||""):void 0,oe={},se={},re=(S?te.filter(U=>Array.isArray(U.trigger)?U.trigger.includes(S):U.trigger===S):te).filter(D).map((U,K)=>{const E=Object.assign({},U);if(E.validator&&(E.validator=ht(E.validator,!1)),E.asyncValidator&&(E.asyncValidator=ht(E.asyncValidator,!0)),E.renderMessage){const V=`__renderMessage__${K}`;se[V]=E.message,E.message=V,oe[V]=E.renderMessage}return E});if(!re.length)return{valid:!0};const ne=N!=null?N:"__n_no_path__",ue=new ke({[ne]:re}),{validateMessages:be}=(r==null?void 0:r.props)||{};return be&&ue.messages(be),yield new Promise(U=>{ue.validate({[ne]:ie},H,K=>{K!=null&&K.length?(u.value=K.map(E=>{const V=(E==null?void 0:E.message)||"";return{key:V,render:()=>V.startsWith("__renderMessage__")?oe[V]():V}}),K.forEach(E=>{var V;!((V=E.message)===null||V===void 0)&&V.startsWith("__renderMessage__")&&(E.message=se[E.message])}),o.value=!0,U({valid:!1,errors:K})):(g(),U({valid:!0}))})})});Ee(on,{path:Z(t,"path"),disabled:m,mergedSize:a.mergedSize,mergedValidationStatus:i.mergedValidationStatus,restoreValidation:g,handleContentBlur:T,handleContentChange:y,handleContentFocus:C,handleContentInput:O});const L={validate:R,restoreValidation:g,internalValidate:A},Y=q(null);sn(()=>{if(!i.isAutoLabelWidth.value)return;const S=Y.value;if(S!==null){const D=S.style.whiteSpace;S.style.whiteSpace="nowrap",S.style.width="",r==null||r.deriveMaxChildLabelWidth(Number(getComputedStyle(S).width.slice(0,-2))),S.style.whiteSpace=D}});const ee=z(()=>{var S;const{value:D}=d,{value:H}=f,N=H==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:te},self:{labelTextColor:ie,asteriskColor:oe,lineHeight:se,feedbackTextColor:re,feedbackTextColorWarning:ne,feedbackTextColorError:ue,feedbackPadding:be,[B("labelHeight",D)]:U,[B("blankHeight",D)]:K,[B("feedbackFontSize",D)]:E,[B("feedbackHeight",D)]:V,[B("labelPadding",N)]:pe,[B("labelTextAlign",N)]:Le,[B(B("labelFontSize",H),D)]:$e}}=v.value;let ve=(S=c.value)!==null&&S!==void 0?S:Le;return H==="top"&&(ve=ve==="right"?"flex-end":"flex-start"),{"--n-bezier":te,"--n-line-height":se,"--n-blank-height":K,"--n-label-font-size":$e,"--n-label-text-align":ve,"--n-label-height":U,"--n-label-padding":pe,"--n-asterisk-color":oe,"--n-label-text-color":ie,"--n-feedback-padding":be,"--n-feedback-font-size":E,"--n-feedback-height":V,"--n-feedback-text-color":re,"--n-feedback-text-color-warning":ne,"--n-feedback-text-color-error":ue}}),G=n?Je("form-item",z(()=>{var S;return`${d.value[0]}${f.value[0]}${((S=c.value)===null||S===void 0?void 0:S[0])||""}`}),ee,t):void 0,W=z(()=>f.value==="left"&&h.value==="left"&&c.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:Y,mergedClsPrefix:e,mergedRequired:s,feedbackId:w,renderExplains:u,reverseColSpace:W},i),a),L),{cssVars:n?void 0:ee,themeClass:G==null?void 0:G.themeClass,onRender:G==null?void 0:G.onRender})},render(){const{$slots:t,mergedClsPrefix:e,mergedShowLabel:n,mergedShowRequireMark:r,mergedRequireMarkPlacement:a,onRender:i}=this,o=r!==void 0?r:this.mergedRequired;i==null||i();const s=()=>{const l=this.$slots.label?this.$slots.label():this.label;if(!l)return null;const d=x("span",{class:`${e}-form-item-label__text`},l),f=o?x("span",{class:`${e}-form-item-label__asterisk`},a!=="left"?"\xA0*":"*\xA0"):a==="right-hanging"&&x("span",{class:`${e}-form-item-label__asterisk-placeholder`},"\xA0*"),{labelProps:c}=this;return x("label",Object.assign({},c,{class:[c==null?void 0:c.class,`${e}-form-item-label`,`${e}-form-item-label--${a}-mark`,this.reverseColSpace&&`${e}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),a==="left"?[f,d]:[d,f])};return x("div",{class:[`${e}-form-item`,this.themeClass,`${e}-form-item--${this.mergedSize}-size`,`${e}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${e}-form-item--auto-label-width`,!n&&`${e}-form-item--no-label`],style:this.cssVars},n&&s(),x("div",{class:[`${e}-form-item-blank`,this.mergedValidationStatus&&`${e}-form-item-blank--${this.mergedValidationStatus}`]},t),this.mergedShowFeedback?x("div",{key:this.feedbackId,class:`${e}-form-item-feedback-wrapper`},x(ln,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:l}=this;return Ve(t.feedback,d=>{var f;const{feedback:c}=this,h=d||c?x("div",{key:"__feedback__",class:`${e}-form-item-feedback__line`},d||c):this.renderExplains.length?(f=this.renderExplains)===null||f===void 0?void 0:f.map(({key:u,render:w})=>x("div",{key:u,class:`${e}-form-item-feedback__line`},w())):null;return h?l==="warning"?x("div",{key:"controlled-warning",class:`${e}-form-item-feedback ${e}-form-item-feedback--warning`},h):l==="error"?x("div",{key:"controlled-error",class:`${e}-form-item-feedback ${e}-form-item-feedback--error`},h):l==="success"?x("div",{key:"controlled-success",class:`${e}-form-item-feedback ${e}-form-item-feedback--success`},h):x("div",{key:"controlled-default",class:`${e}-form-item-feedback`},h):null})}})):null)}}),Xr=t=>{const{primaryColor:e,successColor:n,warningColor:r,errorColor:a,infoColor:i,fontWeightStrong:o}=t;return{fontWeight:o,rotate:"252deg",colorStartPrimary:ye(e,{alpha:.6}),colorEndPrimary:e,colorStartInfo:ye(i,{alpha:.6}),colorEndInfo:i,colorStartWarning:ye(r,{alpha:.6}),colorEndWarning:r,colorStartError:ye(a,{alpha:.6}),colorEndError:a,colorStartSuccess:ye(n,{alpha:.6}),colorEndSuccess:n}},Kr={name:"GradientText",common:dn,self:Xr},Jr=Kr,Zr=P("gradient-text",`
display: inline-block;
font-weight: var(--n-font-weight);
-webkit-background-clip: text;
background-clip: text;
color: #0000;
white-space: nowrap;
background-image: linear-gradient(var(--n-rotate), var(--n-color-start) 0%, var(--n-color-end) 100%);
transition:
--n-color-start .3s var(--n-bezier),
--n-color-end .3s var(--n-bezier);
`),Qr=Object.assign(Object.assign({},le.props),{size:[String,Number],fontSize:[String,Number],type:{type:String,default:"primary"},color:[Object,String],gradient:[Object,String]}),ea=Q({name:"GradientText",props:Qr,setup(t){Vn();const{mergedClsPrefixRef:e,inlineThemeDisabled:n}=Oe(t),r=z(()=>{const{type:d}=t;return d==="danger"?"error":d}),a=z(()=>{let d=t.size||t.fontSize;return d&&(d=ze(d)),d||void 0}),i=z(()=>{const d=t.color||t.gradient;if(typeof d=="string")return d;if(d){const f=d.deg||0,c=d.from,h=d.to;return`linear-gradient(${f}deg, ${c} 0%, ${h} 100%)`}}),o=le("GradientText","-gradient-text",Zr,Jr,t,e),s=z(()=>{const{value:d}=r,{common:{cubicBezierEaseInOut:f},self:{rotate:c,[B("colorStart",d)]:h,[B("colorEnd",d)]:u,fontWeight:w}}=o.value;return{"--n-bezier":f,"--n-rotate":c,"--n-color-start":h,"--n-color-end":u,"--n-font-weight":w}}),l=n?Je("gradient-text",z(()=>r.value[0]),s,t):void 0;return{mergedClsPrefix:e,compatibleType:r,styleFontSize:a,styleBgImage:i,cssVars:n?void 0:s,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){const{mergedClsPrefix:t,onRender:e}=this;return e==null||e(),x("span",{class:[`${t}-gradient-text`,`${t}-gradient-text--${this.compatibleType}-type`,this.themeClass],style:[{fontSize:this.styleFontSize,backgroundImage:this.styleBgImage},this.cssVars]},this.$slots)}}),Ze=Ke("n-tabs"),Ct={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:"if"},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]},vt=Q({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:Ct,setup(t){const e=ce(Ze,null);return e||fn("tab-pane","`n-tab-pane` must be placed inside `n-tabs`."),{style:e.paneStyleRef,class:e.paneClassRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){return x("div",{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}}),ta=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},hn(Ct,["displayDirective"])),Xe=Q({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:ta,setup(t){const{mergedClsPrefixRef:e,valueRef:n,typeRef:r,closableRef:a,tabStyleRef:i,tabChangeIdRef:o,onBeforeLeaveRef:s,triggerRef:l,handleAdd:d,activateTab:f,handleClose:c}=ce(Ze);return{trigger:l,mergedClosable:z(()=>{if(t.internalAddable)return!1;const{closable:h}=t;return h===void 0?a.value:h}),style:i,clsPrefix:e,value:n,type:r,handleClose(h){h.stopPropagation(),!t.disabled&&c(t.name)},activateTab(){if(t.disabled)return;if(t.internalAddable){d();return}const{name:h}=t,u=++o.id;if(h!==n.value){const{value:w}=s;w?Promise.resolve(w(t.name,n.value)).then(m=>{m&&o.id===u&&f(h)}):f(h)}}}},render(){const{internalAddable:t,clsPrefix:e,name:n,disabled:r,label:a,tab:i,value:o,mergedClosable:s,style:l,trigger:d,$slots:{default:f}}=this,c=a!=null?a:i;return x("div",{class:`${e}-tabs-tab-wrapper`},this.internalLeftPadded?x("div",{class:`${e}-tabs-tab-pad`}):null,x("div",Object.assign({key:n,"data-name":n,"data-disabled":r?!0:void 0},cn({class:[`${e}-tabs-tab`,o===n&&`${e}-tabs-tab--active`,r&&`${e}-tabs-tab--disabled`,s&&`${e}-tabs-tab--closable`,t&&`${e}-tabs-tab--addable`],onClick:d==="click"?this.activateTab:void 0,onMouseenter:d==="hover"?this.activateTab:void 0,style:t?void 0:l},this.internalCreatedByPane?this.tabProps||{}:this.$attrs)),x("span",{class:`${e}-tabs-tab__label`},t?x(un,null,x("div",{class:`${e}-tabs-tab__height-placeholder`},"\xA0"),x(bn,{clsPrefix:e},{default:()=>x(or,null)})):f?f():typeof c=="object"?c:gn(c!=null?c:n)),s&&this.type==="card"?x(mn,{clsPrefix:e,class:`${e}-tabs-tab__close`,onClick:this.handleClose,disabled:r}):null))}}),na=P("tabs",`
box-sizing: border-box;
width: 100%;
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[_("segment-type",[P("tabs-rail",[j("&.transition-disabled","color: red;",[P("tabs-tab",`
transition: none;
`)])])]),P("tabs-rail",`
padding: 3px;
border-radius: var(--n-tab-border-radius);
width: 100%;
background-color: var(--n-color-segment);
transition: background-color .3s var(--n-bezier);
display: flex;
align-items: center;
`,[P("tabs-tab-wrapper",`
flex-basis: 0;
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
`,[P("tabs-tab",`
overflow: hidden;
border-radius: var(--n-tab-border-radius);
width: 100%;
display: flex;
align-items: center;
justify-content: center;
`,[_("active",`
font-weight: var(--n-font-weight-strong);
color: var(--n-tab-text-color-active);
background-color: var(--n-tab-color-segment);
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08);
`),j("&:hover",`
color: var(--n-tab-text-color-hover);
`)])])]),_("flex",[P("tabs-nav",{width:"100%"},[P("tabs-wrapper",{width:"100%"},[P("tabs-tab",{marginRight:0})])])]),P("tabs-nav",`
box-sizing: border-box;
line-height: 1.5;
display: flex;
transition: border-color .3s var(--n-bezier);
`,[J("prefix, suffix",`
display: flex;
align-items: center;
`),J("prefix","padding-right: 16px;"),J("suffix","padding-left: 16px;")]),P("tabs-nav-scroll-wrapper",`
flex: 1;
position: relative;
overflow: hidden;
`,[_("shadow-before",[j("&::before",`
box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12);
`)]),_("shadow-after",[j("&::after",`
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12);
`)]),j("&::before, &::after",`
transition: box-shadow .3s var(--n-bezier);
pointer-events: none;
content: "";
position: absolute;
top: 0;
bottom: 0;
width: 20px;
z-index: 1;
`),j("&::before",`
left: 0;
`),j("&::after",`
right: 0;
`)]),P("tabs-nav-scroll-content",`
display: flex;
position: relative;
min-width: 100%;
width: fit-content;
`),P("tabs-wrapper",`
display: inline-flex;
flex-wrap: nowrap;
position: relative;
`),P("tabs-tab-wrapper",`
display: flex;
flex-wrap: nowrap;
flex-shrink: 0;
flex-grow: 0;
`),P("tabs-tab",`
cursor: pointer;
white-space: nowrap;
flex-wrap: nowrap;
display: inline-flex;
align-items: center;
color: var(--n-tab-text-color);
font-size: var(--n-tab-font-size);
background-clip: padding-box;
padding: var(--n-tab-padding);
transition:
box-shadow .3s var(--n-bezier),
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[_("disabled",{cursor:"not-allowed"}),J("close",`
margin-left: 6px;
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`),J("label",`
display: flex;
align-items: center;
`)]),P("tabs-bar",`
position: absolute;
bottom: 0;
height: 2px;
border-radius: 1px;
background-color: var(--n-bar-color);
transition:
left .2s var(--n-bezier),
max-width .2s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[j("&.transition-disabled",`
transition: none;
`),_("disabled",`
background-color: var(--n-tab-text-color-disabled)
`)]),P("tabs-pane-wrapper",`
position: relative;
overflow: hidden;
transition: max-height .2s var(--n-bezier);
`),P("tab-pane",`
color: var(--n-pane-text-color);
width: 100%;
padding: var(--n-pane-padding);
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
opacity .2s var(--n-bezier);
left: 0;
right: 0;
top: 0;
`,[j("&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active",`
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
transform .2s var(--n-bezier),
opacity .2s var(--n-bezier);
`),j("&.next-transition-leave-active, &.prev-transition-leave-active",`
position: absolute;
`),j("&.next-transition-enter-from, &.prev-transition-leave-to",`
transform: translateX(32px);
opacity: 0;
`),j("&.next-transition-leave-to, &.prev-transition-enter-from",`
transform: translateX(-32px);
opacity: 0;
`),j("&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to",`
transform: translateX(0);
opacity: 1;
`)]),P("tabs-tab-pad",`
width: var(--n-tab-gap);
flex-grow: 0;
flex-shrink: 0;
`),_("line-type, bar-type",[P("tabs-tab",`
font-weight: var(--n-tab-font-weight);
box-sizing: border-box;
vertical-align: bottom;
`,[j("&:hover",{color:"var(--n-tab-text-color-hover)"}),_("active",`
color: var(--n-tab-text-color-active);
font-weight: var(--n-tab-font-weight-active);
`),_("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),P("tabs-nav",[_("line-type",[J("prefix, suffix",`
transition: border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-tab-border-color);
`),P("tabs-nav-scroll-content",`
transition: border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-tab-border-color);
`),P("tabs-bar",`
border-radius: 0;
bottom: -1px;
`)]),_("card-type",[J("prefix, suffix",`
transition: border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-tab-border-color);
`),P("tabs-pad",`
flex-grow: 1;
transition: border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-tab-border-color);
`),P("tabs-tab-pad",`
transition: border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-tab-border-color);
`),P("tabs-tab",`
font-weight: var(--n-tab-font-weight);
border: 1px solid var(--n-tab-border-color);
border-top-left-radius: var(--n-tab-border-radius);
border-top-right-radius: var(--n-tab-border-radius);
background-color: var(--n-tab-color);
box-sizing: border-box;
position: relative;
vertical-align: bottom;
display: flex;
justify-content: space-between;
font-size: var(--n-tab-font-size);
color: var(--n-tab-text-color);
`,[_("addable",`
padding-left: 8px;
padding-right: 8px;
font-size: 16px;
`,[J("height-placeholder",`
width: 0;
font-size: var(--n-tab-font-size);
`),pn("disabled",[j("&:hover",`
color: var(--n-tab-text-color-hover);
`)])]),_("closable","padding-right: 6px;"),_("active",`
border-bottom: 1px solid #0000;
background-color: #0000;
font-weight: var(--n-tab-font-weight-active);
color: var(--n-tab-text-color-active);
`),_("disabled","color: var(--n-tab-text-color-disabled);")]),P("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);")])])]),ra=Object.assign(Object.assign({},le.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},tabStyle:[String,Object],barWidth:Number,paneClass:String,paneStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),aa=Q({name:"Tabs",props:ra,setup(t,{slots:e}){var n,r,a,i;const{mergedClsPrefixRef:o,inlineThemeDisabled:s}=Oe(t),l=le("Tabs","-tabs",na,Pn,t,o),d=q(null),f=q(null),c=q(null),h=q(null),u=q(null),w=q(!0),m=q(!0),v=rt(t,["labelSize","size"]),g=rt(t,["activeName","value"]),T=q((r=(n=g.value)!==null&&n!==void 0?n:t.defaultValue)!==null&&r!==void 0?r:e.default?(i=(a=je(e.default())[0])===null||a===void 0?void 0:a.props)===null||i===void 0?void 0:i.name:null),y=vn(g,T),C={id:0},O=z(()=>{if(!(!t.justifyContent||t.type==="card"))return{display:"flex",justifyContent:t.justifyContent}});we(y,()=>{C.id=0,L(),Y()});function R(){var b;const{value:p}=y;return p===null?null:(b=d.value)===null||b===void 0?void 0:b.querySelector(`[data-name="${p}"]`)}function A(b){if(t.type==="card")return;const{value:p}=f;if(!!p&&b){const k=`${o.value}-tabs-bar--disabled`,{barWidth:F}=t;if(b.dataset.disabled==="true"?p.classList.add(k):p.classList.remove(k),typeof F=="number"&&b.offsetWidth>=F){const ae=Math.floor((b.offsetWidth-F)/2)+b.offsetLeft;p.style.left=`${ae}px`,p.style.maxWidth=`${F}px`}else p.style.left=`${b.offsetLeft}px`,p.style.maxWidth=`${b.offsetWidth}px`;p.style.width="8192px",p.offsetWidth}}function L(){if(t.type==="card")return;const b=R();b&&A(b)}function Y(b){var p;const k=(p=u.value)===null||p===void 0?void 0:p.$el;if(!k)return;const F=R();if(!F)return;const{scrollLeft:ae,offsetWidth:de}=k,{offsetLeft:me,offsetWidth:Ce}=F;ae>me?k.scrollTo({top:0,left:me,behavior:"smooth"}):me+Ce>ae+de&&k.scrollTo({top:0,left:me+Ce-de,behavior:"smooth"})}const ee=q(null);let G=0,W=null;function S(b){const p=ee.value;if(p){G=b.getBoundingClientRect().height;const k=`${G}px`,F=()=>{p.style.height=k,p.style.maxHeight=k};W?(F(),W(),W=null):W=F}}function D(b){const p=ee.value;if(p){const k=b.getBoundingClientRect().height,F=()=>{document.body.offsetHeight,p.style.maxHeight=`${k}px`,p.style.height=`${Math.max(G,k)}px`};W?(W(),W=null,F()):W=F}}function H(){const b=ee.value;b&&(b.style.maxHeight="",b.style.height="")}const N={value:[]},te=q("next");function ie(b){const p=y.value;let k="next";for(const F of N.value){if(F===p)break;if(F===b){k="prev";break}}te.value=k,oe(b)}function oe(b){const{onActiveNameChange:p,onUpdateValue:k,"onUpdate:value":F}=t;p&&Fe(p,b),k&&Fe(k,b),F&&Fe(F,b),T.value=b}function se(b){const{onClose:p}=t;p&&Fe(p,b)}function re(){const{value:b}=f;if(!b)return;const p="transition-disabled";b.classList.add(p),L(),b.classList.remove(p)}let ne=0;function ue(b){var p;if(b.contentRect.width===0&&b.contentRect.height===0||ne===b.contentRect.width)return;ne=b.contentRect.width;const{type:k}=t;(k==="line"||k==="bar")&&re(),k!=="segment"&&pe((p=u.value)===null||p===void 0?void 0:p.$el)}const be=Me(ue,64);we([()=>t.justifyContent,()=>t.size],()=>{We(()=>{const{type:b}=t;(b==="line"||b==="bar")&&re()})});const U=q(!1);function K(b){var p;const{target:k,contentRect:{width:F}}=b,ae=k.parentElement.offsetWidth;if(!U.value)ae<F&&(U.value=!0);else{const{value:de}=h;if(!de)return;ae-F>de.$el.offsetWidth&&(U.value=!1)}pe((p=u.value)===null||p===void 0?void 0:p.$el)}const E=Me(K,64);function V(){const{onAdd:b}=t;b&&b(),We(()=>{const p=R(),{value:k}=u;!p||!k||k.scrollTo({left:p.offsetLeft,top:0,behavior:"smooth"})})}function pe(b){if(!b)return;const{scrollLeft:p,scrollWidth:k,offsetWidth:F}=b;w.value=p<=0,m.value=p+F>=k}const Le=Me(b=>{pe(b.target)},64);Ee(Ze,{triggerRef:Z(t,"trigger"),tabStyleRef:Z(t,"tabStyle"),paneClassRef:Z(t,"paneClass"),paneStyleRef:Z(t,"paneStyle"),mergedClsPrefixRef:o,typeRef:Z(t,"type"),closableRef:Z(t,"closable"),valueRef:y,tabChangeIdRef:C,onBeforeLeaveRef:Z(t,"onBeforeLeave"),activateTab:ie,handleClose:se,handleAdd:V}),yn(()=>{L(),Y()}),xn(()=>{const{value:b}=c;if(!b)return;const{value:p}=o,k=`${p}-tabs-nav-scroll-wrapper--shadow-before`,F=`${p}-tabs-nav-scroll-wrapper--shadow-after`;w.value?b.classList.remove(k):b.classList.add(k),m.value?b.classList.remove(F):b.classList.add(F)});const $e=q(null);we(y,()=>{if(t.type==="segment"){const b=$e.value;b&&We(()=>{b.classList.add("transition-disabled"),b.offsetWidth,b.classList.remove("transition-disabled")})}});const ve={syncBarPosition:()=>{L()}},qe=z(()=>{const{value:b}=v,{type:p}=t,k={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[p],F=`${b}${k}`,{self:{barColor:ae,closeIconColor:de,closeIconColorHover:me,closeIconColorPressed:Ce,tabColor:Ft,tabBorderColor:_t,paneTextColor:zt,tabFontWeight:Tt,tabBorderRadius:At,tabFontWeightActive:Et,colorSegment:Ot,fontWeightStrong:Lt,tabColorSegment:qt,closeSize:jt,closeIconSize:Wt,closeColorHover:It,closeColorPressed:Mt,closeBorderRadius:Bt,[B("panePadding",b)]:Nt,[B("tabPadding",F)]:Vt,[B("tabGap",F)]:Dt,[B("tabTextColor",p)]:Ht,[B("tabTextColorActive",p)]:Ut,[B("tabTextColorHover",p)]:Yt,[B("tabTextColorDisabled",p)]:Gt,[B("tabFontSize",b)]:Xt},common:{cubicBezierEaseInOut:Kt}}=l.value;return{"--n-bezier":Kt,"--n-color-segment":Ot,"--n-bar-color":ae,"--n-tab-font-size":Xt,"--n-tab-text-color":Ht,"--n-tab-text-color-active":Ut,"--n-tab-text-color-disabled":Gt,"--n-tab-text-color-hover":Yt,"--n-pane-text-color":zt,"--n-tab-border-color":_t,"--n-tab-border-radius":At,"--n-close-size":jt,"--n-close-icon-size":Wt,"--n-close-color-hover":It,"--n-close-color-pressed":Mt,"--n-close-border-radius":Bt,"--n-close-icon-color":de,"--n-close-icon-color-hover":me,"--n-close-icon-color-pressed":Ce,"--n-tab-color":Ft,"--n-tab-font-weight":Tt,"--n-tab-font-weight-active":Et,"--n-tab-padding":Vt,"--n-tab-gap":Dt,"--n-pane-padding":Nt,"--n-font-weight-strong":Lt,"--n-tab-color-segment":qt}}),ge=s?Je("tabs",z(()=>`${v.value[0]}${t.type[0]}`),qe,t):void 0;return Object.assign({mergedClsPrefix:o,mergedValue:y,renderedNames:new Set,tabsRailElRef:$e,tabsPaneWrapperRef:ee,tabsElRef:d,barElRef:f,addTabInstRef:h,xScrollInstRef:u,scrollWrapperElRef:c,addTabFixed:U,tabWrapperStyle:O,handleNavResize:be,mergedSize:v,handleScroll:Le,handleTabsResize:E,cssVars:s?void 0:qe,themeClass:ge==null?void 0:ge.themeClass,animationDirection:te,renderNameListRef:N,onAnimationBeforeLeave:S,onAnimationEnter:D,onAnimationAfterEnter:H,onRender:ge==null?void 0:ge.onRender},ve)},render(){const{mergedClsPrefix:t,type:e,addTabFixed:n,addable:r,mergedSize:a,renderNameListRef:i,onRender:o,$slots:{default:s,prefix:l,suffix:d}}=this;o==null||o();const f=s?je(s()).filter(v=>v.type.__TAB_PANE__===!0):[],c=s?je(s()).filter(v=>v.type.__TAB__===!0):[],h=!c.length,u=e==="card",w=e==="segment",m=!u&&!w&&this.justifyContent;return i.value=[],x("div",{class:[`${t}-tabs`,this.themeClass,`${t}-tabs--${e}-type`,`${t}-tabs--${a}-size`,m&&`${t}-tabs--flex`],style:this.cssVars},x("div",{class:[`${t}-tabs-nav--${e}-type`,`${t}-tabs-nav`]},Ve(l,v=>v&&x("div",{class:`${t}-tabs-nav__prefix`},v)),w?x("div",{class:`${t}-tabs-rail`,ref:"tabsRailElRef"},h?f.map((v,g)=>(i.value.push(v.props.name),x(Xe,Object.assign({},v.props,{internalCreatedByPane:!0,internalLeftPadded:g!==0}),v.children?{default:v.children.tab}:void 0))):c.map((v,g)=>(i.value.push(v.props.name),g===0?v:wt(v)))):x(at,{onResize:this.handleNavResize},{default:()=>x("div",{class:`${t}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},x(Hn,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:()=>{const v=x("div",{style:this.tabWrapperStyle,class:`${t}-tabs-wrapper`},m?null:x("div",{class:`${t}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}),h?f.map((T,y)=>(i.value.push(T.props.name),Ne(x(Xe,Object.assign({},T.props,{internalCreatedByPane:!0,internalLeftPadded:y!==0&&(!m||m==="center"||m==="start"||m==="end")}),T.children?{default:T.children.tab}:void 0)))):c.map((T,y)=>(i.value.push(T.props.name),Ne(y!==0&&!m?wt(T):T))),!n&&r&&u?xt(r,(h?f.length:c.length)!==0):null,m?null:x("div",{class:`${t}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));let g=v;return u&&r&&(g=x(at,{onResize:this.handleTabsResize},{default:()=>v})),x("div",{ref:"tabsElRef",class:`${t}-tabs-nav-scroll-content`},g,u?x("div",{class:`${t}-tabs-pad`}):null,u?null:x("div",{ref:"barElRef",class:`${t}-tabs-bar`}))}}))}),n&&r&&u?xt(r,!0):null,Ve(d,v=>v&&x("div",{class:`${t}-tabs-nav__suffix`},v))),h&&(this.animated?x("div",{ref:"tabsPaneWrapperRef",class:`${t}-tabs-pane-wrapper`},yt(f,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):yt(f,this.mergedValue,this.renderedNames)))}});function yt(t,e,n,r,a,i,o){const s=[];return t.forEach(l=>{const{name:d,displayDirective:f,"display-directive":c}=l.props,h=w=>f===w||c===w,u=e===d;if(l.key!==void 0&&(l.key=d),u||h("show")||h("show:lazy")&&n.has(d)){n.has(d)||n.add(d);const w=!h("if");s.push(w?wn(l,[[kn,u]]):l)}}),o?x(Rn,{name:`${o}-transition`,onBeforeLeave:r,onEnter:a,onAfterEnter:i},{default:()=>s}):s}function xt(t,e){return x(Xe,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:e,disabled:typeof t=="object"&&t.disabled})}function wt(t){const e=Sn(t);return e.props?e.props.internalLeftPadded=!0:e.props={internalLeftPadded:!0},e}function Ne(t){return Array.isArray(t.dynamicProps)?t.dynamicProps.includes("internalLeftPadded")||t.dynamicProps.push("internalLeftPadded"):t.dynamicProps=["internalLeftPadded"],t}function ia(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!Fn(t)}const oa=Q({name:"Signin",setup(){const{t}=Pt(),e=()=>({name:"admin",pwd:"123456"}),n=_n(),r=q(e()),a=q(),i=q(!1),o={name:{required:!0,message:t("LoginModule.NamePlaceholder"),trigger:["blur","input"]},pwd:{required:!0,message:t("LoginModule.PasswordPlaceholder"),trigger:["blur","input"]}};return{signinForm:r,loginFormRef:a,handleLogin:()=>{var l;(l=a.value)==null||l.validate(d=>{d?window.$message.error("\u4E0D\u53EF\u4EE5\u8FD9\u6837\u54DF, \u4E0D\u53EF\u4EE5\u54DF"):(window.$message.info("\u767B\u9646\u4E2D..."),i.value=!0,setTimeout(()=>{n.push("/dashboard"),$n("token","tokenValue")},2*1e3))})},rules:o,loading:i,t}},render(){let t;return M(fr,{model:this.signinForm,ref:"loginFormRef",rules:this.rules},{default:()=>[M(pt,{label:this.t("LoginModule.Name"),path:"name"},{default:()=>[M(it,{value:this.signinForm.name,"onUpdate:value":e=>this.signinForm.name=e,placeholder:this.t("LoginModule.NamePlaceholder")},null)]}),M(pt,{label:this.t("LoginModule.Password"),path:"pwd"},{default:()=>[M(it,{value:this.signinForm.pwd,"onUpdate:value":e=>this.signinForm.pwd=e,type:"password",placeholder:this.t("LoginModule.PasswordPlaceholder")},null)]}),M(Cn,{style:["width: 100%","margin-to: 18px"],type:"primary",onClick:this.handleLogin.bind(this),loading:this.loading},ia(t=this.t("LoginModule.Login"))?t:{default:()=>[t]})]})}}),sa=Q({name:"Register",render(){return M(Bn,{status:"info",title:"\u63D0\u793A",description:"\u6211\u5B9E\u5728\u662F\u4E0D\u60F3\u5199\u4E86..."},null)}}),fa=Q({name:"Login",setup(){const t=zn({tabsValue:"signin"}),{t:e}=Pt(),{height:n}=Tn(),r=An(),{themeValue:a}=En(r),{updateLocale:i}=r;return{...On(t),windowHeight:n,themeValue:a,updateLocale:i,ray:e}},render(){return M("div",{class:["login"],style:[`height: ${this.windowHeight}px`]},[M(Ln,null,{default:()=>[M(ea,{class:"login-title",type:"info"},{default:()=>[qn("Ray Template")]}),M(jn,{options:Wn(),onSelect:t=>this.updateLocale(t)},{default:()=>[M(In,{customClassName:"login-icon",name:"language",size:"18"},null)]})]}),M(Mn,null,{default:()=>[M(aa,{value:this.tabsValue,"onUpdate:value":t=>this.tabsValue=t},{default:()=>[M(vt,{tab:this.ray("LoginModule.Signin"),name:"signin"},{default:()=>[M(oa,null,null)]}),M(vt,{tab:this.ray("LoginModule.Register"),name:"register"},{default:()=>[M(sa,null,null)]})]})]})])}});export{fa as default};