(()=>{"use strict";var e,t,r,n={99563:(e,t,r)=>{var n=r(35810),i=r(53334);const s='';var o,a=r(85471),d=r(61338),l=r(85168),c=r(18740),u=r(4604),p=r(31126),m=r(94219),h=r(80910);!function(e){e.LaterToday="later-today",e.Tomorrow="tomorrow",e.ThisWeekend="this-weekend",e.NextWeek="next-week"}(o||(o={}));const f=()=>{const e=new Date;return e.setHours(0,0,0,0),e.setDate(e.getDate()-e.getDay()+1),new Date(e)},E=e=>{new Date(e).setHours(0,0,0,0);const t=new Date(e.getFullYear(),0,1,0,0,0,0),r=(e.getTime()-t.getTime())/864e5;return Math.ceil((r+t.getDay()+1)/7)},g=e=>({[o.LaterToday]:()=>{const e=new Date,t=new Date;t.setHours(18,0,0,0);const r=new Date;return r.setHours(17,0,0,0),e>=r?null:t},[o.Tomorrow]:()=>{const e=new Date,t=new Date;return t.setDate(e.getDate()+1),t.setHours(8,0,0,0),t},[o.ThisWeekend]:()=>{const e=new Date;if([5,6,0].includes(e.getDay()))return null;const t=new Date,r=f();return t.setDate(r.getDate()+5),t.setHours(8,0,0,0),t},[o.NextWeek]:()=>{if(0===(new Date).getDay())return null;const e=new Date,t=f();return e.setDate(t.getDate()+7),e.setHours(8,0,0,0),e}}[e]()),N=e=>{let t={hour:"numeric",minute:"2-digit"};const r=new Date;var n,s;return s=r,((n=e).getDate()!==s.getDate()||n.getMonth()!==s.getMonth()||n.getFullYear()!==s.getFullYear())&&(t={...t,weekday:"short"}),((e,t)=>E(e)===E(t)&&e.getFullYear()===t.getFullYear())(e,r)||(t={...t,month:"short",day:"numeric"}),e.getFullYear()!==r.getFullYear()&&(t={...t,year:"numeric"}),e.toLocaleString((0,i.lO)(),t)},A=e=>{let t={month:"long",day:"numeric",weekday:"long",hour:"numeric",minute:"2-digit"};const r=new Date;return e.getFullYear()!==r.getFullYear()&&(t={...t,year:"numeric"}),e.toLocaleString((0,i.lO)(),t)},w=(0,r(35947).YK)().setApp("files_reminders").detectUser().build();var v=r(65043),b=r(63814);const I=async(e,t)=>{const r=(0,b.KT)("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await v.Ay.put(r,{dueDate:t.toISOString()})).data.ocs.data},y=async e=>{const t=(0,b.KT)("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await v.Ay.delete(t)).data.ocs.data},L=a.Ay.extend({name:"SetCustomReminderModal",components:{NcButton:c.A,NcDateTime:u.A,NcDateTimePickerNative:p.A,NcDialog:m.A,NcNoteCard:h.A},data:()=>({node:void 0,hasDueDate:!1,opened:!1,isValid:!0,customDueDate:null,nowDate:new Date}),computed:{fileId(){return this.node?.fileid},fileName(){return this.node?.basename},name(){return this.fileName?(0,i.Tl)("files_reminders",'Set reminder for "{fileName}"',{fileName:this.fileName}):""},label:()=>(0,i.Tl)("files_reminders","Set reminder at custom date & time"),clearAriaLabel:()=>(0,i.Tl)("files_reminders","Clear reminder")},methods:{t:i.Tl,getDateString:N,open(e){const t=e.attributes["reminder-due-date"]?new Date(e.attributes["reminder-due-date"]):null;this.node=e,this.hasDueDate=Boolean(t),this.isValid=!0,this.opened=!0,this.customDueDate=t??(()=>{const e=new Date,t=new Date;return t.setHours(e.getHours()+2,0,0,0),t})(),this.nowDate=new Date,setTimeout((()=>{const e=document.getElementById("set-custom-reminder");e.focus(),this.hasDueDate||e.showPicker()}),300)},async setCustom(){if(this.customDueDate instanceof Date&&!isNaN(this.customDueDate))try{await I(this.fileId,this.customDueDate),a.Ay.set(this.node.attributes,"reminder-due-date",this.customDueDate.toISOString()),(0,d.Ic)("files:node:updated",this.node),(0,l.Te)((0,i.Tl)("files_reminders",'Reminder set for "{fileName}"',{fileName:this.fileName})),this.onClose()}catch(e){w.error("Failed to set reminder",{error:e}),(0,l.Qg)((0,i.Tl)("files_reminders","Failed to set reminder"))}else(0,l.Qg)((0,i.Tl)("files_reminders","Please choose a valid date & time"))},async clear(){try{await y(this.fileId),a.Ay.set(this.node.attributes,"reminder-due-date",""),(0,d.Ic)("files:node:updated",this.node),(0,l.Te)((0,i.Tl)("files_reminders",'Reminder cleared for "{fileName}"',{fileName:this.fileName})),this.onClose()}catch(e){w.error("Failed to clear reminder",{error:e}),(0,l.Qg)((0,i.Tl)("files_reminders","Failed to clear reminder"))}},onClose(){this.opened=!1,this.$emit("close")},onInput(){const e=document.getElementById("set-custom-reminder");this.isValid=e.checkValidity()}}});var R=r(85072),_=r.n(R),T=r(97825),D=r.n(T),O=r(77659),$=r.n(O),x=r(55056),S=r.n(x),C=r(10540),P=r.n(C),F=r(41113),M=r.n(F),G=r(21807),k={};k.styleTagTransform=M(),k.setAttributes=S(),k.insert=$().bind(null,"head"),k.domAPI=D(),k.insertStyleElement=P(),_()(G.A,k),G.A&&G.A.locals&&G.A.locals;const B=(0,r(14486).A)(L,(function(){var e=this,t=e._self._c;return e._self._setupProxy,e.opened?t("NcDialog",{attrs:{name:e.name,"out-transition":!0,size:"small","close-on-click-outside":""},on:{closing:e.onClose},scopedSlots:e._u([{key:"actions",fn:function(){return[t("NcButton",{attrs:{type:"tertiary"},on:{click:e.onClose}},[e._v("\n\t\t\t"+e._s(e.t("files_reminders","Cancel"))+"\n\t\t")]),e._v(" "),e.hasDueDate?t("NcButton",{on:{click:e.clear}},[e._v("\n\t\t\t"+e._s(e.t("files_reminders","Clear reminder"))+"\n\t\t")]):e._e(),e._v(" "),t("NcButton",{attrs:{disabled:!e.isValid,type:"primary",form:"set-custom-reminder-form","native-type":"submit"}},[e._v("\n\t\t\t"+e._s(e.t("files_reminders","Set reminder"))+"\n\t\t")])]},proxy:!0}],null,!1,2766788902)},[t("form",{staticClass:"custom-reminder-modal",attrs:{id:"set-custom-reminder-form"},on:{submit:function(t){return t.preventDefault(),e.setCustom.apply(null,arguments)}}},[t("NcDateTimePickerNative",{attrs:{id:"set-custom-reminder",label:e.label,min:e.nowDate,required:!0,type:"datetime-local"},on:{input:e.onInput},model:{value:e.customDueDate,callback:function(t){e.customDueDate=t},expression:"customDueDate"}}),e._v(" "),e.isValid?t("NcNoteCard",{attrs:{type:"info"}},[e._v("\n\t\t\t"+e._s(e.t("files_reminders","We will remind you of this file"))+"\n\t\t\t"),t("NcDateTime",{attrs:{timestamp:e.customDueDate}})],1):t("NcNoteCard",{attrs:{type:"error"}},[e._v("\n\t\t\t"+e._s(e.t("files_reminders","Please choose a valid date & time"))+"\n\t\t")])],1)]):e._e()}),[],!1,null,"82674da4",null).exports,j=a.Ay.extend(B),U=document.createElement("div");U.id="set-custom-reminder-modal",document.body.appendChild(U);const V=new j({name:"SetCustomReminderModal",el:U}),H=e=>(V.open(e),new Promise((e=>{V.$once("close",e)}))),X=new n.hY({id:"reminder-status",inline:()=>!0,displayName:()=>"",title:e=>{const t=e.at(0),r=new Date(t.attributes["reminder-due-date"]);return`${(0,i.Tl)("files_reminders","Reminder set")} – ${A(r)}`},iconSvgInline:()=>s,enabled:e=>{if(1!==e.length)return!1;const t=e.at(0).attributes["reminder-due-date"];return Boolean(t)},exec:async e=>(H(e),null),order:-15}),Y=new n.hY({id:"clear-reminder",displayName:()=>(0,i.Tl)("files_reminders","Clear reminder"),title:e=>{const t=e.at(0),r=new Date(t.attributes["reminder-due-date"]);return`${(0,i.Tl)("files_reminders","Clear reminder")} – ${A(r)}`},iconSvgInline:()=>'',enabled:e=>{if(1!==e.length)return!1;const t=e.at(0).attributes["reminder-due-date"];return Boolean(t)},async exec(e){if(e.fileid)try{return await y(e.fileid),a.Ay.set(e.attributes,"reminder-due-date",""),(0,d.Ic)("files:node:updated",e),!0}catch(e){return!1}return null},order:19}),z="set-reminder-menu",W=new n.hY({id:z,displayName:()=>(0,i.Tl)("files_reminders","Set reminder"),iconSvgInline:()=>s,enabled:(e,t)=>"trashbin"!==t.id,exec:async()=>null,order:20});var q=r(19672),K={};K.styleTagTransform=M(),K.setAttributes=S(),K.insert=$().bind(null,"head"),K.domAPI=D(),K.insertStyleElement=P(),_()(q.A,K),q.A&&q.A.locals&&q.A.locals;const Z={dateTimePreset:o.LaterToday,label:(0,i.Tl)("files_reminders","Later today"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for later today"),dateString:"",verboseDateString:""},Q={dateTimePreset:o.Tomorrow,label:(0,i.Tl)("files_reminders","Tomorrow"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for tomorrow"),dateString:"",verboseDateString:""},J={dateTimePreset:o.ThisWeekend,label:(0,i.Tl)("files_reminders","This weekend"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for this weekend"),dateString:"",verboseDateString:""},ee={dateTimePreset:o.NextWeek,label:(0,i.Tl)("files_reminders","Next week"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for next week"),dateString:"",verboseDateString:""};[Z,Q,J,ee].forEach((e=>{const t=g(e.dateTimePreset);t&&(e.dateString=N(t),e.verboseDateString=A(t),setInterval((()=>{const t=g(e.dateTimePreset);t&&(e.dateString=N(t),e.verboseDateString=A(t))}),18e5))}));const te=[Z,Q,J,ee].map((e=>new n.hY({id:`set-reminder-${e.dateTimePreset}`,displayName:()=>`${e.label} – ${e.dateString}`,title:()=>`${e.ariaLabel} – ${e.verboseDateString}`,iconSvgInline:()=>"",enabled:(t,r)=>"trashbin"!==r.id&&Boolean(g(e.dateTimePreset)),parent:z,async exec(t){if(!t.fileid)return w.error("Failed to set reminder, missing file id"),(0,l.Qg)((0,i.Tl)("files_reminders","Failed to set reminder")),null;try{const r=g(e.dateTimePreset);await I(t.fileid,r),a.Ay.set(t.attributes,"reminder-due-date",r.toISOString()),(0,d.Ic)("files:node:updated",t),(0,l.Te)((0,i.Tl)("files_reminders",'Reminder set for "{fileName}"',{fileName:t.basename}))}catch(e){w.error("Failed to set reminder",{error:e}),(0,l.Qg)((0,i.Tl)("files_reminders","Failed to set reminder"))}return null},order:21}))),re=new n.hY({id:"set-reminder-custom",displayName:()=>(0,i.Tl)("files_reminders","Set custom reminder"),title:()=>(0,i.Tl)("files_reminders","Set reminder at custom date & time"),iconSvgInline:()=>'',enabled:(e,t)=>"trashbin"!==t.id,parent:z,exec:async e=>(H(e),null),order:22});(0,n.Yc)("nc:reminder-due-date",{nc:"http://nextcloud.org/ns"}),(0,n.Gg)(X),(0,n.Gg)(Y),(0,n.Gg)(W),(0,n.Gg)(re),te.forEach((e=>(0,n.Gg)(e)))},19672:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(71354),i=r.n(n),s=r(76314),o=r.n(s)()(i());o.push([e.id,'.files-list__row-action-set-reminder-custom{margin-top:13px;position:relative}.files-list__row-action-set-reminder-custom::before{content:"";margin-block:3px;margin-inline:15px 10px;border-bottom:1px solid var(--color-border-dark);cursor:default;display:flex;height:0;position:absolute;inset-inline:0;top:-10px}',"",{version:3,sources:["webpack://./apps/files_reminders/src/actions/setReminderSuggestionActions.scss"],names:[],mappings:"AAMA,4CACC,eAAA,CACA,iBAAA,CAEA,oDACC,UAAA,CACA,gBAAA,CACA,uBAAA,CACA,gDAAA,CACA,cAAA,CACA,YAAA,CACA,QAAA,CACA,iBAAA,CACA,cAAA,CACA,SAAA",sourceRoot:""}]);const a=o},21807:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(71354),i=r.n(n),s=r(76314),o=r.n(s)()(i());o.push([e.id,".custom-reminder-modal[data-v-82674da4]{margin:0 12px}","",{version:3,sources:["webpack://./apps/files_reminders/src/components/SetCustomReminderModal.vue"],names:[],mappings:"AACA,wCACC,aAAA",sourceRoot:""}]);const a=o},35810:(e,t,r)=>{r.d(t,{Al:()=>M,Gg:()=>g,H4:()=>P,Q$:()=>F,R3:()=>L,VL:()=>y,Yc:()=>v,hY:()=>E,lJ:()=>S,pt:()=>R,ur:()=>U,v7:()=>B});var n=r(35947),i=r(21777),s=r(43627),o=r(71225),a=r(63814),d=r(36117),l=r(44719),c=r(82680),u=r(53334),p=r(380),m=r(65606);const h=(0,n.YK)().setApp("@nextcloud/files").detectUser().build();var f=(e=>(e.DEFAULT="default",e.HIDDEN="hidden",e))(f||{});class E{_action;constructor(e){this.validateAction(e),this._action=e}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(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if("title"in e&&"function"!=typeof e.title)throw new Error("Invalid title function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(f).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function")}}const g=function(e){void 0===window._nc_fileactions&&(window._nc_fileactions=[],h.debug("FileActions initialized")),window._nc_fileactions.find((t=>t.id===e.id))?h.error(`FileAction ${e.id} already registered`,{action:e}):window._nc_fileactions.push(e)};var N=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(N||{});const A=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],w={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},v=function(e,t={nc:"http://nextcloud.org/ns"}){void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...A],window._nc_dav_namespaces={...w});const r={...window._nc_dav_namespaces,...t};return window._nc_dav_properties.find((t=>t===e))?(h.warn(`${e} already registered`,{prop:e}),!1):e.startsWith("<")||2!==e.split(":").length?(h.error(`${e} is not valid. See example: 'oc:fileid'`,{prop:e}),!1):r[e.split(":")[0]]?(window._nc_dav_properties.push(e),window._nc_dav_namespaces=r,!0):(h.error(`${e} namespace unknown`,{prop:e,namespaces:r}),!1)},b=function(){return void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...A]),window._nc_dav_properties.map((e=>`<${e} />`)).join(" ")},I=function(){return void 0===window._nc_dav_namespaces&&(window._nc_dav_namespaces={...w}),Object.keys(window._nc_dav_namespaces).map((e=>`xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`)).join(" ")},y=function(){return`\n\t\t\n\t\t\t\n\t\t\t\t${b()}\n\t\t\t\n\t\t`},L=function(e){return`\n\n\t\n\t\t\n\t\t\t\n\t\t\t\t${b()}\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t/files/${(0,i.HW)()?.uid}/\n\t\t\t\tinfinity\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thttpd/unix-directory\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${e}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t100\n\t\t\t0\n\t\t\n\t\n`};var R=(e=>(e.Folder="folder",e.File="file",e))(R||{});const _=function(e,t){return null!==e.match(t)},T=(e,t)=>{if(e.id&&"number"!=typeof e.id)throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch(e){throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(e.displayname&&"string"!=typeof e.displayname)throw new Error("Invalid displayname type");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||"string"!=typeof e.mime||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&"number"!=typeof e.size&&void 0!==e.size)throw new Error("Invalid size type");if("permissions"in e&&void 0!==e.permissions&&!("number"==typeof e.permissions&&e.permissions>=N.NONE&&e.permissions<=N.ALL))throw new Error("Invalid permissions");if(e.owner&&null!==e.owner&&"string"!=typeof e.owner)throw new Error("Invalid owner type");if(e.attributes&&"object"!=typeof e.attributes)throw new Error("Invalid attributes type");if(e.root&&"string"!=typeof e.root)throw new Error("Invalid root type");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&_(e.source,t)){const r=e.source.match(t)[0];if(!e.source.includes((0,s.join)(r,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.status&&!Object.values(D).includes(e.status))throw new Error("Status must be a valid NodeStatus")};var D=(e=>(e.NEW="new",e.FAILED="failed",e.LOADING="loading",e.LOCKED="locked",e))(D||{});class O{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(O.prototype)).filter((e=>"function"==typeof e[1].get&&"__proto__"!==e[0])).map((e=>e[0]));handler={set:(e,t,r)=>!this.readonlyAttributes.includes(t)&&Reflect.set(e,t,r),deleteProperty:(e,t)=>!this.readonlyAttributes.includes(t)&&Reflect.deleteProperty(e,t),get:(e,t,r)=>this.readonlyAttributes.includes(t)?(h.warn(`Accessing "Node.attributes.${t}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,t)):Reflect.get(e,t,r)};constructor(e,t){T(e,t||this._knownDavService),this._data={displayname:e.attributes?.displayname,...e,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(e.attributes??{}),t&&(this._knownDavService=t)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:e}=new URL(this.source);return e+(0,o.O0)(this.source.slice(e.length))}get basename(){return(0,s.basename)(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(e){this._data.displayname=e}get extension(){return(0,s.extname)(this.source)}get dirname(){if(this.root){let e=this.source;this.isDavRessource&&(e=e.split(this._knownDavService).pop());const t=e.indexOf(this.root),r=this.root.replace(/\/$/,"");return(0,s.dirname)(e.slice(t+r.length)||"/")}const e=new URL(this.source);return(0,s.dirname)(e.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}set mtime(e){this._data.mtime=e}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(e){this.updateMtime(),this._data.size=e}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:N.NONE:N.READ}set permissions(e){this.updateMtime(),this._data.permissions=e}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return _(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 e=this.source;this.isDavRessource&&(e=e.split(this._knownDavService).pop());const t=e.indexOf(this.root),r=this.root.replace(/\/$/,"");return e.slice(t+r.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(e){this._data.status=e}move(e){T({...this._data,source:e},this._knownDavService);const t=this.basename;this._data.source=e,this.displayname===t&&this.basename!==t&&(this.displayname=this.basename),this.updateMtime()}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move((0,s.dirname)(this.source)+"/"+e)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(e){for(const[t,r]of Object.entries(e))try{void 0===r?delete this.attributes[t]:this.attributes[t]=r}catch(e){if(e instanceof TypeError)continue;throw e}}}class $ extends O{get type(){return R.File}}class x extends O{constructor(e){super({...e,mime:"httpd/unix-directory"})}get type(){return R.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const S=(0,c.f)()?`/files/${(0,c.G)()}`:`/files/${(0,i.HW)()?.uid}`,C=function(){const e=(0,a.dC)("dav");return(0,c.f)()?e.replace("remote.php","public.php"):e}(),P=function(e=C,t={}){const r=(0,l.UU)(e,{headers:t});function n(e){r.setHeaders({...t,"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})}return(0,i.zo)(n),n((0,i.do)()),(0,l.Gu)().patch("fetch",((e,t)=>{const r=t.headers;return r?.method&&(t.method=r.method,delete r.method),fetch(e,t)})),r},F=(e,t="/",r=S)=>{const n=new AbortController;return new d.CancelablePromise((async(i,s,o)=>{o((()=>n.abort()));try{i((await e.getDirectoryContents(`${r}${t}`,{signal:n.signal,details:!0,data:`\n\t\t\n\t\t\t\n\t\t\t\t${b()}\n\t\t\t\n\t\t\t\n\t\t\t\t1\n\t\t\t\n\t\t`,headers:{method:"REPORT"},includeSelf:!0})).data.filter((e=>e.filename!==t)).map((e=>M(e,r))))}catch(e){s(e)}}))},M=function(e,t=S,r=C){let n=(0,i.HW)()?.uid;if((0,c.f)())n=n??"anonymous";else if(!n)throw new Error("No user id found");const s=e.props,o=function(e=""){let t=N.NONE;return e?((e.includes("C")||e.includes("K"))&&(t|=N.CREATE),e.includes("G")&&(t|=N.READ),(e.includes("W")||e.includes("N")||e.includes("V"))&&(t|=N.UPDATE),e.includes("D")&&(t|=N.DELETE),e.includes("R")&&(t|=N.SHARE),t):t}(s?.permissions),a=String(s?.["owner-id"]||n),d=s.fileid||0,l={id:d,source:`${r}${e.filename}`,mtime:new Date(Date.parse(e.lastmod)),mime:e.mime||"application/octet-stream",displayname:void 0!==s.displayname?String(s.displayname):void 0,size:s?.size||Number.parseInt(s.getcontentlength||"0"),status:d<0?D.FAILED:void 0,permissions:o,owner:a,root:t,attributes:{...e,...s,hasPreview:s?.["has-preview"]}};return delete l.attributes?.props,"file"===e.type?new $(l):new x(l)};Error;const G=["B","KB","MB","GB","TB","PB"],k=["B","KiB","MiB","GiB","TiB","PiB"];function B(e,t=!1,r=!1,n=!1){r=r&&!n,"string"==typeof e&&(e=Number(e));let i=e>0?Math.floor(Math.log(e)/Math.log(n?1e3:1024)):0;i=Math.min((r?k.length:G.length)-1,i);const s=r?k[i]:G[i];let o=(e/Math.pow(n?1e3:1024,i)).toFixed(1);return!0===t&&0===i?("0.0"!==o?"< 1 ":"0 ")+(r?k[1]:G[1]):(o=i<2?parseFloat(o).toFixed(0):parseFloat(o).toLocaleString((0,u.lO)()),o+" "+s)}function j(e){return e instanceof Date?e.toISOString():String(e)}function U(e,t={}){const r={sortingMode:"basename",sortingOrder:"asc",...t};return function(e,t,r){r=r??[];const n=(t=t??[e=>e]).map(((e,t)=>"asc"===(r[t]??"asc")?1:-1)),i=Intl.Collator([(0,u.Z0)(),(0,u.lO)()],{numeric:!0,usage:"sort"});return[...e].sort(((e,r)=>{for(const[s,o]of t.entries()){const t=i.compare(j(o(e)),j(o(r)));if(0!==t)return t*n[s]}return 0}))}(e,[...r.sortFavoritesFirst?[e=>1!==e.attributes?.favorite]:[],...r.sortFoldersFirst?[e=>"folder"!==e.type]:[],..."basename"!==r.sortingMode?[e=>e[r.sortingMode]]:[],e=>{return(t=e.attributes?.displayname||e.basename).lastIndexOf(".")>0?t.slice(0,t.lastIndexOf(".")):t;var t},e=>e.basename],[...r.sortFavoritesFirst?["asc"]:[],...r.sortFoldersFirst?["asc"]:[],..."mtime"===r.sortingMode?["asc"===r.sortingOrder?"desc":"asc"]:[],..."mtime"!==r.sortingMode&&"basename"!==r.sortingMode?[r.sortingOrder]:[],r.sortingOrder,r.sortingOrder])}var V={};!function(e){const t=":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",r="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",n=new RegExp("^"+r+"$");e.isExist=function(e){return void 0!==e},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,r){if(t){const n=Object.keys(t),i=n.length;for(let s=0;s!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e}};H.buildOptions=function(e){return Object.assign({},X,e)},H.defaultOptions=X,!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat),new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");var Y={};function z(e,t,r){let n;const i={};for(let s=0;s0&&(i[t.textNodeName]=n):void 0!==n&&(i[t.textNodeName]=n),i}function W(e){const t=Object.keys(e);for(let e=0;e`,s=!1;continue}if(d===t.commentPropName){i+=n+`\x3c!--${a[d][0][t.textNodeName]}--\x3e`,s=!0;continue}if("?"===d[0]){const e=te(a[":@"],t),r="?xml"===d?"":n;let o=a[d][0][t.textNodeName];o=0!==o.length?" "+o:"",i+=r+`<${d}${o}${e}?>`,s=!0;continue}let c=n;""!==c&&(c+=t.indentBy);const u=n+`<${d}${te(a[":@"],t)}`,p=J(a[d],t,l,c);-1!==t.unpairedTags.indexOf(d)?t.suppressUnpairedNode?i+=u+">":i+=u+"/>":p&&0!==p.length||!t.suppressEmptyNode?p&&p.endsWith(">")?i+=u+`>${p}${n}${d}>`:(i+=u+">",p&&""!==n&&(p.includes("/>")||p.includes(""))?i+=n+t.indentBy+p+n:i+=p,i+=`${d}>`):i+=u+"/>",s=!0}return i}function ee(e){const t=Object.keys(e);for(let r=0;r0&&t.processEntities)for(let r=0;r0&&(r="\n"),J(e,t,"",r)},se={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function oe(e){this.options=Object.assign({},se,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=le),this.processTextOrObjNode=ae,this.options.format?(this.indentate=de,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ae(e,t,r){const n=this.j2x(e,r+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}function de(e){return this.options.indentBy.repeat(e)}function le(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}oe.prototype.build=function(e){return this.options.preserveOrder?ie(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)},oe.prototype.j2x=function(e,t){let r="",n="";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(void 0===e[i])this.isAttribute(i)&&(n+="");else if(null===e[i])this.isAttribute(i)?n+="":"?"===i[0]?n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)n+=this.buildTextValNode(e[i],i,"",t);else if("object"!=typeof e[i]){const s=this.isAttribute(i);if(s)r+=this.buildAttrPairStr(s,""+e[i]);else if(i===this.options.textNodeName){let t=this.options.tagValueProcessor(i,""+e[i]);n+=this.replaceEntitiesValue(t)}else n+=this.buildTextValNode(e[i],i,"",t)}else if(Array.isArray(e[i])){const r=e[i].length;let s="",o="";for(let a=0;a"+e+i}},oe.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`>${e}`,t},oe.prototype.buildTextValNode=function(e,t,r,n){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(n)+``+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(n)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),""===i?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+i+""+t+this.tagEndChar}},oe.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;tconsole.error("SEMVER",...e):()=>{},ue={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},pe={exports:{}};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=ue,s=ce,o=(t=e.exports={}).re=[],a=t.safeRe=[],d=t.src=[],l=t.t={};let c=0;const u="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[u,n]],m=(e,t,r)=>{const n=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=c++;s(e,i,t),l[e]=i,d[i]=t,o[i]=new RegExp(t,r?"g":void 0),a[i]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),m("MAINVERSION",`(${d[l.NUMERICIDENTIFIER]})\\.(${d[l.NUMERICIDENTIFIER]})\\.(${d[l.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${d[l.NUMERICIDENTIFIERLOOSE]})\\.(${d[l.NUMERICIDENTIFIERLOOSE]})\\.(${d[l.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${d[l.NUMERICIDENTIFIER]}|${d[l.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${d[l.NUMERICIDENTIFIERLOOSE]}|${d[l.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${d[l.PRERELEASEIDENTIFIER]}(?:\\.${d[l.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${d[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[l.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${u}+`),m("BUILD",`(?:\\+(${d[l.BUILDIDENTIFIER]}(?:\\.${d[l.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${d[l.MAINVERSION]}${d[l.PRERELEASE]}?${d[l.BUILD]}?`),m("FULL",`^${d[l.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${d[l.MAINVERSIONLOOSE]}${d[l.PRERELEASELOOSE]}?${d[l.BUILD]}?`),m("LOOSE",`^${d[l.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${d[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${d[l.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${d[l.XRANGEIDENTIFIER]})(?:\\.(${d[l.XRANGEIDENTIFIER]})(?:\\.(${d[l.XRANGEIDENTIFIER]})(?:${d[l.PRERELEASE]})?${d[l.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${d[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[l.XRANGEIDENTIFIERLOOSE]})(?:${d[l.PRERELEASELOOSE]})?${d[l.BUILD]}?)?)?`),m("XRANGE",`^${d[l.GTLT]}\\s*${d[l.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${d[l.GTLT]}\\s*${d[l.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${d[l.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",d[l.COERCEPLAIN]+`(?:${d[l.PRERELEASE]})?(?:${d[l.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",d[l.COERCE],!0),m("COERCERTLFULL",d[l.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${d[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${d[l.LONETILDE]}${d[l.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${d[l.LONETILDE]}${d[l.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${d[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${d[l.LONECARET]}${d[l.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${d[l.LONECARET]}${d[l.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${d[l.GTLT]}\\s*(${d[l.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${d[l.GTLT]}\\s*(${d[l.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${d[l.GTLT]}\\s*(${d[l.LOOSEPLAIN]}|${d[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${d[l.XRANGEPLAIN]})\\s+-\\s+(${d[l.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${d[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[l.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(pe,pe.exports);var me=pe.exports;Object.freeze({loose:!0}),Object.freeze({});const he=/^[0-9]+$/,fe=(e,t)=>{const r=he.test(e),n=he.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:efe(t,e)};const{MAX_LENGTH:ge,MAX_SAFE_INTEGER:Ne}=ue,{safeRe:Ae,t:we}=me,{compareIdentifiers:ve}=Ee;p.m}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=n,e=[],s.O=(t,r,n,i)=>{if(!r){var o=1/0;for(c=0;c=i)&&Object.keys(s.O).every((e=>s.O[e](r[d])))?r.splice(d--,1):(a=!1,i0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[r,n,i]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,r)=>(s.f[r](e,t),t)),[])),s.u=e=>e+"-"+e+".js?v="+{802:"c10e4e0c57e30824ef47",9291:"077955af818a227340aa"}[e],s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="nextcloud:",s.l=(e,n,i,o)=>{if(t[e])t[e].push(n);else{var a,d;if(void 0!==i)for(var l=document.getElementsByTagName("script"),c=0;c{a.onerror=a.onload=null,clearTimeout(m);var i=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(n))),r)return r(n)},m=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),d&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.j=9735,(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{s.b=document.baseURI||self.location.href;var e={9735:0};s.f.j=(t,r)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,i)=>n=e[t]=[r,i]));r.push(n[2]=i);var o=s.p+s.u(t),a=new Error;s.l(o,(r=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,n[1](a)}}),"chunk-"+t,t)}},s.O.j=t=>0===e[t];var t=(t,r)=>{var n,i,o=r[0],a=r[1],d=r[2],l=0;if(o.some((t=>0!==e[t]))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);if(d)var c=d(s)}for(t&&t(r);ls(99563)));o=s.O(o)})();
//# sourceMappingURL=files_reminders-init.js.map?v=b955f4c3df05e13c779d