core-unified-search.js 54 KB

12
  1. (()=>{"use strict";var e,t={36609:(e,t,i)=>{var n=i(35947),r=i(21777),a=i(53334),s=i(65899),o=i(85471),l=i(61338),c=i(13073),d=i(54332),u=i(55602),h=i(63814),A=i(65043),p=i(96763);async function f(e){let{searchTerm:t}=e;const{data:{contacts:i}}=await A.Ay.post((0,h.Jv)("/contactsmenu/contacts"),{filter:t});if(!t){let e=(0,r.HW)();return e={id:e.uid,fullName:e.displayName,emailAddresses:[]},i.unshift(e),i}return i}const m=(0,s.nY)({id:"search",state:()=>({externalFilters:[]}),actions:{registerExternalFilter(e){let{id:t,appId:i,label:n,callback:r,icon:a}=e;this.externalFilters.push({id:t,appId:i,name:n,callback:r,icon:a,isPluginFilter:!0})}}});var g=i(17334),C=i.n(g);const v=null===(b=(0,r.HW)())?(0,n.YK)().setApp("core").build():(0,n.YK)().setApp("core").setUid(b.uid).build();var b;const y=(0,n.YK)().setApp("unified-search").detectUser().build();var _=i(9191),x=i(72755);const w={name:"CalendarRangeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var k=i(14486);const S=(0,k.A)(w,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon calendar-range-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M9,10H7V12H9V10M13,10H11V12H13V10M17,10H15V12H17V10M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M19,19H5V8H19V19Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,N={name:"DotsHorizontalIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},F=(0,k.A)(N,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon dots-horizontal-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,I={name:"FilterIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},B=(0,k.A)(I,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon filter-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,D={name:"ListBoxIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},L=(0,k.A)(D,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon list-box-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M7 7H9V9H7V7M7 11H9V13H7V11M7 15H9V17H7V15M17 17H11V15H17V17M17 13H11V11H17V13M17 9H11V7H17V9Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var M=i(24764),T=i(89257),E=i(41944),P=i(34196),U=i(66394),R=i(94219),z=i(31126),q=i(71650);const H={name:"CustomDateRangeModal",components:{NcButton:d.A,NcModal:q.A,CalendarRangeIcon:S,NcDateTimePicker:z.A},props:{isOpen:{type:Boolean,required:!0}},data:()=>({dateFilter:{startFrom:null,endAt:null}}),computed:{isModalOpen:{get(){return this.isOpen},set(e){this.$emit("update:is-open",e)}}},methods:{closeModal(){this.isModalOpen=!1},applyCustomRange(){this.$emit("set:custom-date-range",this.dateFilter),this.closeModal()}}};var O=i(85072),V=i.n(O),G=i(97825),$=i.n(G),Q=i(77659),Y=i.n(Q),j=i(55056),K=i.n(j),W=i(10540),J=i.n(W),Z=i(41113),X=i.n(Z),ee=i(69663),te={};te.styleTagTransform=X(),te.setAttributes=K(),te.insert=Y().bind(null,"head"),te.domAPI=$(),te.insertStyleElement=J(),V()(ee.A,te),ee.A&&ee.A.locals&&ee.A.locals;const ie=(0,k.A)(H,(function(){var e=this,t=e._self._c;return e.isModalOpen?t("NcModal",{attrs:{id:"unified-search",name:e.t("core","Custom date range"),show:e.isModalOpen,size:"small","clear-view-delay":0,title:e.t("core","Custom date range")},on:{"update:show":function(t){e.isModalOpen=t},close:e.closeModal}},[t("div",{staticClass:"unified-search-custom-date-modal"},[t("h1",[e._v(e._s(e.t("core","Custom date range")))]),e._v(" "),t("div",{staticClass:"unified-search-custom-date-modal__pickers"},[t("NcDateTimePicker",{attrs:{id:"unifiedsearch-custom-date-range-start",label:e.t("core","Pick start date"),type:"date"},model:{value:e.dateFilter.startFrom,callback:function(t){e.$set(e.dateFilter,"startFrom",t)},expression:"dateFilter.startFrom"}}),e._v(" "),t("NcDateTimePicker",{attrs:{id:"unifiedsearch-custom-date-range-end",label:e.t("core","Pick end date"),type:"date"},model:{value:e.dateFilter.endAt,callback:function(t){e.$set(e.dateFilter,"endAt",t)},expression:"dateFilter.endAt"}})],1),e._v(" "),t("div",{staticClass:"unified-search-custom-date-modal__footer"},[t("NcButton",{on:{click:e.applyCustomRange},scopedSlots:e._u([{key:"icon",fn:function(){return[t("CalendarRangeIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,3084610734)},[e._v("\n\t\t\t\t"+e._s(e.t("core","Search in date range"))+"\n\t\t\t\t")])],1)])]):e._e()}),[],!1,null,"54c43949",null).exports,ne={name:"SearchFilterChip",components:{CloseIcon:i(24325).A},props:{text:{type:String,required:!0},pretext:{type:String,required:!0}},methods:{deleteChip(){this.$emit("delete",this.filter)}}};var re=i(3743),ae={};ae.styleTagTransform=X(),ae.setAttributes=K(),ae.insert=Y().bind(null,"head"),ae.domAPI=$(),ae.insertStyleElement=J(),V()(re.A,ae),re.A&&re.A.locals&&re.A.locals;const se=(0,k.A)(ne,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"chip"},[t("span",{staticClass:"icon"},[e._t("icon"),e._v(" "),e.pretext.length?t("span",[e._v(" "+e._s(e.pretext)+" : ")]):e._e()],2),e._v(" "),t("span",{staticClass:"text"},[e._v(e._s(e.text))]),e._v(" "),t("span",{staticClass:"close-icon",on:{click:e.deleteChip}},[t("CloseIcon",{attrs:{size:18}})],1)])}),[],!1,null,"9a2b627a",null).exports;i(28054);var oe=i(59602),le=i(30567),ce=i(4703),de=i(3771),ue=i(73267),he=i(15683),Ae=i(93806),pe=i(54657),fe=i(80114),me=i(32831),ge=i(98060),Ce=i(36412),ve=i(47611),be=i(10363),ye=i(85794),_e=i(71265),xe=i(20377),we=i(10603),ke=i(80329),Se=i(62720),Ne=i(4747),Fe=i(24551),Ie=i(72076),Be=i(66687),De=i(91774),Le=i(85948),Me=i(89802),Te=i(46503),Ee=i(79935),Pe=i(29723),Ue=i(93355),Re=i(99006),ze=i(34894),qe=i(51218),He=i(25971),Oe=i(28331),Ve=i(33101),Ge=i(11134),$e=i(92433),Qe=i(54028),Ye=i(7271),je=i(17635),Ke=i(68296),We=i(6245),Je=i(78298),Ze=i(49708),Xe=i(94659),et=i(15676),tt=i(201),it=i(2509),nt=i(84237),rt=i(80910),at=i(33809),st=i(28640),ot=i(97595),lt=i(11868),ct=i(23596),dt=i(78914),ut=i(58222),ht=(i(40708),i(41364),i(30600)),At=i(71906),pt=i(12679),ft=i(16160),mt=i(48274),gt=i(97896),Ct=i(8063),vt=i(42740),bt=i(40174),yt=i(47741),_t=i(3507),xt=i(23610),wt=(i(23020),i(53429)),kt=(i(9050),i(69257),i(42892)),St=i(65842),Nt=(i(18300),i(75105),i(92471),i(16406),i(2508));T.A,oe.N,le.A,ce.A,de.N,ue.A,he.A,Ae.A,fe.A,me.A,ge.A,pe.N,Ce.N,ve.A,be.A,ye.N,_e.N,xe.A,we.N,ke.A,Se.A,Ne.N,Fe.N,Ie.N,Be.A,De.N,Le.A,Me.N,Te.A,dt.N,Ee.N,Pe.N,Ue.N,d.A,Re.N,ze.N,qe.N,He.N,Oe.A,Ve.N,Ge.N,$e.N,Qe.A,z.A,Ye.N,je.N,Ke.A,We.N,P.A,Je.A,Ze.N,Xe.N,et.N,U.A,tt.N,it.N,nt.A,ct.N,q.A,rt.A,at.N,st.N,ot.N,lt.N,dt.a,ut.N,pt.N,ht.N,ft.N,mt.N,gt.N,Ct.N,vt.A,At.N,bt.N,yt.N,_t.N,xt.A,Symbol.toStringTag,kt.u,St.u,Nt.yw,Symbol.toStringTag;const Ft={name:"AlertCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},It=(0,k.A)(Ft,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon alert-circle-outline-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,Bt={name:"SearchableList",components:{NcPopover:st.N,NcTextField:At.N,Magnify:u.A,AlertCircleOutline:It,NcAvatar:Ee.N,NcEmptyContent:P.A,NcButton:d.A},props:{labelText:{type:String,default:"this is a label"},searchList:{type:Array,required:!0},emptyContentText:{type:String,required:!0}},data:()=>({opened:!1,error:!1,searchTerm:""}),computed:{filteredList(){return this.searchList.filter((e=>!this.searchTerm.toLowerCase().length||["displayName"].some((t=>e[t].toLowerCase().includes(this.searchTerm.toLowerCase())))))}},methods:{clearSearch(){this.searchTerm=""},itemSelected(e){this.$emit("item-selected",e),this.clearSearch(),this.opened=!1},searchTermChanged(e){this.$emit("search-term-change",e)}}};var Dt=i(51568),Lt={};Lt.styleTagTransform=X(),Lt.setAttributes=K(),Lt.insert=Y().bind(null,"head"),Lt.domAPI=$(),Lt.insertStyleElement=J(),V()(Dt.A,Lt),Dt.A&&Dt.A.locals&&Dt.A.locals;const Mt=(0,k.A)(Bt,(function(){var e=this,t=e._self._c;return t("NcPopover",{attrs:{shown:e.opened},on:{show:function(t){e.opened=!0},hide:function(t){e.opened=!1}},scopedSlots:e._u([{key:"trigger",fn:function(){return[e._t("trigger")]},proxy:!0}],null,!0)},[e._v(" "),t("div",{staticClass:"searchable-list__wrapper"},[t("NcTextField",{attrs:{value:e.searchTerm,label:e.labelText,"trailing-button-icon":"close","show-trailing-button":""!==e.searchTerm},on:{"update:value":[function(t){e.searchTerm=t},e.searchTermChanged],"trailing-button-click":e.clearSearch}},[t("Magnify",{attrs:{size:20}})],1),e._v(" "),e.filteredList.length>0?t("ul",{staticClass:"searchable-list__list"},e._l(e.filteredList,(function(i){return t("li",{key:i.id,attrs:{title:i.displayName,role:"button"}},[t("NcButton",{attrs:{alignment:"start",type:"tertiary",wide:!0},on:{click:function(t){return e.itemSelected(i)}},scopedSlots:e._u([{key:"icon",fn:function(){return[i.isUser?t("NcAvatar",{attrs:{user:i.user,"show-user-status":!1}}):t("NcAvatar",{attrs:{"is-no-user":!0,"display-name":i.displayName,"show-user-status":!1}})]},proxy:!0}],null,!0)},[e._v("\n\t\t\t\t\t"+e._s(i.displayName)+"\n\t\t\t\t")])],1)})),0):t("div",{staticClass:"searchable-list__empty-content"},[t("NcEmptyContent",{attrs:{name:e.emptyContentText},scopedSlots:e._u([{key:"icon",fn:function(){return[t("AlertCircleOutline")]},proxy:!0}])})],1)],1)])}),[],!1,null,"62560aa0",null).exports,Tt={name:"SearchResult",components:{NcListItem:i(1522).A},props:{thumbnailUrl:{type:String,default:null},title:{type:String,required:!0},subline:{type:String,default:null},resourceUrl:{type:String,default:null},icon:{type:String,default:""},rounded:{type:Boolean,default:!1},query:{type:String,default:""},focused:{type:Boolean,default:!1}},data:()=>({thumbnailHasError:!1}),watch:{thumbnailUrl(){this.thumbnailHasError=!1}},methods:{isValidIconOrPreviewUrl:e=>/^https?:\/\//.test(e)||e.startsWith("/"),thumbnailErrorHandler(){this.thumbnailHasError=!0}}};var Et=i(58535),Pt={};Pt.styleTagTransform=X(),Pt.setAttributes=K(),Pt.insert=Y().bind(null,"head"),Pt.domAPI=$(),Pt.insertStyleElement=J(),V()(Et.A,Pt),Et.A&&Et.A.locals&&Et.A.locals;const Ut=(0,k.A)(Tt,(function(){var e=this,t=e._self._c;return t("NcListItem",{staticClass:"result-items__item",attrs:{name:e.title,bold:!1,href:e.resourceUrl,target:"_self"},scopedSlots:e._u([{key:"icon",fn:function(){return[t("div",{staticClass:"result-items__item-icon",class:{"result-items__item-icon--rounded":e.rounded,"result-items__item-icon--no-preview":!e.isValidIconOrPreviewUrl(e.thumbnailUrl),"result-items__item-icon--with-thumbnail":e.isValidIconOrPreviewUrl(e.thumbnailUrl),[e.icon]:!e.isValidIconOrPreviewUrl(e.icon)},style:{backgroundImage:e.isValidIconOrPreviewUrl(e.icon)?`url(${e.icon})`:""},attrs:{"aria-hidden":"true"}},[e.isValidIconOrPreviewUrl(e.thumbnailUrl)&&!e.thumbnailHasError?t("img",{attrs:{src:e.thumbnailUrl},on:{error:e.thumbnailErrorHandler}}):e._e()])]},proxy:!0},{key:"subname",fn:function(){return[e._v("\n\t\t"+e._s(e.subline)+"\n\t")]},proxy:!0}])})}),[],!1,null,"60a5b225",null).exports,Rt=(0,o.pM)({name:"UnifiedSearchModal",components:{IconArrowRight:_.A,IconAccountGroup:x.A,IconCalendarRange:S,IconDotsHorizontal:F,IconFilter:B,IconListBox:L,IconMagnify:u.A,CustomDateRangeModal:ie,FilterChip:se,NcActions:M.A,NcActionButton:T.A,NcAvatar:E.A,NcButton:d.A,NcEmptyContent:P.A,NcDialog:R.A,NcInputField:U.A,SearchableList:Mt,SearchResult:Ut},props:{open:{type:Boolean,required:!0},query:{type:String,default:""},localSearch:{type:Boolean,default:!1}},emits:["update:open","update:query"],setup(){const e=(0,c.ZDG)(),t=m();return{t:a.Tl,currentLocation:e,externalFilters:t.externalFilters}},data(){return{providers:[],providerActionMenuIsOpen:!1,dateActionMenuIsOpen:!1,providerResultLimit:5,dateFilter:{id:"date",type:"date",text:"",startFrom:null,endAt:null},personFilter:{id:"person",type:"person",name:""},dateFilterIsApplied:!1,personFilterIsApplied:!1,filteredProviders:[],searching:!1,searchQuery:"",placessearchTerm:"",dateTimeFilter:null,filters:[],results:[],contacts:[],showDateRangeModal:!1,internalIsVisible:this.open}},computed:{isEmptySearch(){return 0===this.searchQuery.length},hasNoResults(){return!this.isEmptySearch&&0===this.results.length},showEmptyContentInfo(){return this.isEmptySearch||this.hasNoResults},emptyContentMessage(){return this.searching&&this.hasNoResults?(0,a.Tl)("core","Searching …"):this.isEmptySearch?(0,a.Tl)("core","Start typing to search"):(0,a.Tl)("core","No matching results")},userContacts(){return this.contacts},debouncedFind(){return C()(this.find,300)},debouncedFilterContacts(){return C()(this.filterContacts,300)}},watch:{open(){this.open&&this.searchQuery&&this.find(this.searchQuery)},query:{immediate:!0,handler(){this.searchQuery=this.query.trim()}}},mounted(){(0,l.B1)("nextcloud:unified-search:add-filter",this.handlePluginFilter),async function(){try{const{data:e}=await A.Ay.get((0,h.KT)("search/providers"),{params:{from:window.location.pathname.replace("/index.php","")+window.location.search}});if("ocs"in e&&"data"in e.ocs&&Array.isArray(e.ocs.data)&&e.ocs.data.length>0)return e.ocs.data}catch(e){p.error(e)}return[]}().then((e=>{this.providers=e,this.externalFilters.forEach((e=>{this.providers.push(e)})),this.providers=this.groupProvidersByApp(this.providers),y.debug("Search providers",{providers:this.providers})})),f({searchTerm:""}).then((e=>{this.contacts=this.mapContacts(e),y.debug("Contacts",{contacts:this.contacts})}))},methods:{onUpdateOpen(e){e||(this.$emit("update:open",!1),this.$emit("update:query",""))},searchLocally(){this.$emit("update:query",this.searchQuery),this.$emit("update:open",!1)},find(e){if(0===e.length)return this.results=[],void(this.searching=!1);this.searching=!0;const t=[],i=this.filteredProviders.length>0?this.filteredProviders:this.providers,n=(i,n)=>{const r={type:i.id,query:e,cursor:null,extraQueries:i.extraParams};if(n.dateFilterIsApplied){if(!i.filters?.since||!i.filters?.until)return;r.since=this.dateFilter.startFrom,r.until=this.dateFilter.endAt}if(n.personFilterIsApplied){if(!i.filters?.person)return;r.person=this.personFilter.user}this.providerResultLimit>5&&(r.limit=this.providerResultLimit),(0,function(e){let{type:t,query:i,cursor:n,since:r,until:a,limit:s,person:o,extraQueries:l={}}=e;const c=A.Ay.CancelToken.source();return{request:async()=>A.Ay.get((0,h.KT)("search/providers/{type}/search",{type:t}),{cancelToken:c.token,params:{term:i,cursor:n,since:r,until:a,limit:s,person:o,from:window.location.pathname.replace("/index.php","")+window.location.search,...l}}),cancel:c.cancel}}(r).request)().then((e=>{t.push({id:i.id,provider:i.name,inAppSearch:i.inAppSearch,results:e.data.ocs.data.entries}),y.debug("Unified search results:",{results:this.results,newResults:t}),this.updateResults(t),this.searching=!1}))};i.forEach((e=>{const t=this.dateFilterIsApplied,i=this.personFilterIsApplied;n(e,{dateFilterIsApplied:t,personFilterIsApplied:i})}))},updateResults(e){let t=[...this.results];this.filters.length>0&&(t=t.filter((e=>this.filters.some((t=>t.id===e.id))))),e.forEach((e=>{const i=t.findIndex((t=>t.id===e.id));-1!==i?0===e.results.length?t.splice(i,1):t.splice(i,1,e):e.results.length>0&&t.push(e)}));const i=t.slice(0);i.sort(((e,t)=>{const i=this.providers.find((t=>t.id===e.id)),n=this.providers.find((e=>e.id===t.id));return(i?i.order:0)-(n?n.order:0)})),this.results=i},mapContacts:e=>e.map((e=>({displayName:e.fullName,isNoUser:!1,subname:e.emailAddresses[0]?e.emailAddresses[0]:"",icon:"",user:e.id,isUser:e.isUser}))),filterContacts(e){f({searchTerm:e}).then((t=>{this.contacts=this.mapContacts(t),y.debug(`Contacts filtered by ${e}`,{contacts:this.contacts})}))},applyPersonFilter(e){this.personFilterIsApplied=!0;const t=this.filters.findIndex((t=>t.id===e.id));-1===t?(this.personFilter.id=e.id,this.personFilter.user=e.user,this.personFilter.name=e.displayName,this.filters.push(this.personFilter)):(this.filters[t].id=e.id,this.filters[t].user=e.user,this.filters[t].name=e.displayName),this.debouncedFind(this.searchQuery),y.debug("Person filter applied",{person:e})},loadMoreResultsForProvider(e){this.providerResultLimit+=5,this.filters=this.filters.filter((e=>"provider"!==e.type));const t=this.providers.find((t=>t.id===e));this.addProviderFilter(t,!0)},addProviderFilter(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.id)return;e.isPluginFilter&&e.callback(),this.providerResultLimit=t?this.providerResultLimit:5,this.providerActionMenuIsOpen=!1;const i=this.filteredProviders.findIndex((t=>t.id===e.id));i>-1&&(this.filteredProviders.splice(i,1),this.filters=this.syncProviderFilters(this.filters,this.filteredProviders)),this.filteredProviders.push({id:e.id,name:e.name,icon:e.icon,type:e.type||"provider",filters:e.filters,isPluginFilter:e.isPluginFilter||!1}),this.filters=this.syncProviderFilters(this.filters,this.filteredProviders),y.debug("Search filters (newly added)",{filters:this.filters}),this.debouncedFind(this.searchQuery)},removeFilter(e){if("provider"===e.type){for(let t=0;t<this.filteredProviders.length;t++)if(this.filteredProviders[t].id===e.id){this.filteredProviders.splice(t,1);break}this.filters=this.syncProviderFilters(this.filters,this.filteredProviders),y.debug("Search filters (recently removed)",{filters:this.filters})}else for(let t=0;t<this.filters.length;t++)if("date"===this.filters[t].id||this.filters[t].id===e.id){this.dateFilterIsApplied=!1,this.filters.splice(t,1),"person"===e.type&&(this.personFilterIsApplied=!1);break}this.debouncedFind(this.searchQuery)},syncProviderFilters(e,t){const i=e.slice();return i.forEach(((e,n)=>{const r=e.id;"provider"===e.type&&(t.some((e=>e.id===r))||i.splice(n,1))})),t.forEach((e=>{const t=e.id;"provider"===e.type&&(i.some((e=>e.id===t))||i.push(e))})),i},updateDateFilter(){const e=this.filters.findIndex((e=>"date"===e.id));-1!==e?this.filters[e]=this.dateFilter:this.filters.push(this.dateFilter),this.dateFilterIsApplied=!0,this.debouncedFind(this.searchQuery)},applyQuickDateRange(e){this.dateActionMenuIsOpen=!1;const t=new Date;let i,n;switch(e){case"today":i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59,999),this.dateFilter.text=(0,a.Tl)("core","Today");break;case"7days":i=new Date(t.getFullYear(),t.getMonth(),t.getDate()-6,0,0,0,0),this.dateFilter.text=(0,a.Tl)("core","Last 7 days");break;case"30days":i=new Date(t.getFullYear(),t.getMonth(),t.getDate()-29,0,0,0,0),this.dateFilter.text=(0,a.Tl)("core","Last 30 days");break;case"thisyear":i=new Date(t.getFullYear(),0,1,0,0,0,0),n=new Date(t.getFullYear(),11,31,23,59,59,999),this.dateFilter.text=(0,a.Tl)("core","This year");break;case"lastyear":i=new Date(t.getFullYear()-1,0,1,0,0,0,0),n=new Date(t.getFullYear()-1,11,31,23,59,59,999),this.dateFilter.text=(0,a.Tl)("core","Last year");break;case"custom":return void(this.showDateRangeModal=!0);default:return}this.dateFilter.startFrom=i,this.dateFilter.endAt=n,this.updateDateFilter()},setCustomDateRange(e){y.debug("Custom date range",{range:e}),this.dateFilter.startFrom=e.startFrom,this.dateFilter.endAt=e.endAt,this.dateFilter.text=(0,a.Tl)("core",`Between ${this.dateFilter.startFrom.toLocaleDateString()} and ${this.dateFilter.endAt.toLocaleDateString()}`),this.updateDateFilter()},handlePluginFilter(e){for(let t=0;t<this.filteredProviders.length;t++){const i=this.filteredProviders[t];if(i.id===e.id){i.name=e.filterUpdateText;const n=this.providers.findIndex((t=>t.id===e.id));n>-1&&(i.extraParams=e.filterParams,this.filteredProviders[t]=i);break}}this.debouncedFind(this.searchQuery)},groupProvidersByApp(e){const t={};e.forEach((e=>{const i=e.appId?e.appId:"general";t[i]||(t[i]=[]),t[i].push(e)}));const i=[];return Object.values(t).forEach((e=>{i.push(...e)})),i}}});var zt=i(53085),qt={};qt.styleTagTransform=X(),qt.setAttributes=K(),qt.insert=Y().bind(null,"head"),qt.domAPI=$(),qt.insertStyleElement=J(),V()(zt.A,qt),zt.A&&zt.A.locals&&zt.A.locals;const Ht=(0,k.A)(Rt,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("NcDialog",{ref:"unifiedSearchModal",attrs:{id:"unified-search","content-classes":"unified-search-modal__content","dialog-classes":"unified-search-modal",name:e.t("core","Unified search"),open:e.open},on:{"update:open":e.onUpdateOpen}},[t("CustomDateRangeModal",{staticClass:"unified-search__date-range",attrs:{"is-open":e.showDateRangeModal},on:{"set:custom-date-range":e.setCustomDateRange,"update:is-open":function(t){e.showDateRangeModal=t}}}),e._v(" "),t("div",{staticClass:"unified-search-modal__header"},[t("NcInputField",{ref:"searchInput",attrs:{"data-cy-unified-search-input":"",value:e.searchQuery,type:"text",label:e.t("core","Search apps, files, tags, messages")+"..."},on:{"update:value":[function(t){e.searchQuery=t},e.debouncedFind]}}),e._v(" "),t("div",{staticClass:"unified-search-modal__filters",attrs:{"data-cy-unified-search-filters":""}},[t("NcActions",{attrs:{"menu-name":e.t("core","Places"),open:e.providerActionMenuIsOpen,"data-cy-unified-search-filter":"places"},on:{"update:open":function(t){e.providerActionMenuIsOpen=t}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconListBox",{attrs:{size:20}})]},proxy:!0}])},[e._v(" "),e._l(e.providers,(function(i){return t("NcActionButton",{key:`${i.id}-${i.name.replace(/\s/g,"")}`,on:{click:function(t){return e.addProviderFilter(i)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("img",{staticClass:"filter-button__icon",attrs:{src:i.icon,alt:""}})]},proxy:!0}],null,!0)},[e._v("\n\t\t\t\t\t"+e._s(i.name)+"\n\t\t\t\t")])}))],2),e._v(" "),t("NcActions",{attrs:{"menu-name":e.t("core","Date"),open:e.dateActionMenuIsOpen,"data-cy-unified-search-filter":"date"},on:{"update:open":function(t){e.dateActionMenuIsOpen=t}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconCalendarRange",{attrs:{size:20}})]},proxy:!0}])},[e._v(" "),t("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(t){return e.applyQuickDateRange("today")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("core","Today"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(t){return e.applyQuickDateRange("7days")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("core","Last 7 days"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(t){return e.applyQuickDateRange("30days")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("core","Last 30 days"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(t){return e.applyQuickDateRange("thisyear")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("core","This year"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(t){return e.applyQuickDateRange("lastyear")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("core","Last year"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(t){return e.applyQuickDateRange("custom")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("core","Custom date range"))+"\n\t\t\t\t")])],1),e._v(" "),t("SearchableList",{attrs:{"label-text":e.t("core","Search people"),"search-list":e.userContacts,"empty-content-text":e.t("core","Not found"),"data-cy-unified-search-filter":"people"},on:{"search-term-change":e.debouncedFilterContacts,"item-selected":e.applyPersonFilter},scopedSlots:e._u([{key:"trigger",fn:function(){return[t("NcButton",{scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconAccountGroup",{attrs:{size:20}})]},proxy:!0}])},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("core","People"))+"\n\t\t\t\t\t")])]},proxy:!0}])}),e._v(" "),e.localSearch?t("NcButton",{attrs:{"data-cy-unified-search-filter":"current-view"},on:{click:e.searchLocally},scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconFilter",{attrs:{size:20}})]},proxy:!0}],null,!1,4275912387)},[e._v("\n\t\t\t\t"+e._s(e.t("core","Filter in current view"))+"\n\t\t\t\t")]):e._e()],1),e._v(" "),t("div",{staticClass:"unified-search-modal__filters-applied"},e._l(e.filters,(function(i){return t("FilterChip",{key:i.id,attrs:{text:i.name??i.text,pretext:""},on:{delete:function(t){return e.removeFilter(i)}},scopedSlots:e._u([{key:"icon",fn:function(){return["person"===i.type?t("NcAvatar",{attrs:{user:i.user,size:24,"disable-menu":!0,"show-user-status":!1,"hide-favorite":!1}}):"date"===i.type?t("IconCalendarRange"):t("img",{attrs:{src:i.icon,alt:""}})]},proxy:!0}],null,!0)})})),1)],1),e._v(" "),e.showEmptyContentInfo?t("div",{staticClass:"unified-search-modal__no-content"},[t("NcEmptyContent",{attrs:{name:e.emptyContentMessage},scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconMagnify",{attrs:{size:64}})]},proxy:!0}],null,!1,125778896)})],1):t("div",{staticClass:"unified-search-modal__results"},[t("h3",{staticClass:"hidden-visually"},[e._v("\n\t\t\t"+e._s(e.t("core","Results"))+"\n\t\t")]),e._v(" "),e._l(e.results,(function(i){return t("div",{key:i.id,staticClass:"result"},[t("h4",{staticClass:"result-title",attrs:{id:`unified-search-result-${i.id}`}},[e._v("\n\t\t\t\t"+e._s(i.provider)+"\n\t\t\t")]),e._v(" "),t("ul",{staticClass:"result-items",attrs:{"aria-labelledby":`unified-search-result-${i.id}`}},e._l(i.results,(function(i,n){return t("SearchResult",e._b({key:n},"SearchResult",i,!1))})),1),e._v(" "),t("div",{staticClass:"result-footer"},[t("NcButton",{attrs:{type:"tertiary-no-background"},on:{click:function(t){return e.loadMoreResultsForProvider(i.id)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconDotsHorizontal",{attrs:{size:20}})]},proxy:!0}],null,!0)},[e._v("\n\t\t\t\t\t"+e._s(e.t("core","Load more results"))+"\n\t\t\t\t\t")]),e._v(" "),i.inAppSearch?t("NcButton",{attrs:{alignment:"end-reverse",type:"tertiary-no-background"},scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconArrowRight",{attrs:{size:20}})]},proxy:!0}],null,!0)},[e._v("\n\t\t\t\t\t"+e._s(e.t("core","Search in"))+" "+e._s(i.provider)+"\n\t\t\t\t\t")]):e._e()],1)])}))],2)],1)}),[],!1,null,"67c4f290",null).exports;var Ot=i(6695);const Vt=(0,o.pM)({__name:"UnifiedSearchLocalSearchBar",props:{query:null,open:{type:Boolean}},emits:["update:open","update:query","global-search"],setup(e,t){let{emit:i}=t;const n=e;(0,o.$9)(((e,t)=>({"79f1a635":t.searchGlobalButtonCSSWidth,"0f1e1e54":t.searchGlobalButtonWidth})));const r=(0,o.KR)();(0,o.nT)((()=>{n.open&&r.value&&r.value.focus()}));const s=(0,wt.al)(),l=(0,o.KR)(),{width:u}=(0,c.Lhy)(l),h=(0,o.EW)((()=>u.value?`${u.value}px`:"var(--default-clickable-area)"));return{__sfc:!0,props:n,emit:i,searchInput:r,isMobile:s,searchGlobalButton:l,searchGlobalButtonWidth:u,searchGlobalButtonCSSWidth:h,clearAndCloseSearch:function(){i("update:query",""),i("update:open",!1)},mdiCloudSearch:"M21.86 12.5C21.1 11.63 20.15 11.13 19 11C19 9.05 18.32 7.4 16.96 6.04C15.6 4.68 13.95 4 12 4C10.42 4 9 4.47 7.75 5.43S5.67 7.62 5.25 9.15C4 9.43 2.96 10.08 2.17 11.1S1 13.28 1 14.58C1 16.09 1.54 17.38 2.61 18.43C3.69 19.5 5 20 6.5 20H18.5C19.75 20 20.81 19.56 21.69 18.69C22.56 17.81 23 16.75 23 15.5C23 14.35 22.62 13.35 21.86 12.5M16.57 18L14 15.43C13.43 15.79 12.74 16 12 16C9.79 16 8 14.21 8 12S9.79 8 12 8 16 9.79 16 12C16 12.74 15.79 13.43 15.43 14L18 16.57L16.57 18M14 12C14 13.11 13.11 14 12 14S10 13.11 10 12 10.9 10 12 10 14 10.9 14 12Z",mdiClose:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",t:a.Tl,NcButton:d.A,NcIconSvgWrapper:Ot.A,NcInputField:U.A}}});var Gt=i(93118),$t={};$t.styleTagTransform=X(),$t.setAttributes=K(),$t.insert=Y().bind(null,"head"),$t.domAPI=$(),$t.insertStyleElement=J(),V()(Gt.A,$t),Gt.A&&Gt.A.locals&&Gt.A.locals;const Qt=(0,k.A)(Vt,(function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("Transition",[e.open?t("div",{staticClass:"local-unified-search animated-width",class:{"local-unified-search--open":e.open}},[t(i.NcInputField,{ref:"searchInput",staticClass:"local-unified-search__input animated-width",attrs:{"aria-label":i.t("core","Search in current app"),placeholder:i.t("core","Search in current app"),"show-trailing-button":"","trailing-button-label":i.t("core","Clear search"),value:e.query},on:{"update:value":function(t){return e.$emit("update:query",t)},"trailing-button-click":i.clearAndCloseSearch},scopedSlots:e._u([{key:"trailing-button-icon",fn:function(){return[t(i.NcIconSvgWrapper,{attrs:{path:i.mdiClose}})]},proxy:!0}],null,!1,3585538455)}),e._v(" "),t(i.NcButton,{ref:"searchGlobalButton",staticClass:"local-unified-search__global-search",attrs:{"aria-label":i.t("core","Search everywhere"),title:i.t("core","Search everywhere"),type:"tertiary-no-background"},on:{click:function(t){return e.$emit("global-search")}},scopedSlots:e._u([i.isMobile?null:{key:"default",fn:function(){return[e._v("\n\t\t\t\t"+e._s(i.t("core","Search everywhere"))+"\n\t\t\t")]},proxy:!0},{key:"icon",fn:function(){return[t(i.NcIconSvgWrapper,{attrs:{path:i.mdiCloudSearch}})]},proxy:!0}],null,!0)})],1):e._e()])}),[],!1,null,"199a6c24",null).exports,Yt=(0,o.pM)({name:"UnifiedSearch",components:{NcButton:d.A,Magnify:u.A,UnifiedSearchModal:Ht,UnifiedSearchLocalSearchBar:Qt},setup:()=>({currentLocation:(0,c.ZDG)(),t:a.Tl}),data:()=>({queryText:"",showUnifiedSearch:!1,showLocalSearch:!1}),computed:{debouncedQueryUpdate(){return C()(this.emitUpdatedQuery,250)},supportsLocalSearch(){return["/settings/users","/apps/deck","/settings/apps"].some((e=>this.currentLocation.pathname?.includes?.(e)))}},watch:{queryText(){this.debouncedQueryUpdate()}},mounted(){window.addEventListener("keydown",this.onKeyDown),(0,l.B1)("nextcloud:unified-search:reset",(()=>{this.showLocalSearch=!1,this.queryText=""})),(0,l.B1)("nextcloud:unified-search:reset",(()=>{(0,l.Ic)("nextcloud:unified-search.reset",{query:""})})),(0,l.B1)("nextcloud:unified-search:search",(e=>{let{query:t}=e;(0,l.Ic)("nextcloud:unified-search.search",{query:t})})),v.debug("Unified search initialized!")},beforeDestroy(){window.removeEventListener("keydown",this.onKeyDown)},methods:{onKeyDown(e){e.ctrlKey&&"KeyF"===e.code&&(this.showLocalSearch||this.showUnifiedSearch||(this.toggleUnifiedSearch(),e.preventDefault()))},toggleUnifiedSearch(){this.supportsLocalSearch?this.showLocalSearch=!0:this.openModal()},openModal(){this.showUnifiedSearch=!0,this.showLocalSearch=!1},emitUpdatedQuery(){""===this.queryText?(0,l.Ic)("nextcloud:unified-search:reset"):(0,l.Ic)("nextcloud:unified-search:search",{query:this.queryText})}}});var jt=i(81813),Kt={};Kt.styleTagTransform=X(),Kt.setAttributes=K(),Kt.insert=Y().bind(null,"head"),Kt.domAPI=$(),Kt.insertStyleElement=J(),V()(jt.A,Kt),jt.A&&jt.A.locals&&jt.A.locals;const Wt=(0,k.A)(Yt,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"header-menu unified-search-menu"},[t("NcButton",{directives:[{name:"show",rawName:"v-show",value:!e.showLocalSearch,expression:"!showLocalSearch"}],staticClass:"header-menu__trigger",attrs:{"aria-label":e.t("core","Unified search"),type:"tertiary-no-background"},on:{click:e.toggleUnifiedSearch},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Magnify",{staticClass:"header-menu__trigger-icon",attrs:{size:20}})]},proxy:!0}])}),e._v(" "),e.supportsLocalSearch?t("UnifiedSearchLocalSearchBar",{attrs:{open:e.showLocalSearch,query:e.queryText},on:{"update:open":function(t){e.showLocalSearch=t},"update:query":function(t){e.queryText=t},"global-search":e.openModal}}):e._e(),e._v(" "),t("UnifiedSearchModal",{attrs:{"local-search":e.supportsLocalSearch,query:e.queryText,open:e.showUnifiedSearch},on:{"update:query":function(t){e.queryText=t},"update:open":function(t){e.showUnifiedSearch=t}}})],1)}),[],!1,null,"97afc5f6",null).exports;i.nc=(0,r.aV)();const Jt=(0,n.YK)().setApp("unified-search").detectUser().build();o.Ay.mixin({data:()=>({logger:Jt}),methods:{t:a.Tl,n:a.zw}}),window.OCA=window.OCA||{},window.OCA.UnifiedSearch={registerFilterAction:e=>{let{id:t,appId:i,label:n,callback:r,icon:a}=e;m().registerExternalFilter({id:t,appId:i,label:n,callback:r,icon:a})}},o.Ay.use(s.R2);const Zt=(0,s.Ey)();new o.Ay({el:"#unified-search",pinia:Zt,name:"UnifiedSearchRoot",render:e=>e(Wt)})},69663:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(71354),r=i.n(n),a=i(76314),s=i.n(a)()(r());s.push([e.id,".unified-search-custom-date-modal[data-v-54c43949]{padding:10px 20px 10px 20px}.unified-search-custom-date-modal h1[data-v-54c43949]{font-size:16px;font-weight:bolder;line-height:2em}.unified-search-custom-date-modal__pickers[data-v-54c43949]{display:flex;flex-direction:column}.unified-search-custom-date-modal__footer[data-v-54c43949]{display:flex;justify-content:end}","",{version:3,sources:["webpack://./core/src/components/UnifiedSearch/CustomDateRangeModal.vue"],names:[],mappings:"AACA,mDACC,2BAAA,CAEA,sDACC,cAAA,CACA,kBAAA,CACA,eAAA,CAGD,4DACC,YAAA,CACA,qBAAA,CAGD,2DACC,YAAA,CACA,mBAAA",sourcesContent:["\n.unified-search-custom-date-modal {\n\tpadding: 10px 20px 10px 20px;\n\n\th1 {\n\t\tfont-size: 16px;\n\t\tfont-weight: bolder;\n\t\tline-height: 2em;\n\t}\n\n\t&__pickers {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t&__footer {\n\t\tdisplay: flex;\n\t\tjustify-content: end;\n\t}\n\n}\n"],sourceRoot:""}]);const o=s},3743:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(71354),r=i.n(n),a=i(76314),s=i.n(a)()(r());s.push([e.id,".chip[data-v-9a2b627a]{display:flex;align-items:center;padding:2px 4px;border:1px solid var(--color-primary-element-light);border-radius:20px;background-color:var(--color-primary-element-light);margin:2px}.chip .icon[data-v-9a2b627a]{display:flex;align-items:center;padding-right:5px}.chip .icon img[data-v-9a2b627a]{width:20px;padding:2px;border-radius:20px;filter:var(--background-invert-if-bright)}.chip .text[data-v-9a2b627a]{margin:0 2px}.chip .close-icon[data-v-9a2b627a]{cursor:pointer}.chip .close-icon[data-v-9a2b627a] :hover{filter:invert(20%)}","",{version:3,sources:["webpack://./core/src/components/UnifiedSearch/SearchFilterChip.vue"],names:[],mappings:"AACA,uBACI,YAAA,CACA,kBAAA,CACA,eAAA,CACA,mDAAA,CACA,kBAAA,CACA,mDAAA,CACA,UAAA,CAEA,6BACI,YAAA,CACA,kBAAA,CACA,iBAAA,CAEA,iCACI,UAAA,CACA,WAAA,CACA,kBAAA,CACA,yCAAA,CAIR,6BACI,YAAA,CAGJ,mCACI,cAAA,CAEA,0CACI,kBAAA",sourcesContent:["\n.chip {\n display: flex;\n align-items: center;\n padding: 2px 4px;\n border: 1px solid var(--color-primary-element-light);\n border-radius: 20px;\n background-color: var(--color-primary-element-light);\n margin: 2px;\n\n .icon {\n display: flex;\n align-items: center;\n padding-right: 5px;\n\n img {\n width: 20px;\n padding: 2px;\n border-radius: 20px;\n filter: var(--background-invert-if-bright);\n }\n }\n\n .text {\n margin: 0 2px;\n }\n\n .close-icon {\n cursor: pointer ;\n\n :hover {\n filter: invert(20%);\n }\n }\n}\n"],sourceRoot:""}]);const o=s},58535:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(71354),r=i.n(n),a=i(76314),s=i.n(a)()(r());s.push([e.id,".result-items__item[data-v-60a5b225] a{border-radius:12px;border:2px solid rgba(0,0,0,0);border-radius:var(--border-radius-large) !important}.result-items__item[data-v-60a5b225] a--focused{background-color:var(--color-background-hover)}.result-items__item[data-v-60a5b225] a:active,.result-items__item[data-v-60a5b225] a:hover,.result-items__item[data-v-60a5b225] a:focus{background-color:var(--color-background-hover);border:2px solid var(--color-border-maxcontrast)}.result-items__item[data-v-60a5b225] a *{cursor:pointer}.result-items__item-icon[data-v-60a5b225]{overflow:hidden;width:44px;height:44px;border-radius:var(--border-radius);background-repeat:no-repeat;background-position:center center;background-size:32px}.result-items__item-icon--rounded[data-v-60a5b225]{border-radius:22px}.result-items__item-icon--no-preview[data-v-60a5b225]{background-size:32px}.result-items__item-icon--with-thumbnail[data-v-60a5b225]{background-size:cover}.result-items__item-icon--with-thumbnail[data-v-60a5b225]:not(.result-items__item-icon--rounded){max-width:42px;max-height:42px;border:1px solid var(--color-border)}.result-items__item-icon img[data-v-60a5b225]{width:100%;height:100%;object-fit:cover;object-position:center}","",{version:3,sources:["webpack://./core/src/components/UnifiedSearch/SearchResult.vue"],names:[],mappings:"AAQI,uCACQ,kBAAA,CACA,8BAAA,CACA,mDAAA,CAEA,gDACI,8CAAA,CAGJ,wIAGI,8CAAA,CACA,gDAAA,CAGJ,yCACI,cAAA,CAKR,0CACI,eAAA,CACA,UA9BK,CA+BL,WA/BK,CAgCL,kCAAA,CACA,2BAAA,CACA,iCAAA,CACA,oBAAA,CAEA,mDACI,kBAAA,CAGJ,sDACI,oBAAA,CAGJ,0DACI,qBAAA,CAGJ,iGAEI,cAAA,CACA,eAAA,CACA,oCAAA,CAGJ,8CAEI,UAAA,CACA,WAAA,CAEA,gBAAA,CACA,sBAAA",sourcesContent:['\n@use "sass:math";\n$clickable-area: 44px;\n$margin: 10px;\n\n.result-items {\n &__item {\n\n ::v-deep a {\n border-radius: 12px;\n border: 2px solid transparent;\n border-radius: var(--border-radius-large) !important;\n\n &--focused {\n background-color: var(--color-background-hover);\n }\n\n &:active,\n &:hover,\n &:focus {\n background-color: var(--color-background-hover);\n border: 2px solid var(--color-border-maxcontrast);\n }\n\n * {\n cursor: pointer;\n }\n\n }\n\n &-icon {\n overflow: hidden;\n width: $clickable-area;\n height: $clickable-area;\n border-radius: var(--border-radius);\n background-repeat: no-repeat;\n background-position: center center;\n background-size: 32px;\n\n &--rounded {\n border-radius: math.div($clickable-area, 2);\n }\n\n &--no-preview {\n background-size: 32px;\n }\n\n &--with-thumbnail {\n background-size: cover;\n }\n\n &--with-thumbnail:not(&--rounded) {\n // compensate for border\n max-width: $clickable-area - 2px;\n max-height: $clickable-area - 2px;\n border: 1px solid var(--color-border);\n }\n\n img {\n // Make sure to keep ratio\n width: 100%;\n height: 100%;\n\n object-fit: cover;\n object-position: center;\n }\n }\n\n }\n}\n'],sourceRoot:""}]);const o=s},51568:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(71354),r=i.n(n),a=i(76314),s=i.n(a)()(r());s.push([e.id,".searchable-list__wrapper[data-v-62560aa0]{padding:calc(var(--default-grid-baseline)*3);display:flex;flex-direction:column;align-items:center;width:250px}.searchable-list__list[data-v-62560aa0]{width:100%;max-height:284px;overflow-y:auto;margin-top:var(--default-grid-baseline);padding:var(--default-grid-baseline)}.searchable-list__list[data-v-62560aa0] .button-vue{border-radius:var(--border-radius-large) !important}.searchable-list__list[data-v-62560aa0] .button-vue span{font-weight:initial}.searchable-list__empty-content[data-v-62560aa0]{margin-top:calc(var(--default-grid-baseline)*3)}","",{version:3,sources:["webpack://./core/src/components/UnifiedSearch/SearchableList.vue"],names:[],mappings:"AAEC,2CACC,4CAAA,CACA,YAAA,CACA,qBAAA,CACA,kBAAA,CACA,WAAA,CAGD,wCACC,UAAA,CACA,gBAAA,CACA,eAAA,CACA,uCAAA,CACA,oCAAA,CAEA,oDACC,mDAAA,CACA,yDACC,mBAAA,CAKH,iDACC,+CAAA",sourcesContent:["\n.searchable-list {\n\t&__wrapper {\n\t\tpadding: calc(var(--default-grid-baseline) * 3);\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\twidth: 250px;\n\t}\n\n\t&__list {\n\t\twidth: 100%;\n\t\tmax-height: 284px;\n\t\toverflow-y: auto;\n\t\tmargin-top: var(--default-grid-baseline);\n\t\tpadding: var(--default-grid-baseline);\n\n\t\t:deep(.button-vue) {\n\t\t\tborder-radius: var(--border-radius-large) !important;\n\t\t\tspan {\n\t\t\t\tfont-weight: initial;\n\t\t\t}\n\t\t}\n\t}\n\n\t&__empty-content {\n\t\tmargin-top: calc(var(--default-grid-baseline) * 3);\n\t}\n}\n"],sourceRoot:""}]);const o=s},93118:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(71354),r=i.n(n),a=i(76314),s=i.n(a)()(r());s.push([e.id,".local-unified-search[data-v-199a6c24]{--local-search-width: min(calc(250px + var(--79f1a635)), 95vw);box-sizing:border-box;position:relative;height:var(--header-height);width:var(--local-search-width);display:flex;align-items:center;z-index:10;padding-inline:var(--border-width-input-focused);overflow:hidden;inset-inline-end:0}.local-unified-search .local-unified-search__global-search[data-v-199a6c24]{position:absolute;inset-inline-end:var(--default-clickable-area)}.local-unified-search .local-unified-search__input[data-v-199a6c24]{box-sizing:border-box;margin:0;width:var(--local-search-width)}.local-unified-search .local-unified-search__input[data-v-199a6c24] input{padding-inline-end:calc(var(--0f1e1e54) + var(--default-clickable-area))}.animated-width[data-v-199a6c24]{transition:width var(--animation-quick) linear}.v-leave-active[data-v-199a6c24]{position:absolute !important}.v-enter.local-unified-search[data-v-199a6c24],.v-leave-to.local-unified-search[data-v-199a6c24]{--local-search-width: var(--clickable-area-large)}@media screen and (max-width: 500px){.local-unified-search.local-unified-search--open[data-v-199a6c24]{--local-search-width: 100vw;padding-inline:var(--default-grid-baseline)}.unified-search-menu:has(.local-unified-search--open){position:absolute !important;inset-inline:0}.header-right:has(.local-unified-search--open) > :not(.unified-search-menu){display:none}}","",{version:3,sources:["webpack://./core/src/components/UnifiedSearch/UnifiedSearchLocalSearchBar.vue"],names:[],mappings:"AACA,uCACC,8DAAA,CAEA,qBAAA,CACA,iBAAA,CACA,2BAAA,CACA,+BAAA,CACA,YAAA,CACA,kBAAA,CAEA,UAAA,CAEA,gDAAA,CAEA,eAAA,CAEA,kBAAA,CAEA,4EACC,iBAAA,CACA,8CAAA,CAGD,oEACC,qBAAA,CAEA,QAAA,CACA,+BAAA,CAIA,0EAEC,wEAAA,CAKH,iCACC,8CAAA,CAKD,iCACC,4BAAA,CAKA,iGAEC,iDAAA,CAIF,qCACC,kEAEC,2BAAA,CACA,2CAAA,CAID,sDACC,4BAAA,CACA,cAAA,CAGD,4EACC,YAAA,CAAA",sourcesContent:['\n.local-unified-search {\n\t--local-search-width: min(calc(250px + v-bind(\'searchGlobalButtonCSSWidth\')), 95vw);\n\n\tbox-sizing: border-box;\n\tposition: relative;\n\theight: var(--header-height);\n\twidth: var(--local-search-width);\n\tdisplay: flex;\n\talign-items: center;\n\t// Ensure it overlays the other entries\n\tz-index: 10;\n\t// add some padding for the focus visible outline\n\tpadding-inline: var(--border-width-input-focused);\n\t// hide the overflow - needed for the transition\n\toverflow: hidden;\n\t// Ensure the position is fixed also during "position: absolut" (transition)\n\tinset-inline-end: 0;\n\n\t#{&} &__global-search {\n\t\tposition: absolute;\n\t\tinset-inline-end: var(--default-clickable-area);\n\t}\n\n\t#{&} &__input {\n\t\tbox-sizing: border-box;\n\t\t// override some nextcloud-vue styles\n\t\tmargin: 0;\n\t\twidth: var(--local-search-width);\n\n\t\t// Fixup the spacing so we can fit in the "search globally" button\n\t\t// this can break at any time the component library changes\n\t\t:deep(input) {\n\t\t\t// search global width + close button width\n\t\t\tpadding-inline-end: calc(v-bind(\'searchGlobalButtonWidth\') + var(--default-clickable-area));\n\t\t}\n\t}\n}\n\n.animated-width {\n\ttransition: width var(--animation-quick) linear;\n}\n\n// Make the position absolut during the transition\n// this is needed to "hide" the button begind it\n.v-leave-active {\n\tposition: absolute !important;\n}\n\n.v-enter,\n.v-leave-to {\n\t&.local-unified-search {\n\t\t// Start with only the overlayed button\n\t\t--local-search-width: var(--clickable-area-large);\n\t}\n}\n\n@media screen and (max-width: 500px) {\n\t.local-unified-search.local-unified-search--open {\n\t\t// 100% but still show the menu toggle on the very right\n\t\t--local-search-width: 100vw;\n\t\tpadding-inline: var(--default-grid-baseline);\n\t}\n\n\t// when open we need to position it absolut to allow overlay the full bar\n\t:global(.unified-search-menu:has(.local-unified-search--open)) {\n\t\tposition: absolute !important;\n\t\tinset-inline: 0;\n\t}\n\t// Hide all other entries, especially the user menu as it might leak pixels\n\t:global(.header-right:has(.local-unified-search--open) > :not(.unified-search-menu)) {\n\t\tdisplay: none;\n\t}\n}\n'],sourceRoot:""}]);const o=s},53085:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(71354),r=i.n(n),a=i(76314),s=i.n(a)()(r());s.push([e.id,"[data-v-67c4f290] .unified-search-modal .unified-search-modal__content{--dialog-height: min(80vh, 800px);box-sizing:border-box;height:var(--dialog-height);max-height:var(--dialog-height);min-height:var(--dialog-height);display:flex;flex-direction:column;padding-inline:0}.unified-search-modal__header[data-v-67c4f290]{background-color:var(--color-main-background);padding-inline-end:12px;padding-block-end:12px;position:sticky;top:6px}.unified-search-modal__filters[data-v-67c4f290]{display:flex;flex-wrap:wrap;gap:4px;justify-content:start;padding-top:4px}.unified-search-modal__filters-applied[data-v-67c4f290]{padding-top:4px;display:flex;flex-wrap:wrap}.unified-search-modal__no-content[data-v-67c4f290]{display:flex;align-items:center;height:100%}.unified-search-modal__results[data-v-67c4f290]{overflow:hidden scroll;padding-inline:0 12px;padding-block:0 12px}.unified-search-modal__results .result-title[data-v-67c4f290]{color:var(--color-primary-element);font-size:16px;margin-block:8px 4px}.unified-search-modal__results .result-footer[data-v-67c4f290]{justify-content:space-between;align-items:center;display:flex}.filter-button__icon[data-v-67c4f290]{height:20px;width:20px;object-fit:contain;filter:var(--background-invert-if-bright);padding:11px}@media only screen and (max-height: 400px){.unified-search-modal__results[data-v-67c4f290]{overflow:unset}}","",{version:3,sources:["webpack://./core/src/components/UnifiedSearch/UnifiedSearchModal.vue"],names:[],mappings:"AACA,uEACC,iCAAA,CACA,qBAAA,CACA,2BAAA,CACA,+BAAA,CACA,+BAAA,CAEA,YAAA,CACA,qBAAA,CAEA,gBAAA,CAIA,+CAEC,6CAAA,CAEA,uBAAA,CAEA,sBAAA,CAEA,eAAA,CACA,OAAA,CAGD,gDACC,YAAA,CACA,cAAA,CACA,OAAA,CACA,qBAAA,CACA,eAAA,CAGD,wDACC,eAAA,CACA,YAAA,CACA,cAAA,CAGD,mDACC,YAAA,CACA,kBAAA,CACA,WAAA,CAGD,gDACC,sBAAA,CAEA,qBAAA,CACA,oBAAA,CAGC,8DACC,kCAAA,CACA,cAAA,CACA,oBAAA,CAGD,+DACC,6BAAA,CACA,kBAAA,CACA,YAAA,CAOJ,sCACC,WAAA,CACA,UAAA,CACA,kBAAA,CACA,yCAAA,CACA,YAAA,CAID,2CACC,gDACC,cAAA,CAAA",sourcesContent:["\n:deep(.unified-search-modal .unified-search-modal__content) {\n\t--dialog-height: min(80vh, 800px);\n\tbox-sizing: border-box;\n\theight: var(--dialog-height);\n\tmax-height: var(--dialog-height);\n\tmin-height: var(--dialog-height);\n\n\tdisplay: flex;\n\tflex-direction: column;\n\t// No padding to prevent scrollbar misplacement\n\tpadding-inline: 0;\n}\n\n.unified-search-modal {\n\t&__header {\n\t\t// Add background to prevent leaking scrolled content (because of sticky position)\n\t\tbackground-color: var(--color-main-background);\n\t\t// Fix padding to have the input centered\n\t\tpadding-inline-end: 12px;\n\t\t// Some padding to make elements scrolled under sticky position look nicer\n\t\tpadding-block-end: 12px;\n\t\t// Make it sticky with the input margin for the label\n\t\tposition: sticky;\n\t\ttop: 6px;\n\t}\n\n\t&__filters {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 4px;\n\t\tjustify-content: start;\n\t\tpadding-top: 4px;\n\t}\n\n\t&__filters-applied {\n\t\tpadding-top: 4px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t}\n\n\t&__no-content {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\theight: 100%;\n\t}\n\n\t&__results {\n\t\toverflow: hidden scroll;\n\t\t// Adjust padding to match container but keep the scrollbar on the very end\n\t\tpadding-inline: 0 12px;\n\t\tpadding-block: 0 12px;\n\n\t\t.result {\n\t\t\t&-title {\n\t\t\t\tcolor: var(--color-primary-element);\n\t\t\t\tfont-size: 16px;\n\t\t\t\tmargin-block: 8px 4px;\n\t\t\t}\n\n\t\t\t&-footer {\n\t\t\t\tjustify-content: space-between;\n\t\t\t\talign-items: center;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n.filter-button__icon {\n\theight: 20px;\n\twidth: 20px;\n\tobject-fit: contain;\n\tfilter: var(--background-invert-if-bright);\n\tpadding: 11px; // align with text to fit at least 44px\n}\n\n// Ensure modal is accessible on small devices\n@media only screen and (max-height: 400px) {\n\t.unified-search-modal__results {\n\t\toverflow: unset;\n\t}\n}\n"],sourceRoot:""}]);const o=s},81813:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(71354),r=i.n(n),a=i(76314),s=i.n(a)()(r());s.push([e.id,"#header .header-menu[data-v-97afc5f6]{display:flex;align-items:center;justify-content:center}#header .header-menu__trigger[data-v-97afc5f6]{height:var(--header-height);width:var(--header-height) !important}#header .header-menu__trigger[data-v-97afc5f6]:focus-visible{outline:none !important;box-shadow:none !important}#header .header-menu__trigger[data-v-97afc5f6]:not(:hover,:focus,:focus-visible){opacity:.85}#header .header-menu__trigger-icon[data-v-97afc5f6]{color:var(--color-background-plain-text) !important}","",{version:3,sources:["webpack://./core/src/views/UnifiedSearch.vue"],names:[],mappings:"AAGC,sCACC,YAAA,CACA,kBAAA,CACA,sBAAA,CAEA,+CACC,2BAAA,CACA,qCAAA,CAEA,6DAEC,uBAAA,CACA,0BAAA,CAGD,iFACC,WAAA,CAGD,oDAEC,mDAAA",sourcesContent:["\n// this is needed to allow us overriding component styles (focus-visible)\n#header {\n\t.header-menu {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&__trigger {\n\t\t\theight: var(--header-height);\n\t\t\twidth: var(--header-height) !important;\n\n\t\t\t&:focus-visible {\n\t\t\t\t// align with other header menu entries\n\t\t\t\toutline: none !important;\n\t\t\t\tbox-shadow: none !important;\n\t\t\t}\n\n\t\t\t&:not(:hover,:focus,:focus-visible) {\n\t\t\t\topacity: .85;\n\t\t\t}\n\n\t\t\t&-icon {\n\t\t\t\t// ensure the icon has the correct color\n\t\t\t\tcolor: var(--color-background-plain-text) !important;\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const o=s},27518:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M15.4%2016.6L10.8%2012l4.6-4.6L14%206l-6%206%206%206%201.4-1.4z%27/%3e%3c/svg%3e"},27514:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M18.4%207.4L17%206l-6%206%206%206%201.4-1.4-4.6-4.6%204.6-4.6m-6%200L11%206l-6%206%206%206%201.4-1.4L7.8%2012l4.6-4.6z%27/%3e%3c/svg%3e"},79722:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M5.6%207.4L7%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6m6%200L13%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6z%27/%3e%3c/svg%3e"},86886:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M8.6%2016.6l4.6-4.6-4.6-4.6L10%206l6%206-6%206-1.4-1.4z%27/%3e%3c/svg%3e"}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var a=i[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.m=t,e=[],n.O=(t,i,r,a)=>{if(!i){var s=1/0;for(d=0;d<e.length;d++){i=e[d][0],r=e[d][1],a=e[d][2];for(var o=!0,l=0;l<i.length;l++)(!1&a||s>=a)&&Object.keys(n.O).every((e=>n.O[e](i[l])))?i.splice(l--,1):(o=!1,a<s&&(s=a));if(o){e.splice(d--,1);var c=r();void 0!==c&&(t=c)}}return t}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[i,r,a]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.j=6776,(()=>{n.b=document.baseURI||self.location.href;var e={6776:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var r,a,s=i[0],o=i[1],l=i[2],c=0;if(s.some((t=>0!==e[t]))){for(r in o)n.o(o,r)&&(n.m[r]=o[r]);if(l)var d=l(n)}for(t&&t(i);c<s.length;c++)a=s[c],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return n.O(d)},i=self.webpackChunknextcloud=self.webpackChunknextcloud||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),n.nc=void 0;var r=n.O(void 0,[4208],(()=>n(36609)));r=n.O(r)})();
  2. //# sourceMappingURL=core-unified-search.js.map?v=e020631339ef14bc3362