const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('photos', '', 'js/NcColorPicker-DUXt6lMy.chunk.mjs'),window.OC.filePath('photos', '', 'js/NcSelect-DTniMiUS-DT0HbKa6.chunk.mjs'),window.OC.filePath('photos', '', 'js/preload-helper-DadE4qT2.chunk.mjs'),window.OC.filePath('photos', '', 'js/index-Dgdobvu3.chunk.mjs'),window.OC.filePath('photos', '', 'js/index-BCevi9E9.chunk.mjs'),window.OC.filePath('photos', '', 'css/index-Cza_DEM4.chunk.css'),window.OC.filePath('photos', '', 'js/useModelMigration-EhAWvqDD-Zhby4giX.chunk.mjs'),window.OC.filePath('photos', '', 'js/NcAvatar-D5nljVEA-Mn39wJHK.chunk.mjs'),window.OC.filePath('photos', '', 'js/NcActionButton-DykQxmXJ-KVA0ETt1.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcActionButton-DykQxmXJ-Dc3ra1Np.chunk.css'),window.OC.filePath('photos', '', 'css/NcAvatar-D5nljVEA-By5U0e-S.chunk.css'),window.OC.filePath('photos', '', 'css/NcSelect-DTniMiUS-D-nWHgHx.chunk.css'),window.OC.filePath('photos', '', 'js/NcProgressBar-D7zYeXBH-uJjZguS5.chunk.mjs'),window.OC.filePath('photos', '', 'js/index-V4SUT3Zk.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcProgressBar-D7zYeXBH-B3qS3u7h.chunk.css'),window.OC.filePath('photos', '', 'js/video-eu9Y2O-I.chunk.mjs'),window.OC.filePath('photos', '', 'css/video-CmtaypCh.chunk.css'),window.OC.filePath('photos', '', 'js/NcFormBoxButton-C6EvdLK4-C8B93Wrm.chunk.mjs'),window.OC.filePath('photos', '', 'js/NcVNodes-BVNC6_P_.chunk.mjs'),window.OC.filePath('photos', '', 'js/index-D_vzF9fp.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcFormBoxButton-C6EvdLK4-Ddk1H9dB.chunk.css'),window.OC.filePath('photos', '', 'js/useHotKey-DFSRx3Nk.chunk.mjs'),window.OC.filePath('photos', '', 'js/NcTextField-CfZknuqx-CsSvGxmN.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcTextField-CfZknuqx-ChYPIaUD.chunk.css'),window.OC.filePath('photos', '', 'js/NcCheckboxRadioSwitch-DAPHFb0L-ou8aC9jF.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcCheckboxRadioSwitch-DAPHFb0L-35V8jJy1.chunk.css'),window.OC.filePath('photos', '', 'js/NcEmptyContent-D03x2I6w.chunk.mjs'),window.OC.filePath('photos', '', 'js/createElementId-DhjFt1I9-B2HCdIOx.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcEmptyContent-BC9mI1uc.chunk.css'),window.OC.filePath('photos', '', 'js/NcListItem-BommrKRB-nRPPDJuP.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcListItem-BommrKRB-rU4rujf8.chunk.css'),window.OC.filePath('photos', '', 'js/useFormatDateTime-Dj6f4vk0.chunk.mjs'),window.OC.filePath('photos', '', 'js/NcDateTimePicker-BJgTfZNh.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcDateTimePicker-DRVX_HEr.chunk.css'),window.OC.filePath('photos', '', 'js/NcSelectUsers-RyUVUaWQ-CTrr_2Z8.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcSelectUsers-RyUVUaWQ-LFhRBB90.chunk.css'),window.OC.filePath('photos', '', 'js/NcUserBubble-VLY4hn5K-C859Jy5x.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcUserBubble-VLY4hn5K-DuGeWNEo.chunk.css'),window.OC.filePath('photos', '', 'js/icons-CFZwNZD8.chunk.mjs'),window.OC.filePath('photos', '', 'js/CollectionContent-BxIYqcaH.chunk.mjs'),window.OC.filePath('photos', '', 'js/FileComponent-A6f_Dtn9.chunk.mjs'),window.OC.filePath('photos', '', 'css/FileComponent-BNcqW4Yv.chunk.css'),window.OC.filePath('photos', '', 'js/FilesSelectionMixin-1nnlfofj.chunk.mjs'),window.OC.filePath('photos', '', 'js/fileFetcher-CFJaIlCO.chunk.mjs'),window.OC.filePath('photos', '', 'css/FilesSelectionMixin-Ir2RfRYO.chunk.css'),window.OC.filePath('photos', '', 'css/CollectionContent--Aqfzk9e.chunk.css'),window.OC.filePath('photos', '', 'js/HeaderNavigation-DLWOytuO.chunk.mjs'),window.OC.filePath('photos', '', 'css/HeaderNavigation-DKt_N0pA.chunk.css'),window.OC.filePath('photos', '', 'js/FetchCollectionContentMixin-NK9nekKH.chunk.mjs'),window.OC.filePath('photos', '', 'js/collectionFetcher-D94WC1TK.chunk.mjs'),window.OC.filePath('photos', '', 'js/AbortControllerMixin-Bb5X6Yae.chunk.mjs'),window.OC.filePath('photos', '', 'css/NcColorPicker-BOn1JYbY.chunk.css')])))=>i.map(i=>d[i]); import{C as q,B as U,b as C,_ as N,V as g,u as Z,s as G}from"./preload-helper-DadE4qT2.chunk.mjs";import{u as x}from"./useModelMigration-EhAWvqDD-Zhby4giX.chunk.mjs";import{n as d,G as k,_ as Q,Q as Y,t as h,I as J,a1 as K,r as M,a2 as X,a3 as tt,j as et,y as E}from"./index-Dgdobvu3.chunk.mjs";import{A as it,N as at}from"./NcActionButton-DykQxmXJ-KVA0ETt1.chunk.mjs";import{d as z}from"./index-D_vzF9fp.chunk.mjs";import{a as S,N as rt}from"./NcTextField-CfZknuqx-CsSvGxmN.chunk.mjs";import{a as nt,b as st}from"./NcAvatar-D5nljVEA-Mn39wJHK.chunk.mjs";import{c as lt}from"./createElementId-DhjFt1I9-B2HCdIOx.chunk.mjs";const ot=["date","datetime-local","month","time","week"],ct={name:"NcDateTimePickerNative",inheritAttrs:!1,model:{prop:"modelValue",event:"update:modelValue"},props:{value:{type:Date,default:void 0},modelValue:{type:Date,default:null},id:{type:String,default:()=>"date-time-picker-"+k(),validator:t=>t.trim()!==""},type:{type:String,default:"date",validate:t=>ot.includes(t)},label:{type:String,default:"Please choose a date"},min:{type:[Boolean,Date],default:null},max:{type:[Boolean,Date],default:null},hideLabel:{type:Boolean,default:!1},inputClass:{type:[Object,String],default:""}},emits:["input","update:modelValue","update:model-value"],setup(){return{model:x("value","input")}},computed:{formattedValue(){return this.formatValue(this.model)},formattedMin(){return this.min?this.formatValue(this.min):!1},formattedMax(){return this.max?this.formatValue(this.max):!1},listeners(){return{...this.$listeners,input:t=>{if(isNaN(t.target.valueAsNumber))this.model=null;else if(this.type==="time"){const e=t.target.value;if(this.model===""){const{yyyy:i,MM:a,dd:r}=this.getReadableDate(new Date);this.model=new Date(`${i}-${a}-${r}T${e}`)}else{const{yyyy:i,MM:a,dd:r}=this.getReadableDate(this.model);this.model=new Date(`${i}-${a}-${r}T${e}`)}}else if(this.type==="month"){const e=(new Date(t.target.value).getMonth()+1).toString().padStart(2,"0");if(this.model===""){const{yyyy:i,dd:a,hh:r,mm:n}=this.getReadableDate(new Date);this.model=new Date(`${i}-${e}-${a}T${r}:${n}`)}else{const{yyyy:i,dd:a,hh:r,mm:n}=this.getReadableDate(this.model);this.model=new Date(`${i}-${e}-${a}T${r}:${n}`)}}else{const e=new Date(t.target.valueAsNumber).getTimezoneOffset()*1e3*60,i=t.target.valueAsNumber+e;this.model=new Date(i)}}}}},methods:{getReadableDate(t){if(t instanceof Date){const e=t.getFullYear().toString().padStart(4,"0"),i=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0"),r=t.getHours().toString().padStart(2,"0"),n=t.getMinutes().toString().padStart(2,"0");return{yyyy:e,MM:i,dd:a,hh:r,mm:n}}},formatValue(t){if(t instanceof Date){const{yyyy:e,MM:i,dd:a,hh:r,mm:n}=this.getReadableDate(t);if(this.type==="datetime-local")return`${e}-${i}-${a}T${r}:${n}`;if(this.type==="date")return`${e}-${i}-${a}`;if(this.type==="month")return`${e}-${i}`;if(this.type==="time")return`${r}:${n}`;if(this.type==="week"){const s=new Date(e,0,1),l=Math.floor((t-s)/(24*60*60*1e3)),c=Math.ceil(l/7);return`${e}-W${c}`}}else return""}}};var dt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"native-datetime-picker"},[e("label",{staticClass:"native-datetime-picker--label",class:{"hidden-visually":t.hideLabel},attrs:{for:t.id}},[t._v(" "+t._s(t.label)+" ")]),e("input",t._g(t._b({staticClass:"native-datetime-picker--input",class:t.inputClass,attrs:{id:t.id,type:t.type,min:t.formattedMin,max:t.formattedMax},domProps:{value:t.formattedValue}},"input",t.$attrs,!1),t.listeners))])},ut=[],pt=d(ct,dt,ut,!1,null,"6c1feae8");const R=pt.exports;Q(R);const ht={name:"EyeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var mt=function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon eye-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(i){return t.$emit("click",i)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])},ft=[],gt=d(ht,mt,ft,!1,null,null);const bt=gt.exports,vt={name:"EyeOffIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var yt=function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon eye-off-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(i){return t.$emit("click",i)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])},_t=[],$t=d(vt,yt,_t,!1,null,null);const Ct=$t.exports;M(X);const L=U("core","capabilities",{}).password_policy||null,Nt=new Set(Object.keys(S.props)),wt={name:"NcPasswordField",components:{NcInputField:S,IconEye:bt,IconEyeOff:Ct},inheritAttrs:!1,model:{prop:"modelValue",event:"update:modelValue"},props:{" ":{},...S.props,showTrailingButton:{type:Boolean,default:!0},trailingButtonLabel:void 0,checkPasswordStrength:{type:Boolean,default:!1},minlength:{type:Number,default:0},maxlength:{type:Number,default:null},asText:{type:Boolean,default:!1},visible:{type:Boolean,default:!1}},emits:["valid","invalid","update:value","update:modelValue","update:model-value","update:visible"],setup(t,{emit:e}){const i=x("value","update:value"),a=K(t,"visible",e,{passive:!0});return{t:h,model:i,visibility:a}},data(){return{internalHelpMessage:"",isValid:null}},computed:{computedError(){return this.error||this.isValid===!1},computedSuccess(){return this.success||this.isValid===!0},computedHelperText(){return this.helperText.length>0?this.helperText:this.internalHelpMessage},rules(){const{minlength:t}=this;return{minlength:t??L?.minLength}},trailingButtonLabelPassword(){return this.visibility?h("Hide password"):h("Show password")},propsAndAttrsToForward(){return{...this.$attrs,...Object.fromEntries(Object.entries(this.$props).filter(([t])=>Nt.has(t)))}}},watch:{model(t){if(this.checkPasswordStrength){if(L===null)return;this.checkPassword(t)}}},methods:{focus(){this.$refs.inputField.focus()},select(){this.$refs.inputField.select()},handleInput(t){this.model=t.target.value},toggleVisibility(){this.visibility=!this.visibility},checkPassword:z(async function(t){try{const{data:e}=await Y.post(q("apps/password_policy/api/v1/validate"),{password:t});if(this.isValid=e.ocs.data.passed,e.ocs.data.passed){this.internalHelpMessage=h("Password is secure"),this.$emit("valid");return}this.internalHelpMessage=e.ocs.data.reason,this.$emit("invalid")}catch(e){J.error("Password policy returned an error",e)}},500)}};var kt=function(){var t=this,e=t._self._c;return e("NcInputField",t._g(t._b({ref:"inputField",attrs:{type:t.visibility||t.asText?"text":"password","trailing-button-label":t.trailingButtonLabelPassword,"helper-text":t.computedHelperText,error:t.computedError,success:t.computedSuccess,minlength:t.rules.minlength,"input-class":{"password-field__input--secure-text":!t.visibility&&t.asText}},on:{"trailing-button-click":t.toggleVisibility,input:t.handleInput},scopedSlots:t._u([t.$scopedSlots.icon||t.$slots.default||t.$scopedSlots.default?{key:"icon",fn:function(){return[t._t("icon",function(){return[t._t("default")]})]},proxy:!0}:null,{key:"trailing-button-icon",fn:function(){return[t.visibility?e("IconEyeOff",{attrs:{size:18}}):e("IconEye",{attrs:{size:18}})]},proxy:!0}],null,!0)},"NcInputField",t.propsAndAttrsToForward,!1),t.$listeners))},St=[],xt=d(wt,kt,St,!1,null,"822eec9d");const Dt=xt.exports;M(tt);const Lt={name:"NcActionInput",components:{NcDateTimePickerNative:R,NcPasswordField:Dt,NcTextField:rt,NcColorPicker:C(()=>N(()=>import("./NcColorPicker-DUXt6lMy.chunk.mjs").then(t=>t.a),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]),import.meta.url)),NcDateTimePicker:C(()=>N(()=>import("./NcDateTimePicker-BJgTfZNh.chunk.mjs"),__vite__mapDeps([32,31,2,3,4,5,6,1,7,8,9,10,11,33]),import.meta.url)),NcSelect:C(()=>N(()=>import("./NcColorPicker-DUXt6lMy.chunk.mjs").then(t=>t.N),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]),import.meta.url))},mixins:[it],model:{prop:"modelValue",event:"update:modelValue"},props:{id:{type:String,default:()=>"action-"+k(),validator:t=>t.trim()!==""},inputId:{type:String,default:()=>"action-input-"+k(),validator:t=>t.trim()!==""},icon:{type:String,default:""},type:{type:String,default:"text",validator(t){return["date","datetime-local","month","multiselect","number","password","search","tel","text","time","url","week","color","email"].indexOf(t)>-1}},idNativeDateTimePicker:{type:String,default:"date-time-picker_id"},isNativePicker:{type:Boolean,default:!1},label:{type:String,default:null},labelOutside:{type:Boolean,default:!0},value:{type:[String,Date,Number,Array],default:void 0},modelValue:{type:[String,Date,Number,Array],default:""},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:""},ariaHidden:{type:Boolean,default:null},showTrailingButton:{type:Boolean,default:!0},trailingButtonLabel:{type:String,default:h("Submit")}},emits:["input","submit","change","update:value","update:modelValue","update:model-value"],setup(){return{model:x("value","update:value")}},computed:{isIconUrl(){try{return new URL(this.icon)}catch{return!1}},isMultiselectType(){return this.type==="multiselect"},nativeDatePickerType(){switch(this.type){case"date":case"month":case"time":case"week":case"datetime-local":return this.type}return!1},datePickerType(){if(!this.isNativePicker)switch(this.type){case"date":case"month":case"time":return this.type;case"datetime-local":return"datetime"}return!1},isFocusable(){return!this.disabled}},methods:{onLeave(){this.$refs.datetimepicker&&this.$refs.datetimepicker.$refs.datepicker&&this.$refs.datetimepicker.$refs.datepicker.closePopup()},onInput(t){this.$emit("input",t),this.model=t.target?t.target.value:t},onSubmit(t){if(t.preventDefault(),t.stopPropagation(),!this.disabled)this.$emit("submit",t);else return!1},onChange(t){this.$emit("change",t)}}};var Bt=function(){var t=this,e=t._self._c;return e("li",{staticClass:"action",class:{"action--disabled":t.disabled}},[e("span",{staticClass:"action-input",class:{"action-input-picker--disabled":t.disabled,"action-input--visible-label":t.labelOutside&&t.label},on:{mouseleave:t.onLeave}},[e("span",{staticClass:"action-input__icon-wrapper"},[t._t("icon",function(){return[e("span",{staticClass:"action-input__icon",class:[t.isIconUrl?"action-input__icon--url":t.icon],style:{backgroundImage:t.isIconUrl?`url(${t.icon})`:null},attrs:{"aria-hidden":"true"}})]})],2),e("form",{ref:"form",staticClass:"action-input__form",attrs:{disabled:t.disabled},on:{submit:function(i){return i.preventDefault(),t.onSubmit.apply(null,arguments)}}},[e("div",{staticClass:"action-input__container"},[t.label&&t.labelOutside?e("label",{staticClass:"action-input__text-label",class:{"action-input__text-label--hidden":!t.labelOutside},attrs:{for:t.inputId}},[t._v(" "+t._s(t.label)+" ")]):t._e(),e("div",{staticClass:"action-input__input-container"},[t.datePickerType?e("NcDateTimePicker",t._b({ref:"datetimepicker",staticClass:"action-input__datetimepicker",staticStyle:{"z-index":"99999999999"},attrs:{value:t.model,placeholder:t.text,disabled:t.disabled,type:t.datePickerType,"input-class":["mx-input",{focusable:t.isFocusable}]},on:{input:t.onInput,change:t.onChange}},"NcDateTimePicker",t.$attrs,!1)):t.isNativePicker?e("NcDateTimePickerNative",t._b({staticClass:"action-input__datetimepicker",attrs:{id:t.idNativeDateTimePicker,value:t.model,type:t.nativeDatePickerType,"input-class":{focusable:t.isFocusable}},on:{"update:model-value":function(i){t.model=i},change:function(i){return t.$emit("change",i)}}},"NcDateTimePickerNative",t.$attrs,!1)):t.isMultiselectType?e("NcSelect",t._g(t._b({staticClass:"action-input__multi",attrs:{value:t.model,placeholder:t.text,disabled:t.disabled,"append-to-body":t.$attrs.appendToBody||t.$attrs["append-to-body"]||!1,"input-class":{focusable:t.isFocusable}}},"NcSelect",t.$attrs,!1),t.$listeners)):t.type==="password"?e("NcPasswordField",t._g(t._b({attrs:{id:t.inputId,value:t.model,label:t.label,"label-outside":!t.label||t.labelOutside,placeholder:t.text,disabled:t.disabled,"input-class":{focusable:t.isFocusable},"show-trailing-button":t.showTrailingButton&&!t.disabled},on:{input:t.onInput,change:t.onChange}},"NcPasswordField",t.$attrs,!1),t.$listeners)):t.type==="color"?e("div",{staticClass:"action-input__container"},[t.label&&t.type==="color"?e("label",{staticClass:"action-input__text-label",class:{"action-input__text-label--hidden":!t.labelOutside},attrs:{for:t.inputId}},[t._v(" "+t._s(t.label)+" ")]):t._e(),e("div",{staticClass:"action-input__input-container"},[e("NcColorPicker",t._g(t._b({staticClass:"colorpicker__trigger",attrs:{id:"inputId",value:t.model},on:{"update:model-value":t.onInput,submit:function(i){return t.$refs.form.requestSubmit()}}},"NcColorPicker",t.$attrs,!1),t.$listeners),[e("button",{staticClass:"colorpicker__preview",class:{focusable:t.isFocusable},style:{"background-color":t.model}})])],1)]):e("NcTextField",t._g(t._b({attrs:{id:t.inputId,value:t.model,label:t.label,"label-outside":!t.label||t.labelOutside,placeholder:t.text,disabled:t.disabled,"input-class":{focusable:t.isFocusable},type:t.type,"trailing-button-icon":"arrowRight","trailing-button-label":t.trailingButtonLabel,"show-trailing-button":t.showTrailingButton&&!t.disabled},on:{"trailing-button-click":function(i){return t.$refs.form.requestSubmit()},input:t.onInput,change:t.onChange}},"NcTextField",t.$attrs,!1),t.$listeners))],1)])])])])},Ot=[],Tt=d(Lt,Bt,Ot,!1,null,"29a30fef");const _e=Tt.exports,At={name:"ChevronRightIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Pt=function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon chevron-right-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(i){return t.$emit("click",i)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])},It=[],Mt=d(At,Pt,It,!1,null,null);const Et=Mt.exports,zt={name:"NcBreadcrumb",components:{NcActions:E,ChevronRight:Et,NcButton:et},inheritAttrs:!1,props:{name:{type:String,required:!0},title:{type:String,default:null},to:{type:[String,Object],default:void 0},exact:{type:Boolean,default:!1},href:{type:String,default:void 0},icon:{type:String,default:""},forceIconText:{type:Boolean,default:!1},disableDrop:{type:Boolean,default:!1},forceMenu:{type:Boolean,default:!1},open:{type:Boolean,default:!1}},emits:["update:open","dropped"],setup(){const t=lt();return{actionsContainer:`.vue-crumb[data-crumb-id="${t}"]`,crumbId:t}},data(){return{hovering:!1}},computed:{linkAttributes(){return this.to?{to:this.to,exact:this.exact,...this.$attrs}:this.href?{href:this.href,...this.$attrs}:this.$attrs}},methods:{onOpenChange(t){this.$emit("update:open",t)},dropped(t){return this.disableDrop||(this.$emit("dropped",t,this.to||this.href),this.$parent.$emit("dropped",t,this.to||this.href),this.hovering=!1),!1},dragEnter(){this.disableDrop||(this.hovering=!0)},dragLeave(t){this.disableDrop||t.target.contains(t.relatedTarget)||this.$refs.crumb.contains(t.relatedTarget)||(this.hovering=!1)}}};var Rt=function(){var t=this,e=t._self._c;return e("li",{ref:"crumb",staticClass:"vue-crumb",class:{"vue-crumb--hovered":t.hovering},attrs:{"data-crumb-id":t.crumbId,draggable:"false"},on:{dragstart:function(i){return i.preventDefault(),(()=>{}).apply(null,arguments)},drop:function(i){return i.preventDefault(),t.dropped.apply(null,arguments)},dragover:function(i){return i.preventDefault(),(()=>{}).apply(null,arguments)},dragenter:t.dragEnter,dragleave:t.dragLeave}},[(t.name||t.icon||t.$slots.icon)&&!t.$slots.default?e("NcButton",t._g(t._b({attrs:{"aria-label":t.icon?t.name:void 0,title:t.title,variant:"tertiary"},scopedSlots:t._u([t.$slots.icon||t.icon?{key:"icon",fn:function(){return[t._t("icon",function(){return[e("span",{staticClass:"icon",class:t.icon})]})]},proxy:!0}:null,!(t.$slots.icon||t.icon)||t.forceIconText?{key:"default",fn:function(){return[t._v(" "+t._s(t.name)+" ")]},proxy:!0}:null],null,!0)},"NcButton",t.linkAttributes,!1),t.$listeners)):t._e(),t.$slots.default?e("NcActions",{ref:"actions",attrs:{"force-menu":t.forceMenu,open:t.open,"menu-name":t.name,title:t.title,"force-name":!0,container:t.actionsContainer,variant:"tertiary"},on:{"update:open":t.onOpenChange},scopedSlots:t._u([{key:"icon",fn:function(){return[t._t("menu-icon")]},proxy:!0}],null,!0)},[t._t("default")],2):t._e(),e("ChevronRight",{staticClass:"vue-crumb__separator",attrs:{size:20}})],1)},Vt=[],Ft=d(zt,Rt,Vt,!1,null,"bc2f0c21");const Wt=Ft.exports;var v=Symbol(),m=Symbol(),B=Symbol(),O=Symbol(),D=function(t){return"frag"in t},jt={get:function(){return this[m]||this.parentElement},configurable:!0},f=function(t,e){m in t||(t[m]=e,Object.defineProperty(t,"parentNode",jt))},Ht={get:function(){var t=this.parentNode.childNodes,e=t.indexOf(this);return e>-1&&t[e+1]||null}},b=function(t){B in t||(t[B]=!0,Object.defineProperty(t,"nextSibling",Ht))},qt=function(t,e){for(;t.parentNode!==e;){var i=t,a=i.parentNode;a&&(t=a)}return t},w,V=function(t){if(!w){var e=Object.getOwnPropertyDescriptor(Node.prototype,"childNodes");w=e.get}var i=w.apply(t),a=Array.from(i).map(function(r){return qt(r,t)});return a.filter(function(r,n){return r!==a[n-1]})},Ut={get:function(){return this.frag||V(this)}},Zt={get:function(){return this.childNodes[0]||null}};function Gt(){return this.childNodes.length>0}var T=function(t){O in t||(t[O]=!0,Object.defineProperties(t,{childNodes:Ut,firstChild:Zt}),t.hasChildNodes=Gt)};function Qt(){var t;(t=this.frag[0]).before.apply(t,arguments)}function Yt(){var t=this.frag,e=t.splice(0,t.length);e.forEach(function(i){i.remove()})}var Jt=function t(e){var i;return(i=Array.prototype).concat.apply(i,e.map(function(a){return D(a)?t(a.frag):a}))},Kt=function(t,e){var i=t[v];e.before(i),f(i,t),t.frag.unshift(i)};function A(t){if(D(this)){var e=this.frag.indexOf(t);if(e>-1){var i=this.frag.splice(e,1),a=i[0];this.frag.length===0&&Kt(this,a),t.remove()}}else{var r=V(this),n=r.indexOf(t);n>-1&&t.remove()}return t}function P(t,e){var i=this,a=t.frag||[t];if(D(this)){if(t[m]===this&&t.parentElement)return t;var r=this.frag;if(e){var n=r.indexOf(e);n>-1&&(r.splice.apply(r,[n,0].concat(a)),e.before.apply(e,a))}else{var s=r[r.length-1];r.push.apply(r,a),s.after.apply(s,a)}F(this)}else e?this.childNodes.includes(e)&&e.before.apply(e,a):this.append.apply(this,a);a.forEach(function(c){f(c,i)});var l=a[a.length-1];return b(l),t}function Xt(t){if(t[m]===this&&t.parentElement)return t;var e=this.frag,i=e[e.length-1];return i.after(t),f(t,this),F(this),e.push(t),t}var F=function(t){var e=t[v];t.frag[0]===e&&(t.frag.shift(),e.remove())},te={set:function(t){var e=this;if(this.frag[0]!==this[v]&&this.frag.slice().forEach(function(a){return e.removeChild(a)}),t){var i=document.createElement("div");i.innerHTML=t,Array.from(i.childNodes).forEach(function(a){e.appendChild(a)})}},get:function(){return""}},ee={inserted:function(t){var e=t.parentNode,i=t.nextSibling,a=t.previousSibling,r=Array.from(t.childNodes),n=document.createComment("");r.length===0&&r.push(n),t.frag=r,t[v]=n;var s=document.createDocumentFragment();s.append.apply(s,Jt(r)),t.replaceWith(s),r.forEach(function(l){f(l,t),b(l)}),T(t),Object.assign(t,{remove:Yt,appendChild:Xt,insertBefore:P,removeChild:A,before:Qt}),Object.defineProperty(t,"innerHTML",te),e&&(Object.assign(e,{removeChild:A,insertBefore:P}),f(t,e),T(e)),i&&b(t),a&&b(a)},unbind:function(t){t.remove()}},ie={name:"Fragment",directives:{frag:ee},render:function(t){return t("div",{directives:[{name:"frag"}]},this.$slots.default)}};const ae={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var re=function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon folder-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(i){return t.$emit("click",i)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])},ne=[],se=d(ae,re,ne,!1,null,null);const le=se.exports;function I(t,e,i){if(t!==void 0)for(let a=t.length-1;a>=0;a--){const r=t[a],n=!r.componentOptions&&r.tag&&e.indexOf(r.tag)===-1,s=!!r.componentOptions&&typeof r.componentOptions.tag=="string",l=s&&e.indexOf(r.componentOptions.tag)===-1;(n||!s||l)&&((n||l)&&g.util.warn(`${n?r.tag:r.componentOptions.tag} is not allowed inside the ${i.$options.name} component`,i),t.splice(a,1))}}const o="vue-crumb",oe={name:"NcBreadcrumbs",components:{NcActions:E,NcActionButton:at,NcActionRouter:st,NcActionLink:nt,NcBreadcrumb:Wt,IconFolder:le},props:{rootIcon:{type:String,default:"icon-home"},ariaLabel:{type:String,default:null}},emits:["dropped"],data(){return{hiddenIndices:[],menuBreadcrumbProps:{name:"",forceMenu:!0,disableDrop:!0,open:!1},breadcrumbsRefs:{}}},beforeMount(){I(this.$slots.default,["NcBreadcrumb"],this)},beforeUpdate(){I(this.$slots.default,["NcBreadcrumb"],this)},created(){window.addEventListener("resize",z(()=>{this.handleWindowResize()},100)),G("navigation-toggled",this.delayedResize)},mounted(){this.handleWindowResize()},updated(){this.delayedResize(),this.$nextTick(()=>{this.hideCrumbs()})},beforeDestroy(){window.removeEventListener("resize",this.handleWindowResize),Z("navigation-toggled",this.delayedResize)},methods:{closeActions(t){this.$refs.actionsBreadcrumb.$el.contains(t.relatedTarget)||(this.menuBreadcrumbProps.open=!1)},async delayedResize(){await this.$nextTick(),this.handleWindowResize()},handleWindowResize(){if(!this.$refs.container)return;const t=Object.values(this.breadcrumbsRefs),e=t.length,i=[],a=this.$refs.container.offsetWidth;let r=this.getTotalWidth(t);this.$refs.breadcrumb__actions&&(r+=this.$refs.breadcrumb__actions.offsetWidth);let n=r-a;n+=n>0?64:0;let s=0;const l=Math.floor(e/2);for(;n>0&&sc-u))||(this.hiddenIndices=i)},arraysEqual(t,e){if(t.length!==e.length)return!1;if(t===e)return!0;if(t===null||e===null)return!1;for(let i=0;ie+this.getWidth(i?.elm,a===t.length-1),0)},getWidth(t,e){if(!t?.classList)return 0;const i=t.classList.contains(`${o}--hidden`);t.style.minWidth="auto",e&&(t.style.maxWidth="210px"),t.classList.remove(`${o}--hidden`);const a=t.offsetWidth;return i&&t.classList.add(`${o}--hidden`),t.style.minWidth="",t.style.maxWidth="",a},preventDefault(t){return t.preventDefault&&t.preventDefault(),!1},dragStart(t){return this.preventDefault(t)},dropped(t,e,i){return i||this.$emit("dropped",t,e),this.menuBreadcrumbProps.open=!1,document.querySelectorAll(`.${o}`).forEach(a=>{a.classList.remove(`${o}--hovered`)}),this.preventDefault(t)},dragOver(t){return this.preventDefault(t)},dragEnter(t,e){if(!e&&t.target.closest){const i=t.target.closest(`.${o}`);i.classList&&i.classList.contains(o)&&(document.querySelectorAll(`.${o}`).forEach(a=>{a.classList.remove(`${o}--hovered`)}),i.classList.add(`${o}--hovered`))}},dragLeave(t,e){if(!e&&!t.target.contains(t.relatedTarget)&&t.target.closest){const i=t.target.closest(`.${o}`);if(i.contains(t.relatedTarget))return;i.classList&&i.classList.contains(o)&&i.classList.remove(`${o}--hovered`)}},hideCrumbs(){Object.values(this.breadcrumbsRefs).forEach((t,e)=>{t?.elm?.classList&&(this.hiddenIndices.includes(e)?t.elm.classList.add(`${o}--hidden`):t.elm.classList.remove(`${o}--hidden`))})},isBreadcrumb(t){return(t?.componentOptions?.tag||t?.tag||"").includes("NcBreadcrumb")}},render(t){const e=[];if(this.$slots.default.forEach(n=>{if(this.isBreadcrumb(n)){e.push(n);return}n?.type===ie&&n?.children?.forEach?.(s=>{this.isBreadcrumb(s)&&e.push(s)})}),e.length===0)return;g.set(e[0].componentOptions.propsData,"icon",this.rootIcon),g.set(e[0].componentOptions.propsData,"ref","breadcrumbs");const i={};e.forEach((n,s)=>{g.set(n,"ref",`crumb-${s}`),i[s]=n});let a=[];if(!this.hiddenIndices.length)a=e;else{a=e.slice(0,Math.round(e.length/2)),a.push(t("NcBreadcrumb",{class:"dropdown",props:this.menuBreadcrumbProps,attrs:{"aria-hidden":!0},ref:"actionsBreadcrumb",key:"actions-breadcrumb-1",nativeOn:{dragstart:this.dragStart,dragenter:()=>{this.menuBreadcrumbProps.open=!0},dragleave:this.closeActions},on:{"update:open":s=>{this.menuBreadcrumbProps.open=s}}},this.hiddenIndices.filter(s=>s<=e.length-1).map(s=>{const l=e[s],c=l.componentOptions.propsData.to,u=l.componentOptions.propsData.href,y=l.componentOptions.propsData.disableDrop,W=l.componentOptions.propsData.title,j=l.componentOptions.propsData.name;let _="NcActionButton",$="";u&&(_="NcActionLink",$=u),c&&(_="NcActionRouter",$=c);const H=t("IconFolder",{props:{size:20},slot:"icon"});return t(_,{class:o,props:{href:u||null,title:W,to:c||null},attrs:{draggable:!1},on:{...l.componentOptions.listeners},nativeOn:{dragstart:this.dragStart,drop:p=>this.dropped(p,$,y),dragover:this.dragOver,dragenter:p=>this.dragEnter(p,y),dragleave:p=>this.dragLeave(p,y)}},[H,j])})));const n=e.slice(Math.round(e.length/2));a=a.concat(n)}const r=[t("nav",{attrs:{"aria-label":this.ariaLabel}},[t("ul",{class:"breadcrumb__crumbs"},[a])])];return this.$slots.actions&&r.push(t("div",{class:"breadcrumb__actions",ref:"breadcrumb__actions"},this.$slots.actions)),this.breadcrumbsRefs=i,t("div",{class:["breadcrumb",{"breadcrumb--collapsed":this.hiddenIndices.length===e.length-2}],ref:"container"},r)}},ce=null,de=null;var ue=d(oe,ce,de,!1,null,"daf14f2f");const $e=ue.exports;export{Wt as N,$e as a,_e as b,ie as f}; //# sourceMappingURL=NcBreadcrumbs-BPfsSByZ-Lyy2GAQq.chunk.mjs.map