aboutsummaryrefslogtreecommitdiffstats
path: root/dist/files_reminders-init.js
blob: 5cbe87654b7489c6a890d363aa7fce21e596f2f6 (plain)
1
2
(()=>{"use strict";var e,t,r,n={17929:(e,t,r)=>{var n=r(35810),i=r(53334);const a='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-alarm" viewBox="0 0 24 24"><path d="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" /></svg>';var s,o=r(85471),c=r(61338),l=r(85168),u=r(97012),d=r(4604),m=r(88984),E=r(94219),p=r(40083);!function(e){e.LaterToday="later-today",e.Tomorrow="tomorrow",e.ThisWeekend="this-weekend",e.NextWeek="next-week"}(s||(s={}));const f=()=>{const e=new Date;return e.setHours(0,0,0,0),e.setDate(e.getDate()-e.getDay()+1),new Date(e)},T=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)},h=e=>({[s.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},[s.Tomorrow]:()=>{const e=new Date,t=new Date;return t.setDate(e.getDate()+1),t.setHours(8,0,0,0),t},[s.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},[s.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]()),g=e=>{let t={hour:"numeric",minute:"2-digit"};const r=new Date;var n,a;return a=r,((n=e).getDate()!==a.getDate()||n.getMonth()!==a.getMonth()||n.getFullYear()!==a.getFullYear())&&(t={...t,weekday:"short"}),((e,t)=>T(e)===T(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)},I=(0,r(35947).YK)().setApp("files_reminders").detectUser().build();var N=r(65043),_=r(63814);const D=async(e,t)=>{const r=(0,_.KT)("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await N.Ay.put(r,{dueDate:t.toISOString()})).data.ocs.data},b=async e=>{const t=(0,_.KT)("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await N.Ay.delete(t)).data.ocs.data},v=o.Ay.extend({name:"SetCustomReminderModal",components:{NcButton:u.A,NcDateTime:d.A,NcDateTimePickerNative:m.A,NcDialog:E.A,NcNoteCard:p.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:g,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 D(this.fileId,this.customDueDate),o.Ay.set(this.node.attributes,"reminder-due-date",this.customDueDate.toISOString()),(0,c.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){I.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 b(this.fileId),o.Ay.set(this.node.attributes,"reminder-due-date",""),(0,c.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){I.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 L=r(85072),O=r.n(L),C=r(97825),R=r.n(C),S=r(77659),w=r.n(S),y=r(55056),F=r.n(y),P=r(10540),x=r.n(P),M=r(41113),$=r.n(M),B=r(36720),U={};U.styleTagTransform=$(),U.setAttributes=F(),U.insert=w().bind(null,"head"),U.domAPI=R(),U.insertStyleElement=x(),O()(B.A,U),B.A&&B.A.locals&&B.A.locals;const G=(0,r(14486).A)(v,(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,"75680f34",null).exports,V=o.Ay.extend(G),k=document.createElement("div");k.id="set-custom-reminder-modal",document.body.appendChild(k);const X=new V({name:"SetCustomReminderModal",el:k}),Y=e=>(X.open(e),new Promise((e=>{X.$once("close",e)}))),j=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:()=>a,enabled:e=>{if(1!==e.length)return!1;const t=e.at(0).attributes["reminder-due-date"];return Boolean(t)},exec:async e=>(Y(e),null),order:-15}),H=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:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-alarm-off" viewBox="0 0 24 24"><path d="M8,3.28L6.6,1.86L5.74,2.57L7.16,4M16.47,18.39C15.26,19.39 13.7,20 12,20A7,7 0 0,1 5,13C5,11.3 5.61,9.74 6.61,8.53M2.92,2.29L1.65,3.57L3,4.9L1.87,5.83L3.29,7.25L4.4,6.31L5.2,7.11C3.83,8.69 3,10.75 3,13A9,9 0 0,0 12,22C14.25,22 16.31,21.17 17.89,19.8L20.09,22L21.36,20.73L3.89,3.27L2.92,2.29M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72M12,6A7,7 0 0,1 19,13C19,13.84 18.84,14.65 18.57,15.4L20.09,16.92C20.67,15.73 21,14.41 21,13A9,9 0 0,0 12,4C10.59,4 9.27,4.33 8.08,4.91L9.6,6.43C10.35,6.16 11.16,6 12,6Z" /></svg>',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 b(e.fileid),o.Ay.set(e.attributes,"reminder-due-date",""),(0,c.Ic)("files:node:updated",e),!0}catch(e){return!1}return null},order:19}),q="set-reminder-menu",W=new n.hY({id:q,displayName:()=>(0,i.Tl)("files_reminders","Set reminder"),iconSvgInline:()=>a,enabled:(e,t)=>"trashbin"!==t.id&&(1===e.length&&void 0!==e.at(0).attributes["reminder-due-date"]),exec:async()=>null,order:20});var Q=r(19672),z={};z.styleTagTransform=$(),z.setAttributes=F(),z.insert=w().bind(null,"head"),z.domAPI=R(),z.insertStyleElement=x(),O()(Q.A,z),Q.A&&Q.A.locals&&Q.A.locals;const K={dateTimePreset:s.LaterToday,label:(0,i.Tl)("files_reminders","Later today"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for later today"),dateString:"",verboseDateString:""},Z={dateTimePreset:s.Tomorrow,label:(0,i.Tl)("files_reminders","Tomorrow"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for tomorrow"),dateString:"",verboseDateString:""},J={dateTimePreset:s.ThisWeekend,label:(0,i.Tl)("files_reminders","This weekend"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for this weekend"),dateString:"",verboseDateString:""},ee={dateTimePreset:s.NextWeek,label:(0,i.Tl)("files_reminders","Next week"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for next week"),dateString:"",verboseDateString:""};[K,Z,J,ee].forEach((e=>{const t=h(e.dateTimePreset);t&&(e.dateString=g(t),e.verboseDateString=A(t),setInterval((()=>{const t=h(e.dateTimePreset);t&&(e.dateString=g(t),e.verboseDateString=A(t))}),18e5))}));const te=[K,Z,J,ee].map((e=>new n.hY({id:`set-reminder-${e.dateTimePreset}`,displayName:()=>`${e.label}${e.dateString}`,title:()=>`${e.ariaLabel}${e.verboseDateString}`,iconSvgInline:()=>"<svg></svg>",enabled:(t,r)=>"trashbin"!==r.id&&(1===t.length&&(void 0!==t.at(0).attributes["reminder-due-date"]&&Boolean(h(e.dateTimePreset)))),parent:q,async exec(t){if(!t.fileid)return I.error("Failed to set reminder, missing file id"),(0,l.Qg)((0,i.Tl)("files_reminders","Failed to set reminder")),null;try{const r=h(e.dateTimePreset);await D(t.fileid,r),o.Ay.set(t.attributes,"reminder-due-date",r.toISOString()),(0,c.Ic)("files:node:updated",t),(0,l.Te)((0,i.Tl)("files_reminders",'Reminder set for "{fileName}"',{fileName:t.basename}))}catch(e){I.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:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-calendar-clock" viewBox="0 0 24 24"><path d="M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z" /></svg>',enabled:(e,t)=>"trashbin"!==t.id&&(1===e.length&&void 0!==e.at(0).attributes["reminder-due-date"]),parent:q,exec:async e=>(Y(e),null),order:22});(0,n.Yc)("nc:reminder-due-date",{nc:"http://nextcloud.org/ns"}),(0,n.Gg)(j),(0,n.Gg)(H),(0,n.Gg)(W),(0,n.Gg)(re),te.forEach((e=>(0,n.Gg)(e)))},19672:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(71354),i=r.n(n),a=r(76314),s=r.n(a)()(i());s.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",sourcesContent:['/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n // TODO: remove when/if the actions API supports a separator\n // This the last preset action, so we need to add a separator\n.files-list__row-action-set-reminder-custom {\n\tmargin-top: 13px;\n\tposition: relative;\n\n\t&::before {\n\t\tcontent: "";\n\t\tmargin-block: 3px;\n\t\tmargin-inline: 15px 10px;\n\t\tborder-bottom: 1px solid var(--color-border-dark);\n\t\tcursor: default;\n\t\tdisplay: flex;\n\t\theight: 0;\n\t\tposition: absolute;\n\t\tinset-inline: 0;\n\t\ttop: -10px;\n\t}\n}\n'],sourceRoot:""}]);const o=s},35810:(e,t,r)=>{r.d(t,{Al:()=>n.r,Gg:()=>m,H4:()=>n.c,KT:()=>f,Q$:()=>n.e,R3:()=>n.n,VL:()=>n.l,Yc:()=>n.i,di:()=>p,hY:()=>d,lJ:()=>n.d,nF:()=>E,pt:()=>n.F,ur:()=>I,v7:()=>g});var n=r(36585),i=r(87485),a=(r(43627),r(53334)),s=r(380),o=r(83141),c=r(62045).hp,l=r(65606),u=(e=>(e.DEFAULT="default",e.HIDDEN="hidden",e))(u||{});class d{_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 destructive(){return this._action.destructive}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(void 0!==e.destructive&&"boolean"!=typeof e.destructive)throw new Error("Invalid destructive flag");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(u).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 m=function(e){void 0===window._nc_fileactions&&(window._nc_fileactions=[],n.o.debug("FileActions initialized")),window._nc_fileactions.find((t=>t.id===e.id))?n.o.error(`FileAction ${e.id} already registered`,{action:e}):window._nc_fileactions.push(e)};var E=(e=>(e.ReservedName="reserved name",e.Character="character",e.Extension="extension",e))(E||{});class p extends Error{constructor(e){super(`Invalid ${e.reason} '${e.segment}' in filename '${e.filename}'`,{cause:e})}get filename(){return this.cause.filename}get reason(){return this.cause.reason}get segment(){return this.cause.segment}}function f(e){const t=(0,i.F)().files,r=t.forbidden_filename_characters??window._oc_config?.forbidden_filenames_characters??["/","\\"];for(const t of r)if(e.includes(t))throw new p({segment:t,reason:"character",filename:e});if(e=e.toLocaleLowerCase(),(t.forbidden_filenames??[".htaccess"]).includes(e))throw new p({filename:e,segment:e,reason:"reserved name"});const n=e.indexOf(".",1),a=e.substring(0,-1===n?void 0:n);if((t.forbidden_filename_basenames??[]).includes(a))throw new p({filename:e,segment:a,reason:"reserved name"});const s=t.forbidden_filename_extensions??[".part",".filepart"];for(const t of s)if(e.length>t.length&&e.endsWith(t))throw new p({segment:t,reason:"extension",filename:e})}const T=["B","KB","MB","GB","TB","PB"],h=["B","KiB","MiB","GiB","TiB","PiB"];function g(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?h.length:T.length)-1,i);const s=r?h[i]:T[i];let o=(e/Math.pow(n?1e3:1024,i)).toFixed(1);return!0===t&&0===i?("0.0"!==o?"< 1 ":"0 ")+(r?h[1]:T[1]):(o=i<2?parseFloat(o).toFixed(0):parseFloat(o).toLocaleString((0,a.lO)()),o+" "+s)}function A(e){return e instanceof Date?e.toISOString():String(e)}function I(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,a.Z0)(),(0,a.lO)()],{numeric:!0,usage:"sort"});return[...e].sort(((e,r)=>{for(const[a,s]of t.entries()){const t=i.compare(A(s(e)),A(s(r)));if(0!==t)return t*n[a]}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.displayname||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 N,_,D,b,v;function L(){if(D)return _;D=1;const e="object"==typeof l&&l.env&&l.env.NODE_DEBUG&&/\bsemver\b/i.test(l.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return _=e}function O(){if(v)return b;v=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return b={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}N||(N=1,function(e){e.parser=function(e,t){return new n(e,t)},e.SAXParser=n,e.SAXStream=a,e.createStream=function(e,t){return new a(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function n(t,i){if(!(this instanceof n))return new n(t,i);var a=this;!function(e){for(var t=0,n=r.length;t<n;t++)e[r[t]]=""}(a),a.q=a.c="",a.bufferCheckPosition=e.MAX_BUFFER_LENGTH,a.opt=i||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase",a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!t,a.noscript=!(!t&&!a.opt.noscript),a.state=v.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(m)),void 0===a.opt.unquotedAttributeValues&&(a.opt.unquotedAttributeValues=!t),a.trackPosition=!1!==a.opt.position,a.trackPosition&&(a.position=a.line=a.column=0),O(a,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t}),n.prototype={end:function(){y(this)},write:function(t){var n=this;if(this.error)throw this.error;if(n.closed)return w(n,"Cannot write after close. Assign an onready handler.");if(null===t)return y(n);"object"==typeof t&&(t=t.toString());for(var i=0,a="";a=V(t,i++),n.c=a,a;)switch(n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++),n.state){case v.BEGIN:if(n.state=v.BEGIN_WHITESPACE,"\ufeff"===a)continue;G(n,a);continue;case v.BEGIN_WHITESPACE:G(n,a);continue;case v.TEXT:if(n.sawRoot&&!n.closedRoot){for(var o=i-1;a&&"<"!==a&&"&"!==a;)(a=V(t,i++))&&n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++);n.textNode+=t.substring(o,i-1)}"<"!==a||n.sawRoot&&n.closedRoot&&!n.strict?(h(a)||n.sawRoot&&!n.closedRoot||F(n,"Text data outside of root node."),"&"===a?n.state=v.TEXT_ENTITY:n.textNode+=a):(n.state=v.OPEN_WAKA,n.startTagPosition=n.position);continue;case v.SCRIPT:"<"===a?n.state=v.SCRIPT_ENDING:n.script+=a;continue;case v.SCRIPT_ENDING:"/"===a?n.state=v.CLOSE_TAG:(n.script+="<"+a,n.state=v.SCRIPT);continue;case v.OPEN_WAKA:if("!"===a)n.state=v.SGML_DECL,n.sgmlDecl="";else if(h(a));else if(I(E,a))n.state=v.OPEN_TAG,n.tagName=a;else if("/"===a)n.state=v.CLOSE_TAG,n.tagName="";else if("?"===a)n.state=v.PROC_INST,n.procInstName=n.procInstBody="";else{if(F(n,"Unencoded <"),n.startTagPosition+1<n.position){var c=n.position-n.startTagPosition;a=new Array(c).join(" ")+a}n.textNode+="<"+a,n.state=v.TEXT}continue;case v.SGML_DECL:if(n.sgmlDecl+a==="--"){n.state=v.COMMENT,n.comment="",n.sgmlDecl="";continue}n.doctype&&!0!==n.doctype&&n.sgmlDecl?(n.state=v.DOCTYPE_DTD,n.doctype+="<!"+n.sgmlDecl+a,n.sgmlDecl=""):(n.sgmlDecl+a).toUpperCase()===s?(C(n,"onopencdata"),n.state=v.CDATA,n.sgmlDecl="",n.cdata=""):(n.sgmlDecl+a).toUpperCase()===l?(n.state=v.DOCTYPE,(n.doctype||n.sawRoot)&&F(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):">"===a?(C(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=v.TEXT):g(a)?(n.state=v.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case v.SGML_DECL_QUOTED:a===n.q&&(n.state=v.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case v.DOCTYPE:">"===a?(n.state=v.TEXT,C(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=v.DOCTYPE_DTD:g(a)&&(n.state=v.DOCTYPE_QUOTED,n.q=a));continue;case v.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=v.DOCTYPE);continue;case v.DOCTYPE_DTD:"]"===a?(n.doctype+=a,n.state=v.DOCTYPE):"<"===a?(n.state=v.OPEN_WAKA,n.startTagPosition=n.position):g(a)?(n.doctype+=a,n.state=v.DOCTYPE_DTD_QUOTED,n.q=a):n.doctype+=a;continue;case v.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=v.DOCTYPE_DTD,n.q="");continue;case v.COMMENT:"-"===a?n.state=v.COMMENT_ENDING:n.comment+=a;continue;case v.COMMENT_ENDING:"-"===a?(n.state=v.COMMENT_ENDED,n.comment=S(n.opt,n.comment),n.comment&&C(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=v.COMMENT);continue;case v.COMMENT_ENDED:">"!==a?(F(n,"Malformed comment"),n.comment+="--"+a,n.state=v.COMMENT):n.doctype&&!0!==n.doctype?n.state=v.DOCTYPE_DTD:n.state=v.TEXT;continue;case v.CDATA:"]"===a?n.state=v.CDATA_ENDING:n.cdata+=a;continue;case v.CDATA_ENDING:"]"===a?n.state=v.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=v.CDATA);continue;case v.CDATA_ENDING_2:">"===a?(n.cdata&&C(n,"oncdata",n.cdata),C(n,"onclosecdata"),n.cdata="",n.state=v.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=v.CDATA);continue;case v.PROC_INST:"?"===a?n.state=v.PROC_INST_ENDING:h(a)?n.state=v.PROC_INST_BODY:n.procInstName+=a;continue;case v.PROC_INST_BODY:if(!n.procInstBody&&h(a))continue;"?"===a?n.state=v.PROC_INST_ENDING:n.procInstBody+=a;continue;case v.PROC_INST_ENDING:">"===a?(C(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=v.TEXT):(n.procInstBody+="?"+a,n.state=v.PROC_INST_BODY);continue;case v.OPEN_TAG:I(p,a)?n.tagName+=a:(P(n),">"===a?$(n):"/"===a?n.state=v.OPEN_TAG_SLASH:(h(a)||F(n,"Invalid character in tag name"),n.state=v.ATTRIB));continue;case v.OPEN_TAG_SLASH:">"===a?($(n,!0),B(n)):(F(n,"Forward-slash in opening tag not followed by >"),n.state=v.ATTRIB);continue;case v.ATTRIB:if(h(a))continue;">"===a?$(n):"/"===a?n.state=v.OPEN_TAG_SLASH:I(E,a)?(n.attribName=a,n.attribValue="",n.state=v.ATTRIB_NAME):F(n,"Invalid attribute name");continue;case v.ATTRIB_NAME:"="===a?n.state=v.ATTRIB_VALUE:">"===a?(F(n,"Attribute without value"),n.attribValue=n.attribName,M(n),$(n)):h(a)?n.state=v.ATTRIB_NAME_SAW_WHITE:I(p,a)?n.attribName+=a:F(n,"Invalid attribute name");continue;case v.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=v.ATTRIB_VALUE;else{if(h(a))continue;F(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",C(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?$(n):I(E,a)?(n.attribName=a,n.state=v.ATTRIB_NAME):(F(n,"Invalid attribute name"),n.state=v.ATTRIB)}continue;case v.ATTRIB_VALUE:if(h(a))continue;g(a)?(n.q=a,n.state=v.ATTRIB_VALUE_QUOTED):(n.opt.unquotedAttributeValues||w(n,"Unquoted attribute value"),n.state=v.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case v.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=v.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}M(n),n.q="",n.state=v.ATTRIB_VALUE_CLOSED;continue;case v.ATTRIB_VALUE_CLOSED:h(a)?n.state=v.ATTRIB:">"===a?$(n):"/"===a?n.state=v.OPEN_TAG_SLASH:I(E,a)?(F(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=v.ATTRIB_NAME):F(n,"Invalid attribute name");continue;case v.ATTRIB_VALUE_UNQUOTED:if(!A(a)){"&"===a?n.state=v.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}M(n),">"===a?$(n):n.state=v.ATTRIB;continue;case v.CLOSE_TAG:if(n.tagName)">"===a?B(n):I(p,a)?n.tagName+=a:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=v.SCRIPT):(h(a)||F(n,"Invalid tagname in closing tag"),n.state=v.CLOSE_TAG_SAW_WHITE);else{if(h(a))continue;N(E,a)?n.script?(n.script+="</"+a,n.state=v.SCRIPT):F(n,"Invalid tagname in closing tag."):n.tagName=a}continue;case v.CLOSE_TAG_SAW_WHITE:if(h(a))continue;">"===a?B(n):F(n,"Invalid characters in closing tag");continue;case v.TEXT_ENTITY:case v.ATTRIB_VALUE_ENTITY_Q:case v.ATTRIB_VALUE_ENTITY_U:var u,d;switch(n.state){case v.TEXT_ENTITY:u=v.TEXT,d="textNode";break;case v.ATTRIB_VALUE_ENTITY_Q:u=v.ATTRIB_VALUE_QUOTED,d="attribValue";break;case v.ATTRIB_VALUE_ENTITY_U:u=v.ATTRIB_VALUE_UNQUOTED,d="attribValue"}if(";"===a){var m=U(n);n.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(m)?(n.entity="",n.state=u,n.write(m)):(n[d]+=m,n.entity="",n.state=u)}else I(n.entity.length?T:f,a)?n.entity+=a:(F(n,"Invalid character in entity name"),n[d]+="&"+n.entity+a,n.entity="",n.state=u);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,s=r.length;a<s;a++){var o=t[r[a]].length;if(o>n)switch(r[a]){case"textNode":R(t);break;case"cdata":C(t,"oncdata",t.cdata),t.cdata="";break;case"script":C(t,"onscript",t.script),t.script="";break;default:w(t,"Max buffer length exceeded: "+r[a])}i=Math.max(i,o)}var c=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=c+t.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;R(e=this),""!==e.cdata&&(C(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(C(e,"onscript",e.script),e.script="")}};try{t=require("stream").Stream}catch(e){t=function(){}}t||(t=function(){});var i=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function a(e,r){if(!(this instanceof a))return new a(e,r);t.apply(this),this._parser=new n(e,r),this.writable=!0,this.readable=!0;var s=this;this._parser.onend=function(){s.emit("end")},this._parser.onerror=function(e){s.emit("error",e),s._parser.error=null},this._decoder=null,i.forEach((function(e){Object.defineProperty(s,"on"+e,{get:function(){return s._parser["on"+e]},set:function(t){if(!t)return s.removeAllListeners(e),s._parser["on"+e]=t,t;s.on(e,t)},enumerable:!0,configurable:!1})}))}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof c&&"function"==typeof c.isBuffer&&c.isBuffer(e)){if(!this._decoder){var t=o.I;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,r){var n=this;return n._parser["on"+e]||-1===i.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),t.prototype.on.call(n,e,r)};var s="[CDATA[",l="DOCTYPE",u="http://www.w3.org/XML/1998/namespace",d="http://www.w3.org/2000/xmlns/",m={xml:u,xmlns:d},E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[:_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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,f=/[#:_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]/,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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function h(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function A(e){return">"===e||h(e)}function I(e,t){return e.test(t)}function N(e,t){return!I(e,t)}var _,D,b,v=0;for(var L in e.STATE={BEGIN:v++,BEGIN_WHITESPACE:v++,TEXT:v++,TEXT_ENTITY:v++,OPEN_WAKA:v++,SGML_DECL:v++,SGML_DECL_QUOTED:v++,DOCTYPE:v++,DOCTYPE_QUOTED:v++,DOCTYPE_DTD:v++,DOCTYPE_DTD_QUOTED:v++,COMMENT_STARTING:v++,COMMENT:v++,COMMENT_ENDING:v++,COMMENT_ENDED:v++,CDATA:v++,CDATA_ENDING:v++,CDATA_ENDING_2:v++,PROC_INST:v++,PROC_INST_BODY:v++,PROC_INST_ENDING:v++,OPEN_TAG:v++,OPEN_TAG_SLASH:v++,ATTRIB:v++,ATTRIB_NAME:v++,ATTRIB_NAME_SAW_WHITE:v++,ATTRIB_VALUE:v++,ATTRIB_VALUE_QUOTED:v++,ATTRIB_VALUE_CLOSED:v++,ATTRIB_VALUE_UNQUOTED:v++,ATTRIB_VALUE_ENTITY_Q:v++,ATTRIB_VALUE_ENTITY_U:v++,CLOSE_TAG:v++,CLOSE_TAG_SAW_WHITE:v++,SCRIPT:v++,SCRIPT_ENDING:v++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var r=e.ENTITIES[t],n="number"==typeof r?String.fromCharCode(r):r;e.ENTITIES[t]=n})),e.STATE)e.STATE[e.STATE[L]]=L;function O(e,t,r){e[t]&&e[t](r)}function C(e,t,r){e.textNode&&R(e),O(e,t,r)}function R(e){e.textNode=S(e.opt,e.textNode),e.textNode&&O(e,"ontext",e.textNode),e.textNode=""}function S(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function w(e,t){return R(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,O(e,"onerror",t),e}function y(e){return e.sawRoot&&!e.closedRoot&&F(e,"Unclosed root tag"),e.state!==v.BEGIN&&e.state!==v.BEGIN_WHITESPACE&&e.state!==v.TEXT&&w(e,"Unexpected end"),R(e),e.c="",e.closed=!0,O(e,"onend"),n.call(e,e.strict,e.opt),e}function F(e,t){if("object"!=typeof e||!(e instanceof n))throw new Error("bad call to strictFail");e.strict&&w(e,t)}function P(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,C(e,"onopentagstart",r)}function x(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],i=r[1];return t&&"xmlns"===e&&(n="xmlns",i=""),{prefix:n,local:i}}function M(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=x(e.attribName,!0),r=t.prefix,n=t.local;if("xmlns"===r)if("xml"===n&&e.attribValue!==u)F(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==d)F(e,"xmlns: prefix must be bound to "+d+"\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,C(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function $(e,t){if(e.opt.xmlns){var r=e.tag,n=x(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(F(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix);var i=e.tags[e.tags.length-1]||e;r.ns&&i.ns!==r.ns&&Object.keys(r.ns).forEach((function(t){C(e,"onopennamespace",{prefix:t,uri:r.ns[t]})}));for(var a=0,s=e.attribList.length;a<s;a++){var o=e.attribList[a],c=o[0],l=o[1],u=x(c,!0),d=u.prefix,m=u.local,E=""===d?"":r.ns[d]||"",p={name:c,value:l,prefix:d,local:m,uri:E};d&&"xmlns"!==d&&!E&&(F(e,"Unbound namespace prefix: "+JSON.stringify(d)),p.uri=d),e.tag.attributes[c]=p,C(e,"onattribute",p)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),C(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=v.TEXT:e.state=v.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function B(e){if(!e.tagName)return F(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=v.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=v.SCRIPT);C(e,"onscript",e.script),e.script=""}var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var n=r;t--&&e.tags[t].name!==n;)F(e,"Unexpected close tag");if(t<0)return F(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=v.TEXT);e.tagName=r;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,C(e,"onclosetag",e.tagName);var s={};for(var o in a.ns)s[o]=a.ns[o];var c=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==c.ns&&Object.keys(a.ns).forEach((function(t){var r=a.ns[t];C(e,"onclosenamespace",{prefix:t,uri:r})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=v.TEXT}function U(e){var t,r=e.entity,n=r.toLowerCase(),i="";return e.ENTITIES[r]?e.ENTITIES[r]:e.ENTITIES[n]?e.ENTITIES[n]:("#"===(r=n).charAt(0)&&("x"===r.charAt(1)?(r=r.slice(2),i=(t=parseInt(r,16)).toString(16)):(r=r.slice(1),i=(t=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==r?(F(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function G(e,t){"<"===t?(e.state=v.OPEN_WAKA,e.startTagPosition=e.position):h(t)||(F(e,"Non-whitespace before first tag."),e.textNode=t,e.state=v.TEXT)}function V(e,t){var r="";return t<e.length&&(r=e.charAt(t)),r}v=e.STATE,String.fromCodePoint||(_=String.fromCharCode,D=Math.floor,b=function(){var e,t,r=[],n=-1,i=arguments.length;if(!i)return"";for(var a="";++n<i;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||D(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(n+1===i||r.length>16384)&&(a+=_.apply(null,r),r.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:b,configurable:!0,writable:!0}):String.fromCodePoint=b)}({}));var C,R,S,w,y,F,P,x,M,$,B,U,G,V={exports:{}};function k(){if(P)return F;P=1;const e=L(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=O(),{safeRe:n,t:i}=(C||(C=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=O(),a=L(),s=(t=e.exports={}).re=[],o=t.safeRe=[],c=t.src=[],l=t.t={};let u=0;const d="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",i],[d,n]],E=(e,t,r)=>{const n=(e=>{for(const[t,r]of m)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=u++;a(e,i,t),l[e]=i,c[i]=t,s[i]=new RegExp(t,r?"g":void 0),o[i]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),E("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${d}+`),E("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),E("FULL",`^${c[l.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),E("LOOSE",`^${c[l.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),E("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),E("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",c[l.COERCE],!0),E("COERCERTLFULL",c[l.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",E("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",E("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(V,V.exports)),V.exports),a=function(){if(S)return R;S=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return R=r=>r?"object"!=typeof r?e:r:t}(),{compareIdentifiers:s}=function(){if(y)return w;y=1;const e=/^[0-9]+$/,t=(t,r)=>{const n=e.test(t),i=e.test(r);return n&&i&&(t=+t,r=+r),t===r?0:n&&!i?-1:i&&!n?1:t<r?-1:1};return w={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)}}();class o{constructor(s,c){if(c=a(c),s instanceof o){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=s.trim().match(c.loose?n[i.LOOSE]:n[i.FULL]);if(!l)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e})):this.prerelease=[],this.build=l[5]?l[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof o)){if("string"==typeof t&&t===this.version)return 0;t=new o(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof o||(e=new o(e,this.options)),s(this.major,e.major)||s(this.minor,e.minor)||s(this.patch,e.patch)}comparePre(t){if(t instanceof o||(t=new o(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(e("prerelease compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return s(n,i)}while(++r)}compareBuild(t){t instanceof o||(t=new o(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(e("build compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return s(n,i)}while(++r)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return F=o}!function(){if(B)return $;B=1;const e=function(){if(M)return x;M=1;const e=k();return x=(t,r,n=!1)=>{if(t instanceof e)return t;try{return new e(t,r)}catch(e){if(!n)return null;throw e}}}();$=(t,r)=>{const n=e(t,r);return n?n.version:null}}(),function(){if(G)return U;G=1;const e=k();U=(t,r)=>new e(t,r).major}(),s.m},36720:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(71354),i=r.n(n),a=r(76314),s=r.n(a)()(i());s.push([e.id,".custom-reminder-modal[data-v-75680f34]{margin:0 12px}","",{version:3,sources:["webpack://./apps/files_reminders/src/components/SetCustomReminderModal.vue"],names:[],mappings:"AACA,wCACC,aAAA",sourcesContent:["\n.custom-reminder-modal {\n\tmargin: 0 12px;\n}\n"],sourceRoot:""}]);const o=s}},i={};function a(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,a),r.loaded=!0,r.exports}a.m=n,e=[],a.O=(t,r,n,i)=>{if(!r){var s=1/0;for(u=0;u<e.length;u++){r=e[u][0],n=e[u][1],i=e[u][2];for(var o=!0,c=0;c<r.length;c++)(!1&i||s>=i)&&Object.keys(a.O).every((e=>a.O[e](r[c])))?r.splice(c--,1):(o=!1,i<s&&(s=i));if(o){e.splice(u--,1);var l=n();void 0!==l&&(t=l)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,n,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>e+"-"+e+".js?v="+{640:"b2fa23a809053c6305c5",5771:"a4e2a98efcfb7393c5bd",5810:"f63f10359069f886ce52",7432:"bf576075b1d8131aa273"}[e],a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="nextcloud:",a.l=(e,n,i,s)=>{if(t[e])t[e].push(n);else{var o,c;if(void 0!==i)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+i){o=d;break}}o||(c=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-webpack",r+i),o.src=e),t[e]=[n];var m=(r,n)=>{o.onerror=o.onload=null,clearTimeout(E);var i=t[e];if(delete t[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach((e=>e(n))),r)return r(n)},E=setTimeout(m.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=m.bind(null,o.onerror),o.onload=m.bind(null,o.onload),c&&document.head.appendChild(o)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.j=9735,(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.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(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{a.b=document.baseURI||self.location.href;var e={5810:0,9735:0};a.f.j=(t,r)=>{var n=a.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 s=a.p+a.u(t),o=new Error;a.l(s,(r=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",o.name="ChunkLoadError",o.type=i,o.request=s,n[1](o)}}),"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,r)=>{var n,i,s=r[0],o=r[1],c=r[2],l=0;if(s.some((t=>0!==e[t]))){for(n in o)a.o(o,n)&&(a.m[n]=o[n]);if(c)var u=c(a)}for(t&&t(r);l<s.length;l++)i=s[l],a.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return a.O(u)},r=self.webpackChunknextcloud=self.webpackChunknextcloud||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),a.nc=void 0;var s=a.O(void 0,[4208],(()=>a(17929)));s=a.O(s)})();
//# sourceMappingURL=files_reminders-init.js.map?v=c800bc2913138d587487