12 |
- (()=>{"use strict";var e,t={63541:(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),v=i.n(g);const C=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(8369),R=i(94219),z=i(31126),q=i(34499);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(18898);var oe=i(8654),le=i(30567),ce=i(3441),de=i(83405),ue=i(73267),he=i(15683),Ae=i(93806),pe=i(60597),fe=i(80114),me=i(32831),ge=i(98060),ve=i(27353),Ce=i(47611),be=i(10363),ye=i(71523),_e=i(18928),xe=i(20377),we=i(65136),ke=i(80329),Se=i(62720),Ne=i(59256),Fe=i(5798),Ie=i(66687),Be=i(39033),De=i(35845),Le=i(86897),Me=i(46503),Te=i(4831),Ee=i(51850),Pe=i(86383),Ue=i(9827),Re=i(58982),ze=i(69606),qe=i(93790),He=i(5569),Oe=i(22720),Ve=i(33116),Ge=i(26039),$e=i(21682),Qe=i(7271),Ye=i(17635),je=i(68296),Ke=i(39930),We=i(78298),Je=i(49708),Ze=i(94659),Xe=i(15676),et=i(80763),tt=i(4586),it=i(84237),nt=i(52201),rt=i(65124),at=i(28640),st=i(97595),ot=i(91329),lt=i(23596),ct=i(64678),dt=i(87059),ut=(i(40708),i(28554),i(77590)),ht=i(51335),At=i(12679),pt=i(47493),ft=i(46818),mt=i(86484),gt=i(76633),vt=i(42740),Ct=i(35329),bt=i(66646),yt=i(8675),_t=i(23610),xt=(i(23020),i(53429)),wt=(i(9050),i(1040),i(42892)),kt=i(65842),St=(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,ve.N,Ce.A,be.A,ye.N,_e.N,xe.A,we.N,ke.A,Se.A,Ne.N,Fe.N,Ie.A,Be.N,De.A,Le.N,Me.A,ct.N,Te.N,Ee.N,Pe.N,d.A,Ue.N,Re.N,ze.N,qe.N,He.A,Oe.N,Ve.N,Ge.N,$e.A,z.A,Qe.N,Ye.N,je.A,Ke.N,P.A,We.A,Je.N,Ze.N,Xe.N,U.A,et.N,tt.N,it.A,lt.N,q.A,nt.A,rt.N,at.N,st.N,ot.N,ct.a,dt.N,At.N,ut.N,pt.N,ft.N,mt.N,gt.N,vt.A,ht.N,Ct.N,bt.N,yt.N,_t.A,Symbol.toStringTag,wt.u,kt.u,St.yw,Symbol.toStringTag;const Nt={name:"AlertCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ft=(0,k.A)(Nt,(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,It={name:"SearchableList",components:{NcPopover:at.N,NcTextField:ht.N,Magnify:u.A,AlertCircleOutline:Ft,NcAvatar:Te.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 Bt=i(51568),Dt={};Dt.styleTagTransform=X(),Dt.setAttributes=K(),Dt.insert=Y().bind(null,"head"),Dt.domAPI=$(),Dt.insertStyleElement=J(),V()(Bt.A,Dt),Bt.A&&Bt.A.locals&&Bt.A.locals;const Lt=(0,k.A)(It,(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,Mt={name:"SearchResult",components:{NcListItem:et.N},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 Tt=i(58535),Et={};Et.styleTagTransform=X(),Et.setAttributes=K(),Et.insert=Y().bind(null,"head"),Et.domAPI=$(),Et.insertStyleElement=J(),V()(Tt.A,Et),Tt.A&&Tt.A.locals&&Tt.A.locals;const Pt=(0,k.A)(Mt,(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(".concat(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,Ut=(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:Lt,SearchResult:Pt},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 v()(this.find,300)},debouncedFilterContacts(){return v()(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){var a,s;if(null===(a=i.filters)||void 0===a||!a.since||null===(s=i.filters)||void 0===s||!s.until)return;r.since=this.dateFilter.startFrom,r.until=this.dateFilter.endAt}if(n.personFilterIsApplied){var o;if(null===(o=i.filters)||void 0===o||!o.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 ".concat(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 ".concat(this.dateFilter.startFrom.toLocaleDateString()," and ").concat(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 Rt=i(96306),zt={};zt.styleTagTransform=X(),zt.setAttributes=K(),zt.insert=Y().bind(null,"head"),zt.domAPI=$(),zt.insertStyleElement=J(),V()(Rt.A,zt),Rt.A&&Rt.A.locals&&Rt.A.locals;const qt=(0,k.A)(Ut,(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:"".concat(i.id,"-").concat(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){var n;return t("FilterChip",{key:i.id,attrs:{text:null!==(n=i.name)&&void 0!==n?n: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(e._s(e.t("core","Results")))]),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-".concat(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-".concat(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,"3005fa1b",null).exports;var Ht=i(6695);const Ot=(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,xt.al)(),l=(0,o.KR)(),{width:u}=(0,c.Lhy)(l),h=(0,o.EW)((()=>u.value?"".concat(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:Ht.A,NcInputField:U.A}}});var Vt=i(93118),Gt={};Gt.styleTagTransform=X(),Gt.setAttributes=K(),Gt.insert=Y().bind(null,"head"),Gt.domAPI=$(),Gt.insertStyleElement=J(),V()(Vt.A,Gt),Vt.A&&Vt.A.locals&&Vt.A.locals;const $t=(0,k.A)(Ot,(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,Qt=(0,o.pM)({name:"UnifiedSearch",components:{NcButton:d.A,Magnify:u.A,UnifiedSearchModal:qt,UnifiedSearchLocalSearchBar:$t},setup:()=>({currentLocation:(0,c.ZDG)(),t:a.Tl}),data:()=>({queryText:"",showUnifiedSearch:!1,showLocalSearch:!1}),computed:{debouncedQueryUpdate(){return v()(this.emitUpdatedQuery,250)},supportsLocalSearch(){return["/settings/users","/apps/files","/apps/deck","/settings/apps"].some((e=>{var t,i;return null===(t=this.currentLocation.pathname)||void 0===t||null===(i=t.includes)||void 0===i?void 0:i.call(t,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})})),C.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 Yt=i(46486),jt={};jt.styleTagTransform=X(),jt.setAttributes=K(),jt.insert=Y().bind(null,"head"),jt.domAPI=$(),jt.insertStyleElement=J(),V()(Yt.A,jt),Yt.A&&Yt.A.locals&&Yt.A.locals;const Kt=(0,k.A)(Qt,(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,"3496fc74",null).exports;i.nc=btoa((0,r.do)());const Wt=(0,n.YK)().setApp("unified-search").detectUser().build();o.Ay.mixin({data:()=>({logger:Wt}),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 Jt=(0,s.Ey)();new o.Ay({el:"#unified-search",pinia:Jt,name:"UnifiedSearchRoot",render:e=>e(Kt)})},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},96306:(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-3005fa1b] .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-3005fa1b]{background-color:var(--color-main-background);padding-inline-end:12px;padding-block-end:12px;position:sticky;top:6px}.unified-search-modal__filters[data-v-3005fa1b]{display:flex;flex-wrap:wrap;gap:4px;justify-content:start;padding-top:4px}.unified-search-modal__filters-applied[data-v-3005fa1b]{padding-top:4px;display:flex;flex-wrap:wrap}.unified-search-modal__no-content[data-v-3005fa1b]{display:flex;align-items:center;height:100%}.unified-search-modal__results[data-v-3005fa1b]{overflow:hidden scroll;padding-inline:0 12px;padding-block:0 12px}.unified-search-modal__results .result-title[data-v-3005fa1b]{color:var(--color-primary-element);font-size:16px;margin-block:8px 4px}.unified-search-modal__results .result-footer[data-v-3005fa1b]{justify-content:space-between;align-items:center;display:flex}.filter-button__icon[data-v-3005fa1b]{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-3005fa1b]{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},46486:(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-3496fc74]{display:flex;align-items:center;justify-content:center}#header .header-menu__trigger[data-v-3496fc74]{height:var(--header-height);width:var(--header-height) !important}#header .header-menu__trigger[data-v-3496fc74]:focus-visible{outline:none !important;box-shadow:none !important}#header .header-menu__trigger[data-v-3496fc74]:not(:hover,:focus,:focus-visible){opacity:.85}#header .header-menu__trigger-icon[data-v-3496fc74]{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(63541)));r=n.O(r)})();
- //# sourceMappingURL=core-unified-search.js.map?v=af5d4a5dc352c5151d82
|