const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/SystemTagPicker-BVXKy5nQ.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Bndk0DrU.chunk.mjs'),window.OC.filePath('', '', 'dist/index-JpgrUA2Z-BYgeawUc.chunk.mjs'),window.OC.filePath('', '', 'dist/index-DCpg1aui.chunk.mjs'),window.OC.filePath('', '', 'dist/index-BrC2bLMO.chunk.mjs'),window.OC.filePath('', '', 'dist/runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_WKCRq3.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-Bni_xMHF.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-CklyzrxW.chunk.mjs'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-R3us1MM8.chunk.css'),window.OC.filePath('', '', 'dist/mdi-Bm11w6Fn.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/index-CySLkPBX.chunk.css'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-C71YD40i.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-Jq77EThs.chunk.css'),window.OC.filePath('', '', 'dist/NcCheckboxRadioSwitch-BMsPx74L-CrcuxmoM.chunk.mjs'),window.OC.filePath('', '', 'dist/NcCheckboxRadioSwitch-BMsPx74L-CQwJiKOs.chunk.css'),window.OC.filePath('', '', 'dist/NcChip-B71t2Ny2-efwz32oA.chunk.mjs'),window.OC.filePath('', '', 'dist/PencilOutline-BR85Y6ME.chunk.mjs'),window.OC.filePath('', '', 'dist/PencilOutline-DdQinVMt.chunk.css'),window.OC.filePath('', '', 'dist/NcChip-B71t2Ny2-Som-mR4B.chunk.css'),window.OC.filePath('', '', 'dist/NcColorPicker-DDHxR-iN-BXwxdmCO.chunk.mjs'),window.OC.filePath('', '', 'dist/colors-BHGKZFDI-BKHpzg2v.chunk.mjs'),window.OC.filePath('', '', 'dist/NcColorPicker-DDHxR-iN-Bwe91UZ7.chunk.css'),window.OC.filePath('', '', 'dist/Plus-QzdZMNfM.chunk.mjs'),window.OC.filePath('', '', 'dist/Plus-DoZPzs7J.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-B5FsJrKA.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-DJtp_yB7.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-BYlw6Xsd.chunk.css'),window.OC.filePath('', '', 'dist/api-BBzfFEqa.chunk.mjs'),window.OC.filePath('', '', 'dist/index-BT4ljBnH.chunk.mjs'),window.OC.filePath('', '', 'dist/string_decoder-BO00msnV.chunk.mjs'),window.OC.filePath('', '', 'dist/index-CLPHpMLr.chunk.mjs'),window.OC.filePath('', '', 'dist/NcPasswordField-uaMO2pdt-Bi58_jEx.chunk.mjs'),window.OC.filePath('', '', 'dist/NcPasswordField-uaMO2pdt-DxPSRxK-.chunk.css'),window.OC.filePath('', '', 'dist/dav-SmFgKjZ4.chunk.mjs'),window.OC.filePath('', '', 'dist/index-JSJM6V6X.chunk.mjs'),window.OC.filePath('', '', 'dist/public-Sa--me8z.chunk.mjs'),window.OC.filePath('', '', 'dist/index-CuwFxdv0.chunk.mjs'),window.OC.filePath('', '', 'dist/systemtags-SystemTagPicker-r37hCiyq.chunk.css')])))=>i.map(i=>d[i]); import{c as ne,g as te,V as oe,D as ae,b as E}from"./index-CuwFxdv0.chunk.mjs";import{g as se,e as R,f as le,r as ie,a as ce,b as ue,c as he}from"./dav-SmFgKjZ4.chunk.mjs";import{_ as U}from"./index-DCpg1aui.chunk.mjs";import{i as de,P,b as H,F as D}from"./public-Sa--me8z.chunk.mjs";import{t as w}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{s as B}from"./index-BrC2bLMO.chunk.mjs";import{a as J}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{s as O,a as Z}from"./index-Bndk0DrU.chunk.mjs";import{e as ge,f as W,l as be}from"./api-BBzfFEqa.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./createElementId-DhjFt1I9-C_WKCRq3.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";import"./logger-D3RVzcfQ-CklyzrxW.chunk.mjs";import"./mdi-Bm11w6Fn.chunk.mjs";import"./index-BT4ljBnH.chunk.mjs";import"./index-CLPHpMLr.chunk.mjs";import"./NcPasswordField-uaMO2pdt-Bi58_jEx.chunk.mjs";import"./NcInputField-o5OFv3z6-DJtp_yB7.chunk.mjs";const Y='';async function T({nodes:e}){const r=await B(J(()=>U(()=>import("./SystemTagPicker-BVXKy5nQ.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40]),import.meta.url)),{nodes:e});return Array(e.length).fill(r)}const fe={id:"systemtags:bulk",displayName:()=>w("systemtags","Manage tags"),iconSvgInline:()=>Y,enabled({nodes:e}){return de()||e.length===0||e.some(r=>!r.isDavResource)?!1:!e.some(r=>(r.permissions&P.UPDATE)===0)},async exec(e){const[r]=await T(e);return r},execBatch:T,hotkey:{description:w("systemtags","Manage tags"),key:"t"}},me='';function pe(){ne({id:"systemtags",order:20,displayName(){return w("systemtags","Add tags")},enabled(){return!0},iconSvgInline(){return me},onClick({node:e}){return B(J(()=>U(()=>import("./SystemTagPicker-BVXKy5nQ.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40]),import.meta.url)),{nodes:[e]})}})}const S={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in S)Object.freeze(S[e]);const N=Object.freeze(S),G=Object.create(null);for(const e in N)Object.hasOwn(N,e)&&(G[N[e]]=e);const b={to:{},get:{}};b.get=function(e){const r=e.slice(0,3).toLowerCase();let n,t;switch(r){case"hsl":{n=b.get.hsl(e),t="hsl";break}case"hwb":{n=b.get.hwb(e),t="hwb";break}default:{n=b.get.rgb(e),t="rgb";break}}return n?{model:t,value:n}:null},b.get.rgb=function(e){if(!e)return null;const r=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,t=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,o=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,a=/^(\w+)$/;let s=[0,0,0,1],l,i,u;if(l=e.match(n)){for(u=l[2],l=l[1],i=0;i<3;i++){const m=i*2;s[i]=Number.parseInt(l.slice(m,m+2),16)}u&&(s[3]=Number.parseInt(u,16)/255)}else if(l=e.match(r)){for(l=l[1],u=l[3],i=0;i<3;i++)s[i]=Number.parseInt(l[i]+l[i],16);u&&(s[3]=Number.parseInt(u+u,16)/255)}else if(l=e.match(t)){for(i=0;i<3;i++)s[i]=Number.parseFloat(l[i+1]);l[4]&&(s[3]=l[5]?Number.parseFloat(l[4])*.01:Number.parseFloat(l[4]))}else if(l=e.match(o)){for(i=0;i<3;i++)s[i]=Math.round(Number.parseFloat(l[i+1])*2.55);l[4]&&(s[3]=l[5]?Number.parseFloat(l[4])*.01:Number.parseFloat(l[4]))}else return(l=e.toLowerCase().match(a))?l[1]==="transparent"?[0,0,0,0]:Object.hasOwn(N,l[1])?(s=N[l[1]].slice(),s[3]=1,s):null:null;for(i=0;i<3;i++)s[i]=k(s[i],0,255);return s[3]=k(s[3],0,1),s},b.get.hsl=function(e){if(!e)return null;const r=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,n=e.match(r);if(n){const t=Number.parseFloat(n[4]),o=(Number.parseFloat(n[1])%360+360)%360,a=k(Number.parseFloat(n[2]),0,100),s=k(Number.parseFloat(n[3]),0,100),l=k(Number.isNaN(t)?1:t,0,1);return[o,a,s,l]}return null},b.get.hwb=function(e){if(!e)return null;const r=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,n=e.match(r);if(n){const t=Number.parseFloat(n[4]),o=(Number.parseFloat(n[1])%360+360)%360,a=k(Number.parseFloat(n[2]),0,100),s=k(Number.parseFloat(n[3]),0,100),l=k(Number.isNaN(t)?1:t,0,1);return[o,a,s,l]}return null},b.to.hex=function(...e){return"#"+j(e[0])+j(e[1])+j(e[2])+(e[3]<1?j(Math.round(e[3]*255)):"")},b.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},b.to.rgb.percent=function(...e){const r=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),t=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+r+"%, "+n+"%, "+t+"%)":"rgba("+r+"%, "+n+"%, "+t+"%, "+e[3]+")"},b.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},b.to.hwb=function(...e){let r="";return e.length>=4&&e[3]!==1&&(r=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+r+")"},b.to.keyword=function(...e){return G[e.slice(0,3)]};function k(e,r,n){return Math.min(Math.max(r,e),n)}function j(e){const r=Math.round(e).toString(16).toUpperCase();return r.length<2?"0"+r:r}const q={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in q)Object.freeze(q[e]);const A=Object.freeze(q),K={};for(const e of Object.keys(A))K[A[e]]=e;const c={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},y=(6/29)**3;function M(e){const r=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,r),1)}function x(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(c)){if(!("channels"in c[e]))throw new Error("missing channels property: "+e);if(!("labels"in c[e]))throw new Error("missing channel labels property: "+e);if(c[e].labels.length!==c[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:r,labels:n}=c[e];delete c[e].channels,delete c[e].labels,Object.defineProperty(c[e],"channels",{value:r}),Object.defineProperty(c[e],"labels",{value:n})}c.rgb.hsl=function(e){const r=e[0]/255,n=e[1]/255,t=e[2]/255,o=Math.min(r,n,t),a=Math.max(r,n,t),s=a-o;let l,i;switch(a){case o:{l=0;break}case r:{l=(n-t)/s;break}case n:{l=2+(t-r)/s;break}case t:{l=4+(r-n)/s;break}}l=Math.min(l*60,360),l<0&&(l+=360);const u=(o+a)/2;return a===o?i=0:u<=.5?i=s/(a+o):i=s/(2-a-o),[l,i*100,u*100]},c.rgb.hsv=function(e){let r,n,t,o,a;const s=e[0]/255,l=e[1]/255,i=e[2]/255,u=Math.max(s,l,i),m=u-Math.min(s,l,i),p=function(re){return(u-re)/6/m+1/2};if(m===0)o=0,a=0;else{switch(a=m/u,r=p(s),n=p(l),t=p(i),u){case s:{o=t-n;break}case l:{o=1/3+r-t;break}case i:{o=2/3+n-r;break}}o<0?o+=1:o>1&&(o-=1)}return[o*360,a*100,u*100]},c.rgb.hwb=function(e){const r=e[0],n=e[1];let t=e[2];const o=c.rgb.hsl(e)[0],a=1/255*Math.min(r,Math.min(n,t));return t=1-1/255*Math.max(r,Math.max(n,t)),[o,a*100,t*100]},c.rgb.oklab=function(e){const r=x(e[0]/255),n=x(e[1]/255),t=x(e[2]/255),o=Math.cbrt(.4122214708*r+.5363325363*n+.0514459929*t),a=Math.cbrt(.2119034982*r+.6806995451*n+.1073969566*t),s=Math.cbrt(.0883024619*r+.2817188376*n+.6299787005*t),l=.2104542553*o+.793617785*a-.0040720468*s,i=1.9779984951*o-2.428592205*a+.4505937099*s,u=.0259040371*o+.7827717662*a-.808675766*s;return[l*100,i*100,u*100]},c.rgb.cmyk=function(e){const r=e[0]/255,n=e[1]/255,t=e[2]/255,o=Math.min(1-r,1-n,1-t),a=(1-r-o)/(1-o)||0,s=(1-n-o)/(1-o)||0,l=(1-t-o)/(1-o)||0;return[a*100,s*100,l*100,o*100]};function ye(e,r){return(e[0]-r[0])**2+(e[1]-r[1])**2+(e[2]-r[2])**2}c.rgb.keyword=function(e){const r=K[e];if(r)return r;let n=Number.POSITIVE_INFINITY,t;for(const o of Object.keys(A)){const a=A[o],s=ye(e,a);sy?n**(1/3):7.787*n+16/116,t=t>y?t**(1/3):7.787*t+16/116,o=o>y?o**(1/3):7.787*o+16/116;const a=116*t-16,s=500*(n-t),l=200*(t-o);return[a,s,l]},c.hsl.rgb=function(e){const r=e[0]/360,n=e[1]/100,t=e[2]/100;let o,a;if(n===0)return a=t*255,[a,a,a];const s=t<.5?t*(1+n):t+n-t*n,l=2*t-s,i=[0,0,0];for(let u=0;u<3;u++)o=r+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?a=l+(s-l)*6*o:2*o<1?a=s:3*o<2?a=l+(s-l)*(2/3-o)*6:a=l,i[u]=a*255;return i},c.hsl.hsv=function(e){const r=e[0];let n=e[1]/100,t=e[2]/100,o=n;const a=Math.max(t,.01);t*=2,n*=t<=1?t:2-t,o*=a<=1?a:2-a;const s=(t+n)/2,l=t===0?2*o/(a+o):2*n/(t+n);return[r,l*100,s*100]},c.hsv.rgb=function(e){const r=e[0]/60,n=e[1]/100;let t=e[2]/100;const o=Math.floor(r)%6,a=r-Math.floor(r),s=255*t*(1-n),l=255*t*(1-n*a),i=255*t*(1-n*(1-a));switch(t*=255,o){case 0:return[t,i,s];case 1:return[l,t,s];case 2:return[s,t,i];case 3:return[s,l,t];case 4:return[i,s,t];case 5:return[t,s,l]}},c.hsv.hsl=function(e){const r=e[0],n=e[1]/100,t=e[2]/100,o=Math.max(t,.01);let a,s;s=(2-n)*t;const l=(2-n)*o;return a=n*o,a/=l<=1?l:2-l,a=a||0,s/=2,[r,a*100,s*100]},c.hwb.rgb=function(e){const r=e[0]/360;let n=e[1]/100,t=e[2]/100;const o=n+t;let a;o>1&&(n/=o,t/=o);const s=Math.floor(6*r),l=1-t;a=6*r-s,(s&1)!==0&&(a=1-a);const i=n+a*(l-n);let u,m,p;switch(s){default:case 6:case 0:{u=l,m=i,p=n;break}case 1:{u=i,m=l,p=n;break}case 2:{u=n,m=l,p=i;break}case 3:{u=n,m=i,p=l;break}case 4:{u=i,m=n,p=l;break}case 5:{u=l,m=n,p=i;break}}return[u*255,m*255,p*255]},c.cmyk.rgb=function(e){const r=e[0]/100,n=e[1]/100,t=e[2]/100,o=e[3]/100,a=1-Math.min(1,r*(1-o)+o),s=1-Math.min(1,n*(1-o)+o),l=1-Math.min(1,t*(1-o)+o);return[a*255,s*255,l*255]},c.xyz.rgb=function(e){const r=e[0]/100,n=e[1]/100,t=e[2]/100;let o,a,s;return o=r*3.2404542+n*-1.5371385+t*-.4985314,a=r*-.969266+n*1.8760108+t*.041556,s=r*.0556434+n*-.2040259+t*1.0572252,o=M(o),a=M(a),s=M(s),[o*255,a*255,s*255]},c.xyz.lab=function(e){let r=e[0],n=e[1],t=e[2];r/=95.047,n/=100,t/=108.883,r=r>y?r**(1/3):7.787*r+16/116,n=n>y?n**(1/3):7.787*n+16/116,t=t>y?t**(1/3):7.787*t+16/116;const o=116*n-16,a=500*(r-n),s=200*(n-t);return[o,a,s]},c.xyz.oklab=function(e){const r=e[0]/100,n=e[1]/100,t=e[2]/100,o=Math.cbrt(.8189330101*r+.3618667424*n-.1288597137*t),a=Math.cbrt(.0329845436*r+.9293118715*n+.0361456387*t),s=Math.cbrt(.0482003018*r+.2643662691*n+.633851707*t),l=.2104542553*o+.793617785*a-.0040720468*s,i=1.9779984951*o-2.428592205*a+.4505937099*s,u=.0259040371*o+.7827717662*a-.808675766*s;return[l*100,i*100,u*100]},c.oklab.oklch=function(e){return c.lab.lch(e)},c.oklab.xyz=function(e){const r=e[0]/100,n=e[1]/100,t=e[2]/100,o=(.999999998*r+.396337792*n+.215803758*t)**3,a=(1.000000008*r-.105561342*n-.063854175*t)**3,s=(1.000000055*r-.089484182*n-1.291485538*t)**3,l=1.227013851*o-.55779998*a+.281256149*s,i=-.040580178*o+1.11225687*a-.071676679*s,u=-.076381285*o-.421481978*a+1.58616322*s;return[l*100,i*100,u*100]},c.oklab.rgb=function(e){const r=e[0]/100,n=e[1]/100,t=e[2]/100,o=(r+.3963377774*n+.2158037573*t)**3,a=(r-.1055613458*n-.0638541728*t)**3,s=(r-.0894841775*n-1.291485548*t)**3,l=M(4.0767416621*o-3.3077115913*a+.2309699292*s),i=M(-1.2684380046*o+2.6097574011*a-.3413193965*s),u=M(-.0041960863*o-.7034186147*a+1.707614701*s);return[l*255,i*255,u*255]},c.oklch.oklab=function(e){return c.lch.lab(e)},c.lab.xyz=function(e){const r=e[0],n=e[1],t=e[2];let o,a,s;a=(r+16)/116,o=n/500+a,s=a-t/200;const l=a**3,i=o**3,u=s**3;return a=l>y?l:(a-16/116)/7.787,o=i>y?i:(o-16/116)/7.787,s=u>y?u:(s-16/116)/7.787,o*=95.047,a*=100,s*=108.883,[o,a,s]},c.lab.lch=function(e){const r=e[0],n=e[1],t=e[2];let o;o=Math.atan2(t,n)*360/2/Math.PI,o<0&&(o+=360);const a=Math.sqrt(n*n+t*t);return[r,a,o]},c.lch.lab=function(e){const r=e[0],n=e[1],t=e[2]/360*2*Math.PI,o=n*Math.cos(t),a=n*Math.sin(t);return[r,o,a]},c.rgb.ansi16=function(e,r=null){const[n,t,o]=e;let a=r===null?c.rgb.hsv(e)[2]:r;if(a=Math.round(a/50),a===0)return 30;let s=30+(Math.round(o/255)<<2|Math.round(t/255)<<1|Math.round(n/255));return a===2&&(s+=60),s},c.hsv.ansi16=function(e){return c.rgb.ansi16(c.hsv.rgb(e),e[2])},c.rgb.ansi256=function(e){const r=e[0],n=e[1],t=e[2];return r>>4===n>>4&&n>>4===t>>4?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(t/255*5)},c.ansi16.rgb=function(e){e=e[0];let r=e%10;if(r===0||r===7)return e>50&&(r+=3.5),r=r/10.5*255,[r,r,r];const n=(Math.trunc(e>50)+1)*.5,t=(r&1)*n*255,o=(r>>1&1)*n*255,a=(r>>2&1)*n*255;return[t,o,a]},c.ansi256.rgb=function(e){if(e=e[0],e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let r;const n=Math.floor(e/36)/5*255,t=Math.floor((r=e%36)/6)/5*255,o=r%6/5*255;return[n,t,o]},c.rgb.hex=function(e){const r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r},c.hex.rgb=function(e){const r=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!r)return[0,0,0];let n=r[0];r[0].length===3&&(n=[...n].map(l=>l+l).join(""));const t=Number.parseInt(n,16),o=t>>16&255,a=t>>8&255,s=t&255;return[o,a,s]},c.rgb.hcg=function(e){const r=e[0]/255,n=e[1]/255,t=e[2]/255,o=Math.max(Math.max(r,n),t),a=Math.min(Math.min(r,n),t),s=o-a;let l;const i=s<1?a/(1-s):0;return s<=0?l=0:o===r?l=(n-t)/s%6:o===n?l=2+(t-r)/s:l=4+(r-n)/s,l/=6,l%=1,[l*360,s*100,i*100]},c.hsl.hcg=function(e){const r=e[1]/100,n=e[2]/100,t=n<.5?2*r*n:2*r*(1-n);let o=0;return t<1&&(o=(n-.5*t)/(1-t)),[e[0],t*100,o*100]},c.hsv.hcg=function(e){const r=e[1]/100,n=e[2]/100,t=r*n;let o=0;return t<1&&(o=(n-t)/(1-t)),[e[0],t*100,o*100]},c.hcg.rgb=function(e){const r=e[0]/360,n=e[1]/100,t=e[2]/100;if(n===0)return[t*255,t*255,t*255];const o=[0,0,0],a=r%1*6,s=a%1,l=1-s;let i=0;switch(Math.floor(a)){case 0:{o[0]=1,o[1]=s,o[2]=0;break}case 1:{o[0]=l,o[1]=1,o[2]=0;break}case 2:{o[0]=0,o[1]=1,o[2]=s;break}case 3:{o[0]=0,o[1]=l,o[2]=1;break}case 4:{o[0]=s,o[1]=0,o[2]=1;break}default:o[0]=1,o[1]=0,o[2]=l}return i=(1-n)*t,[(n*o[0]+i)*255,(n*o[1]+i)*255,(n*o[2]+i)*255]},c.hcg.hsv=function(e){const r=e[1]/100,n=e[2]/100,t=r+n*(1-r);let o=0;return t>0&&(o=r/t),[e[0],o*100,t*100]},c.hcg.hsl=function(e){const r=e[1]/100,n=e[2]/100*(1-r)+.5*r;let t=0;return n>0&&n<.5?t=r/(2*n):n>=.5&&n<1&&(t=r/(2*(1-n))),[e[0],t*100,n*100]},c.hcg.hwb=function(e){const r=e[1]/100,n=e[2]/100,t=r+n*(1-r);return[e[0],(t-r)*100,(1-t)*100]},c.hwb.hcg=function(e){const r=e[1]/100,n=1-e[2]/100,t=n-r;let o=0;return t<1&&(o=(n-t)/(1-t)),[e[0],t*100,o*100]},c.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},c.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},c.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},c.gray.hsl=function(e){return[0,0,e[0]]},c.gray.hsv=c.gray.hsl,c.gray.hwb=function(e){return[0,100,e[0]]},c.gray.cmyk=function(e){return[0,0,0,e[0]]},c.gray.lab=function(e){return[e[0],0,0]},c.gray.hex=function(e){const r=Math.round(e[0]/100*255)&255,n=((r<<16)+(r<<8)+r).toString(16).toUpperCase();return"000000".slice(n.length)+n},c.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function we(){const e={},r=Object.keys(c);for(let{length:n}=r,t=0;t0;){const t=n.pop(),o=Object.keys(c[t]);for(let{length:a}=o,s=0;s1&&(n=t),e(n))};return"conversion"in e&&(r.conversion=e.conversion),r}function Oe(e){const r=function(...n){const t=n[0];if(t==null)return t;t.length>1&&(n=t);const o=e(n);if(typeof o=="object")for(let{length:a}=o,s=0;s0){this.model=r||"rgb",t=f[this.model].channels;const o=Array.prototype.slice.call(e,0,t);this.color=z(o,t),this.valpha=typeof e[t]=="number"?e[t]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const o=Object.keys(e);"alpha"in e&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const a=o.sort().join("");if(!(a in C))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=C[a];const{labels:s}=f[this.model],l=[];for(n=0;n(e%360+360)%360),saturationl:h("hsl",1,g(100)),lightness:h("hsl",2,g(100)),saturationv:h("hsv",1,g(100)),value:h("hsv",2,g(100)),chroma:h("hcg",1,g(100)),gray:h("hcg",2,g(100)),white:h("hwb",1,g(100)),wblack:h("hwb",2,g(100)),cyan:h("cmyk",0,g(100)),magenta:h("cmyk",1,g(100)),yellow:h("cmyk",2,g(100)),black:h("cmyk",3,g(100)),x:h("xyz",0,g(95.047)),y:h("xyz",1,g(100)),z:h("xyz",2,g(108.833)),l:h("lab",0,g(100)),a:h("lab",1),b:h("lab",2),keyword(e){return e!==void 0?new d(e):f[this.model].keyword(this.color)},hex(e){return e!==void 0?new d(e):b.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new d(e);const r=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),b.to.hex(...r)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,r=[];for(const[n,t]of e.entries()){const o=t/255;r[n]=o<=.04045?o/12.92:((o+.055)/1.055)**2.4}return .2126*r[0]+.7152*r[1]+.0722*r[2]},contrast(e){const r=this.luminosity(),n=e.luminosity();return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)},level(e){const r=this.contrast(e);return r>=7?"AAA":r>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let r=0;r<3;r++)e.color[r]=255-e.color[r];return e},lighten(e){const r=this.hsl();return r.color[2]+=r.color[2]*e,r},darken(e){const r=this.hsl();return r.color[2]-=r.color[2]*e,r},saturate(e){const r=this.hsl();return r.color[1]+=r.color[1]*e,r},desaturate(e){const r=this.hsl();return r.color[1]-=r.color[1]*e,r},whiten(e){const r=this.hwb();return r.color[1]+=r.color[1]*e,r},blacken(e){const r=this.hwb();return r.color[2]+=r.color[2]*e,r},grayscale(){const e=this.rgb().color,r=e[0]*.3+e[1]*.59+e[2]*.11;return d.rgb(r,r,r)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const r=this.hsl();let n=r.color[0];return n=(n+e)%360,n=n<0?360+n:n,r.color[0]=n,r},mix(e,r){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),t=this.rgb(),o=r===void 0?.5:r,a=2*o-1,s=n.alpha()-t.alpha(),l=((a*s===-1?a:(a+s)/(1+a*s))+1)/2,i=1-l;return d.rgb(l*n.red()+i*t.red(),l*n.green()+i*t.green(),l*n.blue()+i*t.blue(),n.alpha()*o+t.alpha()*(1-o))}};for(const e of Object.keys(f)){if(Q.includes(e))continue;const{channels:r}=f[e];d.prototype[e]=function(...n){return this.model===e?new d(this):n.length>0?new d(n,e):new d([...Ie(f[this.model][e].raw(this.color)),this.valpha],e)},d[e]=function(...n){let t=n[0];return typeof t=="number"&&(t=z(n,r)),new d(t,e)}}function je(e,r){return Number(e.toFixed(r))}function Le(e){return function(r){return je(r,e)}}function h(e,r,n){e=Array.isArray(e)?e:[e];for(const t of e)(F[t]||=[])[r]=n;return e=e[0],function(t){let o;return t!==void 0?(n&&(t=n(t)),o=this[e](),o.color[r]=t,o):(o=this[e]().color[r],n&&(o=n(o)),o)}}function g(e){return function(r){return Math.max(0,Math.min(e,r))}}function Ie(e){return Array.isArray(e)?e:[e]}function z(e,r){for(let n=0;n.6}function Ce(e,r){const n=qe(r),t=Fe(r,n?e:"#ffffff",66);let o=_(e,t);const a=Se()?5.6:3.2;let s=0,l=e;const i=(n?-100:100)/255;for(;o(a/=255,a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4))),[n,t,o]=r;return .2126*n+.7152*t+.0722*o}function _(e,r){const n=$(e)+.05,t=$(r)+.05;return Math.max(n,t)/Math.min(n,t)}function ze(e){return new d(e).rgb().array()}function $e(e){const r=new d(e).hsl();return{h:r.color[0],s:r.color[1],l:r.color[2]}}function _e(e){return new d(e).hex()}const v=[],Pe={id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled({nodes:e}){return e.length===1},exec:async()=>null,renderInline:({nodes:e})=>e.length!==1||!e[0]?Promise.resolve(null):X(e[0]),order:0};O("systemtags:node:updated",De),O("systemtags:tag:created",Te),O("systemtags:tag:deleted",Ve),O("systemtags:tag:updated",Re);function De(e){X(e).then(r=>{document.querySelectorAll(`[data-systemtags-fileid="${e.fileid}"]`).forEach(n=>{n.replaceWith(r)})})}function Te(e){v.push(e)}function Ve(e){v.splice(v.findIndex(r=>r.id===e.id),1)}function Re(e){const r=v.findIndex(n=>n.id===e.id);r!==-1&&(v[r]=e),Ue(e)}function Ue(e){document.querySelectorAll(`[data-systemtag-name="${e.displayName}"]`).forEach(r=>{r.style.setProperty("--systemtag-color",`#${e.color}`)})}function L(e,r=!1){const n=document.createElement("li");n.classList.add("files-list__system-tag"),n.setAttribute("data-systemtag-name",e),n.textContent=e;const t=v.find(o=>o.displayName===e);if(t?.color){const o=getComputedStyle(document.body).getPropertyValue("--color-main-background").replace("#","")||(Ee()?"000000":"ffffff"),a=Ce(`#${t.color}`,`#${o}`);n.style.setProperty("--systemtag-color",a),n.setAttribute("data-systemtag-color","true")}return r&&n.classList.add("files-list__system-tag--more"),n}async function X(e){const r=ge(e),n=document.createElement("ul");if(n.classList.add("files-list__system-tags"),n.setAttribute("aria-label",w("files","Assigned collaborative tags")),n.setAttribute("data-systemtags-fileid",e.fileid?.toString()||""),r.length===0)return n;if(v.length===0)try{v.push(...await W())}catch(t){be.error("Failed to fetch tags",{error:t})}if(n.append(L(r[0])),r.length===2)n.append(L(r[1]));else if(r.length>1){const t=L("+"+(r.length-1),!0);t.setAttribute("title",r.slice(1).join(", ")),t.setAttribute("aria-hidden","true"),t.setAttribute("role","presentation"),n.append(t);for(const o of r.slice(1)){const a=L(o);a.classList.add("hidden-visually"),n.append(a)}}return n}const I="/systemtags",He=se();function Be(e){return` ${ue()} ${e} `}function V(e){return new H({id:e.id,source:`${R()}${I}/${e.id}`,owner:String(Z()?.uid??"anonymous"),root:I,displayname:e.displayName,permissions:P.READ,attributes:{...e,"is-tag":!0}})}async function Je(e="/"){const r=(await W()).filter(l=>l.userVisible);if(e==="/")return{folder:new H({id:0,source:`${R()}${I}`,owner:Z()?.uid,root:I,permissions:P.NONE}),contents:r.map(V)};const n=e.split("/",2)[1];if(!n||isNaN(parseInt(n)))throw new Error("Invalid tag ID");const t=parseInt(n),o=r.find(l=>l.id===t);if(!o)throw new Error("Tag not found");const a=V(o),s=await He.getDirectoryContents(le(),{details:!0,data:Be(t),headers:{method:"REPORT"}});return{folder:a,contents:s.data.map(l=>ie(l))}}const ee="tags";function Ze(){te().register(new oe({id:ee,name:w("systemtags","Tags"),caption:w("systemtags","List of tags and their associated files and folders."),emptyTitle:w("systemtags","No tags found"),emptyCaption:w("systemtags","Tags you have created will show up here."),icon:Y,order:25,getContents:Je}))}const We={id:"systemtags:open-in-files",displayName:()=>w("systemtags","Open in Files"),iconSvgInline:()=>"",enabled({nodes:e,view:r}){return r.id!==ee||e.length!==1||!e[0]?!1:e[0].attributes["is-tag"]!==!0&&e[0].type===D.Folder},async exec({nodes:e}){if(!e[0]||e.length!==1)return!1;let r=e[0].dirname;return e[0].type===D.Folder&&(r=e[0].path),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e[0].fileid)},{dir:r,openfile:"true"}),null},order:-1e3,default:ae.HIDDEN};he("nc:system-tags"),E(fe),E(Pe),E(We),Ze(),pe();export{Ee as a,Ce as e,gr as i}; //# sourceMappingURL=systemtags-init.mjs.map