@oiij/chrome-tabs 0.0.3 → 0.0.4

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 CHANGED
@@ -11,4 +11,4 @@ ${i}
11
11
 
12
12
  `)}function Ne(e){for(var t=0,n,o=0,i=e.length;i>=4;++o,i-=4)n=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Be(e,t,n,o){const{els:i}=t;if(n===void 0)i.forEach(Z),t.els=[];else{const l=q(n,o);l&&i.includes(l)&&(Z(l),t.els=i.filter(s=>s!==l))}}function K(e,t){e.push(t)}function Ie(e,t,n,o,i,l,s,u,f){let d;if(n===void 0&&(d=t.render(o),n=Ne(d)),f){f.adapter(n,d??t.render(o));return}u===void 0&&(u=document.head);const m=q(n,u);if(m!==null&&!l)return m;const c=m??ke(n);if(d===void 0&&(d=t.render(o)),c.textContent=d,m!==null)return m;if(s){const b=u.querySelector(`meta[name="${s}"]`);if(b)return u.insertBefore(c,b),K(t.els,c),c}return i?u.insertBefore(c,u.querySelector("style, link")):u.appendChild(c),K(t.els,c),c}function Me(e){return Ee(this,this.instance,e)}function Se(e={}){const{id:t,ssr:n,props:o,head:i=!1,force:l=!1,anchorMetaName:s,parent:u}=e;return Ie(this.instance,this,t,o,i,l,s,u,n)}function Ve(e={}){const{id:t,parent:n}=e;Be(this.instance,this,t,n)}const z=function(e,t,n,o){return{instance:e,$:t,props:n,children:o,els:[],render:Me,mount:Se,unmount:Ve}},_e=function(e,t,n,o){return Array.isArray(t)?z(e,{$:null},null,t):Array.isArray(n)?z(e,t,null,n):Array.isArray(o)?z(e,t,n,o):z(e,t,n,null)};function Ae(e={}){const t={c:(...n)=>_e(t,...n),use:(n,...o)=>n.install(t,...o),find:q,context:{},config:e};return t}function Re(e){const{namespace:t="n",blockPrefix:n=`.${t}-`,elementPrefix:o="__",modifierPrefix:i="--"}=e??{},l=Ae(),s=pe({blockPrefix:n,elementPrefix:o,modifierPrefix:i});return l.use(s),{namespace:t,blockPrefix:n,elementPrefix:o,modifierPrefix:i,cssr:l,plugin:s}}const ze="@css-render/vue3-ssr";function Le(e,t){return`<style cssr-id="${e}">
13
13
  ${t}
