(()=>{"use strict";var e,t,n,r={76907:(e,t,n)=>{var r=n(21777),o=n(85471),l=n(85168),i=n(32981),a=n(53334),c=n(53429),u=n(18740),s=n(2769),p=n(35559),d=n(1522);const m=(0,o.pM)({__name:"PublicPageMenuEntry",props:{clickOnly:{type:Boolean},id:null,label:null,icon:null,href:null,details:null},setup(e){const t=e;return(0,o.sV)((()=>{const e=document.getElementById(`${t.id}--link`);e.role="menuitem",t.clickOnly&&(e.onclick=e=>e.preventDefault())})),{__sfc:!0,props:t,NcListItem:d.A}}});var f=n(85072),b=n.n(f),v=n(97825),g=n.n(v),y=n(77659),A=n.n(y),h=n(55056),_=n.n(h),k=n(10540),C=n.n(k),P=n(41113),x=n.n(P),w=n(35253),M={};M.styleTagTransform=x(),M.setAttributes=_(),M.insert=A().bind(null,"head"),M.domAPI=g(),M.insertStyleElement=C(),b()(w.A,M),w.A&&w.A.locals&&w.A.locals;var E=n(14486);const S=(0,E.A)(m,(function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.NcListItem,{attrs:{"anchor-id":`${e.id}--link`,compact:"",details:e.details,href:e.href,name:e.label,role:"presentation"},on:{click:function(t){return e.$emit("click")}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("div",{class:["icon",e.icon,"public-page-menu-entry__icon"],attrs:{role:"presentation"}})]},proxy:!0}])})}),[],!1,null,"0d5b2ec6",null).exports,N=(0,o.pM)({__name:"PublicPageMenuCustomEntry",props:{id:null,html:null},setup(e){const t=(0,o.KR)(),n=(0,o.KR)("presentation");return(0,o.sV)((()=>{const e=t.value?.querySelector('[role="menuitem"]');if(e)return;const r=t.value?.querySelector("button")??t.value?.querySelector("a");r?r.role="menuitem":n.value="menuitem"})),{__sfc:!0,listItem:t,itemRole:n}}}),I=(0,E.A)(N,(function(){var e=this;return(0,e._self._c)("li",{ref:"listItem",attrs:{role:e._self._setupProxy.itemRole},domProps:{innerHTML:e._s(e.html)}})}),[],!1,null,null,null).exports;var T=n(63814),L=n(82680),O=n(65043),D=n(94219),R=n(84237),$=n(82182),j=n(35947);const B=null===(F=(0,r.HW)())?(0,j.YK)().setApp("core").build():(0,j.YK)().setApp("core").setUid(F.uid).build();var F;(0,j.YK)().setApp("unified-search").detectUser().build();const U=(0,o.pM)({__name:"PublicPageMenuExternalDialog",props:{label:null},setup(e){const t=(0,o.KR)(!1),n=(0,o.KR)(""),r=(0,o.KR)(),i=(0,o.KR)(!0);return(0,o.sV)((()=>(0,o.dY)((()=>r.value.focus())))),(0,o.wB)(n,(()=>{let e="";n.value.includes("@")?n.value.match(/@(.+\..{2,}|localhost)(:\d\d+)?$/)||(e=(0,a.t)("core","Invalid remote URL.")):e=(0,a.t)("core","The remote URL must include the user."),r.value.$el.querySelector("input").setCustomValidity(e),r.value.$el.querySelector("input").reportValidity()})),{__sfc:!0,loading:t,remoteUrl:n,input:r,open:i,createFederatedShare:async function(){t.value=!0;try{const e=(0,T.Jv)("/apps/federatedfilesharing/createFederatedShare"),{data:t}=await O.Ay.post(e,{shareWith:n.value,token:(0,L.G)()});t.remoteUrl.includes("://")?window.location.href=t.remoteUrl:window.location.href=`${window.location.protocol}//${t.remoteUrl}`}catch(e){B.error("Failed to create federated share",{error:e}),(0,l.Qg)((0,a.t)("files_sharing","Failed to add the public link to your Nextcloud"))}finally{t.value=!1}},t:a.t,NcButton:u.A,NcDialog:D.A,NcLoadingIcon:R.A,NcTextField:$.A}}}),q=(0,E.A)(U,(function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.NcDialog,{attrs:{"is-form":"",name:e.label,open:n.open},on:{"update:open":function(e){n.open=e},submit:n.createFederatedShare},scopedSlots:e._u([{key:"actions",fn:function(){return[t(n.NcButton,{attrs:{disabled:n.loading,type:"primary","native-type":"submit"},scopedSlots:e._u([n.loading?{key:"icon",fn:function(){return[t(n.NcLoadingIcon)]},proxy:!0}:null],null,!0)},[e._v("\n\t\t\t"+e._s(n.t("core","Create share"))+"\n\t\t")])]},proxy:!0}])},[t(n.NcTextField,{ref:"input",attrs:{label:n.t("core","Federated user"),placeholder:n.t("core","user@your-nextcloud.org"),required:"",value:n.remoteUrl},on:{"update:value":function(e){n.remoteUrl=e}}})],1)}),[],!1,null,null,null).exports,K=(0,o.pM)({__name:"PublicPageMenuExternalEntry",props:{id:null,label:null,icon:null,href:null},emits:["click"],setup(e,t){let{emit:n}=t;const r=e;return{__sfc:!0,props:r,emit:n,openDialog:function(){(0,l.Ss)(q,{label:r.label}),n("click")},PublicPageMenuEntry:S}}}),G=(0,E.A)(K,(function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.PublicPageMenuEntry,{attrs:{id:e.id,icon:e.icon,href:"#",label:e.label},on:{click:n.openDialog}})}),[],!1,null,null,null).exports,H=(0,o.pM)({__name:"PublicPageMenuLinkEntry",props:{id:null,label:null,icon:null,href:null},emits:["click"],setup(e,t){let{emit:n}=t;const r=e;async function o(){try{await window.navigator.clipboard.writeText(r.href),(0,l.Te)((0,a.t)("core","Direct link copied to clipboard"))}catch{window.prompt((0,a.t)("core","Please copy the link manually:"),r.href)}}return{__sfc:!0,props:r,emit:n,copyLink:o,onClick:function(){o(),n("click")},PublicPageMenuEntry:S}}}),V=(0,E.A)(H,(function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.PublicPageMenuEntry,{attrs:{id:e.id,"click-only":"",icon:e.icon,href:e.href,label:e.label},on:{click:n.onClick}})}),[],!1,null,null,null).exports,Y=(0,o.pM)({__name:"PublicPageMenu",setup(e){const t=(0,i.C)("core","public-page-menu"),n=(0,o.KR)(!1),r=(0,c.F)(),d=(0,o.EW)((()=>r.value?void 0:t[0])),m=(0,o.EW)((()=>r.value?t:t.slice(1)));return{__sfc:!0,menuEntries:t,showMenu:n,isMobile:r,primaryAction:d,secondaryActions:m,getComponent:function(e){if("html"in e)return I;switch(e.id){case"save":return G;case"directLink":return V;default:return S}},openDialogIfNeeded:function(){"save"===d.value?.id&&(0,l.Ss)(q,{label:d.value.label})},t:a.t,NcButton:u.A,NcHeaderMenu:s.A,IconMore:p.A}}});var W=n(64254),z={};z.styleTagTransform=x(),z.setAttributes=_(),z.insert=A().bind(null,"head"),z.domAPI=g(),z.insertStyleElement=C(),b()(W.A,z),W.A&&W.A.locals&&W.A.locals;const X=(0,E.A)(Y,(function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"public-page-menu__wrapper"},[n.primaryAction?t(n.NcButton,{staticClass:"public-page-menu__primary",attrs:{id:"public-page-menu--primary",href:n.primaryAction.href,type:"primary"},on:{click:n.openDialogIfNeeded},scopedSlots:e._u([n.primaryAction.icon?{key:"icon",fn:function(){return[t("div",{class:["icon",n.primaryAction.icon,"public-page-menu__primary-icon"]})]},proxy:!0}:null],null,!0)},[e._v("\n\t\t"+e._s(n.primaryAction.label)+"\n\t")]):e._e(),e._v(" "),n.secondaryActions.length>0?t(n.NcHeaderMenu,{attrs:{id:"public-page-menu","aria-label":n.t("core","More actions"),open:n.showMenu},on:{"update:open":function(e){n.showMenu=e}},scopedSlots:e._u([{key:"trigger",fn:function(){return[t(n.IconMore,{attrs:{size:20}})]},proxy:!0}],null,!1,262033445)},[e._v(" "),t("ul",{staticClass:"public-page-menu",attrs:{"aria-label":n.t("core","More actions"),role:"menu"}},e._l(n.secondaryActions,(function(r,o){return t(n.getComponent(r),e._b({key:o,tag:"component",on:{click:function(e){n.showMenu=!1}}},"component",r,!1))})),1)]):e._e()],1)}),[],!1,null,"432be84e",null).exports;n.nc=(0,r.aV)(),(new(o.Ay.extend(X))).$mount("#public-page-menu")},64254:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(71354),o=n.n(r),l=n(76314),i=n.n(l)()(o());i.push([e.id,".public-page-menu[data-v-432be84e]{box-sizing:border-box}.public-page-menu[data-v-432be84e]> *{box-sizing:border-box}.public-page-menu__wrapper[data-v-432be84e]{display:flex;flex-direction:row;gap:var(--default-grid-baseline)}.public-page-menu__primary[data-v-432be84e]{height:var(--default-clickable-area);margin-block:calc((var(--header-height) - var(--default-clickable-area))/2)}.public-page-menu__primary[data-v-432be84e]:focus-visible{border-color:var(--color-background-plain-text) !important}.public-page-menu__primary-icon[data-v-432be84e]{filter:var(--primary-invert-if-bright)}","",{version:3,sources:["webpack://./core/src/views/PublicPageMenu.vue"],names:[],mappings:"AACA,mCACC,qBAAA,CAEA,sCACC,qBAAA,CAGD,4CACC,YAAA,CACA,kBAAA,CACA,gCAAA,CAGD,4CACC,oCAAA,CACA,2EAAA,CAGA,0DACC,0DAAA,CAIF,iDACC,sCAAA",sourceRoot:""}]);const a=i},35253:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(71354),o=n.n(r),l=n(76314),i=n.n(l)()(o());i.push([e.id,"\n.public-page-menu-entry__icon[data-v-0d5b2ec6] {\n\tpadding-inline-start: var(--default-grid-baseline);\n}\n","",{version:3,sources:["webpack://./core/src/components/PublicPageMenu/PublicPageMenuEntry.vue"],names:[],mappings:";AA6CA;CACA,kDAAA;AACA",sourcesContent:['\x3c!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n --\x3e\n\n\t\n\t\t\n\t\t\t\n\t\t\n\t\n\n\n