mirror of
https://github.com/nextcloud/server.git
synced 2026-06-27 17:40:37 -04:00
11 lines
31 KiB
JavaScript
11 lines
31 KiB
JavaScript
import{_ as Ot}from"./index-CI-5vlTq.chunk.mjs";import{h as Et,q as yt,t as Z}from"./index-C6ey-Mhx.chunk.mjs";import{r as $t}from"./util-djQ-4xJ5.chunk.mjs";import{g as Mt}from"./dav-sq7XGhQT.chunk.mjs";function Pt(){return Et("dav/comments")}const Wt=Mt(Pt());var U,rt;function At(){if(rt)return U;rt=1,U=o;function o(n,s,r){n instanceof RegExp&&(n=t(n,r)),s instanceof RegExp&&(s=t(s,r));var i=e(n,s,r);return i&&{start:i[0],end:i[1],pre:r.slice(0,i[0]),body:r.slice(i[0]+n.length,i[1]),post:r.slice(i[1]+s.length)}}function t(n,s){var r=s.match(n);return r?r[0]:null}o.range=e;function e(n,s,r){var i,h,l,a,u,c=r.indexOf(n),p=r.indexOf(s,c+1),b=c;if(c>=0&&p>0){if(n===s)return[c,p];for(i=[],l=r.length;b>=0&&!u;)b==c?(i.push(b),c=r.indexOf(n,b+1)):i.length==1?u=[i.pop(),p]:(h=i.pop(),h<l&&(l=h,a=p),p=r.indexOf(s,b+1)),b=c<p&&c>=0?c:p;i.length&&(u=[l,a])}return u}return U}var V,it;function Nt(){if(it)return V;it=1;var o=At();V=u;var t="\0SLASH"+Math.random()+"\0",e="\0OPEN"+Math.random()+"\0",n="\0CLOSE"+Math.random()+"\0",s="\0COMMA"+Math.random()+"\0",r="\0PERIOD"+Math.random()+"\0";function i(d){return parseInt(d,10)==d?parseInt(d,10):d.charCodeAt(0)}function h(d){return d.split("\\\\").join(t).split("\\{").join(e).split("\\}").join(n).split("\\,").join(s).split("\\.").join(r)}function l(d){return d.split(t).join("\\").split(e).join("{").split(n).join("}").split(s).join(",").split(r).join(".")}function a(d){if(!d)return[""];var x=[],S=o("{","}",d);if(!S)return d.split(",");var O=S.pre,g=S.body,f=S.post,y=O.split(",");y[y.length-1]+="{"+g+"}";var w=a(f);return f.length&&(y[y.length-1]+=w.shift(),y.push.apply(y,w)),x.push.apply(x,y),x}function u(d){return d?(d.substr(0,2)==="{}"&&(d="\\{\\}"+d.substr(2)),m(h(d),!0).map(l)):[]}function c(d){return"{"+d+"}"}function p(d){return/^-?0\d/.test(d)}function b(d,x){return d<=x}function v(d,x){return d>=x}function m(d,x){var S=[],O=o("{","}",d);if(!O)return[d];var g=O.pre,f=O.post.length?m(O.post,!1):[""];if(/\$$/.test(O.pre))for(var y=0;y<f.length;y++){var w=g+"{"+O.body+"}"+f[y];S.push(w)}else{var $=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(O.body),M=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(O.body),E=$||M,A=O.body.indexOf(",")>=0;if(!E&&!A)return O.post.match(/,(?!,).*\}/)?(d=O.pre+"{"+O.body+n+O.post,m(d)):[d];var j;if(E)j=O.body.split(/\.\./);else if(j=a(O.body),j.length===1&&(j=m(j[0],!1).map(c),j.length===1))return f.map(function(jt){return O.pre+j[0]+jt});var R;if(E){var _=i(j[0]),F=i(j[1]),H=Math.max(j[0].length,j[1].length),I=j.length==3?Math.abs(i(j[2])):1,et=b,xt=F<_;xt&&(I*=-1,et=v);var St=j.some(p);R=[];for(var L=_;et(L,F);L+=I){var T;if(M)T=String.fromCharCode(L),T==="\\"&&(T="");else if(T=String(L),St){var nt=H-T.length;if(nt>0){var st=new Array(nt+1).join("0");L<0?T="-"+st+T.slice(1):T=st+T}}R.push(T)}}else{R=[];for(var C=0;C<j.length;C++)R.push.apply(R,m(j[C],!1))}for(var C=0;C<R.length;C++)for(var y=0;y<f.length;y++){var w=g+R[C]+f[y];(!x||E||w)&&S.push(w)}}return S}return V}var Rt=Nt();const zt=yt(Rt),Tt=1024*64,J=o=>{if(typeof o!="string")throw new TypeError("invalid pattern");if(o.length>Tt)throw new TypeError("pattern is too long")},Ct={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},G=o=>o.replace(/[[\]\\-]/g,"\\$&"),It=o=>o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ot=o=>o.join(""),Lt=(o,t)=>{const e=t;if(o.charAt(e)!=="[")throw new Error("not in a brace expression");const n=[],s=[];let r=e+1,i=!1,h=!1,l=!1,a=!1,u=e,c="";t:for(;r<o.length;){const v=o.charAt(r);if((v==="!"||v==="^")&&r===e+1){a=!0,r++;continue}if(v==="]"&&i&&!l){u=r+1;break}if(i=!0,v==="\\"&&!l){l=!0,r++;continue}if(v==="["&&!l){for(const[m,[d,x,S]]of Object.entries(Ct))if(o.startsWith(m,r)){if(c)return["$.",!1,o.length-e,!0];r+=m.length,S?s.push(d):n.push(d),h=h||x;continue t}}if(l=!1,c){v>c?n.push(G(c)+"-"+G(v)):v===c&&n.push(G(v)),c="",r++;continue}if(o.startsWith("-]",r+1)){n.push(G(v+"-")),r+=2;continue}if(o.startsWith("-",r+1)){c=v,r+=2;continue}n.push(G(v)),r++}if(u<r)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,o.length-e,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!a){const v=n[0].length===2?n[0].slice(-1):n[0];return[It(v),!1,u-e,!1]}const p="["+(a?"^":"")+ot(n)+"]",b="["+(a?"":"^")+ot(s)+"]";return[n.length&&s.length?"("+p+"|"+b+")":n.length?p:b,h,u-e,!0]},k=(o,{windowsPathsNoEscape:t=!1}={})=>t?o.replace(/\[([^\/\\])\]/g,"$1"):o.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var N;const Gt=new Set(["!","?","+","*","@"]),X=o=>Gt.has(o),ht=o=>X(o.type),kt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),_t=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Ft=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),at=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Dt="(?!(?:^|/)\\.\\.?(?:$|/))",D="(?!\\.)",Zt=new Set(["[","."]),Jt=new Set(["..","."]),Bt=new Set("().*{}+?[]^$\\!"),Ht=o=>o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Y="[^/]",lt=Y+"*?",ut=Y+"+?";class tt{type;#n;#s;#r=!1;#t=[];#e;#h;#l;#a=!1;#i;#o;#u=!1;constructor(t,e,n={}){this.type=t,t&&(this.#s=!0),this.#e=e,this.#n=this.#e?this.#e.#n:this,this.#i=this.#n===this?n:this.#n.#i,this.#l=this.#n===this?[]:this.#n.#l,t==="!"&&!this.#n.#a&&this.#l.push(this),this.#h=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#m(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#l.pop();){if(t.type!=="!")continue;let e=t,n=e.#e;for(;n;){for(let s=e.#h+1;!n.type&&s<n.#t.length;s++)for(const r of t.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(n.#t[s])}e=n,n=e.#e}}return this}push(...t){for(const e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof N&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){const t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#e?.isStart())return!1;if(this.#h===0)return!0;const t=this.#e;for(let e=0;e<this.#h;e++){const n=t.#t[e];if(!(n instanceof N&&n.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();const t=this.#e?this.#e.#t.length:0;return this.#h===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const e=new N(this.type,t);for(const n of this.#t)e.copyIn(n);return e}static#c(t,e,n,s,r){const i=s.maxExtglobRecursion??2;let h=!1,l=!1,a=-1,u=!1;if(e.type===null){let m=n,d="";for(;m<t.length;){const x=t.charAt(m++);if(h||x==="\\"){h=!h,d+=x;continue}if(l){m===a+1?(x==="^"||x==="!")&&(u=!0):x==="]"&&!(m===a+2&&u)&&(l=!1),d+=x;continue}else if(x==="["){l=!0,a=m,u=!1,d+=x;continue}if(!s.noext&&X(x)&&t.charAt(m)==="("&&r<=i){e.push(d),d="";const S=new N(x,e);m=N.#c(t,S,m,s,r+1),e.push(S);continue}d+=x}return e.push(d),m}let c=n+1,p=new N(null,e);const b=[];let v="";for(;c<t.length;){const m=t.charAt(c++);if(h||m==="\\"){h=!h,v+=m;continue}if(l){c===a+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(c===a+2&&u)&&(l=!1),v+=m;continue}else if(m==="["){l=!0,a=c,u=!1,v+=m;continue}if(X(m)&&t.charAt(c)==="("&&(r<=i||e&&e.#p(m))){const d=e&&e.#p(m)?0:1;p.push(v),v="";const x=new N(m,p);p.push(x),c=N.#c(t,x,c,s,r+d);continue}if(m==="|"){p.push(v),v="",b.push(p),p=new N(null,e);continue}if(m===")")return v===""&&e.#t.length===0&&(e.#u=!0),p.push(v),v="",e.push(...b,p),c;v+=m}return e.type=null,e.#s=void 0,e.#t=[t.substring(n-1)],c}#b(t){return this.#g(t,_t)}#g(t,e=kt){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;const n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#p(n.type,e)}#p(t,e=Ft){return!!e.get(this.type)?.includes(t)}#w(t,e){const n=t.#t[0],s=new N(null,n,this.options);s.#t.push(""),n.push(s),this.#d(t,e)}#d(t,e){const n=t.#t[0];this.#t.splice(e,1,...n.#t);for(const s of n.#t)typeof s=="object"&&(s.#e=this);this.#o=void 0}#v(t){return!!at.get(this.type)?.has(t)}#x(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;const e=t.#t[0];return!e||typeof e!="object"||e.type===null?!1:this.#v(e.type)}#S(t){const e=at.get(this.type),n=t.#t[0],s=e?.get(n.type);if(!s)return!1;this.#t=n.#t;for(const r of this.#t)typeof r=="object"&&(r.#e=this);this.type=s,this.#o=void 0,this.#u=!1}#f(){if(ht(this)){let t=0,e=!1;do{e=!0;for(let n=0;n<this.#t.length;n++){const s=this.#t[n];typeof s=="object"&&(s.#f(),this.#g(s)?(e=!1,this.#d(s,n)):this.#b(s)?(e=!1,this.#w(s,n)):this.#x(s)&&(e=!1,this.#S(s)))}}while(!e&&++t<10)}else for(const t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}static fromGlob(t,e={}){const n=new N(null,void 0,e);return N.#c(t,n,0,e,0),n}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[e,n,s,r]=this.toRegExpSource();if(!(s||this.#s||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const i=(this.#i.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,i),{_src:e,_glob:t})}get options(){return this.#i}toRegExpSource(t){const e=t??!!this.#i.dot;if(this.#n===this&&(this.#f(),this.#m()),!ht(this)){const l=this.isStart()&&this.isEnd(),a=this.#t.map(p=>{const[b,v,m,d]=typeof p=="string"?N.#j(p,this.#s,l):p.toRegExpSource(t);return this.#s=this.#s||m,this.#r=this.#r||d,b}).join("");let u="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Jt.has(this.#t[0]))){const p=Zt,b=e&&p.has(a.charAt(0))||a.startsWith("\\.")&&p.has(a.charAt(2))||a.startsWith("\\.\\.")&&p.has(a.charAt(4)),v=!e&&!t&&p.has(a.charAt(0));u=b?Dt:v?D:""}let c="";return this.isEnd()&&this.#n.#a&&this.#e?.type==="!"&&(c="(?:$|\\/)"),[u+a+c,k(a),this.#s=!!this.#s,this.#r]}const n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let r=this.#y(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){const l=this.toString(),a=this;return a.#t=[l],a.type=null,a.#s=void 0,[l,k(this.toString()),!1,!1]}let i=!n||t||e||!D?"":this.#y(!0);i===r&&(i=""),i&&(r=`(?:${r})(?:${i})*?`);let h="";if(this.type==="!"&&this.#u)h=(this.isStart()&&!e?D:"")+ut;else{const l=this.type==="!"?"))"+(this.isStart()&&!e&&!t?D:"")+lt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`;h=s+r+l}return[h,k(r),this.#s=!!this.#s,this.#r]}#y(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");const[n,s,r,i]=e.toRegExpSource(t);return this.#r=this.#r||i,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#j(t,e,n=!1){let s=!1,r="",i=!1,h=!1;for(let l=0;l<t.length;l++){const a=t.charAt(l);if(s){s=!1,r+=(Bt.has(a)?"\\":"")+a,h=!1;continue}if(a==="\\"){l===t.length-1?r+="\\\\":s=!0;continue}if(a==="["){const[u,c,p,b]=Lt(t,l);if(p){r+=u,i=i||c,l+=p-1,e=e||b,h=!1;continue}}if(a==="*"){if(h)continue;h=!0,r+=n&&/^[*]+$/.test(t)?ut:lt,e=!0;continue}else h=!1;if(a==="?"){r+=Y,e=!0;continue}r+=Ht(a)}return[r,k(t),!!e,i]}}N=tt;const Ut=(o,{windowsPathsNoEscape:t=!1}={})=>t?o.replace(/[?*()[\]]/g,"[$&]"):o.replace(/[?*()[\]\\]/g,"\\$&");var q={};const W=(o,t,e={})=>(J(t),!e.nocomment&&t.charAt(0)==="#"?!1:new B(t,e).match(o)),Vt=/^\*+([^+@!?\*\[\(]*)$/,qt=o=>t=>!t.startsWith(".")&&t.endsWith(o),Kt=o=>t=>t.endsWith(o),Qt=o=>(o=o.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(o)),Xt=o=>(o=o.toLowerCase(),t=>t.toLowerCase().endsWith(o)),Yt=/^\*+\.\*+$/,te=o=>!o.startsWith(".")&&o.includes("."),ee=o=>o!=="."&&o!==".."&&o.includes("."),ne=/^\.\*+$/,se=o=>o!=="."&&o!==".."&&o.startsWith("."),re=/^\*+$/,ie=o=>o.length!==0&&!o.startsWith("."),oe=o=>o.length!==0&&o!=="."&&o!=="..",he=/^\?+([^+@!?\*\[\(]*)?$/,ae=([o,t=""])=>{const e=mt([o]);return t?(t=t.toLowerCase(),n=>e(n)&&n.toLowerCase().endsWith(t)):e},le=([o,t=""])=>{const e=bt([o]);return t?(t=t.toLowerCase(),n=>e(n)&&n.toLowerCase().endsWith(t)):e},ue=([o,t=""])=>{const e=bt([o]);return t?n=>e(n)&&n.endsWith(t):e},ce=([o,t=""])=>{const e=mt([o]);return t?n=>e(n)&&n.endsWith(t):e},mt=([o])=>{const t=o.length;return e=>e.length===t&&!e.startsWith(".")},bt=([o])=>{const t=o.length;return e=>e.length===t&&e!=="."&&e!==".."},wt=typeof Z=="object"&&Z?typeof q=="object"&&q&&q.__MINIMATCH_TESTING_PLATFORM__||Z.platform:"posix",ct={win32:{sep:"\\"},posix:{sep:"/"}},pe=wt==="win32"?ct.win32.sep:ct.posix.sep;W.sep=pe;const P=Symbol("globstar **");W.GLOBSTAR=P;const fe="[^/]",ge=fe+"*?",de="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ye="(?:(?!(?:\\/|^)\\.).)*?",me=(o,t={})=>e=>W(e,o,t);W.filter=me;const z=(o,t={})=>Object.assign({},o,t),be=o=>{if(!o||typeof o!="object"||!Object.keys(o).length)return W;const t=W;return Object.assign((e,n,s={})=>t(e,n,z(o,s)),{Minimatch:class extends t.Minimatch{constructor(e,n={}){super(e,z(o,n))}static defaults(e){return t.defaults(z(o,e)).Minimatch}},AST:class extends t.AST{constructor(e,n,s={}){super(e,n,z(o,s))}static fromGlob(e,n={}){return t.AST.fromGlob(e,z(o,n))}},unescape:(e,n={})=>t.unescape(e,z(o,n)),escape:(e,n={})=>t.escape(e,z(o,n)),filter:(e,n={})=>t.filter(e,z(o,n)),defaults:e=>t.defaults(z(o,e)),makeRe:(e,n={})=>t.makeRe(e,z(o,n)),braceExpand:(e,n={})=>t.braceExpand(e,z(o,n)),match:(e,n,s={})=>t.match(e,n,z(o,s)),sep:t.sep,GLOBSTAR:P})};W.defaults=be;const vt=(o,t={})=>(J(o),t.nobrace||!/\{(?:(?!\{).)*\}/.test(o)?[o]:zt(o));W.braceExpand=vt;const we=(o,t={})=>new B(o,t).makeRe();W.makeRe=we;const ve=(o,t,e={})=>{const n=new B(t,e);return o=o.filter(s=>n.match(s)),n.options.nonull&&!o.length&&o.push(t),o};W.match=ve;const pt=/[?*]|[+@!]\(.*?\)|\[|\]/,xe=o=>o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class B{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,e={}){J(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||wt,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((r,i,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){const l=r[0]===""&&r[1]===""&&(r[2]==="?"||!pt.test(r[2]))&&!pt.test(r[3]),a=/^[a-z]:/i.test(r[0]);if(l)return[...r.slice(0,4),...r.slice(4).map(u=>this.parse(u))];if(a)return[r[0],...r.slice(1).map(u=>this.parse(u))]}return r.map(l=>this.parse(l))});if(this.debug(this.pattern,s),this.set=s.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){const i=this.set[r];i[0]===""&&i[1]===""&&this.globParts[r][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let s=0;s<t[n].length;s++)t[n][s]==="**"&&(t[n][s]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let n=-1;for(;(n=e.indexOf("**",n+1))!==-1;){let s=n;for(;e[s+1]==="**";)s++;s!==n&&e.splice(n,s-n)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((n,s)=>{const r=n[n.length-1];return s==="**"&&r==="**"?n:s===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(n.pop(),n):(n.push(s),n)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const r=t[s];s===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const s=t[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let i=s;for(;n[i+1]==="**";)i++;i>s&&n.splice(s+1,i-s);let h=n[s+1];const l=n[s+2],a=n[s+3];if(h!==".."||!l||l==="."||l===".."||!a||a==="."||a==="..")continue;e=!0,n.splice(s,1);const u=n.slice(0);u[s]="**",t.push(u),s--}if(!this.preserveMultipleSlashes){for(let i=1;i<n.length-1;i++){const h=n[i];i===1&&h===""&&n[0]===""||(h==="."||h==="")&&(e=!0,n.splice(i,1),i--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(e=!0,n.pop())}let r=0;for(;(r=n.indexOf("..",r+1))!==-1;){const i=n[r-1];if(i&&i!=="."&&i!==".."&&i!=="**"){e=!0;const h=r===1&&n[r+1]==="**"?["."]:[];n.splice(r-1,2,...h),n.length===0&&n.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const s=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);if(s){t[e]=[],t[n]=s;break}}return t.filter(e=>e.length)}partsMatch(t,e,n=!1){let s=0,r=0,i=[],h="";for(;s<t.length&&r<e.length;)if(t[s]===e[r])i.push(h==="b"?e[r]:t[s]),s++,r++;else if(n&&t[s]==="**"&&e[r]===t[s+1])i.push(t[s]),s++;else if(n&&e[r]==="**"&&t[s]===e[r+1])i.push(e[r]),r++;else if(t[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(h==="b")return!1;h="a",i.push(t[s]),s++,r++}else if(e[r]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(h==="a")return!1;h="b",i.push(e[r]),s++,r++}else return!1;return t.length===e.length&&i}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){let s=0,r=0;if(this.isWindows){const h=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!h&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),a=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),u=!a&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),c=l?3:h?0:void 0,p=u?3:a?0:void 0;if(typeof c=="number"&&typeof p=="number"){const[b,v]=[t[c],e[p]];b.toLowerCase()===v.toLowerCase()&&(e[p]=b,r=p,s=c)}}const{optimizationLevel:i=1}=this.options;return i>=2&&(t=this.levelTwoFileOptimize(t)),e.includes(P)?this.#n(t,e,n,s,r):this.#r(t,e,n,s,r)}#n(t,e,n,s,r){const i=e.indexOf(P,r),h=e.lastIndexOf(P),[l,a,u]=n?[e.slice(r,i),e.slice(i+1),[]]:[e.slice(r,i),e.slice(i+1,h),e.slice(h+1)];if(l.length){const S=t.slice(s,s+l.length);if(!this.#r(S,l,n,0,0))return!1;s+=l.length}let c=0;if(u.length){if(u.length+s>t.length)return!1;let S=t.length-u.length;if(this.#r(t,u,n,S,0))c=u.length;else{if(t[t.length-1]!==""||s+u.length===t.length||(S--,!this.#r(t,u,n,S,0)))return!1;c=u.length+1}}if(!a.length){let S=!!c;for(let O=s;O<t.length-c;O++){const g=String(t[O]);if(S=!0,g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1}return n||S}const p=[[[],0]];let b=p[0],v=0;const m=[0];for(const S of a)S===P?(m.push(v),b=[[],0],p.push(b)):(b[0].push(S),v++);let d=p.length-1;const x=t.length-c;for(const S of p)S[1]=x-(m[d--]+S[0].length);return!!this.#s(t,p,s,0,n,0,!!c)}#s(t,e,n,s,r,i,h){const l=e[s];if(!l){for(let c=n;c<t.length;c++){h=!0;const p=t[c];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return h}const[a,u]=l;for(;n<=u;){if(this.#r(t.slice(0,n+a.length),a,r,n,0)&&i<this.maxGlobstarRecursion){const p=this.#s(t,e,n+a.length,s+1,r,i+1,h);if(p!==!1)return p}const c=t[n];if(c==="."||c===".."||!this.options.dot&&c.startsWith("."))return!1;n++}return r||null}#r(t,e,n,s,r){let i,h,l,a;for(i=s,h=r,a=t.length,l=e.length;i<a&&h<l;i++,h++){this.debug("matchOne loop");let u=e[h],c=t[i];if(this.debug(e,u,c),u===!1||u===P)return!1;let p;if(typeof u=="string"?(p=c===u,this.debug("string match",u,c,p)):(p=u.test(c),this.debug("pattern match",u,c,p)),!p)return!1}if(i===a&&h===l)return!0;if(i===a)return n;if(h===l)return i===a-1&&t[i]==="";throw new Error("wtf?")}braceExpand(){return vt(this.pattern,this.options)}parse(t){J(t);const e=this.options;if(t==="**")return P;if(t==="")return"";let n,s=null;(n=t.match(re))?s=e.dot?oe:ie:(n=t.match(Vt))?s=(e.nocase?e.dot?Xt:Qt:e.dot?Kt:qt)(n[1]):(n=t.match(he))?s=(e.nocase?e.dot?le:ae:e.dot?ue:ce)(n):(n=t.match(Yt))?s=e.dot?ee:te:(n=t.match(ne))&&(s=se);const r=tt.fromGlob(t,this.options).toMMPattern();return s&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:s}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?ge:e.dot?de:ye,s=new Set(e.nocase?["i"]:[]);let r=t.map(l=>{const a=l.map(u=>{if(u instanceof RegExp)for(const c of u.flags.split(""))s.add(c);return typeof u=="string"?xe(u):u===P?P:u._src});return a.forEach((u,c)=>{const p=a[c+1],b=a[c-1];u!==P||b===P||(b===void 0?p!==void 0&&p!==P?a[c+1]="(?:\\/|"+n+"\\/)?"+p:a[c]=n:p===void 0?a[c-1]=b+"(?:\\/|"+n+")?":p!==P&&(a[c-1]=b+"(?:\\/|\\/"+n+"\\/)"+p,a[c+1]=P))}),a.filter(u=>u!==P).join("/")}).join("|");const[i,h]=t.length>1?["(?:",")"]:["",""];r="^"+i+r+h+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const r=this.set;this.debug(this.pattern,"set",r);let i=s[s.length-1];if(!i)for(let h=s.length-2;!i&&h>=0;h--)i=s[h];for(let h=0;h<r.length;h++){const l=r[h];let a=s;if(n.matchBase&&l.length===1&&(a=[i]),this.matchOne(a,l,e))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return W.defaults(t).Minimatch}}W.AST=tt,W.Minimatch=B,W.escape=Ut,W.unescape=k;function Se(o){const t={};for(const e of o.keys())t[e]=o.get(e);return t}function je(o,t,e=!1){return e?{data:t,headers:o.headers?Se(o.headers):{},status:o.status,statusText:o.statusText}:t}var K,ft;function Oe(){if(ft)return K;ft=1;var o=$t(),t=function(i){return typeof i=="string"};function e(i,h){for(var l=[],a=0;a<i.length;a++){var u=i[a];!u||u==="."||(u===".."?l.length&&l[l.length-1]!==".."?l.pop():h&&l.push(".."):l.push(u))}return l}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,s={};function r(i){return n.exec(i).slice(1)}return s.resolve=function(){for(var i="",h=!1,l=arguments.length-1;l>=-1&&!h;l--){var a=l>=0?arguments[l]:Z.cwd();if(t(a)){if(!a)continue}else throw new TypeError("Arguments to path.resolve must be strings");i=a+"/"+i,h=a.charAt(0)==="/"}return i=e(i.split("/"),!h).join("/"),(h?"/":"")+i||"."},s.normalize=function(i){var h=s.isAbsolute(i),l=i.substr(-1)==="/";return i=e(i.split("/"),!h).join("/"),!i&&!h&&(i="."),i&&l&&(i+="/"),(h?"/":"")+i},s.isAbsolute=function(i){return i.charAt(0)==="/"},s.join=function(){for(var i="",h=0;h<arguments.length;h++){var l=arguments[h];if(!t(l))throw new TypeError("Arguments to path.join must be strings");l&&(i?i+="/"+l:i+=l)}return s.normalize(i)},s.relative=function(i,h){i=s.resolve(i).substr(1),h=s.resolve(h).substr(1);function l(m){for(var d=0;d<m.length&&m[d]==="";d++);for(var x=m.length-1;x>=0&&m[x]==="";x--);return d>x?[]:m.slice(d,x+1)}for(var a=l(i.split("/")),u=l(h.split("/")),c=Math.min(a.length,u.length),p=c,b=0;b<c;b++)if(a[b]!==u[b]){p=b;break}for(var v=[],b=p;b<a.length;b++)v.push("..");return v=v.concat(u.slice(p)),v.join("/")},s._makeLong=function(i){return i},s.dirname=function(i){var h=r(i),l=h[0],a=h[1];return!l&&!a?".":(a&&(a=a.substr(0,a.length-1)),l+a)},s.basename=function(i,h){var l=r(i)[2];return h&&l.substr(-1*h.length)===h&&(l=l.substr(0,l.length-h.length)),l},s.extname=function(i){return r(i)[3]},s.format=function(i){if(!o.isObject(i))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof i);var h=i.root||"";if(!t(h))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof i.root);var l=i.dir?i.dir+s.sep:"",a=i.base||"";return l+a},s.parse=function(i){if(!t(i))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof i);var h=r(i);if(!h||h.length!==4)throw new TypeError("Invalid path '"+i+"'");return h[1]=h[1]||"",h[2]=h[2]||"",h[3]=h[3]||"",{root:h[0],dir:h[0]+h[1].slice(0,h[1].length-1),base:h[2],ext:h[3],name:h[2].slice(0,h[2].length-h[3].length)}},s.sep="/",s.delimiter=":",K=s,K}var Ee=Oe();const $e=yt(Ee);var Q,gt;function Me(){if(gt)return Q;gt=1;function o(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(f){return typeof f}:o=function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},o(g)}function t(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function e(g,f){return f&&(o(f)==="object"||typeof f=="function")?f:n(g)}function n(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function s(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),f&&a(g,f)}function r(g){var f=typeof Map=="function"?new Map:void 0;return r=function(y){if(y===null||!l(y))return y;if(typeof y!="function")throw new TypeError("Super expression must either be null or a function");if(typeof f<"u"){if(f.has(y))return f.get(y);f.set(y,w)}function w(){return i(y,arguments,u(this).constructor)}return w.prototype=Object.create(y.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),a(w,y)},r(g)}function i(g,f,y){return h()?i=Reflect.construct:i=function(w,$,M){var E=[null];E.push.apply(E,$);var A=Function.bind.apply(w,E),j=new A;return M&&a(j,M.prototype),j},i.apply(null,arguments)}function h(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function l(g){return Function.toString.call(g).indexOf("[native code]")!==-1}function a(g,f){return a=Object.setPrototypeOf||function(y,w){return y.__proto__=w,y},a(g,f)}function u(g){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},u(g)}var c="+",p=".",b=(function(g){s(f,g);function f(y){var w;return t(this,f),w=e(this,u(f).call(this,y)),w.name="ObjectPrototypeMutationError",w}return f})(r(Error));Q={set:d,get:v,has:m,hasOwn:function(g,f,y){return this.has(g,f,y||{own:!0})},isIn:x,ObjectPrototypeMutationError:b};function v(g,f){if(o(g)!="object"||g===null||typeof f>"u")return g;if(typeof f=="number")return g[f];try{return S(g,f,function(y,w){return y[w]})}catch{return g}}function m(g,f){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(o(g)!="object"||g===null||typeof f>"u")return!1;if(typeof f=="number")return f in g;try{var w=!1;return S(g,f,function($,M,E,A){if(O(E,A))y.own?w=$.hasOwnProperty(M):w=M in $;else return $&&$[M]}),w}catch{return!1}}function d(g,f,y){if(o(g)!="object"||g===null||typeof f>"u")return g;if(typeof f=="number")return g[f]=y,g[f];try{return S(g,f,function(w,$,M,E){if(w===Reflect.getPrototypeOf({}))throw new b("Attempting to mutate Object.prototype");if(!w[$]){var A=Number.isInteger(Number(M[E+1])),j=M[E+1]===c;A||j?w[$]=[]:w[$]={}}return O(M,E)&&(w[$]=y),w[$]})}catch(w){if(w instanceof b)throw w;return g}}function x(g,f,y){var w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(o(g)!="object"||g===null||typeof f>"u")return!1;try{var $=!1,M=!1;return S(g,f,function(E,A,j,R){return $=$||E===y||!!E&&E[A]===y,M=O(j,R)&&o(E)==="object"&&A in E,E&&E[A]}),w.validPath?$&&M:$}catch{return!1}}function S(g,f){for(var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},w=f.split(p),$=w.length,M=function(j){var R=w[j];if(!g)return{v:void 0};if(R===c){if(Array.isArray(g))return{v:g.map(function(F,H){var I=w.slice(j+1);return I.length>0?S(F,I.join(p),y):y(g,H,w,j)})};var _=w.slice(0,j).join(p);throw new Error("Object at wildcard (".concat(_,") is not an array"))}else g=y(g,R,w,j)},E=0;E<$;E++){var A=M(E);if(o(A)==="object")return A.v}return g}function O(g,f){return g.length===f+1}return Q}Me();var dt;(function(o){o.Array="array",o.Object="object",o.Original="original"})(dt||(dt={}));function Pe(o,t,e=!1){const{getlastmodified:n=null,getcontentlength:s="0",resourcetype:r=null,getcontenttype:i=null,getetag:h=null}=o,l=r&&typeof r=="object"&&typeof r.collection<"u"?"directory":"file",a={filename:t,basename:$e.basename(t),lastmod:n,size:parseInt(s,10),type:l,etag:typeof h=="string"?h.replace(/"/g,""):null};return l==="file"&&(a.mime=i&&typeof i=="string"?i.split(";")[0]:""),e&&(typeof o.displayname<"u"&&(o.displayname=String(o.displayname)),a.props=o),a}const We=20;async function Ce({resourceType:o,resourceId:t},e){const n=["",o,t].join("/"),s=e.datetime?`<oc:datetime>${e.datetime.toISOString()}</oc:datetime>`:"",r=await Wt.customRequest(n,{method:"REPORT",data:`<?xml version="1.0"?>
|
|
<oc:filter-comments
|
|
xmlns:d="DAV:"
|
|
xmlns:oc="http://owncloud.org/ns"
|
|
xmlns:nc="http://nextcloud.org/ns"
|
|
xmlns:ocs="http://open-collaboration-services.org/ns">
|
|
<oc:limit>${e.limit??We}</oc:limit>
|
|
<oc:offset>${e.offset||0}</oc:offset>
|
|
${s}
|
|
</oc:filter-comments>`,...e}),i=await r.text(),h=await Ot(i),l=Ae(h,!0);return je(r,l,!0)}function Ae(o,t=!1){const{multistatus:{response:e}}=o;return e.map(n=>{const s=n.propstat.prop;return Pe(s,s.id.toString(),t)})}export{We as D,Pt as a,Wt as c,Ce as g};
|
|
//# sourceMappingURL=GetComments-PgOpAezt.chunk.mjs.map
|