14
- </style>`}function Te(e,t,n){const{styles:o,ids:i}=n;i.has(e)||o!==null&&(i.add(e),o.push(Le(e,t)))}const je=typeof document<"u";function Pe(){if(je)return;const e=r.inject(ze,null);if(e!==null)return{adapter:(t,n)=>Te(t,n,e),context:e}}function Oe(e,t){const n=Pe();function o(){t.mount({id:e,head:!0,ssr:n})}n?o():r.onBeforeMount(()=>{o()})}const{cssr:De,plugin:We,namespace:ae}=Re(),{c:x,cB:L,cE:g,cM:O,cNotM:Y}={...De,...We},V=`${ae}-chrome-tabs`,$=`${ae}-chrome-tabs-item`,M="all .2s cubic-bezier(.4, 0, .2, 1)";function He(){return x([L("chrome-tabs",{display:"flex",width:"100%",height:"40px",padding:"0 10px",alignItems:"center",backgroundColor:"var(--background-color)",color:"var(--background-color-dark)"},[x(".group-move, .group-enter-active, .group-leave-active",{transition:M}),x(".group-enter-from, .group-leave-to",{opacity:0}),x(".group-leave-active",{}),g("prefix",{}),g("icon",{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",padding:"5px",borderRadius:"10px",backgroundColor:"var(--active-background-color)",transition:M},[x("svg",{width:"100%",height:"100%",fill:"currentColor"}),x("&:hover",{backgroundColor:"var(--primary-color)"})]),g("content",{flex:"1",height:"100%",minWidth:0,overflow:"hidden",marginLeft:"-6px",padding:"0 10px"}),g("scroll",{position:"relative",display:"flex",alignItems:"center",height:"100%"},[g("icon",{marginLeft:"5px",borderRadius:"50%",backgroundColor:"transparent",flexShrink:0},[x("&:hover",{backgroundColor:"var(--primary-color)"})])]),g("suffix",{})]),L("chrome-tabs-item",{position:"relative",margin:"0 -5px",height:"100%",flexShrink:0,cursor:"default",userSelect:"none",padding:"6px 10px 0px 10px"},[O("disabled",{cursor:"not-allowed",pointerEvents:"none",opacity:.5,filter:"grayscale(0.5)"}),O("active",[g("background",{opacity:1})]),Y("active",[x("&:hover",{},[g("content",{backgroundColor:"var(--primary-color)"})])]),x("&::first-child",{marginLeft:"0 !important"}),x("&::last-child",{marginRight:"0 !important"}),g("content",{position:"relative",zIndex:1,height:"28px",display:"flex",alignItems:"center",gap:"5px",borderRadius:"10px",padding:"0 10px",transition:M}),g("slot",{}),g("icon",{},[x("svg",{width:"1.2em",height:"1.2em",fill:"currentColor"})]),g("close",{width:"16px",height:"16px",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:M},[x("&:hover",{backgroundColor:"rgba(0,0,0,0.1)"}),x("svg",{width:"100%",height:"100%",fill:"currentColor"})]),g("background",{position:"absolute",opacity:0,left:0,bottom:0,zIndex:0,height:"34px",width:"100%",display:"flex",alignItems:"flex-end",transition:M},[g("block",{height:"100%",flex:1,minWidth:0,borderRadius:"10px 10px 0 0",backgroundColor:"var(--active-background-color)"}),x("svg",{fill:"var(--active-background-color)"})]),g("line",{position:"absolute",bottom:"12px",right:"4px",height:"16px",width:"2px",borderRadius:"1px",transition:M,backgroundColor:"var(--primary-color)",opacity:0},[O("show",{opacity:1})])]),x(".dark",[L("chrome-tabs",{backgroundColor:"var(--background-color-dark)",color:"var(--background-color)"},[g("icon",{backgroundColor:"var(--active-background-color-dark)"},[x("&:hover",{backgroundColor:"var(--primary-color-dark)"})])]),L("chrome-tabs-item",{},[Y("active",[x("&:hover",{},[g("content",{backgroundColor:"var(--primary-color-dark)"})])]),g("background",{},[g("block",{backgroundColor:"var(--active-background-color-dark)"}),x("svg",{fill:"var(--active-background-color-dark)"})])])])])}const P=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},Fe={name:"LineMdLoadingTwotoneLoop"},qe={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ge(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",qe,t[0]||(t[0]=[r.createStaticVNode('<g fill="none" stroke="#757575" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"></animate><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"></animateTransform></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity=".3" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"></animate></path></g>',1)]))}const Ze=P(Fe,[["render",Ge]]),Ue={name:"RiCloseLine"},Ke={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ye(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Ke,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)]))}const Je=P(Ue,[["render",Ye]]),ce=r.defineComponent({__name:"TabItem",props:{label:{type:[String,Function]},icon:{type:Function},closable:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},loadingIcon:{type:Function},onClick:{type:Function},onContextMenu:{type:Function},onClose:{type:Function},activeIndex:{default:0},index:{}},emits:["itemClick","itemContextmenu","itemClose"],setup(e,{emit:t}){const n=t,o=r.computed(()=>e.activeIndex!==e.index&&e.activeIndex!==e.index-1),i=r.computed(()=>e.activeIndex===e.index),l=r.computed(()=>typeof e.label=="string"?r.h("span",{class:`${$}__label`},e.label):e.label),s=r.computed(()=>e.loadingIcon??r.h(Ze));function u(m){m.stopPropagation(),n("itemClick",m),e.onClick?.(m)}function f(m){n("itemContextmenu",m),e.onContextMenu?.(m)}function d(){n("itemClose"),e.onClose?.()}return(m,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref($),{[`${r.unref($)}--active`]:i.value,[`${r.unref($)}--disabled`]:m.disabled}]),onClick:u,onContextmenu:f},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__content`])},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__icon`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.loading?s.value:m.icon)))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__slot`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value)))],2),m.closable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref($)}__close`]),onClick:r.withModifiers(d,["stop"])},[r.createVNode(Je)],2)):r.createCommentVNode("",!0)],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__background`])},[c[0]||(c[0]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z"})],-1)),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__block`])},null,2),c[1]||(c[1]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z"})],-1))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__line`,o.value?`${r.unref($)}__line--show`:""])},null,2)],34))}});function de(e){return r.getCurrentScope()?(r.onScopeDispose(e),!0):!1}const Qe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xe=Object.prototype.toString,et=e=>Xe.call(e)==="[object Object]",J=()=>{};function tt(e,t){function n(...o){return new Promise((i,l)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(l)})}return n}function nt(e,t={}){let n,o,i=J;const l=f=>{clearTimeout(f),i(),i=J};let s;return f=>{const d=r.toValue(e),m=r.toValue(t.maxWait);return n&&l(n),d<=0||m!==void 0&&m<=0?(o&&(l(o),o=void 0),Promise.resolve(f())):new Promise((c,b)=>{i=t.rejectOnCancel?b:c,s=f,m&&!o&&(o=setTimeout(()=>{n&&l(n),o=void 0,c(s())},m)),n=setTimeout(()=>{o&&l(o),o=void 0,c(f())},d)})}}function j(e){return Array.isArray(e)?e:[e]}function ot(e){return r.getCurrentInstance()}function rt(e,t=200,n={}){return tt(nt(t,n),e)}function it(e,t=!0,n){ot()?r.onMounted(e,n):t?e():r.nextTick(e)}function lt(e,t,n){return r.watch(e,t,{...n,immediate:!0})}const G=Qe?window:void 0;function B(e){var t;const n=r.toValue(e);return(t=n?.$el)!=null?t:n}function st(...e){const t=[],n=()=>{t.forEach(u=>u()),t.length=0},o=(u,f,d,m)=>(u.addEventListener(f,d,m),()=>u.removeEventListener(f,d,m)),i=r.computed(()=>{const u=j(r.toValue(e[0])).filter(f=>f!=null);return u.every(f=>typeof f!="string")?u:void 0}),l=lt(()=>{var u,f;return[(f=(u=i.value)==null?void 0:u.map(d=>B(d)))!=null?f:[G].filter(d=>d!=null),j(r.toValue(i.value?e[1]:e[0])),j(r.unref(i.value?e[2]:e[1])),r.toValue(i.value?e[3]:e[2])]},([u,f,d,m])=>{if(n(),!u?.length||!f?.length||!d?.length)return;const c=et(m)?{...m}:m;t.push(...u.flatMap(b=>f.flatMap(E=>d.map(a=>o(b,E,a,c)))))},{flush:"post"}),s=()=>{l(),n()};return de(n),s}function ut(){const e=r.shallowRef(!1),t=r.getCurrentInstance();return t&&r.onMounted(()=>{e.value=!0},t),e}function at(e){const t=ut();return r.computed(()=>(t.value,!!e()))}function ct(e,t,n={}){const{window:o=G,...i}=n;let l;const s=at(()=>o&&"ResizeObserver"in o),u=()=>{l&&(l.disconnect(),l=void 0)},f=r.computed(()=>{const c=r.toValue(e);return Array.isArray(c)?c.map(b=>B(b)):[B(c)]}),d=r.watch(f,c=>{if(u(),s.value&&o){l=new ResizeObserver(t);for(const b of c)b&&l.observe(b,i)}},{immediate:!0,flush:"post"}),m=()=>{u(),d()};return de(m),{isSupported:s,stop:m}}function dt(e,t={width:0,height:0},n={}){const{window:o=G,box:i="content-box"}=n,l=r.computed(()=>{var c,b;return(b=(c=B(e))==null?void 0:c.namespaceURI)==null?void 0:b.includes("svg")}),s=r.shallowRef(t.width),u=r.shallowRef(t.height),{stop:f}=ct(e,([c])=>{const b=i==="border-box"?c.borderBoxSize:i==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(o&&l.value){const E=B(e);if(E){const a=E.getBoundingClientRect();s.value=a.width,u.value=a.height}}else if(b){const E=j(b);s.value=E.reduce((a,{inlineSize:v})=>a+v,0),u.value=E.reduce((a,{blockSize:v})=>a+v,0)}else s.value=c.contentRect.width,u.value=c.contentRect.height},n);it(()=>{const c=B(e);c&&(s.value="offsetWidth"in c?c.offsetWidth:t.width,u.value="offsetHeight"in c?c.offsetHeight:t.height)});const d=r.watch(()=>B(e),c=>{s.value=c?t.width:0,u.value=c?t.height:0});function m(){f(),d()}return{width:s,height:u,stop:m}}function ft(e){const{activeClassName:t=".active",enableWheel:n=!0,direction:o="vertical"}=e??{},i=r.ref(),{width:l,height:s}=dt(i);async function u(m){await r.nextTick();const c=i.value?.querySelector(t);c&&c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest",...m})}function f(m){if(!n)return;m.preventDefault();const{deltaY:c}=m;switch(o){case"vertical":i.value?.scrollBy({top:c>0?s.value:-s.value,behavior:"smooth"});break;case"horizontal":i.value?.scrollBy({left:c>0?l.value:-l.value,behavior:"smooth"});break}}st(i,"wheel",f);const d=rt(u,500);return r.watch([l,s],()=>{d()}),{scrollRef:i,scrollToView:u}}var mt={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},y=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},w=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},fe=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Q=function(e){return{r:w(e.r,0,255),g:w(e.g,0,255),b:w(e.b,0,255),a:w(e.a)}},D=function(e){return{r:y(e.r),g:y(e.g),b:y(e.b),a:y(e.a,3)}},ht=/^#([0-9a-f]{3,8})$/i,T=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},me=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),s=l-Math.min(t,n,o),u=s?l===t?(n-o)/s:l===n?2+(o-t)/s:4+(t-n)/s:0;return{h:60*(u<0?u+6:u),s:l?s/l*100:0,v:l/255*100,a:i}},he=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),s=o*(1-n),u=o*(1-(t-l)*n),f=o*(1-(1-t+l)*n),d=l%6;return{r:255*[o,u,s,s,f,o][d],g:255*[f,o,o,u,s,s][d],b:255*[s,s,f,o,o,u][d],a:i}},X=function(e){return{h:fe(e.h),s:w(e.s,0,100),l:w(e.l,0,100),a:w(e.a)}},ee=function(e){return{h:y(e.h),s:y(e.s),l:y(e.l),a:y(e.a,3)}},te=function(e){return he((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},_=function(e){return{h:(t=me(e)).h,s:(i=(200-(n=t.s))*(o=t.v)/100)>0&&i<200?n*o/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,o,i},pt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ne={string:[[function(e){var t=ht.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?y(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?y(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=bt.exec(e)||gt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Q({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=pt.exec(e)||vt.exec(e);if(!t)return null;var n,o,i=X({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(mt[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return te(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=i===void 0?1:i;return N(t)&&N(n)&&N(o)?Q({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=X({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return te(s)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=function(u){return{h:fe(u.h),s:w(u.s,0,100),v:w(u.v,0,100),a:w(u.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return he(s)},"hsv"]]},oe=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},xt=function(e){return typeof e=="string"?oe(e.trim(),ne.string):typeof e=="object"&&e!==null?oe(e,ne.object):[null,void 0]},W=function(e,t){var n=_(e);return{h:n.h,s:w(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},re=function(e,t){var n=_(e);return{h:n.h,s:n.s,l:w(n.l+100*t,0,100),a:n.a}},ie=function(){function e(t){this.parsed=xt(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return y(H(this.rgba),2)},e.prototype.isDark=function(){return H(this.rgba)<.5},e.prototype.isLight=function(){return H(this.rgba)>=.5},e.prototype.toHex=function(){return t=D(this.rgba),n=t.r,o=t.g,i=t.b,s=(l=t.a)<1?T(y(255*l)):"","#"+T(n)+T(o)+T(i)+s;var t,n,o,i,l,s},e.prototype.toRgb=function(){return D(this.rgba)},e.prototype.toRgbString=function(){return t=D(this.rgba),n=t.r,o=t.g,i=t.b,(l=t.a)<1?"rgba("+n+", "+o+", "+i+", "+l+")":"rgb("+n+", "+o+", "+i+")";var t,n,o,i,l},e.prototype.toHsl=function(){return ee(_(this.rgba))},e.prototype.toHslString=function(){return t=ee(_(this.rgba)),n=t.h,o=t.s,i=t.l,(l=t.a)<1?"hsla("+n+", "+o+"%, "+i+"%, "+l+")":"hsl("+n+", "+o+"%, "+i+"%)";var t,n,o,i,l},e.prototype.toHsv=function(){return t=me(this.rgba),{h:y(t.h),s:y(t.s),v:y(t.v),a:y(t.a,3)};var t},e.prototype.invert=function(){return C({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),C(W(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),C(W(this.rgba,-t))},e.prototype.grayscale=function(){return C(W(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),C(re(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),C(re(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?C({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):y(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=_(this.rgba);return typeof t=="number"?C({h:t,s:n.s,l:n.l,a:n.a}):y(n.h)},e.prototype.isEqual=function(t){return this.toHex()===C(t).toHex()},e}(),C=function(e){return e instanceof ie?e:new ie(e)};const yt={name:"RiAddLine"},kt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function $t(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",kt,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)]))}const Ct=P(yt,[["render",$t]]),wt={name:"RiArrowDropDownLine"},Et={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Nt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Et,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414z"},null,-1)]))}const Bt=P(wt,[["render",Nt]]),It=r.defineComponent({__name:"Tabs",props:r.mergeModels({colors:{},dropdown:{type:Boolean},addable:{type:Boolean},options:{}},{value:{},valueModifiers:{}}),emits:r.mergeModels(["click","contextmenu","close","add"],["update:value"]),setup(e,{emit:t}){const n=t;Oe("n-chrome-tabs",He());const{background:o="#E5E7EB",active:i="#fff",primary:l="rgba(251,191,36,1)"}=e.colors??{},s=r.useModel(e,"value"),u=r.computed(()=>e.options?.findIndex(h=>h.key===s.value)),{scrollRef:f,scrollToView:d}=ft({activeClassName:`.${$}--active`,direction:"horizontal"});r.watch(s,()=>{d()},{immediate:!0});const m=r.computed(()=>C(o).darken(.9).toHex()),c=r.computed(()=>C(i).darken(.8).toHex()),b=r.computed(()=>C(l).darken(.3).toHex());function E(h){n("click",h)}function a(h){n("contextmenu",h)}function v(h){n("close",h)}return(h,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(V)]),style:r.normalizeStyle({"--background-color":`${r.unref(o)}`,"--background-color-dark":`${m.value}`,"--active-background-color":`${r.unref(i)}`,"--active-background-color-dark":`${c.value}`,"--primary-color":`${r.unref(l)}`,"--primary-color-dark":`${b.value}`})},[h.dropdown?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(V)}__icon`])},[r.createVNode(Bt)],2)):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"prefix"),r.createElementVNode("div",{ref_key:"scrollRef",ref:f,class:r.normalizeClass([`${r.unref(V)}__content`])},[r.createVNode(r.TransitionGroup,{name:"group",tag:"div",class:r.normalizeClass([`${r.unref(V)}__scroll`])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.options,({key:k,...S},I)=>(r.openBlock(),r.createBlock(ce,r.mergeProps({key:k},{ref_for:!0},S,{index:I,"active-index":u.value,onItemClick:A=>E(k),onItemContextmenu:A=>a(k),onItemClose:A=>v(k)}),null,16,["index","active-index","onItemClick","onItemContextmenu","onItemClose"]))),128))]),_:1},8,["class"])],2),r.renderSlot(h.$slots,"suffix"),h.addable?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([`${r.unref(V)}__icon`]),onClick:p[0]||(p[0]=k=>n("add"))},[r.createVNode(Ct)],2)):r.createCommentVNode("",!0)],6))}});exports.CTabItem=ce;exports.CTabs=It;
14
+ </style>`}function Te(e,t,n){const{styles:o,ids:i}=n;i.has(e)||o!==null&&(i.add(e),o.push(Le(e,t)))}const je=typeof document<"u";function Pe(){if(je)return;const e=r.inject(ze,null);if(e!==null)return{adapter:(t,n)=>Te(t,n,e),context:e}}function Oe(e,t){const n=Pe();function o(){t.mount({id:e,head:!0,ssr:n})}n?o():r.onBeforeMount(()=>{o()})}const{cssr:De,plugin:He,namespace:ae}=Re(),{c:g,cB:L,cE:x,cM:O,cNotM:Y}={...De,...He},V=`${ae}-chrome-tabs`,$=`${ae}-chrome-tabs-item`,M="all .2s cubic-bezier(.4, 0, .2, 1)";function We(){return g([L("chrome-tabs",{display:"flex",width:"100%",height:"40px",padding:"0 10px",alignItems:"center",backgroundColor:"var(--background-color)",color:"var(--background-color-dark)"},[g("div",{boxSizing:"border-box"}),g(".group-move, .group-enter-active, .group-leave-active",{transition:M}),g(".group-enter-from, .group-leave-to",{opacity:0}),g(".group-leave-active",{}),x("prefix",{}),x("icon",{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",padding:"5px",borderRadius:"10px",backgroundColor:"var(--active-background-color)",transition:M},[g("svg",{width:"100%",height:"100%",fill:"currentColor"}),g("&:hover",{backgroundColor:"var(--primary-color)"})]),x("content",{flex:"1",height:"100%",minWidth:0,overflow:"hidden",marginLeft:"-6px",padding:"0 10px"}),x("scroll",{position:"relative",display:"flex",alignItems:"center",height:"100%"},[x("icon",{marginLeft:"5px",borderRadius:"50%",backgroundColor:"transparent",flexShrink:0},[g("&:hover",{backgroundColor:"var(--primary-color)"})])]),x("suffix",{})]),L("chrome-tabs-item",{position:"relative",margin:"0 -5px",height:"100%",flexShrink:0,cursor:"default",userSelect:"none",padding:"6px 10px 0px 10px"},[O("disabled",{cursor:"not-allowed",pointerEvents:"none",opacity:.5,filter:"grayscale(0.5)"}),O("active",[x("background",{opacity:1})]),Y("active",[g("&:hover",{},[x("content",{backgroundColor:"var(--primary-color)"})])]),g("&::first-child",{marginLeft:"0 !important"}),g("&::last-child",{marginRight:"0 !important"}),x("content",{position:"relative",zIndex:1,height:"28px",display:"flex",alignItems:"center",gap:"5px",borderRadius:"10px",padding:"0 10px",transition:M}),x("slot",{}),x("icon",{lineHeight:1},[g("svg",{width:"1.2em",height:"1.2em",fill:"currentColor"})]),x("close",{width:"16px",height:"16px",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:M},[g("&:hover",{backgroundColor:"rgba(0,0,0,0.1)"}),g("svg",{width:"100%",height:"100%",fill:"currentColor"})]),x("background",{position:"absolute",opacity:0,left:0,bottom:0,zIndex:0,height:"34px",width:"100%",display:"flex",alignItems:"flex-end",transition:M},[x("block",{height:"100%",flex:1,minWidth:0,borderRadius:"10px 10px 0 0",backgroundColor:"var(--active-background-color)"}),g("svg",{fill:"var(--active-background-color)"})]),x("line",{position:"absolute",bottom:"12px",right:"4px",height:"16px",width:"2px",borderRadius:"1px",transition:M,backgroundColor:"var(--primary-color)",opacity:0},[O("show",{opacity:1})])]),g(".dark",[L("chrome-tabs",{backgroundColor:"var(--background-color-dark)",color:"var(--background-color)"},[x("icon",{backgroundColor:"var(--active-background-color-dark)"},[g("&:hover",{backgroundColor:"var(--primary-color-dark)"})])]),L("chrome-tabs-item",{},[Y("active",[g("&:hover",{},[x("content",{backgroundColor:"var(--primary-color-dark)"})])]),x("background",{},[x("block",{backgroundColor:"var(--active-background-color-dark)"}),g("svg",{fill:"var(--active-background-color-dark)"})])])])])}const P=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},Fe={name:"LineMdLoadingTwotoneLoop"},qe={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ge(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",qe,t[0]||(t[0]=[r.createStaticVNode('<g fill="none" stroke="#757575" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"></animate><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"></animateTransform></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity=".3" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"></animate></path></g>',1)]))}const Ze=P(Fe,[["render",Ge]]),Ue={name:"RiCloseLine"},Ke={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ye(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Ke,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)]))}const Je=P(Ue,[["render",Ye]]),ce=r.defineComponent({__name:"TabItem",props:{label:{type:[String,Function]},icon:{type:Function},closable:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},loadingIcon:{type:Function},onClick:{type:Function},onContextMenu:{type:Function},onClose:{type:Function},activeIndex:{default:0},index:{}},emits:["itemClick","itemContextmenu","itemClose"],setup(e,{emit:t}){const n=t,o=r.computed(()=>e.activeIndex!==e.index&&e.activeIndex!==e.index-1),i=r.computed(()=>e.activeIndex===e.index),l=r.computed(()=>typeof e.label=="string"?r.h("span",{class:`${$}__label`},e.label):e.label),s=r.computed(()=>e.loadingIcon??r.h(Ze));function u(m){m.stopPropagation(),n("itemClick",m),e.onClick?.(m)}function f(m){n("itemContextmenu",m),e.onContextMenu?.(m)}function d(){n("itemClose"),e.onClose?.()}return(m,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref($),{[`${r.unref($)}--active`]:i.value,[`${r.unref($)}--disabled`]:m.disabled}]),onClick:u,onContextmenu:f},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__content`])},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__icon`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.loading?s.value:m.icon)))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__slot`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value)))],2),m.closable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref($)}__close`]),onClick:r.withModifiers(d,["stop"])},[r.createVNode(Je)],2)):r.createCommentVNode("",!0)],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__background`])},[c[0]||(c[0]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z"})],-1)),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__block`])},null,2),c[1]||(c[1]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z"})],-1))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__line`,o.value?`${r.unref($)}__line--show`:""])},null,2)],34))}});function de(e){return r.getCurrentScope()?(r.onScopeDispose(e),!0):!1}const Qe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xe=Object.prototype.toString,et=e=>Xe.call(e)==="[object Object]",J=()=>{};function tt(e,t){function n(...o){return new Promise((i,l)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(l)})}return n}function nt(e,t={}){let n,o,i=J;const l=f=>{clearTimeout(f),i(),i=J};let s;return f=>{const d=r.toValue(e),m=r.toValue(t.maxWait);return n&&l(n),d<=0||m!==void 0&&m<=0?(o&&(l(o),o=void 0),Promise.resolve(f())):new Promise((c,b)=>{i=t.rejectOnCancel?b:c,s=f,m&&!o&&(o=setTimeout(()=>{n&&l(n),o=void 0,c(s())},m)),n=setTimeout(()=>{o&&l(o),o=void 0,c(f())},d)})}}function j(e){return Array.isArray(e)?e:[e]}function ot(e){return r.getCurrentInstance()}function rt(e,t=200,n={}){return tt(nt(t,n),e)}function it(e,t=!0,n){ot()?r.onMounted(e,n):t?e():r.nextTick(e)}function lt(e,t,n){return r.watch(e,t,{...n,immediate:!0})}const G=Qe?window:void 0;function B(e){var t;const n=r.toValue(e);return(t=n?.$el)!=null?t:n}function st(...e){const t=[],n=()=>{t.forEach(u=>u()),t.length=0},o=(u,f,d,m)=>(u.addEventListener(f,d,m),()=>u.removeEventListener(f,d,m)),i=r.computed(()=>{const u=j(r.toValue(e[0])).filter(f=>f!=null);return u.every(f=>typeof f!="string")?u:void 0}),l=lt(()=>{var u,f;return[(f=(u=i.value)==null?void 0:u.map(d=>B(d)))!=null?f:[G].filter(d=>d!=null),j(r.toValue(i.value?e[1]:e[0])),j(r.unref(i.value?e[2]:e[1])),r.toValue(i.value?e[3]:e[2])]},([u,f,d,m])=>{if(n(),!u?.length||!f?.length||!d?.length)return;const c=et(m)?{...m}:m;t.push(...u.flatMap(b=>f.flatMap(E=>d.map(a=>o(b,E,a,c)))))},{flush:"post"}),s=()=>{l(),n()};return de(n),s}function ut(){const e=r.shallowRef(!1),t=r.getCurrentInstance();return t&&r.onMounted(()=>{e.value=!0},t),e}function at(e){const t=ut();return r.computed(()=>(t.value,!!e()))}function ct(e,t,n={}){const{window:o=G,...i}=n;let l;const s=at(()=>o&&"ResizeObserver"in o),u=()=>{l&&(l.disconnect(),l=void 0)},f=r.computed(()=>{const c=r.toValue(e);return Array.isArray(c)?c.map(b=>B(b)):[B(c)]}),d=r.watch(f,c=>{if(u(),s.value&&o){l=new ResizeObserver(t);for(const b of c)b&&l.observe(b,i)}},{immediate:!0,flush:"post"}),m=()=>{u(),d()};return de(m),{isSupported:s,stop:m}}function dt(e,t={width:0,height:0},n={}){const{window:o=G,box:i="content-box"}=n,l=r.computed(()=>{var c,b;return(b=(c=B(e))==null?void 0:c.namespaceURI)==null?void 0:b.includes("svg")}),s=r.shallowRef(t.width),u=r.shallowRef(t.height),{stop:f}=ct(e,([c])=>{const b=i==="border-box"?c.borderBoxSize:i==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(o&&l.value){const E=B(e);if(E){const a=E.getBoundingClientRect();s.value=a.width,u.value=a.height}}else if(b){const E=j(b);s.value=E.reduce((a,{inlineSize:v})=>a+v,0),u.value=E.reduce((a,{blockSize:v})=>a+v,0)}else s.value=c.contentRect.width,u.value=c.contentRect.height},n);it(()=>{const c=B(e);c&&(s.value="offsetWidth"in c?c.offsetWidth:t.width,u.value="offsetHeight"in c?c.offsetHeight:t.height)});const d=r.watch(()=>B(e),c=>{s.value=c?t.width:0,u.value=c?t.height:0});function m(){f(),d()}return{width:s,height:u,stop:m}}function ft(e){const{activeClassName:t=".active",enableWheel:n=!0,direction:o="vertical"}=e??{},i=r.ref(),{width:l,height:s}=dt(i);async function u(m){await r.nextTick();const c=i.value?.querySelector(t);c&&c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest",...m})}function f(m){if(!n)return;m.preventDefault();const{deltaY:c}=m;switch(o){case"vertical":i.value?.scrollBy({top:c>0?s.value:-s.value,behavior:"smooth"});break;case"horizontal":i.value?.scrollBy({left:c>0?l.value:-l.value,behavior:"smooth"});break}}st(i,"wheel",f);const d=rt(u,500);return r.watch([l,s],()=>{d()}),{scrollRef:i,scrollToView:u}}var mt={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},y=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},w=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},fe=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Q=function(e){return{r:w(e.r,0,255),g:w(e.g,0,255),b:w(e.b,0,255),a:w(e.a)}},D=function(e){return{r:y(e.r),g:y(e.g),b:y(e.b),a:y(e.a,3)}},ht=/^#([0-9a-f]{3,8})$/i,T=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},me=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),s=l-Math.min(t,n,o),u=s?l===t?(n-o)/s:l===n?2+(o-t)/s:4+(t-n)/s:0;return{h:60*(u<0?u+6:u),s:l?s/l*100:0,v:l/255*100,a:i}},he=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),s=o*(1-n),u=o*(1-(t-l)*n),f=o*(1-(1-t+l)*n),d=l%6;return{r:255*[o,u,s,s,f,o][d],g:255*[f,o,o,u,s,s][d],b:255*[s,s,f,o,o,u][d],a:i}},X=function(e){return{h:fe(e.h),s:w(e.s,0,100),l:w(e.l,0,100),a:w(e.a)}},ee=function(e){return{h:y(e.h),s:y(e.s),l:y(e.l),a:y(e.a,3)}},te=function(e){return he((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},_=function(e){return{h:(t=me(e)).h,s:(i=(200-(n=t.s))*(o=t.v)/100)>0&&i<200?n*o/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,o,i},pt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ne={string:[[function(e){var t=ht.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?y(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?y(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=bt.exec(e)||gt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Q({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=pt.exec(e)||vt.exec(e);if(!t)return null;var n,o,i=X({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(mt[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return te(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=i===void 0?1:i;return N(t)&&N(n)&&N(o)?Q({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=X({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return te(s)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=function(u){return{h:fe(u.h),s:w(u.s,0,100),v:w(u.v,0,100),a:w(u.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return he(s)},"hsv"]]},oe=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},xt=function(e){return typeof e=="string"?oe(e.trim(),ne.string):typeof e=="object"&&e!==null?oe(e,ne.object):[null,void 0]},H=function(e,t){var n=_(e);return{h:n.h,s:w(n.s+100*t,0,100),l:n.l,a:n.a}},W=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},re=function(e,t){var n=_(e);return{h:n.h,s:n.s,l:w(n.l+100*t,0,100),a:n.a}},ie=function(){function e(t){this.parsed=xt(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return y(W(this.rgba),2)},e.prototype.isDark=function(){return W(this.rgba)<.5},e.prototype.isLight=function(){return W(this.rgba)>=.5},e.prototype.toHex=function(){return t=D(this.rgba),n=t.r,o=t.g,i=t.b,s=(l=t.a)<1?T(y(255*l)):"","#"+T(n)+T(o)+T(i)+s;var t,n,o,i,l,s},e.prototype.toRgb=function(){return D(this.rgba)},e.prototype.toRgbString=function(){return t=D(this.rgba),n=t.r,o=t.g,i=t.b,(l=t.a)<1?"rgba("+n+", "+o+", "+i+", "+l+")":"rgb("+n+", "+o+", "+i+")";var t,n,o,i,l},e.prototype.toHsl=function(){return ee(_(this.rgba))},e.prototype.toHslString=function(){return t=ee(_(this.rgba)),n=t.h,o=t.s,i=t.l,(l=t.a)<1?"hsla("+n+", "+o+"%, "+i+"%, "+l+")":"hsl("+n+", "+o+"%, "+i+"%)";var t,n,o,i,l},e.prototype.toHsv=function(){return t=me(this.rgba),{h:y(t.h),s:y(t.s),v:y(t.v),a:y(t.a,3)};var t},e.prototype.invert=function(){return C({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),C(H(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),C(H(this.rgba,-t))},e.prototype.grayscale=function(){return C(H(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),C(re(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),C(re(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?C({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):y(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=_(this.rgba);return typeof t=="number"?C({h:t,s:n.s,l:n.l,a:n.a}):y(n.h)},e.prototype.isEqual=function(t){return this.toHex()===C(t).toHex()},e}(),C=function(e){return e instanceof ie?e:new ie(e)};const yt={name:"RiAddLine"},kt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function $t(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",kt,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)]))}const Ct=P(yt,[["render",$t]]),wt={name:"RiArrowDropDownLine"},Et={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Nt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Et,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414z"},null,-1)]))}const Bt=P(wt,[["render",Nt]]),It=r.defineComponent({__name:"Tabs",props:r.mergeModels({colors:{},dropdown:{type:Boolean},addable:{type:Boolean},options:{}},{value:{},valueModifiers:{}}),emits:r.mergeModels(["click","contextmenu","close","add"],["update:value"]),setup(e,{emit:t}){const n=t;Oe("n-chrome-tabs",We());const{background:o="#E5E7EB",active:i="#fff",primary:l="rgba(251,191,36,1)"}=e.colors??{},s=r.useModel(e,"value"),u=r.computed(()=>e.options?.findIndex(h=>h.key===s.value)),{scrollRef:f,scrollToView:d}=ft({activeClassName:`.${$}--active`,direction:"horizontal"});r.watch(s,()=>{d()},{immediate:!0});const m=r.computed(()=>C(o).darken(.9).toHex()),c=r.computed(()=>C(i).darken(.8).toHex()),b=r.computed(()=>C(l).darken(.3).toHex());function E(h){n("click",h)}function a(h){n("contextmenu",h)}function v(h){n("close",h)}return(h,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(V)]),style:r.normalizeStyle({"--background-color":`${r.unref(o)}`,"--background-color-dark":`${m.value}`,"--active-background-color":`${r.unref(i)}`,"--active-background-color-dark":`${c.value}`,"--primary-color":`${r.unref(l)}`,"--primary-color-dark":`${b.value}`})},[h.dropdown?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(V)}__icon`])},[r.createVNode(Bt)],2)):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"prefix"),r.createElementVNode("div",{ref_key:"scrollRef",ref:f,class:r.normalizeClass([`${r.unref(V)}__content`])},[r.createVNode(r.TransitionGroup,{name:"group",tag:"div",class:r.normalizeClass([`${r.unref(V)}__scroll`])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.options,({key:k,...S},I)=>(r.openBlock(),r.createBlock(ce,r.mergeProps({key:k},{ref_for:!0},S,{index:I,"active-index":u.value,onItemClick:A=>E(k),onItemContextmenu:A=>a(k),onItemClose:A=>v(k)}),null,16,["index","active-index","onItemClick","onItemContextmenu","onItemClose"]))),128))]),_:1},8,["class"])],2),r.renderSlot(h.$slots,"suffix"),h.addable?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([`${r.unref(V)}__icon`]),onClick:p[0]||(p[0]=k=>n("add"))},[r.createVNode(Ct)],2)):r.createCommentVNode("",!0)],6))}});exports.CTabItem=ce;exports.CTabs=It;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { inject as Be, onBeforeMount as Le, createElementBlock as _, openBlock as E, createStaticVNode as je, createElementVNode as k, defineComponent as $e, computed as M, h as re, normalizeClass as C, unref as b, createCommentVNode as Q, createBlock as X, resolveDynamicComponent as ie, withModifiers as Te, createVNode as q, onMounted as ke, nextTick as we, watch as O, getCurrentScope as Pe, onScopeDispose as ze, getCurrentInstance as Ce, toValue as B, shallowRef as ee, ref as Oe, mergeModels as se, useModel as De, normalizeStyle as Ve, renderSlot as ue, TransitionGroup as We, withCtx as He, Fragment as Fe, renderList as qe, mergeProps as Ge } from "vue";
1
+ import { inject as Be, onBeforeMount as Le, createElementBlock as _, openBlock as E, createStaticVNode as je, createElementVNode as k, defineComponent as $e, computed as M, h as re, normalizeClass as C, unref as b, createCommentVNode as Q, createBlock as X, resolveDynamicComponent as ie, withModifiers as Te, createVNode as q, onMounted as ke, nextTick as we, watch as O, getCurrentScope as Pe, onScopeDispose as ze, getCurrentInstance as Ce, toValue as B, shallowRef as ee, ref as Oe, mergeModels as se, useModel as De, normalizeStyle as Ve, renderSlot as ue, TransitionGroup as He, withCtx as We, Fragment as Fe, renderList as qe, mergeProps as Ge } from "vue";
2
2
  function Ze(e) {
3
3
  let t = ".", n = "__", o = "--", r;
4
4
  if (e) {
@@ -304,7 +304,7 @@ function at(e = {}) {
304
304
  const { id: t, parent: n } = e;
305
305
  it(this.instance, this, t, n);
306
306
  }
307
- const W = function(e, t, n, o) {
307
+ const H = function(e, t, n, o) {
308
308
  return {
309
309
  instance: e,
310
310
  $: t,
@@ -316,7 +316,7 @@ const W = function(e, t, n, o) {
316
316
  unmount: at
317
317
  };
318
318
  }, ct = function(e, t, n, o) {
319
- return Array.isArray(t) ? W(e, { $: null }, null, t) : Array.isArray(n) ? W(e, t, null, n) : Array.isArray(o) ? W(e, t, n, o) : W(e, t, n, null);
319
+ return Array.isArray(t) ? H(e, { $: null }, null, t) : Array.isArray(n) ? H(e, t, null, n) : Array.isArray(o) ? H(e, t, n, o) : H(e, t, n, null);
320
320
  };
321
321
  function ft(e = {}) {
322
322
  const t = {
@@ -377,10 +377,10 @@ function gt(e, t) {
377
377
  o();
378
378
  });
379
379
  }
380
- const { cssr: xt, plugin: yt, namespace: Ne } = dt(), { c: x, cB: H, cE: g, cM: U, cNotM: fe } = { ...xt, ...yt }, P = `${Ne}-chrome-tabs`, w = `${Ne}-chrome-tabs-item`, j = "all .2s cubic-bezier(.4, 0, .2, 1)";
380
+ const { cssr: xt, plugin: yt, namespace: Ne } = dt(), { c: g, cB: W, cE: x, cM: U, cNotM: fe } = { ...xt, ...yt }, P = `${Ne}-chrome-tabs`, w = `${Ne}-chrome-tabs-item`, j = "all .2s cubic-bezier(.4, 0, .2, 1)";
381
381
  function $t() {
382
- return x([
383
- H("chrome-tabs", {
382
+ return g([
383
+ W("chrome-tabs", {
384
384
  display: "flex",
385
385
  width: "100%",
386
386
  height: "40px",
@@ -389,15 +389,18 @@ function $t() {
389
389
  backgroundColor: "var(--background-color)",
390
390
  color: "var(--background-color-dark)"
391
391
  }, [
392
- x(".group-move, .group-enter-active, .group-leave-active", {
392
+ g("div", {
393
+ boxSizing: "border-box"
394
+ }),
395
+ g(".group-move, .group-enter-active, .group-leave-active", {
393
396
  transition: j
394
397
  }),
395
- x(".group-enter-from, .group-leave-to", {
398
+ g(".group-enter-from, .group-leave-to", {
396
399
  opacity: 0
397
400
  }),
398
- x(".group-leave-active", {}),
399
- g("prefix", {}),
400
- g("icon", {
401
+ g(".group-leave-active", {}),
402
+ x("prefix", {}),
403
+ x("icon", {
401
404
  width: "28px",
402
405
  height: "28px",
403
406
  display: "flex",
@@ -408,16 +411,16 @@ function $t() {
408
411
  backgroundColor: "var(--active-background-color)",
409
412
  transition: j
410
413
  }, [
411
- x("svg", {
414
+ g("svg", {
412
415
  width: "100%",
413
416
  height: "100%",
414
417
  fill: "currentColor"
415
418
  }),
416
- x("&:hover", {
419
+ g("&:hover", {
417
420
  backgroundColor: "var(--primary-color)"
418
421
  })
419
422
  ]),
420
- g("content", {
423
+ x("content", {
421
424
  flex: "1",
422
425
  height: "100%",
423
426
  minWidth: 0,
@@ -425,26 +428,26 @@ function $t() {
425
428
  marginLeft: "-6px",
426
429
  padding: "0 10px"
427
430
  }),
428
- g("scroll", {
431
+ x("scroll", {
429
432
  position: "relative",
430
433
  display: "flex",
431
434
  alignItems: "center",
432
435
  height: "100%"
433
436
  }, [
434
- g("icon", {
437
+ x("icon", {
435
438
  marginLeft: "5px",
436
439
  borderRadius: "50%",
437
440
  backgroundColor: "transparent",
438
441
  flexShrink: 0
439
442
  }, [
440
- x("&:hover", {
443
+ g("&:hover", {
441
444
  backgroundColor: "var(--primary-color)"
442
445
  })
443
446
  ])
444
447
  ]),
445
- g("suffix", {})
448
+ x("suffix", {})
446
449
  ]),
447
- H("chrome-tabs-item", {
450
+ W("chrome-tabs-item", {
448
451
  position: "relative",
449
452
  margin: "0 -5px",
450
453
  height: "100%",
@@ -460,24 +463,24 @@ function $t() {
460
463
  filter: "grayscale(0.5)"
461
464
  }),
462
465
  U("active", [
463
- g("background", {
466
+ x("background", {
464
467
  opacity: 1
465
468
  })
466
469
  ]),
467
470
  fe("active", [
468
- x("&:hover", {}, [
469
- g("content", {
471
+ g("&:hover", {}, [
472
+ x("content", {
470
473
  backgroundColor: "var(--primary-color)"
471
474
  })
472
475
  ])
473
476
  ]),
474
- x("&::first-child", {
477
+ g("&::first-child", {
475
478
  marginLeft: "0 !important"
476
479
  }),
477
- x("&::last-child", {
480
+ g("&::last-child", {
478
481
  marginRight: "0 !important"
479
482
  }),
480
- g("content", {
483
+ x("content", {
481
484
  position: "relative",
482
485
  zIndex: 1,
483
486
  height: "28px",
@@ -488,15 +491,17 @@ function $t() {
488
491
  padding: "0 10px",
489
492
  transition: j
490
493
  }),
491
- g("slot", {}),
492
- g("icon", {}, [
493
- x("svg", {
494
+ x("slot", {}),
495
+ x("icon", {
496
+ lineHeight: 1
497
+ }, [
498
+ g("svg", {
494
499
  width: "1.2em",
495
500
  height: "1.2em",
496
501
  fill: "currentColor"
497
502
  })
498
503
  ]),
499
- g("close", {
504
+ x("close", {
500
505
  width: "16px",
501
506
  height: "16px",
502
507
  padding: "2px",
@@ -506,16 +511,16 @@ function $t() {
506
511
  borderRadius: "50%",
507
512
  transition: j
508
513
  }, [
509
- x("&:hover", {
514
+ g("&:hover", {
510
515
  backgroundColor: "rgba(0,0,0,0.1)"
511
516
  }),
512
- x("svg", {
517
+ g("svg", {
513
518
  width: "100%",
514
519
  height: "100%",
515
520
  fill: "currentColor"
516
521
  })
517
522
  ]),
518
- g("background", {
523
+ x("background", {
519
524
  position: "absolute",
520
525
  opacity: 0,
521
526
  left: 0,
@@ -527,18 +532,18 @@ function $t() {
527
532
  alignItems: "flex-end",
528
533
  transition: j
529
534
  }, [
530
- g("block", {
535
+ x("block", {
531
536
  height: "100%",
532
537
  flex: 1,
533
538
  minWidth: 0,
534
539
  borderRadius: "10px 10px 0 0",
535
540
  backgroundColor: "var(--active-background-color)"
536
541
  }),
537
- x("svg", {
542
+ g("svg", {
538
543
  fill: "var(--active-background-color)"
539
544
  })
540
545
  ]),
541
- g("line", {
546
+ x("line", {
542
547
  position: "absolute",
543
548
  bottom: "12px",
544
549
  right: "4px",
@@ -554,32 +559,32 @@ function $t() {
554
559
  })
555
560
  ])
556
561
  ]),
557
- x(".dark", [
558
- H("chrome-tabs", {
562
+ g(".dark", [
563
+ W("chrome-tabs", {
559
564
  backgroundColor: "var(--background-color-dark)",
560
565
  color: "var(--background-color)"
561
566
  }, [
562
- g("icon", {
567
+ x("icon", {
563
568
  backgroundColor: "var(--active-background-color-dark)"
564
569
  }, [
565
- x("&:hover", {
570
+ g("&:hover", {
566
571
  backgroundColor: "var(--primary-color-dark)"
567
572
  })
568
573
  ])
569
574
  ]),
570
- H("chrome-tabs-item", {}, [
575
+ W("chrome-tabs-item", {}, [
571
576
  fe("active", [
572
- x("&:hover", {}, [
573
- g("content", {
577
+ g("&:hover", {}, [
578
+ x("content", {
574
579
  backgroundColor: "var(--primary-color-dark)"
575
580
  })
576
581
  ])
577
582
  ]),
578
- g("background", {}, [
579
- g("block", {
583
+ x("background", {}, [
584
+ x("block", {
580
585
  backgroundColor: "var(--active-background-color-dark)"
581
586
  }),
582
- x("svg", {
587
+ g("svg", {
583
588
  fill: "var(--active-background-color-dark)"
584
589
  })
585
590
  ])
@@ -809,14 +814,14 @@ function Vt() {
809
814
  e.value = !0;
810
815
  }, t), e;
811
816
  }
812
- function Wt(e) {
817
+ function Ht(e) {
813
818
  const t = Vt();
814
819
  return M(() => (t.value, !!e()));
815
820
  }
816
- function Ht(e, t, n = {}) {
821
+ function Wt(e, t, n = {}) {
817
822
  const { window: o = oe, ...r } = n;
818
823
  let i;
819
- const s = Wt(() => o && "ResizeObserver" in o), u = () => {
824
+ const s = Ht(() => o && "ResizeObserver" in o), u = () => {
820
825
  i && (i.disconnect(), i = void 0);
821
826
  }, f = M(() => {
822
827
  const a = B(e);
@@ -843,7 +848,7 @@ function Ft(e, t = { width: 0, height: 0 }, n = {}) {
843
848
  const { window: o = oe, box: r = "content-box" } = n, i = M(() => {
844
849
  var a, v;
845
850
  return (v = (a = R(e)) == null ? void 0 : a.namespaceURI) == null ? void 0 : v.includes("svg");
846
- }), s = ee(t.width), u = ee(t.height), { stop: f } = Ht(
851
+ }), s = ee(t.width), u = ee(t.height), { stop: f } = Wt(
847
852
  e,
848
853
  ([a]) => {
849
854
  const v = r === "border-box" ? a.borderBoxSize : r === "content-box" ? a.contentBoxSize : a.devicePixelContentBoxSize;
@@ -1136,12 +1141,12 @@ const un = /* @__PURE__ */ Z(on, [["render", sn]]), an = /* @__PURE__ */ $e({
1136
1141
  ref: f,
1137
1142
  class: C([`${b(P)}__content`])
1138
1143
  }, [
1139
- q(We, {
1144
+ q(He, {
1140
1145
  name: "group",
1141
1146
  tag: "div",
1142
1147
  class: C([`${b(P)}__scroll`])
1143
1148
  }, {
1144
- default: He(() => [
1149
+ default: We(() => [
1145
1150
  (E(!0), _(Fe, null, qe(h.options, ({ key: $, ...T }, L) => (E(), X(_t, Ge({ key: $ }, { ref_for: !0 }, T, {
1146
1151
  index: L,
1147
1152
  "active-index": u.value,
@@ -1,14 +1,14 @@
1
- (function(B,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(B=typeof globalThis<"u"?globalThis:B||self,r(B["@oiij/chrome-tabs"]={},B.Vue))})(this,function(B,r){"use strict";function be(e){let t=".",n="__",o="--",i;if(e){let c=e.blockPrefix;c&&(t=c),c=e.elementPrefix,c&&(n=c),c=e.modifierPrefix,c&&(o=c)}const l={install(c){i=c.c;const b=c.context;b.bem={},b.bem.b=null,b.bem.els=null}};function s(c){let b,h;return{before(p){b=p.bem.b,h=p.bem.els,p.bem.els=null},after(p){p.bem.b=b,p.bem.els=h},$({context:p,props:v}){return c=typeof c=="string"?c:c({context:p,props:v}),p.bem.b=c,`${v?.bPrefix||t}${p.bem.b}`}}}function a(c){let b;return{before(h){b=h.bem.els},after(h){h.bem.els=b},$({context:h,props:p}){return c=typeof c=="string"?c:c({context:h,props:p}),h.bem.els=c.split(",").map(v=>v.trim()),h.bem.els.map(v=>`${p?.bPrefix||t}${h.bem.b}${n}${v}`).join(", ")}}}function d(c){return{$({context:b,props:h}){c=typeof c=="string"?c:c({context:b,props:h});const p=c.split(",").map(S=>S.trim());function v(S){return p.map(O=>`&${h?.bPrefix||t}${b.bem.b}${S!==void 0?`${n}${S}`:""}${o}${O}`).join(", ")}const A=b.bem.els;if(A!==null){if(process.env.NODE_ENV!=="production"&&A.length>=2)throw Error(`[css-render/plugin-bem]: m(${c}) is invalid, using modifier inside multiple elements is not allowed`);return v(A[0])}else return v()}}}function f(c){return{$({context:b,props:h}){c=typeof c=="string"?c:c({context:b,props:h});const p=b.bem.els;if(process.env.NODE_ENV!=="production"&&p!==null&&p.length>=2)throw Error(`[css-render/plugin-bem]: notM(${c}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${h?.bPrefix||t}${b.bem.b}${p!==null&&p.length>0?`${n}${p[0]}`:""}${o}${c})`}}}return Object.assign(l,{cB:(...c)=>i(s(c[0]),c[1],c[2]),cE:(...c)=>i(a(c[0]),c[1],c[2]),cM:(...c)=>i(d(c[0]),c[1],c[2]),cNotM:(...c)=>i(f(c[0]),c[1],c[2])}),l}function ge(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const U=/\s*,(?![^(]*\))\s*/g,xe=/\s+/g;function ye(e,t){const n=[];return t.split(U).forEach(o=>{let i=ge(o);if(i){if(i===1){e.forEach(s=>{n.push(o.replace("&",s))});return}}else{e.forEach(s=>{n.push((s&&s+" ")+o)});return}let l=[o];for(;i--;){const s=[];l.forEach(a=>{e.forEach(d=>{s.push(a.replace("&",d))})}),l=s}l.forEach(s=>n.push(s))}),n}function ke(e,t){const n=[];return t.split(U).forEach(o=>{e.forEach(i=>{n.push((i&&i+" ")+o)})}),n}function ve(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=ye(t,n):t=ke(t,n))}),t.join(", ").replace(xe," ")}function K(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function D(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function $e(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function R(e){return e?/^\s*@(s|m)/.test(e):!1}const Ce=/[A-Z]/g;function Y(e){return e.replace(Ce,t=>"-"+t.toLowerCase())}function we(e,t=" "){return typeof e=="object"&&e!==null?` {
1
+ (function(B,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(B=typeof globalThis<"u"?globalThis:B||self,r(B["@oiij/chrome-tabs"]={},B.Vue))})(this,function(B,r){"use strict";function be(e){let t=".",n="__",o="--",i;if(e){let c=e.blockPrefix;c&&(t=c),c=e.elementPrefix,c&&(n=c),c=e.modifierPrefix,c&&(o=c)}const l={install(c){i=c.c;const b=c.context;b.bem={},b.bem.b=null,b.bem.els=null}};function s(c){let b,h;return{before(p){b=p.bem.b,h=p.bem.els,p.bem.els=null},after(p){p.bem.b=b,p.bem.els=h},$({context:p,props:v}){return c=typeof c=="string"?c:c({context:p,props:v}),p.bem.b=c,`${v?.bPrefix||t}${p.bem.b}`}}}function a(c){let b;return{before(h){b=h.bem.els},after(h){h.bem.els=b},$({context:h,props:p}){return c=typeof c=="string"?c:c({context:h,props:p}),h.bem.els=c.split(",").map(v=>v.trim()),h.bem.els.map(v=>`${p?.bPrefix||t}${h.bem.b}${n}${v}`).join(", ")}}}function f(c){return{$({context:b,props:h}){c=typeof c=="string"?c:c({context:b,props:h});const p=c.split(",").map(S=>S.trim());function v(S){return p.map(O=>`&${h?.bPrefix||t}${b.bem.b}${S!==void 0?`${n}${S}`:""}${o}${O}`).join(", ")}const A=b.bem.els;if(A!==null){if(process.env.NODE_ENV!=="production"&&A.length>=2)throw Error(`[css-render/plugin-bem]: m(${c}) is invalid, using modifier inside multiple elements is not allowed`);return v(A[0])}else return v()}}}function d(c){return{$({context:b,props:h}){c=typeof c=="string"?c:c({context:b,props:h});const p=b.bem.els;if(process.env.NODE_ENV!=="production"&&p!==null&&p.length>=2)throw Error(`[css-render/plugin-bem]: notM(${c}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${h?.bPrefix||t}${b.bem.b}${p!==null&&p.length>0?`${n}${p[0]}`:""}${o}${c})`}}}return Object.assign(l,{cB:(...c)=>i(s(c[0]),c[1],c[2]),cE:(...c)=>i(a(c[0]),c[1],c[2]),cM:(...c)=>i(f(c[0]),c[1],c[2]),cNotM:(...c)=>i(d(c[0]),c[1],c[2])}),l}function ge(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const U=/\s*,(?![^(]*\))\s*/g,xe=/\s+/g;function ye(e,t){const n=[];return t.split(U).forEach(o=>{let i=ge(o);if(i){if(i===1){e.forEach(s=>{n.push(o.replace("&",s))});return}}else{e.forEach(s=>{n.push((s&&s+" ")+o)});return}let l=[o];for(;i--;){const s=[];l.forEach(a=>{e.forEach(f=>{s.push(a.replace("&",f))})}),l=s}l.forEach(s=>n.push(s))}),n}function ke(e,t){const n=[];return t.split(U).forEach(o=>{e.forEach(i=>{n.push((i&&i+" ")+o)})}),n}function ve(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=ye(t,n):t=ke(t,n))}),t.join(", ").replace(xe," ")}function K(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function D(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function $e(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function R(e){return e?/^\s*@(s|m)/.test(e):!1}const Ce=/[A-Z]/g;function Y(e){return e.replace(Ce,t=>"-"+t.toLowerCase())}function we(e,t=" "){return typeof e=="object"&&e!==null?` {
2
2
  `+Object.entries(e).map(n=>t+` ${Y(n[0])}: ${n[1]};`).join(`
3
3
  `)+`
4
4
  `+t+"}":`: ${e};`}function Ee(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function J(e,t,n,o){if(!t)return"";const i=Ee(t,n,o);if(!i)return"";if(typeof i=="string")return`${e} {
5
5
  ${i}
6
6
  }`;const l=Object.keys(i);if(l.length===0)return n.config.keepEmptyBlock?e+` {
7
- }`:"";const s=e?[e+" {"]:[];return l.forEach(a=>{const d=i[a];if(a==="raw"){s.push(`
8
- `+d+`
9
- `);return}a=Y(a),d!=null&&s.push(` ${a}${we(d)}`)}),e&&s.push("}"),s.join(`
10
- `)}function W(e,t,n){e&&e.forEach(o=>{if(Array.isArray(o))W(o,t,n);else if(typeof o=="function"){const i=o(t);Array.isArray(i)?W(i,t,n):i&&n(i)}else o&&n(o)})}function Q(e,t,n,o,i){const l=e.$;let s="";if(!l||typeof l=="string")R(l)?s=l:t.push(l);else if(typeof l=="function"){const f=l({context:o.context,props:i});R(f)?s=f:t.push(f)}else if(l.before&&l.before(o.context),!l.$||typeof l.$=="string")R(l.$)?s=l.$:t.push(l.$);else if(l.$){const f=l.$({context:o.context,props:i});R(f)?s=f:t.push(f)}const a=ve(t),d=J(a,e.props,o,i);s?n.push(`${s} {`):d.length&&n.push(d),e.children&&W(e.children,{context:o.context,props:i},f=>{if(typeof f=="string"){const m=J(a,{raw:f},o,i);n.push(m)}else Q(f,t,n,o,i)}),t.pop(),s&&n.push("}"),l&&l.after&&l.after(o.context)}function Ne(e,t,n){const o=[];return Q(e,[],o,t,n),o.join(`
7
+ }`:"";const s=e?[e+" {"]:[];return l.forEach(a=>{const f=i[a];if(a==="raw"){s.push(`
8
+ `+f+`
9
+ `);return}a=Y(a),f!=null&&s.push(` ${a}${we(f)}`)}),e&&s.push("}"),s.join(`
10
+ `)}function H(e,t,n){e&&e.forEach(o=>{if(Array.isArray(o))H(o,t,n);else if(typeof o=="function"){const i=o(t);Array.isArray(i)?H(i,t,n):i&&n(i)}else o&&n(o)})}function Q(e,t,n,o,i){const l=e.$;let s="";if(!l||typeof l=="string")R(l)?s=l:t.push(l);else if(typeof l=="function"){const d=l({context:o.context,props:i});R(d)?s=d:t.push(d)}else if(l.before&&l.before(o.context),!l.$||typeof l.$=="string")R(l.$)?s=l.$:t.push(l.$);else if(l.$){const d=l.$({context:o.context,props:i});R(d)?s=d:t.push(d)}const a=ve(t),f=J(a,e.props,o,i);s?n.push(`${s} {`):f.length&&n.push(f),e.children&&H(e.children,{context:o.context,props:i},d=>{if(typeof d=="string"){const m=J(a,{raw:d},o,i);n.push(m)}else Q(d,t,n,o,i)}),t.pop(),s&&n.push("}"),l&&l.after&&l.after(o.context)}function Ne(e,t,n){const o=[];return Q(e,[],o,t,n),o.join(`
11
11
 
12
- `)}function Be(e){for(var t=0,n,o=0,i=e.length;i>=4;++o,i-=4)n=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Ie(e,t,n,o){const{els:i}=t;if(n===void 0)i.forEach(K),t.els=[];else{const l=D(n,o);l&&i.includes(l)&&(K(l),t.els=i.filter(s=>s!==l))}}function X(e,t){e.push(t)}function Me(e,t,n,o,i,l,s,a,d){let f;if(n===void 0&&(f=t.render(o),n=Be(f)),d){d.adapter(n,f??t.render(o));return}a===void 0&&(a=document.head);const m=D(n,a);if(m!==null&&!l)return m;const u=m??$e(n);if(f===void 0&&(f=t.render(o)),u.textContent=f,m!==null)return m;if(s){const g=a.querySelector(`meta[name="${s}"]`);if(g)return a.insertBefore(u,g),X(t.els,u),u}return i?a.insertBefore(u,a.querySelector("style, link")):a.appendChild(u),X(t.els,u),u}function Se(e){return Ne(this,this.instance,e)}function Ve(e={}){const{id:t,ssr:n,props:o,head:i=!1,force:l=!1,anchorMetaName:s,parent:a}=e;return Me(this.instance,this,t,o,i,l,s,a,n)}function _e(e={}){const{id:t,parent:n}=e;Ie(this.instance,this,t,n)}const z=function(e,t,n,o){return{instance:e,$:t,props:n,children:o,els:[],render:Se,mount:Ve,unmount:_e}},Ae=function(e,t,n,o){return Array.isArray(t)?z(e,{$:null},null,t):Array.isArray(n)?z(e,t,null,n):Array.isArray(o)?z(e,t,n,o):z(e,t,n,null)};function Re(e={}){const t={c:(...n)=>Ae(t,...n),use:(n,...o)=>n.install(t,...o),find:D,context:{},config:e};return t}function ze(e){const{namespace:t="n",blockPrefix:n=`.${t}-`,elementPrefix:o="__",modifierPrefix:i="--"}=e??{},l=Re(),s=be({blockPrefix:n,elementPrefix:o,modifierPrefix:i});return l.use(s),{namespace:t,blockPrefix:n,elementPrefix:o,modifierPrefix:i,cssr:l,plugin:s}}const Le="@css-render/vue3-ssr";function Te(e,t){return`<style cssr-id="${e}">
12
+ `)}function Be(e){for(var t=0,n,o=0,i=e.length;i>=4;++o,i-=4)n=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Ie(e,t,n,o){const{els:i}=t;if(n===void 0)i.forEach(K),t.els=[];else{const l=D(n,o);l&&i.includes(l)&&(K(l),t.els=i.filter(s=>s!==l))}}function X(e,t){e.push(t)}function Me(e,t,n,o,i,l,s,a,f){let d;if(n===void 0&&(d=t.render(o),n=Be(d)),f){f.adapter(n,d??t.render(o));return}a===void 0&&(a=document.head);const m=D(n,a);if(m!==null&&!l)return m;const u=m??$e(n);if(d===void 0&&(d=t.render(o)),u.textContent=d,m!==null)return m;if(s){const g=a.querySelector(`meta[name="${s}"]`);if(g)return a.insertBefore(u,g),X(t.els,u),u}return i?a.insertBefore(u,a.querySelector("style, link")):a.appendChild(u),X(t.els,u),u}function Se(e){return Ne(this,this.instance,e)}function Ve(e={}){const{id:t,ssr:n,props:o,head:i=!1,force:l=!1,anchorMetaName:s,parent:a}=e;return Me(this.instance,this,t,o,i,l,s,a,n)}function _e(e={}){const{id:t,parent:n}=e;Ie(this.instance,this,t,n)}const z=function(e,t,n,o){return{instance:e,$:t,props:n,children:o,els:[],render:Se,mount:Ve,unmount:_e}},Ae=function(e,t,n,o){return Array.isArray(t)?z(e,{$:null},null,t):Array.isArray(n)?z(e,t,null,n):Array.isArray(o)?z(e,t,n,o):z(e,t,n,null)};function Re(e={}){const t={c:(...n)=>Ae(t,...n),use:(n,...o)=>n.install(t,...o),find:D,context:{},config:e};return t}function ze(e){const{namespace:t="n",blockPrefix:n=`.${t}-`,elementPrefix:o="__",modifierPrefix:i="--"}=e??{},l=Re(),s=be({blockPrefix:n,elementPrefix:o,modifierPrefix:i});return l.use(s),{namespace:t,blockPrefix:n,elementPrefix:o,modifierPrefix:i,cssr:l,plugin:s}}const Le="@css-render/vue3-ssr";function Te(e,t){return`<style cssr-id="${e}">
13
13
  ${t}
14
- </style>`}function je(e,t,n){const{styles:o,ids:i}=n;i.has(e)||o!==null&&(i.add(e),o.push(Te(e,t)))}const Pe=typeof document<"u";function Oe(){if(Pe)return;const e=r.inject(Le,null);if(e!==null)return{adapter:(t,n)=>je(t,n,e),context:e}}function De(e,t){const n=Oe();function o(){t.mount({id:e,head:!0,ssr:n})}n?o():r.onBeforeMount(()=>{o()})}const{cssr:We,plugin:He,namespace:ee}=ze(),{c:y,cB:L,cE:x,cM:H,cNotM:te}={...We,...He},V=`${ee}-chrome-tabs`,$=`${ee}-chrome-tabs-item`,M="all .2s cubic-bezier(.4, 0, .2, 1)";function Fe(){return y([L("chrome-tabs",{display:"flex",width:"100%",height:"40px",padding:"0 10px",alignItems:"center",backgroundColor:"var(--background-color)",color:"var(--background-color-dark)"},[y(".group-move, .group-enter-active, .group-leave-active",{transition:M}),y(".group-enter-from, .group-leave-to",{opacity:0}),y(".group-leave-active",{}),x("prefix",{}),x("icon",{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",padding:"5px",borderRadius:"10px",backgroundColor:"var(--active-background-color)",transition:M},[y("svg",{width:"100%",height:"100%",fill:"currentColor"}),y("&:hover",{backgroundColor:"var(--primary-color)"})]),x("content",{flex:"1",height:"100%",minWidth:0,overflow:"hidden",marginLeft:"-6px",padding:"0 10px"}),x("scroll",{position:"relative",display:"flex",alignItems:"center",height:"100%"},[x("icon",{marginLeft:"5px",borderRadius:"50%",backgroundColor:"transparent",flexShrink:0},[y("&:hover",{backgroundColor:"var(--primary-color)"})])]),x("suffix",{})]),L("chrome-tabs-item",{position:"relative",margin:"0 -5px",height:"100%",flexShrink:0,cursor:"default",userSelect:"none",padding:"6px 10px 0px 10px"},[H("disabled",{cursor:"not-allowed",pointerEvents:"none",opacity:.5,filter:"grayscale(0.5)"}),H("active",[x("background",{opacity:1})]),te("active",[y("&:hover",{},[x("content",{backgroundColor:"var(--primary-color)"})])]),y("&::first-child",{marginLeft:"0 !important"}),y("&::last-child",{marginRight:"0 !important"}),x("content",{position:"relative",zIndex:1,height:"28px",display:"flex",alignItems:"center",gap:"5px",borderRadius:"10px",padding:"0 10px",transition:M}),x("slot",{}),x("icon",{},[y("svg",{width:"1.2em",height:"1.2em",fill:"currentColor"})]),x("close",{width:"16px",height:"16px",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:M},[y("&:hover",{backgroundColor:"rgba(0,0,0,0.1)"}),y("svg",{width:"100%",height:"100%",fill:"currentColor"})]),x("background",{position:"absolute",opacity:0,left:0,bottom:0,zIndex:0,height:"34px",width:"100%",display:"flex",alignItems:"flex-end",transition:M},[x("block",{height:"100%",flex:1,minWidth:0,borderRadius:"10px 10px 0 0",backgroundColor:"var(--active-background-color)"}),y("svg",{fill:"var(--active-background-color)"})]),x("line",{position:"absolute",bottom:"12px",right:"4px",height:"16px",width:"2px",borderRadius:"1px",transition:M,backgroundColor:"var(--primary-color)",opacity:0},[H("show",{opacity:1})])]),y(".dark",[L("chrome-tabs",{backgroundColor:"var(--background-color-dark)",color:"var(--background-color)"},[x("icon",{backgroundColor:"var(--active-background-color-dark)"},[y("&:hover",{backgroundColor:"var(--primary-color-dark)"})])]),L("chrome-tabs-item",{},[te("active",[y("&:hover",{},[x("content",{backgroundColor:"var(--primary-color-dark)"})])]),x("background",{},[x("block",{backgroundColor:"var(--active-background-color-dark)"}),y("svg",{fill:"var(--active-background-color-dark)"})])])])])}const T=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},qe={name:"LineMdLoadingTwotoneLoop"},Ge={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ze(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Ge,t[0]||(t[0]=[r.createStaticVNode('<g fill="none" stroke="#757575" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"></animate><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"></animateTransform></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity=".3" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"></animate></path></g>',1)]))}const Ue=T(qe,[["render",Ze]]),Ke={name:"RiCloseLine"},Ye={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Je(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Ye,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)]))}const Qe=T(Ke,[["render",Je]]),ne=r.defineComponent({__name:"TabItem",props:{label:{type:[String,Function]},icon:{type:Function},closable:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},loadingIcon:{type:Function},onClick:{type:Function},onContextMenu:{type:Function},onClose:{type:Function},activeIndex:{default:0},index:{}},emits:["itemClick","itemContextmenu","itemClose"],setup(e,{emit:t}){const n=t,o=r.computed(()=>e.activeIndex!==e.index&&e.activeIndex!==e.index-1),i=r.computed(()=>e.activeIndex===e.index),l=r.computed(()=>typeof e.label=="string"?r.h("span",{class:`${$}__label`},e.label):e.label),s=r.computed(()=>e.loadingIcon??r.h(Ue));function a(m){m.stopPropagation(),n("itemClick",m),e.onClick?.(m)}function d(m){n("itemContextmenu",m),e.onContextMenu?.(m)}function f(){n("itemClose"),e.onClose?.()}return(m,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref($),{[`${r.unref($)}--active`]:i.value,[`${r.unref($)}--disabled`]:m.disabled}]),onClick:a,onContextmenu:d},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__content`])},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__icon`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.loading?s.value:m.icon)))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__slot`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value)))],2),m.closable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref($)}__close`]),onClick:r.withModifiers(f,["stop"])},[r.createVNode(Qe)],2)):r.createCommentVNode("",!0)],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__background`])},[u[0]||(u[0]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z"})],-1)),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__block`])},null,2),u[1]||(u[1]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z"})],-1))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__line`,o.value?`${r.unref($)}__line--show`:""])},null,2)],34))}});function oe(e){return r.getCurrentScope()?(r.onScopeDispose(e),!0):!1}const Xe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const et=Object.prototype.toString,tt=e=>et.call(e)==="[object Object]",re=()=>{};function nt(e,t){function n(...o){return new Promise((i,l)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(l)})}return n}function ot(e,t={}){let n,o,i=re;const l=d=>{clearTimeout(d),i(),i=re};let s;return d=>{const f=r.toValue(e),m=r.toValue(t.maxWait);return n&&l(n),f<=0||m!==void 0&&m<=0?(o&&(l(o),o=void 0),Promise.resolve(d())):new Promise((u,g)=>{i=t.rejectOnCancel?g:u,s=d,m&&!o&&(o=setTimeout(()=>{n&&l(n),o=void 0,u(s())},m)),n=setTimeout(()=>{o&&l(o),o=void 0,u(d())},f)})}}function j(e){return Array.isArray(e)?e:[e]}function rt(e){return r.getCurrentInstance()}function it(e,t=200,n={}){return nt(ot(t,n),e)}function lt(e,t=!0,n){rt()?r.onMounted(e,n):t?e():r.nextTick(e)}function st(e,t,n){return r.watch(e,t,{...n,immediate:!0})}const F=Xe?window:void 0;function I(e){var t;const n=r.toValue(e);return(t=n?.$el)!=null?t:n}function at(...e){const t=[],n=()=>{t.forEach(a=>a()),t.length=0},o=(a,d,f,m)=>(a.addEventListener(d,f,m),()=>a.removeEventListener(d,f,m)),i=r.computed(()=>{const a=j(r.toValue(e[0])).filter(d=>d!=null);return a.every(d=>typeof d!="string")?a:void 0}),l=st(()=>{var a,d;return[(d=(a=i.value)==null?void 0:a.map(f=>I(f)))!=null?d:[F].filter(f=>f!=null),j(r.toValue(i.value?e[1]:e[0])),j(r.unref(i.value?e[2]:e[1])),r.toValue(i.value?e[3]:e[2])]},([a,d,f,m])=>{if(n(),!a?.length||!d?.length||!f?.length)return;const u=tt(m)?{...m}:m;t.push(...a.flatMap(g=>d.flatMap(E=>f.map(c=>o(g,E,c,u)))))},{flush:"post"}),s=()=>{l(),n()};return oe(n),s}function ct(){const e=r.shallowRef(!1),t=r.getCurrentInstance();return t&&r.onMounted(()=>{e.value=!0},t),e}function ut(e){const t=ct();return r.computed(()=>(t.value,!!e()))}function ft(e,t,n={}){const{window:o=F,...i}=n;let l;const s=ut(()=>o&&"ResizeObserver"in o),a=()=>{l&&(l.disconnect(),l=void 0)},d=r.computed(()=>{const u=r.toValue(e);return Array.isArray(u)?u.map(g=>I(g)):[I(u)]}),f=r.watch(d,u=>{if(a(),s.value&&o){l=new ResizeObserver(t);for(const g of u)g&&l.observe(g,i)}},{immediate:!0,flush:"post"}),m=()=>{a(),f()};return oe(m),{isSupported:s,stop:m}}function dt(e,t={width:0,height:0},n={}){const{window:o=F,box:i="content-box"}=n,l=r.computed(()=>{var u,g;return(g=(u=I(e))==null?void 0:u.namespaceURI)==null?void 0:g.includes("svg")}),s=r.shallowRef(t.width),a=r.shallowRef(t.height),{stop:d}=ft(e,([u])=>{const g=i==="border-box"?u.borderBoxSize:i==="content-box"?u.contentBoxSize:u.devicePixelContentBoxSize;if(o&&l.value){const E=I(e);if(E){const c=E.getBoundingClientRect();s.value=c.width,a.value=c.height}}else if(g){const E=j(g);s.value=E.reduce((c,{inlineSize:b})=>c+b,0),a.value=E.reduce((c,{blockSize:b})=>c+b,0)}else s.value=u.contentRect.width,a.value=u.contentRect.height},n);lt(()=>{const u=I(e);u&&(s.value="offsetWidth"in u?u.offsetWidth:t.width,a.value="offsetHeight"in u?u.offsetHeight:t.height)});const f=r.watch(()=>I(e),u=>{s.value=u?t.width:0,a.value=u?t.height:0});function m(){d(),f()}return{width:s,height:a,stop:m}}function mt(e){const{activeClassName:t=".active",enableWheel:n=!0,direction:o="vertical"}=e??{},i=r.ref(),{width:l,height:s}=dt(i);async function a(m){await r.nextTick();const u=i.value?.querySelector(t);u&&u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest",...m})}function d(m){if(!n)return;m.preventDefault();const{deltaY:u}=m;switch(o){case"vertical":i.value?.scrollBy({top:u>0?s.value:-s.value,behavior:"smooth"});break;case"horizontal":i.value?.scrollBy({left:u>0?l.value:-l.value,behavior:"smooth"});break}}at(i,"wheel",d);const f=it(a,500);return r.watch([l,s],()=>{f()}),{scrollRef:i,scrollToView:a}}var ht={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},k=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},C=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},ie=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},le=function(e){return{r:C(e.r,0,255),g:C(e.g,0,255),b:C(e.b,0,255),a:C(e.a)}},q=function(e){return{r:k(e.r),g:k(e.g),b:k(e.b),a:k(e.a,3)}},pt=/^#([0-9a-f]{3,8})$/i,P=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},se=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),s=l-Math.min(t,n,o),a=s?l===t?(n-o)/s:l===n?2+(o-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:l?s/l*100:0,v:l/255*100,a:i}},ae=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),s=o*(1-n),a=o*(1-(t-l)*n),d=o*(1-(1-t+l)*n),f=l%6;return{r:255*[o,a,s,s,d,o][f],g:255*[d,o,o,a,s,s][f],b:255*[s,s,d,o,o,a][f],a:i}},ce=function(e){return{h:ie(e.h),s:C(e.s,0,100),l:C(e.l,0,100),a:C(e.a)}},ue=function(e){return{h:k(e.h),s:k(e.s),l:k(e.l),a:k(e.a,3)}},fe=function(e){return ae((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},_=function(e){return{h:(t=se(e)).h,s:(i=(200-(n=t.s))*(o=t.v)/100)>0&&i<200?n*o/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,o,i},bt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,yt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,de={string:[[function(e){var t=pt.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?k(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?k(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=xt.exec(e)||yt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:le({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=bt.exec(e)||gt.exec(e);if(!t)return null;var n,o,i=ce({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(ht[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return fe(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=i===void 0?1:i;return N(t)&&N(n)&&N(o)?le({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=ce({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return fe(s)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=function(a){return{h:ie(a.h),s:C(a.s,0,100),v:C(a.v,0,100),a:C(a.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return ae(s)},"hsv"]]},me=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},kt=function(e){return typeof e=="string"?me(e.trim(),de.string):typeof e=="object"&&e!==null?me(e,de.object):[null,void 0]},G=function(e,t){var n=_(e);return{h:n.h,s:C(n.s+100*t,0,100),l:n.l,a:n.a}},Z=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},he=function(e,t){var n=_(e);return{h:n.h,s:n.s,l:C(n.l+100*t,0,100),a:n.a}},pe=function(){function e(t){this.parsed=kt(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return k(Z(this.rgba),2)},e.prototype.isDark=function(){return Z(this.rgba)<.5},e.prototype.isLight=function(){return Z(this.rgba)>=.5},e.prototype.toHex=function(){return t=q(this.rgba),n=t.r,o=t.g,i=t.b,s=(l=t.a)<1?P(k(255*l)):"","#"+P(n)+P(o)+P(i)+s;var t,n,o,i,l,s},e.prototype.toRgb=function(){return q(this.rgba)},e.prototype.toRgbString=function(){return t=q(this.rgba),n=t.r,o=t.g,i=t.b,(l=t.a)<1?"rgba("+n+", "+o+", "+i+", "+l+")":"rgb("+n+", "+o+", "+i+")";var t,n,o,i,l},e.prototype.toHsl=function(){return ue(_(this.rgba))},e.prototype.toHslString=function(){return t=ue(_(this.rgba)),n=t.h,o=t.s,i=t.l,(l=t.a)<1?"hsla("+n+", "+o+"%, "+i+"%, "+l+")":"hsl("+n+", "+o+"%, "+i+"%)";var t,n,o,i,l},e.prototype.toHsv=function(){return t=se(this.rgba),{h:k(t.h),s:k(t.s),v:k(t.v),a:k(t.a,3)};var t},e.prototype.invert=function(){return w({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),w(G(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),w(G(this.rgba,-t))},e.prototype.grayscale=function(){return w(G(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),w(he(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),w(he(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?w({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):k(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=_(this.rgba);return typeof t=="number"?w({h:t,s:n.s,l:n.l,a:n.a}):k(n.h)},e.prototype.isEqual=function(t){return this.toHex()===w(t).toHex()},e}(),w=function(e){return e instanceof pe?e:new pe(e)};const vt={name:"RiAddLine"},$t={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ct(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",$t,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)]))}const wt=T(vt,[["render",Ct]]),Et={name:"RiArrowDropDownLine"},Nt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Bt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Nt,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414z"},null,-1)]))}const It=T(Et,[["render",Bt]]),Mt=r.defineComponent({__name:"Tabs",props:r.mergeModels({colors:{},dropdown:{type:Boolean},addable:{type:Boolean},options:{}},{value:{},valueModifiers:{}}),emits:r.mergeModels(["click","contextmenu","close","add"],["update:value"]),setup(e,{emit:t}){const n=t;De("n-chrome-tabs",Fe());const{background:o="#E5E7EB",active:i="#fff",primary:l="rgba(251,191,36,1)"}=e.colors??{},s=r.useModel(e,"value"),a=r.computed(()=>e.options?.findIndex(h=>h.key===s.value)),{scrollRef:d,scrollToView:f}=mt({activeClassName:`.${$}--active`,direction:"horizontal"});r.watch(s,()=>{f()},{immediate:!0});const m=r.computed(()=>w(o).darken(.9).toHex()),u=r.computed(()=>w(i).darken(.8).toHex()),g=r.computed(()=>w(l).darken(.3).toHex());function E(h){n("click",h)}function c(h){n("contextmenu",h)}function b(h){n("close",h)}return(h,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(V)]),style:r.normalizeStyle({"--background-color":`${r.unref(o)}`,"--background-color-dark":`${m.value}`,"--active-background-color":`${r.unref(i)}`,"--active-background-color-dark":`${u.value}`,"--primary-color":`${r.unref(l)}`,"--primary-color-dark":`${g.value}`})},[h.dropdown?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(V)}__icon`])},[r.createVNode(It)],2)):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"prefix"),r.createElementVNode("div",{ref_key:"scrollRef",ref:d,class:r.normalizeClass([`${r.unref(V)}__content`])},[r.createVNode(r.TransitionGroup,{name:"group",tag:"div",class:r.normalizeClass([`${r.unref(V)}__scroll`])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.options,({key:v,...A},S)=>(r.openBlock(),r.createBlock(ne,r.mergeProps({key:v},{ref_for:!0},A,{index:S,"active-index":a.value,onItemClick:O=>E(v),onItemContextmenu:O=>c(v),onItemClose:O=>b(v)}),null,16,["index","active-index","onItemClick","onItemContextmenu","onItemClose"]))),128))]),_:1},8,["class"])],2),r.renderSlot(h.$slots,"suffix"),h.addable?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([`${r.unref(V)}__icon`]),onClick:p[0]||(p[0]=v=>n("add"))},[r.createVNode(wt)],2)):r.createCommentVNode("",!0)],6))}});B.CTabItem=ne,B.CTabs=Mt,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
14
+ </style>`}function je(e,t,n){const{styles:o,ids:i}=n;i.has(e)||o!==null&&(i.add(e),o.push(Te(e,t)))}const Pe=typeof document<"u";function Oe(){if(Pe)return;const e=r.inject(Le,null);if(e!==null)return{adapter:(t,n)=>je(t,n,e),context:e}}function De(e,t){const n=Oe();function o(){t.mount({id:e,head:!0,ssr:n})}n?o():r.onBeforeMount(()=>{o()})}const{cssr:He,plugin:We,namespace:ee}=ze(),{c:x,cB:L,cE:y,cM:W,cNotM:te}={...He,...We},V=`${ee}-chrome-tabs`,$=`${ee}-chrome-tabs-item`,M="all .2s cubic-bezier(.4, 0, .2, 1)";function Fe(){return x([L("chrome-tabs",{display:"flex",width:"100%",height:"40px",padding:"0 10px",alignItems:"center",backgroundColor:"var(--background-color)",color:"var(--background-color-dark)"},[x("div",{boxSizing:"border-box"}),x(".group-move, .group-enter-active, .group-leave-active",{transition:M}),x(".group-enter-from, .group-leave-to",{opacity:0}),x(".group-leave-active",{}),y("prefix",{}),y("icon",{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",padding:"5px",borderRadius:"10px",backgroundColor:"var(--active-background-color)",transition:M},[x("svg",{width:"100%",height:"100%",fill:"currentColor"}),x("&:hover",{backgroundColor:"var(--primary-color)"})]),y("content",{flex:"1",height:"100%",minWidth:0,overflow:"hidden",marginLeft:"-6px",padding:"0 10px"}),y("scroll",{position:"relative",display:"flex",alignItems:"center",height:"100%"},[y("icon",{marginLeft:"5px",borderRadius:"50%",backgroundColor:"transparent",flexShrink:0},[x("&:hover",{backgroundColor:"var(--primary-color)"})])]),y("suffix",{})]),L("chrome-tabs-item",{position:"relative",margin:"0 -5px",height:"100%",flexShrink:0,cursor:"default",userSelect:"none",padding:"6px 10px 0px 10px"},[W("disabled",{cursor:"not-allowed",pointerEvents:"none",opacity:.5,filter:"grayscale(0.5)"}),W("active",[y("background",{opacity:1})]),te("active",[x("&:hover",{},[y("content",{backgroundColor:"var(--primary-color)"})])]),x("&::first-child",{marginLeft:"0 !important"}),x("&::last-child",{marginRight:"0 !important"}),y("content",{position:"relative",zIndex:1,height:"28px",display:"flex",alignItems:"center",gap:"5px",borderRadius:"10px",padding:"0 10px",transition:M}),y("slot",{}),y("icon",{lineHeight:1},[x("svg",{width:"1.2em",height:"1.2em",fill:"currentColor"})]),y("close",{width:"16px",height:"16px",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:M},[x("&:hover",{backgroundColor:"rgba(0,0,0,0.1)"}),x("svg",{width:"100%",height:"100%",fill:"currentColor"})]),y("background",{position:"absolute",opacity:0,left:0,bottom:0,zIndex:0,height:"34px",width:"100%",display:"flex",alignItems:"flex-end",transition:M},[y("block",{height:"100%",flex:1,minWidth:0,borderRadius:"10px 10px 0 0",backgroundColor:"var(--active-background-color)"}),x("svg",{fill:"var(--active-background-color)"})]),y("line",{position:"absolute",bottom:"12px",right:"4px",height:"16px",width:"2px",borderRadius:"1px",transition:M,backgroundColor:"var(--primary-color)",opacity:0},[W("show",{opacity:1})])]),x(".dark",[L("chrome-tabs",{backgroundColor:"var(--background-color-dark)",color:"var(--background-color)"},[y("icon",{backgroundColor:"var(--active-background-color-dark)"},[x("&:hover",{backgroundColor:"var(--primary-color-dark)"})])]),L("chrome-tabs-item",{},[te("active",[x("&:hover",{},[y("content",{backgroundColor:"var(--primary-color-dark)"})])]),y("background",{},[y("block",{backgroundColor:"var(--active-background-color-dark)"}),x("svg",{fill:"var(--active-background-color-dark)"})])])])])}const T=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},qe={name:"LineMdLoadingTwotoneLoop"},Ge={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ze(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Ge,t[0]||(t[0]=[r.createStaticVNode('<g fill="none" stroke="#757575" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"></animate><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"></animateTransform></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity=".3" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"></animate></path></g>',1)]))}const Ue=T(qe,[["render",Ze]]),Ke={name:"RiCloseLine"},Ye={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Je(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Ye,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)]))}const Qe=T(Ke,[["render",Je]]),ne=r.defineComponent({__name:"TabItem",props:{label:{type:[String,Function]},icon:{type:Function},closable:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},loadingIcon:{type:Function},onClick:{type:Function},onContextMenu:{type:Function},onClose:{type:Function},activeIndex:{default:0},index:{}},emits:["itemClick","itemContextmenu","itemClose"],setup(e,{emit:t}){const n=t,o=r.computed(()=>e.activeIndex!==e.index&&e.activeIndex!==e.index-1),i=r.computed(()=>e.activeIndex===e.index),l=r.computed(()=>typeof e.label=="string"?r.h("span",{class:`${$}__label`},e.label):e.label),s=r.computed(()=>e.loadingIcon??r.h(Ue));function a(m){m.stopPropagation(),n("itemClick",m),e.onClick?.(m)}function f(m){n("itemContextmenu",m),e.onContextMenu?.(m)}function d(){n("itemClose"),e.onClose?.()}return(m,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref($),{[`${r.unref($)}--active`]:i.value,[`${r.unref($)}--disabled`]:m.disabled}]),onClick:a,onContextmenu:f},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__content`])},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__icon`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.loading?s.value:m.icon)))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__slot`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value)))],2),m.closable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref($)}__close`]),onClick:r.withModifiers(d,["stop"])},[r.createVNode(Qe)],2)):r.createCommentVNode("",!0)],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__background`])},[u[0]||(u[0]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z"})],-1)),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__block`])},null,2),u[1]||(u[1]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z"})],-1))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__line`,o.value?`${r.unref($)}__line--show`:""])},null,2)],34))}});function oe(e){return r.getCurrentScope()?(r.onScopeDispose(e),!0):!1}const Xe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const et=Object.prototype.toString,tt=e=>et.call(e)==="[object Object]",re=()=>{};function nt(e,t){function n(...o){return new Promise((i,l)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(l)})}return n}function ot(e,t={}){let n,o,i=re;const l=f=>{clearTimeout(f),i(),i=re};let s;return f=>{const d=r.toValue(e),m=r.toValue(t.maxWait);return n&&l(n),d<=0||m!==void 0&&m<=0?(o&&(l(o),o=void 0),Promise.resolve(f())):new Promise((u,g)=>{i=t.rejectOnCancel?g:u,s=f,m&&!o&&(o=setTimeout(()=>{n&&l(n),o=void 0,u(s())},m)),n=setTimeout(()=>{o&&l(o),o=void 0,u(f())},d)})}}function j(e){return Array.isArray(e)?e:[e]}function rt(e){return r.getCurrentInstance()}function it(e,t=200,n={}){return nt(ot(t,n),e)}function lt(e,t=!0,n){rt()?r.onMounted(e,n):t?e():r.nextTick(e)}function st(e,t,n){return r.watch(e,t,{...n,immediate:!0})}const F=Xe?window:void 0;function I(e){var t;const n=r.toValue(e);return(t=n?.$el)!=null?t:n}function at(...e){const t=[],n=()=>{t.forEach(a=>a()),t.length=0},o=(a,f,d,m)=>(a.addEventListener(f,d,m),()=>a.removeEventListener(f,d,m)),i=r.computed(()=>{const a=j(r.toValue(e[0])).filter(f=>f!=null);return a.every(f=>typeof f!="string")?a:void 0}),l=st(()=>{var a,f;return[(f=(a=i.value)==null?void 0:a.map(d=>I(d)))!=null?f:[F].filter(d=>d!=null),j(r.toValue(i.value?e[1]:e[0])),j(r.unref(i.value?e[2]:e[1])),r.toValue(i.value?e[3]:e[2])]},([a,f,d,m])=>{if(n(),!a?.length||!f?.length||!d?.length)return;const u=tt(m)?{...m}:m;t.push(...a.flatMap(g=>f.flatMap(E=>d.map(c=>o(g,E,c,u)))))},{flush:"post"}),s=()=>{l(),n()};return oe(n),s}function ct(){const e=r.shallowRef(!1),t=r.getCurrentInstance();return t&&r.onMounted(()=>{e.value=!0},t),e}function ut(e){const t=ct();return r.computed(()=>(t.value,!!e()))}function dt(e,t,n={}){const{window:o=F,...i}=n;let l;const s=ut(()=>o&&"ResizeObserver"in o),a=()=>{l&&(l.disconnect(),l=void 0)},f=r.computed(()=>{const u=r.toValue(e);return Array.isArray(u)?u.map(g=>I(g)):[I(u)]}),d=r.watch(f,u=>{if(a(),s.value&&o){l=new ResizeObserver(t);for(const g of u)g&&l.observe(g,i)}},{immediate:!0,flush:"post"}),m=()=>{a(),d()};return oe(m),{isSupported:s,stop:m}}function ft(e,t={width:0,height:0},n={}){const{window:o=F,box:i="content-box"}=n,l=r.computed(()=>{var u,g;return(g=(u=I(e))==null?void 0:u.namespaceURI)==null?void 0:g.includes("svg")}),s=r.shallowRef(t.width),a=r.shallowRef(t.height),{stop:f}=dt(e,([u])=>{const g=i==="border-box"?u.borderBoxSize:i==="content-box"?u.contentBoxSize:u.devicePixelContentBoxSize;if(o&&l.value){const E=I(e);if(E){const c=E.getBoundingClientRect();s.value=c.width,a.value=c.height}}else if(g){const E=j(g);s.value=E.reduce((c,{inlineSize:b})=>c+b,0),a.value=E.reduce((c,{blockSize:b})=>c+b,0)}else s.value=u.contentRect.width,a.value=u.contentRect.height},n);lt(()=>{const u=I(e);u&&(s.value="offsetWidth"in u?u.offsetWidth:t.width,a.value="offsetHeight"in u?u.offsetHeight:t.height)});const d=r.watch(()=>I(e),u=>{s.value=u?t.width:0,a.value=u?t.height:0});function m(){f(),d()}return{width:s,height:a,stop:m}}function mt(e){const{activeClassName:t=".active",enableWheel:n=!0,direction:o="vertical"}=e??{},i=r.ref(),{width:l,height:s}=ft(i);async function a(m){await r.nextTick();const u=i.value?.querySelector(t);u&&u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest",...m})}function f(m){if(!n)return;m.preventDefault();const{deltaY:u}=m;switch(o){case"vertical":i.value?.scrollBy({top:u>0?s.value:-s.value,behavior:"smooth"});break;case"horizontal":i.value?.scrollBy({left:u>0?l.value:-l.value,behavior:"smooth"});break}}at(i,"wheel",f);const d=it(a,500);return r.watch([l,s],()=>{d()}),{scrollRef:i,scrollToView:a}}var ht={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},k=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},C=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},ie=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},le=function(e){return{r:C(e.r,0,255),g:C(e.g,0,255),b:C(e.b,0,255),a:C(e.a)}},q=function(e){return{r:k(e.r),g:k(e.g),b:k(e.b),a:k(e.a,3)}},pt=/^#([0-9a-f]{3,8})$/i,P=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},se=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),s=l-Math.min(t,n,o),a=s?l===t?(n-o)/s:l===n?2+(o-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:l?s/l*100:0,v:l/255*100,a:i}},ae=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),s=o*(1-n),a=o*(1-(t-l)*n),f=o*(1-(1-t+l)*n),d=l%6;return{r:255*[o,a,s,s,f,o][d],g:255*[f,o,o,a,s,s][d],b:255*[s,s,f,o,o,a][d],a:i}},ce=function(e){return{h:ie(e.h),s:C(e.s,0,100),l:C(e.l,0,100),a:C(e.a)}},ue=function(e){return{h:k(e.h),s:k(e.s),l:k(e.l),a:k(e.a,3)}},de=function(e){return ae((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},_=function(e){return{h:(t=se(e)).h,s:(i=(200-(n=t.s))*(o=t.v)/100)>0&&i<200?n*o/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,o,i},bt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,yt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fe={string:[[function(e){var t=pt.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?k(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?k(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=xt.exec(e)||yt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:le({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=bt.exec(e)||gt.exec(e);if(!t)return null;var n,o,i=ce({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(ht[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return de(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=i===void 0?1:i;return N(t)&&N(n)&&N(o)?le({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=ce({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return de(s)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=function(a){return{h:ie(a.h),s:C(a.s,0,100),v:C(a.v,0,100),a:C(a.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return ae(s)},"hsv"]]},me=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},kt=function(e){return typeof e=="string"?me(e.trim(),fe.string):typeof e=="object"&&e!==null?me(e,fe.object):[null,void 0]},G=function(e,t){var n=_(e);return{h:n.h,s:C(n.s+100*t,0,100),l:n.l,a:n.a}},Z=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},he=function(e,t){var n=_(e);return{h:n.h,s:n.s,l:C(n.l+100*t,0,100),a:n.a}},pe=function(){function e(t){this.parsed=kt(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return k(Z(this.rgba),2)},e.prototype.isDark=function(){return Z(this.rgba)<.5},e.prototype.isLight=function(){return Z(this.rgba)>=.5},e.prototype.toHex=function(){return t=q(this.rgba),n=t.r,o=t.g,i=t.b,s=(l=t.a)<1?P(k(255*l)):"","#"+P(n)+P(o)+P(i)+s;var t,n,o,i,l,s},e.prototype.toRgb=function(){return q(this.rgba)},e.prototype.toRgbString=function(){return t=q(this.rgba),n=t.r,o=t.g,i=t.b,(l=t.a)<1?"rgba("+n+", "+o+", "+i+", "+l+")":"rgb("+n+", "+o+", "+i+")";var t,n,o,i,l},e.prototype.toHsl=function(){return ue(_(this.rgba))},e.prototype.toHslString=function(){return t=ue(_(this.rgba)),n=t.h,o=t.s,i=t.l,(l=t.a)<1?"hsla("+n+", "+o+"%, "+i+"%, "+l+")":"hsl("+n+", "+o+"%, "+i+"%)";var t,n,o,i,l},e.prototype.toHsv=function(){return t=se(this.rgba),{h:k(t.h),s:k(t.s),v:k(t.v),a:k(t.a,3)};var t},e.prototype.invert=function(){return w({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),w(G(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),w(G(this.rgba,-t))},e.prototype.grayscale=function(){return w(G(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),w(he(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),w(he(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?w({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):k(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=_(this.rgba);return typeof t=="number"?w({h:t,s:n.s,l:n.l,a:n.a}):k(n.h)},e.prototype.isEqual=function(t){return this.toHex()===w(t).toHex()},e}(),w=function(e){return e instanceof pe?e:new pe(e)};const vt={name:"RiAddLine"},$t={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ct(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",$t,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)]))}const wt=T(vt,[["render",Ct]]),Et={name:"RiArrowDropDownLine"},Nt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Bt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Nt,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414z"},null,-1)]))}const It=T(Et,[["render",Bt]]),Mt=r.defineComponent({__name:"Tabs",props:r.mergeModels({colors:{},dropdown:{type:Boolean},addable:{type:Boolean},options:{}},{value:{},valueModifiers:{}}),emits:r.mergeModels(["click","contextmenu","close","add"],["update:value"]),setup(e,{emit:t}){const n=t;De("n-chrome-tabs",Fe());const{background:o="#E5E7EB",active:i="#fff",primary:l="rgba(251,191,36,1)"}=e.colors??{},s=r.useModel(e,"value"),a=r.computed(()=>e.options?.findIndex(h=>h.key===s.value)),{scrollRef:f,scrollToView:d}=mt({activeClassName:`.${$}--active`,direction:"horizontal"});r.watch(s,()=>{d()},{immediate:!0});const m=r.computed(()=>w(o).darken(.9).toHex()),u=r.computed(()=>w(i).darken(.8).toHex()),g=r.computed(()=>w(l).darken(.3).toHex());function E(h){n("click",h)}function c(h){n("contextmenu",h)}function b(h){n("close",h)}return(h,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(V)]),style:r.normalizeStyle({"--background-color":`${r.unref(o)}`,"--background-color-dark":`${m.value}`,"--active-background-color":`${r.unref(i)}`,"--active-background-color-dark":`${u.value}`,"--primary-color":`${r.unref(l)}`,"--primary-color-dark":`${g.value}`})},[h.dropdown?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(V)}__icon`])},[r.createVNode(It)],2)):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"prefix"),r.createElementVNode("div",{ref_key:"scrollRef",ref:f,class:r.normalizeClass([`${r.unref(V)}__content`])},[r.createVNode(r.TransitionGroup,{name:"group",tag:"div",class:r.normalizeClass([`${r.unref(V)}__scroll`])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.options,({key:v,...A},S)=>(r.openBlock(),r.createBlock(ne,r.mergeProps({key:v},{ref_for:!0},A,{index:S,"active-index":a.value,onItemClick:O=>E(v),onItemContextmenu:O=>c(v),onItemClose:O=>b(v)}),null,16,["index","active-index","onItemClick","onItemContextmenu","onItemClose"]))),128))]),_:1},8,["class"])],2),r.renderSlot(h.$slots,"suffix"),h.addable?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([`${r.unref(V)}__icon`]),onClick:p[0]||(p[0]=v=>n("add"))},[r.createVNode(wt)],2)):r.createCommentVNode("",!0)],6))}});B.CTabItem=ne,B.CTabs=Mt,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oiij/chrome-tabs",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "description": "A Vue Component Likes Chrome Tabs Style.",
6
6
  "author": "oiij",
7
7
  "license": "MIT",
@@ -36,13 +36,13 @@
36
36
  "colord": "^2.9.3",
37
37
  "vue": "^3.5.13",
38
38
  "@oiij/css-render": "0.0.2",
39
- "@oiij/use": "0.0.16"
39
+ "@oiij/use": "0.0.17"
40
40
  },
41
41
  "devDependencies": {
42
42
  "colord": "^2.9.3",
43
43
  "vue": "^3.5.17",
44
44
  "@oiij/css-render": "0.0.2",
45
- "@oiij/use": "0.0.16"
45
+ "@oiij/use": "0.0.17"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"