(()=>{var t,e={49611:(t,e,s)=>{"use strict";var n=s(49584),i=s(53334),r=s(85072),o=s.n(r),a=s(97825),l=s.n(a),d=s(77659),c=s.n(d),A=s(55056),g=s.n(A),p=s(10540),m=s.n(p),u=s(41113),f=s.n(u),C=s(73911),v={};v.styleTagTransform=f(),v.setAttributes=g(),v.insert=c().bind(null,"head"),v.domAPI=l(),v.insertStyleElement=m(),o()(C.A,v),C.A&&C.A.locals&&C.A.locals;const y=function(t){var e;const s=null===(e=t.attributes)||void 0===e||null===(e=e["system-tags"])||void 0===e?void 0:e["system-tag"];return void 0===s?[]:[s].flat()},h=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=document.createElement("li");return s.classList.add("files-list__system-tag"),s.textContent=t,e&&s.classList.add("files-list__system-tag--more"),s},b=new n.hY({id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled(t){if(1!==t.length)return!1;const e=t[0];return 0!==y(e).length},exec:async()=>null,async renderInline(t){const e=y(t);if(0===e.length)return null;const s=document.createElement("ul");if(s.classList.add("files-list__system-tags"),1===e.length)s.setAttribute("aria-label",(0,i.Tl)("files","This file has the tag {tag}",{tag:e[0]}));else{const t=e.slice(0,-1).join(", "),n=e[e.length-1];s.setAttribute("aria-label",(0,i.Tl)("files","This file has the tags {firstTags} and {lastTag}",{firstTags:t,lastTag:n}))}if(s.append(h(e[0])),e.length>1){const t=h("+"+(e.length-1),!0);t.setAttribute("title",e.slice(1).join(", ")),s.append(t)}return s},order:0});(0,n.Yc)("nc:system-tags"),(0,n.Gg)(b);var w=s(63814),x=s(21777),_=(s(65043),s(63623));const T=(0,w.dC)("dav"),B=(0,_.UU)(T),O=t=>{B.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=t?t:""})};(0,x.zo)(O),O((0,x.do)());var L=s(71654);const j=(0,s(35947).YK)().setApp("systemtags").detectUser().build(),E=(0,n.H4)(),P=t=>(0,n.Al)(t),S=t=>'\n\n\t\n\t\t").concat((0,n.VX)(),"\n\t\n \n ").concat(t,"\n \n"),k=function(t){var e;return new n.vd({id:t.id,source:(0,w.dC)("dav/systemtags/"+t.id),owner:null===(e=(0,x.HW)())||void 0===e?void 0:e.uid,root:"/systemtags",permissions:n.aX.READ,attributes:{...t,"is-tag":!0}})};(0,n.bh)().register(new n.Ss({id:"tags",name:(0,i.Tl)("systemtags","Tags"),caption:(0,i.Tl)("systemtags","List of tags and their associated files and folders."),emptyTitle:(0,i.Tl)("systemtags","No tags found"),emptyCaption:(0,i.Tl)("systemtags","Tags you have created will show up here."),icon:'',order:25,getContents:async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const e=(await(async()=>{try{const{data:t}=await B.getDirectoryContents("/systemtags",{data:'\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n',details:!0,glob:"/systemtags/*"});return(t=>t.map((t=>{let{props:e}=t;return Object.fromEntries(Object.entries(e).map((t=>{let[e,s]=t;return[(0,L.A)(e),"displayName"===(0,L.A)(e)?String(s):s]})))})))(t)}catch(t){throw j.error((0,i.Tl)("systemtags","Failed to load tags"),{error:t}),new Error((0,i.Tl)("systemtags","Failed to load tags"))}})()).filter((t=>t.userVisible));var s;if("/"===t)return{folder:new n.vd({id:0,source:(0,w.dC)("dav/systemtags"),owner:null===(s=(0,x.HW)())||void 0===s?void 0:s.uid,root:"/systemtags",permissions:n.aX.NONE}),contents:e.map(k)};const r=parseInt(t.replace("/",""),10),o=e.find((t=>t.id===r));if(!o)throw new Error("Tag not found");return{folder:k(o),contents:(await E.getDirectoryContents("/",{details:!0,data:S(r),headers:{method:"REPORT"}})).data.map(P)}}}))},73911:(t,e,s)=>{"use strict";s.d(e,{A:()=>a});var n=s(71354),i=s.n(n),r=s(76314),o=s.n(r)()(i());o.push([t.id,".files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:22px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-left:5px}@media(min-width: 512px){.files-list__system-tags{display:flex}}","",{version:3,sources:["webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss"],names:[],mappings:"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,eAAA,CAIF,yBACC,yBACC,YAAA,CAAA",sourcesContent:["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n.files-list__system-tags {\n\t--min-size: 32px;\n\tdisplay: none;\n\tjustify-content: center;\n\talign-items: center;\n\tmin-width: calc(var(--min-size) * 2);\n\tmax-width: 300px;\n}\n\n.files-list__system-tag {\n\tpadding: 5px 10px;\n\tborder: 1px solid;\n\tborder-radius: var(--border-radius-pill);\n\tborder-color: var(--color-border);\n\tcolor: var(--color-text-maxcontrast);\n\theight: var(--min-size);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tline-height: 22px; // min-size - 2 * 5px padding\n\ttext-align: center;\n\n\t&--more {\n\t\toverflow: visible;\n\t\ttext-overflow: initial;\n\t}\n\n\t// Proper spacing if multiple shown\n\t& + .files-list__system-tag {\n\t\tmargin-left: 5px;\n\t}\n}\n\n@media (min-width: 512px) {\n\t.files-list__system-tags {\n\t\tdisplay: flex;\n\t}\n}\n"],sourceRoot:""}]);const a=o},42634:()=>{},15340:()=>{},79838:()=>{}},s={};function n(t){var i=s[t];if(void 0!==i)return i.exports;var r=s[t]={id:t,loaded:!1,exports:{}};return e[t].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=e,t=[],n.O=(e,s,i,r)=>{if(!s){var o=1/0;for(c=0;c=r)&&Object.keys(n.O).every((t=>n.O[t](s[l])))?s.splice(l--,1):(a=!1,r0&&t[c-1][2]>r;c--)t[c]=t[c-1];t[c]=[s,i,r]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n.j=2766,(()=>{n.b=document.baseURI||self.location.href;var t={2766:0};n.O.j=e=>0===t[e];var e=(e,s)=>{var i,r,o=s[0],a=s[1],l=s[2],d=0;if(o.some((e=>0!==t[e]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(l)var c=l(n)}for(e&&e(s);dn(49611)));i=n.O(i)})(); //# sourceMappingURL=systemtags-init.js.map?v=13cd891587e1c15f21c3