You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/dist/systemtags-init.js

3 lines
52 KiB
JavaScript

/*! For license information please see systemtags-init.js.LICENSE.txt */
(()=>{var t,e={61692:(t,e,n)=>{"use strict";var i=n(92457),r=n(53529),o=n(53334),s=n(43627),a=n(71089),l=n(99498),u=n(44719);const c=null===(d=(0,i.HW)())?(0,r.YK)().setApp("files").build():(0,r.YK)().setApp("files").setUid(d.uid).build();var d,f=(t=>(t.DEFAULT="default",t.HIDDEN="hidden",t))(f||{}),h=(t=>(t[t.NONE=0]="NONE",t[t.CREATE=4]="CREATE",t[t.READ=1]="READ",t[t.UPDATE=2]="UPDATE",t[t.DELETE=8]="DELETE",t[t.SHARE=16]="SHARE",t[t.ALL=31]="ALL",t))(h||{});const p=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","nc:share-attributes","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:share-types","oc:size","ocs:share-permissions"],g={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"};var m=(t=>(t.Folder="folder",t.File="file",t))(m||{});const v=function(t,e){return null!==t.match(e)},w=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=h.NONE&&t.permissions<=h.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&v(t.source,e)){const n=t.source.match(e)[0];if(!t.source.includes((0,s.join)(n,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(y).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var y=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(y||{});class b{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(t,e){w(t,e||this._knownDavService),this._data=t;const n={set:(t,e,n)=>(this.updateMtime(),Reflect.set(t,e,n)),deleteProperty:(t,e)=>(this.updateMtime(),Reflect.deleteProperty(t,e))};this._attributes=new Proxy(t.attributes||{},n),delete this._data.attributes,e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+(0,a.O0)(this.source.slice(t.length))}get basename(){return(0,s.basename)(this.source)}get extension(){return(0,s.extname)(this.source)}get dirname(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),n=this.root.replace(/\/$/,"");return(0,s.dirname)(t.slice(e+n.length)||"/")}const t=new URL(this.source);return(0,s.dirname)(t.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}get crtime(){return this._data.crtime}get size(){return this._data.size}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:h.NONE:h.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return v(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,s.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),n=this.root.replace(/\/$/,"");return t.slice(e+n.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id||this.attributes?.fileid}get status(){return this._data?.status}set status(t){this._data.status=t}move(t){w({...this._data,source:t},this._knownDavService),this._data.source=t,this.updateMtime()}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move((0,s.dirname)(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}}class x extends b{get type(){return m.File}}class A extends b{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return m.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}(0,l.dC)("dav");class E{_column;constructor(t){N(t),this._column=t}get id(){return this._column.id}get title(){return this._column.title}get render(){return this._column.render}get sort(){return this._column.sort}get summary(){return this._column.summary}}const N=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("A column id is required");if(!t.title||"string"!=typeof t.title)throw new Error("A column title is required");if(!t.render||"function"!=typeof t.render)throw new Error("A render function is required");if(t.sort&&"function"!=typeof t.sort)throw new Error("Column sortFunction must be a function");if(t.summary&&"function"!=typeof t.summary)throw new Error("Column summary must be a function");return!0};var _={},C={};!function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+e+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+n+"$");t.isExist=function(t){return typeof t<"u"},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,n){if(e){const i=Object.keys(e),r=i.length;for(let o=0;o<r;o++)t[i[o]]="strict"===n?[e[i[o]]]:e[i[o]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){const e=i.exec(t);return!(null===e||typeof e>"u")},t.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const o=i.length;for(let t=0;t<o;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n},t.nameRegexp=n}(C);const T=C,O={allowBooleanAttributes:!1,unpairedTags:[]};function P(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function I(t,e){const n=e;for(;e<t.length;e++)if("?"==t[e]||" "==t[e]){const i=t.substr(n,e-n);if(e>5&&"xml"===i)return $("InvalidXml","XML declaration allowed only at the start of the document.",M(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function S(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}_.validate=function(t,e){e=Object.assign({},O,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=I(t,o),o.err)return o}else{if("<"!==t[o]){if(P(t[o]))continue;return $("InvalidChar","char '"+t[o]+"' is not expected.",M(t,o))}{let s=o;if(o++,"!"===t[o]){o=S(t,o);continue}{let a=!1;"/"===t[o]&&(a=!0,o++);let l="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)l+=t[o];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),o--),!B(l)){let e;return e=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",$("InvalidTag",e,M(t,o))}const u=D(t,o);if(!1===u)return $("InvalidAttr","Attributes for '"+l+"' have open quote.",M(t,o));let c=u.value;if(o=u.index,"/"===c[c.length-1]){const n=o-c.length;c=c.substring(0,c.length-1);const r=V(c,e);if(!0!==r)return $(r.err.code,r.err.msg,M(t,n+r.err.line));i=!0}else if(a){if(!u.tagClosed)return $("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",M(t,o));if(c.trim().length>0)return $("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",M(t,s));{const e=n.pop();if(l!==e.tagName){let n=M(t,e.tagStartPos);return $("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",M(t,s))}0==n.length&&(r=!0)}}else{const a=V(c,e);if(!0!==a)return $(a.err.code,a.err.msg,M(t,o-c.length+a.err.line));if(!0===r)return $("InvalidXml","Multiple possible root nodes found.",M(t,o));-1!==e.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:s}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=S(t,o);continue}if("?"!==t[o+1])break;if(o=I(t,++o),o.err)return o}else if("&"===t[o]){const e=R(t,o);if(-1==e)return $("InvalidChar","char '&' is not expected.",M(t,o));o=e}else if(!0===r&&!P(t[o]))return $("InvalidXml","Extra text at the end",M(t,o));"<"===t[o]&&o--}}}return i?1==n.length?$("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",M(t,n[0].tagStartPos)):!(n.length>0)||$("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):$("InvalidXml","Start tag expected.",1)};const j='"',L="'";function D(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===j||t[e]===L)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const k=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function V(t,e){const n=T.getAllMatches(t,k),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return $("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",U(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return $("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",U(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return $("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",U(n[t]));const r=n[t][2];if(!F(r))return $("InvalidAttr","Attribute '"+r+"' is an invalid name.",U(n[t]));if(i.hasOwnProperty(r))return $("InvalidAttr","Attribute '"+r+"' is repeated.",U(n[t]));i[r]=1}return!0}function R(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function $(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function F(t){return T.isName(t)}function B(t){return T.isName(t)}function M(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function U(t){return t.startIndex+t[1].length}var z={};const q={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};z.buildOptions=function(t){return Object.assign({},q,t)},z.defaultOptions=q;const G=C;function W(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let r="";for(;e<t.length&&t[e]!==i;e++)r+=t[e];return[n,r,e]}function X(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function H(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function Y(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function K(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function Z(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function J(t){if(G.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}const Q=/^[-+]?0x[a-fA-F0-9]+$/,tt=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const et={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const nt=C,it=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}},rt=function(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,r=!1,o=!1,s="";for(;e<t.length;e++)if("<"!==t[e]||o)if(">"===t[e]){if(o?"-"===t[e-1]&&"-"===t[e-2]&&(o=!1,i--):i--,0===i)break}else"["===t[e]?r=!0:s+=t[e];else{if(r&&H(t,e))e+=7,[entityName,val,e]=W(t,e+1),-1===val.indexOf("&")&&(n[J(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(r&&Y(t,e))e+=8;else if(r&&K(t,e))e+=8;else if(r&&Z(t,e))e+=9;else{if(!X)throw new Error("Invalid DOCTYPE");o=!0}i++,s=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}},ot=function(t,e={}){if(e=Object.assign({},et,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(e.hex&&Q.test(n))return Number.parseInt(n,16);{const i=tt.exec(n);if(i){const r=i[1],o=i[2];let s=function(t){return t&&-1!==t.indexOf(".")&&("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1))),t}(i[3]);const a=i[4]||i[6];if(!e.leadingZeros&&o.length>0&&r&&"."!==n[2])return t;if(!e.leadingZeros&&o.length>0&&!r&&"."!==n[1])return t;{const i=Number(n),l=""+i;return-1!==l.search(/[eE]/)||a?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===l&&""===s||l===s||r&&l==="-"+s?i:t:o?s===l||r+s===l?i:t:n===l||n===r+l?i:t}}return t}};function st(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function at(t,e,n,i,r,o,s){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,r,o);return null==i?t:typeof i!=typeof t||i!==t?i:this.options.trimValues||t.trim()===t?yt(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function lt(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,nt.nameRegexp);const ut=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function ct(t,e,n){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=nt.getAllMatches(t,ut),i=n.length,r={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);let o=n[t][4],s=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(s=this.options.transformAttributeName(s)),"__proto__"===s&&(s="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const t=this.options.attributeValueProcessor(i,o,e);r[s]=null==t?o:typeof t!=typeof o||t!==o?t:yt(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[s]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const dt=function(t){t=t.replace(/\r\n?/g,"\n");const e=new it("!xml");let n=e,i="",r="";for(let o=0;o<t.length;o++)if("<"===t[o])if("/"===t[o+1]){const e=mt(t,">",o,"Closing Tag is not closed.");let s=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=s.indexOf(":");-1!==t&&(s=s.substr(t+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(i=this.saveTextToParentTag(i,n,r));const a=r.substring(r.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),n=this.tagsNodeStack.pop(),i="",o=e}else if("?"===t[o+1]){let e=vt(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),!(this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags)){const t=new it(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(n,t,r)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=mt(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const s=t.substring(o+4,e-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}o=e}else if("!D"===t.substr(o+1,2)){const e=rt(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=mt(t,"]]>",o,"CDATA is not closed.")-2,s=t.substring(o+9,e);if(i=this.saveTextToParentTag(i,n,r),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]);else{let t=this.parseTextData(s,n.tagname,r,!0,!1,!0);null==t&&(t=""),n.add(this.options.textNodeName,t)}o=e+2}else{let s=vt(t,o,this.options.removeNSPrefix),a=s.tagName;const l=s.rawTagName;let u=s.tagExp,c=s.attrExpPresent,d=s.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const f=n;if(f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)o=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=s.closeIndex;else{const n=this.readStopNodeData(t,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);o=n.i,e=n.tagContent}const i=new it(a);a!==u&&c&&(i[":@"]=this.buildAttributesMap(u,r,a)),e&&(e=this.parseTextData(e,a,r,!0,c,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,r)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new it(a);a!==u&&c&&(t[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new it(a);this.tagsNodeStack.push(n),a!==u&&c&&(t[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(n,t,r),n=t}i="",o=d}}else i+=t[o];return e.child};function ft(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i&&(e.tagname=i),t.addChild(e))}const ht=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function pt(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function gt(t,e,n){const i="*."+n;for(const n in t){const r=t[n];if(i===r||e===r)return!0}return!1}function mt(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function vt(t,e,n,i=">"){const r=function(t,e,n=">"){let i,r="";for(let o=e;o<t.length;o++){let e=t[o];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:o};if(t[o+1]===n[1])return{data:r,index:o}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,i);if(!r)return;let o=r.data;const s=r.index,a=o.search(/\s/);let l=o,u=!0;-1!==a&&(l=o.substr(0,a).replace(/\s\s*$/,""),o=o.substr(a+1));const c=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),u=l!==r.data.substr(t+1))}return{tagName:l,tagExp:o,closeIndex:s,attrExpPresent:u,rawTagName:c}}function wt(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const o=mt(t,">",n,`${e} is not closed`);if(t.substring(n+2,o).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:o};n=o}else if("?"===t[n+1])n=mt(t,"?>",n+1,"StopNode is not closed.");else if("!--"===t.substr(n+1,3))n=mt(t,"--\x3e",n+3,"StopNode is not closed.");else if("!["===t.substr(n+1,2))n=mt(t,"]]>",n,"StopNode is not closed.")-2;else{const i=vt(t,n,">");i&&((i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex)}}function yt(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&ot(t,n)}return nt.isExist(t)?t:""}var bt={};function xt(t,e,n){let i;const r={};for(let o=0;o<t.length;o++){const s=t[o],a=At(s);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=s[a]:i+=""+s[a];else{if(void 0===a)continue;if(s[a]){let t=xt(s[a],e,l);const n=Nt(t,e);s[":@"]?Et(t,s[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,l,n)?r[a]=[t]:r[a]=t}}}return"string"==typeof i?i.length>0&&(r[e.textNodeName]=i):void 0!==i&&(r[e.textNodeName]=i),r}function At(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Et(t,e,n,i){if(e){const r=Object.keys(e),o=r.length;for(let s=0;s<o;s++){const o=r[s];i.isArray(o,n+"."+o,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}}function Nt(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return!(0!==i&&(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n]))}bt.prettify=function(t,e){return xt(t,e)};const{buildOptions:_t}=z,Ct=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=st,this.parseXml=dt,this.parseTextData=at,this.resolveNameSpace=lt,this.buildAttributesMap=ct,this.isItStopNode=gt,this.replaceEntitiesValue=ht,this.readStopNodeData=wt,this.saveTextToParentTag=pt,this.addChild=ft}},{prettify:Tt}=bt,Ot=_;function Pt(t,e,n,i){let r="",o=!1;for(let s=0;s<t.length;s++){const a=t[s],l=It(a);if(void 0===l)continue;let u="";if(u=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];jt(u,e)||(t=e.tagValueProcessor(l,t),t=Lt(t,e)),o&&(r+=i),r+=t,o=!1;continue}if(l===e.cdataPropName){o&&(r+=i),r+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,o=!1;continue}if(l===e.commentPropName){r+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,o=!0;continue}if("?"===l[0]){const t=St(a[":@"],e),n="?xml"===l?"":i;let s=a[l][0][e.textNodeName];s=0!==s.length?" "+s:"",r+=n+`<${l}${s}${t}?>`,o=!0;continue}let c=i;""!==c&&(c+=e.indentBy);const d=i+`<${l}${St(a[":@"],e)}`,f=Pt(a[l],e,u,c);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=d+">":r+=d+"/>":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(">")?r+=d+`>${f}${i}</${l}>`:(r+=d+">",f&&""!==i&&(f.includes("/>")||f.includes("</"))?r+=i+e.indentBy+f+i:r+=f,r+=`</${l}>`):r+=d+"/>",o=!0}return r}function It(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function St(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let r=e.attributeValueProcessor(i,t[i]);r=Lt(r,e),!0===r&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${r}"`}return n}function jt(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function Lt(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const Dt=function(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),Pt(t,e,"",n)},kt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Vt(t){this.options=Object.assign({},kt,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Ft),this.processTextOrObjNode=Rt,this.options.format?(this.indentate=$t,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Rt(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function $t(t){return this.options.indentBy.repeat(t)}function Ft(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Vt.prototype.build=function(t){return this.options.preserveOrder?Dt(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},Vt.prototype.j2x=function(t,e){let n="",i="";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))if(typeof t[r]>"u")this.isAttribute(r)&&(i+="");else if(null===t[r])this.isAttribute(r)?i+="":"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)i+=this.buildTextValNode(t[r],r,"",e);else if("object"!=typeof t[r]){const o=this.isAttribute(r);if(o)n+=this.buildAttrPairStr(o,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const n=t[r].length;let o="";for(let s=0;s<n;s++){const n=t[r][s];typeof n>"u"||(null===n?"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar:"object"==typeof n?this.options.oneListGroup?o+=this.j2x(n,e+1).val:o+=this.processTextOrObjNode(n,r,e):o+=this.buildTextValNode(n,r,"",e))}this.options.oneListGroup&&(o=this.buildObjectNode(o,r,"",e)),i+=o}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),i=e.length;for(let o=0;o<i;o++)n+=this.buildAttrPairStr(e[o],""+t[r][e[o]])}else i+=this.processTextOrObjNode(t[r],r,e);return{attrStr:n,val:i}},Vt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},Vt.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,o="";return"?"===e[0]&&(o="?",r=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===o.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+o+this.tagEndChar+t+this.indentate(i)+r:this.indentate(i)+"<"+e+n+o+">"+t+r}},Vt.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},Vt.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+r+"</"+e+this.tagEndChar}},Vt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};var Bt={XMLParser:class{constructor(t){this.externalEntities={},this.options=_t(t)}parse(t,e){if("string"!=typeof t){if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=Ot.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Ct(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:Tt(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}},XMLValidator:_,XMLBuilder:Vt};var Mt=n(85072),Ut=n.n(Mt),zt=n(97825),qt=n.n(zt),Gt=n(77659),Wt=n.n(Gt),Xt=n(55056),Ht=n.n(Xt),Yt=n(10540),Kt=n.n(Yt),Zt=n(41113),Jt=n.n(Zt),Qt=n(73911),te={};te.styleTagTransform=Jt(),te.setAttributes=Ht(),te.insert=Wt().bind(null,"head"),te.domAPI=qt(),te.insertStyleElement=Kt(),Ut()(Qt.A,te),Qt.A&&Qt.A.locals&&Qt.A.locals;const ee=function(t){var e;const n=null===(e=t.attributes)||void 0===e||null===(e=e["system-tags"])||void 0===e?void 0:e["system-tag"];return void 0===n?[]:[n].flat()},ne=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("li");return n.classList.add("files-list__system-tag"),n.textContent=t,e&&n.classList.add("files-list__system-tag--more"),n},ie=new class{_action;constructor(t){this.validateAction(t),this._action=t}get id(){return this._action.id}get displayName(){return this._action.displayName}get title(){return this._action.title}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get order(){return this._action.order}get parent(){return this._action.parent}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(t){if(!t.id||"string"!=typeof t.id)throw new Error("Invalid id");if(!t.displayName||"function"!=typeof t.displayName)throw new Error("Invalid displayName function");if("title"in t&&"function"!=typeof t.title)throw new Error("Invalid title function");if(!t.iconSvgInline||"function"!=typeof t.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!t.exec||"function"!=typeof t.exec)throw new Error("Invalid exec function");if("enabled"in t&&"function"!=typeof t.enabled)throw new Error("Invalid enabled function");if("execBatch"in t&&"function"!=typeof t.execBatch)throw new Error("Invalid execBatch function");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order");if("parent"in t&&"string"!=typeof t.parent)throw new Error("Invalid parent");if(t.default&&!Object.values(f).includes(t.default))throw new Error("Invalid default");if("inline"in t&&"function"!=typeof t.inline)throw new Error("Invalid inline function");if("renderInline"in t&&"function"!=typeof t.renderInline)throw new Error("Invalid renderInline function")}}({id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled(t){if(1!==t.length)return!1;const e=t[0];return 0!==ee(e).length},exec:async()=>null,async renderInline(t){const e=ee(t);if(0===e.length)return null;const n=document.createElement("ul");if(n.classList.add("files-list__system-tags"),1===e.length)n.setAttribute("aria-label",(0,o.Tl)("files","This file has the tag {tag}",{tag:e[0]}));else{const t=e.slice(0,-1).join(", "),i=e[e.length-1];n.setAttribute("aria-label",(0,o.Tl)("files","This file has the tags {firstTags} and {lastTag}",{firstTags:t,lastTag:i}))}if(n.append(ne(e[0])),e.length>1){const t=ne("+"+(e.length-1),!0);t.setAttribute("title",e.slice(1).join(", ")),n.append(t)}return n},order:0});!function(t,e={nc:"http://nextcloud.org/ns"}){typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...p],window._nc_dav_namespaces={...g});const n={...window._nc_dav_namespaces,...e};window._nc_dav_properties.find((e=>e===t))?c.error(`${t} already registered`,{prop:t}):t.startsWith("<")||2!==t.split(":").length?c.error(`${t} is not valid. See example: 'oc:fileid'`,{prop:t}):n[t.split(":")[0]]?(window._nc_dav_properties.push(t),window._nc_dav_namespaces=n):c.error(`${t} namespace unknown`,{prop:t,namespaces:n})}("nc:system-tags"),function(t){typeof window._nc_fileactions>"u"&&(window._nc_fileactions=[],c.debug("FileActions initialized")),window._nc_fileactions.find((e=>e.id===t.id))?c.error(`FileAction ${t.id} already registered`,{action:t}):window._nc_fileactions.push(t)}(ie),n(26287);const re=(0,l.dC)("dav"),oe=(0,u.UU)(re),se=t=>{oe.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=t?t:""})};(0,i.zo)(se),se((0,i.do)());var ae=n(71654);const le=(0,r.YK)().setApp("systemtags").detectUser().build();var ue;const ce="/files/".concat(null===(ue=(0,i.HW)())||void 0===ue?void 0:ue.uid),de=(0,l.dC)("dav"+ce),fe=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de;const e=(0,u.UU)(t),n=t=>{null==e||e.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=t?t:""})};return(0,i.zo)(n),n((0,i.do)()),(0,u.Gu)().patch("fetch",((t,e)=>{const n=e.headers;return null!=n&&n.method&&(e.method=n.method,delete n.method),fetch(t,e)})),e};n(36117),(0,r.YK)().setApp("files").detectUser().build(),fe();const he=function(t){var e;const n=null===(e=(0,i.HW)())||void 0===e?void 0:e.uid;if(!n)throw new Error("No user id found");const r=t.props,o=function(t=""){let e=h.NONE;return t&&((t.includes("C")||t.includes("K"))&&(e|=h.CREATE),t.includes("G")&&(e|=h.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=h.UPDATE),t.includes("D")&&(e|=h.DELETE),t.includes("R")&&(e|=h.SHARE)),e}(null==r?void 0:r.permissions),s=(r["owner-id"]||n).toString(),a=(0,l.dC)("dav"+ce+t.filename),u=(null==r?void 0:r.fileid)<0?a.split("").reduce((function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t}),0):(null==r?void 0:r.fileid)||0,c={id:u,source:a,mtime:new Date(t.lastmod),mime:t.mime||"application/octet-stream",size:(null==r?void 0:r.size)||0,permissions:o,owner:s,root:ce,attributes:{...t,...r,hasPreview:null==r?void 0:r["has-preview"],failed:(null==r?void 0:r.fileid)<0}};return delete c.attributes.props,"file"===t.type?new x(c):new A(c)},pe=t=>'<?xml version="1.0"?>\n<oc:filter-files '.concat((typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...g}),Object.keys(window._nc_dav_namespaces).map((t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`)).join(" ")),">\n\t<d:prop>\n\t\t").concat((typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...p]),window._nc_dav_properties.map((t=>`<${t} />`)).join(" ")),"\n\t</d:prop>\n <oc:filter-rules>\n <oc:systemtag>").concat(t,"</oc:systemtag>\n </oc:filter-rules>\n</oc:filter-files>"),ge=function(t){var e;return new A({id:t.id,source:(0,l.dC)("dav/systemtags/"+t.id),owner:null===(e=(0,i.HW)())||void 0===e?void 0:e.uid,root:"/systemtags",permissions:h.READ,attributes:{...t,"is-tag":!0}})};(typeof window._nc_navigation>"u"&&(window._nc_navigation=new class{_views=[];_currentView=null;register(t){if(this._views.find((e=>e.id===t.id)))throw new Error(`View id ${t.id} is already registered`);this._views.push(t)}remove(t){const e=this._views.findIndex((e=>e.id===t));-1!==e&&this._views.splice(e,1)}get views(){return this._views}setActive(t){this._currentView=t}get active(){return this._currentView}},c.debug("Navigation service initialized")),window._nc_navigation).register(new class{_view;constructor(t){(function(t){if(!t.id||"string"!=typeof t.id)throw new Error("View id is required and must be a string");if(!t.name||"string"!=typeof t.name)throw new Error("View name is required and must be a string");if(t.columns&&t.columns.length>0&&(!t.caption||"string"!=typeof t.caption))throw new Error("View caption is required for top-level views and must be a string");if(!t.getContents||"function"!=typeof t.getContents)throw new Error("View getContents is required and must be a function");if(!t.icon||"string"!=typeof t.icon||!function(t){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(0===(t=t.trim()).length||!0!==Bt.XMLValidator.validate(t))return!1;let e;const n=new Bt.XMLParser;try{e=n.parse(t)}catch{return!1}return!(!e||!("svg"in e))}(t.icon))throw new Error("View icon is required and must be a valid svg string");if(!("order"in t)||"number"!=typeof t.order)throw new Error("View order is required and must be a number");if(t.columns&&t.columns.forEach((t=>{if(!(t instanceof E))throw new Error("View columns must be an array of Column. Invalid column found")})),t.emptyView&&"function"!=typeof t.emptyView)throw new Error("View emptyView must be a function");if(t.parent&&"string"!=typeof t.parent)throw new Error("View parent must be a string");if("sticky"in t&&"boolean"!=typeof t.sticky)throw new Error("View sticky must be a boolean");if("expanded"in t&&"boolean"!=typeof t.expanded)throw new Error("View expanded must be a boolean");if(t.defaultSortKey&&"string"!=typeof t.defaultSortKey)throw new Error("View defaultSortKey must be a string")})(t),this._view=t}get id(){return this._view.id}get name(){return this._view.name}get caption(){return this._view.caption}get emptyTitle(){return this._view.emptyTitle}get emptyCaption(){return this._view.emptyCaption}get getContents(){return this._view.getContents}get icon(){return this._view.icon}set icon(t){this._view.icon=t}get order(){return this._view.order}set order(t){this._view.order=t}get params(){return this._view.params}set params(t){this._view.params=t}get columns(){return this._view.columns}get emptyView(){return this._view.emptyView}get parent(){return this._view.parent}get sticky(){return this._view.sticky}get expanded(){return this._view.expanded}set expanded(t){this._view.expanded=t}get defaultSortKey(){return this._view.defaultSortKey}}({id:"tags",name:(0,o.Tl)("systemtags","Tags"),caption:(0,o.Tl)("systemtags","List of tags and their associated files and folders."),emptyTitle:(0,o.Tl)("systemtags","No tags found"),emptyCaption:(0,o.Tl)("systemtags","Tags you have created will show up here."),icon:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-tag-multiple" viewBox="0 0 24 24"><path d="M5.5,9A1.5,1.5 0 0,0 7,7.5A1.5,1.5 0 0,0 5.5,6A1.5,1.5 0 0,0 4,7.5A1.5,1.5 0 0,0 5.5,9M17.41,11.58C17.77,11.94 18,12.44 18,13C18,13.55 17.78,14.05 17.41,14.41L12.41,19.41C12.05,19.77 11.55,20 11,20C10.45,20 9.95,19.78 9.58,19.41L2.59,12.42C2.22,12.05 2,11.55 2,11V6C2,4.89 2.89,4 4,4H9C9.55,4 10.05,4.22 10.41,4.58L17.41,11.58M13.54,5.71L14.54,4.71L21.41,11.58C21.78,11.94 22,12.45 22,13C22,13.55 21.78,14.05 21.42,14.41L16.04,19.79L15.04,18.79L20.75,13L13.54,5.71Z" /></svg>',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 oe.getDirectoryContents("/systemtags",{data:'<?xml version="1.0"?>\n<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>',details:!0,glob:"/systemtags/*"});return(t=>t.map((t=>{let{props:e}=t;return Object.fromEntries(Object.entries(e).map((t=>{let[e,n]=t;return[(0,ae.A)(e),"displayName"===(0,ae.A)(e)?String(n):n]})))})))(t)}catch(t){throw le.error((0,o.Tl)("systemtags","Failed to load tags"),{error:t}),new Error((0,o.Tl)("systemtags","Failed to load tags"))}})()).filter((t=>t.userVisible));var n;if("/"===t)return{folder:new A({id:0,source:(0,l.dC)("dav/systemtags"),owner:null===(n=(0,i.HW)())||void 0===n?void 0:n.uid,root:"/systemtags",permissions:h.NONE}),contents:e.map(ge)};const r=parseInt(t.replace("/",""),10),s=e.find((t=>t.id===r));if(!s)throw new Error("Tag not found");return{folder:ge(s),contents:(await fe().getDirectoryContents("/",{details:!0,data:pe(r),headers:{method:"REPORT"}})).data.map(he)}}}))},36117:function(t,e,n){var i,r,o=n(96763);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=function(t){"use strict";function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,n)}function n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=i(t);if(e){var o=i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function c(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function h(t,e){return function(t,e){return e.get?e.get.call(t):e.value}(t,g(t,e,"get"))}function p(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,g(t,e,"set"),n),n}function g(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.CancelablePromise=void 0,t.cancelable=A,t.default=void 0,t.isCancelablePromise=E;var m="undefined"!=typeof Symbol?Symbol.toStringTag:"@@toStringTag",v=new WeakMap,w=new WeakMap,y=function(){function t(e){var n=e.executor,i=void 0===n?function(){}:n,r=e.internals,o=void 0===r?{isCanceled:!1,onCancelList:[]}:r,s=e.promise,a=void 0===s?new Promise((function(t,e){return i(t,e,(function(t){o.onCancelList.push(t)}))})):s;l(this,t),f(this,v,{writable:!0,value:void 0}),f(this,w,{writable:!0,value:void 0}),d(this,m,"CancelablePromise"),this.cancel=this.cancel.bind(this),p(this,v,o),p(this,w,a||new Promise((function(t,e){return i(t,e,(function(t){o.onCancelList.push(t)}))})))}return c(t,[{key:"then",value:function(t,e){return _(h(this,w).then(N(t,h(this,v)),N(e,h(this,v))),h(this,v))}},{key:"catch",value:function(t){return _(h(this,w).catch(N(t,h(this,v))),h(this,v))}},{key:"finally",value:function(t,e){var n=this;return e&&h(this,v).onCancelList.push(t),_(h(this,w).finally(N((function(){if(t)return e&&(h(n,v).onCancelList=h(n,v).onCancelList.filter((function(e){return e!==t}))),t()}),h(this,v))),h(this,v))}},{key:"cancel",value:function(){h(this,v).isCanceled=!0;var t=h(this,v).onCancelList;h(this,v).onCancelList=[];var e,n=r(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if("function"==typeof i)try{i()}catch(t){o.error(t)}}}catch(t){n.e(t)}finally{n.f()}}},{key:"isCanceled",value:function(){return!0===h(this,v).isCanceled}}]),t}(),b=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&e(t,n)}(r,t);var i=n(r);function r(t){return l(this,r),i.call(this,{executor:t})}return c(r)}(y);t.CancelablePromise=b,d(b,"all",(function(t){return C(t,Promise.all(t))})),d(b,"allSettled",(function(t){return C(t,Promise.allSettled(t))})),d(b,"any",(function(t){return C(t,Promise.any(t))})),d(b,"race",(function(t){return C(t,Promise.race(t))})),d(b,"resolve",(function(t){return A(Promise.resolve(t))})),d(b,"reject",(function(t){return A(Promise.reject(t))})),d(b,"isCancelable",E);var x=b;function A(t){return _(t,{isCanceled:!1,onCancelList:[]})}function E(t){return t instanceof b||t instanceof y}function N(t,e){if(t)return function(n){if(!e.isCanceled){var i=t(n);return E(i)&&e.onCancelList.push(i.cancel),i}return n}}function _(t,e){return new y({internals:e,promise:t})}function C(t,e){var n={isCanceled:!1,onCancelList:[]};return n.onCancelList.push((function(){var e,n=r(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;E(i)&&i.cancel()}}catch(t){n.e(t)}finally{n.f()}})),new y({internals:n,promise:e})}t.default=x},void 0===(r=i.apply(e,[e]))||(t.exports=r)},73911:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(71354),r=n.n(i),o=n(76314),s=n.n(o)()(r());s.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:"AAsBA,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 * @copyright Copyright (c) 2023 Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @author Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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=s}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=e,t=[],i.O=(e,n,r,o)=>{if(!n){var s=1/0;for(c=0;c<t.length;c++){n=t[c][0],r=t[c][1],o=t[c][2];for(var a=!0,l=0;l<n.length;l++)(!1&o||s>=o)&&Object.keys(i.O).every((t=>i.O[t](n[l])))?n.splice(l--,1):(a=!1,o<s&&(s=o));if(a){t.splice(c--,1);var u=r();void 0!==u&&(e=u)}}return e}o=o||0;for(var c=t.length;c>0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[n,r,o]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.e=()=>Promise.resolve(),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),i.j=2766,(()=>{i.b=document.baseURI||self.location.href;var t={2766:0};i.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,s=n[0],a=n[1],l=n[2],u=0;if(s.some((e=>0!==t[e]))){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);if(l)var c=l(i)}for(e&&e(n);u<s.length;u++)o=s[u],i.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return i.O(c)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),i.nc=void 0;var r=i.O(void 0,[4208],(()=>i(61692)));r=i.O(r)})();
//# sourceMappingURL=systemtags-init.js.map?v=d34ef5df09cf3656f82e