varOe=typeofglobalThis<"u"?globalThis:typeofwindow<"u"?window:typeofglobal<"u"?global:typeofself<"u"?self:{};functionQo(e){returne&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}functionEl(e){returne&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}varku={exports:{}},Xt=ku.exports={},Le,Be;functionMo(){thrownewError("setTimeout has not been defined")}functionTo(){thrownewError("clearTimeout has not been defined")}(function(){try{typeofsetTimeout=="function"?Le=setTimeout:Le=Mo}catch{Le=Mo}try{typeofclearTimeout=="function"?Be=clearTimeout:Be=To}catch{Be=To}})();function$u(e){if(Le===setTimeout)returnsetTimeout(e,0);if((Le===Mo||!Le)&&setTimeout)returnLe=setTimeout,setTimeout(e,0);try{returnLe(e,0)}catch{try{returnLe.call(null,e,0)}catch{returnLe.call(this,e,0)}}}function_l(e){if(Be===clearTimeout)returnclearTimeout(e);if((Be===To||!Be)&&clearTimeout)returnBe=clearTimeout,clearTimeout(e);try{returnBe(e)}catch{try{returnBe.call(null,e)}catch{returnBe.call(this,e)}}}varTe=[],un=!1,qe,Hn=-1;functionAl(){!un||!qe||(un=!1,qe.length?Te=qe.concat(Te):Hn=-1,Te.length&&Fu())}functionFu(){if(!un){vare=$u(Al);un=!0;for(vart=Te.length;t;){for(qe=Te,Te=[];++Hn<t;)qe&&qe[Hn].run();Hn=-1,t=Te.length}qe=null,un=!1,_l(e)}}Xt.nextTick=function(e){vart=newArray(arguments.length-1);if(arguments.length>1)for(varn=1;n<arguments.length;n++)t[n-1]=arguments[n];Te.push(newGu(e,t)),Te.length===1&&!un&&$u(Fu)};functionGu(e,t){this.fun=e,this.array=t}Gu.prototype.run=function(){this.fun.apply(null,this.array)},Xt.title="browser",Xt.browser=!0,Xt.env={},Xt.argv=[],Xt.version="",Xt.versions={};functionDe(){}Xt.on=De,Xt.addListener=De,Xt.once=De,Xt.off=De,Xt.removeListener=De,Xt.removeAllListeners=De,Xt.emit=De,Xt.prependListener=De,Xt.prependOnceListener=De,Xt.listeners=function(e){return[]},Xt.binding=function(e){thrownewError("process.binding is not supported")},Xt.cwd=function(){return"/"},Xt.chdir=function(e){thrownewError("process.chdir is not supported")},Xt.umask=function(){return0};varSl=ku.exports;constvt=El(Sl);varfr,js;functionOu(){if(js)returnfr;js=1;vare={};returnfr=typeofvt=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{},fr}varhr,Ds;functionVu(){if(Ds)returnhr;Ds=1;conste="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;returnhr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},hr}varpr={exports:{}},Ms;functionNl(){returnMs||(Ms=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Vu(),s=Ou();t=e.exports={};constu=t.re=[],i=t.safeRe=[],f=t.src=[],h=t.safeSrc=[],a=t.t={};letp=0;constd="[a-zA-Z0-9-]",I=[["\\s",1],["\\d",o],[d,r]],S=R=>{for(const[v,E]ofI)R=R.split(`${v}*`).join(`${v}{0,${E}}`).split(`${v}+`).join(`${v}{1,${E}}`);returnR},w=(R,v,E)=>{constx=S(v),N=p++;s(R,N,v),a[R]=N,f[N]=v,h[N]=x,u[N]=newRegExp(v,E?"g":void0),i[N]=newRegExp(x,E?"g":void0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*"),w("NUMERICIDENTIFIERLOOSE","\\d+"),w("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),w("MAINVERSION",`(${f[a.NUMERICIDENTIFIER]})\\.(${f[a.NUMERICIDENTIFIER]})\\.(${f[a.NUMERICIDENTIFIER]})`),w("MAINVERSIONLOOSE",`(${f[a.NUMERICIDENTIFIERLOOSE]})\\.(${f[a.NUMERICIDENTIFIERLOOSE]})\\.(${f[a.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASEIDENTIFIER",`(?:${f[a.NONNUMERICIDENTIFIER]}|${f[a.NUMERICIDENTIFIER]})`),w("PRERELEASEIDENTIFIERLOOSE",`(?:${f[a.NONNUMERICIDENTIFIER]}|${f[a.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASE",`(?:-(${f[a.PRERELEASEIDENTIFIER]}(?:\\.${f[a.PRERELEASEIDENTIFIER]})*))`),w("PRERELEASELOOSE",`(?:-?(${f[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[a.PRERELEASEIDENTIFIERLOOSE]})*))`),w("BUILDIDENTIFIER",`${d}+`),w("BUILD",`(?:\\+(${f[a.BUILDIDENTIFIER]}(?:\\.${f[a.BUILDIDENTIFIER]})*))`),w("FULLPLAIN",`v?${f[a.MAINVERSION]}${f[a.P
${t.stack}`),o)}log(t,n,r){if(!(typeofthis.context?.level=="number"&&t<this.context?.level))switch(typeofn=="object"&&r?.error===void0&&(r.error=n),t){caseqt.Debug:console.debug(this.formatMessage(n,qt.Debug,r),r);break;caseqt.Info:console.info(this.formatMessage(n,qt.Info,r),r);break;caseqt.Warn:console.warn(this.formatMessage(n,qt.Warn,r),r);break;caseqt.Error:console.error(this.formatMessage(n,qt.Error,r),r);break;caseqt.Fatal:default:console.error(this.formatMessage(n,qt.Fatal,r),r);break}}debug(t,n){this.log(qt.Debug,t,Object.assign({},this.context,n))}info(t,n){this.log(qt.Info,t,Object.assign({},this.context,n))}warn(t,n){this.log(qt.Warn,t,Object.assign({},this.context,n))}error(t,n){this.log(qt.Error,t,Object.assign({},this.context,n))}fatal(t,n){this.log(qt.Fatal,t,Object.assign({},this.context,n))}}functionJl(e){returnnewXl(e)}classql{context;factory;constructor(t){this.context={},this.factory=t}setApp(t){returnthis.context.app=t,this}setLogLevel(t){returnthis.context.level=t,this}setUid(t){returnthis.context.uid=t,this}detectUser(){constt=Ko();returnt!==null&&(this.context.uid=t.uid),this}detectLogLevel(){constt=this,n=()=>{document.readyState==="complete"||document.readyState==="interactive"?(t.context.level=window._oc_config?.loglevel??qt.Warn,window._oc_debug&&(t.context.level=qt.Debug),document.removeEventListener("readystatechange",n)):document.addEventListener("readystatechange",n)};returnn(),this}build(){returnthis.context.level===void0&&this.detectLogLevel(),this.factory(this.context)}}functionQl(){returnnewql(Jl)}functionzs(e){returne&&e.split("/").map(encodeURIComponent).join("/")}functionXu(e,t){returne=e.replace(/\\/g,"/").replace(/\/+$/g,"").replace(/.*\//,""),e}functionWs(e){e=e.replaceAll(/\\/g,"/");constt=e.split("/");returnt.length<=1?".":(t.pop(),t.length===1&&t[0]===""?"/":t.join("/"))}functionZl(e){constt=Xu(e),n=t.lastIndexOf(".");returnn>0?t.substring(n):""}functionKl(...e){if(arguments.length<1)return"";constt=e.filter(f=>f.length>0);if(t.length<1)return"";constn=t[t.length-1],r=t[0].charAt(0)==="/",o=n.charAt(n.length-1)==="/",s=t.reduce((f,h)=>f.concat(h.split("/")),[]);letu=!r;consti=s.reduce((f,h)=>h===""?f:u?(u=!1,f+h):f+"/"+h,"");returno?i+"/":i}window._nc_files_scope??={},window._nc_files_scope.v4_0??={};constOt=window._nc_files_scope.v4_0,Ge=Ql().setApp("@nextcloud/files").detectUser().build(),Ju=Object.freeze({Folder:"folder",File:"file"}),Ee=Object.freeze({NONE:0,READ:1,UPDATE:2,CREATE:4,WRITE:4,DELETE:8,SHARE:16,ALL:31}),qu=Object.freeze({NEW:"new",FAILED:"failed",LOADING:"loading",LOCKED:"locked"});functionQu(e,t){returne.match(t)!==null}functionke(e,t){if(e.id&&typeofe.id!="number"&&typeofe.id!="string")thrownewError("Invalid id type of value");if(!e.source)thrownewError("Missing mandatory source");try{newURL(e.source)}catch{thrownewError("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))thrownewError("Invalid source format, only http(s) is supported");if(!e.root)thrownewError("Missing mandatory root");if(typeofe.root!="string")thrownewError("Invalid root type");if(!e.root.startsWith("/"))thrownewError("Root must start with a leading slash");if(!e.source.includes(e.root))thrownewError("Root must be part of the source");if(Qu(e.source,t)){constn=e.source.match(t)[0];if(!e.source.includes(Kl(n,e.root)))thrownewError("The root must be relative to the service. e.g /files/emma")}if(e.displayname&&typeofe.displayname!="string")thrownewError("Invalid displayname type");if(e.mtime&&!(e.mtimeinstanceofDate))thrownewError("Invalid mtime type");if(e.crtime&&!(e.crtimeinstanceofDate))thrownewError("Invalid crtime type");if(!e.mime||typeofe.mime!="string"||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))thrownewError("Missing or invalid mandatory mime");if("size"ine&&typeofe.size!="number"&&e.size!==void0)thrownewError("Invalid size type");if("permissions"ine&&e.permissions!==void0&&!(typeofe.permissions=="number"&&e.permissions>=Ee.NONE&&e.permissions<=Ee.ALL))thrownewE
`?(y.line++,y.column=0):y.column++);y.cdata+=b.substring(ot,k-1),D==="]"&&(y.state=j.CDATA_ENDING);continue;case j.CDATA_ENDING:D==="]"?y.state=j.CDATA_ENDING_2:(y.cdata+="]"+D,y.state=j.CDATA);continue;case j.CDATA_ENDING_2:D===">"?(y.cdata&<(y,"oncdata",y.cdata),lt(y,"onclosecdata"),y.cdata="",y.state=j.TEXT):D==="]"?y.cdata+="]":(y.cdata+="]]"+D,y.state=j.CDATA);continue;case j.PROC_INST:D==="?"?y.state=j.PROC_INST_ENDING:P(D)?y.state=j.PROC_INST_BODY:y.procInstName+=D;continue;case j.PROC_INST_BODY:if(!y.procInstBody&&P(D))continue;D==="?"?y.state=j.PROC_INST_ENDING:y.procInstBody+=D;continue;case j.PROC_INST_ENDING:if(D===">"){const dt={name:y.procInstName,body:y.procInstBody};Et(y,dt),lt(y,"onprocessinginstruction",dt),y.procInstName=y.procInstBody="",y.state=j.TEXT}else y.procInstBody+="?"+D,y.state=j.PROC_INST_BODY;continue;case j.OPEN_TAG:O(E,D)?y.tagName+=D:(z(y),D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:(P(D)||ft(y,"Invalid character in tag name"),y.state=j.ATTRIB));continue;case j.OPEN_TAG_SLASH:D===">"?(T(y,!0),Y(y)):(ft(y,"Forward-slash in opening tag not followed by >"),y.state=j.ATTRIB);continue;case j.ATTRIB:if(P(D))continue;D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:O(v,D)?(y.attribName=D,y.attribValue="",y.state=j.ATTRIB_NAME):ft(y,"Invalid attribute name");continue;case j.ATTRIB_NAME:D==="="?y.state=j.ATTRIB_VALUE:D===">"?(ft(y,"Attribute without value"),y.attribValue=y.attribName,Q(y),T(y)):P(D)?y.state=j.ATTRIB_NAME_SAW_WHITE:O(E,D)?y.attribName+=D:ft(y,"Invalid attribute name");continue;case j.ATTRIB_NAME_SAW_WHITE:if(D==="=")y.state=j.ATTRIB_VALUE;else{if(P(D))continue;ft(y,"Attribute without value"),y.tag.attributes[y.attribName]="",y.attribValue="",lt(y,"onattribute",{name:y.attribName,value:""}),y.attribName="",D===">"?T(y):O(v,D)?(y.attribName=D,y.state=j.ATTRIB_NAME):(ft(y,"Invalid attribute name"),y.state=j.ATTRIB)}continue;case j.ATTRIB_VALUE:if(P(D))continue;M(D)?(y.q=D,y.state=j.ATTRIB_VALUE_QUOTED):(y.opt.unquotedAttributeValues||yt(y,"Unquoted attribute value"),y.state=j.ATTRIB_VALUE_UNQUOTED,y.attribValue=D);continue;case j.ATTRIB_VALUE_QUOTED:if(D!==y.q){D==="&"?y.state=j.ATTRIB_VALUE_ENTITY_Q:y.attribValue+=D;continue}Q(y),y.q="",y.state=j.ATTRIB_VALUE_CLOSED;continue;case j.ATTRIB_VALUE_CLOSED:P(D)?y.state=j.ATTRIB:D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:O(v,D)?(ft(y,"No whitespace between attributes"),y.attribName=D,y.attribValue="",y.state=j.ATTRIB_NAME):ft(y,"Invalid attribute name");continue;case j.ATTRIB_VALUE_UNQUOTED:if(!F(D)){D==="&"?y.state=j.ATTRIB_VALUE_ENTITY_U:y.attribValue+=D;continue}Q(y),D===">"?T(y):y.state=j.ATTRIB;continue;case j.CLOSE_TAG:if(y.tagName)D===">"?Y(y):O(E,D)?y.tagName+=D:y.script?(y.script+="</"+y.tagName+D,y.tagName="",y.state=j.SCRIPT):(P(D)||ft(y,"Invalid tagname in closing tag"),y.state=j.CLOSE_TAG_SAW_WHITE);else{if(P(D))continue;q(v,D)?y.script?(y.script+="</"+D,y.state=j.SCRIPT):ft(y,"Invalid tagname in closing tag."):y.tagName=D}continue;case j.CLOSE_TAG_SAW_WHITE:if(P(D))continue;D===">"?Y(y):ft(y,"Invalid characters in closing tag");continue;case j.TEXT_ENTITY:case j.ATTRIB_VALUE_ENTITY_Q:case j.ATTRIB_VALUE_ENTITY_U:var X,wt;switch(y.state){case j.TEXT_ENTITY:X=j.TEXT,wt="textNode";break;case j.ATTRIB_VALUE_ENTITY_Q:X=j.ATTRIB_VALUE_QUOTED,wt="attribValue";break;case j.ATTRIB_VALUE_ENTITY_U:X=j.ATTRIB_VALUE_UNQUOTED,wt="attribValue";break}if(D===";"){var Bt=K(y);y.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Bt)?((y.entityCount+=1)>y.opt.maxEntityCount&&yt(y,"Parsed entity count exceeds max entity count"),(y.entityDepth+=1)>y.opt.maxEntityDepth&&yt(y,"Parsed entity depth exceeds max entity depth"),y.entity="",y.state=X,y.write(Bt),y.entityDepth-=1):(y[wt]+=Bt,y.entity="",y.state=X)}else O(y.entity.length?N:x,D)?y.entity+=D:(ft(y,"Invalid character in entity name"),y[wt]+="&"+y.entity+D,y.entity="",y.state=X);continue;default:throw new Error(y,"Unknown state: "+y.state)}return y.position>=y.bufferCheckPosition&&o(y),y}String.fromCodePoint||(function(){var b=String.fromCharCode,y=Math.floor,k=function(){var D
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}functionph(e,t){returnlh(e)||fh(e,t)||dh(e,t)||hh()}functiondh(e,t){if(e){if(typeofe=="string")returnYi(e,t);varn={}.toString.call(e).slice(8,-1);returnn==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yi(e,t):void0}}constmc=Object.entries,Hi=Object.setPrototypeOf,gh=Object.isFrozen,mh=Object.getPrototypeOf,yh=Object.getOwnPropertyDescriptor;letZt=Object.freeze,re=Object.seal,on=Object.create,yc=typeofReflect<"u"&&Reflect,ko=yc.apply,$o=yc.construct;Zt||(Zt=function(e){returne}),re||(re=function(e){returne}),ko||(ko=function(e,t){for(varn=arguments.length,r=newArray(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];returne.apply(t,r)}),$o||($o=function(e){for(vart=arguments.length,n=newArray(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];returnnewe(...n)});constJe=Qt(Array.prototype.forEach),bh=Qt(Array.prototype.lastIndexOf),Xi=Qt(Array.prototype.pop),wn=Qt(Array.prototype.push),wh=Qt(Array.prototype.splice),cn=Array.isArray,In=Qt(String.prototype.toLowerCase),po=Qt(String.prototype.toString),Ji=Qt(String.prototype.match),vn=Qt(String.prototype.replace),qi=Qt(String.prototype.indexOf),vh=Qt(String.prototype.trim),Eh=Qt(Number.prototype.toString),_h=Qt(Boolean.prototype.toString),Qi=typeofBigInt>"u"?null:Qt(BigInt.prototype.toString),Zi=typeofSymbol>"u"?null:Qt(Symbol.prototype.toString),me=Qt(Object.prototype.hasOwnProperty),En=Qt(Object.prototype.toString),ie=Qt(RegExp.prototype.test),Ye=Ah(TypeError);functionQt(e){returnfunction(t){tinstanceofRegExp&&(t.lastIndex=0);for(varn=arguments.length,r=newArray(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];returnko(e,t,r)}}functionAh(e){returnfunction(){for(vart=arguments.length,n=newArray(t),r=0;r<t;r++)n[r]=arguments[r];return$o(e,n)}}functionIt(e,t){letn=arguments.length>2&&arguments[2]!==void0?arguments[2]:In;if(Hi&&Hi(e,null),!cn(t))returne;letr=t.length;for(;r--;){leto=t[r];if(typeofo=="string"){consts=n(o);s!==o&&(gh(t)||(t[r]=s),o=s)}e[o]=!0}returne}functionSh(e){for(lett=0;t<e.length;t++)me(e,t)||(e[t]=null);returne}functionve(e){constt=on(null);for(constrofmc(e)){varn=ph(r,2);consto=n[0],s=n[1];me(e,o)&&(cn(s)?t[o]=Sh(s):s&&typeofs=="object"&&s.constructor===Object?t[o]=ve(s):t[o]=s)}returnt}functionNh(e){switch(typeofe){case"string":returne;case"number":returnEh(e);case"boolean":return_h(e);case"bigint":returnQi?Qi(e):"0";case"symbol":returnZi?Zi(e):"Symbol()";case"undefined":returnEn(e);case"function":case"object":{if(e===null)returnEn(e);constt=e,n=Ae(t,"toString");if(typeofn=="function"){constr=n(t);returntypeofr=="string"?r:En(r)}returnEn(e)}default:returnEn(e)}}functionAe(e,t){for(;e!==null;){constr=yh(e,t);if(r){if(r.get)returnQt(r.get);if(typeofr.value=="function")returnQt(r.value)}e=mh(e)}functionn(){returnnull}returnn}functionIh(e){try{returnie(e,""),!0}catch{return!1}}constKi=Zt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),go=Zt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","ent
`+Ue),$t&&(Ue=kn(Ue)),j&&at?Et(Ue):Ue},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ur(C),c=!0,g=k,_=ot},t.clearConfig=function(){Ke=null,c=!1,g=null,_=null,j=G,ct=""},t.isValidAttribute=function(C,J,et){Ke||ur({});const ut=Yt(C),ht=Yt(J);return Ps(ut,ht,et)},t.addHook=function(C,J){typeof J=="function"&&me(Q,C)&&wn(Q[C],J)},t.removeHook=function(C,J){if(me(Q,C)){if(J!==void 0){const et=bh(Q[C],J);return et===-1?void 0:wh(Q[C],et,1)[0]}return Xi(Q[C])}},t.removeHooks=function(C){me(Q,C)&&(Q[C]=[])},t.removeAllHooks=function(){Q=au()},t}wc(),globalThis._nc_l10n_locale??=typeof document<"u"&&document.documentElement.dataset.locale||Intl.DateTimeFormat().resolvedOptions().locale.replaceAll(/-/g,"_"),globalThis._nc_l10n_language??=typeof document<"u"&&document.documentElement.lang||(globalThis.navigator?.language??"en"),globalThis._oc_l10n_registry_translations??={},globalThis._oc_l10n_registry_plural_functions??={};class zh extends of{}function vc(){return Ot.registry??=new zh,Ot.registry}function Wh(){return vc()}const Yh=Object.freeze({DEFAULT:"default",HIDDEN:"hidden"});function Hh(e){if(Jh(e),Ot.fileActions??=new Map,Ot.fileActions.has(e.id)){Ge.error(`FileAction ${e.id} already registered`,{action:e});return}Ot.fileActions.set(e.id,e),vc().dispatchTypedEvent("register:action",new CustomEvent("register:action",{detail:e}))}function Xh(){return Ot.fileActions?[...Ot.fileActions.values()]:[]}function Jh(e){if(!e.id||typeof e.id!="string")throw new Error("Invalidid");if(!e.displayName||typeof e.displayName!="function")throw new Error("InvaliddisplayNamefunction");if("title"in e&&typeof e.title!="function")throw new Error("Invalidtitlefunction");if(!e.iconSvgInline||typeof e.iconSvgInline!="function")throw new Error("InvalidiconSvgInlinefunction");if(!e.exec||typeof e.exec!="function")throw new Error("Invalidexecfunction");if("enabled"in e&&typeof e.enabled!="function")throw new Error("Invalidenabledfunction");if("execBatch"in e&&typeof e.execBatch!="function")throw new Error("InvalidexecBatchfunction");if("order"in e&&typeof e.order!="number")throw new Error("Invalidorder");if(e.destructive!==void 0&&typeof e.destructive!="boolean")throw new Error("Invaliddestructiveflag");if("parent"in e&&typeof e.parent!="string")throw new Error("Invalidparent");if(e.default&&!Object.values(Yh).includes(e.default))throw new Error("Invaliddefault");if("inline"in e&&typeof e.inline!="function")throw new Error("Invalidinlinefunction");if("renderInline"in e&&typeof e.renderInline!="function")throw new Error("InvalidrenderInlinefunction");if("hotkey"in e&&e.hotkey!==void 0){if(typeof e.hotkey!="object")throw new Error("Invalidhotkeyconfiguration");if(typeof e.hotkey.key!="string"||!e.hotkey.key)throw new Error("Missingorinvalidhotkeykey");if(typeof e.hotkey.description!="string"||!e.hotkey.description)throw new Error("Missingorinvalidhotkeydescription")}}function qh(e){if(Qh(e),Ot.filesSidebarActions??=new Map,Ot.filesSidebarActions.has(e.id)){Ge.warn(`Sidebar action with id "${e.id}" already registered. Skipping.`);return}Ot.filesSidebarActions.set(e.id,e),Ge.debug(`New sidebar action with id "${e.id}" registered.`)}function Qh(e){if(typeof e!="object")throw new Error("Sidebaractionisnotanobject");if(!e.id||typeof e.id!="string"||e.id!==CSS.escape(e.id))throw new Error("SidebaractionsneedtohaveanidconformingtotheHTMLidattributespecifications");if(!e.displayName||typeof e.displayName!="function")throw new Error("SidebaractionsneedtohaveadisplayNamefunction");if(!e.iconSvgInline||typeof e.iconSvgInline!="function")throw new Error("SidebaractionsneedtohaveaiconSvgInlinefunction");if(!e.enabled||typeof e.enabled!="function")throw new Error("Sidebaractionsneedtohaveanenabledfunction");if(!e.onClick||typeof e.onClick!="function")throw new Error("SidebaractionsneedtohaveanonClickfunction")}function Ec(e){if(Zh(e),Ot.filesSidebarTabs??=new Map,Ot.filesSidebarTabs.has(e.id)){Ge.warn(`Sidebar tab with id "${e.id}" already registered
caused by: ${pe.fullStack(n)}`:t.stack??""}static info(t){Eo(t);const n={},r=pe.cause(t);return r&&Object.assign(n,pe.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var op=kt(47),qn=kt.n(op);const uu="__PATH_SEPARATOR_POSIX__",cu="__PATH_SEPARATOR_WINDOWS__";function Vt(e){try{const t=e.replace(/\//g,uu).replace(/\\\\/g,cu);return encodeURIComponent(t).split(cu).join("\\\\").split(uu).join("/")}catch(t){throw new pe(t,"Failedencodingpath")}}function lu(e){return e.startsWith("/")?e:"/"+e}function Cn(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function sp(e){let t=new(rp())(e).pathname;return t.length<=0&&(t="/"),Cn(t)}function zt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(function(){return(function(r){var o=[];if(r.length===0)return"";if(typeof r[0]!="string")throw new TypeError("Urlmustbeastring.Received"+r[0]);if(r[0].match(/^[^/:]+:\/*$/)&&r.length>1){var s=r.shift();r[0]=s+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var u=0;u<r.length;u++){var i=r[u];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(u>0&&(i=i.replace(/^[\/]+/,"")),i=u<r.length-1?i.replace(/[\/]+$/,""):i.replace(/[\/]+$/,"/"),o.push(i))}var f=o.join("/"),h=(f=f.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return h.shift()+(h.length>0?"?":"")+h.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((r,o,s)=>((s===0||o!=="/"||o==="/"&&r[r.length-1]!=="/")&&r.push(o),r)),[]))}var ap=kt(542),_n=kt.n(ap);function fu(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),o=e.method?e.method.toUpperCase():"GET",s=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",u=`00000000${t.nc}`.slice(-8),i=(function(d,I,S,w,R,v,E){const x=E||_n()(`${I}:${S}:${w}`);return d&&d.toLowerCase()==="md5-sess"?_n()(`${x}:${R}:${v}`):x})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),f=_n()(`${o}:${r}`),h=s?_n()(`${i}:${t.nonce}:${u}:${t.cnonce}:${s}:${f}`):_n()(`${i}:${t.nonce}:${f}`),a={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:s,response:h,nc:u,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},p=[];for(const d in a)a[d]&&(d==="qop"||d==="nc"||d==="algorithm"?p.push(`${d}=${a[d]}`):p.push(`${d}="${a[d]}"`));return`Digest ${p.join(", ")}`}function Ac(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var ip=kt(101),Sc=kt.n(ip);function hu(e){return Sc().decode(e)}function pu(e,t){var n;return`Basic ${n=`${e}:${t}`,Sc().encode(n)}`}const du=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,up=du.fetch.bind(du);let ye=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),Ve=(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({});function Nc(e,t,n,r,o){switch(e.authType){case ye.Auto:t&&n&&(e.headers.Authorization=pu(t,n));break;case ye.Digest:e.digest=(function(u,i,f){return{username:u,password:i,ha1:f,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,o);break;case ye.None:break;case ye.Password:e.headers.Authorization=pu(t,n);break;case ye.Token:e.headers.Authorization=`${(s=r).token_type} ${s.access_token}`;break;default:throw new pe({info:{code:Ve.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var s}kt(345),kt(800);const gu="@@HOTPATCHER",cp=()=>{};function _o(e){return{original:e,methods:[e],final:!1}}class lp{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=gu}get configuration(){return this._configuration}get getEmptyAction(){re
`);const t=new Fe("!xml");let n=t,r="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const o=this.options,s=new Xp(o.processEntities),u=e.length;for(let i=0;i<u;i++)if(e[i]==="<"){const f=e.charCodeAt(i+1);if(f===47){const h=ln(e,">",i,"Closing Tag is not closed.");let a=e.substring(i+2,h).trim();if(o.removeNSPrefix){const d=a.indexOf(":");d!==-1&&(a=a.substr(d+1))}a=Ro(o.transformTagName,a,"",o).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));const p=this.matcher.getCurrentTag();if(a&&o.unpairedTagsSet.has(a))throw new Error(`Unpairedtagcannotbeusedasclosingtag:</${a}>`);p&&o.unpairedTagsSet.has(p)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r="",i=h}else if(f===63){let h=Wo(e,i,!1,"?>");if(!h)throw new Error("Pi Tag is not closed.");r=this.saveTextToParentTag(r,n,this.readonlyMatcher);const a=this.buildAttributesMap(h.tagExp,this.matcher,h.tagName,!0);if(a){const p=a[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(p)||1)}if(!(o.ignoreDeclaration&&h.tagName==="?xml"||o.ignorePiTags)){const p=new Fe(h.tagName);p.add(o.textNodeName,""),h.tagName!==h.tagExp&&h.attrExpPresent&&o.ignoreAttributes!==!0&&(p[":@"]=a),this.addChild(n,p,this.readonlyMatcher,i)}i=h.closeIndex+1}else if(f===33&&e.charCodeAt(i+2)===45&&e.charCodeAt(i+3)===45){const h=ln(e,"-->",i+4,"Comment is not closed.");if(o.commentPropName){const a=e.substring(i+4,h-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(o.commentPropName,[{[o.textNodeName]:a}])}i=h}else if(f===33&&e.charCodeAt(i+2)===68){const h=s.readDocType(e,i);this.entityDecoder.addInputEntities(h.entities),i=h.i}else if(f===33&&e.charCodeAt(i+2)===91){const h=ln(e,"]]>",i,"CDATA is not closed.")-2,a=e.substring(i+9,h);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let p=this.parseTextData(a,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);p==null&&(p=""),o.cdataPropName?n.add(o.cdataPropName,[{[o.textNodeName]:a}]):n.add(o.textNodeName,p),i=h+2}else{let h=Wo(e,i,o.removeNSPrefix);if(!h){const N=e.substring(Math.max(0,i-50),Math.min(u,i+50));throw new Error(`readTagExp returned undefined at position ${i}. Context: "${N}"`)}let a=h.tagName;const p=h.rawTagName;let d=h.tagExp,I=h.attrExpPresent,S=h.closeIndex;if({tagName:a,tagExp:d}=Ro(o.transformTagName,a,d,o),o.strictReservedNames&&(a===o.commentPropName||a===o.cdataPropName||a===o.textNodeName||a===o.attributesGroupName))throw new Error(`Invalid tag name: ${a}`);n&&r&&n.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));const w=n;w&&o.unpairedTagsSet.has(w.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let R=!1;d.length>0&&d.lastIndexOf("/")===d.length-1&&(R=!0,a[a.length-1]==="/"?(a=a.substr(0,a.length-1),d=a):d=d.substr(0,d.length-1),I=a!==d);let v,E=null;v=ad(p),a!==t.tagname&&this.matcher.push(a,{},v),a!==d&&I&&(E=this.buildAttributesMap(d,this.matcher,a),E&&sd(E,o)),a!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());const x=i;if(this.isCurrentNodeStopNode){let N="";if(R)i=h.closeIndex;else if(o.unpairedTagsSet.has(a))i=h.closeIndex;else{const M=this.readStopNodeData(e,p,S+1);if(!M)throw new Error(`Unexpected end of ${p}`);i=M.i,N=M.tagContent}const P=new Fe(a);E&&(P[":@"]=E),P.add(o.textNodeName,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,P,this.readonlyMatcher,x)}else{if(R){({tagName:a,tagExp:d}=Ro(o.transformTagName,a,d,o));const N=new Fe(a);E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(o.unpairedTagsSet.has(a)){const N=new Fe(a);E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1,i=h.closeIndex;continue}{const N=new Fe(a);if(this.tagsNodeStack.length>o.maxNestedTags)throw new Error("Maximumnestedtagsexceeded");this.tagsNodeStack.push(n),E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),n=N}}r="",i=S}}}else r+=e[i];return t.c
`||e==="\r"}function Ru(e,t){const n=t;for(;t<e.length;t++)if(!(e[t]!="?"&&e[t]!="")){const r=e.substr(n,t-n);if(t>5&&r==="xml")return Ht("InvalidXml","XMLdeclarationallowedonlyatthestartofthedocument.",fe(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}}return t}function xu(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let n=1;for(t+=8;t<e.length;t++)if(e[t]==="<")n++;else if(e[t]===">"&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}function Nd(e,t){let n="",r="",o=!1;for(;t<e.length;t++){if(e[t]==='"'||e[t]==="'")r===""?r=e[t]:r!==e[t]||(r="");else if(e[t]===">"&&r===""){o=!0;break}n+=e[t]}return r===""&&{value:n,index:t,tagClosed:o}}const Id=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Pu(e,t){const n=Mc(e,Id),r={};for(let o=0;o<n.length;o++){if(n[o][1].length===0)return Ht("InvalidAttr","Attribute '"+n[o][2]+"' has no space in starting.",Nn(n[o]));if(n[o][3]!==void 0&&n[o][4]===void 0)return Ht("InvalidAttr","Attribute '"+n[o][2]+"' is without value.",Nn(n[o]));if(n[o][3]===void 0&&!t.allowBooleanAttributes)return Ht("InvalidAttr","boolean attribute '"+n[o][2]+"' is not allowed.",Nn(n[o]));const s=n[o][2];if(!xd(s))return Ht("InvalidAttr","Attribute '"+s+"' is an invalid name.",Nn(n[o]));if(Object.prototype.hasOwnProperty.call(r,s))return Ht("InvalidAttr","Attribute '"+s+"' is repeated.",Nn(n[o]));r[s]=1}return!0}function Rd(e,t){if(e[++t]===";")return-1;if(e[t]==="#")return(function(r,o){let s=/\d/;for(r[o]==="x"&&(o++,s=/[\da-fA-F]/);o<r.length;o++){if(r[o]===";")return o;if(!r[o].match(s))break}return-1})(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===";")break;return-1}return t}function Ht(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function xd(e){return ar(e)}function fe(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Nn(e){return e.startIndex+e[1].length}class zc{constructor(t){this.externalEntities={},this.options=Hp(t)}parse(t,n){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const s=(function(u,i){i=Object.assign({},Sd,i);const f=[];let h=!1,a=!1;u[0]==="\uFEFF"&&(u=u.substr(1));for(let p=0;p<u.length;p++)if(u[p]==="<"&&u[p+1]==="?"){if(p+=2,p=Ru(u,p),p.err)return p}else{if(u[p]!=="<"){if(Iu(u[p]))continue;return Ht("InvalidChar","char '"+u[p]+"' is not expected.",fe(u,p))}{let d=p;if(p++,u[p]==="!"){p=xu(u,p);continue}{let I=!1;u[p]==="/"&&(I=!0,p++);let S="";for(;p<u.length&&u[p]!==">"&&u[p]!==" "&&u[p]!==" "&&u[p]!==`
`&&u[p]!=="\r";p++)S+=u[p];if(S=S.trim(),S[S.length-1]==="/"&&(S=S.substring(0,S.length-1),p--),!ar(S)){let v;return v=S.trim().length===0?"Invalid space after '<'.":"Tag '"+S+"' is an invalid name.",Ht("InvalidTag",v,fe(u,p))}const w=Nd(u,p);if(w===!1)return Ht("InvalidAttr","Attributes for '"+S+"' have open quote.",fe(u,p));let R=w.value;if(p=w.index,R[R.length-1]==="/"){const v=p-R.length;R=R.substring(0,R.length-1);const E=Pu(R,i);if(E!==!0)return Ht(E.err.code,E.err.msg,fe(u,v+E.err.line));h=!0}else if(I){if(!w.tagClosed)return Ht("InvalidTag","Closing tag '"+S+"' doesn't have proper closing.",fe(u,p));if(R.trim().length>0)return Ht("InvalidTag","Closing tag '"+S+"' can't have attributes or invalid starting.",fe(u,d));if(f.length===0)return Ht("InvalidTag","Closing tag '"+S+"' has not been opened.",fe(u,d));{const v=f.pop();if(S!==v.tagName){let E=fe(u,v.tagStartPos);return Ht("InvalidTag","Expected closing tag '"+v.tagName+"' (opened in line "+E.line+", col "+E.col+") instead of closing tag '"+S+"'.",fe(u,d))}f.length==0&&(a=!0)}}else{const v=Pu(R,i);if(v!==!0)return Ht(v.err.code,v.err.msg,fe(u,p-R.length+v.err.line));if(a===!0)return Ht("InvalidXml","Multiple possible root nodes found.",fe(u,p));i.unpairedTags.indexOf(S)!==-1||f.push({tagName:S,tagStartPos:d}),h=!0}for(p++;p<u.length;p++)if(u[p]==="<"){if(u[p+1]==="!"){p++,p=xu(u,p);continue}if(u[p+1]!=="?")break;if(p=Ru(u,++p),p.err)return p}else if(u[p]==="&"){const v=Rd(u,p);if(v==-1)return Ht("InvalidChar","char '&' is not expected.",fe(u,p));p=v}else if(a===!0&&!Iu(u[p]))return Ht("InvalidXml","Extra text at the end",fe(u,p));u[p]==="<"&&p--}}}return h?f.length==1?Ht("InvalidTag","Unclosed tag '"+f[0].tagName+"'.",fe(u,f[0].tagStartPos)):!(f.length>0)||Ht("InvalidXml","Invalid '"+JSON.stringify(f.map((p=>p.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ht("InvalidXml","Start tag expected.",1)})(t,n);if(s!==!0)throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}const r=new id(this.options,this.externalEntities),o=r.parseXml(t);return this.options.preserveOrder||o===void 0?o:vd(o,this.options,r.matcher,r.readonlyMatcher)}addEntity(t,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=n}static getMetaDataSymbol(){return Fe.getMetaDataSymbol()}}var Pd=kt(829),Me=kt.n(Pd),sn=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(sn||{});function Cu(e){return typeof e=="string"?e:e.toString(".",!1)}function Wc(e,t){if(!e.endsWith("propstat.prop.displayname"))return t}function Yn(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sn.Original;const r=Me().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function ir(e,t){return t=t??{attributeNamePrefix:"@",attributeParsers:[],tagParsers:[Wc]},new Promise((n=>{n((function(r){const{multistatus:o}=r;if(o==="")return{multistatus:{response:[]}};if(!o)throw new Error("Invalid response: No root multistatus found");const s={multistatus:Array.isArray(o)?o[0]:o};return Me().set(s,"multistatus.response",Yn(s,"multistatus.response",sn.Array)),Me().set(s,"multistatus.response",Me().get(s,"multistatus.response").map((u=>(function(i){const f=Object.assign({},i);return f.status?Me().set(f,"status",Yn(f,"status",sn.Object)):(Me().set(f,"propstat",Yn(f,"propstat",sn.Object)),Me().set(f,"propstat.prop",Yn(f,"propstat.prop",sn.Object))),f})(u)))),s})((function(r){let{attributeNamePrefix:o,attributeParsers:s,entityDecoder:u,tagParsers:i}=r;const f={allowBooleanAttributes:!0,attributeNamePrefix:o,textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,jPath:!1,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor(h,a,p){const d=Cu(p);for(const I of s)try{const S=I(d,a);if(S!==a)return S}catch{}return a},tagValueProcessor(h,a,p){const d=Cu(p);for(const I of i)try{const S=I
</d:propfind>`});if(Do.get(e.source)!==t)return;constr="data"inn?n.data:n,o=Ag(r,e.root).attributes["comments-count"],s=e.attributes["comments-count"],u=typeofs=="number"?s:typeofs=="string"?Number.parseInt(s,10):0;typeofo=="number"&&o!==u&&(e.update({"comments-count":o}),Yu("files:node:updated",e))}asyncfunctionRg(){conste=Date.now()+5e3;for(;Date.now()<e;){constt=window.OCA?.Comments?.View;if(t)returnt;awaitnewPromise(n=>window.setTimeout(n,50))}thrownewError("Nextcloud Comments view is unavailable")}functionxg(){returnclassextendsHTMLElement{commentsView;container;currentNode;mutationObserver;refreshTimers=newMap;renderGeneration=0;active=!1;folder;view;getnode(){returnthis.currentNode}setnode(e){this.currentNode=e,this.renderComments()}connectedCallback(){this.style.display="block",this.style.height="100%",this.style.overflow="auto",this.container=document.createElement("div"),this.container.className="korean-comments-action__content",this.append(this.container),typeofMutationObserver<"u"&&(this.mutationObserver=newMutationObserver(()=>this.scheduleCountRefresh()),this.mutationObserver.observe(this.container,{childList:!0,subtree:!0})),this.renderComments()}disconnectedCallback(){this.renderGeneration+=1,this.mutationObserver?.disconnect(),this.mutationObserver=void0;for(consteofthis.refreshTimers.values())window.clearTimeout(e);this.refreshTimers.clear(),this.commentsView?.$unmount(),this.commentsView=void0,this.container=void0,this.replaceChildren()}asyncrenderComments(){conste=this.currentNode,t=e?.fileid;if(!this.isConnected||!this.container||!e||t===void0)return;if(this.commentsView){awaitthis.commentsView.update(t),this.scheduleCountRefresh();return}constn=++this.renderGeneration;try{constr=awaitRg();if(n!==this.renderGeneration||!this.isConnected||!this.container)return;this.commentsView=newr("files",{el:this.container,props:{resourceId:t}}),this.scheduleCountRefresh()}catch(r){n===this.renderGeneration&&this.renderRetry(r)}}renderRetry(e){if(!this.container)return;console.error("Could not initialize the native Comments view",e);constt=document.createElement("p");t.textContent="댓글 화면을 불러오지 못했습니다.";constn=document.createElement("button");n.type="button",n.textContent="다시 시도",n.addEventListener("click",()=>{this.renderComments()}),this.container.replaceChildren(t,n)}scheduleCountRefresh(){conste=this.currentNode;if(!e)return;constt=e.source,n=this.refreshTimers.get(t);n!==void0&&window.clearTimeout(n);constr=window.setTimeout(()=>{this.refreshTimers.delete(t),Ig(e).catch(o=>{console.error("Could not refresh the comment count",o)})},200);this.refreshTimers.set(t,r)}}}mg("oc:comments-count"),Ec({id:Jo,displayName:"댓글",iconSvgInline:bs,order:45,tagName:jo,enabled({node:e}){returnrl()&&e.root.startsWith("/files/")&&e.permissions!==Ee.NONE&&e.fileid!==void0},onInit(){returnwindow.customElements.get(jo)||window.customElements.define(jo,xg()),Promise.resolve()}});letol=!1;constxn={id:"korean-comments-action",displayName:()=>"",title:e=>{constt=Uu(e);returnt>0?`댓글 ${t}개`:"댓글 작성"},iconSvgInline:e=>Uu(e)>0?bs:Sg,enabled(e){returnqo(e)&&(!ol||Ng(e)===0)},asyncexec(e){const[t]=e.nodes;if(!t||!qo(e))return!1;try{constn=_c();returnn.isOpen&&n.node?.source===t.source?n.setActiveTab(Jo):n.open(t,Jo),null}catch(n){returnconsole.error("Could not open the comments-only sidebar",n),!1}},inline:()=>!0,order:-45};functionsl(e){if(e.id!=="comments-unread"||typeofe.enabled!="function")return!1;constt=e.enabled;returne.displayName=xn.displayName,e.title=xn.title,e.iconSvgInline=()=>bs,e.exec=xn.exec,e.inline=xn.inline,e.enabled=n=>qo(n)&&t(n)===!0,ol=!0,!0}for(consteofXh())sl(e);Wh().addEventListener("register:action",e=>{sl(e.detail)}),Hh(xn);