(()=>{var e,r,i,s={5153:(e,r,i)=>{"use strict";var s=i(85471),o=i(61338),a=i(4523),l=i(74692),c=i.n(l),u=i(85168);const d={updatableNotification:null,getDefaultNotificationFunction:null,setDefault(t){this.getDefaultNotificationFunction=t},hide(t,e){a.default.isFunction(t)&&(e=t,t=void 0),t?(t.each((function(){c()(this)[0].toastify?c()(this)[0].toastify.hideToast():console.error("cannot hide toast because object is not set"),this===this.updatableNotification&&(this.updatableNotification=null)})),e&&e.call(),this.getDefaultNotificationFunction&&this.getDefaultNotificationFunction()):console.error("Missing argument $row in OC.Notification.hide() call, caller needs to be adjusted to only dismiss its own notification")},showHtml(t,e){(e=e||{}).isHTML=!0,e.timeout=e.timeout?e.timeout:u.DH;const n=(0,u.rG)(t,e);return n.toastElement.toastify=n,c()(n.toastElement)},show(t,e){(e=e||{}).timeout=e.timeout?e.timeout:u.DH;const n=(0,u.rG)(function(t){return t.toString().split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}(t),e);return n.toastElement.toastify=n,c()(n.toastElement)},showUpdate(t){return this.updatableNotification&&this.updatableNotification.hideToast(),this.updatableNotification=(0,u.rG)(t,{timeout:u.DH}),this.updatableNotification.toastElement.toastify=this.updatableNotification,c()(this.updatableNotification.toastElement)},showTemporary(t,e){(e=e||{}).timeout=e.timeout||u.Jt;const n=(0,u.rG)(t,e);return n.toastElement.toastify=n,c()(n.toastElement)},isHidden:()=>!c()("#content").find(".toastify").length};var h=i(21777);const f=a.default.throttle((()=>{(0,u.I9)(t("core","Connection to server lost"))}),7e3,{trailing:!1});let p=!1;const g={enableDynamicSlideToggle(){p=!0},showAppSidebar:function(t){(t||c()("#app-sidebar")).removeClass("disappear").show(),c()("#app-content").trigger(new(c().Event)("appresized"))},hideAppSidebar:function(t){(t||c()("#app-sidebar")).hide().addClass("disappear"),c()("#app-content").trigger(new(c().Event)("appresized"))}};var m=i(63814);function v(t,e,n){"post"!==t&&"delete"!==t||!pt.PasswordConfirmation.requiresPasswordConfirmation()?(n=n||{},c().ajax({type:t.toUpperCase(),url:(0,m.KT)("apps/provisioning_api/api/v1/config/apps")+e,data:n.data||{},success:n.success,error:n.error})):pt.PasswordConfirmation.requirePasswordConfirmation(_.bind(v,this,t,e,n))}const y=window.oc_appconfig||{},b={getValue:function(t,e,n,r){!function(t,e,n,r){(r=r||{}).data={defaultValue:n},v("get","/"+t+"/"+e,r)}(t,e,n,{success:r})},setValue:function(t,e,n){!function(t,e,n,r){(r=r||{}).data={value:n},v("post","/"+t+"/"+e,r)}(t,e,n)},getApps:function(t){!function(t){v("get","",t)}({success:t})},getKeys:function(t,e){!function(t,e){v("get","/"+t,e)}(t,{success:e})},deleteKey:function(t,e){!function(t,e){v("delete","/"+t+"/"+e,void 0)}(t,e)}},A=void 0!==window._oc_appswebroots&&window._oc_appswebroots;var w=i(21391),E=i.n(w),x=i(78112);const N={create:"POST",update:"PROPPATCH",patch:"PROPPATCH",delete:"DELETE",read:"PROPFIND"};function C(t,e){if(a.default.isArray(t))return a.default.map(t,(function(t){return C(t,e)}));var n={href:t.href};return a.default.each(t.propStat,(function(t){if("HTTP/1.1 200 OK"===t.status)for(var r in t.properties){var i=r;r in e&&(i=e[r]),n[i]=t.properties[r]}})),n.id||(n.id=T(n.href)),n}function T(t){var e=t.indexOf("?");e>0&&(t=t.substr(0,e));var n,r=t.split("/");do{n=r[r.length-1],r.pop()}while(!n&&r.length>0);return n}function I(t){return t>=200&&t<=299}function P(t,e,n,r){return t.propPatch(e.url,function(t,e){var n,r={};for(n in t){var i=e[n],s=t[n];i||(console.warn('No matching DAV property for property "'+n),i=n),(a.default.isBoolean(s)||a.default.isNumber(s))&&(s=""+s),r[i]=s}return r}(n.changed,e.davProperties),r).then((function(t){I(t.status)?a.default.isFunction(e.success)&&e.success(n.toJSON()):a.default.isFunction(e.error)&&e.error(t)}))}const O=E().noConflict();Object.assign(O,{davCall:(t,e)=>{var n=new x.dav.Client({baseUrl:t.url,xmlNamespaces:a.default.extend({"DAV:":"d","http://owncloud.org/ns":"oc"},t.xmlNamespaces||{})});n.resolveUrl=function(){return t.url};var r=a.default.extend({"X-Requested-With":"XMLHttpRequest",requesttoken:OC.requestToken},t.headers);return"PROPFIND"===t.type?function(t,e,n,r){return t.propFind(e.url,a.default.values(e.davProperties)||[],e.depth,r).then((function(t){if(I(t.status)){if(a.default.isFunction(e.success)){var n=a.default.invert(e.davProperties),r=C(t.body,n);e.depth>0&&r.shift(),e.success(r)}}else a.default.isFunction(e.error)&&e.error(t)}))}(n,t,0,r):"PROPPATCH"===t.type?P(n,t,e,r):"MKCOL"===t.type?function(t,e,n,r){return t.request(e.type,e.url,r,null).then((function(i){I(i.status)?P(t,e,n,r):a.default.isFunction(e.error)&&e.error(i)}))}(n,t,e,r):function(t,e,n,r){return r["Content-Type"]="application/json",t.request(e.type,e.url,r,e.data).then((function(t){if(I(t.status)){if(a.default.isFunction(e.success)){if("PUT"===e.type||"POST"===e.type||"MKCOL"===e.type){var r=t.body||n.toJSON(),i=t.xhr.getResponseHeader("Content-Location");return"POST"===e.type&&i&&(r.id=T(i)),void e.success(r)}if(207===t.status){var s=a.default.invert(e.davProperties);e.success(C(t.body,s))}else e.success(t.body)}}else a.default.isFunction(e.error)&&e.error(t)}))}(n,t,e,r)},davSync:(t=>(e,n,r)=>{var i={type:N[e]||e},s=n instanceof t.Collection;if("update"===e&&(n.hasInnerCollection?i.type="MKCOL":(n.usePUT||n.collection&&n.collection.usePUT)&&(i.type="PUT")),r.url||(i.url=a.default.result(n,"url")||function(){throw new Error('A "url" property or function must be specified')}()),null!=r.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(i.data=JSON.stringify(r.attrs||n.toJSON(r))),"PROPFIND"!==i.type&&(i.processData=!1),"PROPFIND"===i.type||"PROPPATCH"===i.type){var o=n.davProperties;!o&&n.model&&(o=n.model.prototype.davProperties),o&&(a.default.isFunction(o)?i.davProperties=o.call(n):i.davProperties=o),i.davProperties=a.default.extend(i.davProperties||{},r.davProperties),a.default.isUndefined(r.depth)&&(r.depth=s?1:0)}var l=r.error;r.error=function(t,e,n){r.textStatus=e,r.errorThrown=n,l&&l.call(r.context,t,e,n)};var c=r.xhr=t.davCall(a.default.extend(i,r),n);return n.trigger("request",n,c,r),c})(O)});const S=O;var k=i(71225);const R=window._oc_config||{},L=document.getElementsByTagName("head")[0].getAttribute("data-user"),j=document.getElementsByTagName("head")[0].getAttribute("data-user-displayname"),F=void 0!==L&&L;var $=i(39285),B=i(36882),M=i(53334),D=i(43627);const U={YES_NO_BUTTONS:70,OK_BUTTONS:71,FILEPICKER_TYPE_CHOOSE:1,FILEPICKER_TYPE_MOVE:2,FILEPICKER_TYPE_COPY:3,FILEPICKER_TYPE_COPY_MOVE:4,FILEPICKER_TYPE_CUSTOM:5,alert:function(t,e,n,r){this.message(t,e,"alert",U.OK_BUTTON,n,r)},info:function(t,e,n,r){this.message(t,e,"info",U.OK_BUTTON,n,r)},confirm:function(t,e,n,r){return this.message(t,e,"notice",U.YES_NO_BUTTONS,n,r)},confirmDestructive:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U.OK_BUTTONS,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{};return(new u.ik).setName(e).setText(t).setButtons(n===U.OK_BUTTONS?[{label:(0,M.Tl)("core","Yes"),type:"error",callback:()=>{r.clicked=!0,r(!0)}}]:U._getLegacyButtons(n,r)).build().show().then((()=>{r.clicked||r(!1)}))},confirmHtml:function(t,e,n,r){return(new u.ik).setName(e).setText("").setButtons([{label:(0,M.Tl)("core","No"),callback:()=>{}},{label:(0,M.Tl)("core","Yes"),type:"primary",callback:()=>{n.clicked=!0,n(!0)}}]).build().setHTML(t).show().then((()=>{n.clicked||n(!1)}))},prompt:function(t,e,n,r,o,a){return new Promise((r=>{(0,u.Ss)((0,s.$V)((()=>i.e(1642).then(i.bind(i,71642)))),{text:t,name:e,callback:n,inputName:o,isPassword:!!a},(function(){n(...arguments),r()}))}))},filepicker(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:u.bh.Choose,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;const a=(t,e)=>{const r=t=>{const e=t?.root||"";let n=t?.path||"";return n.startsWith(e)&&(n=n.slice(e.length)||"/"),n};return n?n=>t(n.map(r),e):n=>t(r(n[0]),e)},l=(0,u.a1)(t);i===this.FILEPICKER_TYPE_CUSTOM?(o.buttons||[]).forEach((t=>{l.addButton({callback:a(e,t.type),label:t.text,type:t.defaultButton?"primary":"secondary"})})):l.setButtonFactory(((t,n)=>{const r=[],s=t?.[0]?.attributes?.displayName||t?.[0]?.basename,o=s||(0,D.basename)(n);return i===u.bh.Choose&&r.push({callback:a(e,u.bh.Choose),label:s&&!this.multiSelect?(0,M.Tl)("core","Choose {file}",{file:s}):(0,M.Tl)("core","Choose"),type:"primary"}),i!==u.bh.CopyMove&&i!==u.bh.Copy||r.push({callback:a(e,u.bh.Copy),label:o?(0,M.Tl)("core","Copy to {target}",{target:o}):(0,M.Tl)("core","Copy"),type:"primary",icon:B}),i!==u.bh.Move&&i!==u.bh.CopyMove||r.push({callback:a(e,u.bh.Move),label:o?(0,M.Tl)("core","Move to {target}",{target:o}):(0,M.Tl)("core","Move"),type:i===u.bh.Move?"primary":"secondary",icon:$}),r})),r&&l.setMimeTypeFilter("string"==typeof r?[r]:r||[]),"function"==typeof o?.filter&&l.setFilter((t=>o.filter((t=>({id:t.fileid||null,path:t.path,mimetype:t.mime||null,mtime:t.mtime?.getTime()||null,permissions:t.permissions,name:t.attributes?.displayName||t.basename,etag:t.attributes?.etag||null,hasPreview:t.attributes?.hasPreview||null,mountType:t.attributes?.mountType||null,quotaAvailableBytes:t.attributes?.quotaAvailableBytes||null,icon:null,sharePermissions:null}))(t)))),l.allowDirectories(!0===o?.allowDirectoryChooser||r?.includes("httpd/unix-directory")||!1).setMultiSelect(n).startAt(s).build().pick()},message:function(t,e,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{},s=arguments.length>6?arguments[6]:void 0;const o=(new u.ik).setName(e).setText(s?"":t).setButtons(U._getLegacyButtons(r,i));switch(n){case"alert":o.setSeverity("warning");break;case"notice":o.setSeverity("info")}const a=o.build();return s&&a.setHTML(t),a.show().then((()=>{i._clicked||i(!1)}))},_getLegacyButtons(t,e){const n=[];switch("object"==typeof t?t.type:t){case U.YES_NO_BUTTONS:n.push({label:t?.cancel??(0,M.Tl)("core","No"),callback:()=>{e._clicked=!0,e(!1)}}),n.push({label:t?.confirm??(0,M.Tl)("core","Yes"),type:"primary",callback:()=>{e._clicked=!0,e(!0)}});break;case U.OK_BUTTONS:n.push({label:t?.confirm??(0,M.Tl)("core","OK"),type:"primary",callback:()=>{e._clicked=!0,e(!0)}});break;default:console.error("Invalid call to OC.dialogs")}return n},_fileexistsshown:!1,fileexists:function(t,e,r,i){var s=this,o=new(c().Deferred),a=function(t,e,n,r,i){r=Math.round(r),i=Math.round(i);for(var s=t.getContext("2d").getImageData(0,0,e,n),o=t.getContext("2d").getImageData(0,0,r,i),a=s.data,l=o.data,c=e/r,u=n/i,d=Math.ceil(c/2),h=Math.ceil(u/2),f=0;f=-1&&O<=1&&(m=2*O*O*O-3*O*O+1)>0&&(E+=m*a[3+(P=4*(I+x*e))],y+=m,a[P+3]<255&&(m=m*a[P+3]/250),b+=m*a[P],A+=m*a[P+1],w+=m*a[P+2],v+=m)}l[g]=b/v,l[g+1]=A/v,l[g+2]=w/v,l[g+3]=E/y}t.getContext("2d").clearRect(0,0,Math.max(e,r),Math.max(n,i)),t.width=r,t.height=i,t.getContext("2d").putImageData(o,0,0)},l=function(e,n,r){var i=e.find(".template").clone().removeClass("template").addClass("conflict"),s=i.find(".original"),o=i.find(".replacement");i.data("data",t),i.find(".filename").text(n.name),s.find(".size").text(pt.Util.humanFileSize(n.size)),s.find(".mtime").text(pt.Util.formatDate(n.mtime)),r.size&&r.lastModified&&(o.find(".size").text(pt.Util.humanFileSize(r.size)),o.find(".mtime").text(pt.Util.formatDate(r.lastModified)));var l=n.directory+"/"+n.name,u={file:l,x:96,y:96,c:n.etag,forceIcon:0},d=Files.generatePreviewUrl(u);d=d.replace(/'/g,"%27"),s.find(".icon").css({"background-image":"url('"+d+"')"}),function(t){var e=new(c().Deferred),n=t.type&&t.type.split("/").shift();if(window.FileReader&&"image"===n){var r=new FileReader;r.onload=function(t){var n=new Blob([t.target.result]);window.URL=window.URL||window.webkitURL;var r=window.URL.createObjectURL(n),i=new Image;i.src=r,i.onload=function(){var t,n,r,s,o,l,c,u=(t=i,o=document.createElement("canvas"),l=t.width,c=t.height,l>c?(r=0,n=(l-c)/2):(r=(c-l)/2,n=0),s=Math.min(l,c),o.width=s,o.height=s,o.getContext("2d").drawImage(t,n,r,s,s,0,0,s,s),a(o,s,s,96,96),o.toDataURL("image/png",.7));e.resolve(u)}},r.readAsArrayBuffer(t)}else e.reject();return e}(r).then((function(t){o.find(".icon").css("background-image","url("+t+")")}),(function(){l=pt.MimeType.getIconUrl(r.type),o.find(".icon").css("background-image","url("+l+")")}));var h=e.find(".conflict").length;s.find("input:checkbox").attr("id","checkbox_original_"+h),o.find("input:checkbox").attr("id","checkbox_replacement_"+h),e.append(i),r.lastModified>n.mtime?o.find(".mtime").css("font-weight","bold"):r.lastModifiedn.size?o.find(".size").css("font-weight","bold"):r.size&&r.size0?(c()(d).find(".allnewfiles").prop("checked",!1),c()(d).find(".allnewfiles + .count").text((0,M.Tl)("core","({count} selected)",{count:t}))):(c()(d).find(".allnewfiles").prop("checked",!1),c()(d).find(".allnewfiles + .count").text("")),m()})),c()(d).on("click",".original,.allexistingfiles",(function(){var t=c()(d).find('.conflict .original input[type="checkbox"]:checked').length;t===c()(d+" .conflict").length?(c()(d).find(".allexistingfiles").prop("checked",!0),c()(d).find(".allexistingfiles + .count").text((0,M.Tl)("core","(all selected)"))):t>0?(c()(d).find(".allexistingfiles").prop("checked",!1),c()(d).find(".allexistingfiles + .count").text((0,M.Tl)("core","({count} selected)",{count:t}))):(c()(d).find(".allexistingfiles").prop("checked",!1),c()(d).find(".allexistingfiles + .count").text("")),m()})),o.resolve()})).fail((function(){o.reject(),alert((0,M.Tl)("core","Error loading file exists template"))}));return o.promise()},_getFileExistsTemplate:function(){var t=c().Deferred();if(this.$fileexistsTemplate)t.resolve(this.$fileexistsTemplate);else{var e=this;c().get(pt.filePath("core","templates/legacy","fileexists.html"),(function(n){e.$fileexistsTemplate=c()(n),t.resolve(e.$fileexistsTemplate)})).fail((function(){t.reject()}))}return t.promise()}},z=U,H=((t,e)=>{let n=t.getElementsByTagName("head")[0].getAttribute("data-requesttoken");return{getToken:()=>n,setToken:t=>{n=t,e("csrf-token-update",{token:n})}}})(document,o.Ic),G=H.getToken,q=(H.setToken,function(t,e){var n,r,i="";if(this.typelessListeners=[],this.closed=!1,this.listeners={},e)for(n in e)i+=n+"="+encodeURIComponent(e[n])+"&";if(i+="requesttoken="+encodeURIComponent(G()),this.useFallBack||"undefined"==typeof EventSource){var s="oc_eventsource_iframe_"+q.iframeCount;q.fallBackSources[q.iframeCount]=this,this.iframe=c()(""),this.iframe.attr("id",s),this.iframe.hide(),r="&",-1===t.indexOf("?")&&(r="?"),this.iframe.attr("src",t+r+"fallback=true&fallback_id="+q.iframeCount+"&"+i),c()("body").append(this.iframe),this.useFallBack=!0,q.iframeCount++}else r="&",-1===t.indexOf("?")&&(r="?"),this.source=new EventSource(t+r+i),this.source.onmessage=function(t){for(var e=0;e(0,nt.oB)(),requirePasswordConfirmation(t,e,n){(0,nt.C5)().then(t,n)}},it={_plugins:{},register(t,e){let n=this._plugins[t];n||(n=this._plugins[t]=[]),n.push(e)},getPlugins(t){return this._plugins[t]||[]},attach(t,e,n){const r=this.getPlugins(t);for(let t=0;t-1&&parseInt(navigator.userAgent.split("/").pop())<51){const t=document.querySelectorAll('[fill^="url(#"], [stroke^="url(#"], [filter^="url(#invert"]');for(let e,n=0,r=t.length;n=0?t.substr(e+1):t.length?t.substr(1):""},_decodeQuery:t=>t.replace(/\+/g," "),parseUrlQuery(){const t=this._parseHashQuery();let e;return t&&(e=pt.parseQueryString(this._decodeQuery(t))),e=a.default.extend(e||{},pt.parseQueryString(this._decodeQuery(location.search))),e||{}},_onPopState(t){if(this._cancelPop)return void(this._cancelPop=!1);let e;if(this._handlers.length){e=t&&t.state,a.default.isString(e)?e=pt.parseQueryString(e):e||(e=this.parseUrlQuery()||{});for(let t=0;t="0"&&n<="9";o!==s&&(i++,e[i]="",s=o),e[i]+=n,r++}return e}const ut={History:lt,humanFileSize:i(35810).v7,computerFileSize(t){if("string"!=typeof t)return null;const e=t.toLowerCase().trim();let n=null;const r=e.match(/^[\s+]?([0-9]*)(\.([0-9]+))?( +)?([kmgtp]?b?)$/i);return null===r?null:(n=parseFloat(e),isFinite(n)?(r[5]&&(n*={b:1,k:1024,kb:1024,mb:1048576,m:1048576,gb:1073741824,g:1073741824,tb:1099511627776,t:1099511627776,pb:0x4000000000000,p:0x4000000000000}[r[5]]),n=Math.round(n),n):null)},formatDate:(t,e)=>(void 0===window.TESTING&&pt.debug&&console.warn("OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment"),e=e||"LLL",at()(t).format(e)),relativeModifiedDate(e){void 0===window.TESTING&&pt.debug&&console.warn("OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment");const n=at()().diff(at()(e));return n>=0&&n<45e3?t("core","seconds ago"):at()(e).fromNow()},getScrollBarWidth(){if(this._scrollBarWidth)return this._scrollBarWidth;const t=document.createElement("p");t.style.width="100%",t.style.height="200px";const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);const n=t.offsetWidth;e.style.overflow="scroll";let r=t.offsetWidth;return n===r&&(r=e.clientWidth),document.body.removeChild(e),this._scrollBarWidth=n-r,this._scrollBarWidth},stripTime:t=>new Date(t.getFullYear(),t.getMonth(),t.getDate()),naturalSortCompare(t,e){let n;const r=ct(t),i=ct(e);for(n=0;r[n]&&i[n];n++)if(r[n]!==i[n]){const t=Number(r[n]),e=Number(i[n]);return t==r[n]&&e==i[n]?t-e:r[n].localeCompare(i[n],pt.getLanguage())}return r.length-i.length},waitFor(t,e){const n=function(){!0!==t()&&setTimeout(n,e)};n()},isCookieSetToValue(t,e){const n=document.cookie.split(";");for(let r=0;r!$_",fileIsBlacklisted:t=>!!t.match(R.blacklist_files_regex),Apps:g,AppConfig:b,appConfig:y,appswebroots:A,Backbone:S,config:R,currentUser:F,dialogs:z,EventSource:V,getCurrentUser:()=>({uid:F,displayName:j}),isUserAdmin:()=>J,L10N:tt,_ajaxConnectionLostHandler:f,_processAjaxError:t=>{(0!==t.status||"abort"!==t.statusText&&"timeout"!==t.statusText&&!pt._reloadCalled)&&([302,303,307,401].includes(t.status)&&(0,h.HW)()?setTimeout((function(){if(!pt._userIsNavigatingAway&&!pt._reloadCalled){let t=0;const e=5,r=setInterval((function(){d.showUpdate(n("core","Problem loading page, reloading in %n second","Problem loading page, reloading in %n seconds",e-t)),t>=e&&(clearInterval(r),pt.reload()),t++}),1e3);pt._reloadCalled=!0}}),100):0===t.status&&setTimeout((function(){pt._userIsNavigatingAway||pt._reloadCalled||pt._ajaxConnectionLostHandler()}),100))},registerXHRForErrorProcessing:t=>{t.addEventListener&&(t.addEventListener("load",(()=>{4===t.readyState&&(t.status>=200&&t.status<300||304===t.status||c()(document).trigger(new(c().Event)("ajaxError"),t))})),t.addEventListener("error",(()=>{c()(document).trigger(new(c().Event)("ajaxError"),t)})))},getCapabilities:()=>(OC.debug&&console.warn("OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities"),(0,X.F)()),hideMenus:W,registerMenu:function(t,e,n,r){e.addClass("menu");const i="A"===t.prop("tagName")||"BUTTON"===t.prop("tagName");t.on(i?"click.menu":"click.menu keyup.menu",(function(i){i.preventDefault(),i.key&&"Enter"!==i.key||(e.is(Y)?W():(Y&&W(),!0===r&&e.parent().addClass("openedMenu"),t.attr("aria-expanded",!0),e.slideToggle(50,n),Y=e,K=t))}))},showMenu:(t,e,n)=>{e.is(Y)||(W(),Y=e,K=t,e.trigger(new(c().Event)("beforeShow")),e.show(),e.trigger(new(c().Event)("afterShow")),a.default.isFunction(n)&&n())},unregisterMenu:(t,e)=>{e.is(Y)&&W(),t.off("click.menu").removeClass("menutoggle"),e.removeClass("menu")},basename:k.P8,encodePath:k.O0,dirname:k.pD,isSamePath:k.ys,joinPaths:k.HS,getHost:()=>window.location.host,getHostName:()=>window.location.hostname,getPort:()=>window.location.port,getProtocol:()=>window.location.protocol.split(":")[0],getCanonicalLocale:M.lO,getLocale:M.JK,getLanguage:M.Z0,buildQueryString:t=>t?c().map(t,(function(t,e){let n=encodeURIComponent(e);return null!=t&&(n+="="+encodeURIComponent(t)),n})).join("&"):"",parseQueryString:t=>{let e,n;const r={};let i;if(!t)return null;e=t.indexOf("?"),e>=0&&(t=t.substr(e+1));const s=t.replace(/\+/g,"%20").split("&");for(let t=0;t=0?[o.substr(0,e),o.substr(e+1)]:[o],n.length&&(i=decodeURIComponent(n[0]),i&&(r[i]=n.length>1?decodeURIComponent(n[1]):null))}return r},msg:et,Notification:d,PasswordConfirmation:rt,Plugins:it,theme:st,Util:ut,debug:dt,filePath:m.fg,generateUrl:m.Jv,get:(gt=window,t=>{const e=t.split("."),n=e.pop();for(let t=0;t(e,n)=>{const r=e.split("."),i=r.pop();for(let e=0;e{window.location=t},reload:()=>{window.location.reload()},requestToken:G(),linkTo:m.uM,linkToOCS:(t,e)=>(0,m.KT)(t,{},{ocsVersion:e||1})+"/",linkToRemote:m.dC,linkToRemoteBase:t=>(0,m.aU)()+"/remote.php/"+t,webroot:ft};var gt;(0,o.B1)("csrf-token-update",(t=>{OC.requestToken=t.token,console.info("OC.requestToken changed",t.token)}));var mt=i(32981),vt=i(82490),yt=i(17334),bt=i.n(yt),At=i(16044),wt=i(82182),Et=i(40083);const _t={computed:{userNameInputLengthIs255(){return this.user.length>=255},userInputHelperText(){if(this.userNameInputLengthIs255)return t("core","Email length is at max (255)")}}};var xt=i(70995);const Nt={name:"LoginButton",components:{ArrowRight:i(33691).A,NcButton:xt.A},props:{value:{type:String,default:(0,M.Tl)("core","Log in")},valueLoading:{type:String,default:(0,M.Tl)("core","Logging in …")},loading:{type:Boolean,required:!0},invertedColors:{type:Boolean,default:!1}}};var Ct=i(85072),Tt=i.n(Ct),It=i(97825),Pt=i.n(It),Ot=i(77659),St=i.n(Ot),kt=i(55056),Rt=i.n(kt),Lt=i(10540),jt=i.n(Lt),Ft=i(41113),$t=i.n(Ft),Bt=i(39136),Mt={};Mt.styleTagTransform=$t(),Mt.setAttributes=Rt(),Mt.insert=St().bind(null,"head"),Mt.domAPI=Pt(),Mt.insertStyleElement=jt(),Tt()(Bt.A,Mt),Bt.A&&Bt.A.locals&&Bt.A.locals;var Dt=i(14486);const Ut=(0,Dt.A)(Nt,(function(){var t=this,e=t._self._c;return e("NcButton",{attrs:{type:"primary","native-type":"submit",wide:!0,disabled:t.loading},on:{click:function(e){return t.$emit("click")}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("div",{staticClass:"submit-wrapper__icon icon-loading-small-dark"}):e("ArrowRight",{staticClass:"submit-wrapper__icon"})]},proxy:!0}])},[t._v("\n\t"+t._s(t.loading?t.valueLoading:t.value)+"\n\t")])}),[],!1,null,"6acd8f45",null).exports,zt={name:"LoginForm",components:{LoginButton:Ut,NcPasswordField:At.A,NcTextField:wt.A,NcNoteCard:Et.A},mixins:[_t],props:{username:{type:String,default:""},redirectUrl:{type:[String,Boolean],default:!1},errors:{type:Array,default:()=>[]},messages:{type:Array,default:()=>[]},throttleDelay:{type:Number,default:0},autoCompleteAllowed:{type:Boolean,default:!0},directLogin:{type:Boolean,default:!1},emailStates:{type:Array,default:()=>[]}},setup:()=>({t:M.Tl,headlineText:(0,M.Tl)("core","Log in to {productName}",{productName:OC.theme.name},void 0,{sanitize:!1,escape:!1}),loginTimeout:(0,mt.C)("core","loginTimeout",300),requestToken:window.OC.requestToken,timezone:(new Intl.DateTimeFormat)?.resolvedOptions()?.timeZone,timezoneOffset:-(new Date).getTimezoneOffset()/60}),data:()=>({loading:!1,user:"",password:""}),computed:{resetFormTimeout(){return this.loginTimeout<=0?()=>{}:bt()(this.handleResetForm,1e3*this.loginTimeout)},isError(){return this.invalidPassword||this.userDisabled||this.throttleDelay>5e3},errorLabel(){return this.invalidPassword?(0,M.Tl)("core","Wrong login or password."):this.userDisabled?(0,M.Tl)("core","This account is disabled"):this.throttleDelay>5e3?(0,M.Tl)("core","We have detected multiple invalid login attempts from your IP. Therefore your next login is throttled up to 30 seconds."):void 0},apacheAuthFailed(){return-1!==this.errors.indexOf("apacheAuthFailed")},csrfCheckFailed(){return-1!==this.errors.indexOf("csrfCheckFailed")},internalException(){return-1!==this.errors.indexOf("internalexception")},invalidPassword(){return-1!==this.errors.indexOf("invalidpassword")},userDisabled(){return-1!==this.errors.indexOf("userdisabled")},loadingIcon:()=>(0,m.d0)("core","loading-dark.gif"),loginActionUrl:()=>(0,m.Jv)("login"),emailEnabled(){return this.emailStates?this.emailStates.every((t=>"1"===t)):1},loginText(){return this.emailEnabled?(0,M.Tl)("core","Account name or email"):(0,M.Tl)("core","Account name")}},watch:{password(){this.resetFormTimeout()}},mounted(){""===this.username?this.$refs.user.$refs.inputField.$refs.input.focus():(this.user=this.username,this.$refs.password.$refs.inputField.$refs.input.focus())},methods:{handleResetForm(){this.password=""},updateUsername(){this.$emit("update:username",this.user)},submit(t){this.loading?t.preventDefault():(this.loading=!0,this.$emit("submit"))}}};var Ht=i(49618),Gt={};Gt.styleTagTransform=$t(),Gt.setAttributes=Rt(),Gt.insert=St().bind(null,"head"),Gt.domAPI=Pt(),Gt.insertStyleElement=jt(),Tt()(Ht.A,Gt),Ht.A&&Ht.A.locals&&Ht.A.locals;const qt=(0,Dt.A)(zt,(function(){var t=this,e=t._self._c;return e("form",{ref:"loginForm",staticClass:"login-form",attrs:{method:"post",name:"login",action:t.loginActionUrl},on:{submit:t.submit}},[e("fieldset",{staticClass:"login-form__fieldset",attrs:{"data-login-form":""}},[t.apacheAuthFailed?e("NcNoteCard",{attrs:{title:t.t("core","Server side authentication failed!"),type:"warning"}},[t._v("\n\t\t\t"+t._s(t.t("core","Please contact your administrator."))+"\n\t\t")]):t._e(),t._v(" "),t.csrfCheckFailed?e("NcNoteCard",{attrs:{heading:t.t("core","Temporary error"),type:"error"}},[t._v("\n\t\t\t"+t._s(t.t("core","Please try again."))+"\n\t\t")]):t._e(),t._v(" "),t.messages.length>0?e("NcNoteCard",t._l(t.messages,(function(n,r){return e("div",{key:r},[t._v("\n\t\t\t\t"+t._s(n)),e("br")])})),0):t._e(),t._v(" "),t.internalException?e("NcNoteCard",{class:t.t("core","An internal error occurred."),attrs:{type:"warning"}},[t._v("\n\t\t\t"+t._s(t.t("core","Please try again or contact your administrator."))+"\n\t\t")]):t._e(),t._v(" "),e("div",{staticClass:"hidden",attrs:{id:"message"}},[e("img",{staticClass:"float-spinner",attrs:{alt:"",src:t.loadingIcon}}),t._v(" "),e("span",{attrs:{id:"messageText"}}),t._v(" "),e("div",{staticStyle:{clear:"both"}})]),t._v(" "),e("h2",{staticClass:"login-form__headline",attrs:{"data-login-form-headline":""}},[t._v("\n\t\t\t"+t._s(t.headlineText)+"\n\t\t")]),t._v(" "),e("NcTextField",{ref:"user",class:{shake:t.invalidPassword},attrs:{id:"user",label:t.loginText,name:"user",maxlength:255,value:t.user,autocapitalize:"none",spellchecking:!1,autocomplete:t.autoCompleteAllowed?"username":"off",required:"",error:t.userNameInputLengthIs255,"helper-text":t.userInputHelperText,"data-login-form-input-user":""},on:{"update:value":function(e){t.user=e},change:t.updateUsername}}),t._v(" "),e("NcPasswordField",{ref:"password",class:{shake:t.invalidPassword},attrs:{id:"password",name:"password",value:t.password,spellchecking:!1,autocapitalize:"none",autocomplete:t.autoCompleteAllowed?"current-password":"off",label:t.t("core","Password"),"helper-text":t.errorLabel,error:t.isError,"data-login-form-input-password":"",required:""},on:{"update:value":function(e){t.password=e}}}),t._v(" "),e("LoginButton",{attrs:{"data-login-form-submit":"",loading:t.loading}}),t._v(" "),t.redirectUrl?e("input",{attrs:{type:"hidden",name:"redirect_url"},domProps:{value:t.redirectUrl}}):t._e(),t._v(" "),e("input",{attrs:{type:"hidden",name:"timezone"},domProps:{value:t.timezone}}),t._v(" "),e("input",{attrs:{type:"hidden",name:"timezone_offset"},domProps:{value:t.timezoneOffset}}),t._v(" "),e("input",{attrs:{type:"hidden",name:"requesttoken"},domProps:{value:t.requestToken}}),t._v(" "),t.directLogin?e("input",{attrs:{type:"hidden",name:"direct",value:"1"}}):t._e()],1)])}),[],!1,null,"f18886ec",null).exports;function Vt(){return Xt.stubThis(void 0!==globalThis?.PublicKeyCredential&&"function"==typeof globalThis.PublicKeyCredential)}const Xt={stubThis:t=>t};class Yt extends Error{constructor({message:t,code:e,cause:n,name:r}){super(t,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=e}}const Kt=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const t=new Error("Cancelling existing WebAuthn API call for new one");t.name="AbortError",this.controller.abort(t)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}};function Wt(t){const e=new Uint8Array(t);let n="";for(const t of e)n+=String.fromCharCode(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Jt(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=(4-e.length%4)%4,r=e.padEnd(e.length+n,"="),i=atob(r),s=new ArrayBuffer(i.length),o=new Uint8Array(s);for(let t=0;tt;function Zt(t){const{id:e}=t;return{...t,id:Jt(e),transports:t.transports}}const te=["cross-platform","platform"];function ee(t){if(t&&!(te.indexOf(t)<0))return t}var ne=i(65043),re=i(35947);const ie=null===(se=(0,h.HW)())?(0,re.YK)().setApp("core").build():(0,re.YK)().setApp("core").setUid(se.uid).build();var se;(0,re.YK)().setApp("unified-search").detectUser().build();class oe extends Error{}const ae={name:"InformationIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},le=(0,Dt.A)(ae,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon information-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,ce={name:"LockOpenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ue={name:"PasswordLessLoginForm",components:{LoginButton:Ut,InformationIcon:le,LockOpenIcon:(0,Dt.A)(ce,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon lock-open-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,NcTextField:wt.A},props:{username:{type:String,default:""},redirectUrl:{type:[String,Boolean],default:!1},autoCompleteAllowed:{type:Boolean,default:!0},isHttps:{type:Boolean,default:!1},isLocalhost:{type:Boolean,default:!1}},setup:()=>({supportsWebauthn:Vt()}),data(){return{user:this.username,loading:!1,validCredentials:!0}},methods:{async authenticate(){if(this.$refs.loginForm.checkValidity()){console.debug("passwordless login initiated");try{const t=await async function(t){const e=(0,m.Jv)("/login/webauthn/start"),{data:n}=await ne.Ay.post(e,{loginName:t});if(!n.allowCredentials||0===n.allowCredentials.length)throw ie.error("No valid credentials returned for webauthn"),new oe;return await async function(t){const{optionsJSON:e,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=t;if(!Vt())throw new Error("WebAuthn is not supported in this browser");let i;0!==e.allowCredentials?.length&&(i=e.allowCredentials?.map(Zt));const s={...e,challenge:Jt(e.challenge),allowCredentials:i},o={};if(n){if(!await function(){if(!Vt())return Qt(new Promise((t=>t(!1))));const t=globalThis.PublicKeyCredential;return Qt(void 0===t?.isConditionalMediationAvailable?new Promise((t=>t(!1))):t.isConditionalMediationAvailable())}())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&r)throw Error('No with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation="conditional",s.allowCredentials=[]}let a;o.publicKey=s,o.signal=Kt.createNewAbortSignal();try{a=await navigator.credentials.get(o)}catch(t){throw function({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if("AbortError"===t.name){if(e.signal instanceof AbortSignal)return new Yt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if("NotAllowedError"===t.name)return new Yt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if("SecurityError"===t.name){const e=globalThis.location.hostname;if("localhost"!==(r=e)&&!/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(r))return new Yt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t});if(n.rpId!==e)return new Yt({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else if("UnknownError"===t.name)return new Yt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}var r;return t}({error:t,options:o})}if(!a)throw new Error("Authentication was not completed");const{id:l,rawId:c,response:u,type:d}=a;let h;return u.userHandle&&(h=Wt(u.userHandle)),{id:l,rawId:Wt(c),response:{authenticatorData:Wt(u.authenticatorData),clientDataJSON:Wt(u.clientDataJSON),signature:Wt(u.signature),userHandle:h},type:d,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:ee(a.authenticatorAttachment)}}(n)}(this.user);await this.completeAuthentication(t)}catch(t){if(t instanceof NoValidCredentials)return void(this.validCredentials=!1);ie.debug(t)}}},changeUsername(t){this.user=t,this.$emit("update:username",this.user)},completeAuthentication(t){const e=this.redirectUrl;return async function(t){const e=(0,m.Jv)("/login/webauthn/finish"),{data:n}=await ne.Ay.post(e,{data:JSON.stringify(t)});return n}(t).then((t=>{let{defaultRedirectUrl:n}=t;console.debug("Logged in redirecting"),window.location.href=e||n})).catch((t=>{console.debug("GOT AN ERROR WHILE SUBMITTING CHALLENGE!"),console.debug(t)}))},submit(){}}};var de=i(87511),he={};he.styleTagTransform=$t(),he.setAttributes=Rt(),he.insert=St().bind(null,"head"),he.domAPI=Pt(),he.insertStyleElement=jt(),Tt()(de.A,he),de.A&&de.A.locals&&de.A.locals;const fe=(0,Dt.A)(ue,(function(){var t=this,e=t._self._c;return(t.isHttps||t.isLocalhost)&&t.supportsWebauthn?e("form",{ref:"loginForm",attrs:{method:"post",name:"login"},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("h2",[t._v(t._s(t.t("core","Log in with a device")))]),t._v(" "),e("fieldset",[e("NcTextField",{attrs:{required:"",value:t.user,autocomplete:t.autoCompleteAllowed?"on":"off",error:!t.validCredentials,label:t.t("core","Login or email"),placeholder:t.t("core","Login or email"),"helper-text":t.validCredentials?"":t.t("core","Your account is not setup for passwordless login.")},on:{"update:value":t.changeUsername}}),t._v(" "),t.validCredentials?e("LoginButton",{attrs:{loading:t.loading},on:{click:t.authenticate}}):t._e()],1)]):t.supportsWebauthn?t.isHttps||t.isLocalhost?t._e():e("div",{staticClass:"update"},[e("LockOpenIcon",{attrs:{size:"70"}}),t._v(" "),e("h2",[t._v(t._s(t.t("core","Your connection is not secure")))]),t._v(" "),e("p",{staticClass:"infogroup"},[t._v("\n\t\t"+t._s(t.t("core","Passwordless authentication is only available over a secure connection."))+"\n\t")])],1):e("div",{staticClass:"update"},[e("InformationIcon",{attrs:{size:"70"}}),t._v(" "),e("h2",[t._v(t._s(t.t("core","Browser not supported")))]),t._v(" "),e("p",{staticClass:"infogroup"},[t._v("\n\t\t"+t._s(t.t("core","Passwordless authentication is not supported in your browser."))+"\n\t")])],1)}),[],!1,null,"4a6bfc86",null).exports,pe={name:"ResetPassword",components:{LoginButton:Ut,NcNoteCard:Et.A,NcTextField:wt.A},mixins:[_t],props:{username:{type:String,required:!0},resetPasswordLink:{type:String,required:!0}},data(){return{error:!1,loading:!1,message:void 0,user:this.username}},watch:{username(t){this.user=t}},methods:{updateUsername(){this.$emit("update:username",this.user)},submit(){this.loading=!0,this.error=!1,this.message="";const t=(0,m.Jv)("/lostpassword/email"),e={user:this.user};return ne.Ay.post(t,e).then((t=>t.data)).then((t=>{if("success"!==t.status)throw new Error(`got status ${t.status}`);this.message="send-success"})).catch((t=>{console.error("could not send reset email request",t),this.error=!0,this.message="send-error"})).then((()=>{this.loading=!1}))}}};var ge=i(92022),me={};me.styleTagTransform=$t(),me.setAttributes=Rt(),me.insert=St().bind(null,"head"),me.domAPI=Pt(),me.insertStyleElement=jt(),Tt()(ge.A,me),ge.A&&ge.A.locals&&ge.A.locals;const ve=(0,Dt.A)(pe,(function(){var t=this,e=t._self._c;return e("form",{staticClass:"login-form",on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("fieldset",{staticClass:"login-form__fieldset"},[e("NcTextField",{attrs:{id:"user",value:t.user,name:"user",maxlength:255,autocapitalize:"off",label:t.t("core","Login or email"),error:t.userNameInputLengthIs255,"helper-text":t.userInputHelperText,required:""},on:{"update:value":function(e){t.user=e},change:t.updateUsername}}),t._v(" "),e("LoginButton",{attrs:{value:t.t("core","Reset password")}}),t._v(" "),"send-success"===t.message?e("NcNoteCard",{attrs:{type:"success"}},[t._v("\n\t\t\t"+t._s(t.t("core","If this account exists, a password reset message has been sent to its email address. If you do not receive it, verify your email address and/or Login, check your spam/junk folders or ask your local administration for help."))+"\n\t\t")]):"send-error"===t.message?e("NcNoteCard",{attrs:{type:"error"}},[t._v("\n\t\t\t"+t._s(t.t("core","Couldn't send reset email. Please contact your administrator."))+"\n\t\t")]):"reset-error"===t.message?e("NcNoteCard",{attrs:{type:"error"}},[t._v("\n\t\t\t"+t._s(t.t("core","Password cannot be changed. Please contact your administrator."))+"\n\t\t")]):t._e(),t._v(" "),e("a",{staticClass:"login-form__link",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.$emit("abort")}}},[t._v("\n\t\t\t"+t._s(t.t("core","Back to login"))+"\n\t\t")])],1)])}),[],!1,null,"586305cf",null).exports,ye={name:"UpdatePassword",components:{LoginButton:Ut},props:{username:{type:String,required:!0},resetPasswordTarget:{type:String,required:!0}},data(){return{error:!1,loading:!1,message:void 0,user:this.username,password:"",encrypted:!1,proceed:!1}},watch:{username(t){this.user=t}},methods:{async submit(){this.loading=!0,this.error=!1,this.message="";try{const{data:t}=await ne.Ay.post(this.resetPasswordTarget,{password:this.password,proceed:this.proceed});if(t&&"success"===t.status)this.message="send-success",this.$emit("update:username",this.user),this.$emit("done");else{if(!t||!t.encryption)throw t&&t.msg?new Error(t.msg):new Error;this.encrypted=!0}}catch(e){this.error=!0,this.message=e.message?e.message:t("core","Password cannot be changed. Please contact your administrator.")}finally{this.loading=!1}}}};var be=i(37861),Ae={};Ae.styleTagTransform=$t(),Ae.setAttributes=Rt(),Ae.insert=St().bind(null,"head"),Ae.domAPI=Pt(),Ae.insertStyleElement=jt(),Tt()(be.A,Ae),be.A&&be.A.locals&&be.A.locals;const we=(0,Dt.A)(ye,(function(){var t=this,e=t._self._c;return e("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("fieldset",[e("p",[e("label",{staticClass:"infield",attrs:{for:"password"}},[t._v(t._s(t.t("core","New password")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.password,expression:"password"}],attrs:{id:"password",type:"password",name:"password",autocomplete:"new-password",autocapitalize:"none",spellcheck:"false",required:"",placeholder:t.t("core","New password")},domProps:{value:t.password},on:{input:function(e){e.target.composing||(t.password=e.target.value)}}})]),t._v(" "),t.encrypted?e("div",{staticClass:"update"},[e("p",[t._v("\n\t\t\t\t"+t._s(t.t("core","Your files are encrypted. There will be no way to get your data back after your password is reset. If you are not sure what to do, please contact your administrator before you continue. Do you really want to continue?"))+"\n\t\t\t")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.proceed,expression:"proceed"}],staticClass:"checkbox",attrs:{id:"encrypted-continue",type:"checkbox"},domProps:{checked:Array.isArray(t.proceed)?t._i(t.proceed,null)>-1:t.proceed},on:{change:function(e){var n=t.proceed,r=e.target,i=!!r.checked;if(Array.isArray(n)){var s=t._i(n,null);r.checked?s<0&&(t.proceed=n.concat([null])):s>-1&&(t.proceed=n.slice(0,s).concat(n.slice(s+1)))}else t.proceed=i}}}),t._v(" "),e("label",{attrs:{for:"encrypted-continue"}},[t._v("\n\t\t\t\t"+t._s(t.t("core","I know what I'm doing"))+"\n\t\t\t")])]):t._e(),t._v(" "),e("LoginButton",{attrs:{loading:t.loading,value:t.t("core","Reset password"),"value-loading":t.t("core","Resetting password")}}),t._v(" "),t.error&&t.message?e("p",{class:{warning:t.error}},[t._v("\n\t\t\t"+t._s(t.message)+"\n\t\t")]):t._e()],1)])}),[],!1,null,"6bdd5975",null).exports,Ee=vt.A.parse(location.search);if("1"===Ee.clear)try{window.localStorage.clear(),window.sessionStorage.clear(),console.debug("Browser storage cleared")}catch(t){console.error("Could not clear browser storage",t)}const _e={name:"Login",components:{LoginForm:qt,PasswordLessLoginForm:fe,ResetPassword:ve,UpdatePassword:we,NcButton:xt.A,NcNoteCard:Et.A},data:()=>({loading:!1,user:(0,mt.C)("core","loginUsername",""),passwordlessLogin:!1,resetPassword:!1,errors:(0,mt.C)("core","loginErrors",[]),messages:(0,mt.C)("core","loginMessages",[]),redirectUrl:(0,mt.C)("core","loginRedirectUrl",!1),throttleDelay:(0,mt.C)("core","loginThrottleDelay",0),canResetPassword:(0,mt.C)("core","loginCanResetPassword",!1),resetPasswordLink:(0,mt.C)("core","loginResetPasswordLink",""),autoCompleteAllowed:(0,mt.C)("core","loginAutocomplete",!0),resetPasswordTarget:(0,mt.C)("core","resetPasswordTarget",""),resetPasswordUser:(0,mt.C)("core","resetPasswordUser",""),directLogin:"1"===Ee.direct,hasPasswordless:(0,mt.C)("core","webauthn-available",!1),countAlternativeLogins:(0,mt.C)("core","countAlternativeLogins",!1),alternativeLogins:(0,mt.C)("core","alternativeLogins",[]),isHttps:"https:"===window.location.protocol,isLocalhost:"localhost"===window.location.hostname,hideLoginForm:(0,mt.C)("core","hideLoginForm",!1),emailStates:(0,mt.C)("core","emailStates",[])}),methods:{passwordResetFinished(){this.resetPasswordTarget="",this.directLogin=!0}}};var xe=i(79327),Ne={};Ne.styleTagTransform=$t(),Ne.setAttributes=Rt(),Ne.insert=St().bind(null,"head"),Ne.domAPI=Pt(),Ne.insertStyleElement=jt(),Tt()(xe.A,Ne),xe.A&&xe.A.locals&&xe.A.locals;const Ce=(0,Dt.A)(_e,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"guest-box login-box"},[!t.hideLoginForm||t.directLogin?[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.passwordlessLogin||t.resetPassword||""!==t.resetPasswordTarget?!t.loading&&t.passwordlessLogin?e("div",{key:"reset-pw-less",staticClass:"login-additional login-passwordless"},[e("PasswordLessLoginForm",{attrs:{username:t.user,"redirect-url":t.redirectUrl,"auto-complete-allowed":t.autoCompleteAllowed,"is-https":t.isHttps,"is-localhost":t.isLocalhost},on:{"update:username":function(e){t.user=e},submit:function(e){t.loading=!0}}}),t._v(" "),e("NcButton",{attrs:{type:"tertiary","aria-label":t.t("core","Back to login form"),wide:!0},on:{click:function(e){t.passwordlessLogin=!1}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("core","Back"))+"\n\t\t\t\t")])],1):!t.loading&&t.canResetPassword?e("div",{key:"reset-can-reset",staticClass:"login-additional"},[e("div",{staticClass:"lost-password-container"},[t.resetPassword?e("ResetPassword",{attrs:{username:t.user,"reset-password-link":t.resetPasswordLink},on:{"update:username":function(e){t.user=e},abort:function(e){t.resetPassword=!1}}}):t._e()],1)]):""!==t.resetPasswordTarget?e("div",[e("UpdatePassword",{attrs:{username:t.user,"reset-password-target":t.resetPasswordTarget},on:{"update:username":function(e){t.user=e},done:t.passwordResetFinished}})],1):t._e():e("div",[e("LoginForm",{attrs:{username:t.user,"redirect-url":t.redirectUrl,"direct-login":t.directLogin,messages:t.messages,errors:t.errors,"throttle-delay":t.throttleDelay,"auto-complete-allowed":t.autoCompleteAllowed,"email-states":t.emailStates},on:{"update:username":function(e){t.user=e},submit:function(e){t.loading=!0}}}),t._v(" "),t.canResetPassword&&""!==t.resetPasswordLink?e("a",{staticClass:"login-box__link",attrs:{id:"lost-password",href:t.resetPasswordLink}},[t._v("\n\t\t\t\t\t"+t._s(t.t("core","Forgot password?"))+"\n\t\t\t\t")]):t.canResetPassword&&!t.resetPassword?e("a",{staticClass:"login-box__link",attrs:{id:"lost-password",href:t.resetPasswordLink},on:{click:function(e){e.preventDefault(),t.resetPassword=!0}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("core","Forgot password?"))+"\n\t\t\t\t")]):t._e(),t._v(" "),t.hasPasswordless?[t.countAlternativeLogins?e("div",{staticClass:"alternative-logins"},[t.hasPasswordless?e("a",{staticClass:"button",class:{"single-alt-login-option":t.countAlternativeLogins},attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.passwordlessLogin=!0}}},[t._v("\n\t\t\t\t\t\t\t"+t._s(t.t("core","Log in with a device"))+"\n\t\t\t\t\t\t")]):t._e()]):e("a",{attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.passwordlessLogin=!0}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("core","Log in with a device"))+"\n\t\t\t\t\t")])]:t._e()],2)])]:[e("transition",{attrs:{name:"fade",mode:"out-in"}},[e("NcNoteCard",{attrs:{type:"info",title:t.t("core","Login form is disabled.")}},[t._v("\n\t\t\t\t"+t._s(t.t("core","The Nextcloud login form is disabled. Use another login option if available or contact your administration."))+"\n\t\t\t")])],1)],t._v(" "),e("div",{staticClass:"alternative-logins",attrs:{id:"alternative-logins"}},t._l(t.alternativeLogins,(function(n,r){return e("NcButton",{key:r,class:[n.class],attrs:{type:"secondary",wide:!0,role:"link",href:n.href}},[t._v("\n\t\t\t"+t._s(n.name)+"\n\t\t")])})),1)],2)}),[],!1,null,null,null).exports,Te={data:()=>({OC:pt}),methods:{t:tt.translate.bind(tt),n:tt.translatePlural.bind(tt)}};s.Ay.mixin(Te),(new(s.Ay.extend(Ce))).$mount("#login")},21391:(t,e,n)=>{var r,i,s;s="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g,r=[n(4523),n(74692),e],i=function(t,e,n){s.Backbone=function(t,e,n,r){var i=t.Backbone,s=Array.prototype.slice;e.VERSION="1.6.0",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var o,a=e.Events={},l=/\s+/,c=function(t,e,r,i,s){var o,a=0;if(r&&"object"==typeof r){void 0!==i&&"context"in s&&void 0===s.context&&(s.context=i);for(o=n.keys(r);athis.length&&(i=this.length),i<0&&(i+=this.length+1);var s,o,a=[],l=[],c=[],u=[],d={},h=e.add,f=e.merge,p=e.remove,g=!1,m=this.comparator&&null==i&&!1!==e.sort,v=n.isString(this.comparator)?this.comparator:null;for(o=0;o0&&!e.silent&&delete e.index,n},_isModel:function(t){return t instanceof v},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes,t.idAttribute);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes,t.idAttribute);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"changeId"===t){var i=this.modelId(e.previousAttributes(),e.idAttribute),s=this.modelId(e.attributes,e.idAttribute);null!=i&&delete this._byId[i],null!=s&&(this._byId[s]=e)}}this.trigger.apply(this,arguments)},_forwardPristineError:function(t,e,n){this.has(t)||this._onModelEvent("error",t,e,n)}});var E="function"==typeof Symbol&&Symbol.iterator;E&&(y.prototype[E]=y.prototype.values);var _=function(t,e){this._collection=t,this._kind=e,this._index=0},x=1,N=2,C=3;E&&(_.prototype[E]=function(){return this}),_.prototype.next=function(){if(this._collection){if(this._index7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(U,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var s=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?s("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?s("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),M.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!this.matchRoot()&&this.notfound();this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return this.matchRoot()?(t=this.fragment=this.getFragment(t),n.some(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0}))||this.notfound()):this.notfound()},notfound:function(){return this.trigger("notfound"),!1},navigate:function(t,e){if(!M.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;this._trailingSlash||""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;t=t.replace(z,"");var i=this.decodeFragment(t);if(this.fragment!==i){if(this.fragment=i,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;e.replace||(s.document.open(),s.document.close()),this._updateHash(s.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new M;v.extend=y.extend=L.extend=T.extend=M.extend=function(t,e){var r,i=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e),r.prototype=n.create(i.prototype,t),r.prototype.constructor=r,r.__super__=i.prototype,r};var H=function(){throw new Error('A "url" property or function must be specified')},G=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e._debug=function(){return{root:t,_:n}},e}(s,n,t,e)}.apply(e,r),void 0===i||(t.exports=i)},39136:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(71354),i=n.n(r),s=n(76314),o=n.n(s)()(i());o.push([t.id,".button-vue[data-v-6acd8f45]{margin-top:.5rem}","",{version:3,sources:["webpack://./core/src/components/login/LoginButton.vue"],names:[],mappings:"AACA,6BACC,gBAAA",sourceRoot:""}]);const a=o},49618:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(71354),i=n.n(r),s=n(76314),o=n.n(s)()(i());o.push([t.id,".login-form[data-v-f18886ec]{text-align:start;font-size:1rem}.login-form__fieldset[data-v-f18886ec]{width:100%;display:flex;flex-direction:column;gap:.5rem}.login-form__headline[data-v-f18886ec]{text-align:center;overflow-wrap:anywhere}","",{version:3,sources:["webpack://./core/src/components/login/LoginForm.vue"],names:[],mappings:"AACA,6BACC,gBAAA,CACA,cAAA,CAEA,uCACC,UAAA,CACA,YAAA,CACA,qBAAA,CACA,SAAA,CAGD,uCACC,iBAAA,CACA,sBAAA",sourceRoot:""}]);const a=o},87511:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(71354),i=n.n(r),s=n(76314),o=n.n(s)()(i());o.push([t.id,"fieldset[data-v-4a6bfc86]{display:flex;flex-direction:column;gap:.5rem}fieldset[data-v-4a6bfc86] label{text-align:initial}.update[data-v-4a6bfc86]{margin:0 auto}","",{version:3,sources:["webpack://./core/src/components/login/PasswordLessLoginForm.vue"],names:[],mappings:"AACA,0BACC,YAAA,CACA,qBAAA,CACA,SAAA,CAEA,gCACC,kBAAA,CAIF,yBACC,aAAA",sourceRoot:""}]);const a=o},92022:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(71354),i=n.n(r),s=n(76314),o=n.n(s)()(i());o.push([t.id,".login-form[data-v-586305cf]{text-align:start;font-size:1rem}.login-form__fieldset[data-v-586305cf]{width:100%;display:flex;flex-direction:column;gap:.5rem}.login-form__link[data-v-586305cf]{display:block;font-weight:normal !important;cursor:pointer;font-size:var(--default-font-size);text-align:center;padding:.5rem 1rem 1rem 1rem}","",{version:3,sources:["webpack://./core/src/components/login/ResetPassword.vue"],names:[],mappings:"AACA,6BACC,gBAAA,CACA,cAAA,CAEA,uCACC,UAAA,CACA,YAAA,CACA,qBAAA,CACA,SAAA,CAGD,mCACC,aAAA,CACA,6BAAA,CACA,cAAA,CACA,kCAAA,CACA,iBAAA,CACA,4BAAA",sourceRoot:""}]);const a=o},79327:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(71354),i=n.n(r),s=n(76314),o=n.n(s)()(i());o.push([t.id,"body{font-size:var(--default-font-size)}.login-box{width:320px;box-sizing:border-box}.login-box__link{display:block;padding:1rem;font-size:var(--default-font-size);text-align:center;font-weight:normal !important}.fade-enter-active,.fade-leave-active{transition:opacity .3s}.fade-enter,.fade-leave-to{opacity:0}.alternative-logins{display:flex;flex-direction:column;gap:.75rem}.alternative-logins .button-vue{box-sizing:border-box}.login-passwordless .button-vue{margin-top:.5rem}","",{version:3,sources:["webpack://./core/src/views/Login.vue"],names:[],mappings:"AACA,KACC,kCAAA,CAGD,WAEC,WAAA,CACA,qBAAA,CAEA,iBACC,aAAA,CACA,YAAA,CACA,kCAAA,CACA,iBAAA,CACA,6BAAA,CAIF,sCACC,sBAAA,CAGD,2BACC,SAAA,CAGD,oBACC,YAAA,CACA,qBAAA,CACA,UAAA,CAEA,gCACC,qBAAA,CAKD,gCACC,gBAAA",sourceRoot:""}]);const a=o},37861:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(71354),i=n.n(r),s=n(76314),o=n.n(s)()(i());o.push([t.id,"\nfieldset[data-v-6bdd5975] {\n\ttext-align: center;\n}\ninput[type=submit][data-v-6bdd5975] {\n\tmargin-top: 20px;\n}\n","",{version:3,sources:["webpack://./core/src/components/login/UpdatePassword.vue"],names:[],mappings:";AA2HA;CACA,kBAAA;AACA;AAEA;CACA,gBAAA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n\n\n