bkui-vue 0.0.2-beta.132 → 0.0.2-beta.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.umd.js +1 -1
- package/lib/search-select/index.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -358,6 +358,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
358
358
|
`+n),a.b(" </div>"),a.b(`
|
359
359
|
`+n),a.b(" </div>"),a.b(`
|
360
360
|
`+n),a.b(" </div>"),a.b(`
|
361
|
-
`+n),a.b("</div>"),a.fl()},partials:{},subs:{}});$e["tag-file-added"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),a.fl()},partials:{},subs:{}});$e["tag-file-changed"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),a.fl()},partials:{},subs:{}});$e["tag-file-deleted"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),a.fl()},partials:{},subs:{}});$e["tag-file-renamed"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),a.fl()},partials:{},subs:{}});var Wn=globalThis&&globalThis.__assign||function(){return Wn=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Wn.apply(this,arguments)},bD=function(){function e(t){var n=t.compiledTemplates,a=n===void 0?{}:n,s=t.rawTemplates,r=s===void 0?{}:s,o=Object.entries(r).reduce(function(l,u){var c,d=u[0],f=u[1],h=ze.compile(f,{asString:!1});return Wn(Wn({},l),(c={},c[d]=h,c))},{});this.preCompiledTemplates=Wn(Wn(Wn({},$e),a),o)}return e.compile=function(t){return ze.compile(t,{asString:!1})},e.prototype.render=function(t,n,a,s,r){var o=this.templateKey(t,n);try{var l=this.preCompiledTemplates[o];return l.render(a,s,r)}catch{throw new Error("Could not find template to render '".concat(o,"'"))}},e.prototype.template=function(t,n){return this.preCompiledTemplates[this.templateKey(t,n)]},e.prototype.templateKey=function(t,n){return"".concat(t,"-").concat(n)},e}(),Kn=globalThis&&globalThis.__assign||function(){return Kn=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Kn.apply(this,arguments)},CD=Kn(Kn(Kn({},P3),A3),{outputFormat:$x.LINE_BY_LINE,drawFileList:!0});function ND(e,t){t===void 0&&(t={});var n=Kn(Kn({},CD),t),a=typeof e=="string"?Ux(e,n):e,s=new bD(n),r=n.drawFileList?dD(a,s):"",o=n.outputFormat==="side-by-side"?new yD(s,n).render(a):new gD(s,n).render(a);return r+o}const wD=["side-by-side","line-by-line"],MD=mh([...wD]),ID=["dark","light"],LD=mh([...ID]),TD={oldContent:ct().def(""),newContent:ct().def(""),diffFormat:ct().def(MD["line-by-line"]),diffContext:fh(),theme:ct().def("light"),language:ct().def("javascript"),hljs:g.any.isRequired};function SD(e,t){return e.replace(/d2h-code-line-ctn/g,n=>`${n} lang-${t}`)}const kD=i.defineComponent({name:"CodeDiff",props:TD,emits:[],setup(e){const{resolveClassName:t}=oe(),n=i.ref(null),a=i.ref(""),s=i.computed(()=>be({dark:e.theme===LD.dark},`hljs ${t("code-diff")}`));function r(){i.nextTick(()=>{n.value&&n.value.querySelectorAll(`.lang-${e.language}`).forEach(l=>{e.hljs.highlightElement(l)})})}function o(l,u){const c=Qx("",e.oldContent,e.newContent,"","",{context:l});a.value=SD(ND(c,{drawFileList:!1,matching:"lines",outputFormat:e.diffFormat}),u),r()}return i.onMounted(()=>{o(e.diffContext,e.language)}),i.watch(()=>[e.diffContext,e.language],l=>{const[u,c]=l;o(u,c)}),()=>i.createVNode("div",{ref:n,class:s.value,innerHTML:a.value},null)}}),J3=Me(kD);function er(e){"@babel/helpers - typeof";return er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(e)}var xD=/^\s+/,DD=/\s+$/;function ye(e,t){if(e=e||"",t=t||{},e instanceof ye)return e;if(!(this instanceof ye))return new ye(e,t);var n=jD(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}ye.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,a,s,r,o,l;return n=t.r/255,a=t.g/255,s=t.b/255,n<=.03928?r=n/12.92:r=Math.pow((n+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),s<=.03928?l=s/12.92:l=Math.pow((s+.055)/1.055,2.4),.2126*r+.7152*o+.0722*l},setAlpha:function(t){return this._a=R3(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Of(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Of(this._r,this._g,this._b),n=Math.round(t.h*360),a=Math.round(t.s*100),s=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+a+"%, "+s+"%)":"hsva("+n+", "+a+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var t=jf(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=jf(this._r,this._g,this._b),n=Math.round(t.h*360),a=Math.round(t.s*100),s=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+a+"%, "+s+"%)":"hsla("+n+", "+a+"%, "+s+"%, "+this._roundA+")"},toHex:function(t){return Ef(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return AD(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(je(this._r,255)*100)+"%",g:Math.round(je(this._g,255)*100)+"%",b:Math.round(je(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(je(this._r,255)*100)+"%, "+Math.round(je(this._g,255)*100)+"%, "+Math.round(je(this._b,255)*100)+"%)":"rgba("+Math.round(je(this._r,255)*100)+"%, "+Math.round(je(this._g,255)*100)+"%, "+Math.round(je(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:GD[Ef(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+Pf(this._r,this._g,this._b,this._a),a=n,s=this._gradientType?"GradientType = 1, ":"";if(t){var r=ye(t);a="#"+Pf(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+n+",endColorstr="+a+")"},toString:function(t){var n=!!t;t=t||this._format;var a=!1,s=this._a<1&&this._a>=0,r=!n&&s&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return r?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(a=this.toRgbString()),t==="prgb"&&(a=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(a=this.toHexString()),t==="hex3"&&(a=this.toHexString(!0)),t==="hex4"&&(a=this.toHex8String(!0)),t==="hex8"&&(a=this.toHex8String()),t==="name"&&(a=this.toName()),t==="hsl"&&(a=this.toHslString()),t==="hsv"&&(a=this.toHsvString()),a||this.toHexString())},clone:function(){return ye(this.toString())},_applyModification:function(t,n){var a=t.apply(null,[this].concat([].slice.call(n)));return this._r=a._r,this._g=a._g,this._b=a._b,this.setAlpha(a._a),this},lighten:function(){return this._applyModification(RD,arguments)},brighten:function(){return this._applyModification(QD,arguments)},darken:function(){return this._applyModification($D,arguments)},desaturate:function(){return this._applyModification(zD,arguments)},saturate:function(){return this._applyModification(VD,arguments)},greyscale:function(){return this._applyModification(JD,arguments)},spin:function(){return this._applyModification(_D,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(FD,arguments)},complement:function(){return this._applyCombination(HD,arguments)},monochromatic:function(){return this._applyCombination(BD,arguments)},splitcomplement:function(){return this._applyCombination(WD,arguments)},triad:function(){return this._applyCombination(Af,[3])},tetrad:function(){return this._applyCombination(Af,[4])}};ye.fromRatio=function(e,t){if(er(e)=="object"){var n={};for(var a in e)e.hasOwnProperty(a)&&(a==="a"?n[a]=e[a]:n[a]=mi(e[a]));e=n}return ye(e,t)};function jD(e){var t={r:0,g:0,b:0},n=1,a=null,s=null,r=null,o=!1,l=!1;return typeof e=="string"&&(e=KD(e)),er(e)=="object"&&(en(e.r)&&en(e.g)&&en(e.b)?(t=OD(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):en(e.h)&&en(e.s)&&en(e.v)?(a=mi(e.s),s=mi(e.v),t=PD(e.h,a,s),o=!0,l="hsv"):en(e.h)&&en(e.s)&&en(e.l)&&(a=mi(e.s),r=mi(e.l),t=ED(e.h,a,r),o=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=R3(n),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function OD(e,t,n){return{r:je(e,255)*255,g:je(t,255)*255,b:je(n,255)*255}}function jf(e,t,n){e=je(e,255),t=je(t,255),n=je(n,255);var a=Math.max(e,t,n),s=Math.min(e,t,n),r,o,l=(a+s)/2;if(a==s)r=o=0;else{var u=a-s;switch(o=l>.5?u/(2-a-s):u/(a+s),a){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4;break}r/=6}return{h:r,s:o,l}}function ED(e,t,n){var a,s,r;e=je(e,360),t=je(t,100),n=je(n,100);function o(c,d,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(d-c)*6*f:f<1/2?d:f<2/3?c+(d-c)*(2/3-f)*6:c}if(t===0)a=s=r=n;else{var l=n<.5?n*(1+t):n+t-n*t,u=2*n-l;a=o(u,l,e+1/3),s=o(u,l,e),r=o(u,l,e-1/3)}return{r:a*255,g:s*255,b:r*255}}function Of(e,t,n){e=je(e,255),t=je(t,255),n=je(n,255);var a=Math.max(e,t,n),s=Math.min(e,t,n),r,o,l=a,u=a-s;if(o=a===0?0:u/a,a==s)r=0;else{switch(a){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4;break}r/=6}return{h:r,s:o,v:l}}function PD(e,t,n){e=je(e,360)*6,t=je(t,100),n=je(n,100);var a=Math.floor(e),s=e-a,r=n*(1-t),o=n*(1-s*t),l=n*(1-(1-s)*t),u=a%6,c=[n,o,r,r,l,n][u],d=[l,n,n,o,r,r][u],f=[r,r,l,n,n,o][u];return{r:c*255,g:d*255,b:f*255}}function Ef(e,t,n,a){var s=[Dt(Math.round(e).toString(16)),Dt(Math.round(t).toString(16)),Dt(Math.round(n).toString(16))];return a&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function AD(e,t,n,a,s){var r=[Dt(Math.round(e).toString(16)),Dt(Math.round(t).toString(16)),Dt(Math.round(n).toString(16)),Dt(Q3(a))];return s&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)&&r[3].charAt(0)==r[3].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function Pf(e,t,n,a){var s=[Dt(Q3(a)),Dt(Math.round(e).toString(16)),Dt(Math.round(t).toString(16)),Dt(Math.round(n).toString(16))];return s.join("")}ye.equals=function(e,t){return!e||!t?!1:ye(e).toRgbString()==ye(t).toRgbString()};ye.random=function(){return ye.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function zD(e,t){t=t===0?0:t||10;var n=ye(e).toHsl();return n.s-=t/100,n.s=so(n.s),ye(n)}function VD(e,t){t=t===0?0:t||10;var n=ye(e).toHsl();return n.s+=t/100,n.s=so(n.s),ye(n)}function JD(e){return ye(e).desaturate(100)}function RD(e,t){t=t===0?0:t||10;var n=ye(e).toHsl();return n.l+=t/100,n.l=so(n.l),ye(n)}function QD(e,t){t=t===0?0:t||10;var n=ye(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),ye(n)}function $D(e,t){t=t===0?0:t||10;var n=ye(e).toHsl();return n.l-=t/100,n.l=so(n.l),ye(n)}function _D(e,t){var n=ye(e).toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,ye(n)}function HD(e){var t=ye(e).toHsl();return t.h=(t.h+180)%360,ye(t)}function Af(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=ye(e).toHsl(),a=[ye(e)],s=360/t,r=1;r<t;r++)a.push(ye({h:(n.h+r*s)%360,s:n.s,l:n.l}));return a}function WD(e){var t=ye(e).toHsl(),n=t.h;return[ye(e),ye({h:(n+72)%360,s:t.s,l:t.l}),ye({h:(n+216)%360,s:t.s,l:t.l})]}function FD(e,t,n){t=t||6,n=n||30;var a=ye(e).toHsl(),s=360/n,r=[ye(e)];for(a.h=(a.h-(s*t>>1)+720)%360;--t;)a.h=(a.h+s)%360,r.push(ye(a));return r}function BD(e,t){t=t||6;for(var n=ye(e).toHsv(),a=n.h,s=n.s,r=n.v,o=[],l=1/t;t--;)o.push(ye({h:a,s,v:r})),r=(r+l)%1;return o}ye.mix=function(e,t,n){n=n===0?0:n||50;var a=ye(e).toRgb(),s=ye(t).toRgb(),r=n/100,o={r:(s.r-a.r)*r+a.r,g:(s.g-a.g)*r+a.g,b:(s.b-a.b)*r+a.b,a:(s.a-a.a)*r+a.a};return ye(o)};ye.readability=function(e,t){var n=ye(e),a=ye(t);return(Math.max(n.getLuminance(),a.getLuminance())+.05)/(Math.min(n.getLuminance(),a.getLuminance())+.05)};ye.isReadable=function(e,t,n){var a=ye.readability(e,t),s,r;switch(r=!1,s=XD(n),s.level+s.size){case"AAsmall":case"AAAlarge":r=a>=4.5;break;case"AAlarge":r=a>=3;break;case"AAAsmall":r=a>=7;break}return r};ye.mostReadable=function(e,t,n){var a=null,s=0,r,o,l,u;n=n||{},o=n.includeFallbackColors,l=n.level,u=n.size;for(var c=0;c<t.length;c++)r=ye.readability(e,t[c]),r>s&&(s=r,a=ye(t[c]));return ye.isReadable(e,a,{level:l,size:u})||!o?a:(n.includeFallbackColors=!1,ye.mostReadable(e,["#fff","#000"],n))};var pl=ye.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},GD=ye.hexNames=ZD(pl);function ZD(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function R3(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function je(e,t){YD(e)&&(e="100%");var n=UD(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function so(e){return Math.min(1,Math.max(0,e))}function vt(e){return parseInt(e,16)}function YD(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function UD(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Dt(e){return e.length==1?"0"+e:""+e}function mi(e){return e<=1&&(e=e*100+"%"),e}function Q3(e){return Math.round(parseFloat(e)*255).toString(16)}function zf(e){return vt(e)/255}var kt=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",s="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+a),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+a),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+a),hsva:new RegExp("hsva"+s),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function en(e){return!!kt.CSS_UNIT.exec(e)}function KD(e){e=e.replace(xD,"").replace(DD,"").toLowerCase();var t=!1;if(pl[e])e=pl[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=kt.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=kt.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=kt.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=kt.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=kt.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=kt.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=kt.hex8.exec(e))?{r:vt(n[1]),g:vt(n[2]),b:vt(n[3]),a:zf(n[4]),format:t?"name":"hex8"}:(n=kt.hex6.exec(e))?{r:vt(n[1]),g:vt(n[2]),b:vt(n[3]),format:t?"name":"hex"}:(n=kt.hex4.exec(e))?{r:vt(n[1]+""+n[1]),g:vt(n[2]+""+n[2]),b:vt(n[3]+""+n[3]),a:zf(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=kt.hex3.exec(e))?{r:vt(n[1]+""+n[1]),g:vt(n[2]+""+n[2]),b:vt(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function XD(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const qD={info:g.object.isRequired},li=i.defineComponent({props:qD,emits:["tab","input"],setup(e,{emit:t}){const n=o=>{e.info.key==="a"&&t("tab",o)},a=o=>{const{key:l}=e.info,{value:u}=o.target;t("input",l,u)},{resolveClassName:s}=oe(),r=i.computed(()=>be({error:e.info.error},`${s("color-picker-input-value")}`));return()=>i.createVNode("div",{class:`${s("color-picker-input-part")}`},[i.createVNode("input",{type:e.info.name==="HEX"?"text":"number",class:r.value,value:e.info.value,onKeydown:n,onInput:a},null),i.createVNode("span",{class:`${s("color-picker-input-text")}`},[e.info.name])])}}),ej={colorObj:g.object.isRequired},tj=i.defineComponent({name:"ColorPicker",props:ej,emits:["change","tab"],setup(e,{emit:t}){const n=i.reactive({key:"hex",name:"HEX",value:e.colorObj.hex,error:!1}),a=i.reactive({key:"r",name:"R",value:e.colorObj.rgba.r.toString(),error:!1}),s=i.reactive({key:"g",name:"G",value:e.colorObj.rgba.g.toString(),error:!1}),r=i.reactive({key:"b",name:"B",value:e.colorObj.rgba.b.toString(),error:!1}),o=i.reactive({key:"a",name:"Alpha",value:e.colorObj.rgba.a.toString(),error:!1});i.watch(()=>e.colorObj,f=>{ye(f.hex).toString()!==ye(n.value).toString()&&(n.value=f.hex),a.value=f.rgba.r.toString(),s.value=f.rgba.g.toString(),r.value=f.rgba.b.toString(),o.value=f.rgba.a.toString(),c()},{deep:!0});const l=f=>{t("tab",f)},u=(f,h)=>{const m={r:a,g:s,b:r,a:o,hex:n};if(m[f].value=h,c()){const v=f==="hex"?n.value:`rgba(${a.value}, ${s.value}, ${r.value}, ${o.value})`;t("change",v)}},c=()=>{let f=!0;n.value.startsWith("#")&&(n.value.length===4||n.value.length===7)&&!n.value.slice(1).match(/[^0-9a-fA-F]/)?n.error=!1:(n.error=!0,f=!1),o.value!==""&&o.value>=0&&o.value<=1?o.error=!1:(o.error=!0,f=!1);for(const h of[a,s,r]){const{value:m}=h;m!==""&&m>=0&&m<=255?h.error=!1:(h.error=!0,f=!1)}return f},{resolveClassName:d}=oe();return()=>i.createVNode("div",{class:`${d("color-picker-input")}`},[i.createVNode("div",{class:`${d("color-picker-input-hex")}`},[i.createVNode(li,{info:n,onInput:u},null)]),i.createVNode("div",{class:`${d("color-picker-input-rgba")}`},[i.createVNode(li,{info:a,onInput:u},null),i.createVNode(li,{info:s,onInput:u},null),i.createVNode(li,{info:r,onInput:u},null),i.createVNode(li,{info:o,onInput:u,onTab:l},null)])])}}),yl=e=>{let t=e;e===""&&(t="#FFFFFF");const n=ye(e),a=n.toHsl(),s=n.toHsv();return a.s===0&&(a.h=t.h||0,s.h=t.h||0),s.v<.0164&&(s.h=t.h||0,s.s=t.s||0),a.l<.01&&(a.h=t.h||0,a.s=t.s||0),{hsl:a,hsv:s,hex:n.toHexString().toUpperCase(),rgba:n.toRgb()}},Ke=(e,t,n)=>e<t?t:e>n?n:e,bl=(e,t)=>e.touches?e.touches[0][t]:0,Vf=e=>{const{r:t,g:n,b:a,a:s}=e;return`rgba(${[t,n,a,s].join(",")})`},nj={colorObj:g.object.isRequired},aj=i.defineComponent({name:"ColorPicker",props:nj,emits:["change"],setup(e,{emit:t}){const n=i.ref(null),a=i.computed(()=>({left:`${e.colorObj.hsv.h/360*100}%`})),s=f=>{const{clientWidth:h}=n.value;let m=e.colorObj.hsv.h/360*h;const v=2,b=10;switch(f.code){case"ArrowLeft":f.preventDefault(),m=Ke(m-v,0,h);break;case"ArrowRight":f.preventDefault(),m=Ke(m+v,0,h);break;case"ArrowUp":f.preventDefault(),m=Ke(m-b,0,h);break;case"ArrowDown":f.preventDefault(),m=Ke(m+b,0,h);break;default:return}l(null,m)},r=f=>{n.value.focus(),l(f),window.addEventListener("mousemove",l,{passive:!0}),window.addEventListener("mouseup",o)},o=()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",o)},l=(f,h)=>{const{clientWidth:m}=n.value,v=h!==void 0?h:u(f);c(v/m)},u=f=>{const h=n.value.getBoundingClientRect().left+window.pageXOffset,m=f.pageX||bl(f,"PageX");return Ke(m-h,0,n.value.clientWidth)},c=f=>{const{h,s:m,l:v,a:b}=e.colorObj.hsl,N=f*360;h!==N&&t("change",{h:N,s:m,l:v,a:b})},{resolveClassName:d}=oe();return()=>i.createVNode("div",{ref:n,tabindex:"0",class:`${d("color-picker-hue")}`,onKeydown:s,onMousedown:f=>{f.stopPropagation(),f.preventDefault(),r(f)}},[i.createVNode("div",{class:`${d("color-picker-hue-pointer")}`,style:a.value},[i.createVNode("div",{class:`${d("color-picker-hue-rectangle")}`},null)])])}}),ij={colorObj:g.object.isRequired,recommend:g.oneOfType([g.array.def(()=>[]),g.bool.def(!0)]).isRequired,recommendEmpty:g.bool.def(!0)},sj=i.defineComponent({props:ij,emits:["change","tab"],setup(e,{emit:t}){const n=i.ref(!1),a=i.ref(-1),s=i.ref(null);i.watch(()=>e.colorObj,()=>{a.value=-1,s.value=null},{deep:!0});const r=i.computed(()=>d(e.recommend)),{resolveClassName:o}=oe(),l=(f,h)=>be({[`${o("color-picker-empty")}`]:f==="",[`${o("color-picker-recommend-selected-color")}`]:n.value&&a.value===h},`${o("color-picker-recommend-color")}`),u=f=>{if(f.code==="Tab")t("tab",f);else{let h=0;const m=10,v=r.value.length-1;switch(f.code){case"ArrowLeft":f.preventDefault(),h=Ke(a.value-1,0,v);break;case"ArrowRight":f.preventDefault(),h=Ke(a.value+1,0,v);break;case"ArrowUp":f.preventDefault(),h=Ke(a.value-m,0,v);break;case"ArrowDown":f.preventDefault(),h=Ke(a.value+m,0,v);break;default:return}c(h)}},c=f=>{const h=r.value[f];t("change",h),i.nextTick(()=>{a.value=f,s.value=h})},d=f=>{if(f===!0){const h=["#ff4500","#ff8c00","#ffd700","#90ee90","#ddffff","#00ced1","#3a84ff","#a933f5","#db7093","#000000","#494949","#9B9B9B","#ffffff"];return e.recommendEmpty&&h.unshift(""),h}if(Array.isArray(f))return f.map(h=>ye(h).isValid()?h:"")};return()=>i.createVNode("div",{tabindex:"0",class:`${o("color-picker-recommend")} `,onFocus:()=>n.value=!0,onBlur:()=>n.value=!1,onKeydown:u},[r.value.map((f,h)=>i.createVNode("div",{style:`background: ${f||"#fff"}`,class:l(f,h),onClick:()=>c(h)},[a.value===h?i.createVNode("div",{class:`${o("color-picker-pointer")}`},[i.createVNode("div",{class:`${o("color-picker-circle")}`},null)]):void 0]))])}}),rj={colorObj:g.object.isRequired},oj=i.defineComponent({props:rj,emits:["change"],setup(e,{emit:t}){const n=i.ref(null),a=i.computed(()=>({background:`hsl(${e.colorObj.hsv.h}, 100%, 50%)`})),s=i.computed(()=>({top:`${(1-e.colorObj.hsv.v)*100}%`,left:`${e.colorObj.hsv.s*100}%`})),r=m=>{n.value.focus(),u(m),window.addEventListener("mousemove",u,{passive:!0}),window.addEventListener("mouseup",o)},o=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",o)},l=m=>{const{clientWidth:v,clientHeight:b}=n.value;let N=e.colorObj.hsv.s*v,C=(1-e.colorObj.hsv.v)*b;const I=10;switch(m.code){case"ArrowLeft":m.preventDefault(),N=Ke(N-I,0,v);break;case"ArrowRight":m.preventDefault(),N=Ke(N+I,0,v);break;case"ArrowUp":m.preventDefault(),C=Ke(C-I,0,b);break;case"ArrowDown":m.preventDefault(),C=Ke(C+I,0,b);break;default:return}u(null,N,C)},u=(m,v,b)=>{const{clientWidth:N,clientHeight:C}=n.value,I=v!==void 0?v:c(m),p=b!==void 0?b:d(m),y=I/N,w=1-p/C;f(e.colorObj.hsv.h,y,w,e.colorObj.hsv.a)},c=m=>{const v=n.value.getBoundingClientRect().left+window.pageXOffset,b=m.pageX||bl(m,"PageX");return Ke(b-v,0,n.value.clientWidth)},d=m=>{const v=n.value.getBoundingClientRect().top+window.pageYOffset,b=m.pageY||bl(m,"PageY");return Ke(b-v,0,n.value.clientHeight)},f=(m,v,b,N)=>{t("change",{h:m,s:v,v:b,a:N})},{resolveClassName:h}=oe();return()=>i.createVNode("div",{ref:n,tabindex:"0",class:`${h("color-picker-saturation")}`,style:a.value,onKeydown:l,onMousedown:m=>{m.stopPropagation(),r(m)}},[i.createVNode("div",{class:`${h("color-picker-saturation-white")}`},null),i.createVNode("div",{class:`${h("color-picker-saturation-black")}`},null),i.createVNode("div",{class:`${h("color-picker-pointer")}`,style:s.value},[i.createVNode("div",{class:`${h("color-picker-circle")}`},null)])])}});var $3=function(e){return e.UNKNOWN="",e.SMALL="small",e.LARGE="large",e}($3||{});const lj={modelValue:g.string.def(""),disabled:g.bool.def(!1),readonly:g.bool.def(!1),transfer:g.bool.def(!1),size:ge("colorPickSize",{}).def($3.UNKNOWN),showValue:g.bool.def(!0),recommend:g.oneOfType([g.array.def(()=>[]),g.bool.def(!0)]).def(!0),extCls:g.string.def(""),withValidate:g.bool.def(!0),recommendEmpty:g.bool.def(!0)},ci=yl("#FFFFFF"),cj=i.defineComponent({name:"ColorPicker",directives:{clickoutside:Kt},props:lj,emits:["update:modelValue","change"],setup(e,{emit:t,slots:n}){const a=Ot(),s=i.ref(!1),r=i.ref(""),o=i.reactive(JSON.parse(JSON.stringify(ci))),l=i.ref(null),u=i.ref(null),c=i.ref(null),{resolveClassName:d}=oe(),f=i.computed(()=>be({[`${d(`color-picker-${e.size}`)}`]:e.size,[`${d("color-picker-show-dropdown")}`]:s.value,[`${d("color-picker-show-value")}`]:e.showValue,[`${d("color-picker-disabled")}`]:e.disabled||e.readonly},`${d("color-picker")} ${e.extCls}`)),h=i.computed(()=>!!(e.recommend===!0||Array.isArray(e.recommend)&&e.recommend.length));i.onBeforeMount(()=>{y({isCreated:!0})}),i.watch(()=>e.modelValue,()=>{var S;y(),e.withValidate&&((S=a==null?void 0:a.validate)==null||S.call(a,"change"))});const m=S=>{S.code==="Enter"||S.code==="NumpadEnter"?b():S.code==="Escape"&&p()},v=S=>{e.transfer&&m(S)},b=()=>{e.disabled||e.readonly||(s.value?p():I())},N=S=>{h.value||(S.preventDefault(),u.value.$el.focus())},C=S=>{S.preventDefault(),u.value.$el.focus()},I=()=>{var S;s.value=!0,(S=l.value)==null||S.updateDropdown(),setTimeout(()=>{l.value.$el.querySelector(`.${d("color-picker-input-hex")} .${d("color-picker-input-value")}`).select()},100)},p=()=>{var S;s.value&&(i.nextTick(()=>c.value.focus()),s.value=!1,(S=l.value)==null||S.destoryDropdown(),y())},y=({isCreated:S=!1}={})=>{if(e.modelValue===""){r.value!==""&&(r.value="",Object.assign(o,ci),t("update:modelValue",r.value));return}const L=yl(e.modelValue),j=L.rgba.a===1?L.hex:Vf(L.rgba);if(j!==r.value){const T=ye(e.modelValue).isValid();S?T?(r.value=j.toLowerCase()===e.modelValue.toLowerCase()?e.modelValue:j,Object.assign(o,L)):(Object.assign(o,ci),t("change","")):T?j.toLowerCase()!==r.value.toLowerCase()&&(Object.assign(o,L),r.value=j):(r.value="",Object.assign(o,ci))}},w=S=>{if(S===""){r.value="",Object.assign(o,ci),t("update:modelValue",""),t("change","");return}const L=yl(S),j=L.rgba.a===1?L.hex:Vf(L.rgba);r.value=j,Object.assign(o,L),t("update:modelValue",r.value),t("change",j)},M=()=>{s.value=!1};return()=>i.withDirectives(i.createVNode("div",{ref:c,tabindex:"0",class:f.value,onKeydown:m,onClick:b},[typeof n.trigger=="function"?n.trigger({value:r.value,isShowDropdown:s.value}):i.createVNode(i.Fragment,null,[i.createVNode("div",{class:`${d("color-picker-color")}`},[i.createVNode("span",{class:`${d("color-picker-color-square")} ${!r.value&&`${d("color-picker-empty")}`}`,style:`background: ${r.value||"#FFF"}`},null)]),e.showValue?i.createVNode("div",{class:`${d("color-picker-text")}`},[i.createVNode("span",null,[r.value])]):void 0,i.createVNode("div",{class:`${d("color-picker-icon")}`},[i.createVNode(oa,{class:"icon-angle-down"},null)])]),i.createVNode(i.Transition,{name:"bk-fade-down-transition"},{default:()=>[i.withDirectives(i.createVNode(Jc,{ref:l,triggerRef:c.value},{default:()=>[i.createVNode("div",{class:`${d("color-dropdown-container")}`},[i.createVNode("div",{class:`${d("color-picker-dropdown")}`,onClick:S=>{S.stopPropagation()},onMousedown:S=>{S.stopPropagation()},onKeydown:v},[i.createVNode(oj,{ref:u,colorObj:o,onChange:w},null),i.createVNode(aj,{colorObj:o,onChange:w},null),i.createVNode(tj,{colorObj:o,onTab:N,onChange:w},null),h.value?i.createVNode("div",{class:`${d("color-picker-recommend-container")}`},[i.createVNode(sj,{colorObj:o,recommend:e.recommend,recommendEmpty:e.recommendEmpty,onTab:C,onChange:w},null)]):void 0])])]}),[[i.vShow,s.value]])]})]),[[i.resolveDirective("clickoutside"),M]])}}),_3=Me(cj),H3=Me(WS);var ko=null;function uj(e){return ko||(ko=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return setTimeout(t,16)}).bind(window)),ko(e)}var xo=null;function dj(e){xo||(xo=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)}).bind(window)),xo(e)}function fj(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}function cs(e,t){t===void 0&&(t={});var n=document.createElement(e);return Object.keys(t).forEach(function(a){n[a]=t[a]}),n}function W3(e,t,n){var a=window.getComputedStyle(e,n||null)||{display:"none"};return a[t]}function Cl(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if(W3(t,"display")==="none")return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var hj='.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}',Nl=0,ws=null;function gj(e,t){e.__resize_mutation_handler__||(e.__resize_mutation_handler__=pj.bind(e));var n=e.__resize_listeners__;if(!n){if(e.__resize_listeners__=[],window.ResizeObserver){var a=e.offsetWidth,s=e.offsetHeight,r=new ResizeObserver(function(){!e.__resize_observer_triggered__&&(e.__resize_observer_triggered__=!0,e.offsetWidth===a&&e.offsetHeight===s)||tr(e)}),o=Cl(e),l=o.detached,u=o.rendered;e.__resize_observer_triggered__=l===!1&&u===!1,e.__resize_observer__=r,r.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){tr(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(Nl||(ws=fj(hj)),yj(e),e.__resize_rendered__=Cl(e).rendered,window.MutationObserver){var c=new MutationObserver(e.__resize_mutation_handler__);c.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=c}}e.__resize_listeners__.push(t),Nl++}function mj(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener){e.detachEvent("onresize",e.__resize_legacy_resize_handler__),document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);return}e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",Yc),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--Nl&&ws&&ws.parentNode.removeChild(ws)}}function vj(e){var t=e.__resize_last__,n=t.width,a=t.height,s=e.offsetWidth,r=e.offsetHeight;return s!==n||r!==a?{width:s,height:r}:null}function pj(){var e=Cl(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(Uc(this),this.addEventListener("scroll",Yc,!0)),this.__resize_rendered__=t,tr(this))}function Yc(){var e=this;Uc(this),this.__resize_raf__&&dj(this.__resize_raf__),this.__resize_raf__=uj(function(){var t=vj(e);t&&(e.__resize_last__=t,tr(e))})}function tr(e){!e||!e.__resize_listeners__||e.__resize_listeners__.forEach(function(t){t.call(e,e)})}function yj(e){var t=W3(e,"position");(!t||t==="static")&&(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=cs("div",{className:"resize-triggers"}),a=cs("div",{className:"resize-expand-trigger"}),s=cs("div"),r=cs("div",{className:"resize-contract-trigger"});a.appendChild(s),n.appendChild(a),n.appendChild(r),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:a,expandChild:s,contract:r},Uc(e),e.addEventListener("scroll",Yc,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}function Uc(e){var t=e.__resize_triggers__,n=t.expand,a=t.expandChild,s=t.contract,r=s.scrollWidth,o=s.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,c=n.scrollWidth,d=n.scrollHeight;s.scrollLeft=r,s.scrollTop=o,a.style.width=l+1+"px",a.style.height=u+1+"px",n.scrollLeft=c,n.scrollTop=d}var lt=(e=>(e.ALL="all",e.NEEDKEY="need-key",e))(lt||{});const F3=Symbol("SEARCH_SLECT_PROVIDER_KEY"),bj=e=>{i.provide(F3,e)},B3=()=>i.inject(F3);var ya=(e=>(e.DEFAULT="default",e.EDIT="edit",e))(ya||{}),Ra=(e=>(e.AND="&",e.OR="|",e))(Ra||{});class Fn{constructor(t,n="default"){ve(this,"id");ve(this,"name");ve(this,"values",[]);ve(this,"condition");ve(this,"logical");this.searchItem=t,this.type=n,this.id=t.id,this.name=t.name,this.logical=t.logical||"|"}get multiple(){return!!this.searchItem.multiple}get placeholder(){return this.searchItem.placeholder||""}get children(){return this.searchItem.children||[]}get validate(){return!this.searchItem.noValidate}get inputInnerHtml(){var t;return this.isSpecialType()?this.name:`${this.keyInnerHtml}${((t=this.values)==null?void 0:t.map(n=>n.name).join(` ${this.logical} `))||""}`}get inputInnerText(){var t;return this.isSpecialType()?this.name:`${this.keyInnerText}${((t=this.values)==null?void 0:t.map(n=>n.name).join(` ${this.logical} `))||""}`}get keyInnerHtml(){return this.isSpecialType()?this.name:this.name?`${this.name}: `:""}get keyInnerText(){return this.isSpecialType()?this.name:this.name?`${this.name}: `:""}get showLogical(){return!!this.searchItem.showLogicalPanel}isSpecialType(){return["text","condition"].includes(this.type)}addValue(t){if(this.multiple){const n=this.values.findIndex(a=>a.id===t.id);if(n>-1){this.values.splice(n,1);return}this.values.push(t);return}this.values=[t]}toValue(){var n;const t={id:this.id,name:this.name};return(n=this.values)!=null&&n.length&&(t.values=this.values.map(a=>({id:a.id,name:a.name})),this.multiple&&this.logical!=="|"&&(t.logical=this.logical)),this.type&&this.type!=="default"&&(t.type=this.type),t}toValueKey(){return JSON.stringify(this.toValue())}isInValueList(t){return this.children.some(n=>n.id===(t==null?void 0:t.id))}}const Cj=i.defineComponent({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:()=>[]},conditions:{type:Array},footerBtns:{type:Array,default:()=>[]},showLogical:{type:Boolean,default:!0},logical:{type:String,default:Ra.OR}},emits:["selectItem","selectCondition","footerClick","update:logical"],setup(e,{emit:t}){const n=ke("searchSelect"),{resolveClassName:a}=oe(),s=i.computed(()=>e.footerBtns===void 0||e.footerBtns.length===0?[{id:"confirm",name:n.value.ok},{id:"cancel",name:n.value.cancel,disabled:!1}]:e.footerBtns);function r(m){t("selectItem",m)}function o(m){t("selectCondition",m)}function l(m){t("footerClick",m)}const u=i.computed(()=>{var m,v;return(m=e.list)!=null&&m.length?(v=e.keyword)!=null&&v.length?e.list.filter(b=>b.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())):e.list:[]});function c(m){if(!m)return m;let{keyword:v}=e;const b=v.length;if(!(v!=null&&v.trim().length)||!m.toLocaleLowerCase().includes(v.toLocaleLowerCase()))return m;const N=[];let C=-1;return v=v.replace(/([.*/]{1})/gim,"\\$1"),m.replace(new RegExp(`${v}`,"igm"),(I,p)=>(N.length===0&&p!==0?N.push(m.slice(0,p)):C>=0&&N.push(m.slice(C+I.length,p)),N.push(i.createVNode("span",{class:"is-keyword"},[I])),C=p,I)),C>=0&&N.push(m.slice(C+b)),N.length?N:m}function d(m){var v;return(v=m.value)!=null&&v.name?[i.createVNode("span",{class:"menu-name"},[m.name,i.createTextVNode(":")]),m.value.name]:c(m.name)}function f(m,v){m.stopPropagation(),m.preventDefault(),r(v)}function h(m){t("update:logical",m)}return{handleClick:r,handleClickCondition:o,handleClickFooterBtn:l,handleSelectedChange:f,handleLogicalChange:h,filterList:u,getSearchNode:d,localFooterBtns:s,resolveClassName:a,t:n}},render(){var n,a;const e=i.createVNode("ul",{class:"menu-content"},[(n=this.list)==null?void 0:n.map(s=>i.createVNode("li",{class:`menu-item ${s.disabled?"is-disabled":""} ${this.hoverId===s.id&&!s.disabled?"is-hover":""}`,key:s.id,id:s.id,tabindex:"-1",onClick:()=>!s.disabled&&this.handleClick(s)},[this.$slots.default?this.$slots.default({item:s,list:this.list,multiple:!!this.multiple,hoverId:this.hoverId,getSearchNode:this.getSearchNode}):i.createVNode(i.Fragment,null,[this.multiple&&i.createVNode("span",{onClick:r=>this.handleSelectedChange(r,s)},[i.createVNode(ht,{modelValue:this.selected.includes(s.id),class:"is-selected"},null)]),this.getSearchNode(s)])]))]),t=()=>!this.showLogical||!this.multiple?e:i.createVNode("div",{class:"menu-content-wrapper"},[e,i.createVNode("div",{class:"menu-condition"},[i.createVNode("div",{class:"menu-condition-title"},[this.t.logical]),i.createVNode(As,{modelValue:this.logical,onChange:this.handleLogicalChange,label:"|"},{default:()=>[this.t.or,i.createTextVNode(" |")]}),i.createVNode(As,{modelValue:this.logical,onChange:this.handleLogicalChange,label:"&"},{default:()=>[this.t.and,i.createTextVNode(" &")]})])]);return i.createVNode("div",{class:this.resolveClassName("search-select-menu")},[!!((a=this.conditions)!=null&&a.length)&&i.createVNode("ul",{class:"menu-header"},[this.conditions.map(s=>i.createVNode("li",{key:s.id,class:`menu-header-item ${s.disabled?"is-disabled":""}`,onClick:()=>!s.disabled&&this.handleClickCondition(s)},[s.name]))]),t()])}}),G3=i.defineComponent({name:"SearchSelectInput",directives:{clickoutside:Kt},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:()=>[]},defautUsingItem:Object,mode:{type:String,default:ya.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup(e,{emit:t,expose:n}){const a=ke("searchSelect"),{resolveClassName:s}=oe(),r=i.ref(null),o=i.ref(null),l=i.ref(""),u=i.ref(!1),c=i.ref(!1),d=i.ref(!1),f=i.ref(e.defautUsingItem),h=i.ref(""),m=i.ref(!1),v=$a(300,ie);let b=!1;const N=i.ref([]),C=i.ref([]),{editKey:I,onValidate:p}=B3(),y=i.computed(()=>{var O;return((O=f.value)==null?void 0:O.logical)||Ra.OR});i.watch(I,()=>{e.mode===ya.DEFAULT&&I.value&&(d.value=!1)}),i.watchEffect(()=>{l.value||k()},{flush:"pre"}),i.watch([C,d],()=>{var O;(O=C.value)!=null&&O.some(R=>!R.disabled)&&d.value?b||(e.valueBehavior===lt.NEEDKEY?h.value=C.value.find(R=>!R.disabled).id:h.value="",b=!0,document.addEventListener("keydown",w)):(document.removeEventListener("keydown",w),b=!1,e.valueBehavior!==lt.NEEDKEY&&(h.value=""))});function w(O){switch(O.code){case"ArrowDown":case"ArrowUp":M(O);break;case"Enter":case"NumpadEnter":S(O);break}}function M(O){var G;O.preventDefault(),(G=r.value)==null||G.blur();const R=C.value.length;let B=R,K=C.value.findIndex(te=>te.id===h.value);for(;B>=0;){K=O.code==="ArrowDown"?K+1:K-1,K=K>R-1?0:K<0?R-1:K;const te=C.value[K];if(te&&!te.disabled){B=-1;const F=document.getElementById(te.id);F==null||F.focus(),h.value=te.id;return}B-=1}}function S(O){if(b){O.preventDefault();const R=C.value.find(B=>B.id===h.value);R&&E(R)}}function L(O){var R,B,K,G,te;if(!((R=o.value)!=null&&R.contains(O.target))&&((B=e.clickOutside)!=null&&B.call(e,O.target,o.value))){if((G=(K=f.value)==null?void 0:K.values)!=null&&G.length&&((te=f.value)!=null&&te.multiple)){l.value="",J();return}d.value=!1,c.value=!1,t("focus",c.value)}}function j(O){Z(),O&&ie()}function T(O){var B,K,G,te,F,D,x,$,q;Y();let R=O.target.innerText;if(/(\r|\n)/gm.test(R)||/\s{2}/gm.test(R))O.preventDefault(),R=R.replace(/(\r|\n)/gm,` ${y.value} `).replace(/\s{2}/gm,""),r.value.innerText=R,Z(),l.value=R.replace(((B=f.value)==null?void 0:B.keyInnerText)||"","").trim(),v();else if(!l.value&&R.length<(((G=(K=f.value)==null?void 0:K.inputInnerText)==null?void 0:G.length)||1)){const W=R.replace(" "," ").replace(((te=f.value)==null?void 0:te.keyInnerText.replace(" "," ").trim())||"","").trim();if(R&&((F=f.value)==null?void 0:F.keyInnerText)&&R.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&W&&((D=f.value.values)!=null&&D.length)){l.value=W,console.info("outerText",W),v();return}(W||!(R!=null&&R.length))&&(f.value=null),l.value=W?R:"",v()}else($=(x=f.value)==null?void 0:x.values)!=null&&$.length||(l.value=R.replace(" "," ").replace(((q=f.value)==null?void 0:q.keyInnerText.replace(" "," "))||"","").trim(),Z(),v())}function z(O){switch(O.code){case"Enter":case"NumpadEnter":if(e.valueBehavior===lt.NEEDKEY&&C.value.some(R=>R.id===h.value))return;J(O);break;case"Backspace":V();default:u.value=!1;break}}async function J(O){var K;if(O==null||O.preventDefault(),await new Promise(G=>setTimeout(G,0)),!f.value){if(!l.value||e.valueBehavior===lt.NEEDKEY)return;const G={id:l.value,name:l.value};if(!await Q(G))return;t("add",new Fn(G,"text")),l.value="",ie();return}const{values:R}=f.value;if(!(R!=null&&R.length)){if((K=l.value)!=null&&K.length){if(l.value.includes(y.value)){const G=l.value.split(y.value);if(!await Q({id:l.value,name:l.value}))return;G.forEach(F=>f.value.addValue({id:F,name:F}))}else{const G={id:l.value,name:l.value};if(!await Q(G))return;f.value.addValue(G)}t("add",f.value),l.value="",f.value=null,Z(!0);return}u.value=!0;return}if(l.value){const G={id:l.value,name:l.value};if(!await Q(G))return;f.value.addValue(G),t("add",f.value),l.value="",f.value=null,Z(!0);return}await Q()&&H()}function V(){var O,R;if(!f.value&&!l.value){t("delete"),i.nextTick(ie);return}if((O=f.value)!=null&&O.values.length){if((R=f.value)!=null&&R.multiple||f.value.isInValueList(f.value.values[0])||e.mode===ya.EDIT&&!l.value){f.value.values.splice(-1,1),l.value="",Z();return}}else l.value||(f.value=null,l.value="",ie());p("")}async function E(O,R){var K,G,te,F;if((K=O.value)!=null&&K.id){if(e.valueBehavior===lt.NEEDKEY&&O.value||!e.validateValues){const x=new Fn({...O,id:O.realId??O.id},R);x.addValue(O.value),H(x),e.valueBehavior===lt.NEEDKEY&&h.value&&Z(!0),h.value="";return}if(f.value=new Fn({...O,id:O.realId??O.id},R),f.value.addValue(O.value),!await Q(O.value)){f.value=null;return}H(f.value),h.value="",Z(!0);return}if(!f.value||!((G=r==null?void 0:r.value)!=null&&G.innerText)){f.value=new Fn(O,R),l.value="";const D=R==="condition";D&&H(),d.value=D||!!f.value.children.length,Z(e.valueBehavior===lt.NEEDKEY&&!!h.value);return}if(((te=f.value)==null?void 0:te.type)==="condition"){f.value=new Fn(O,R),H();return}f.value.addValue(O),await Q(O)&&(f.value.multiple||H(),e.valueBehavior===lt.NEEDKEY&&((F=f.value)!=null&&F.multiple)&&Z())}function P(O){E(O,"condition")}function _(O){var R;switch(O.id){case"confirm":if(!((R=f.value)!=null&&R.values.length))return;l.value="",J();break;case"cancel":f.value.values=[],d.value=!1;break}}async function Q(O){if(!f.value)return await U(null,[O]);const{searchItem:R,validate:B,values:K}=f.value;return B&&typeof e.validateValues=="function"?await U(R,O?[O]:K):(p(""),!0)}async function U(O,R){var K;const B=await((K=e.validateValues)==null?void 0:K.call(e,O??null,R).catch(()=>!1));return typeof B=="string"||B===!1?(p(B||"校验错误"),!1):(p(""),!0)}function Z(O=!1){O&&i.nextTick().then(()=>{ie()}),c.value=!0,d.value=!0,u.value=!1;const R=setTimeout(()=>{if(r.value){r.value.focus();const B=window.getSelection();B.focusOffset===0&&(B.selectAllChildren(r.value),B.collapseToEnd())}window.clearTimeout(R)},0);t("focus",c.value)}async function ie(){var R,B,K,G,te;let O=[];if(typeof e.getMenuList=="function"&&(typeof((B=(R=f.value)==null?void 0:R.searchItem)==null?void 0:B.async)>"u"||f.value.searchItem.async===!0)?(m.value=!0,O=await e.getMenuList((K=f.value)==null?void 0:K.searchItem,l.value).catch(()=>[]),m.value=!1):f!=null&&f.value?f.value.type==="condition"?O=e.conditions:(!((te=f.value.values)!=null&&te.length)||f.value.multiple||e.mode===ya.EDIT)&&(O=f.value.children.filter(F=>F.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase()))):(G=l.value)!=null&&G.length?e.data.filter(F=>!F.isSelected).forEach(F=>{var x,$;if(F.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase())){O.push(F);const q=[];(x=F.children)==null||x.forEach(W=>{q.push({...F,realId:F.id,id:Ln(10),value:W})}),!q.length&&!F.onlyRecommendChildren&&q.push({...F,realId:F.id,id:Ln(10),value:{id:l.value,name:l.value}}),O.push(...q)}else{const q=[];($=F.children)==null||$.forEach(W=>{W.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase())&&q.push({...F,realId:F.id,id:Ln(10),value:W})}),!q.length&&!F.onlyRecommendChildren&&q.push({...F,value:{id:l.value,name:l.value}}),O.push(...q)}}):O=e.data.filter(F=>!F.isSelected).slice(),C.value=O,e.valueBehavior===lt.NEEDKEY){const F=O.find(D=>!D.disabled);F&&(!h.value||h.value&&!O.some(D=>D.id===h.value))&&(h.value=F.id)}}function H(O){t("add",O??f.value),f.value=null,l.value="",Z(e.valueBehavior===lt.NEEDKEY)}function Y(){const O=r.value.innerText;O[O.length-1]===`
|
361
|
+
`+n),a.b("</div>"),a.fl()},partials:{},subs:{}});$e["tag-file-added"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),a.fl()},partials:{},subs:{}});$e["tag-file-changed"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),a.fl()},partials:{},subs:{}});$e["tag-file-deleted"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),a.fl()},partials:{},subs:{}});$e["tag-file-renamed"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),a.fl()},partials:{},subs:{}});var Wn=globalThis&&globalThis.__assign||function(){return Wn=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Wn.apply(this,arguments)},bD=function(){function e(t){var n=t.compiledTemplates,a=n===void 0?{}:n,s=t.rawTemplates,r=s===void 0?{}:s,o=Object.entries(r).reduce(function(l,u){var c,d=u[0],f=u[1],h=ze.compile(f,{asString:!1});return Wn(Wn({},l),(c={},c[d]=h,c))},{});this.preCompiledTemplates=Wn(Wn(Wn({},$e),a),o)}return e.compile=function(t){return ze.compile(t,{asString:!1})},e.prototype.render=function(t,n,a,s,r){var o=this.templateKey(t,n);try{var l=this.preCompiledTemplates[o];return l.render(a,s,r)}catch{throw new Error("Could not find template to render '".concat(o,"'"))}},e.prototype.template=function(t,n){return this.preCompiledTemplates[this.templateKey(t,n)]},e.prototype.templateKey=function(t,n){return"".concat(t,"-").concat(n)},e}(),Kn=globalThis&&globalThis.__assign||function(){return Kn=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Kn.apply(this,arguments)},CD=Kn(Kn(Kn({},P3),A3),{outputFormat:$x.LINE_BY_LINE,drawFileList:!0});function ND(e,t){t===void 0&&(t={});var n=Kn(Kn({},CD),t),a=typeof e=="string"?Ux(e,n):e,s=new bD(n),r=n.drawFileList?dD(a,s):"",o=n.outputFormat==="side-by-side"?new yD(s,n).render(a):new gD(s,n).render(a);return r+o}const wD=["side-by-side","line-by-line"],MD=mh([...wD]),ID=["dark","light"],LD=mh([...ID]),TD={oldContent:ct().def(""),newContent:ct().def(""),diffFormat:ct().def(MD["line-by-line"]),diffContext:fh(),theme:ct().def("light"),language:ct().def("javascript"),hljs:g.any.isRequired};function SD(e,t){return e.replace(/d2h-code-line-ctn/g,n=>`${n} lang-${t}`)}const kD=i.defineComponent({name:"CodeDiff",props:TD,emits:[],setup(e){const{resolveClassName:t}=oe(),n=i.ref(null),a=i.ref(""),s=i.computed(()=>be({dark:e.theme===LD.dark},`hljs ${t("code-diff")}`));function r(){i.nextTick(()=>{n.value&&n.value.querySelectorAll(`.lang-${e.language}`).forEach(l=>{e.hljs.highlightElement(l)})})}function o(l,u){const c=Qx("",e.oldContent,e.newContent,"","",{context:l});a.value=SD(ND(c,{drawFileList:!1,matching:"lines",outputFormat:e.diffFormat}),u),r()}return i.onMounted(()=>{o(e.diffContext,e.language)}),i.watch(()=>[e.diffContext,e.language],l=>{const[u,c]=l;o(u,c)}),()=>i.createVNode("div",{ref:n,class:s.value,innerHTML:a.value},null)}}),J3=Me(kD);function er(e){"@babel/helpers - typeof";return er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(e)}var xD=/^\s+/,DD=/\s+$/;function ye(e,t){if(e=e||"",t=t||{},e instanceof ye)return e;if(!(this instanceof ye))return new ye(e,t);var n=jD(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}ye.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,a,s,r,o,l;return n=t.r/255,a=t.g/255,s=t.b/255,n<=.03928?r=n/12.92:r=Math.pow((n+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),s<=.03928?l=s/12.92:l=Math.pow((s+.055)/1.055,2.4),.2126*r+.7152*o+.0722*l},setAlpha:function(t){return this._a=R3(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Of(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Of(this._r,this._g,this._b),n=Math.round(t.h*360),a=Math.round(t.s*100),s=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+a+"%, "+s+"%)":"hsva("+n+", "+a+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var t=jf(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=jf(this._r,this._g,this._b),n=Math.round(t.h*360),a=Math.round(t.s*100),s=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+a+"%, "+s+"%)":"hsla("+n+", "+a+"%, "+s+"%, "+this._roundA+")"},toHex:function(t){return Ef(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return AD(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(je(this._r,255)*100)+"%",g:Math.round(je(this._g,255)*100)+"%",b:Math.round(je(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(je(this._r,255)*100)+"%, "+Math.round(je(this._g,255)*100)+"%, "+Math.round(je(this._b,255)*100)+"%)":"rgba("+Math.round(je(this._r,255)*100)+"%, "+Math.round(je(this._g,255)*100)+"%, "+Math.round(je(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:GD[Ef(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+Pf(this._r,this._g,this._b,this._a),a=n,s=this._gradientType?"GradientType = 1, ":"";if(t){var r=ye(t);a="#"+Pf(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+n+",endColorstr="+a+")"},toString:function(t){var n=!!t;t=t||this._format;var a=!1,s=this._a<1&&this._a>=0,r=!n&&s&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return r?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(a=this.toRgbString()),t==="prgb"&&(a=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(a=this.toHexString()),t==="hex3"&&(a=this.toHexString(!0)),t==="hex4"&&(a=this.toHex8String(!0)),t==="hex8"&&(a=this.toHex8String()),t==="name"&&(a=this.toName()),t==="hsl"&&(a=this.toHslString()),t==="hsv"&&(a=this.toHsvString()),a||this.toHexString())},clone:function(){return ye(this.toString())},_applyModification:function(t,n){var a=t.apply(null,[this].concat([].slice.call(n)));return this._r=a._r,this._g=a._g,this._b=a._b,this.setAlpha(a._a),this},lighten:function(){return this._applyModification(RD,arguments)},brighten:function(){return this._applyModification(QD,arguments)},darken:function(){return this._applyModification($D,arguments)},desaturate:function(){return this._applyModification(zD,arguments)},saturate:function(){return this._applyModification(VD,arguments)},greyscale:function(){return this._applyModification(JD,arguments)},spin:function(){return this._applyModification(_D,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(FD,arguments)},complement:function(){return this._applyCombination(HD,arguments)},monochromatic:function(){return this._applyCombination(BD,arguments)},splitcomplement:function(){return this._applyCombination(WD,arguments)},triad:function(){return this._applyCombination(Af,[3])},tetrad:function(){return this._applyCombination(Af,[4])}};ye.fromRatio=function(e,t){if(er(e)=="object"){var n={};for(var a in e)e.hasOwnProperty(a)&&(a==="a"?n[a]=e[a]:n[a]=mi(e[a]));e=n}return ye(e,t)};function jD(e){var t={r:0,g:0,b:0},n=1,a=null,s=null,r=null,o=!1,l=!1;return typeof e=="string"&&(e=KD(e)),er(e)=="object"&&(en(e.r)&&en(e.g)&&en(e.b)?(t=OD(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):en(e.h)&&en(e.s)&&en(e.v)?(a=mi(e.s),s=mi(e.v),t=PD(e.h,a,s),o=!0,l="hsv"):en(e.h)&&en(e.s)&&en(e.l)&&(a=mi(e.s),r=mi(e.l),t=ED(e.h,a,r),o=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=R3(n),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function OD(e,t,n){return{r:je(e,255)*255,g:je(t,255)*255,b:je(n,255)*255}}function jf(e,t,n){e=je(e,255),t=je(t,255),n=je(n,255);var a=Math.max(e,t,n),s=Math.min(e,t,n),r,o,l=(a+s)/2;if(a==s)r=o=0;else{var u=a-s;switch(o=l>.5?u/(2-a-s):u/(a+s),a){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4;break}r/=6}return{h:r,s:o,l}}function ED(e,t,n){var a,s,r;e=je(e,360),t=je(t,100),n=je(n,100);function o(c,d,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(d-c)*6*f:f<1/2?d:f<2/3?c+(d-c)*(2/3-f)*6:c}if(t===0)a=s=r=n;else{var l=n<.5?n*(1+t):n+t-n*t,u=2*n-l;a=o(u,l,e+1/3),s=o(u,l,e),r=o(u,l,e-1/3)}return{r:a*255,g:s*255,b:r*255}}function Of(e,t,n){e=je(e,255),t=je(t,255),n=je(n,255);var a=Math.max(e,t,n),s=Math.min(e,t,n),r,o,l=a,u=a-s;if(o=a===0?0:u/a,a==s)r=0;else{switch(a){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4;break}r/=6}return{h:r,s:o,v:l}}function PD(e,t,n){e=je(e,360)*6,t=je(t,100),n=je(n,100);var a=Math.floor(e),s=e-a,r=n*(1-t),o=n*(1-s*t),l=n*(1-(1-s)*t),u=a%6,c=[n,o,r,r,l,n][u],d=[l,n,n,o,r,r][u],f=[r,r,l,n,n,o][u];return{r:c*255,g:d*255,b:f*255}}function Ef(e,t,n,a){var s=[Dt(Math.round(e).toString(16)),Dt(Math.round(t).toString(16)),Dt(Math.round(n).toString(16))];return a&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function AD(e,t,n,a,s){var r=[Dt(Math.round(e).toString(16)),Dt(Math.round(t).toString(16)),Dt(Math.round(n).toString(16)),Dt(Q3(a))];return s&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)&&r[3].charAt(0)==r[3].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function Pf(e,t,n,a){var s=[Dt(Q3(a)),Dt(Math.round(e).toString(16)),Dt(Math.round(t).toString(16)),Dt(Math.round(n).toString(16))];return s.join("")}ye.equals=function(e,t){return!e||!t?!1:ye(e).toRgbString()==ye(t).toRgbString()};ye.random=function(){return ye.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function zD(e,t){t=t===0?0:t||10;var n=ye(e).toHsl();return n.s-=t/100,n.s=so(n.s),ye(n)}function VD(e,t){t=t===0?0:t||10;var n=ye(e).toHsl();return n.s+=t/100,n.s=so(n.s),ye(n)}function JD(e){return ye(e).desaturate(100)}function RD(e,t){t=t===0?0:t||10;var n=ye(e).toHsl();return n.l+=t/100,n.l=so(n.l),ye(n)}function QD(e,t){t=t===0?0:t||10;var n=ye(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),ye(n)}function $D(e,t){t=t===0?0:t||10;var n=ye(e).toHsl();return n.l-=t/100,n.l=so(n.l),ye(n)}function _D(e,t){var n=ye(e).toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,ye(n)}function HD(e){var t=ye(e).toHsl();return t.h=(t.h+180)%360,ye(t)}function Af(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=ye(e).toHsl(),a=[ye(e)],s=360/t,r=1;r<t;r++)a.push(ye({h:(n.h+r*s)%360,s:n.s,l:n.l}));return a}function WD(e){var t=ye(e).toHsl(),n=t.h;return[ye(e),ye({h:(n+72)%360,s:t.s,l:t.l}),ye({h:(n+216)%360,s:t.s,l:t.l})]}function FD(e,t,n){t=t||6,n=n||30;var a=ye(e).toHsl(),s=360/n,r=[ye(e)];for(a.h=(a.h-(s*t>>1)+720)%360;--t;)a.h=(a.h+s)%360,r.push(ye(a));return r}function BD(e,t){t=t||6;for(var n=ye(e).toHsv(),a=n.h,s=n.s,r=n.v,o=[],l=1/t;t--;)o.push(ye({h:a,s,v:r})),r=(r+l)%1;return o}ye.mix=function(e,t,n){n=n===0?0:n||50;var a=ye(e).toRgb(),s=ye(t).toRgb(),r=n/100,o={r:(s.r-a.r)*r+a.r,g:(s.g-a.g)*r+a.g,b:(s.b-a.b)*r+a.b,a:(s.a-a.a)*r+a.a};return ye(o)};ye.readability=function(e,t){var n=ye(e),a=ye(t);return(Math.max(n.getLuminance(),a.getLuminance())+.05)/(Math.min(n.getLuminance(),a.getLuminance())+.05)};ye.isReadable=function(e,t,n){var a=ye.readability(e,t),s,r;switch(r=!1,s=XD(n),s.level+s.size){case"AAsmall":case"AAAlarge":r=a>=4.5;break;case"AAlarge":r=a>=3;break;case"AAAsmall":r=a>=7;break}return r};ye.mostReadable=function(e,t,n){var a=null,s=0,r,o,l,u;n=n||{},o=n.includeFallbackColors,l=n.level,u=n.size;for(var c=0;c<t.length;c++)r=ye.readability(e,t[c]),r>s&&(s=r,a=ye(t[c]));return ye.isReadable(e,a,{level:l,size:u})||!o?a:(n.includeFallbackColors=!1,ye.mostReadable(e,["#fff","#000"],n))};var pl=ye.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},GD=ye.hexNames=ZD(pl);function ZD(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function R3(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function je(e,t){YD(e)&&(e="100%");var n=UD(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function so(e){return Math.min(1,Math.max(0,e))}function vt(e){return parseInt(e,16)}function YD(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function UD(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Dt(e){return e.length==1?"0"+e:""+e}function mi(e){return e<=1&&(e=e*100+"%"),e}function Q3(e){return Math.round(parseFloat(e)*255).toString(16)}function zf(e){return vt(e)/255}var kt=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",s="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+a),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+a),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+a),hsva:new RegExp("hsva"+s),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function en(e){return!!kt.CSS_UNIT.exec(e)}function KD(e){e=e.replace(xD,"").replace(DD,"").toLowerCase();var t=!1;if(pl[e])e=pl[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=kt.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=kt.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=kt.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=kt.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=kt.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=kt.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=kt.hex8.exec(e))?{r:vt(n[1]),g:vt(n[2]),b:vt(n[3]),a:zf(n[4]),format:t?"name":"hex8"}:(n=kt.hex6.exec(e))?{r:vt(n[1]),g:vt(n[2]),b:vt(n[3]),format:t?"name":"hex"}:(n=kt.hex4.exec(e))?{r:vt(n[1]+""+n[1]),g:vt(n[2]+""+n[2]),b:vt(n[3]+""+n[3]),a:zf(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=kt.hex3.exec(e))?{r:vt(n[1]+""+n[1]),g:vt(n[2]+""+n[2]),b:vt(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function XD(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const qD={info:g.object.isRequired},li=i.defineComponent({props:qD,emits:["tab","input"],setup(e,{emit:t}){const n=o=>{e.info.key==="a"&&t("tab",o)},a=o=>{const{key:l}=e.info,{value:u}=o.target;t("input",l,u)},{resolveClassName:s}=oe(),r=i.computed(()=>be({error:e.info.error},`${s("color-picker-input-value")}`));return()=>i.createVNode("div",{class:`${s("color-picker-input-part")}`},[i.createVNode("input",{type:e.info.name==="HEX"?"text":"number",class:r.value,value:e.info.value,onKeydown:n,onInput:a},null),i.createVNode("span",{class:`${s("color-picker-input-text")}`},[e.info.name])])}}),ej={colorObj:g.object.isRequired},tj=i.defineComponent({name:"ColorPicker",props:ej,emits:["change","tab"],setup(e,{emit:t}){const n=i.reactive({key:"hex",name:"HEX",value:e.colorObj.hex,error:!1}),a=i.reactive({key:"r",name:"R",value:e.colorObj.rgba.r.toString(),error:!1}),s=i.reactive({key:"g",name:"G",value:e.colorObj.rgba.g.toString(),error:!1}),r=i.reactive({key:"b",name:"B",value:e.colorObj.rgba.b.toString(),error:!1}),o=i.reactive({key:"a",name:"Alpha",value:e.colorObj.rgba.a.toString(),error:!1});i.watch(()=>e.colorObj,f=>{ye(f.hex).toString()!==ye(n.value).toString()&&(n.value=f.hex),a.value=f.rgba.r.toString(),s.value=f.rgba.g.toString(),r.value=f.rgba.b.toString(),o.value=f.rgba.a.toString(),c()},{deep:!0});const l=f=>{t("tab",f)},u=(f,h)=>{const m={r:a,g:s,b:r,a:o,hex:n};if(m[f].value=h,c()){const v=f==="hex"?n.value:`rgba(${a.value}, ${s.value}, ${r.value}, ${o.value})`;t("change",v)}},c=()=>{let f=!0;n.value.startsWith("#")&&(n.value.length===4||n.value.length===7)&&!n.value.slice(1).match(/[^0-9a-fA-F]/)?n.error=!1:(n.error=!0,f=!1),o.value!==""&&o.value>=0&&o.value<=1?o.error=!1:(o.error=!0,f=!1);for(const h of[a,s,r]){const{value:m}=h;m!==""&&m>=0&&m<=255?h.error=!1:(h.error=!0,f=!1)}return f},{resolveClassName:d}=oe();return()=>i.createVNode("div",{class:`${d("color-picker-input")}`},[i.createVNode("div",{class:`${d("color-picker-input-hex")}`},[i.createVNode(li,{info:n,onInput:u},null)]),i.createVNode("div",{class:`${d("color-picker-input-rgba")}`},[i.createVNode(li,{info:a,onInput:u},null),i.createVNode(li,{info:s,onInput:u},null),i.createVNode(li,{info:r,onInput:u},null),i.createVNode(li,{info:o,onInput:u,onTab:l},null)])])}}),yl=e=>{let t=e;e===""&&(t="#FFFFFF");const n=ye(e),a=n.toHsl(),s=n.toHsv();return a.s===0&&(a.h=t.h||0,s.h=t.h||0),s.v<.0164&&(s.h=t.h||0,s.s=t.s||0),a.l<.01&&(a.h=t.h||0,a.s=t.s||0),{hsl:a,hsv:s,hex:n.toHexString().toUpperCase(),rgba:n.toRgb()}},Ke=(e,t,n)=>e<t?t:e>n?n:e,bl=(e,t)=>e.touches?e.touches[0][t]:0,Vf=e=>{const{r:t,g:n,b:a,a:s}=e;return`rgba(${[t,n,a,s].join(",")})`},nj={colorObj:g.object.isRequired},aj=i.defineComponent({name:"ColorPicker",props:nj,emits:["change"],setup(e,{emit:t}){const n=i.ref(null),a=i.computed(()=>({left:`${e.colorObj.hsv.h/360*100}%`})),s=f=>{const{clientWidth:h}=n.value;let m=e.colorObj.hsv.h/360*h;const v=2,b=10;switch(f.code){case"ArrowLeft":f.preventDefault(),m=Ke(m-v,0,h);break;case"ArrowRight":f.preventDefault(),m=Ke(m+v,0,h);break;case"ArrowUp":f.preventDefault(),m=Ke(m-b,0,h);break;case"ArrowDown":f.preventDefault(),m=Ke(m+b,0,h);break;default:return}l(null,m)},r=f=>{n.value.focus(),l(f),window.addEventListener("mousemove",l,{passive:!0}),window.addEventListener("mouseup",o)},o=()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",o)},l=(f,h)=>{const{clientWidth:m}=n.value,v=h!==void 0?h:u(f);c(v/m)},u=f=>{const h=n.value.getBoundingClientRect().left+window.pageXOffset,m=f.pageX||bl(f,"PageX");return Ke(m-h,0,n.value.clientWidth)},c=f=>{const{h,s:m,l:v,a:b}=e.colorObj.hsl,N=f*360;h!==N&&t("change",{h:N,s:m,l:v,a:b})},{resolveClassName:d}=oe();return()=>i.createVNode("div",{ref:n,tabindex:"0",class:`${d("color-picker-hue")}`,onKeydown:s,onMousedown:f=>{f.stopPropagation(),f.preventDefault(),r(f)}},[i.createVNode("div",{class:`${d("color-picker-hue-pointer")}`,style:a.value},[i.createVNode("div",{class:`${d("color-picker-hue-rectangle")}`},null)])])}}),ij={colorObj:g.object.isRequired,recommend:g.oneOfType([g.array.def(()=>[]),g.bool.def(!0)]).isRequired,recommendEmpty:g.bool.def(!0)},sj=i.defineComponent({props:ij,emits:["change","tab"],setup(e,{emit:t}){const n=i.ref(!1),a=i.ref(-1),s=i.ref(null);i.watch(()=>e.colorObj,()=>{a.value=-1,s.value=null},{deep:!0});const r=i.computed(()=>d(e.recommend)),{resolveClassName:o}=oe(),l=(f,h)=>be({[`${o("color-picker-empty")}`]:f==="",[`${o("color-picker-recommend-selected-color")}`]:n.value&&a.value===h},`${o("color-picker-recommend-color")}`),u=f=>{if(f.code==="Tab")t("tab",f);else{let h=0;const m=10,v=r.value.length-1;switch(f.code){case"ArrowLeft":f.preventDefault(),h=Ke(a.value-1,0,v);break;case"ArrowRight":f.preventDefault(),h=Ke(a.value+1,0,v);break;case"ArrowUp":f.preventDefault(),h=Ke(a.value-m,0,v);break;case"ArrowDown":f.preventDefault(),h=Ke(a.value+m,0,v);break;default:return}c(h)}},c=f=>{const h=r.value[f];t("change",h),i.nextTick(()=>{a.value=f,s.value=h})},d=f=>{if(f===!0){const h=["#ff4500","#ff8c00","#ffd700","#90ee90","#ddffff","#00ced1","#3a84ff","#a933f5","#db7093","#000000","#494949","#9B9B9B","#ffffff"];return e.recommendEmpty&&h.unshift(""),h}if(Array.isArray(f))return f.map(h=>ye(h).isValid()?h:"")};return()=>i.createVNode("div",{tabindex:"0",class:`${o("color-picker-recommend")} `,onFocus:()=>n.value=!0,onBlur:()=>n.value=!1,onKeydown:u},[r.value.map((f,h)=>i.createVNode("div",{style:`background: ${f||"#fff"}`,class:l(f,h),onClick:()=>c(h)},[a.value===h?i.createVNode("div",{class:`${o("color-picker-pointer")}`},[i.createVNode("div",{class:`${o("color-picker-circle")}`},null)]):void 0]))])}}),rj={colorObj:g.object.isRequired},oj=i.defineComponent({props:rj,emits:["change"],setup(e,{emit:t}){const n=i.ref(null),a=i.computed(()=>({background:`hsl(${e.colorObj.hsv.h}, 100%, 50%)`})),s=i.computed(()=>({top:`${(1-e.colorObj.hsv.v)*100}%`,left:`${e.colorObj.hsv.s*100}%`})),r=m=>{n.value.focus(),u(m),window.addEventListener("mousemove",u,{passive:!0}),window.addEventListener("mouseup",o)},o=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",o)},l=m=>{const{clientWidth:v,clientHeight:b}=n.value;let N=e.colorObj.hsv.s*v,C=(1-e.colorObj.hsv.v)*b;const I=10;switch(m.code){case"ArrowLeft":m.preventDefault(),N=Ke(N-I,0,v);break;case"ArrowRight":m.preventDefault(),N=Ke(N+I,0,v);break;case"ArrowUp":m.preventDefault(),C=Ke(C-I,0,b);break;case"ArrowDown":m.preventDefault(),C=Ke(C+I,0,b);break;default:return}u(null,N,C)},u=(m,v,b)=>{const{clientWidth:N,clientHeight:C}=n.value,I=v!==void 0?v:c(m),p=b!==void 0?b:d(m),y=I/N,w=1-p/C;f(e.colorObj.hsv.h,y,w,e.colorObj.hsv.a)},c=m=>{const v=n.value.getBoundingClientRect().left+window.pageXOffset,b=m.pageX||bl(m,"PageX");return Ke(b-v,0,n.value.clientWidth)},d=m=>{const v=n.value.getBoundingClientRect().top+window.pageYOffset,b=m.pageY||bl(m,"PageY");return Ke(b-v,0,n.value.clientHeight)},f=(m,v,b,N)=>{t("change",{h:m,s:v,v:b,a:N})},{resolveClassName:h}=oe();return()=>i.createVNode("div",{ref:n,tabindex:"0",class:`${h("color-picker-saturation")}`,style:a.value,onKeydown:l,onMousedown:m=>{m.stopPropagation(),r(m)}},[i.createVNode("div",{class:`${h("color-picker-saturation-white")}`},null),i.createVNode("div",{class:`${h("color-picker-saturation-black")}`},null),i.createVNode("div",{class:`${h("color-picker-pointer")}`,style:s.value},[i.createVNode("div",{class:`${h("color-picker-circle")}`},null)])])}});var $3=function(e){return e.UNKNOWN="",e.SMALL="small",e.LARGE="large",e}($3||{});const lj={modelValue:g.string.def(""),disabled:g.bool.def(!1),readonly:g.bool.def(!1),transfer:g.bool.def(!1),size:ge("colorPickSize",{}).def($3.UNKNOWN),showValue:g.bool.def(!0),recommend:g.oneOfType([g.array.def(()=>[]),g.bool.def(!0)]).def(!0),extCls:g.string.def(""),withValidate:g.bool.def(!0),recommendEmpty:g.bool.def(!0)},ci=yl("#FFFFFF"),cj=i.defineComponent({name:"ColorPicker",directives:{clickoutside:Kt},props:lj,emits:["update:modelValue","change"],setup(e,{emit:t,slots:n}){const a=Ot(),s=i.ref(!1),r=i.ref(""),o=i.reactive(JSON.parse(JSON.stringify(ci))),l=i.ref(null),u=i.ref(null),c=i.ref(null),{resolveClassName:d}=oe(),f=i.computed(()=>be({[`${d(`color-picker-${e.size}`)}`]:e.size,[`${d("color-picker-show-dropdown")}`]:s.value,[`${d("color-picker-show-value")}`]:e.showValue,[`${d("color-picker-disabled")}`]:e.disabled||e.readonly},`${d("color-picker")} ${e.extCls}`)),h=i.computed(()=>!!(e.recommend===!0||Array.isArray(e.recommend)&&e.recommend.length));i.onBeforeMount(()=>{y({isCreated:!0})}),i.watch(()=>e.modelValue,()=>{var S;y(),e.withValidate&&((S=a==null?void 0:a.validate)==null||S.call(a,"change"))});const m=S=>{S.code==="Enter"||S.code==="NumpadEnter"?b():S.code==="Escape"&&p()},v=S=>{e.transfer&&m(S)},b=()=>{e.disabled||e.readonly||(s.value?p():I())},N=S=>{h.value||(S.preventDefault(),u.value.$el.focus())},C=S=>{S.preventDefault(),u.value.$el.focus()},I=()=>{var S;s.value=!0,(S=l.value)==null||S.updateDropdown(),setTimeout(()=>{l.value.$el.querySelector(`.${d("color-picker-input-hex")} .${d("color-picker-input-value")}`).select()},100)},p=()=>{var S;s.value&&(i.nextTick(()=>c.value.focus()),s.value=!1,(S=l.value)==null||S.destoryDropdown(),y())},y=({isCreated:S=!1}={})=>{if(e.modelValue===""){r.value!==""&&(r.value="",Object.assign(o,ci),t("update:modelValue",r.value));return}const L=yl(e.modelValue),j=L.rgba.a===1?L.hex:Vf(L.rgba);if(j!==r.value){const T=ye(e.modelValue).isValid();S?T?(r.value=j.toLowerCase()===e.modelValue.toLowerCase()?e.modelValue:j,Object.assign(o,L)):(Object.assign(o,ci),t("change","")):T?j.toLowerCase()!==r.value.toLowerCase()&&(Object.assign(o,L),r.value=j):(r.value="",Object.assign(o,ci))}},w=S=>{if(S===""){r.value="",Object.assign(o,ci),t("update:modelValue",""),t("change","");return}const L=yl(S),j=L.rgba.a===1?L.hex:Vf(L.rgba);r.value=j,Object.assign(o,L),t("update:modelValue",r.value),t("change",j)},M=()=>{s.value=!1};return()=>i.withDirectives(i.createVNode("div",{ref:c,tabindex:"0",class:f.value,onKeydown:m,onClick:b},[typeof n.trigger=="function"?n.trigger({value:r.value,isShowDropdown:s.value}):i.createVNode(i.Fragment,null,[i.createVNode("div",{class:`${d("color-picker-color")}`},[i.createVNode("span",{class:`${d("color-picker-color-square")} ${!r.value&&`${d("color-picker-empty")}`}`,style:`background: ${r.value||"#FFF"}`},null)]),e.showValue?i.createVNode("div",{class:`${d("color-picker-text")}`},[i.createVNode("span",null,[r.value])]):void 0,i.createVNode("div",{class:`${d("color-picker-icon")}`},[i.createVNode(oa,{class:"icon-angle-down"},null)])]),i.createVNode(i.Transition,{name:"bk-fade-down-transition"},{default:()=>[i.withDirectives(i.createVNode(Jc,{ref:l,triggerRef:c.value},{default:()=>[i.createVNode("div",{class:`${d("color-dropdown-container")}`},[i.createVNode("div",{class:`${d("color-picker-dropdown")}`,onClick:S=>{S.stopPropagation()},onMousedown:S=>{S.stopPropagation()},onKeydown:v},[i.createVNode(oj,{ref:u,colorObj:o,onChange:w},null),i.createVNode(aj,{colorObj:o,onChange:w},null),i.createVNode(tj,{colorObj:o,onTab:N,onChange:w},null),h.value?i.createVNode("div",{class:`${d("color-picker-recommend-container")}`},[i.createVNode(sj,{colorObj:o,recommend:e.recommend,recommendEmpty:e.recommendEmpty,onTab:C,onChange:w},null)]):void 0])])]}),[[i.vShow,s.value]])]})]),[[i.resolveDirective("clickoutside"),M]])}}),_3=Me(cj),H3=Me(WS);var ko=null;function uj(e){return ko||(ko=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return setTimeout(t,16)}).bind(window)),ko(e)}var xo=null;function dj(e){xo||(xo=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)}).bind(window)),xo(e)}function fj(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}function cs(e,t){t===void 0&&(t={});var n=document.createElement(e);return Object.keys(t).forEach(function(a){n[a]=t[a]}),n}function W3(e,t,n){var a=window.getComputedStyle(e,n||null)||{display:"none"};return a[t]}function Cl(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if(W3(t,"display")==="none")return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var hj='.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}',Nl=0,ws=null;function gj(e,t){e.__resize_mutation_handler__||(e.__resize_mutation_handler__=pj.bind(e));var n=e.__resize_listeners__;if(!n){if(e.__resize_listeners__=[],window.ResizeObserver){var a=e.offsetWidth,s=e.offsetHeight,r=new ResizeObserver(function(){!e.__resize_observer_triggered__&&(e.__resize_observer_triggered__=!0,e.offsetWidth===a&&e.offsetHeight===s)||tr(e)}),o=Cl(e),l=o.detached,u=o.rendered;e.__resize_observer_triggered__=l===!1&&u===!1,e.__resize_observer__=r,r.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){tr(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(Nl||(ws=fj(hj)),yj(e),e.__resize_rendered__=Cl(e).rendered,window.MutationObserver){var c=new MutationObserver(e.__resize_mutation_handler__);c.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=c}}e.__resize_listeners__.push(t),Nl++}function mj(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener){e.detachEvent("onresize",e.__resize_legacy_resize_handler__),document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);return}e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",Yc),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--Nl&&ws&&ws.parentNode.removeChild(ws)}}function vj(e){var t=e.__resize_last__,n=t.width,a=t.height,s=e.offsetWidth,r=e.offsetHeight;return s!==n||r!==a?{width:s,height:r}:null}function pj(){var e=Cl(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(Uc(this),this.addEventListener("scroll",Yc,!0)),this.__resize_rendered__=t,tr(this))}function Yc(){var e=this;Uc(this),this.__resize_raf__&&dj(this.__resize_raf__),this.__resize_raf__=uj(function(){var t=vj(e);t&&(e.__resize_last__=t,tr(e))})}function tr(e){!e||!e.__resize_listeners__||e.__resize_listeners__.forEach(function(t){t.call(e,e)})}function yj(e){var t=W3(e,"position");(!t||t==="static")&&(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=cs("div",{className:"resize-triggers"}),a=cs("div",{className:"resize-expand-trigger"}),s=cs("div"),r=cs("div",{className:"resize-contract-trigger"});a.appendChild(s),n.appendChild(a),n.appendChild(r),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:a,expandChild:s,contract:r},Uc(e),e.addEventListener("scroll",Yc,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}function Uc(e){var t=e.__resize_triggers__,n=t.expand,a=t.expandChild,s=t.contract,r=s.scrollWidth,o=s.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,c=n.scrollWidth,d=n.scrollHeight;s.scrollLeft=r,s.scrollTop=o,a.style.width=l+1+"px",a.style.height=u+1+"px",n.scrollLeft=c,n.scrollTop=d}var lt=(e=>(e.ALL="all",e.NEEDKEY="need-key",e))(lt||{});const F3=Symbol("SEARCH_SLECT_PROVIDER_KEY"),bj=e=>{i.provide(F3,e)},B3=()=>i.inject(F3);var ya=(e=>(e.DEFAULT="default",e.EDIT="edit",e))(ya||{}),Ra=(e=>(e.AND="&",e.OR="|",e))(Ra||{});class Fn{constructor(t,n="default"){ve(this,"id");ve(this,"name");ve(this,"values",[]);ve(this,"condition");ve(this,"logical");this.searchItem=t,this.type=n,this.id=t.id,this.name=t.name,this.logical=t.logical||"|"}get multiple(){return!!this.searchItem.multiple}get placeholder(){return this.searchItem.placeholder||""}get children(){return this.searchItem.children||[]}get validate(){return!this.searchItem.noValidate}get inputInnerHtml(){var t;return this.isSpecialType()?this.name:`${this.keyInnerHtml}${((t=this.values)==null?void 0:t.map(n=>n.name).join(` ${this.logical} `))||""}`}get inputInnerText(){var t;return this.isSpecialType()?this.name:`${this.keyInnerText}${((t=this.values)==null?void 0:t.map(n=>n.name).join(` ${this.logical} `))||""}`}get keyInnerHtml(){return this.isSpecialType()?this.name:this.name?`${this.name}: `:""}get keyInnerText(){return this.isSpecialType()?this.name:this.name?`${this.name}: `:""}get showLogical(){return!!this.searchItem.showLogicalPanel}isSpecialType(){return["text","condition"].includes(this.type)}addValue(t){if(this.multiple){const n=this.values.findIndex(a=>a.id===t.id);if(n>-1){this.values.splice(n,1);return}this.values.push(t);return}this.values=[t]}toValue(){var n;const t={id:this.id,name:this.name};return(n=this.values)!=null&&n.length&&(t.values=this.values.map(a=>({id:a.id,name:a.name})),this.multiple&&this.logical!=="|"&&(t.logical=this.logical)),this.type&&this.type!=="default"&&(t.type=this.type),t}toValueKey(){return JSON.stringify(this.toValue())}isInValueList(t){return this.children.some(n=>n.id===(t==null?void 0:t.id))}}const Cj=i.defineComponent({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:()=>[]},conditions:{type:Array},footerBtns:{type:Array,default:()=>[]},showLogical:{type:Boolean,default:!0},logical:{type:String,default:Ra.OR}},emits:["selectItem","selectCondition","footerClick","update:logical"],setup(e,{emit:t}){const n=ke("searchSelect"),{resolveClassName:a}=oe(),s=i.computed(()=>e.footerBtns===void 0||e.footerBtns.length===0?[{id:"confirm",name:n.value.ok},{id:"cancel",name:n.value.cancel,disabled:!1}]:e.footerBtns);function r(m){t("selectItem",m)}function o(m){t("selectCondition",m)}function l(m){t("footerClick",m)}const u=i.computed(()=>{var m,v;return(m=e.list)!=null&&m.length?(v=e.keyword)!=null&&v.length?e.list.filter(b=>b.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())):e.list:[]});function c(m){if(!m)return m;let{keyword:v}=e;const b=v.length;if(!(v!=null&&v.trim().length)||!m.toLocaleLowerCase().includes(v.toLocaleLowerCase()))return m;const N=[];let C=-1;return v=v.replace(/([.*/]{1})/gim,"\\$1"),m.replace(new RegExp(`${v}`,"igm"),(I,p)=>(N.length===0&&p!==0?N.push(m.slice(0,p)):C>=0&&N.push(m.slice(C+I.length,p)),N.push(i.createVNode("span",{class:"is-keyword"},[I])),C=p,I)),C>=0&&N.push(m.slice(C+b)),N.length?N:m}function d(m){var v;return(v=m.value)!=null&&v.name?[i.createVNode("span",{class:"menu-name"},[m.name,i.createTextVNode(":")]),m.value.name]:c(m.name)}function f(m,v){m.stopPropagation(),m.preventDefault(),r(v)}function h(m){t("update:logical",m)}return{handleClick:r,handleClickCondition:o,handleClickFooterBtn:l,handleSelectedChange:f,handleLogicalChange:h,filterList:u,getSearchNode:d,localFooterBtns:s,resolveClassName:a,t:n}},render(){var n,a;const e=i.createVNode("ul",{class:"menu-content"},[(n=this.list)==null?void 0:n.map(s=>i.createVNode("li",{class:`menu-item ${s.disabled?"is-disabled":""} ${this.hoverId===s.id&&!s.disabled?"is-hover":""}`,key:s.id,id:s.id,tabindex:"-1",onClick:()=>!s.disabled&&this.handleClick(s)},[this.$slots.default?this.$slots.default({item:s,list:this.list,multiple:!!this.multiple,hoverId:this.hoverId,getSearchNode:this.getSearchNode}):i.createVNode(i.Fragment,null,[this.multiple&&i.createVNode("span",{onClick:r=>this.handleSelectedChange(r,s)},[i.createVNode(ht,{modelValue:this.selected.includes(s.id),class:"is-selected"},null)]),this.getSearchNode(s)])]))]),t=()=>!this.showLogical||!this.multiple?e:i.createVNode("div",{class:"menu-content-wrapper"},[e,i.createVNode("div",{class:"menu-condition"},[i.createVNode("div",{class:"menu-condition-title"},[this.t.logical]),i.createVNode(As,{modelValue:this.logical,onChange:this.handleLogicalChange,label:"|"},{default:()=>[this.t.or,i.createTextVNode(" |")]}),i.createVNode(As,{modelValue:this.logical,onChange:this.handleLogicalChange,label:"&"},{default:()=>[this.t.and,i.createTextVNode(" &")]})])]);return i.createVNode("div",{class:this.resolveClassName("search-select-menu")},[!!((a=this.conditions)!=null&&a.length)&&i.createVNode("ul",{class:"menu-header"},[this.conditions.map(s=>i.createVNode("li",{key:s.id,class:`menu-header-item ${s.disabled?"is-disabled":""}`,onClick:()=>!s.disabled&&this.handleClickCondition(s)},[s.name]))]),t()])}}),G3=i.defineComponent({name:"SearchSelectInput",directives:{clickoutside:Kt},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:()=>[]},defautUsingItem:Object,mode:{type:String,default:ya.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup(e,{emit:t,expose:n}){const a=ke("searchSelect"),{resolveClassName:s}=oe(),r=i.ref(null),o=i.ref(null),l=i.ref(""),u=i.ref(!1),c=i.ref(!1),d=i.ref(!1),f=i.ref(e.defautUsingItem),h=i.ref(""),m=i.ref(!1),v=$a(300,ie);let b=!1;const N=i.ref([]),C=i.ref([]),{editKey:I,onValidate:p}=B3(),y=i.computed(()=>{var O;return((O=f.value)==null?void 0:O.logical)||Ra.OR});i.watch(I,()=>{e.mode===ya.DEFAULT&&I.value&&(d.value=!1)}),i.watchEffect(()=>{l.value||k()},{flush:"pre"}),i.watch([C,d],()=>{var O;(O=C.value)!=null&&O.some(R=>!R.disabled)&&d.value?b||(e.valueBehavior===lt.NEEDKEY?h.value=C.value.find(R=>!R.disabled).id:h.value="",b=!0,document.addEventListener("keydown",w)):(document.removeEventListener("keydown",w),b=!1,e.valueBehavior!==lt.NEEDKEY&&(h.value=""))});function w(O){switch(O.code){case"ArrowDown":case"ArrowUp":M(O);break;case"Enter":case"NumpadEnter":S(O);break}}function M(O){var G;O.preventDefault(),(G=r.value)==null||G.blur();const R=C.value.length;let B=R,K=C.value.findIndex(te=>te.id===h.value);for(;B>=0;){K=O.code==="ArrowDown"?K+1:K-1,K=K>R-1?0:K<0?R-1:K;const te=C.value[K];if(te&&!te.disabled){B=-1;const F=document.getElementById(te.id);F==null||F.focus(),h.value=te.id;return}B-=1}}function S(O){if(b){O.preventDefault();const R=C.value.find(B=>B.id===h.value);R&&E(R)}}function L(O){var R,B,K,G,te;if(!((R=o.value)!=null&&R.contains(O.target))&&((B=e.clickOutside)!=null&&B.call(e,O.target,o.value))){if((G=(K=f.value)==null?void 0:K.values)!=null&&G.length&&((te=f.value)!=null&&te.multiple)){l.value="",J();return}d.value=!1,c.value=!1,t("focus",c.value)}}function j(O){Z(),O&&ie()}function T(O){var B,K,G,te,F,D,x,$,q;Y();let R=O.target.innerText;if(/(\r|\n)/gm.test(R)||/\s{2}/gm.test(R))O.preventDefault(),R=R.replace(/(\r|\n)/gm,` ${y.value} `).replace(/\s{2}/gm,""),r.value.innerText=R,Z(),l.value=R.replace(((B=f.value)==null?void 0:B.keyInnerText)||"","").trim(),v();else if(!l.value&&R.length<(((G=(K=f.value)==null?void 0:K.inputInnerText)==null?void 0:G.length)||1)){const W=R.replace(" "," ").replace(((te=f.value)==null?void 0:te.keyInnerText.replace(" "," ").trim())||"","").trim();if(R&&((F=f.value)==null?void 0:F.keyInnerText)&&R.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&W&&((D=f.value.values)!=null&&D.length)){l.value=W,console.info("outerText",W),v();return}(W||!(R!=null&&R.length))&&(f.value=null),l.value=W?R:"",v()}else($=(x=f.value)==null?void 0:x.values)!=null&&$.length||(l.value=R.replace(" "," ").replace(((q=f.value)==null?void 0:q.keyInnerText.replace(" "," "))||"","").trim(),Z(),v())}function z(O){switch(O.code){case"Enter":case"NumpadEnter":if(e.valueBehavior===lt.NEEDKEY&&C.value.some(R=>R.id===h.value))return;J(O);break;case"Backspace":V();default:u.value=!1;break}}async function J(O){var K;if(O==null||O.preventDefault(),await new Promise(G=>setTimeout(G,0)),!f.value){if(!l.value||e.valueBehavior===lt.NEEDKEY)return;const G={id:l.value,name:l.value};if(!await Q(G))return;t("add",new Fn(G,"text")),l.value="",ie();return}const{values:R}=f.value;if(!(R!=null&&R.length)){if((K=l.value)!=null&&K.length){if(l.value.includes(y.value)){const G=l.value.split(y.value);if(!await Q({id:l.value,name:l.value}))return;G.forEach(F=>f.value.addValue({id:F,name:F}))}else{const G={id:l.value,name:l.value};if(!await Q(G))return;f.value.addValue(G)}t("add",f.value),l.value="",f.value=null,Z(!0);return}u.value=!0;return}if(l.value){const G={id:l.value,name:l.value};if(!await Q(G))return;f.value.addValue(G),t("add",f.value),l.value="",f.value=null,Z(!0);return}await Q()&&H()}function V(){var O,R;if(!f.value&&!l.value){t("delete"),i.nextTick(ie);return}if((O=f.value)!=null&&O.values.length){if((R=f.value)!=null&&R.multiple||f.value.isInValueList(f.value.values[0])||e.mode===ya.EDIT&&!l.value){f.value.values.splice(-1,1),l.value="",Z();return}}else l.value||(f.value=null,l.value="",ie());p("")}async function E(O,R){var K,G,te,F;if((K=O.value)!=null&&K.id){if(e.valueBehavior===lt.NEEDKEY&&O.value||!e.validateValues){const x=new Fn({...O,id:O.realId??O.id},R);x.addValue(O.value),H(x),e.valueBehavior===lt.NEEDKEY&&h.value&&Z(!0),h.value="";return}if(f.value=new Fn({...O,id:O.realId??O.id},R),f.value.addValue(O.value),!await Q(O.value)){f.value=null;return}H(f.value),h.value="",Z(!0);return}if(!f.value||!((G=r==null?void 0:r.value)!=null&&G.innerText)){f.value=new Fn(O,R),l.value="";const D=R==="condition";D&&H(),d.value=D||!!f.value.children.length,Z(e.valueBehavior===lt.NEEDKEY&&!!h.value);return}if(((te=f.value)==null?void 0:te.type)==="condition"){f.value=new Fn(O,R),H();return}f.value.addValue(O),await Q(O)&&(f.value.multiple||H(),e.valueBehavior===lt.NEEDKEY&&((F=f.value)!=null&&F.multiple)&&Z())}function P(O){E(O,"condition")}function _(O){var R;switch(O.id){case"confirm":if(!((R=f.value)!=null&&R.values.length))return;l.value="",J();break;case"cancel":f.value.values=[],d.value=!1;break}}async function Q(O){if(!f.value)return await U(null,[O]);const{searchItem:R,validate:B,values:K}=f.value;return B&&typeof e.validateValues=="function"?await U(R,O?[O]:K):(p(""),!0)}async function U(O,R){var K;const B=await((K=e.validateValues)==null?void 0:K.call(e,O??null,R).catch(()=>!1));return typeof B=="string"||B===!1?(p(B||"校验错误"),!1):(p(""),!0)}function Z(O=!1){O&&setTimeout(()=>{ie()},16),c.value=!0,d.value=!0,u.value=!1;const R=setTimeout(()=>{if(r.value){r.value.focus();const B=window.getSelection();B.focusOffset===0&&(B.selectAllChildren(r.value),B.collapseToEnd())}window.clearTimeout(R)},0);t("focus",c.value)}async function ie(){var R,B,K,G,te;let O=[];if(typeof e.getMenuList=="function"&&(typeof((B=(R=f.value)==null?void 0:R.searchItem)==null?void 0:B.async)>"u"||f.value.searchItem.async===!0)?(m.value=!0,O=await e.getMenuList((K=f.value)==null?void 0:K.searchItem,l.value).catch(()=>[]),m.value=!1):f!=null&&f.value?f.value.type==="condition"?O=e.conditions:(!((te=f.value.values)!=null&&te.length)||f.value.multiple||e.mode===ya.EDIT)&&(O=f.value.children.filter(F=>F.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase()))):(G=l.value)!=null&&G.length?e.data.filter(F=>!F.isSelected).forEach(F=>{var x,$;if(F.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase())){O.push(F);const q=[];(x=F.children)==null||x.forEach(W=>{q.push({...F,realId:F.id,id:Ln(10),value:W})}),!q.length&&!F.onlyRecommendChildren&&q.push({...F,realId:F.id,id:Ln(10),value:{id:l.value,name:l.value}}),O.push(...q)}else{const q=[];($=F.children)==null||$.forEach(W=>{W.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase())&&q.push({...F,realId:F.id,id:Ln(10),value:W})}),!q.length&&!F.onlyRecommendChildren&&q.push({...F,value:{id:l.value,name:l.value}}),O.push(...q)}}):O=e.data.filter(F=>!F.isSelected).slice(),C.value=O,e.valueBehavior===lt.NEEDKEY){const F=O.find(D=>!D.disabled);F&&(!h.value||h.value&&!O.some(D=>D.id===h.value))&&(h.value=F.id)}}function H(O){t("add",O??f.value),f.value=null,l.value="",Z(e.valueBehavior===lt.NEEDKEY)}function Y(){const O=r.value.innerText;O[O.length-1]===`
|
362
362
|
`||O[0]==="\r"?(k(O.slice(0,-1)),Y()):(O[0]===`
|
363
363
|
`||O[0]==="\r")&&(k(O.slice(1)),Y())}function k(O=""){var R;r.value&&(r.value.innerHTML=O||((R=f.value)==null?void 0:R.inputInnerHtml)||"")}function A(O){f.value&&(f.value.logical=O)}return n({handleInputFocus:j,isFocus:c}),{popoverRef:o,inputRef:r,keyword:l,loading:m,remoteMenuList:N,menuList:C,menuHoverId:h,isFocus:c,usingItem:f,showPopover:d,showNoSelectValueError:u,debounceSetMenuList:v,documentArrowEvent:M,handleClickOutside:L,handleInputFocus:j,handleInputChange:T,handleLogicalChange:A,handleInputKeyup:z,handleSelectItem:E,handleSelectCondtionItem:P,handleMenuFooterClick:_,resolveClassName:s,t:a}},render(){var d,f;const{multiple:e,values:t,placeholder:n,inputInnerHtml:a}=this.usingItem||{},s=!((d=this.keyword)!=null&&d.length)&&!(t!=null&&t.length)&&n,r=this.loading||this.showNoSelectValueError||this.showPopover&&!!((f=this.menuList)!=null&&f.length),o=!this.usingItem&&this.showCondition,l=Object.assign({},this.$slots.menu?{default:h=>{var m,v;return(v=(m=this.$slots).menu)==null?void 0:v.call(m,h)}}:{}),u=()=>{var h;return i.withDirectives(i.createVNode("div",{ref:"inputRef",class:{"div-input":!0,"input-before":this.showInputBefore&&!((h=this.keyword)!=null&&h.length),"input-after":s},contenteditable:!0,"data-placeholder":!a&&!this.keyword?this.placeholder:"","data-tips":n||"",spellcheck:"false",onFocus:this.handleInputFocus,onInput:this.handleInputChange,onKeydown:this.handleInputKeyup},null),[[i.resolveDirective("clickoutside"),this.handleClickOutside]])},c=()=>{var h,m,v;return this.loading?i.createVNode("div",null,[this.t.loading]):this.showNoSelectValueError?i.createVNode("div",null,[this.t.filterQueryMustHasValue]):(h=this.menuList)!=null&&h.length?i.createVNode("div",{ref:"popoverRef",class:this.resolveClassName("search-select-popover")},[i.createVNode(Cj,{list:this.menuList,keyword:this.keyword,multiple:!!e,hoverId:this.menuHoverId,selected:(t==null?void 0:t.map(b=>b.id))||[],conditions:o?this.conditions:[],logical:(m=this.usingItem)==null?void 0:m.logical,showLogical:(v=this.usingItem)==null?void 0:v.showLogical,"onUpdate:logical":this.handleLogicalChange,onSelectItem:this.handleSelectItem,onSelectCondition:this.handleSelectCondtionItem,onFooterClick:this.handleMenuFooterClick},{...l})]):void 0};return i.createVNode(Xe,{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:r},{default:u,content:c})}}),Nj=i.defineComponent({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:()=>[]},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup(e,{emit:t}){const n=i.ref(null),{onEditClick:a,onEditEnter:s,onEditBlur:r,editKey:o}=B3();function l(m){t("delete",m)}function u(m,v,b){m.preventDefault(),m.stopPropagation(),a(v,b),setTimeout(()=>n.value.handleInputFocus(),200)}function c(m,v){s(m,v)}function d(m){m||r()}function f(){return!0}function h(m){const v=new Fn(m.searchItem,m.type);return v.values=m.values.slice(),v.logical=m.logical||Ra.OR,v}return{inputRef:n,editKey:o,copySeletedItem:h,handleDeleteSelected:l,handleEditSeleted:u,handleInputOutside:f,handleAddSelected:c,handleInputFocus:d}},render(){const e=(t,n)=>this.editKey===`${t.id}_${n}`?i.createVNode("div",{class:"selected-input",key:this.editKey.toString()},[i.createVNode(G3,{ref:"inputRef",key:this.editKey.toString(),mode:ya.EDIT,data:this.data,showCondition:!1,conditions:this.conditions,defautUsingItem:this.copySeletedItem(t),clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:a=>this.handleAddSelected(a,n),onFocus:this.handleInputFocus},null)]):i.createVNode("li",{class:`search-container-selected ${(this.overflowIndex>=0?n<this.overflowIndex:n>=0)?"":"hidden-selected"}`,key:`${t.id}_${n}`},[i.createVNode("span",{class:"selected-name",onClick:a=>this.handleEditSeleted(a,t,n)},[t.inputInnerText]),i.createVNode(ft,{class:"selected-clear",onClick:()=>this.handleDeleteSelected(n)},null)]);return i.createVNode(i.Fragment,null,[this.selectedList.map((t,n)=>[this.overflowIndex>=0&&n===this.overflowIndex&&i.createVNode("div",{class:"search-container-selected overflow-selected"},[i.createTextVNode("+"),this.selectedList.length-this.overflowIndex]),e(t,n)])])}}),Do=40,Jf=6,wj={data:{type:Array,default:()=>[]},modelValue:{type:Array,default:()=>[]},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:()=>[]},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:lt.ALL,validator(e){return[lt.ALL,lt.NEEDKEY].includes(e)}}},Mj=i.defineComponent({name:"SearchSelect",directives:{clickoutside:Kt},props:wj,emits:["update:modelValue","search"],setup(e,{emit:t}){const n=ke("searchSelect"),{resolveClassName:a}=oe(),s=i.computed(()=>e.conditions===void 0?[{id:"or",name:n.value.or},{id:"and",name:n.value.and}]:e.conditions),r=i.ref(null),o=i.ref(null),l=i.ref(!1),u=i.ref([]),c=i.ref(-1),d=$a(32,I),f=i.ref(""),h=i.ref(""),m=i.shallowRef([]);i.watch(()=>e.data,()=>{var T;m.value=JSON.parse(JSON.stringify(e.data)),(T=m.value)==null||T.forEach(z=>{z.isSelected=e.uniqueSelect&&!!e.modelValue.some(J=>J.id===z.id)})},{immediate:!0}),i.watch(()=>e.modelValue,T=>{var J;if(!(T!=null&&T.length)){u.value=[],(J=m.value)==null||J.forEach(V=>{V.isSelected=!1});return}const z=[];T.forEach(V=>{var P;const E=u.value.find(_=>_.id===V.id&&_.name===V.name);if((E==null?void 0:E.toValueKey())===JSON.stringify(V))E.values=V.values||[],E.logical=V.logical||Ra.OR,z.push(E);else{let _=e.data.find(Z=>Z.id===V.id),Q="default";_||(_=e.conditions.find(Z=>Z.id===V.id),_&&(Q="condition")),!_&&!((P=V.values)!=null&&P.length)&&(Q="text");const U=new Fn(_||V,Q);U.values=V.values||[],U.logical=V.logical||Ra.OR,z.push(U)}}),u.value=z,m.value=JSON.parse(JSON.stringify(e.data||[])),m.value.forEach(V=>{V.isSelected=e.uniqueSelect&&!!z.some(E=>E.id===V.id)})},{immediate:!0,deep:!0}),i.onMounted(()=>{gj(o.value.querySelector(`.${a("search-select-container")}`),d)}),i.onBeforeUnmount(()=>{mj(o.value.querySelector(`.${a("search-select-container")}`),d)}),bj({onEditClick:v,onEditEnter:b,onEditBlur:N,onValidate:C,editKey:f});function v(T,z){f.value=`${T.id}_${z}`}function b(T,z){const J=u.value.slice();J.splice(z,1,T),t("update:modelValue",J.map(V=>V.toValue())),f.value=""}function N(){f.value="",C("")}function C(T){h.value=T||""}function I(){if(l.value||u.value.length<1){c.value=-1;return}const T=o.value.querySelector(`.${a("search-select-container")}`),z=o.value.querySelector(".search-container").clientWidth-Jf-2,J=T.querySelectorAll(".search-container-selected:not(.overflow-selected)");let V=0,E=0,P=0;for(;E===0&&V<=z-Do&&P<=J.length-1;){const _=J[P];if(_.clientHeight>e.minHeight){c.value=P;return}V+=_?_.clientWidth+Jf:0,V>=z-Do&&(E=P),P+=1}if(E===J.length-1&&V<=z){c.value=-1;return}c.value=V>=z-Do?E:E-1}function p(){f.value||r.value.handleInputFocus()}function y(){u.value=[],c.value=-1,t("update:modelValue",[])}function w(T){var z;return!((z=o.value)!=null&&z.contains(T))}function M(T){const z=u.value.slice();z.push(T),C(""),t("update:modelValue",z.map(J=>J.toValue()))}function S(T){const z=u.value.slice();z.splice(typeof T=="number"?T:u.value.length-1,1),C(""),t("update:modelValue",z.map(J=>J.toValue()))}function L(T){var z;T&&(c.value=-1),T===!1&&((z=o.value.querySelector(`.${a("search-select-container")}`))==null||z.scrollTo(0,0)),l.value=T}function j(T){t("search",T)}return{inputRef:r,wrapRef:o,isFocus:l,copyData:m,selectedList:u,overflowIndex:c,validateStr:h,onEditClick:v,onEditEnter:b,handleWrapClick:p,handleInputFocus:L,handleResize:I,handleClearAll:y,handleInputOutside:w,handleAddSelected:M,handleDeleteSelected:S,handleClickSearch:j,localConditions:s,resolveClassName:a,t:n}},render(){var a,s;const e=`${!this.shrink||this.isFocus?this.maxHeight:this.minHeight}px`,t=!!this.selectedList.length&&this.selectedList.slice(-1)[0].type!=="condition",n=Object.assign({},this.$slots.menu?{menu:r=>{var o,l;return(l=(o=this.$slots).menu)==null?void 0:l.call(o,r)}}:{});return i.createVNode("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[i.createVNode("div",{class:{[this.resolveClassName("search-select-container")]:!0,"is-focus":this.isFocus},onClick:this.handleWrapClick},[i.createVNode("div",{class:"search-prefix"},[(s=(a=this.$slots).prepend)==null?void 0:s.call(a)]),i.createVNode("div",{class:"search-container",style:{maxHeight:e}},[i.createVNode(Nj,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},{...n}),i.createVNode("div",{class:"search-container-input"},[i.createVNode(G3,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:t,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},{...n})])]),i.createVNode("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&i.createVNode(gt,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():i.createVNode(ca,{onClick:this.handleClickSearch,class:`search-nextfix-icon ${this.isFocus?"is-focus":""}`},null)])]),!!this.validateStr.length&&i.createVNode("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():i.createVNode(i.Fragment,null,[i.createVNode(_i,{class:"select-tips"},null),this.validateStr||""])])])}}),Z3=Me(Mj);function Ij(){return ge("trigger",{}).def("hover")}const Lj={trigger:Ij(),title:g.string.def(""),content:g.string.def(""),confirmText:g.string.def(""),cancelText:g.string.def(""),placement:g.oneOfType([El().def(ja.TOP),g.string]).def(ja.TOP),theme:g.string.def("light "),icon:g.string.def(""),width:g.oneOfType([g.string,g.number]).def("auto")},Tj=i.defineComponent({name:"PopConfirm",components:{BkPopover:Xe,BkButton:Je},props:Lj,emits:["confirm","cancel"],setup(e,{emit:t,slots:n}){const a=i.ref(!1),s=ke("popConfirm");function r(f){a.value=!1,t("confirm"),f.stopPropagation()}function o(f){a.value=!1,t("cancel"),f.stopPropagation()}function l(){return typeof n.icon=="function"?n.icon():e.icon}const u=l(),{resolveClassName:c}=oe();return{popoverRef:i.ref(null),visible:a,t:s,icon:u,resolveClassName:c,ensure:r,cancel:o}},render(){return i.createVNode(Xe,{ref:"popoverRef",isShow:this.visible,trigger:this.trigger,theme:this.theme,width:this.width,onAfterShow:()=>this.visible=!0,extCls:`${this.resolveClassName("pop-confirm-box")}`},{default:()=>this.$slots.default(),content:()=>i.createVNode("div",{class:`${this.resolveClassName("pop-confirm")}`},[typeof this.$slots.content=="function"?this.$slots.content():i.createVNode(i.Fragment,null,[this.title?i.createVNode("div",{class:`${this.resolveClassName("pop-confirm-title")}`},[this.icon?i.createVNode("span",{class:`${this.resolveClassName("pop-confirm-icon")}`},[this.icon]):"",i.createVNode("span",null,[this.title])]):"",i.createVNode("div",{class:`${this.resolveClassName("pop-confirm-content")}`},[this.title?"":this.icon,this.content])]),i.createVNode("div",{class:`${this.resolveClassName("pop-confirm-footer")}`},[i.createVNode(Je,{onClick:this.ensure,size:"small",theme:"primary"},{default:()=>[this.confirmText||this.t.ok]}),i.createVNode(Je,{onClick:this.cancel,size:"small"},{default:()=>[this.cancelText||this.t.cancel]})])])})}}),Y3=Me(Tj),jo=Object.freeze(Object.defineProperty({__proto__:null,$bkPopover:Ic,Affix:Gh,Alert:Fh,AnimateNumber:Bh,Backtop:Zh,Badge:Yh,Breadcrumb:Kh,Button:Je,Card:x0,Cascader:w3,Checkbox:ht,CodeDiff:J3,Collapse:O0,ColorPicker:_3,ConfigProvider:Hh,Container:Us,DatePicker:o3,Dialog:P0,Divider:L9,Dropdown:y3,Exception:Yr,FixedNavbar:A0,Form:p3,InfoBox:J9,Input:na,Link:V0,Loading:Sn,Menu:H9,Message:V9,Modal:aa,Navigation:W9,Notify:Q9,OverflowTitle:b0,Pagination:zc,PopConfirm:Y3,Popover:Xe,Popover2:J0,Process:T3,Progress:xi,Radio:As,Rate:_0,ResizeLayout:I3,SearchSelect:Z3,Select:kc,Sideslider:e9,Slider:M3,Steps:n9,Swiper:H0,Switcher:a9,Tab:x9,Table:w9,Tag:Va,TagInput:I9,TimeLine:L3,TimePicker:H3,Transfer:l3,Tree:v3,Upload:x3,VirtualRender:Ua,containerProps:Us},Symbol.toStringTag,{value:"Module"})),Rf=(e="Bk")=>(t,n)=>{const a=t.config.globalProperties.bkUIPrefix||e;Object.keys(jo).forEach(s=>{const r=jo[s];"install"in r?t.use(r,{prefix:a}):t.component(a+s,jo[s])}),n&&Rl(n)},Sj={createInstall:Rf,install:Rf(),version:"0.0.1"};exports.$bkPopover=Ic;exports.Affix=Gh;exports.Alert=Fh;exports.AnimateNumber=Bh;exports.Backtop=Zh;exports.Badge=Yh;exports.Breadcrumb=Kh;exports.Button=Je;exports.Card=x0;exports.Cascader=w3;exports.Checkbox=ht;exports.CodeDiff=J3;exports.Collapse=O0;exports.ColorPicker=_3;exports.ConfigProvider=Hh;exports.Container=Us;exports.DatePicker=o3;exports.Dialog=P0;exports.Divider=L9;exports.Dropdown=y3;exports.Exception=Yr;exports.FixedNavbar=A0;exports.Form=p3;exports.InfoBox=J9;exports.Input=na;exports.Link=V0;exports.Loading=Sn;exports.Menu=H9;exports.Message=V9;exports.Modal=aa;exports.Navigation=W9;exports.Notify=Q9;exports.OverflowTitle=b0;exports.Pagination=zc;exports.PopConfirm=Y3;exports.Popover=Xe;exports.Popover2=J0;exports.Process=T3;exports.Progress=xi;exports.Radio=As;exports.Rate=_0;exports.ResizeLayout=I3;exports.SearchSelect=Z3;exports.Select=kc;exports.Sideslider=e9;exports.Slider=M3;exports.Steps=n9;exports.Swiper=H0;exports.Switcher=a9;exports.Tab=x9;exports.Table=w9;exports.Tag=Va;exports.TagInput=I9;exports.TimeLine=L3;exports.TimePicker=H3;exports.Transfer=l3;exports.Tree=v3;exports.Upload=x3;exports.VirtualRender=Ua;exports.bkEllipsis=P8;exports.bkEllipsisInstance=Lc;exports.bkTooltips=On;exports.clickoutside=Kt;exports.containerProps=Us;exports.default=Sj;exports.defaultRootConfig=ea;exports.mousewheel=D8;exports.overflowTitle=p8;exports.provideGlobalConfig=Rl;exports.rootProviderKey=zi;exports.setPrefixVariable=Jo;exports.useGlobalConfig=b5;exports.useLocale=ke;exports.usePrefix=oe;
|
package/dist/index.esm.js
CHANGED
@@ -29945,9 +29945,9 @@ const qj = /* @__PURE__ */ oe({
|
|
29945
29945
|
return typeof Z == "string" || Z === !1 ? (p(Z || "校验错误"), !1) : (p(""), !0);
|
29946
29946
|
}
|
29947
29947
|
function U(E = !1) {
|
29948
|
-
E &&
|
29948
|
+
E && setTimeout(() => {
|
29949
29949
|
le();
|
29950
|
-
}), o.value = !0, d.value = !0, c.value = !1;
|
29950
|
+
}, 16), o.value = !0, d.value = !0, c.value = !1;
|
29951
29951
|
const $ = setTimeout(() => {
|
29952
29952
|
if (s.value) {
|
29953
29953
|
s.value.focus();
|
package/dist/index.umd.js
CHANGED
@@ -358,6 +358,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
358
358
|
`+n),a.b(" </div>"),a.b(`
|
359
359
|
`+n),a.b(" </div>"),a.b(`
|
360
360
|
`+n),a.b(" </div>"),a.b(`
|
361
|
-
`+n),a.b("</div>"),a.fl()},partials:{},subs:{}}),$e["tag-file-added"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),a.fl()},partials:{},subs:{}}),$e["tag-file-changed"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),a.fl()},partials:{},subs:{}}),$e["tag-file-deleted"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),a.fl()},partials:{},subs:{}}),$e["tag-file-renamed"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),a.fl()},partials:{},subs:{}});var ra=globalThis&&globalThis.__assign||function(){return ra=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ra.apply(this,arguments)},Mx=function(){function e(t){var n=t.compiledTemplates,a=n===void 0?{}:n,s=t.rawTemplates,r=s===void 0?{}:s,o=Object.entries(r).reduce(function(l,d){var c,u=d[0],f=d[1],h=ze.compile(f,{asString:!1});return ra(ra({},l),(c={},c[u]=h,c))},{});this.preCompiledTemplates=ra(ra(ra({},$e),a),o)}return e.compile=function(t){return ze.compile(t,{asString:!1})},e.prototype.render=function(t,n,a,s,r){var o=this.templateKey(t,n);try{var l=this.preCompiledTemplates[o];return l.render(a,s,r)}catch{throw new Error("Could not find template to render '".concat(o,"'"))}},e.prototype.template=function(t,n){return this.preCompiledTemplates[this.templateKey(t,n)]},e.prototype.templateKey=function(t,n){return"".concat(t,"-").concat(n)},e}(),oa=globalThis&&globalThis.__assign||function(){return oa=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},oa.apply(this,arguments)},Ix=oa(oa(oa({},b3),v3),{outputFormat:Fk.LINE_BY_LINE,drawFileList:!0});function Lx(e,t){t===void 0&&(t={});var n=oa(oa({},Ix),t),a=typeof e=="string"?ex(e,n):e,s=new Mx(n),r=n.drawFileList?mx(a,s):"",o=n.outputFormat==="side-by-side"?new wx(s,n).render(a):new bx(s,n).render(a);return r+o}const Tx=Gd([...["side-by-side","line-by-line"]]),Sx=Gd([...["dark","light"]]),kx={oldContent:st().def(""),newContent:st().def(""),diffFormat:st().def(Tx["line-by-line"]),diffContext:Wd(),theme:st().def("light"),language:st().def("javascript"),hljs:g.any.isRequired};function xx(e,t){return e.replace(/d2h-code-line-ctn/g,n=>`${n} lang-${t}`)}const M3=Me(i.defineComponent({name:"CodeDiff",props:kx,emits:[],setup(e){const{resolveClassName:t}=re(),n=i.ref(null),a=i.ref(""),s=i.computed(()=>ve({dark:e.theme===Sx.dark},`hljs ${t("code-diff")}`));function r(){i.nextTick(()=>{n.value&&n.value.querySelectorAll(`.lang-${e.language}`).forEach(l=>{e.hljs.highlightElement(l)})})}function o(l,d){const c=Wk("",e.oldContent,e.newContent,"","",{context:l});a.value=xx(Lx(c,{drawFileList:!1,matching:"lines",outputFormat:e.diffFormat}),d),r()}return i.onMounted(()=>{o(e.diffContext,e.language)}),i.watch(()=>[e.diffContext,e.language],l=>{const[d,c]=l;o(d,c)}),()=>i.createVNode("div",{ref:n,class:s.value,innerHTML:a.value},null)}}));function no(e){"@babel/helpers - typeof";return no=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},no(e)}var Dx=/^\s+/,jx=/\s+$/;function Ce(e,t){if(e=e||"",t=t||{},e instanceof Ce)return e;if(!(this instanceof Ce))return new Ce(e,t);var n=Ox(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}Ce.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,a,s,r,o,l;return n=t.r/255,a=t.g/255,s=t.b/255,n<=.03928?r=n/12.92:r=Math.pow((n+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),s<=.03928?l=s/12.92:l=Math.pow((s+.055)/1.055,2.4),.2126*r+.7152*o+.0722*l},setAlpha:function(t){return this._a=x3(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=L3(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=L3(this._r,this._g,this._b),n=Math.round(t.h*360),a=Math.round(t.s*100),s=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+a+"%, "+s+"%)":"hsva("+n+", "+a+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var t=I3(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=I3(this._r,this._g,this._b),n=Math.round(t.h*360),a=Math.round(t.s*100),s=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+a+"%, "+s+"%)":"hsla("+n+", "+a+"%, "+s+"%, "+this._roundA+")"},toHex:function(t){return T3(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return zx(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(je(this._r,255)*100)+"%",g:Math.round(je(this._g,255)*100)+"%",b:Math.round(je(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(je(this._r,255)*100)+"%, "+Math.round(je(this._g,255)*100)+"%, "+Math.round(je(this._b,255)*100)+"%)":"rgba("+Math.round(je(this._r,255)*100)+"%, "+Math.round(je(this._g,255)*100)+"%, "+Math.round(je(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Zx[T3(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+S3(this._r,this._g,this._b,this._a),a=n,s=this._gradientType?"GradientType = 1, ":"";if(t){var r=Ce(t);a="#"+S3(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+n+",endColorstr="+a+")"},toString:function(t){var n=!!t;t=t||this._format;var a=!1,s=this._a<1&&this._a>=0,r=!n&&s&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return r?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(a=this.toRgbString()),t==="prgb"&&(a=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(a=this.toHexString()),t==="hex3"&&(a=this.toHexString(!0)),t==="hex4"&&(a=this.toHex8String(!0)),t==="hex8"&&(a=this.toHex8String()),t==="name"&&(a=this.toName()),t==="hsl"&&(a=this.toHslString()),t==="hsv"&&(a=this.toHsvString()),a||this.toHexString())},clone:function(){return Ce(this.toString())},_applyModification:function(t,n){var a=t.apply(null,[this].concat([].slice.call(n)));return this._r=a._r,this._g=a._g,this._b=a._b,this.setAlpha(a._a),this},lighten:function(){return this._applyModification(Qx,arguments)},brighten:function(){return this._applyModification($x,arguments)},darken:function(){return this._applyModification(_x,arguments)},desaturate:function(){return this._applyModification(Vx,arguments)},saturate:function(){return this._applyModification(Jx,arguments)},greyscale:function(){return this._applyModification(Rx,arguments)},spin:function(){return this._applyModification(Hx,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(Bx,arguments)},complement:function(){return this._applyCombination(Wx,arguments)},monochromatic:function(){return this._applyCombination(Gx,arguments)},splitcomplement:function(){return this._applyCombination(Fx,arguments)},triad:function(){return this._applyCombination(k3,[3])},tetrad:function(){return this._applyCombination(k3,[4])}},Ce.fromRatio=function(e,t){if(no(e)=="object"){var n={};for(var a in e)e.hasOwnProperty(a)&&(a==="a"?n[a]=e[a]:n[a]=Fi(e[a]));e=n}return Ce(e,t)};function Ox(e){var t={r:0,g:0,b:0},n=1,a=null,s=null,r=null,o=!1,l=!1;return typeof e=="string"&&(e=Xx(e)),no(e)=="object"&&(pn(e.r)&&pn(e.g)&&pn(e.b)?(t=Ex(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):pn(e.h)&&pn(e.s)&&pn(e.v)?(a=Fi(e.s),s=Fi(e.v),t=Ax(e.h,a,s),o=!0,l="hsv"):pn(e.h)&&pn(e.s)&&pn(e.l)&&(a=Fi(e.s),r=Fi(e.l),t=Px(e.h,a,r),o=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=x3(n),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function Ex(e,t,n){return{r:je(e,255)*255,g:je(t,255)*255,b:je(n,255)*255}}function I3(e,t,n){e=je(e,255),t=je(t,255),n=je(n,255);var a=Math.max(e,t,n),s=Math.min(e,t,n),r,o,l=(a+s)/2;if(a==s)r=o=0;else{var d=a-s;switch(o=l>.5?d/(2-a-s):d/(a+s),a){case e:r=(t-n)/d+(t<n?6:0);break;case t:r=(n-e)/d+2;break;case n:r=(e-t)/d+4;break}r/=6}return{h:r,s:o,l}}function Px(e,t,n){var a,s,r;e=je(e,360),t=je(t,100),n=je(n,100);function o(c,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(u-c)*6*f:f<1/2?u:f<2/3?c+(u-c)*(2/3-f)*6:c}if(t===0)a=s=r=n;else{var l=n<.5?n*(1+t):n+t-n*t,d=2*n-l;a=o(d,l,e+1/3),s=o(d,l,e),r=o(d,l,e-1/3)}return{r:a*255,g:s*255,b:r*255}}function L3(e,t,n){e=je(e,255),t=je(t,255),n=je(n,255);var a=Math.max(e,t,n),s=Math.min(e,t,n),r,o,l=a,d=a-s;if(o=a===0?0:d/a,a==s)r=0;else{switch(a){case e:r=(t-n)/d+(t<n?6:0);break;case t:r=(n-e)/d+2;break;case n:r=(e-t)/d+4;break}r/=6}return{h:r,s:o,v:l}}function Ax(e,t,n){e=je(e,360)*6,t=je(t,100),n=je(n,100);var a=Math.floor(e),s=e-a,r=n*(1-t),o=n*(1-s*t),l=n*(1-(1-s)*t),d=a%6,c=[n,o,r,r,l,n][d],u=[l,n,n,o,r,r][d],f=[r,r,l,n,n,o][d];return{r:c*255,g:u*255,b:f*255}}function T3(e,t,n,a){var s=[Pt(Math.round(e).toString(16)),Pt(Math.round(t).toString(16)),Pt(Math.round(n).toString(16))];return a&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function zx(e,t,n,a,s){var r=[Pt(Math.round(e).toString(16)),Pt(Math.round(t).toString(16)),Pt(Math.round(n).toString(16)),Pt(D3(a))];return s&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)&&r[3].charAt(0)==r[3].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function S3(e,t,n,a){var s=[Pt(D3(a)),Pt(Math.round(e).toString(16)),Pt(Math.round(t).toString(16)),Pt(Math.round(n).toString(16))];return s.join("")}Ce.equals=function(e,t){return!e||!t?!1:Ce(e).toRgbString()==Ce(t).toRgbString()},Ce.random=function(){return Ce.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Vx(e,t){t=t===0?0:t||10;var n=Ce(e).toHsl();return n.s-=t/100,n.s=ao(n.s),Ce(n)}function Jx(e,t){t=t===0?0:t||10;var n=Ce(e).toHsl();return n.s+=t/100,n.s=ao(n.s),Ce(n)}function Rx(e){return Ce(e).desaturate(100)}function Qx(e,t){t=t===0?0:t||10;var n=Ce(e).toHsl();return n.l+=t/100,n.l=ao(n.l),Ce(n)}function $x(e,t){t=t===0?0:t||10;var n=Ce(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),Ce(n)}function _x(e,t){t=t===0?0:t||10;var n=Ce(e).toHsl();return n.l-=t/100,n.l=ao(n.l),Ce(n)}function Hx(e,t){var n=Ce(e).toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,Ce(n)}function Wx(e){var t=Ce(e).toHsl();return t.h=(t.h+180)%360,Ce(t)}function k3(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Ce(e).toHsl(),a=[Ce(e)],s=360/t,r=1;r<t;r++)a.push(Ce({h:(n.h+r*s)%360,s:n.s,l:n.l}));return a}function Fx(e){var t=Ce(e).toHsl(),n=t.h;return[Ce(e),Ce({h:(n+72)%360,s:t.s,l:t.l}),Ce({h:(n+216)%360,s:t.s,l:t.l})]}function Bx(e,t,n){t=t||6,n=n||30;var a=Ce(e).toHsl(),s=360/n,r=[Ce(e)];for(a.h=(a.h-(s*t>>1)+720)%360;--t;)a.h=(a.h+s)%360,r.push(Ce(a));return r}function Gx(e,t){t=t||6;for(var n=Ce(e).toHsv(),a=n.h,s=n.s,r=n.v,o=[],l=1/t;t--;)o.push(Ce({h:a,s,v:r})),r=(r+l)%1;return o}Ce.mix=function(e,t,n){n=n===0?0:n||50;var a=Ce(e).toRgb(),s=Ce(t).toRgb(),r=n/100,o={r:(s.r-a.r)*r+a.r,g:(s.g-a.g)*r+a.g,b:(s.b-a.b)*r+a.b,a:(s.a-a.a)*r+a.a};return Ce(o)},Ce.readability=function(e,t){var n=Ce(e),a=Ce(t);return(Math.max(n.getLuminance(),a.getLuminance())+.05)/(Math.min(n.getLuminance(),a.getLuminance())+.05)},Ce.isReadable=function(e,t,n){var a=Ce.readability(e,t),s,r;switch(r=!1,s=qx(n),s.level+s.size){case"AAsmall":case"AAAlarge":r=a>=4.5;break;case"AAlarge":r=a>=3;break;case"AAAsmall":r=a>=7;break}return r},Ce.mostReadable=function(e,t,n){var a=null,s=0,r,o,l,d;n=n||{},o=n.includeFallbackColors,l=n.level,d=n.size;for(var c=0;c<t.length;c++)r=Ce.readability(e,t[c]),r>s&&(s=r,a=Ce(t[c]));return Ce.isReadable(e,a,{level:l,size:d})||!o?a:(n.includeFallbackColors=!1,Ce.mostReadable(e,["#fff","#000"],n))};var zc=Ce.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Zx=Ce.hexNames=Yx(zc);function Yx(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function x3(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function je(e,t){Ux(e)&&(e="100%");var n=Kx(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function ao(e){return Math.min(1,Math.max(0,e))}function Nt(e){return parseInt(e,16)}function Ux(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Kx(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Pt(e){return e.length==1?"0"+e:""+e}function Fi(e){return e<=1&&(e=e*100+"%"),e}function D3(e){return Math.round(parseFloat(e)*255).toString(16)}function j3(e){return Nt(e)/255}var At=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",s="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+a),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+a),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+a),hsva:new RegExp("hsva"+s),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function pn(e){return!!At.CSS_UNIT.exec(e)}function Xx(e){e=e.replace(Dx,"").replace(jx,"").toLowerCase();var t=!1;if(zc[e])e=zc[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=At.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=At.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=At.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=At.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=At.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=At.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=At.hex8.exec(e))?{r:Nt(n[1]),g:Nt(n[2]),b:Nt(n[3]),a:j3(n[4]),format:t?"name":"hex8"}:(n=At.hex6.exec(e))?{r:Nt(n[1]),g:Nt(n[2]),b:Nt(n[3]),format:t?"name":"hex"}:(n=At.hex4.exec(e))?{r:Nt(n[1]+""+n[1]),g:Nt(n[2]+""+n[2]),b:Nt(n[3]+""+n[3]),a:j3(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=At.hex3.exec(e))?{r:Nt(n[1]+""+n[1]),g:Nt(n[2]+""+n[2]),b:Nt(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function qx(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const eD={info:g.object.isRequired},Bi=i.defineComponent({props:eD,emits:["tab","input"],setup(e,{emit:t}){const n=o=>{e.info.key==="a"&&t("tab",o)},a=o=>{const{key:l}=e.info,{value:d}=o.target;t("input",l,d)},{resolveClassName:s}=re(),r=i.computed(()=>ve({error:e.info.error},`${s("color-picker-input-value")}`));return()=>i.createVNode("div",{class:`${s("color-picker-input-part")}`},[i.createVNode("input",{type:e.info.name==="HEX"?"text":"number",class:r.value,value:e.info.value,onKeydown:n,onInput:a},null),i.createVNode("span",{class:`${s("color-picker-input-text")}`},[e.info.name])])}}),tD={colorObj:g.object.isRequired},nD=i.defineComponent({name:"ColorPicker",props:tD,emits:["change","tab"],setup(e,{emit:t}){const n=i.reactive({key:"hex",name:"HEX",value:e.colorObj.hex,error:!1}),a=i.reactive({key:"r",name:"R",value:e.colorObj.rgba.r.toString(),error:!1}),s=i.reactive({key:"g",name:"G",value:e.colorObj.rgba.g.toString(),error:!1}),r=i.reactive({key:"b",name:"B",value:e.colorObj.rgba.b.toString(),error:!1}),o=i.reactive({key:"a",name:"Alpha",value:e.colorObj.rgba.a.toString(),error:!1});i.watch(()=>e.colorObj,f=>{Ce(f.hex).toString()!==Ce(n.value).toString()&&(n.value=f.hex),a.value=f.rgba.r.toString(),s.value=f.rgba.g.toString(),r.value=f.rgba.b.toString(),o.value=f.rgba.a.toString(),c()},{deep:!0});const l=f=>{t("tab",f)},d=(f,h)=>{const m={r:a,g:s,b:r,a:o,hex:n};if(m[f].value=h,c()){const p=f==="hex"?n.value:`rgba(${a.value}, ${s.value}, ${r.value}, ${o.value})`;t("change",p)}},c=()=>{let f=!0;n.value.startsWith("#")&&(n.value.length===4||n.value.length===7)&&!n.value.slice(1).match(/[^0-9a-fA-F]/)?n.error=!1:(n.error=!0,f=!1),o.value!==""&&o.value>=0&&o.value<=1?o.error=!1:(o.error=!0,f=!1);for(const h of[a,s,r]){const{value:m}=h;m!==""&&m>=0&&m<=255?h.error=!1:(h.error=!0,f=!1)}return f},{resolveClassName:u}=re();return()=>i.createVNode("div",{class:`${u("color-picker-input")}`},[i.createVNode("div",{class:`${u("color-picker-input-hex")}`},[i.createVNode(Bi,{info:n,onInput:d},null)]),i.createVNode("div",{class:`${u("color-picker-input-rgba")}`},[i.createVNode(Bi,{info:a,onInput:d},null),i.createVNode(Bi,{info:s,onInput:d},null),i.createVNode(Bi,{info:r,onInput:d},null),i.createVNode(Bi,{info:o,onInput:d,onTab:l},null)])])}}),Vc=e=>{let t=e;e===""&&(t="#FFFFFF");const n=Ce(e),a=n.toHsl(),s=n.toHsv();return a.s===0&&(a.h=t.h||0,s.h=t.h||0),s.v<.0164&&(s.h=t.h||0,s.s=t.s||0),a.l<.01&&(a.h=t.h||0,a.s=t.s||0),{hsl:a,hsv:s,hex:n.toHexString().toUpperCase(),rgba:n.toRgb()}},nt=(e,t,n)=>e<t?t:e>n?n:e,Jc=(e,t)=>e.touches?e.touches[0][t]:0,O3=e=>{const{r:t,g:n,b:a,a:s}=e;return`rgba(${[t,n,a,s].join(",")})`},aD={colorObj:g.object.isRequired},iD=i.defineComponent({name:"ColorPicker",props:aD,emits:["change"],setup(e,{emit:t}){const n=i.ref(null),a=i.computed(()=>({left:`${e.colorObj.hsv.h/360*100}%`})),s=f=>{const{clientWidth:h}=n.value;let m=e.colorObj.hsv.h/360*h;const p=2,C=10;switch(f.code){case"ArrowLeft":f.preventDefault(),m=nt(m-p,0,h);break;case"ArrowRight":f.preventDefault(),m=nt(m+p,0,h);break;case"ArrowUp":f.preventDefault(),m=nt(m-C,0,h);break;case"ArrowDown":f.preventDefault(),m=nt(m+C,0,h);break;default:return}l(null,m)},r=f=>{n.value.focus(),l(f),window.addEventListener("mousemove",l,{passive:!0}),window.addEventListener("mouseup",o)},o=()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",o)},l=(f,h)=>{const{clientWidth:m}=n.value,p=h!==void 0?h:d(f);c(p/m)},d=f=>{const h=n.value.getBoundingClientRect().left+window.pageXOffset,m=f.pageX||Jc(f,"PageX");return nt(m-h,0,n.value.clientWidth)},c=f=>{const{h,s:m,l:p,a:C}=e.colorObj.hsl,N=f*360;h!==N&&t("change",{h:N,s:m,l:p,a:C})},{resolveClassName:u}=re();return()=>i.createVNode("div",{ref:n,tabindex:"0",class:`${u("color-picker-hue")}`,onKeydown:s,onMousedown:f=>{f.stopPropagation(),f.preventDefault(),r(f)}},[i.createVNode("div",{class:`${u("color-picker-hue-pointer")}`,style:a.value},[i.createVNode("div",{class:`${u("color-picker-hue-rectangle")}`},null)])])}}),sD={colorObj:g.object.isRequired,recommend:g.oneOfType([g.array.def(()=>[]),g.bool.def(!0)]).isRequired,recommendEmpty:g.bool.def(!0)},rD=i.defineComponent({props:sD,emits:["change","tab"],setup(e,{emit:t}){const n=i.ref(!1),a=i.ref(-1),s=i.ref(null);i.watch(()=>e.colorObj,()=>{a.value=-1,s.value=null},{deep:!0});const r=i.computed(()=>u(e.recommend)),{resolveClassName:o}=re(),l=(f,h)=>ve({[`${o("color-picker-empty")}`]:f==="",[`${o("color-picker-recommend-selected-color")}`]:n.value&&a.value===h},`${o("color-picker-recommend-color")}`),d=f=>{if(f.code==="Tab")t("tab",f);else{let h=0;const m=10,p=r.value.length-1;switch(f.code){case"ArrowLeft":f.preventDefault(),h=nt(a.value-1,0,p);break;case"ArrowRight":f.preventDefault(),h=nt(a.value+1,0,p);break;case"ArrowUp":f.preventDefault(),h=nt(a.value-m,0,p);break;case"ArrowDown":f.preventDefault(),h=nt(a.value+m,0,p);break;default:return}c(h)}},c=f=>{const h=r.value[f];t("change",h),i.nextTick(()=>{a.value=f,s.value=h})},u=f=>{if(f===!0){const h=["#ff4500","#ff8c00","#ffd700","#90ee90","#ddffff","#00ced1","#3a84ff","#a933f5","#db7093","#000000","#494949","#9B9B9B","#ffffff"];return e.recommendEmpty&&h.unshift(""),h}if(Array.isArray(f))return f.map(h=>Ce(h).isValid()?h:"")};return()=>i.createVNode("div",{tabindex:"0",class:`${o("color-picker-recommend")} `,onFocus:()=>n.value=!0,onBlur:()=>n.value=!1,onKeydown:d},[r.value.map((f,h)=>i.createVNode("div",{style:`background: ${f||"#fff"}`,class:l(f,h),onClick:()=>c(h)},[a.value===h?i.createVNode("div",{class:`${o("color-picker-pointer")}`},[i.createVNode("div",{class:`${o("color-picker-circle")}`},null)]):void 0]))])}}),oD={colorObj:g.object.isRequired},lD=i.defineComponent({props:oD,emits:["change"],setup(e,{emit:t}){const n=i.ref(null),a=i.computed(()=>({background:`hsl(${e.colorObj.hsv.h}, 100%, 50%)`})),s=i.computed(()=>({top:`${(1-e.colorObj.hsv.v)*100}%`,left:`${e.colorObj.hsv.s*100}%`})),r=m=>{n.value.focus(),d(m),window.addEventListener("mousemove",d,{passive:!0}),window.addEventListener("mouseup",o)},o=()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",o)},l=m=>{const{clientWidth:p,clientHeight:C}=n.value;let N=e.colorObj.hsv.s*p,v=(1-e.colorObj.hsv.v)*C;const I=10;switch(m.code){case"ArrowLeft":m.preventDefault(),N=nt(N-I,0,p);break;case"ArrowRight":m.preventDefault(),N=nt(N+I,0,p);break;case"ArrowUp":m.preventDefault(),v=nt(v-I,0,C);break;case"ArrowDown":m.preventDefault(),v=nt(v+I,0,C);break;default:return}d(null,N,v)},d=(m,p,C)=>{const{clientWidth:N,clientHeight:v}=n.value,I=p!==void 0?p:c(m),y=C!==void 0?C:u(m),b=I/N,w=1-y/v;f(e.colorObj.hsv.h,b,w,e.colorObj.hsv.a)},c=m=>{const p=n.value.getBoundingClientRect().left+window.pageXOffset,C=m.pageX||Jc(m,"PageX");return nt(C-p,0,n.value.clientWidth)},u=m=>{const p=n.value.getBoundingClientRect().top+window.pageYOffset,C=m.pageY||Jc(m,"PageY");return nt(C-p,0,n.value.clientHeight)},f=(m,p,C,N)=>{t("change",{h:m,s:p,v:C,a:N})},{resolveClassName:h}=re();return()=>i.createVNode("div",{ref:n,tabindex:"0",class:`${h("color-picker-saturation")}`,style:a.value,onKeydown:l,onMousedown:m=>{m.stopPropagation(),r(m)}},[i.createVNode("div",{class:`${h("color-picker-saturation-white")}`},null),i.createVNode("div",{class:`${h("color-picker-saturation-black")}`},null),i.createVNode("div",{class:`${h("color-picker-pointer")}`,style:s.value},[i.createVNode("div",{class:`${h("color-picker-circle")}`},null)])])}});var E3=function(e){return e.UNKNOWN="",e.SMALL="small",e.LARGE="large",e}(E3||{});const cD={modelValue:g.string.def(""),disabled:g.bool.def(!1),readonly:g.bool.def(!1),transfer:g.bool.def(!1),size:me("colorPickSize",{}).def(E3.UNKNOWN),showValue:g.bool.def(!0),recommend:g.oneOfType([g.array.def(()=>[]),g.bool.def(!0)]).def(!0),extCls:g.string.def(""),withValidate:g.bool.def(!0),recommendEmpty:g.bool.def(!0)},Gi=Vc("#FFFFFF"),P3=Me(i.defineComponent({name:"ColorPicker",directives:{clickoutside:_t},props:cD,emits:["update:modelValue","change"],setup(e,{emit:t,slots:n}){const a=kt(),s=i.ref(!1),r=i.ref(""),o=i.reactive(JSON.parse(JSON.stringify(Gi))),l=i.ref(null),d=i.ref(null),c=i.ref(null),{resolveClassName:u}=re(),f=i.computed(()=>ve({[`${u(`color-picker-${e.size}`)}`]:e.size,[`${u("color-picker-show-dropdown")}`]:s.value,[`${u("color-picker-show-value")}`]:e.showValue,[`${u("color-picker-disabled")}`]:e.disabled||e.readonly},`${u("color-picker")} ${e.extCls}`)),h=i.computed(()=>!!(e.recommend===!0||Array.isArray(e.recommend)&&e.recommend.length));i.onBeforeMount(()=>{b({isCreated:!0})}),i.watch(()=>e.modelValue,()=>{var S;b(),e.withValidate&&((S=a==null?void 0:a.validate)==null||S.call(a,"change"))});const m=S=>{S.code==="Enter"||S.code==="NumpadEnter"?C():S.code==="Escape"&&y()},p=S=>{e.transfer&&m(S)},C=()=>{e.disabled||e.readonly||(s.value?y():I())},N=S=>{h.value||(S.preventDefault(),d.value.$el.focus())},v=S=>{S.preventDefault(),d.value.$el.focus()},I=()=>{var S;s.value=!0,(S=l.value)==null||S.updateDropdown(),setTimeout(()=>{l.value.$el.querySelector(`.${u("color-picker-input-hex")} .${u("color-picker-input-value")}`).select()},100)},y=()=>{var S;s.value&&(i.nextTick(()=>c.value.focus()),s.value=!1,(S=l.value)==null||S.destoryDropdown(),b())},b=({isCreated:S=!1}={})=>{if(e.modelValue===""){r.value!==""&&(r.value="",Object.assign(o,Gi),t("update:modelValue",r.value));return}const L=Vc(e.modelValue),j=L.rgba.a===1?L.hex:O3(L.rgba);if(j!==r.value){const T=Ce(e.modelValue).isValid();S?T?(r.value=j.toLowerCase()===e.modelValue.toLowerCase()?e.modelValue:j,Object.assign(o,L)):(Object.assign(o,Gi),t("change","")):T?j.toLowerCase()!==r.value.toLowerCase()&&(Object.assign(o,L),r.value=j):(r.value="",Object.assign(o,Gi))}},w=S=>{if(S===""){r.value="",Object.assign(o,Gi),t("update:modelValue",""),t("change","");return}const L=Vc(S),j=L.rgba.a===1?L.hex:O3(L.rgba);r.value=j,Object.assign(o,L),t("update:modelValue",r.value),t("change",j)},M=()=>{s.value=!1};return()=>i.withDirectives(i.createVNode("div",{ref:c,tabindex:"0",class:f.value,onKeydown:m,onClick:C},[typeof n.trigger=="function"?n.trigger({value:r.value,isShowDropdown:s.value}):i.createVNode(i.Fragment,null,[i.createVNode("div",{class:`${u("color-picker-color")}`},[i.createVNode("span",{class:`${u("color-picker-color-square")} ${!r.value&&`${u("color-picker-empty")}`}`,style:`background: ${r.value||"#FFF"}`},null)]),e.showValue?i.createVNode("div",{class:`${u("color-picker-text")}`},[i.createVNode("span",null,[r.value])]):void 0,i.createVNode("div",{class:`${u("color-picker-icon")}`},[i.createVNode(Hn,{class:"icon-angle-down"},null)])]),i.createVNode(i.Transition,{name:"bk-fade-down-transition"},{default:()=>[i.withDirectives(i.createVNode(fc,{ref:l,triggerRef:c.value},{default:()=>[i.createVNode("div",{class:`${u("color-dropdown-container")}`},[i.createVNode("div",{class:`${u("color-picker-dropdown")}`,onClick:S=>{S.stopPropagation()},onMousedown:S=>{S.stopPropagation()},onKeydown:p},[i.createVNode(lD,{ref:d,colorObj:o,onChange:w},null),i.createVNode(iD,{colorObj:o,onChange:w},null),i.createVNode(nD,{colorObj:o,onTab:N,onChange:w},null),h.value?i.createVNode("div",{class:`${u("color-picker-recommend-container")}`},[i.createVNode(rD,{colorObj:o,recommend:e.recommend,recommendEmpty:e.recommendEmpty,onTab:v,onChange:w},null)]):void 0])])]}),[[i.vShow,s.value]])]})]),[[i.resolveDirective("clickoutside"),M]])}})),A3=Me(nS);var Rc=null;function dD(e){return Rc||(Rc=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return setTimeout(t,16)}).bind(window)),Rc(e)}var Qc=null;function uD(e){Qc||(Qc=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)}).bind(window)),Qc(e)}function fD(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}function io(e,t){t===void 0&&(t={});var n=document.createElement(e);return Object.keys(t).forEach(function(a){n[a]=t[a]}),n}function z3(e,t,n){var a=window.getComputedStyle(e,n||null)||{display:"none"};return a[t]}function $c(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if(z3(t,"display")==="none")return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var hD='.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}',_c=0,so=null;function gD(e,t){e.__resize_mutation_handler__||(e.__resize_mutation_handler__=yD.bind(e));var n=e.__resize_listeners__;if(!n){if(e.__resize_listeners__=[],window.ResizeObserver){var a=e.offsetWidth,s=e.offsetHeight,r=new ResizeObserver(function(){!e.__resize_observer_triggered__&&(e.__resize_observer_triggered__=!0,e.offsetWidth===a&&e.offsetHeight===s)||ro(e)}),o=$c(e),l=o.detached,d=o.rendered;e.__resize_observer_triggered__=l===!1&&d===!1,e.__resize_observer__=r,r.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){ro(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(_c||(so=fD(hD)),bD(e),e.__resize_rendered__=$c(e).rendered,window.MutationObserver){var c=new MutationObserver(e.__resize_mutation_handler__);c.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=c}}e.__resize_listeners__.push(t),_c++}function mD(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener){e.detachEvent("onresize",e.__resize_legacy_resize_handler__),document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);return}e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",Hc),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--_c&&so&&so.parentNode.removeChild(so)}}function pD(e){var t=e.__resize_last__,n=t.width,a=t.height,s=e.offsetWidth,r=e.offsetHeight;return s!==n||r!==a?{width:s,height:r}:null}function yD(){var e=$c(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(Wc(this),this.addEventListener("scroll",Hc,!0)),this.__resize_rendered__=t,ro(this))}function Hc(){var e=this;Wc(this),this.__resize_raf__&&uD(this.__resize_raf__),this.__resize_raf__=dD(function(){var t=pD(e);t&&(e.__resize_last__=t,ro(e))})}function ro(e){!e||!e.__resize_listeners__||e.__resize_listeners__.forEach(function(t){t.call(e,e)})}function bD(e){var t=z3(e,"position");(!t||t==="static")&&(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=io("div",{className:"resize-triggers"}),a=io("div",{className:"resize-expand-trigger"}),s=io("div"),r=io("div",{className:"resize-contract-trigger"});a.appendChild(s),n.appendChild(a),n.appendChild(r),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:a,expandChild:s,contract:r},Wc(e),e.addEventListener("scroll",Hc,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}function Wc(e){var t=e.__resize_triggers__,n=t.expand,a=t.expandChild,s=t.contract,r=s.scrollWidth,o=s.scrollHeight,l=n.offsetWidth,d=n.offsetHeight,c=n.scrollWidth,u=n.scrollHeight;s.scrollLeft=r,s.scrollTop=o,a.style.width=l+1+"px",a.style.height=d+1+"px",n.scrollLeft=c,n.scrollTop=u}var ht=(e=>(e.ALL="all",e.NEEDKEY="need-key",e))(ht||{});const V3=Symbol("SEARCH_SLECT_PROVIDER_KEY"),CD=e=>{i.provide(V3,e)},J3=()=>i.inject(V3);var Za=(e=>(e.DEFAULT="default",e.EDIT="edit",e))(Za||{}),Ya=(e=>(e.AND="&",e.OR="|",e))(Ya||{});class la{constructor(t,n="default"){ye(this,"id");ye(this,"name");ye(this,"values",[]);ye(this,"condition");ye(this,"logical");this.searchItem=t,this.type=n,this.id=t.id,this.name=t.name,this.logical=t.logical||"|"}get multiple(){return!!this.searchItem.multiple}get placeholder(){return this.searchItem.placeholder||""}get children(){return this.searchItem.children||[]}get validate(){return!this.searchItem.noValidate}get inputInnerHtml(){var t;return this.isSpecialType()?this.name:`${this.keyInnerHtml}${((t=this.values)==null?void 0:t.map(n=>n.name).join(` ${this.logical} `))||""}`}get inputInnerText(){var t;return this.isSpecialType()?this.name:`${this.keyInnerText}${((t=this.values)==null?void 0:t.map(n=>n.name).join(` ${this.logical} `))||""}`}get keyInnerHtml(){return this.isSpecialType()?this.name:this.name?`${this.name}: `:""}get keyInnerText(){return this.isSpecialType()?this.name:this.name?`${this.name}: `:""}get showLogical(){return!!this.searchItem.showLogicalPanel}isSpecialType(){return["text","condition"].includes(this.type)}addValue(t){if(this.multiple){const n=this.values.findIndex(a=>a.id===t.id);if(n>-1){this.values.splice(n,1);return}this.values.push(t);return}this.values=[t]}toValue(){var n;const t={id:this.id,name:this.name};return(n=this.values)!=null&&n.length&&(t.values=this.values.map(a=>({id:a.id,name:a.name})),this.multiple&&this.logical!=="|"&&(t.logical=this.logical)),this.type&&this.type!=="default"&&(t.type=this.type),t}toValueKey(){return JSON.stringify(this.toValue())}isInValueList(t){return this.children.some(n=>n.id===(t==null?void 0:t.id))}}const vD=i.defineComponent({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:()=>[]},conditions:{type:Array},footerBtns:{type:Array,default:()=>[]},showLogical:{type:Boolean,default:!0},logical:{type:String,default:Ya.OR}},emits:["selectItem","selectCondition","footerClick","update:logical"],setup(e,{emit:t}){const n=ke("searchSelect"),{resolveClassName:a}=re(),s=i.computed(()=>e.footerBtns===void 0||e.footerBtns.length===0?[{id:"confirm",name:n.value.ok},{id:"cancel",name:n.value.cancel,disabled:!1}]:e.footerBtns);function r(m){t("selectItem",m)}function o(m){t("selectCondition",m)}function l(m){t("footerClick",m)}const d=i.computed(()=>{var m,p;return(m=e.list)!=null&&m.length?(p=e.keyword)!=null&&p.length?e.list.filter(C=>C.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())):e.list:[]});function c(m){if(!m)return m;let{keyword:p}=e;const C=p.length;if(!(p!=null&&p.trim().length)||!m.toLocaleLowerCase().includes(p.toLocaleLowerCase()))return m;const N=[];let v=-1;return p=p.replace(/([.*/]{1})/gim,"\\$1"),m.replace(new RegExp(`${p}`,"igm"),(I,y)=>(N.length===0&&y!==0?N.push(m.slice(0,y)):v>=0&&N.push(m.slice(v+I.length,y)),N.push(i.createVNode("span",{class:"is-keyword"},[I])),v=y,I)),v>=0&&N.push(m.slice(v+C)),N.length?N:m}function u(m){var p;return(p=m.value)!=null&&p.name?[i.createVNode("span",{class:"menu-name"},[m.name,i.createTextVNode(":")]),m.value.name]:c(m.name)}function f(m,p){m.stopPropagation(),m.preventDefault(),r(p)}function h(m){t("update:logical",m)}return{handleClick:r,handleClickCondition:o,handleClickFooterBtn:l,handleSelectedChange:f,handleLogicalChange:h,filterList:d,getSearchNode:u,localFooterBtns:s,resolveClassName:a,t:n}},render(){var n,a;const e=i.createVNode("ul",{class:"menu-content"},[(n=this.list)==null?void 0:n.map(s=>i.createVNode("li",{class:`menu-item ${s.disabled?"is-disabled":""} ${this.hoverId===s.id&&!s.disabled?"is-hover":""}`,key:s.id,id:s.id,tabindex:"-1",onClick:()=>!s.disabled&&this.handleClick(s)},[this.$slots.default?this.$slots.default({item:s,list:this.list,multiple:!!this.multiple,hoverId:this.hoverId,getSearchNode:this.getSearchNode}):i.createVNode(i.Fragment,null,[this.multiple&&i.createVNode("span",{onClick:r=>this.handleSelectedChange(r,s)},[i.createVNode(ct,{modelValue:this.selected.includes(s.id),class:"is-selected"},null)]),this.getSearchNode(s)])]))]),t=()=>!this.showLogical||!this.multiple?e:i.createVNode("div",{class:"menu-content-wrapper"},[e,i.createVNode("div",{class:"menu-condition"},[i.createVNode("div",{class:"menu-condition-title"},[this.t.logical]),i.createVNode(pr,{modelValue:this.logical,onChange:this.handleLogicalChange,label:"|"},{default:()=>[this.t.or,i.createTextVNode(" |")]}),i.createVNode(pr,{modelValue:this.logical,onChange:this.handleLogicalChange,label:"&"},{default:()=>[this.t.and,i.createTextVNode(" &")]})])]);return i.createVNode("div",{class:this.resolveClassName("search-select-menu")},[!!((a=this.conditions)!=null&&a.length)&&i.createVNode("ul",{class:"menu-header"},[this.conditions.map(s=>i.createVNode("li",{key:s.id,class:`menu-header-item ${s.disabled?"is-disabled":""}`,onClick:()=>!s.disabled&&this.handleClickCondition(s)},[s.name]))]),t()])}}),R3=i.defineComponent({name:"SearchSelectInput",directives:{clickoutside:_t},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:()=>[]},defautUsingItem:Object,mode:{type:String,default:Za.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup(e,{emit:t,expose:n}){const a=ke("searchSelect"),{resolveClassName:s}=re(),r=i.ref(null),o=i.ref(null),l=i.ref(""),d=i.ref(!1),c=i.ref(!1),u=i.ref(!1),f=i.ref(e.defautUsingItem),h=i.ref(""),m=i.ref(!1),p=wa(300,ie);let C=!1;const N=i.ref([]),v=i.ref([]),{editKey:I,onValidate:y}=J3(),b=i.computed(()=>{var O;return((O=f.value)==null?void 0:O.logical)||Ya.OR});i.watch(I,()=>{e.mode===Za.DEFAULT&&I.value&&(u.value=!1)}),i.watchEffect(()=>{l.value||k()},{flush:"pre"}),i.watch([v,u],()=>{var O;(O=v.value)!=null&&O.some(R=>!R.disabled)&&u.value?C||(e.valueBehavior===ht.NEEDKEY?h.value=v.value.find(R=>!R.disabled).id:h.value="",C=!0,document.addEventListener("keydown",w)):(document.removeEventListener("keydown",w),C=!1,e.valueBehavior!==ht.NEEDKEY&&(h.value=""))});function w(O){switch(O.code){case"ArrowDown":case"ArrowUp":M(O);break;case"Enter":case"NumpadEnter":S(O);break}}function M(O){var G;O.preventDefault(),(G=r.value)==null||G.blur();const R=v.value.length;let B=R,K=v.value.findIndex(te=>te.id===h.value);for(;B>=0;){K=O.code==="ArrowDown"?K+1:K-1,K=K>R-1?0:K<0?R-1:K;const te=v.value[K];if(te&&!te.disabled){B=-1;const F=document.getElementById(te.id);F==null||F.focus(),h.value=te.id;return}B-=1}}function S(O){if(C){O.preventDefault();const R=v.value.find(B=>B.id===h.value);R&&E(R)}}function L(O){var R,B,K,G,te;if(!((R=o.value)!=null&&R.contains(O.target))&&((B=e.clickOutside)!=null&&B.call(e,O.target,o.value))){if((G=(K=f.value)==null?void 0:K.values)!=null&&G.length&&((te=f.value)!=null&&te.multiple)){l.value="",J();return}u.value=!1,c.value=!1,t("focus",c.value)}}function j(O){Z(),O&&ie()}function T(O){var B,K,G,te,F,D,x,$,q;Y();let R=O.target.innerText;if(/(\r|\n)/gm.test(R)||/\s{2}/gm.test(R))O.preventDefault(),R=R.replace(/(\r|\n)/gm,` ${b.value} `).replace(/\s{2}/gm,""),r.value.innerText=R,Z(),l.value=R.replace(((B=f.value)==null?void 0:B.keyInnerText)||"","").trim(),p();else if(!l.value&&R.length<(((G=(K=f.value)==null?void 0:K.inputInnerText)==null?void 0:G.length)||1)){const W=R.replace(" "," ").replace(((te=f.value)==null?void 0:te.keyInnerText.replace(" "," ").trim())||"","").trim();if(R&&((F=f.value)==null?void 0:F.keyInnerText)&&R.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&W&&((D=f.value.values)!=null&&D.length)){l.value=W,console.info("outerText",W),p();return}(W||!(R!=null&&R.length))&&(f.value=null),l.value=W?R:"",p()}else($=(x=f.value)==null?void 0:x.values)!=null&&$.length||(l.value=R.replace(" "," ").replace(((q=f.value)==null?void 0:q.keyInnerText.replace(" "," "))||"","").trim(),Z(),p())}function z(O){switch(O.code){case"Enter":case"NumpadEnter":if(e.valueBehavior===ht.NEEDKEY&&v.value.some(R=>R.id===h.value))return;J(O);break;case"Backspace":V();default:d.value=!1;break}}async function J(O){var K;if(O==null||O.preventDefault(),await new Promise(G=>setTimeout(G,0)),!f.value){if(!l.value||e.valueBehavior===ht.NEEDKEY)return;const G={id:l.value,name:l.value};if(!await Q(G))return;t("add",new la(G,"text")),l.value="",ie();return}const{values:R}=f.value;if(!(R!=null&&R.length)){if((K=l.value)!=null&&K.length){if(l.value.includes(b.value)){const G=l.value.split(b.value);if(!await Q({id:l.value,name:l.value}))return;G.forEach(F=>f.value.addValue({id:F,name:F}))}else{const G={id:l.value,name:l.value};if(!await Q(G))return;f.value.addValue(G)}t("add",f.value),l.value="",f.value=null,Z(!0);return}d.value=!0;return}if(l.value){const G={id:l.value,name:l.value};if(!await Q(G))return;f.value.addValue(G),t("add",f.value),l.value="",f.value=null,Z(!0);return}await Q()&&H()}function V(){var O,R;if(!f.value&&!l.value){t("delete"),i.nextTick(ie);return}if((O=f.value)!=null&&O.values.length){if((R=f.value)!=null&&R.multiple||f.value.isInValueList(f.value.values[0])||e.mode===Za.EDIT&&!l.value){f.value.values.splice(-1,1),l.value="",Z();return}}else l.value||(f.value=null,l.value="",ie());y("")}async function E(O,R){var K,G,te,F;if((K=O.value)!=null&&K.id){if(e.valueBehavior===ht.NEEDKEY&&O.value||!e.validateValues){const x=new la({...O,id:O.realId??O.id},R);x.addValue(O.value),H(x),e.valueBehavior===ht.NEEDKEY&&h.value&&Z(!0),h.value="";return}if(f.value=new la({...O,id:O.realId??O.id},R),f.value.addValue(O.value),!await Q(O.value)){f.value=null;return}H(f.value),h.value="",Z(!0);return}if(!f.value||!((G=r==null?void 0:r.value)!=null&&G.innerText)){f.value=new la(O,R),l.value="";const D=R==="condition";D&&H(),u.value=D||!!f.value.children.length,Z(e.valueBehavior===ht.NEEDKEY&&!!h.value);return}if(((te=f.value)==null?void 0:te.type)==="condition"){f.value=new la(O,R),H();return}f.value.addValue(O),await Q(O)&&(f.value.multiple||H(),e.valueBehavior===ht.NEEDKEY&&((F=f.value)!=null&&F.multiple)&&Z())}function P(O){E(O,"condition")}function _(O){var R;switch(O.id){case"confirm":if(!((R=f.value)!=null&&R.values.length))return;l.value="",J();break;case"cancel":f.value.values=[],u.value=!1;break}}async function Q(O){if(!f.value)return await U(null,[O]);const{searchItem:R,validate:B,values:K}=f.value;return B&&typeof e.validateValues=="function"?await U(R,O?[O]:K):(y(""),!0)}async function U(O,R){var K;const B=await((K=e.validateValues)==null?void 0:K.call(e,O??null,R).catch(()=>!1));return typeof B=="string"||B===!1?(y(B||"校验错误"),!1):(y(""),!0)}function Z(O=!1){O&&i.nextTick().then(()=>{ie()}),c.value=!0,u.value=!0,d.value=!1;const R=setTimeout(()=>{if(r.value){r.value.focus();const B=window.getSelection();B.focusOffset===0&&(B.selectAllChildren(r.value),B.collapseToEnd())}window.clearTimeout(R)},0);t("focus",c.value)}async function ie(){var R,B,K,G,te;let O=[];if(typeof e.getMenuList=="function"&&(typeof((B=(R=f.value)==null?void 0:R.searchItem)==null?void 0:B.async)>"u"||f.value.searchItem.async===!0)?(m.value=!0,O=await e.getMenuList((K=f.value)==null?void 0:K.searchItem,l.value).catch(()=>[]),m.value=!1):f!=null&&f.value?f.value.type==="condition"?O=e.conditions:(!((te=f.value.values)!=null&&te.length)||f.value.multiple||e.mode===Za.EDIT)&&(O=f.value.children.filter(F=>F.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase()))):(G=l.value)!=null&&G.length?e.data.filter(F=>!F.isSelected).forEach(F=>{var x,$;if(F.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase())){O.push(F);const q=[];(x=F.children)==null||x.forEach(W=>{q.push({...F,realId:F.id,id:yn(10),value:W})}),!q.length&&!F.onlyRecommendChildren&&q.push({...F,realId:F.id,id:yn(10),value:{id:l.value,name:l.value}}),O.push(...q)}else{const q=[];($=F.children)==null||$.forEach(W=>{W.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase())&&q.push({...F,realId:F.id,id:yn(10),value:W})}),!q.length&&!F.onlyRecommendChildren&&q.push({...F,value:{id:l.value,name:l.value}}),O.push(...q)}}):O=e.data.filter(F=>!F.isSelected).slice(),v.value=O,e.valueBehavior===ht.NEEDKEY){const F=O.find(D=>!D.disabled);F&&(!h.value||h.value&&!O.some(D=>D.id===h.value))&&(h.value=F.id)}}function H(O){t("add",O??f.value),f.value=null,l.value="",Z(e.valueBehavior===ht.NEEDKEY)}function Y(){const O=r.value.innerText;O[O.length-1]===`
|
361
|
+
`+n),a.b("</div>"),a.fl()},partials:{},subs:{}}),$e["tag-file-added"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),a.fl()},partials:{},subs:{}}),$e["tag-file-changed"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),a.fl()},partials:{},subs:{}}),$e["tag-file-deleted"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),a.fl()},partials:{},subs:{}}),$e["tag-file-renamed"]=new ze.Template({code:function(e,t,n){var a=this;return a.b(n=n||""),a.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),a.fl()},partials:{},subs:{}});var ra=globalThis&&globalThis.__assign||function(){return ra=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ra.apply(this,arguments)},Mx=function(){function e(t){var n=t.compiledTemplates,a=n===void 0?{}:n,s=t.rawTemplates,r=s===void 0?{}:s,o=Object.entries(r).reduce(function(l,d){var c,u=d[0],f=d[1],h=ze.compile(f,{asString:!1});return ra(ra({},l),(c={},c[u]=h,c))},{});this.preCompiledTemplates=ra(ra(ra({},$e),a),o)}return e.compile=function(t){return ze.compile(t,{asString:!1})},e.prototype.render=function(t,n,a,s,r){var o=this.templateKey(t,n);try{var l=this.preCompiledTemplates[o];return l.render(a,s,r)}catch{throw new Error("Could not find template to render '".concat(o,"'"))}},e.prototype.template=function(t,n){return this.preCompiledTemplates[this.templateKey(t,n)]},e.prototype.templateKey=function(t,n){return"".concat(t,"-").concat(n)},e}(),oa=globalThis&&globalThis.__assign||function(){return oa=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},oa.apply(this,arguments)},Ix=oa(oa(oa({},b3),v3),{outputFormat:Fk.LINE_BY_LINE,drawFileList:!0});function Lx(e,t){t===void 0&&(t={});var n=oa(oa({},Ix),t),a=typeof e=="string"?ex(e,n):e,s=new Mx(n),r=n.drawFileList?mx(a,s):"",o=n.outputFormat==="side-by-side"?new wx(s,n).render(a):new bx(s,n).render(a);return r+o}const Tx=Gd([...["side-by-side","line-by-line"]]),Sx=Gd([...["dark","light"]]),kx={oldContent:st().def(""),newContent:st().def(""),diffFormat:st().def(Tx["line-by-line"]),diffContext:Wd(),theme:st().def("light"),language:st().def("javascript"),hljs:g.any.isRequired};function xx(e,t){return e.replace(/d2h-code-line-ctn/g,n=>`${n} lang-${t}`)}const M3=Me(i.defineComponent({name:"CodeDiff",props:kx,emits:[],setup(e){const{resolveClassName:t}=re(),n=i.ref(null),a=i.ref(""),s=i.computed(()=>ve({dark:e.theme===Sx.dark},`hljs ${t("code-diff")}`));function r(){i.nextTick(()=>{n.value&&n.value.querySelectorAll(`.lang-${e.language}`).forEach(l=>{e.hljs.highlightElement(l)})})}function o(l,d){const c=Wk("",e.oldContent,e.newContent,"","",{context:l});a.value=xx(Lx(c,{drawFileList:!1,matching:"lines",outputFormat:e.diffFormat}),d),r()}return i.onMounted(()=>{o(e.diffContext,e.language)}),i.watch(()=>[e.diffContext,e.language],l=>{const[d,c]=l;o(d,c)}),()=>i.createVNode("div",{ref:n,class:s.value,innerHTML:a.value},null)}}));function no(e){"@babel/helpers - typeof";return no=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},no(e)}var Dx=/^\s+/,jx=/\s+$/;function Ce(e,t){if(e=e||"",t=t||{},e instanceof Ce)return e;if(!(this instanceof Ce))return new Ce(e,t);var n=Ox(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}Ce.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,a,s,r,o,l;return n=t.r/255,a=t.g/255,s=t.b/255,n<=.03928?r=n/12.92:r=Math.pow((n+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),s<=.03928?l=s/12.92:l=Math.pow((s+.055)/1.055,2.4),.2126*r+.7152*o+.0722*l},setAlpha:function(t){return this._a=x3(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=L3(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=L3(this._r,this._g,this._b),n=Math.round(t.h*360),a=Math.round(t.s*100),s=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+a+"%, "+s+"%)":"hsva("+n+", "+a+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var t=I3(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=I3(this._r,this._g,this._b),n=Math.round(t.h*360),a=Math.round(t.s*100),s=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+a+"%, "+s+"%)":"hsla("+n+", "+a+"%, "+s+"%, "+this._roundA+")"},toHex:function(t){return T3(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return zx(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(je(this._r,255)*100)+"%",g:Math.round(je(this._g,255)*100)+"%",b:Math.round(je(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(je(this._r,255)*100)+"%, "+Math.round(je(this._g,255)*100)+"%, "+Math.round(je(this._b,255)*100)+"%)":"rgba("+Math.round(je(this._r,255)*100)+"%, "+Math.round(je(this._g,255)*100)+"%, "+Math.round(je(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Zx[T3(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+S3(this._r,this._g,this._b,this._a),a=n,s=this._gradientType?"GradientType = 1, ":"";if(t){var r=Ce(t);a="#"+S3(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+n+",endColorstr="+a+")"},toString:function(t){var n=!!t;t=t||this._format;var a=!1,s=this._a<1&&this._a>=0,r=!n&&s&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return r?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(a=this.toRgbString()),t==="prgb"&&(a=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(a=this.toHexString()),t==="hex3"&&(a=this.toHexString(!0)),t==="hex4"&&(a=this.toHex8String(!0)),t==="hex8"&&(a=this.toHex8String()),t==="name"&&(a=this.toName()),t==="hsl"&&(a=this.toHslString()),t==="hsv"&&(a=this.toHsvString()),a||this.toHexString())},clone:function(){return Ce(this.toString())},_applyModification:function(t,n){var a=t.apply(null,[this].concat([].slice.call(n)));return this._r=a._r,this._g=a._g,this._b=a._b,this.setAlpha(a._a),this},lighten:function(){return this._applyModification(Qx,arguments)},brighten:function(){return this._applyModification($x,arguments)},darken:function(){return this._applyModification(_x,arguments)},desaturate:function(){return this._applyModification(Vx,arguments)},saturate:function(){return this._applyModification(Jx,arguments)},greyscale:function(){return this._applyModification(Rx,arguments)},spin:function(){return this._applyModification(Hx,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(Bx,arguments)},complement:function(){return this._applyCombination(Wx,arguments)},monochromatic:function(){return this._applyCombination(Gx,arguments)},splitcomplement:function(){return this._applyCombination(Fx,arguments)},triad:function(){return this._applyCombination(k3,[3])},tetrad:function(){return this._applyCombination(k3,[4])}},Ce.fromRatio=function(e,t){if(no(e)=="object"){var n={};for(var a in e)e.hasOwnProperty(a)&&(a==="a"?n[a]=e[a]:n[a]=Fi(e[a]));e=n}return Ce(e,t)};function Ox(e){var t={r:0,g:0,b:0},n=1,a=null,s=null,r=null,o=!1,l=!1;return typeof e=="string"&&(e=Xx(e)),no(e)=="object"&&(pn(e.r)&&pn(e.g)&&pn(e.b)?(t=Ex(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):pn(e.h)&&pn(e.s)&&pn(e.v)?(a=Fi(e.s),s=Fi(e.v),t=Ax(e.h,a,s),o=!0,l="hsv"):pn(e.h)&&pn(e.s)&&pn(e.l)&&(a=Fi(e.s),r=Fi(e.l),t=Px(e.h,a,r),o=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=x3(n),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function Ex(e,t,n){return{r:je(e,255)*255,g:je(t,255)*255,b:je(n,255)*255}}function I3(e,t,n){e=je(e,255),t=je(t,255),n=je(n,255);var a=Math.max(e,t,n),s=Math.min(e,t,n),r,o,l=(a+s)/2;if(a==s)r=o=0;else{var d=a-s;switch(o=l>.5?d/(2-a-s):d/(a+s),a){case e:r=(t-n)/d+(t<n?6:0);break;case t:r=(n-e)/d+2;break;case n:r=(e-t)/d+4;break}r/=6}return{h:r,s:o,l}}function Px(e,t,n){var a,s,r;e=je(e,360),t=je(t,100),n=je(n,100);function o(c,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(u-c)*6*f:f<1/2?u:f<2/3?c+(u-c)*(2/3-f)*6:c}if(t===0)a=s=r=n;else{var l=n<.5?n*(1+t):n+t-n*t,d=2*n-l;a=o(d,l,e+1/3),s=o(d,l,e),r=o(d,l,e-1/3)}return{r:a*255,g:s*255,b:r*255}}function L3(e,t,n){e=je(e,255),t=je(t,255),n=je(n,255);var a=Math.max(e,t,n),s=Math.min(e,t,n),r,o,l=a,d=a-s;if(o=a===0?0:d/a,a==s)r=0;else{switch(a){case e:r=(t-n)/d+(t<n?6:0);break;case t:r=(n-e)/d+2;break;case n:r=(e-t)/d+4;break}r/=6}return{h:r,s:o,v:l}}function Ax(e,t,n){e=je(e,360)*6,t=je(t,100),n=je(n,100);var a=Math.floor(e),s=e-a,r=n*(1-t),o=n*(1-s*t),l=n*(1-(1-s)*t),d=a%6,c=[n,o,r,r,l,n][d],u=[l,n,n,o,r,r][d],f=[r,r,l,n,n,o][d];return{r:c*255,g:u*255,b:f*255}}function T3(e,t,n,a){var s=[Pt(Math.round(e).toString(16)),Pt(Math.round(t).toString(16)),Pt(Math.round(n).toString(16))];return a&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function zx(e,t,n,a,s){var r=[Pt(Math.round(e).toString(16)),Pt(Math.round(t).toString(16)),Pt(Math.round(n).toString(16)),Pt(D3(a))];return s&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)&&r[3].charAt(0)==r[3].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function S3(e,t,n,a){var s=[Pt(D3(a)),Pt(Math.round(e).toString(16)),Pt(Math.round(t).toString(16)),Pt(Math.round(n).toString(16))];return s.join("")}Ce.equals=function(e,t){return!e||!t?!1:Ce(e).toRgbString()==Ce(t).toRgbString()},Ce.random=function(){return Ce.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Vx(e,t){t=t===0?0:t||10;var n=Ce(e).toHsl();return n.s-=t/100,n.s=ao(n.s),Ce(n)}function Jx(e,t){t=t===0?0:t||10;var n=Ce(e).toHsl();return n.s+=t/100,n.s=ao(n.s),Ce(n)}function Rx(e){return Ce(e).desaturate(100)}function Qx(e,t){t=t===0?0:t||10;var n=Ce(e).toHsl();return n.l+=t/100,n.l=ao(n.l),Ce(n)}function $x(e,t){t=t===0?0:t||10;var n=Ce(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),Ce(n)}function _x(e,t){t=t===0?0:t||10;var n=Ce(e).toHsl();return n.l-=t/100,n.l=ao(n.l),Ce(n)}function Hx(e,t){var n=Ce(e).toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,Ce(n)}function Wx(e){var t=Ce(e).toHsl();return t.h=(t.h+180)%360,Ce(t)}function k3(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Ce(e).toHsl(),a=[Ce(e)],s=360/t,r=1;r<t;r++)a.push(Ce({h:(n.h+r*s)%360,s:n.s,l:n.l}));return a}function Fx(e){var t=Ce(e).toHsl(),n=t.h;return[Ce(e),Ce({h:(n+72)%360,s:t.s,l:t.l}),Ce({h:(n+216)%360,s:t.s,l:t.l})]}function Bx(e,t,n){t=t||6,n=n||30;var a=Ce(e).toHsl(),s=360/n,r=[Ce(e)];for(a.h=(a.h-(s*t>>1)+720)%360;--t;)a.h=(a.h+s)%360,r.push(Ce(a));return r}function Gx(e,t){t=t||6;for(var n=Ce(e).toHsv(),a=n.h,s=n.s,r=n.v,o=[],l=1/t;t--;)o.push(Ce({h:a,s,v:r})),r=(r+l)%1;return o}Ce.mix=function(e,t,n){n=n===0?0:n||50;var a=Ce(e).toRgb(),s=Ce(t).toRgb(),r=n/100,o={r:(s.r-a.r)*r+a.r,g:(s.g-a.g)*r+a.g,b:(s.b-a.b)*r+a.b,a:(s.a-a.a)*r+a.a};return Ce(o)},Ce.readability=function(e,t){var n=Ce(e),a=Ce(t);return(Math.max(n.getLuminance(),a.getLuminance())+.05)/(Math.min(n.getLuminance(),a.getLuminance())+.05)},Ce.isReadable=function(e,t,n){var a=Ce.readability(e,t),s,r;switch(r=!1,s=qx(n),s.level+s.size){case"AAsmall":case"AAAlarge":r=a>=4.5;break;case"AAlarge":r=a>=3;break;case"AAAsmall":r=a>=7;break}return r},Ce.mostReadable=function(e,t,n){var a=null,s=0,r,o,l,d;n=n||{},o=n.includeFallbackColors,l=n.level,d=n.size;for(var c=0;c<t.length;c++)r=Ce.readability(e,t[c]),r>s&&(s=r,a=Ce(t[c]));return Ce.isReadable(e,a,{level:l,size:d})||!o?a:(n.includeFallbackColors=!1,Ce.mostReadable(e,["#fff","#000"],n))};var zc=Ce.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Zx=Ce.hexNames=Yx(zc);function Yx(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function x3(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function je(e,t){Ux(e)&&(e="100%");var n=Kx(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function ao(e){return Math.min(1,Math.max(0,e))}function Nt(e){return parseInt(e,16)}function Ux(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Kx(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Pt(e){return e.length==1?"0"+e:""+e}function Fi(e){return e<=1&&(e=e*100+"%"),e}function D3(e){return Math.round(parseFloat(e)*255).toString(16)}function j3(e){return Nt(e)/255}var At=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",s="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+a),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+a),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+a),hsva:new RegExp("hsva"+s),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function pn(e){return!!At.CSS_UNIT.exec(e)}function Xx(e){e=e.replace(Dx,"").replace(jx,"").toLowerCase();var t=!1;if(zc[e])e=zc[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=At.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=At.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=At.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=At.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=At.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=At.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=At.hex8.exec(e))?{r:Nt(n[1]),g:Nt(n[2]),b:Nt(n[3]),a:j3(n[4]),format:t?"name":"hex8"}:(n=At.hex6.exec(e))?{r:Nt(n[1]),g:Nt(n[2]),b:Nt(n[3]),format:t?"name":"hex"}:(n=At.hex4.exec(e))?{r:Nt(n[1]+""+n[1]),g:Nt(n[2]+""+n[2]),b:Nt(n[3]+""+n[3]),a:j3(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=At.hex3.exec(e))?{r:Nt(n[1]+""+n[1]),g:Nt(n[2]+""+n[2]),b:Nt(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function qx(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const eD={info:g.object.isRequired},Bi=i.defineComponent({props:eD,emits:["tab","input"],setup(e,{emit:t}){const n=o=>{e.info.key==="a"&&t("tab",o)},a=o=>{const{key:l}=e.info,{value:d}=o.target;t("input",l,d)},{resolveClassName:s}=re(),r=i.computed(()=>ve({error:e.info.error},`${s("color-picker-input-value")}`));return()=>i.createVNode("div",{class:`${s("color-picker-input-part")}`},[i.createVNode("input",{type:e.info.name==="HEX"?"text":"number",class:r.value,value:e.info.value,onKeydown:n,onInput:a},null),i.createVNode("span",{class:`${s("color-picker-input-text")}`},[e.info.name])])}}),tD={colorObj:g.object.isRequired},nD=i.defineComponent({name:"ColorPicker",props:tD,emits:["change","tab"],setup(e,{emit:t}){const n=i.reactive({key:"hex",name:"HEX",value:e.colorObj.hex,error:!1}),a=i.reactive({key:"r",name:"R",value:e.colorObj.rgba.r.toString(),error:!1}),s=i.reactive({key:"g",name:"G",value:e.colorObj.rgba.g.toString(),error:!1}),r=i.reactive({key:"b",name:"B",value:e.colorObj.rgba.b.toString(),error:!1}),o=i.reactive({key:"a",name:"Alpha",value:e.colorObj.rgba.a.toString(),error:!1});i.watch(()=>e.colorObj,f=>{Ce(f.hex).toString()!==Ce(n.value).toString()&&(n.value=f.hex),a.value=f.rgba.r.toString(),s.value=f.rgba.g.toString(),r.value=f.rgba.b.toString(),o.value=f.rgba.a.toString(),c()},{deep:!0});const l=f=>{t("tab",f)},d=(f,h)=>{const m={r:a,g:s,b:r,a:o,hex:n};if(m[f].value=h,c()){const p=f==="hex"?n.value:`rgba(${a.value}, ${s.value}, ${r.value}, ${o.value})`;t("change",p)}},c=()=>{let f=!0;n.value.startsWith("#")&&(n.value.length===4||n.value.length===7)&&!n.value.slice(1).match(/[^0-9a-fA-F]/)?n.error=!1:(n.error=!0,f=!1),o.value!==""&&o.value>=0&&o.value<=1?o.error=!1:(o.error=!0,f=!1);for(const h of[a,s,r]){const{value:m}=h;m!==""&&m>=0&&m<=255?h.error=!1:(h.error=!0,f=!1)}return f},{resolveClassName:u}=re();return()=>i.createVNode("div",{class:`${u("color-picker-input")}`},[i.createVNode("div",{class:`${u("color-picker-input-hex")}`},[i.createVNode(Bi,{info:n,onInput:d},null)]),i.createVNode("div",{class:`${u("color-picker-input-rgba")}`},[i.createVNode(Bi,{info:a,onInput:d},null),i.createVNode(Bi,{info:s,onInput:d},null),i.createVNode(Bi,{info:r,onInput:d},null),i.createVNode(Bi,{info:o,onInput:d,onTab:l},null)])])}}),Vc=e=>{let t=e;e===""&&(t="#FFFFFF");const n=Ce(e),a=n.toHsl(),s=n.toHsv();return a.s===0&&(a.h=t.h||0,s.h=t.h||0),s.v<.0164&&(s.h=t.h||0,s.s=t.s||0),a.l<.01&&(a.h=t.h||0,a.s=t.s||0),{hsl:a,hsv:s,hex:n.toHexString().toUpperCase(),rgba:n.toRgb()}},nt=(e,t,n)=>e<t?t:e>n?n:e,Jc=(e,t)=>e.touches?e.touches[0][t]:0,O3=e=>{const{r:t,g:n,b:a,a:s}=e;return`rgba(${[t,n,a,s].join(",")})`},aD={colorObj:g.object.isRequired},iD=i.defineComponent({name:"ColorPicker",props:aD,emits:["change"],setup(e,{emit:t}){const n=i.ref(null),a=i.computed(()=>({left:`${e.colorObj.hsv.h/360*100}%`})),s=f=>{const{clientWidth:h}=n.value;let m=e.colorObj.hsv.h/360*h;const p=2,C=10;switch(f.code){case"ArrowLeft":f.preventDefault(),m=nt(m-p,0,h);break;case"ArrowRight":f.preventDefault(),m=nt(m+p,0,h);break;case"ArrowUp":f.preventDefault(),m=nt(m-C,0,h);break;case"ArrowDown":f.preventDefault(),m=nt(m+C,0,h);break;default:return}l(null,m)},r=f=>{n.value.focus(),l(f),window.addEventListener("mousemove",l,{passive:!0}),window.addEventListener("mouseup",o)},o=()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",o)},l=(f,h)=>{const{clientWidth:m}=n.value,p=h!==void 0?h:d(f);c(p/m)},d=f=>{const h=n.value.getBoundingClientRect().left+window.pageXOffset,m=f.pageX||Jc(f,"PageX");return nt(m-h,0,n.value.clientWidth)},c=f=>{const{h,s:m,l:p,a:C}=e.colorObj.hsl,N=f*360;h!==N&&t("change",{h:N,s:m,l:p,a:C})},{resolveClassName:u}=re();return()=>i.createVNode("div",{ref:n,tabindex:"0",class:`${u("color-picker-hue")}`,onKeydown:s,onMousedown:f=>{f.stopPropagation(),f.preventDefault(),r(f)}},[i.createVNode("div",{class:`${u("color-picker-hue-pointer")}`,style:a.value},[i.createVNode("div",{class:`${u("color-picker-hue-rectangle")}`},null)])])}}),sD={colorObj:g.object.isRequired,recommend:g.oneOfType([g.array.def(()=>[]),g.bool.def(!0)]).isRequired,recommendEmpty:g.bool.def(!0)},rD=i.defineComponent({props:sD,emits:["change","tab"],setup(e,{emit:t}){const n=i.ref(!1),a=i.ref(-1),s=i.ref(null);i.watch(()=>e.colorObj,()=>{a.value=-1,s.value=null},{deep:!0});const r=i.computed(()=>u(e.recommend)),{resolveClassName:o}=re(),l=(f,h)=>ve({[`${o("color-picker-empty")}`]:f==="",[`${o("color-picker-recommend-selected-color")}`]:n.value&&a.value===h},`${o("color-picker-recommend-color")}`),d=f=>{if(f.code==="Tab")t("tab",f);else{let h=0;const m=10,p=r.value.length-1;switch(f.code){case"ArrowLeft":f.preventDefault(),h=nt(a.value-1,0,p);break;case"ArrowRight":f.preventDefault(),h=nt(a.value+1,0,p);break;case"ArrowUp":f.preventDefault(),h=nt(a.value-m,0,p);break;case"ArrowDown":f.preventDefault(),h=nt(a.value+m,0,p);break;default:return}c(h)}},c=f=>{const h=r.value[f];t("change",h),i.nextTick(()=>{a.value=f,s.value=h})},u=f=>{if(f===!0){const h=["#ff4500","#ff8c00","#ffd700","#90ee90","#ddffff","#00ced1","#3a84ff","#a933f5","#db7093","#000000","#494949","#9B9B9B","#ffffff"];return e.recommendEmpty&&h.unshift(""),h}if(Array.isArray(f))return f.map(h=>Ce(h).isValid()?h:"")};return()=>i.createVNode("div",{tabindex:"0",class:`${o("color-picker-recommend")} `,onFocus:()=>n.value=!0,onBlur:()=>n.value=!1,onKeydown:d},[r.value.map((f,h)=>i.createVNode("div",{style:`background: ${f||"#fff"}`,class:l(f,h),onClick:()=>c(h)},[a.value===h?i.createVNode("div",{class:`${o("color-picker-pointer")}`},[i.createVNode("div",{class:`${o("color-picker-circle")}`},null)]):void 0]))])}}),oD={colorObj:g.object.isRequired},lD=i.defineComponent({props:oD,emits:["change"],setup(e,{emit:t}){const n=i.ref(null),a=i.computed(()=>({background:`hsl(${e.colorObj.hsv.h}, 100%, 50%)`})),s=i.computed(()=>({top:`${(1-e.colorObj.hsv.v)*100}%`,left:`${e.colorObj.hsv.s*100}%`})),r=m=>{n.value.focus(),d(m),window.addEventListener("mousemove",d,{passive:!0}),window.addEventListener("mouseup",o)},o=()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",o)},l=m=>{const{clientWidth:p,clientHeight:C}=n.value;let N=e.colorObj.hsv.s*p,v=(1-e.colorObj.hsv.v)*C;const I=10;switch(m.code){case"ArrowLeft":m.preventDefault(),N=nt(N-I,0,p);break;case"ArrowRight":m.preventDefault(),N=nt(N+I,0,p);break;case"ArrowUp":m.preventDefault(),v=nt(v-I,0,C);break;case"ArrowDown":m.preventDefault(),v=nt(v+I,0,C);break;default:return}d(null,N,v)},d=(m,p,C)=>{const{clientWidth:N,clientHeight:v}=n.value,I=p!==void 0?p:c(m),y=C!==void 0?C:u(m),b=I/N,w=1-y/v;f(e.colorObj.hsv.h,b,w,e.colorObj.hsv.a)},c=m=>{const p=n.value.getBoundingClientRect().left+window.pageXOffset,C=m.pageX||Jc(m,"PageX");return nt(C-p,0,n.value.clientWidth)},u=m=>{const p=n.value.getBoundingClientRect().top+window.pageYOffset,C=m.pageY||Jc(m,"PageY");return nt(C-p,0,n.value.clientHeight)},f=(m,p,C,N)=>{t("change",{h:m,s:p,v:C,a:N})},{resolveClassName:h}=re();return()=>i.createVNode("div",{ref:n,tabindex:"0",class:`${h("color-picker-saturation")}`,style:a.value,onKeydown:l,onMousedown:m=>{m.stopPropagation(),r(m)}},[i.createVNode("div",{class:`${h("color-picker-saturation-white")}`},null),i.createVNode("div",{class:`${h("color-picker-saturation-black")}`},null),i.createVNode("div",{class:`${h("color-picker-pointer")}`,style:s.value},[i.createVNode("div",{class:`${h("color-picker-circle")}`},null)])])}});var E3=function(e){return e.UNKNOWN="",e.SMALL="small",e.LARGE="large",e}(E3||{});const cD={modelValue:g.string.def(""),disabled:g.bool.def(!1),readonly:g.bool.def(!1),transfer:g.bool.def(!1),size:me("colorPickSize",{}).def(E3.UNKNOWN),showValue:g.bool.def(!0),recommend:g.oneOfType([g.array.def(()=>[]),g.bool.def(!0)]).def(!0),extCls:g.string.def(""),withValidate:g.bool.def(!0),recommendEmpty:g.bool.def(!0)},Gi=Vc("#FFFFFF"),P3=Me(i.defineComponent({name:"ColorPicker",directives:{clickoutside:_t},props:cD,emits:["update:modelValue","change"],setup(e,{emit:t,slots:n}){const a=kt(),s=i.ref(!1),r=i.ref(""),o=i.reactive(JSON.parse(JSON.stringify(Gi))),l=i.ref(null),d=i.ref(null),c=i.ref(null),{resolveClassName:u}=re(),f=i.computed(()=>ve({[`${u(`color-picker-${e.size}`)}`]:e.size,[`${u("color-picker-show-dropdown")}`]:s.value,[`${u("color-picker-show-value")}`]:e.showValue,[`${u("color-picker-disabled")}`]:e.disabled||e.readonly},`${u("color-picker")} ${e.extCls}`)),h=i.computed(()=>!!(e.recommend===!0||Array.isArray(e.recommend)&&e.recommend.length));i.onBeforeMount(()=>{b({isCreated:!0})}),i.watch(()=>e.modelValue,()=>{var S;b(),e.withValidate&&((S=a==null?void 0:a.validate)==null||S.call(a,"change"))});const m=S=>{S.code==="Enter"||S.code==="NumpadEnter"?C():S.code==="Escape"&&y()},p=S=>{e.transfer&&m(S)},C=()=>{e.disabled||e.readonly||(s.value?y():I())},N=S=>{h.value||(S.preventDefault(),d.value.$el.focus())},v=S=>{S.preventDefault(),d.value.$el.focus()},I=()=>{var S;s.value=!0,(S=l.value)==null||S.updateDropdown(),setTimeout(()=>{l.value.$el.querySelector(`.${u("color-picker-input-hex")} .${u("color-picker-input-value")}`).select()},100)},y=()=>{var S;s.value&&(i.nextTick(()=>c.value.focus()),s.value=!1,(S=l.value)==null||S.destoryDropdown(),b())},b=({isCreated:S=!1}={})=>{if(e.modelValue===""){r.value!==""&&(r.value="",Object.assign(o,Gi),t("update:modelValue",r.value));return}const L=Vc(e.modelValue),j=L.rgba.a===1?L.hex:O3(L.rgba);if(j!==r.value){const T=Ce(e.modelValue).isValid();S?T?(r.value=j.toLowerCase()===e.modelValue.toLowerCase()?e.modelValue:j,Object.assign(o,L)):(Object.assign(o,Gi),t("change","")):T?j.toLowerCase()!==r.value.toLowerCase()&&(Object.assign(o,L),r.value=j):(r.value="",Object.assign(o,Gi))}},w=S=>{if(S===""){r.value="",Object.assign(o,Gi),t("update:modelValue",""),t("change","");return}const L=Vc(S),j=L.rgba.a===1?L.hex:O3(L.rgba);r.value=j,Object.assign(o,L),t("update:modelValue",r.value),t("change",j)},M=()=>{s.value=!1};return()=>i.withDirectives(i.createVNode("div",{ref:c,tabindex:"0",class:f.value,onKeydown:m,onClick:C},[typeof n.trigger=="function"?n.trigger({value:r.value,isShowDropdown:s.value}):i.createVNode(i.Fragment,null,[i.createVNode("div",{class:`${u("color-picker-color")}`},[i.createVNode("span",{class:`${u("color-picker-color-square")} ${!r.value&&`${u("color-picker-empty")}`}`,style:`background: ${r.value||"#FFF"}`},null)]),e.showValue?i.createVNode("div",{class:`${u("color-picker-text")}`},[i.createVNode("span",null,[r.value])]):void 0,i.createVNode("div",{class:`${u("color-picker-icon")}`},[i.createVNode(Hn,{class:"icon-angle-down"},null)])]),i.createVNode(i.Transition,{name:"bk-fade-down-transition"},{default:()=>[i.withDirectives(i.createVNode(fc,{ref:l,triggerRef:c.value},{default:()=>[i.createVNode("div",{class:`${u("color-dropdown-container")}`},[i.createVNode("div",{class:`${u("color-picker-dropdown")}`,onClick:S=>{S.stopPropagation()},onMousedown:S=>{S.stopPropagation()},onKeydown:p},[i.createVNode(lD,{ref:d,colorObj:o,onChange:w},null),i.createVNode(iD,{colorObj:o,onChange:w},null),i.createVNode(nD,{colorObj:o,onTab:N,onChange:w},null),h.value?i.createVNode("div",{class:`${u("color-picker-recommend-container")}`},[i.createVNode(rD,{colorObj:o,recommend:e.recommend,recommendEmpty:e.recommendEmpty,onTab:v,onChange:w},null)]):void 0])])]}),[[i.vShow,s.value]])]})]),[[i.resolveDirective("clickoutside"),M]])}})),A3=Me(nS);var Rc=null;function dD(e){return Rc||(Rc=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return setTimeout(t,16)}).bind(window)),Rc(e)}var Qc=null;function uD(e){Qc||(Qc=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)}).bind(window)),Qc(e)}function fD(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}function io(e,t){t===void 0&&(t={});var n=document.createElement(e);return Object.keys(t).forEach(function(a){n[a]=t[a]}),n}function z3(e,t,n){var a=window.getComputedStyle(e,n||null)||{display:"none"};return a[t]}function $c(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if(z3(t,"display")==="none")return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var hD='.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}',_c=0,so=null;function gD(e,t){e.__resize_mutation_handler__||(e.__resize_mutation_handler__=yD.bind(e));var n=e.__resize_listeners__;if(!n){if(e.__resize_listeners__=[],window.ResizeObserver){var a=e.offsetWidth,s=e.offsetHeight,r=new ResizeObserver(function(){!e.__resize_observer_triggered__&&(e.__resize_observer_triggered__=!0,e.offsetWidth===a&&e.offsetHeight===s)||ro(e)}),o=$c(e),l=o.detached,d=o.rendered;e.__resize_observer_triggered__=l===!1&&d===!1,e.__resize_observer__=r,r.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){ro(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(_c||(so=fD(hD)),bD(e),e.__resize_rendered__=$c(e).rendered,window.MutationObserver){var c=new MutationObserver(e.__resize_mutation_handler__);c.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=c}}e.__resize_listeners__.push(t),_c++}function mD(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener){e.detachEvent("onresize",e.__resize_legacy_resize_handler__),document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);return}e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",Hc),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--_c&&so&&so.parentNode.removeChild(so)}}function pD(e){var t=e.__resize_last__,n=t.width,a=t.height,s=e.offsetWidth,r=e.offsetHeight;return s!==n||r!==a?{width:s,height:r}:null}function yD(){var e=$c(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(Wc(this),this.addEventListener("scroll",Hc,!0)),this.__resize_rendered__=t,ro(this))}function Hc(){var e=this;Wc(this),this.__resize_raf__&&uD(this.__resize_raf__),this.__resize_raf__=dD(function(){var t=pD(e);t&&(e.__resize_last__=t,ro(e))})}function ro(e){!e||!e.__resize_listeners__||e.__resize_listeners__.forEach(function(t){t.call(e,e)})}function bD(e){var t=z3(e,"position");(!t||t==="static")&&(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=io("div",{className:"resize-triggers"}),a=io("div",{className:"resize-expand-trigger"}),s=io("div"),r=io("div",{className:"resize-contract-trigger"});a.appendChild(s),n.appendChild(a),n.appendChild(r),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:a,expandChild:s,contract:r},Wc(e),e.addEventListener("scroll",Hc,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}function Wc(e){var t=e.__resize_triggers__,n=t.expand,a=t.expandChild,s=t.contract,r=s.scrollWidth,o=s.scrollHeight,l=n.offsetWidth,d=n.offsetHeight,c=n.scrollWidth,u=n.scrollHeight;s.scrollLeft=r,s.scrollTop=o,a.style.width=l+1+"px",a.style.height=d+1+"px",n.scrollLeft=c,n.scrollTop=u}var ht=(e=>(e.ALL="all",e.NEEDKEY="need-key",e))(ht||{});const V3=Symbol("SEARCH_SLECT_PROVIDER_KEY"),CD=e=>{i.provide(V3,e)},J3=()=>i.inject(V3);var Za=(e=>(e.DEFAULT="default",e.EDIT="edit",e))(Za||{}),Ya=(e=>(e.AND="&",e.OR="|",e))(Ya||{});class la{constructor(t,n="default"){ye(this,"id");ye(this,"name");ye(this,"values",[]);ye(this,"condition");ye(this,"logical");this.searchItem=t,this.type=n,this.id=t.id,this.name=t.name,this.logical=t.logical||"|"}get multiple(){return!!this.searchItem.multiple}get placeholder(){return this.searchItem.placeholder||""}get children(){return this.searchItem.children||[]}get validate(){return!this.searchItem.noValidate}get inputInnerHtml(){var t;return this.isSpecialType()?this.name:`${this.keyInnerHtml}${((t=this.values)==null?void 0:t.map(n=>n.name).join(` ${this.logical} `))||""}`}get inputInnerText(){var t;return this.isSpecialType()?this.name:`${this.keyInnerText}${((t=this.values)==null?void 0:t.map(n=>n.name).join(` ${this.logical} `))||""}`}get keyInnerHtml(){return this.isSpecialType()?this.name:this.name?`${this.name}: `:""}get keyInnerText(){return this.isSpecialType()?this.name:this.name?`${this.name}: `:""}get showLogical(){return!!this.searchItem.showLogicalPanel}isSpecialType(){return["text","condition"].includes(this.type)}addValue(t){if(this.multiple){const n=this.values.findIndex(a=>a.id===t.id);if(n>-1){this.values.splice(n,1);return}this.values.push(t);return}this.values=[t]}toValue(){var n;const t={id:this.id,name:this.name};return(n=this.values)!=null&&n.length&&(t.values=this.values.map(a=>({id:a.id,name:a.name})),this.multiple&&this.logical!=="|"&&(t.logical=this.logical)),this.type&&this.type!=="default"&&(t.type=this.type),t}toValueKey(){return JSON.stringify(this.toValue())}isInValueList(t){return this.children.some(n=>n.id===(t==null?void 0:t.id))}}const vD=i.defineComponent({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:()=>[]},conditions:{type:Array},footerBtns:{type:Array,default:()=>[]},showLogical:{type:Boolean,default:!0},logical:{type:String,default:Ya.OR}},emits:["selectItem","selectCondition","footerClick","update:logical"],setup(e,{emit:t}){const n=ke("searchSelect"),{resolveClassName:a}=re(),s=i.computed(()=>e.footerBtns===void 0||e.footerBtns.length===0?[{id:"confirm",name:n.value.ok},{id:"cancel",name:n.value.cancel,disabled:!1}]:e.footerBtns);function r(m){t("selectItem",m)}function o(m){t("selectCondition",m)}function l(m){t("footerClick",m)}const d=i.computed(()=>{var m,p;return(m=e.list)!=null&&m.length?(p=e.keyword)!=null&&p.length?e.list.filter(C=>C.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())):e.list:[]});function c(m){if(!m)return m;let{keyword:p}=e;const C=p.length;if(!(p!=null&&p.trim().length)||!m.toLocaleLowerCase().includes(p.toLocaleLowerCase()))return m;const N=[];let v=-1;return p=p.replace(/([.*/]{1})/gim,"\\$1"),m.replace(new RegExp(`${p}`,"igm"),(I,y)=>(N.length===0&&y!==0?N.push(m.slice(0,y)):v>=0&&N.push(m.slice(v+I.length,y)),N.push(i.createVNode("span",{class:"is-keyword"},[I])),v=y,I)),v>=0&&N.push(m.slice(v+C)),N.length?N:m}function u(m){var p;return(p=m.value)!=null&&p.name?[i.createVNode("span",{class:"menu-name"},[m.name,i.createTextVNode(":")]),m.value.name]:c(m.name)}function f(m,p){m.stopPropagation(),m.preventDefault(),r(p)}function h(m){t("update:logical",m)}return{handleClick:r,handleClickCondition:o,handleClickFooterBtn:l,handleSelectedChange:f,handleLogicalChange:h,filterList:d,getSearchNode:u,localFooterBtns:s,resolveClassName:a,t:n}},render(){var n,a;const e=i.createVNode("ul",{class:"menu-content"},[(n=this.list)==null?void 0:n.map(s=>i.createVNode("li",{class:`menu-item ${s.disabled?"is-disabled":""} ${this.hoverId===s.id&&!s.disabled?"is-hover":""}`,key:s.id,id:s.id,tabindex:"-1",onClick:()=>!s.disabled&&this.handleClick(s)},[this.$slots.default?this.$slots.default({item:s,list:this.list,multiple:!!this.multiple,hoverId:this.hoverId,getSearchNode:this.getSearchNode}):i.createVNode(i.Fragment,null,[this.multiple&&i.createVNode("span",{onClick:r=>this.handleSelectedChange(r,s)},[i.createVNode(ct,{modelValue:this.selected.includes(s.id),class:"is-selected"},null)]),this.getSearchNode(s)])]))]),t=()=>!this.showLogical||!this.multiple?e:i.createVNode("div",{class:"menu-content-wrapper"},[e,i.createVNode("div",{class:"menu-condition"},[i.createVNode("div",{class:"menu-condition-title"},[this.t.logical]),i.createVNode(pr,{modelValue:this.logical,onChange:this.handleLogicalChange,label:"|"},{default:()=>[this.t.or,i.createTextVNode(" |")]}),i.createVNode(pr,{modelValue:this.logical,onChange:this.handleLogicalChange,label:"&"},{default:()=>[this.t.and,i.createTextVNode(" &")]})])]);return i.createVNode("div",{class:this.resolveClassName("search-select-menu")},[!!((a=this.conditions)!=null&&a.length)&&i.createVNode("ul",{class:"menu-header"},[this.conditions.map(s=>i.createVNode("li",{key:s.id,class:`menu-header-item ${s.disabled?"is-disabled":""}`,onClick:()=>!s.disabled&&this.handleClickCondition(s)},[s.name]))]),t()])}}),R3=i.defineComponent({name:"SearchSelectInput",directives:{clickoutside:_t},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:()=>[]},defautUsingItem:Object,mode:{type:String,default:Za.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup(e,{emit:t,expose:n}){const a=ke("searchSelect"),{resolveClassName:s}=re(),r=i.ref(null),o=i.ref(null),l=i.ref(""),d=i.ref(!1),c=i.ref(!1),u=i.ref(!1),f=i.ref(e.defautUsingItem),h=i.ref(""),m=i.ref(!1),p=wa(300,ie);let C=!1;const N=i.ref([]),v=i.ref([]),{editKey:I,onValidate:y}=J3(),b=i.computed(()=>{var O;return((O=f.value)==null?void 0:O.logical)||Ya.OR});i.watch(I,()=>{e.mode===Za.DEFAULT&&I.value&&(u.value=!1)}),i.watchEffect(()=>{l.value||k()},{flush:"pre"}),i.watch([v,u],()=>{var O;(O=v.value)!=null&&O.some(R=>!R.disabled)&&u.value?C||(e.valueBehavior===ht.NEEDKEY?h.value=v.value.find(R=>!R.disabled).id:h.value="",C=!0,document.addEventListener("keydown",w)):(document.removeEventListener("keydown",w),C=!1,e.valueBehavior!==ht.NEEDKEY&&(h.value=""))});function w(O){switch(O.code){case"ArrowDown":case"ArrowUp":M(O);break;case"Enter":case"NumpadEnter":S(O);break}}function M(O){var G;O.preventDefault(),(G=r.value)==null||G.blur();const R=v.value.length;let B=R,K=v.value.findIndex(te=>te.id===h.value);for(;B>=0;){K=O.code==="ArrowDown"?K+1:K-1,K=K>R-1?0:K<0?R-1:K;const te=v.value[K];if(te&&!te.disabled){B=-1;const F=document.getElementById(te.id);F==null||F.focus(),h.value=te.id;return}B-=1}}function S(O){if(C){O.preventDefault();const R=v.value.find(B=>B.id===h.value);R&&E(R)}}function L(O){var R,B,K,G,te;if(!((R=o.value)!=null&&R.contains(O.target))&&((B=e.clickOutside)!=null&&B.call(e,O.target,o.value))){if((G=(K=f.value)==null?void 0:K.values)!=null&&G.length&&((te=f.value)!=null&&te.multiple)){l.value="",J();return}u.value=!1,c.value=!1,t("focus",c.value)}}function j(O){Z(),O&&ie()}function T(O){var B,K,G,te,F,D,x,$,q;Y();let R=O.target.innerText;if(/(\r|\n)/gm.test(R)||/\s{2}/gm.test(R))O.preventDefault(),R=R.replace(/(\r|\n)/gm,` ${b.value} `).replace(/\s{2}/gm,""),r.value.innerText=R,Z(),l.value=R.replace(((B=f.value)==null?void 0:B.keyInnerText)||"","").trim(),p();else if(!l.value&&R.length<(((G=(K=f.value)==null?void 0:K.inputInnerText)==null?void 0:G.length)||1)){const W=R.replace(" "," ").replace(((te=f.value)==null?void 0:te.keyInnerText.replace(" "," ").trim())||"","").trim();if(R&&((F=f.value)==null?void 0:F.keyInnerText)&&R.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&W&&((D=f.value.values)!=null&&D.length)){l.value=W,console.info("outerText",W),p();return}(W||!(R!=null&&R.length))&&(f.value=null),l.value=W?R:"",p()}else($=(x=f.value)==null?void 0:x.values)!=null&&$.length||(l.value=R.replace(" "," ").replace(((q=f.value)==null?void 0:q.keyInnerText.replace(" "," "))||"","").trim(),Z(),p())}function z(O){switch(O.code){case"Enter":case"NumpadEnter":if(e.valueBehavior===ht.NEEDKEY&&v.value.some(R=>R.id===h.value))return;J(O);break;case"Backspace":V();default:d.value=!1;break}}async function J(O){var K;if(O==null||O.preventDefault(),await new Promise(G=>setTimeout(G,0)),!f.value){if(!l.value||e.valueBehavior===ht.NEEDKEY)return;const G={id:l.value,name:l.value};if(!await Q(G))return;t("add",new la(G,"text")),l.value="",ie();return}const{values:R}=f.value;if(!(R!=null&&R.length)){if((K=l.value)!=null&&K.length){if(l.value.includes(b.value)){const G=l.value.split(b.value);if(!await Q({id:l.value,name:l.value}))return;G.forEach(F=>f.value.addValue({id:F,name:F}))}else{const G={id:l.value,name:l.value};if(!await Q(G))return;f.value.addValue(G)}t("add",f.value),l.value="",f.value=null,Z(!0);return}d.value=!0;return}if(l.value){const G={id:l.value,name:l.value};if(!await Q(G))return;f.value.addValue(G),t("add",f.value),l.value="",f.value=null,Z(!0);return}await Q()&&H()}function V(){var O,R;if(!f.value&&!l.value){t("delete"),i.nextTick(ie);return}if((O=f.value)!=null&&O.values.length){if((R=f.value)!=null&&R.multiple||f.value.isInValueList(f.value.values[0])||e.mode===Za.EDIT&&!l.value){f.value.values.splice(-1,1),l.value="",Z();return}}else l.value||(f.value=null,l.value="",ie());y("")}async function E(O,R){var K,G,te,F;if((K=O.value)!=null&&K.id){if(e.valueBehavior===ht.NEEDKEY&&O.value||!e.validateValues){const x=new la({...O,id:O.realId??O.id},R);x.addValue(O.value),H(x),e.valueBehavior===ht.NEEDKEY&&h.value&&Z(!0),h.value="";return}if(f.value=new la({...O,id:O.realId??O.id},R),f.value.addValue(O.value),!await Q(O.value)){f.value=null;return}H(f.value),h.value="",Z(!0);return}if(!f.value||!((G=r==null?void 0:r.value)!=null&&G.innerText)){f.value=new la(O,R),l.value="";const D=R==="condition";D&&H(),u.value=D||!!f.value.children.length,Z(e.valueBehavior===ht.NEEDKEY&&!!h.value);return}if(((te=f.value)==null?void 0:te.type)==="condition"){f.value=new la(O,R),H();return}f.value.addValue(O),await Q(O)&&(f.value.multiple||H(),e.valueBehavior===ht.NEEDKEY&&((F=f.value)!=null&&F.multiple)&&Z())}function P(O){E(O,"condition")}function _(O){var R;switch(O.id){case"confirm":if(!((R=f.value)!=null&&R.values.length))return;l.value="",J();break;case"cancel":f.value.values=[],u.value=!1;break}}async function Q(O){if(!f.value)return await U(null,[O]);const{searchItem:R,validate:B,values:K}=f.value;return B&&typeof e.validateValues=="function"?await U(R,O?[O]:K):(y(""),!0)}async function U(O,R){var K;const B=await((K=e.validateValues)==null?void 0:K.call(e,O??null,R).catch(()=>!1));return typeof B=="string"||B===!1?(y(B||"校验错误"),!1):(y(""),!0)}function Z(O=!1){O&&setTimeout(()=>{ie()},16),c.value=!0,u.value=!0,d.value=!1;const R=setTimeout(()=>{if(r.value){r.value.focus();const B=window.getSelection();B.focusOffset===0&&(B.selectAllChildren(r.value),B.collapseToEnd())}window.clearTimeout(R)},0);t("focus",c.value)}async function ie(){var R,B,K,G,te;let O=[];if(typeof e.getMenuList=="function"&&(typeof((B=(R=f.value)==null?void 0:R.searchItem)==null?void 0:B.async)>"u"||f.value.searchItem.async===!0)?(m.value=!0,O=await e.getMenuList((K=f.value)==null?void 0:K.searchItem,l.value).catch(()=>[]),m.value=!1):f!=null&&f.value?f.value.type==="condition"?O=e.conditions:(!((te=f.value.values)!=null&&te.length)||f.value.multiple||e.mode===Za.EDIT)&&(O=f.value.children.filter(F=>F.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase()))):(G=l.value)!=null&&G.length?e.data.filter(F=>!F.isSelected).forEach(F=>{var x,$;if(F.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase())){O.push(F);const q=[];(x=F.children)==null||x.forEach(W=>{q.push({...F,realId:F.id,id:yn(10),value:W})}),!q.length&&!F.onlyRecommendChildren&&q.push({...F,realId:F.id,id:yn(10),value:{id:l.value,name:l.value}}),O.push(...q)}else{const q=[];($=F.children)==null||$.forEach(W=>{W.name.toLocaleLowerCase().includes(l.value.toLocaleLowerCase())&&q.push({...F,realId:F.id,id:yn(10),value:W})}),!q.length&&!F.onlyRecommendChildren&&q.push({...F,value:{id:l.value,name:l.value}}),O.push(...q)}}):O=e.data.filter(F=>!F.isSelected).slice(),v.value=O,e.valueBehavior===ht.NEEDKEY){const F=O.find(D=>!D.disabled);F&&(!h.value||h.value&&!O.some(D=>D.id===h.value))&&(h.value=F.id)}}function H(O){t("add",O??f.value),f.value=null,l.value="",Z(e.valueBehavior===ht.NEEDKEY)}function Y(){const O=r.value.innerText;O[O.length-1]===`
|
362
362
|
`||O[0]==="\r"?(k(O.slice(0,-1)),Y()):(O[0]===`
|
363
363
|
`||O[0]==="\r")&&(k(O.slice(1)),Y())}function k(O=""){var R;r.value&&(r.value.innerHTML=O||((R=f.value)==null?void 0:R.inputInnerHtml)||"")}function A(O){f.value&&(f.value.logical=O)}return n({handleInputFocus:j,isFocus:c}),{popoverRef:o,inputRef:r,keyword:l,loading:m,remoteMenuList:N,menuList:v,menuHoverId:h,isFocus:c,usingItem:f,showPopover:u,showNoSelectValueError:d,debounceSetMenuList:p,documentArrowEvent:M,handleClickOutside:L,handleInputFocus:j,handleInputChange:T,handleLogicalChange:A,handleInputKeyup:z,handleSelectItem:E,handleSelectCondtionItem:P,handleMenuFooterClick:_,resolveClassName:s,t:a}},render(){var u,f;const{multiple:e,values:t,placeholder:n,inputInnerHtml:a}=this.usingItem||{},s=!((u=this.keyword)!=null&&u.length)&&!(t!=null&&t.length)&&n,r=this.loading||this.showNoSelectValueError||this.showPopover&&!!((f=this.menuList)!=null&&f.length),o=!this.usingItem&&this.showCondition,l=Object.assign({},this.$slots.menu?{default:h=>{var m,p;return(p=(m=this.$slots).menu)==null?void 0:p.call(m,h)}}:{}),d=()=>{var h;return i.withDirectives(i.createVNode("div",{ref:"inputRef",class:{"div-input":!0,"input-before":this.showInputBefore&&!((h=this.keyword)!=null&&h.length),"input-after":s},contenteditable:!0,"data-placeholder":!a&&!this.keyword?this.placeholder:"","data-tips":n||"",spellcheck:"false",onFocus:this.handleInputFocus,onInput:this.handleInputChange,onKeydown:this.handleInputKeyup},null),[[i.resolveDirective("clickoutside"),this.handleClickOutside]])},c=()=>{var h,m,p;return this.loading?i.createVNode("div",null,[this.t.loading]):this.showNoSelectValueError?i.createVNode("div",null,[this.t.filterQueryMustHasValue]):(h=this.menuList)!=null&&h.length?i.createVNode("div",{ref:"popoverRef",class:this.resolveClassName("search-select-popover")},[i.createVNode(vD,{list:this.menuList,keyword:this.keyword,multiple:!!e,hoverId:this.menuHoverId,selected:(t==null?void 0:t.map(C=>C.id))||[],conditions:o?this.conditions:[],logical:(m=this.usingItem)==null?void 0:m.logical,showLogical:(p=this.usingItem)==null?void 0:p.showLogical,"onUpdate:logical":this.handleLogicalChange,onSelectItem:this.handleSelectItem,onSelectCondition:this.handleSelectCondtionItem,onFooterClick:this.handleMenuFooterClick},{...l})]):void 0};return i.createVNode(Xe,{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:r},{default:d,content:c})}}),ND=i.defineComponent({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:()=>[]},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup(e,{emit:t}){const n=i.ref(null),{onEditClick:a,onEditEnter:s,onEditBlur:r,editKey:o}=J3();function l(m){t("delete",m)}function d(m,p,C){m.preventDefault(),m.stopPropagation(),a(p,C),setTimeout(()=>n.value.handleInputFocus(),200)}function c(m,p){s(m,p)}function u(m){m||r()}function f(){return!0}function h(m){const p=new la(m.searchItem,m.type);return p.values=m.values.slice(),p.logical=m.logical||Ya.OR,p}return{inputRef:n,editKey:o,copySeletedItem:h,handleDeleteSelected:l,handleEditSeleted:d,handleInputOutside:f,handleAddSelected:c,handleInputFocus:u}},render(){const e=(t,n)=>this.editKey===`${t.id}_${n}`?i.createVNode("div",{class:"selected-input",key:this.editKey.toString()},[i.createVNode(R3,{ref:"inputRef",key:this.editKey.toString(),mode:Za.EDIT,data:this.data,showCondition:!1,conditions:this.conditions,defautUsingItem:this.copySeletedItem(t),clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:a=>this.handleAddSelected(a,n),onFocus:this.handleInputFocus},null)]):i.createVNode("li",{class:`search-container-selected ${(this.overflowIndex>=0?n<this.overflowIndex:n>=0)?"":"hidden-selected"}`,key:`${t.id}_${n}`},[i.createVNode("span",{class:"selected-name",onClick:a=>this.handleEditSeleted(a,t,n)},[t.inputInnerText]),i.createVNode(ot,{class:"selected-clear",onClick:()=>this.handleDeleteSelected(n)},null)]);return i.createVNode(i.Fragment,null,[this.selectedList.map((t,n)=>[this.overflowIndex>=0&&n===this.overflowIndex&&i.createVNode("div",{class:"search-container-selected overflow-selected"},[i.createTextVNode("+"),this.selectedList.length-this.overflowIndex]),e(t,n)])])}}),Fc=40,Q3=6,wD={data:{type:Array,default:()=>[]},modelValue:{type:Array,default:()=>[]},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:()=>[]},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:ht.ALL,validator(e){return[ht.ALL,ht.NEEDKEY].includes(e)}}},$3=Me(i.defineComponent({name:"SearchSelect",directives:{clickoutside:_t},props:wD,emits:["update:modelValue","search"],setup(e,{emit:t}){const n=ke("searchSelect"),{resolveClassName:a}=re(),s=i.computed(()=>e.conditions===void 0?[{id:"or",name:n.value.or},{id:"and",name:n.value.and}]:e.conditions),r=i.ref(null),o=i.ref(null),l=i.ref(!1),d=i.ref([]),c=i.ref(-1),u=wa(32,I),f=i.ref(""),h=i.ref(""),m=i.shallowRef([]);i.watch(()=>e.data,()=>{var T;m.value=JSON.parse(JSON.stringify(e.data)),(T=m.value)==null||T.forEach(z=>{z.isSelected=e.uniqueSelect&&!!e.modelValue.some(J=>J.id===z.id)})},{immediate:!0}),i.watch(()=>e.modelValue,T=>{var J;if(!(T!=null&&T.length)){d.value=[],(J=m.value)==null||J.forEach(V=>{V.isSelected=!1});return}const z=[];T.forEach(V=>{var P;const E=d.value.find(_=>_.id===V.id&&_.name===V.name);if((E==null?void 0:E.toValueKey())===JSON.stringify(V))E.values=V.values||[],E.logical=V.logical||Ya.OR,z.push(E);else{let _=e.data.find(Z=>Z.id===V.id),Q="default";_||(_=e.conditions.find(Z=>Z.id===V.id),_&&(Q="condition")),!_&&!((P=V.values)!=null&&P.length)&&(Q="text");const U=new la(_||V,Q);U.values=V.values||[],U.logical=V.logical||Ya.OR,z.push(U)}}),d.value=z,m.value=JSON.parse(JSON.stringify(e.data||[])),m.value.forEach(V=>{V.isSelected=e.uniqueSelect&&!!z.some(E=>E.id===V.id)})},{immediate:!0,deep:!0}),i.onMounted(()=>{gD(o.value.querySelector(`.${a("search-select-container")}`),u)}),i.onBeforeUnmount(()=>{mD(o.value.querySelector(`.${a("search-select-container")}`),u)}),CD({onEditClick:p,onEditEnter:C,onEditBlur:N,onValidate:v,editKey:f});function p(T,z){f.value=`${T.id}_${z}`}function C(T,z){const J=d.value.slice();J.splice(z,1,T),t("update:modelValue",J.map(V=>V.toValue())),f.value=""}function N(){f.value="",v("")}function v(T){h.value=T||""}function I(){if(l.value||d.value.length<1){c.value=-1;return}const T=o.value.querySelector(`.${a("search-select-container")}`),z=o.value.querySelector(".search-container").clientWidth-Q3-2,J=T.querySelectorAll(".search-container-selected:not(.overflow-selected)");let V=0,E=0,P=0;for(;E===0&&V<=z-Fc&&P<=J.length-1;){const _=J[P];if(_.clientHeight>e.minHeight){c.value=P;return}V+=_?_.clientWidth+Q3:0,V>=z-Fc&&(E=P),P+=1}if(E===J.length-1&&V<=z){c.value=-1;return}c.value=V>=z-Fc?E:E-1}function y(){f.value||r.value.handleInputFocus()}function b(){d.value=[],c.value=-1,t("update:modelValue",[])}function w(T){var z;return!((z=o.value)!=null&&z.contains(T))}function M(T){const z=d.value.slice();z.push(T),v(""),t("update:modelValue",z.map(J=>J.toValue()))}function S(T){const z=d.value.slice();z.splice(typeof T=="number"?T:d.value.length-1,1),v(""),t("update:modelValue",z.map(J=>J.toValue()))}function L(T){var z;T&&(c.value=-1),T===!1&&((z=o.value.querySelector(`.${a("search-select-container")}`))==null||z.scrollTo(0,0)),l.value=T}function j(T){t("search",T)}return{inputRef:r,wrapRef:o,isFocus:l,copyData:m,selectedList:d,overflowIndex:c,validateStr:h,onEditClick:p,onEditEnter:C,handleWrapClick:y,handleInputFocus:L,handleResize:I,handleClearAll:b,handleInputOutside:w,handleAddSelected:M,handleDeleteSelected:S,handleClickSearch:j,localConditions:s,resolveClassName:a,t:n}},render(){var a,s;const e=`${!this.shrink||this.isFocus?this.maxHeight:this.minHeight}px`,t=!!this.selectedList.length&&this.selectedList.slice(-1)[0].type!=="condition",n=Object.assign({},this.$slots.menu?{menu:r=>{var o,l;return(l=(o=this.$slots).menu)==null?void 0:l.call(o,r)}}:{});return i.createVNode("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[i.createVNode("div",{class:{[this.resolveClassName("search-select-container")]:!0,"is-focus":this.isFocus},onClick:this.handleWrapClick},[i.createVNode("div",{class:"search-prefix"},[(s=(a=this.$slots).prepend)==null?void 0:s.call(a)]),i.createVNode("div",{class:"search-container",style:{maxHeight:e}},[i.createVNode(ND,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},{...n}),i.createVNode("div",{class:"search-container-input"},[i.createVNode(R3,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:t,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},{...n})])]),i.createVNode("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&i.createVNode(rt,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():i.createVNode(Fn,{onClick:this.handleClickSearch,class:`search-nextfix-icon ${this.isFocus?"is-focus":""}`},null)])]),!!this.validateStr.length&&i.createVNode("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():i.createVNode(i.Fragment,null,[i.createVNode(Ni,{class:"select-tips"},null),this.validateStr||""])])])}}));function MD(){return me("trigger",{}).def("hover")}const ID={trigger:MD(),title:g.string.def(""),content:g.string.def(""),confirmText:g.string.def(""),cancelText:g.string.def(""),placement:g.oneOfType([ko().def(Na.TOP),g.string]).def(Na.TOP),theme:g.string.def("light "),icon:g.string.def(""),width:g.oneOfType([g.string,g.number]).def("auto")},_3=Me(i.defineComponent({name:"PopConfirm",components:{BkPopover:Xe,BkButton:Je},props:ID,emits:["confirm","cancel"],setup(e,{emit:t,slots:n}){const a=i.ref(!1),s=ke("popConfirm");function r(f){a.value=!1,t("confirm"),f.stopPropagation()}function o(f){a.value=!1,t("cancel"),f.stopPropagation()}function l(){return typeof n.icon=="function"?n.icon():e.icon}const d=l(),{resolveClassName:c}=re();return{popoverRef:i.ref(null),visible:a,t:s,icon:d,resolveClassName:c,ensure:r,cancel:o}},render(){return i.createVNode(Xe,{ref:"popoverRef",isShow:this.visible,trigger:this.trigger,theme:this.theme,width:this.width,onAfterShow:()=>this.visible=!0,extCls:`${this.resolveClassName("pop-confirm-box")}`},{default:()=>this.$slots.default(),content:()=>i.createVNode("div",{class:`${this.resolveClassName("pop-confirm")}`},[typeof this.$slots.content=="function"?this.$slots.content():i.createVNode(i.Fragment,null,[this.title?i.createVNode("div",{class:`${this.resolveClassName("pop-confirm-title")}`},[this.icon?i.createVNode("span",{class:`${this.resolveClassName("pop-confirm-icon")}`},[this.icon]):"",i.createVNode("span",null,[this.title])]):"",i.createVNode("div",{class:`${this.resolveClassName("pop-confirm-content")}`},[this.title?"":this.icon,this.content])]),i.createVNode("div",{class:`${this.resolveClassName("pop-confirm-footer")}`},[i.createVNode(Je,{onClick:this.ensure,size:"small",theme:"primary"},{default:()=>[this.confirmText||this.t.ok]}),i.createVNode(Je,{onClick:this.cancel,size:"small"},{default:()=>[this.cancelText||this.t.cancel]})])])})}})),Bc=Object.freeze(Object.defineProperty({__proto__:null,$bkPopover:Tl,Affix:Qu,Alert:Ju,AnimateNumber:Ru,Backtop:$u,Badge:_u,Breadcrumb:Wu,Button:Je,Card:Ff,Cascader:W9,Checkbox:ct,CodeDiff:M3,Collapse:Zf,ColorPicker:P3,ConfigProvider:zu,Container:Zr,DatePicker:M9,Dialog:Uf,Divider:N0,Dropdown:R9,Exception:mr,FixedNavbar:Xf,Form:J9,InfoBox:J0,Input:Un,Link:eh,Loading:vn,Menu:F0,Message:V0,Modal:Kn,Navigation:G0,Notify:Q0,OverflowTitle:kf,Pagination:oc,PopConfirm:_3,Popover:Xe,Popover2:th,Process:Y9,Progress:Di,Radio:pr,Rate:rh,ResizeLayout:G9,SearchSelect:$3,Select:Yl,Sideslider:Vh,Slider:B9,Steps:Qh,Swiper:oh,Switcher:$h,Tab:T0,Table:p0,Tag:$a,TagInput:v0,TimeLine:Z9,TimePicker:A3,Transfer:I9,Tree:O9,Upload:a3,VirtualRender:Qa,containerProps:Zr},Symbol.toStringTag,{value:"Module"})),H3=(e="Bk")=>(t,n)=>{const a=t.config.globalProperties.bkUIPrefix||e;Object.keys(Bc).forEach(s=>{const r=Bc[s];"install"in r?t.use(r,{prefix:a}):t.component(a+s,Bc[s])}),n&&zo(n)},LD={createInstall:H3,install:H3(),version:"0.0.1"};ge.$bkPopover=Tl,ge.Affix=Qu,ge.Alert=Ju,ge.AnimateNumber=Ru,ge.Backtop=$u,ge.Badge=_u,ge.Breadcrumb=Wu,ge.Button=Je,ge.Card=Ff,ge.Cascader=W9,ge.Checkbox=ct,ge.CodeDiff=M3,ge.Collapse=Zf,ge.ColorPicker=P3,ge.ConfigProvider=zu,ge.Container=Zr,ge.DatePicker=M9,ge.Dialog=Uf,ge.Divider=N0,ge.Dropdown=R9,ge.Exception=mr,ge.FixedNavbar=Xf,ge.Form=J9,ge.InfoBox=J0,ge.Input=Un,ge.Link=eh,ge.Loading=vn,ge.Menu=F0,ge.Message=V0,ge.Modal=Kn,ge.Navigation=G0,ge.Notify=Q0,ge.OverflowTitle=kf,ge.Pagination=oc,ge.PopConfirm=_3,ge.Popover=Xe,ge.Popover2=th,ge.Process=Y9,ge.Progress=Di,ge.Radio=pr,ge.Rate=rh,ge.ResizeLayout=G9,ge.SearchSelect=$3,ge.Select=Yl,ge.Sideslider=Vh,ge.Slider=B9,ge.Steps=Qh,ge.Swiper=oh,ge.Switcher=$h,ge.Tab=T0,ge.Table=p0,ge.Tag=$a,ge.TagInput=v0,ge.TimeLine=Z9,ge.TimePicker=A3,ge.Transfer=I9,ge.Tree=O9,ge.Upload=a3,ge.VirtualRender=Qa,ge.bkEllipsis=d8,ge.bkEllipsisInstance=zl,ge.bkTooltips=Tn,ge.clickoutside=_t,ge.containerProps=Zr,ge.default=LD,ge.defaultRootConfig=_n,ge.mousewheel=r8,ge.overflowTitle=Gv,ge.provideGlobalConfig=zo,ge.rootProviderKey=hi,ge.setPrefixVariable=Ao,ge.useGlobalConfig=X5,ge.useLocale=ke,ge.usePrefix=re,Object.defineProperties(ge,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
@@ -1899,9 +1899,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
1899
1899
|
function setInputFocus() {
|
1900
1900
|
var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
1901
1901
|
if (refleshMenuList) {
|
1902
|
-
(
|
1902
|
+
setTimeout(function () {
|
1903
1903
|
setMenuList();
|
1904
|
-
});
|
1904
|
+
}, 16);
|
1905
1905
|
}
|
1906
1906
|
isFocus.value = true;
|
1907
1907
|
showPopover.value = true;
|