nextcloud-server/dist/files_sharing-files_sharing...

3 lines
104 KiB
JavaScript

/*! For license information please see files_sharing-files_sharing_tab.js.LICENSE.txt */
!function(){"use strict";var e,n={25564:function(e,n,r){var i=r(20144),a=r(72268),s=r.n(a),o=r(9944),c=r(1794),l=r(79753),u=r(75925),h=r.n(u),d=r(4820),f=r(79954);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key,"string"),"symbol"===p(i)?i:String(i)),r)}var i}var g=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"isPublicUploadEnabled",get:function(){return document.getElementsByClassName("files-filestable")[0]&&"yes"===document.getElementsByClassName("files-filestable")[0].dataset.allowPublicUpload}},{key:"isShareWithLinkAllowed",get:function(){return document.getElementById("allowShareWithLink")&&"yes"===document.getElementById("allowShareWithLink").value}},{key:"federatedShareDocLink",get:function(){return OC.appConfig.core.federatedCloudShareDoc}},{key:"defaultExpirationDate",get:function(){return this.isDefaultExpireDateEnabled?new Date((new Date).setDate((new Date).getDate()+this.defaultExpireDate)):null}},{key:"defaultInternalExpirationDate",get:function(){return this.isDefaultInternalExpireDateEnabled?new Date((new Date).setDate((new Date).getDate()+this.defaultInternalExpireDate)):null}},{key:"defaultRemoteExpirationDateString",get:function(){return this.isDefaultRemoteExpireDateEnabled?new Date((new Date).setDate((new Date).getDate()+this.defaultRemoteExpireDate)):null}},{key:"enforcePasswordForPublicLink",get:function(){return!0===OC.appConfig.core.enforcePasswordForPublicLink}},{key:"enableLinkPasswordByDefault",get:function(){return!0===OC.appConfig.core.enableLinkPasswordByDefault}},{key:"isDefaultExpireDateEnforced",get:function(){return!0===OC.appConfig.core.defaultExpireDateEnforced}},{key:"isDefaultExpireDateEnabled",get:function(){return!0===OC.appConfig.core.defaultExpireDateEnabled}},{key:"isDefaultInternalExpireDateEnforced",get:function(){return!0===OC.appConfig.core.defaultInternalExpireDateEnforced}},{key:"isDefaultRemoteExpireDateEnforced",get:function(){return!0===OC.appConfig.core.defaultRemoteExpireDateEnforced}},{key:"isDefaultInternalExpireDateEnabled",get:function(){return!0===OC.appConfig.core.defaultInternalExpireDateEnabled}},{key:"isDefaultRemoteExpireDateEnabled",get:function(){return!0===OC.appConfig.core.defaultRemoteExpireDateEnabled}},{key:"isRemoteShareAllowed",get:function(){return!0===OC.appConfig.core.remoteShareAllowed}},{key:"isMailShareAllowed",get:function(){var e,t,n,r=OC.getCapabilities();return void 0!==(null==r||null===(e=r.files_sharing)||void 0===e?void 0:e.sharebymail)&&!0===(null==r||null===(t=r.files_sharing)||void 0===t||null===(n=t.public)||void 0===n?void 0:n.enabled)}},{key:"defaultExpireDate",get:function(){return OC.appConfig.core.defaultExpireDate}},{key:"defaultInternalExpireDate",get:function(){return OC.appConfig.core.defaultInternalExpireDate}},{key:"defaultRemoteExpireDate",get:function(){return OC.appConfig.core.defaultRemoteExpireDate}},{key:"isResharingAllowed",get:function(){return!0===OC.appConfig.core.resharingAllowed}},{key:"isPasswordForMailSharesRequired",get:function(){return void 0!==OC.getCapabilities().files_sharing.sharebymail&&OC.getCapabilities().files_sharing.sharebymail.password.enforced}},{key:"shouldAlwaysShowUnique",get:function(){var e,t;return!0===(null===(e=OC.getCapabilities().files_sharing)||void 0===e||null===(t=e.sharee)||void 0===t?void 0:t.always_show_unique)}},{key:"allowGroupSharing",get:function(){return!0===OC.appConfig.core.allowGroupSharing}},{key:"maxAutocompleteResults",get:function(){return parseInt(OC.config["sharing.maxAutocompleteResults"],10)||25}},{key:"minSearchStringLength",get:function(){return parseInt(OC.config["sharing.minSearchStringLength"],10)||0}},{key:"passwordPolicy",get:function(){var e=OC.getCapabilities();return e.password_policy?e.password_policy:{}}}])&&m(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),v=r(41922);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A(r.key),r)}}function A(e){var t=function(e,t){if("object"!==y(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===y(t)?t:String(t)}var b=function(){function e(t){var n,r,i,a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,a=void 0,(i=A(i="_share"))in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,t.ocs&&t.ocs.data&&t.ocs.data[0]&&(t=t.ocs.data[0]),t.hide_download=!!t.hide_download,t.mail_send=!!t.mail_send,t.attributes)try{t.attributes=JSON.parse(t.attributes)}catch(e){console.warn('Could not parse share attributes returned by server: "'+t.attributes+'"')}t.attributes=null!==(n=t.attributes)&&void 0!==n?n:[],this._share=t}var t,n;return t=e,(n=[{key:"state",get:function(){return this._share}},{key:"id",get:function(){return this._share.id}},{key:"type",get:function(){return this._share.share_type}},{key:"permissions",get:function(){return this._share.permissions},set:function(e){this._share.permissions=e}},{key:"attributes",get:function(){return this._share.attributes}},{key:"owner",get:function(){return this._share.uid_owner}},{key:"ownerDisplayName",get:function(){return this._share.displayname_owner}},{key:"shareWith",get:function(){return this._share.share_with}},{key:"shareWithDisplayName",get:function(){return this._share.share_with_displayname||this._share.share_with}},{key:"shareWithDisplayNameUnique",get:function(){return this._share.share_with_displayname_unique||this._share.share_with}},{key:"shareWithLink",get:function(){return this._share.share_with_link}},{key:"shareWithAvatar",get:function(){return this._share.share_with_avatar}},{key:"uidFileOwner",get:function(){return this._share.uid_file_owner}},{key:"displaynameFileOwner",get:function(){return this._share.displayname_file_owner||this._share.uid_file_owner}},{key:"createdTime",get:function(){return this._share.stime}},{key:"expireDate",get:function(){return this._share.expiration},set:function(e){this._share.expiration=e}},{key:"token",get:function(){return this._share.token}},{key:"note",get:function(){return this._share.note},set:function(e){this._share.note=e}},{key:"label",get:function(){return this._share.label},set:function(e){this._share.label=e}},{key:"mailSend",get:function(){return!0===this._share.mail_send}},{key:"hideDownload",get:function(){return!0===this._share.hide_download},set:function(e){this._share.hide_download=!0===e}},{key:"password",get:function(){return this._share.password},set:function(e){this._share.password=e}},{key:"passwordExpirationTime",get:function(){return this._share.password_expiration_time},set:function(e){this._share.password_expiration_time=e}},{key:"sendPasswordByTalk",get:function(){return this._share.send_password_by_talk},set:function(e){this._share.send_password_by_talk=e}},{key:"path",get:function(){return this._share.path}},{key:"itemType",get:function(){return this._share.item_type}},{key:"mimetype",get:function(){return this._share.mimetype}},{key:"fileSource",get:function(){return this._share.file_source}},{key:"fileTarget",get:function(){return this._share.file_target}},{key:"fileParent",get:function(){return this._share.file_parent}},{key:"hasReadPermission",get:function(){return!!(this.permissions&OC.PERMISSION_READ)}},{key:"hasCreatePermission",get:function(){return!!(this.permissions&OC.PERMISSION_CREATE)}},{key:"hasDeletePermission",get:function(){return!!(this.permissions&OC.PERMISSION_DELETE)}},{key:"hasUpdatePermission",get:function(){return!!(this.permissions&OC.PERMISSION_UPDATE)}},{key:"hasSharePermission",get:function(){return!!(this.permissions&OC.PERMISSION_SHARE)}},{key:"hasDownloadPermission",get:function(){for(var e in this._share.attributes){var t=this._share.attributes[e];if("permissions"===t.scope&&"download"===t.key)return t.enabled}return!0},set:function(e){this.setAttribute("permissions","download",!!e)}},{key:"setAttribute",value:function(e,t,n){var r={scope:e,key:t,enabled:n};for(var i in this._share.attributes){var a=this._share.attributes[i];if(a.scope===r.scope&&a.key===r.key)return void(this._share.attributes[i]=r)}this._share.attributes.push(r)}},{key:"canEdit",get:function(){return!0===this._share.can_edit}},{key:"canDelete",get:function(){return!0===this._share.can_delete}},{key:"viaFileid",get:function(){return this._share.via_fileid}},{key:"viaPath",get:function(){return this._share.via_path}},{key:"parent",get:function(){return this._share.parent}},{key:"storageId",get:function(){return this._share.storage_id}},{key:"storage",get:function(){return this._share.storage}},{key:"itemSource",get:function(){return this._share.item_source}},{key:"status",get:function(){return this._share.status}}])&&_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),w={data:function(){return{SHARE_TYPES:v.D}}},S=r(26932),E=r(76212),C=r.n(E),x=r(12945),k=r.n(x),P=r(15168),D=r.n(P),T={name:"SharingEntrySimple",components:{NcActions:k()},directives:{Tooltip:D()},props:{title:{type:String,default:"",required:!0},tooltip:{type:String,default:""},subtitle:{type:String,default:""},isUnique:{type:Boolean,default:!0},ariaExpanded:{type:Boolean,default:null}},computed:{ariaExpandedValue:function(){return null===this.ariaExpanded?this.ariaExpanded:this.ariaExpanded?"true":"false"}}},R=r(93379),N=r.n(R),O=r(7795),I=r.n(O),L=r(90569),H=r.n(L),U=r(3565),Y=r.n(U),j=r(19216),M=r.n(j),B=r(44589),W=r.n(B),q=r(60154),F={};F.styleTagTransform=W(),F.setAttributes=Y(),F.insert=H().bind(null,"head"),F.domAPI=I(),F.insertStyleElement=M(),N()(q.Z,F),q.Z&&q.Z.locals&&q.Z.locals;var Z=r(51900),$=(0,Z.Z)(T,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[e._t("avatar"),e._v(" "),t("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.tooltip,expression:"tooltip"}],staticClass:"sharing-entry__desc"},[t("span",{staticClass:"sharing-entry__title"},[e._v(e._s(e.title))]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t"+e._s(e.subtitle)+"\n\t\t")]):e._e()]),e._v(" "),e.$slots.default?t("NcActions",{ref:"actionsComponent",staticClass:"sharing-entry__actions",attrs:{"menu-align":"right","aria-expanded":e.ariaExpandedValue}},[e._t("default")],2):e._e()],2)}),[],!1,null,"73184f79",null).exports;function G(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}var V={name:"SharingEntryInternal",components:{NcActionLink:C(),SharingEntrySimple:$},props:{fileInfo:{type:Object,default:function(){},required:!0}},data:function(){return{copied:!1,copySuccess:!1}},computed:{internalLink:function(){return window.location.protocol+"//"+window.location.host+(0,l.generateUrl)("/f/")+this.fileInfo.id},clipboardTooltip:function(){return this.copied?this.copySuccess?"":t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing","Copy to clipboard")},internalLinkSubtitle:function(){return"dir"===this.fileInfo.type?t("files_sharing","Only works for users with access to this folder"):t("files_sharing","Only works for users with access to this file")}},methods:{copyLink:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.$copyText(n.internalLink);case 3:(0,S.s$)(t("files_sharing","Link copied")),n.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus(),n.copySuccess=!0,n.copied=!0,e.next=14;break;case 9:e.prev=9,e.t0=e.catch(0),n.copySuccess=!1,n.copied=!0,console.error(e.t0);case 14:return e.prev=14,setTimeout((function(){n.copySuccess=!1,n.copied=!1}),4e3),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,9,14,17]])})),function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){G(a,r,i,s,o,"next",e)}function o(e){G(a,r,i,s,o,"throw",e)}s(void 0)}))})()}}},K=V,Q=r(64344),z={};z.styleTagTransform=W(),z.setAttributes=Y(),z.insert=H().bind(null,"head"),z.domAPI=I(),z.insertStyleElement=M(),N()(Q.Z,z),Q.Z&&Q.Z.locals&&Q.Z.locals;var J=(0,Z.Z)(K,(function(){var e=this,t=e._self._c;return t("ul",[t("SharingEntrySimple",{ref:"shareEntrySimple",staticClass:"sharing-entry__internal",attrs:{title:e.t("files_sharing","Internal link"),subtitle:e.internalLinkSubtitle},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("div",{staticClass:"avatar-external icon-external-white"})]},proxy:!0}])},[e._v(" "),t("NcActionLink",{attrs:{href:e.internalLink,"aria-label":e.t("files_sharing","Copy internal link to clipboard"),target:"_blank",icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.preventDefault(),e.copyLink.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.clipboardTooltip)+"\n\t\t")])],1)],1)}),[],!1,null,"120e5240",null),X=J.exports,ee=r(45994),te=r(20296),ne=r.n(te),re=r(98266),ie=r.n(re);function ae(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){ae(a,r,i,s,o,"next",e)}function o(e){ae(a,r,i,s,o,"throw",e)}s(void 0)}))}}var oe=new g,ce="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789";function le(){return ue.apply(this,arguments)}function ue(){return(ue=se(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oe.passwordPolicy.api||!oe.passwordPolicy.api.generate){e.next=12;break}return e.prev=1,e.next=4,d.default.get(oe.passwordPolicy.api.generate);case 4:if(!(t=e.sent).data.ocs.data.password){e.next=7;break}return e.abrupt("return",t.data.ocs.data.password);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),console.info("Error generating password from password_policy",e.t0);case 12:return e.abrupt("return",Array(10).fill(0).reduce((function(e,t){return e+ce.charAt(Math.floor(Math.random()*ce.length))}),""));case 13:case"end":return e.stop()}}),e,null,[[1,9]])})))).apply(this,arguments)}function he(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){he(a,r,i,s,o,"next",e)}function o(e){he(a,r,i,s,o,"throw",e)}s(void 0)}))}}r(35449);var fe=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/shares"),pe={methods:{createShare:function(e){return de(regeneratorRuntime.mark((function n(){var r,i,a,s,o,c,l,u,h,f,p,m,g,v,y,_,A;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.path,i=e.permissions,a=e.shareType,s=e.shareWith,o=e.publicUpload,c=e.password,l=e.sendPasswordByTalk,u=e.expireDate,h=e.label,f=e.attributes,n.prev=1,n.next=4,d.default.post(fe,{path:r,permissions:i,shareType:a,shareWith:s,publicUpload:o,password:c,sendPasswordByTalk:l,expireDate:u,label:h,attributes:f});case 4:if(null!=(m=n.sent)&&null!==(p=m.data)&&void 0!==p&&p.ocs){n.next=7;break}throw m;case 7:return n.abrupt("return",new b(m.data.ocs.data));case 10:throw n.prev=10,n.t0=n.catch(1),console.error("Error while creating share",n.t0),A=null===n.t0||void 0===n.t0||null===(g=n.t0.response)||void 0===g||null===(v=g.data)||void 0===v||null===(y=v.ocs)||void 0===y||null===(_=y.meta)||void 0===_?void 0:_.message,OC.Notification.showTemporary(A?t("files_sharing","Error creating the share: {errorMessage}",{errorMessage:A}):t("files_sharing","Error creating the share"),{type:"error"}),n.t0;case 16:case"end":return n.stop()}}),n,null,[[1,10]])})))()},deleteShare:function(e){return de(regeneratorRuntime.mark((function n(){var r,i,a,s,o,c,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,d.default.delete(fe+"/".concat(e));case 3:if(null!=(i=n.sent)&&null!==(r=i.data)&&void 0!==r&&r.ocs){n.next=6;break}throw i;case 6:return n.abrupt("return",!0);case 9:throw n.prev=9,n.t0=n.catch(0),console.error("Error while deleting share",n.t0),l=null===n.t0||void 0===n.t0||null===(a=n.t0.response)||void 0===a||null===(s=a.data)||void 0===s||null===(o=s.ocs)||void 0===o||null===(c=o.meta)||void 0===c?void 0:c.message,OC.Notification.showTemporary(l?t("files_sharing","Error deleting the share: {errorMessage}",{errorMessage:l}):t("files_sharing","Error deleting the share"),{type:"error"}),n.t0;case 15:case"end":return n.stop()}}),n,null,[[0,9]])})))()},updateShare:function(e,n){return de(regeneratorRuntime.mark((function r(){var i,a,s,o,c,l,u,h;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,d.default.put(fe+"/".concat(e),n);case 3:if(null!=(a=r.sent)&&null!==(i=a.data)&&void 0!==i&&i.ocs){r.next=8;break}throw a;case 8:return r.abrupt("return",a.data.ocs.data);case 9:r.next=17;break;case 11:throw r.prev=11,r.t0=r.catch(0),console.error("Error while updating share",r.t0),400!==r.t0.response.status&&(u=null===r.t0||void 0===r.t0||null===(s=r.t0.response)||void 0===s||null===(o=s.data)||void 0===o||null===(c=o.ocs)||void 0===c||null===(l=c.meta)||void 0===l?void 0:l.message,OC.Notification.showTemporary(u?t("files_sharing","Error updating the share: {errorMessage}",{errorMessage:u}):t("files_sharing","Error updating the share"),{type:"error"})),h=r.t0.response.data.ocs.meta.message,new Error(h);case 17:case"end":return r.stop()}}),r,null,[[0,11]])})))()}}};function me(e){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(e)}function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ye(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==me(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==me(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===me(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function Ae(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){_e(a,r,i,s,o,"next",e)}function o(e){_e(a,r,i,s,o,"throw",e)}s(void 0)}))}}var be={name:"SharingInput",components:{NcMultiselect:ie()},mixins:[w,pe],props:{shares:{type:Array,default:function(){return[]},required:!0},linkShares:{type:Array,default:function(){return[]},required:!0},fileInfo:{type:Object,default:function(){},required:!0},reshare:{type:b,default:null},canReshare:{type:Boolean,required:!0}},data:function(){return{config:new g,loading:!1,query:"",recommendations:[],ShareSearch:OCA.Sharing.ShareSearch.state,suggestions:[]}},computed:{externalResults:function(){return this.ShareSearch.results},inputPlaceholder:function(){var e=this.config.isRemoteShareAllowed;return this.canReshare?e?t("files_sharing","Name, email, or Federated Cloud ID …"):t("files_sharing","Name or email …"):t("files_sharing","Resharing is not allowed")},isValidQuery:function(){return this.query&&""!==this.query.trim()&&this.query.length>this.config.minSearchStringLength},options:function(){return this.isValidQuery?this.suggestions:this.recommendations},noResultText:function(){return this.loading?t("files_sharing","Searching …"):t("files_sharing","No elements found.")}},mounted:function(){this.getRecommendations()},methods:{asyncFind:function(e,t){var n=this;return Ae(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.query=e.trim(),!n.isValidQuery){t.next=5;break}return n.loading=!0,t.next=5,n.debounceGetSuggestions(e);case 5:case"end":return t.stop()}}),t)})))()},getSuggestions:function(e){var n=arguments,r=this;return Ae(regeneratorRuntime.mark((function i(){var a,s,o,c,u,h,f,p,m,g,v,y,_;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=n.length>1&&void 0!==n[1]&&n[1],r.loading=!0,!0===OC.getCapabilities().files_sharing.sharee.query_lookup_default&&(a=!0),s=[r.SHARE_TYPES.SHARE_TYPE_USER,r.SHARE_TYPES.SHARE_TYPE_GROUP,r.SHARE_TYPES.SHARE_TYPE_REMOTE,r.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP,r.SHARE_TYPES.SHARE_TYPE_CIRCLE,r.SHARE_TYPES.SHARE_TYPE_ROOM,r.SHARE_TYPES.SHARE_TYPE_GUEST,r.SHARE_TYPES.SHARE_TYPE_DECK],!0===OC.getCapabilities().files_sharing.public.enabled&&s.push(r.SHARE_TYPES.SHARE_TYPE_EMAIL),o=null,i.prev=6,i.next=9,d.default.get((0,l.generateOcsUrl)("apps/files_sharing/api/v1/sharees"),{params:{format:"json",itemType:"dir"===r.fileInfo.type?"folder":"file",search:e,lookup:a,perPage:r.config.maxAutocompleteResults,shareType:s}});case 9:o=i.sent,i.next=16;break;case 12:return i.prev=12,i.t0=i.catch(6),console.error("Error fetching suggestions",i.t0),i.abrupt("return");case 16:c=o.data.ocs.data,u=o.data.ocs.data.exact,c.exact=[],h=Object.values(u).reduce((function(e,t){return e.concat(t)}),[]),f=Object.values(c).reduce((function(e,t){return e.concat(t)}),[]),p=r.filterOutExistingShares(h).map((function(e){return r.formatForMultiselect(e)})).sort((function(e,t){return e.shareType-t.shareType})),m=r.filterOutExistingShares(f).map((function(e){return r.formatForMultiselect(e)})).sort((function(e,t){return e.shareType-t.shareType})),g=[],c.lookupEnabled&&!a&&g.push({id:"global-lookup",isNoUser:!0,displayName:t("files_sharing","Search globally"),lookup:!0}),v=r.externalResults.filter((function(e){return!e.condition||e.condition(r)})),y=p.concat(m).concat(v).concat(g),_=y.reduce((function(e,t){return t.displayName?(e[t.displayName]||(e[t.displayName]=0),e[t.displayName]++,e):e}),{}),r.suggestions=y.map((function(e){return _[e.displayName]>1&&!e.desc?ve(ve({},e),{},{desc:e.shareWithDisplayNameUnique}):e})),r.loading=!1,console.info("suggestions",r.suggestions);case 31:case"end":return i.stop()}}),i,null,[[6,12]])})))()},debounceGetSuggestions:ne()((function(){this.getSuggestions.apply(this,arguments)}),300),getRecommendations:function(){var e=this;return Ae(regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=!0,n=null,t.prev=2,t.next=5,d.default.get((0,l.generateOcsUrl)("apps/files_sharing/api/v1/sharees_recommended"),{params:{format:"json",itemType:e.fileInfo.type}});case 5:n=t.sent,t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(2),console.error("Error fetching recommendations",t.t0),t.abrupt("return");case 12:r=e.externalResults.filter((function(t){return!t.condition||t.condition(e)})),i=Object.values(n.data.ocs.data.exact).reduce((function(e,t){return e.concat(t)}),[]),e.recommendations=e.filterOutExistingShares(i).map((function(t){return e.formatForMultiselect(t)})).concat(r),e.loading=!1,console.info("recommendations",e.recommendations);case 17:case"end":return t.stop()}}),t,null,[[2,8]])})))()},filterOutExistingShares:function(e){var t=this;return e.reduce((function(e,n){if("object"!==me(n))return e;try{if(n.value.shareType===t.SHARE_TYPES.SHARE_TYPE_USER){if(n.value.shareWith===(0,ee.ts)().uid)return e;if(t.reshare&&n.value.shareWith===t.reshare.owner)return e}if(n.value.shareType===t.SHARE_TYPES.SHARE_TYPE_EMAIL){if(-1!==t.linkShares.map((function(e){return e.shareWith})).indexOf(n.value.shareWith.trim()))return e}else{var r=t.shares.reduce((function(e,t){return e[t.shareWith]=t.type,e}),{}),i=n.value.shareWith.trim();if(i in r&&r[i]===n.value.shareType)return e}e.push(n)}catch(t){return e}return e}),[])},shareTypeToIcon:function(e){switch(e){case this.SHARE_TYPES.SHARE_TYPE_GUEST:return"icon-user";case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:case this.SHARE_TYPES.SHARE_TYPE_GROUP:return"icon-group";case this.SHARE_TYPES.SHARE_TYPE_EMAIL:return"icon-mail";case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:return"icon-circle";case this.SHARE_TYPES.SHARE_TYPE_ROOM:return"icon-room";case this.SHARE_TYPES.SHARE_TYPE_DECK:return"icon-deck";default:return""}},formatForMultiselect:function(e){var n,r;if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_USER&&this.config.shouldAlwaysShowUnique)n=null!==(r=e.shareWithDisplayNameUnique)&&void 0!==r?r:"";else if(e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE&&e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP||!e.value.server)if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_EMAIL)n=e.value.shareWith;else{var i;n=null!==(i=e.shareWithDescription)&&void 0!==i?i:""}else n=t("files_sharing","on {server}",{server:e.value.server});return{id:"".concat(e.value.shareType,"-").concat(e.value.shareWith),shareWith:e.value.shareWith,shareType:e.value.shareType,user:e.uuid||e.value.shareWith,isNoUser:e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_USER,displayName:e.name||e.label,subtitle:n,shareWithDisplayNameUnique:e.shareWithDisplayNameUnique||"",icon:this.shareTypeToIcon(e.value.shareType)}},addShare:function(e){var t=this;return Ae(regeneratorRuntime.mark((function n(){var r,i,a,s,o,c,l,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.lookup){n.next=5;break}return n.next=3,t.getSuggestions(t.query,!0);case 3:return t.$nextTick((function(){t.$refs.multiselect.$el.querySelector(".multiselect__input").focus()})),n.abrupt("return",!0);case 5:if(!e.handler){n.next=11;break}return n.next=8,e.handler(t);case 8:return r=n.sent,t.$emit("add:share",new b(r)),n.abrupt("return",!0);case 11:if(t.loading=!0,console.debug("Adding a new share from the input for",e),n.prev=13,o=null,!t.config.enforcePasswordForPublicLink||e.shareType!==t.SHARE_TYPES.SHARE_TYPE_EMAIL){n.next=19;break}return n.next=18,le();case 18:o=n.sent;case 19:return c=(t.fileInfo.path+"/"+t.fileInfo.name).replace("//","/"),n.next=22,t.createShare({path:c,shareType:e.shareType,shareWith:e.shareWith,password:o,permissions:t.fileInfo.sharePermissions&OC.getCapabilities().files_sharing.default_permissions,attributes:JSON.stringify(t.fileInfo.shareAttributes)});case 22:if(l=n.sent,!o){n.next=31;break}return l.newPassword=o,n.next=27,new Promise((function(e){t.$emit("add:share",l,e)}));case 27:n.sent.open=!0,n.next=32;break;case 31:t.$emit("add:share",l);case 32:return null!==(i=t.$refs.multiselect)&&void 0!==i&&null!==(a=i.$refs)&&void 0!==a&&null!==(s=a.VueMultiselect)&&void 0!==s&&s.search&&(t.$refs.multiselect.$refs.VueMultiselect.search=""),n.next=35,t.getRecommendations();case 35:n.next=43;break;case 37:n.prev=37,n.t0=n.catch(13),(u=t.$refs.multiselect.$el.querySelector("input"))&&u.focus(),t.query=e.shareWith,console.error("Error while adding new share",n.t0);case 43:return n.prev=43,t.loading=!1,n.finish(43);case 46:case"end":return n.stop()}}),n,null,[[13,37,43,46]])})))()}}},we=be,Se=r(7440),Ee={};Ee.styleTagTransform=W(),Ee.setAttributes=Y(),Ee.insert=H().bind(null,"head"),Ee.domAPI=I(),Ee.insertStyleElement=M(),N()(Se.Z,Ee),Se.Z&&Se.Z.locals&&Se.Z.locals;var Ce=(0,Z.Z)(we,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"sharing-search"},[t("label",{attrs:{for:"sharing-search-input"}},[e._v(e._s(e.t("files_sharing","Search for share recipients")))]),e._v(" "),t("NcMultiselect",{ref:"multiselect",staticClass:"sharing-search__input",attrs:{id:"sharing-search-input","clear-on-select":!0,disabled:!e.canReshare,"hide-selected":!0,"internal-search":!1,loading:e.loading,options:e.options,placeholder:e.inputPlaceholder,"preselect-first":!0,"preserve-search":!0,searchable:!0,"user-select":!0,"open-direction":"below",label:"displayName","track-by":"id"},on:{"search-change":e.asyncFind,select:e.addShare},scopedSlots:e._u([{key:"noOptions",fn:function(){return[e._v("\n\t\t\t"+e._s(e.t("files_sharing","No recommendations. Start typing."))+"\n\t\t")]},proxy:!0},{key:"noResult",fn:function(){return[e._v("\n\t\t\t"+e._s(e.noResultText)+"\n\t\t")]},proxy:!0}])})],1)}),[],!1,null,null,null).exports,xe=r(45400),ke=r.n(xe),Pe=r(65358),De=r(1162),Te=r.n(De),Re=r(25746);function Ne(e){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}function Oe(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function Ie(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){Oe(a,r,i,s,o,"next",e)}function o(e){Oe(a,r,i,s,o,"throw",e)}s(void 0)}))}}var Le={mixins:[pe,w],props:{fileInfo:{type:Object,default:function(){},required:!0},share:{type:b,default:null},isUnique:{type:Boolean,default:!0}},data:function(){var e;return{config:new g,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new Re.Z({concurrency:1}),reactiveState:null===(e=this.share)||void 0===e?void 0:e.state}},computed:{hasNote:{get:function(){return""!==this.share.note},set:function(e){this.share.note=e?null:""}},dateTomorrow:function(){return new Date((new Date).setDate((new Date).getDate()+1))},lang:function(){var e=window.dayNamesShort?window.dayNamesShort:["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],t=window.monthNamesShort?window.monthNamesShort:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."];return{formatLocale:{firstDayOfWeek:window.firstDay?window.firstDay:0,monthsShort:t,weekdaysMin:e,weekdaysShort:e},monthFormat:"MMM"}},isShareOwner:function(){return this.share&&this.share.owner===(0,ee.ts)().uid}},methods:{checkShare:function(e){return(!e.password||"string"==typeof e.password&&""!==e.password.trim())&&!(e.expirationDate&&!e.expirationDate.isValid())},parseDateString:function(e){var t;if(e)return new Date(null===(t=e.match(/([0-9]{4}-[0-9]{2}-[0-9]{2})/i))||void 0===t?void 0:t.pop())},formatDateToString:function(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())).toISOString().split("T")[0]},onExpirationChange:function(e){this.share.expireDate=this.formatDateToString(e),this.queueUpdate("expireDate")},onExpirationDisable:function(){this.share.expireDate="",this.queueUpdate("expireDate")},onNoteChange:function(e){this.$set(this.share,"newNote",e.trim())},onNoteSubmit:function(){this.share.newNote&&(this.share.note=this.share.newNote,this.$delete(this.share,"newNote"),(0,S.s$)(t("files_sharing","Share note saved")),this.queueUpdate("note"))},onDelete:function(){var e=this;return Ie(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e.loading=!0,e.open=!1,n.next=5,e.deleteShare(e.share.id);case 5:console.debug("Share deleted",e.share.id),r="file"===e.share.itemType?t("files_sharing",'File "{path}" has been unshared',{path:e.share.path}):t("files_sharing",'Folder "{path}" has been unshared',{path:e.share.path}),(0,S.s$)(r),e.$emit("remove:share",e.share),n.next=14;break;case 11:n.prev=11,n.t0=n.catch(0),e.open=!0;case 14:return n.prev=14,e.loading=!1,n.finish(14);case 17:case"end":return n.stop()}}),n,null,[[0,11,14,17]])})))()},queueUpdate:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(0!==n.length){if(this.share.id){var i={};return n.forEach((function(t){"object"===Ne(e.share[t])?i[t]=JSON.stringify(e.share[t]):i[t]=e.share[t].toString()})),void this.updateQueue.add(Ie(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.saving=!0,e.errors={},t.prev=2,t.next=5,e.updateShare(e.share.id,i);case 5:r=t.sent,n.indexOf("password")>=0&&(e.$delete(e.share,"newPassword"),e.share.passwordExpirationTime=r.password_expiration_time),e.$delete(e.errors,n[0]),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(2),(a=t.t0.message)&&""!==a&&e.onSyncError(n[0],a);case 14:return t.prev=14,e.saving=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[2,10,14,17]])}))))}console.debug("Updated local share",this.share)}},onSyncError:function(e,t){switch(this.open=!0,e){case"password":case"pending":case"expireDate":case"label":case"note":this.$set(this.errors,e,t);var n=this.$refs[e];if(n){n.$el&&(n=n.$el);var r=n.querySelector(".focusable");r&&r.focus()}break;case"sendPasswordByTalk":this.$set(this.errors,e,t),this.share.sendPasswordByTalk=!this.share.sendPasswordByTalk}},debounceQueueUpdate:ne()((function(e){this.queueUpdate(e)}),500)}},He={name:"SharingEntryInherited",components:{NcActionButton:ke(),NcActionLink:C(),NcActionText:Te(),NcAvatar:h(),SharingEntrySimple:$},mixins:[Le],props:{share:{type:b,required:!0}},computed:{viaFileTargetUrl:function(){return(0,l.generateUrl)("/f/{fileid}",{fileid:this.share.viaFileid})},viaFolderName:function(){return(0,Pe.EZ)(this.share.viaPath)}}},Ue=r(15547),Ye={};Ye.styleTagTransform=W(),Ye.setAttributes=Y(),Ye.insert=H().bind(null,"head"),Ye.domAPI=I(),Ye.insertStyleElement=M(),N()(Ue.Z,Ye),Ue.Z&&Ue.Z.locals&&Ue.Z.locals;var je=(0,Z.Z)(He,(function(){var e=this,t=e._self._c;return t("SharingEntrySimple",{key:e.share.id,staticClass:"sharing-entry__inherited",attrs:{title:e.share.shareWithDisplayName},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"tooltip-message":""}})]},proxy:!0}])},[e._v(" "),t("NcActionText",{attrs:{icon:"icon-user"}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Added by {initiator}",{initiator:e.share.ownerDisplayName}))+"\n\t")]),e._v(" "),e.share.viaPath&&e.share.viaFileid?t("NcActionLink",{attrs:{icon:"icon-folder",href:e.viaFileTargetUrl}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Via “{folder}”",{folder:e.viaFolderName}))+"\n\t")]):e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t")]):e._e()],1)}),[],!1,null,"2bbe78b4",null),Me=je.exports;function Be(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}var We={name:"SharingInherited",components:{NcActionButton:ke(),SharingEntryInherited:Me,SharingEntrySimple:$},props:{fileInfo:{type:Object,default:function(){},required:!0}},data:function(){return{loaded:!1,loading:!1,showInheritedShares:!1,shares:[]}},computed:{showInheritedSharesIcon:function(){return this.loading?"icon-loading-small":this.showInheritedShares?"icon-triangle-n":"icon-triangle-s"},mainTitle:function(){return t("files_sharing","Others with access")},subTitle:function(){return this.showInheritedShares&&0===this.shares.length?t("files_sharing","No other users with access found"):""},toggleTooltip:function(){return"dir"===this.fileInfo.type?t("files_sharing","Toggle list of others with access to this directory"):t("files_sharing","Toggle list of others with access to this file")},fullPath:function(){return"".concat(this.fileInfo.path,"/").concat(this.fileInfo.name).replace("//","/")}},watch:{fileInfo:function(){this.resetState()}},methods:{toggleInheritedShares:function(){this.showInheritedShares=!this.showInheritedShares,this.showInheritedShares?this.fetchInheritedShares():this.resetState()},fetchInheritedShares:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading=!0,e.prev=1,r=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/shares/inherited?format=json&path={path}",{path:n.fullPath}),e.next=5,d.default.get(r);case 5:i=e.sent,n.shares=i.data.ocs.data.map((function(e){return new b(e)})).sort((function(e,t){return t.createdTime-e.createdTime})),console.info(n.shares),n.loaded=!0,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),OC.Notification.showTemporary(t("files_sharing","Unable to fetch inherited shares"),{type:"error"});case 14:return e.prev=14,n.loading=!1,e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})),function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){Be(a,r,i,s,o,"next",e)}function o(e){Be(a,r,i,s,o,"throw",e)}s(void 0)}))})()},resetState:function(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]},removeShare:function(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}},qe=We,Fe=r(45057),Ze={};Ze.styleTagTransform=W(),Ze.setAttributes=Y(),Ze.insert=H().bind(null,"head"),Ze.domAPI=I(),Ze.insertStyleElement=M(),N()(Fe.Z,Ze),Fe.Z&&Fe.Z.locals&&Fe.Z.locals;var $e=(0,Z.Z)(qe,(function(){var e=this,t=e._self._c;return t("ul",{attrs:{id:"sharing-inherited-shares"}},[t("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:e.mainTitle,subtitle:e.subTitle,"aria-expanded":e.showInheritedShares},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[e._v(" "),t("NcActionButton",{attrs:{icon:e.showInheritedSharesIcon,"aria-label":e.mainTitle},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.toggleInheritedShares.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.toggleTooltip)+"\n\t\t")])],1),e._v(" "),e._l(e.shares,(function(n){return t("SharingEntryInherited",{key:n.id,attrs:{"file-info":e.fileInfo,share:n},on:{"remove:share":e.removeShare}})}))],2)}),[],!1,null,"2d3dafb9",null),Ge=$e.exports,Ve=r(81807),Ke=r.n(Ve),Qe=r(79570),ze=r.n(Qe),Je=r(875),Xe=r.n(Je),et=r(18074),tt=r.n(et),nt={name:"ExternalShareAction",props:{id:{type:String,required:!0},action:{type:Object,default:function(){return{}}},fileInfo:{type:Object,default:function(){},required:!0},share:{type:b,default:null}},computed:{data:function(){return this.action.data(this)}}},rt=(0,Z.Z)(nt,(function(){var e=this;return(0,e._self._c)(e.data.is,e._g(e._b({tag:"Component"},"Component",e.data,!1),e.action.handlers),[e._v("\n\t"+e._s(e.data.text)+"\n")])}),[],!1,null,null,null).exports,it=r(30158),at=r.n(it),st={NONE:0,READ:1,UPDATE:2,CREATE:4,DELETE:8,SHARE:16},ot={READ_ONLY:st.READ,UPLOAD_AND_UPDATE:st.READ|st.UPDATE|st.CREATE|st.DELETE,FILE_DROP:st.CREATE,ALL:st.UPDATE|st.CREATE|st.READ|st.DELETE|st.SHARE};function ct(e,t){return e!==st.NONE&&(e&t)===t}function lt(e){return!(!ct(e,st.READ)&&!ct(e,st.CREATE)||!ct(e,st.READ)&&(ct(e,st.UPDATE)||ct(e,st.DELETE)))}function ut(e,t){return ct(e,t)?function(e,t){return e&~t}(e,t):function(e,t){return e|t}(e,t)}var ht=r(55976),dt=r(32964),ft={name:"SharePermissionsEditor",components:{NcActionButton:ke(),NcActionCheckbox:Ke(),NcActionRadio:at(),Tune:ht.Z,ChevronLeft:dt.default},mixins:[Le],data:function(){return{randomFormName:Math.random().toString(27).substring(2),showCustomPermissionsForm:!1,atomicPermissions:st,bundledPermissions:ot}},computed:{sharePermissionsSummary:function(){var e=this;return Object.values(this.atomicPermissions).filter((function(t){return e.shareHasPermissions(t)})).map((function(t){switch(t){case e.atomicPermissions.CREATE:return e.t("files_sharing","Upload");case e.atomicPermissions.READ:return e.t("files_sharing","Read");case e.atomicPermissions.UPDATE:return e.t("files_sharing","Edit");case e.atomicPermissions.DELETE:return e.t("files_sharing","Delete");default:return null}})).filter((function(e){return null!==e})).join(", ")},sharePermissionsIsBundle:function(){var e=this;return Object.values(ot).map((function(t){return e.sharePermissionEqual(t)})).filter((function(e){return e})).length>0},sharePermissionsSetIsValid:function(){return lt(this.share.permissions)},isFolder:function(){return"dir"===this.fileInfo.type},fileHasCreatePermission:function(){return!!(this.fileInfo.permissions&st.CREATE)}},mounted:function(){this.showCustomPermissionsForm=!this.sharePermissionsIsBundle},methods:{sharePermissionEqual:function(e){return(this.share.permissions&~st.SHARE)===e},shareHasPermissions:function(e){return ct(this.share.permissions,e)},setSharePermissions:function(e){this.share.permissions=e,this.queueUpdate("permissions")},canToggleSharePermissions:function(e){return function(e,t){return lt(ut(e,t))}(this.share.permissions,e)},toggleSharePermissions:function(e){this.share.permissions=ut(this.share.permissions,e),lt(this.share.permissions)&&this.queueUpdate("permissions")}}},pt=r(73286),mt={};mt.styleTagTransform=W(),mt.setAttributes=Y(),mt.insert=H().bind(null,"head"),mt.domAPI=I(),mt.insertStyleElement=M(),N()(pt.Z,mt),pt.Z&&pt.Z.locals&&pt.Z.locals;var gt=(0,Z.Z)(ft,(function(){var e=this,t=e._self._c;return t("li",[t("ul",[e.isFolder?e._e():t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.UPDATE),disabled:e.saving},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.UPDATE)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t")]),e._v(" "),e.isFolder&&e.fileHasCreatePermission&&e.config.isPublicUploadEnabled?[e.showCustomPermissionsForm?t("span",{class:{error:!e.sharePermissionsSetIsValid}},[t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.READ),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.READ)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.READ)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Read"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.CREATE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.CREATE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.CREATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Upload"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.UPDATE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.UPDATE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.UPDATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Edit"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.DELETE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.DELETE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.DELETE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Delete"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{on:{click:function(t){e.showCustomPermissionsForm=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("ChevronLeft")]},proxy:!0}],null,!1,1018742195)},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Bundled permissions"))+"\n\t\t\t\t")])],1):[t("NcActionRadio",{attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.READ_ONLY),value:e.bundledPermissions.READ_ONLY,name:e.randomFormName,disabled:e.saving},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.READ_ONLY)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Read only"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionRadio",{attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.UPLOAD_AND_UPDATE),value:e.bundledPermissions.UPLOAD_AND_UPDATE,disabled:e.saving,name:e.randomFormName},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.UPLOAD_AND_UPDATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionRadio",{staticClass:"sharing-entry__action--public-upload",attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.FILE_DROP),value:e.bundledPermissions.FILE_DROP,disabled:e.saving,name:e.randomFormName},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.FILE_DROP)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","File drop (upload only)"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{title:e.t("files_sharing","Custom permissions")},on:{click:function(t){e.showCustomPermissionsForm=!0}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Tune")]},proxy:!0}],null,!1,961531849)},[e._v("\n\t\t\t\t\t"+e._s(e.sharePermissionsIsBundle?"":e.sharePermissionsSummary)+"\n\t\t\t\t")])]]:e._e()],2)])}),[],!1,null,"5e957d09",null).exports;function vt(e){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vt(e)}function yt(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function _t(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){yt(a,r,i,s,o,"next",e)}function o(e){yt(a,r,i,s,o,"throw",e)}s(void 0)}))}}var At={name:"SharingEntryLink",components:{NcActions:k(),NcActionButton:ke(),NcActionCheckbox:Ke(),NcActionInput:ze(),NcActionLink:C(),NcActionText:Te(),NcActionTextEditable:tt(),NcActionSeparator:Xe(),NcAvatar:h(),ExternalShareAction:rt,SharePermissionsEditor:gt},directives:{Tooltip:D()},mixins:[Le],props:{canReshare:{type:Boolean,default:!0}},data:function(){return{copySuccess:!0,copied:!1,pending:!1,ExternalLegacyLinkActions:OCA.Sharing.ExternalLinkActions.state,ExternalShareActions:OCA.Sharing.ExternalShareActions.state}},computed:{title:function(){if(this.share&&this.share.id){if(!this.isShareOwner&&this.share.ownerDisplayName)return this.isEmailShareType?t("files_sharing","{shareWith} by {initiator}",{shareWith:this.share.shareWith,initiator:this.share.ownerDisplayName}):t("files_sharing","Shared via link by {initiator}",{initiator:this.share.ownerDisplayName});if(this.share.label&&""!==this.share.label.trim())return this.isEmailShareType?t("files_sharing","Mail share ({label})",{label:this.share.label.trim()}):t("files_sharing","Share link ({label})",{label:this.share.label.trim()});if(this.isEmailShareType)return this.share.shareWith}return t("files_sharing","Share link")},subtitle:function(){return this.isEmailShareType&&this.title!==this.share.shareWith?this.share.shareWith:null},hasExpirationDate:{get:function(){return this.config.isDefaultExpireDateEnforced||!!this.share.expireDate},set:function(e){var t=this.config.defaultExpirationDate||new Date((new Date).setDate((new Date).getDate()+1));this.share.expireDate=e?this.formatDateToString(t):"",console.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced:function(){return this.config.isDefaultExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+this.config.defaultExpireDate)):null},isPasswordProtected:{get:function(){return this.config.enforcePasswordForPublicLink||!!this.share.password},set:function(e){var t=this;return _t(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=i.ZP,n.t1=t.share,!e){n.next=8;break}return n.next=5,le();case 5:n.t2=n.sent,n.next=9;break;case 8:n.t2="";case 9:n.t3=n.t2,n.t0.set.call(n.t0,n.t1,"password",n.t3),i.ZP.set(t.share,"newPassword",t.share.password);case 12:case"end":return n.stop()}}),n)})))()}},passwordExpirationTime:function(){if(null===this.share.passwordExpirationTime)return null;var e=moment(this.share.passwordExpirationTime);return!(e.diff(moment())<0)&&e.fromNow()},isTalkEnabled:function(){return void 0!==OC.appswebroots.spreed},isPasswordProtectedByTalkAvailable:function(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get:function(){return this.share.sendPasswordByTalk},set:function(e){var t=this;return _t(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.share.sendPasswordByTalk=e;case 1:case"end":return n.stop()}}),n)})))()}},isEmailShareType:function(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},canTogglePasswordProtectedByTalkAvailable:function(){return!(!this.isPasswordProtected||this.isEmailShareType&&!this.hasUnsavedPassword)},pendingPassword:function(){return this.config.enforcePasswordForPublicLink&&this.share&&!this.share.id},pendingExpirationDate:function(){return this.config.isDefaultExpireDateEnforced&&this.share&&!this.share.id},hasUnsavedPassword:function(){return void 0!==this.share.newPassword},shareLink:function(){return window.location.protocol+"//"+window.location.host+(0,l.generateUrl)("/s/")+this.share.token},clipboardTooltip:function(){return this.copied?this.copySuccess?"":t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing","Copy to clipboard")},externalLegacyLinkActions:function(){return this.ExternalLegacyLinkActions.actions},externalLinkActions:function(){return this.ExternalShareActions.actions.filter((function(e){return e.shareType.includes(v.D.SHARE_TYPE_LINK)||e.shareType.includes(v.D.SHARE_TYPE_EMAIL)}))},isPasswordPolicyEnabled:function(){return"object"===vt(this.config.passwordPolicy)},canChangeHideDownload:function(){return this.fileInfo.shareAttributes.some((function(e){return"download"===e.key&&"permissions"===e.scope&&!1===e.enabled}))}},methods:{onNewLinkShare:function(){var e=this;return _t(regeneratorRuntime.mark((function n(){var r,i,a,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.loading){n.next=2;break}return n.abrupt("return");case 2:if(r={share_type:v.D.SHARE_TYPE_LINK},e.config.isDefaultExpireDateEnforced&&(r.expiration=e.formatDateToString(e.config.defaultExpirationDate)),!e.config.enableLinkPasswordByDefault){n.next=8;break}return n.next=7,le();case 7:r.password=n.sent;case 8:if(!e.config.enforcePasswordForPublicLink&&!e.config.isDefaultExpireDateEnforced){n.next=33;break}if(e.pending=!0,!e.share||e.share.id){n.next=20;break}if(!e.checkShare(e.share)){n.next=17;break}return n.next=14,e.pushNewLinkShare(e.share,!0);case 14:return n.abrupt("return",!0);case 17:return e.open=!0,OC.Notification.showTemporary(t("files_sharing","Error, please enter proper password and/or expiration date")),n.abrupt("return",!1);case 20:if(!e.config.enforcePasswordForPublicLink){n.next=24;break}return n.next=23,le();case 23:r.password=n.sent;case 24:return i=new b(r),n.next=27,new Promise((function(t){e.$emit("add:share",i,t)}));case 27:a=n.sent,e.open=!1,e.pending=!1,a.open=!0,n.next=36;break;case 33:return s=new b(r),n.next=36,e.pushNewLinkShare(s);case 36:case"end":return n.stop()}}),n)})))()},pushNewLinkShare:function(e,n){var r=this;return _t(regeneratorRuntime.mark((function i(){var a,s,o,c,l,u,h,d,f;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(i.prev=0,!r.loading){i.next=3;break}return i.abrupt("return",!0);case 3:return r.loading=!0,r.errors={},a=(r.fileInfo.path+"/"+r.fileInfo.name).replace("//","/"),s={path:a,shareType:v.D.SHARE_TYPE_LINK,password:e.password,expireDate:e.expireDate,attributes:JSON.stringify(r.fileInfo.shareAttributes)},console.debug("Creating link share with options",s),i.next=10,r.createShare(s);case 10:if(o=i.sent,r.open=!1,console.debug("Link share created",o),!n){i.next=19;break}return i.next=16,new Promise((function(e){r.$emit("update:share",o,e)}));case 16:c=i.sent,i.next=22;break;case 19:return i.next=21,new Promise((function(e){r.$emit("add:share",o,e)}));case 21:c=i.sent;case 22:r.config.enforcePasswordForPublicLink||c.copyLink(),i.next=33;break;case 25:if(i.prev=25,i.t0=i.catch(0),f=null===i.t0||void 0===i.t0||null===(l=i.t0.response)||void 0===l||null===(u=l.data)||void 0===u||null===(h=u.ocs)||void 0===h||null===(d=h.meta)||void 0===d?void 0:d.message){i.next=32;break}return(0,S.x2)(t("sharing","Error while creating the share")),console.error(i.t0),i.abrupt("return");case 32:f.match(/password/i)?r.onSyncError("password",f):f.match(/date/i)?r.onSyncError("expireDate",f):r.onSyncError("pending",f);case 33:return i.prev=33,r.loading=!1,i.finish(33);case 36:case"end":return i.stop()}}),i,null,[[0,25,33,36]])})))()},onLabelChange:function(e){this.$set(this.share,"newLabel",e.trim())},onLabelSubmit:function(){"string"==typeof this.share.newLabel&&(this.share.label=this.share.newLabel,this.$delete(this.share,"newLabel"),(0,S.s$)(t("files_sharing","Share label saved")),this.queueUpdate("label"))},copyLink:function(){var e=this;return _t(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.$copyText(e.shareLink);case 3:(0,S.s$)(t("files_sharing","Link copied")),e.$refs.copyButton.$el.focus(),e.copySuccess=!0,e.copied=!0,n.next=14;break;case 9:n.prev=9,n.t0=n.catch(0),e.copySuccess=!1,e.copied=!0,console.error(n.t0);case 14:return n.prev=14,setTimeout((function(){e.copySuccess=!1,e.copied=!1}),4e3),n.finish(14);case 17:case"end":return n.stop()}}),n,null,[[0,9,14,17]])})))()},onPasswordChange:function(e){this.$set(this.share,"newPassword",e)},onPasswordDisable:function(){this.share.password="",this.$delete(this.share,"newPassword"),this.share.id&&this.queueUpdate("password")},onPasswordSubmit:function(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim(),(0,S.s$)(t("files_sharing","Share password saved")),this.queueUpdate("password"))},onPasswordProtectedByTalkChange:function(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim()),this.queueUpdate("sendPasswordByTalk","password")},onMenuClose:function(){this.onPasswordSubmit(),this.onNoteSubmit()},onCancel:function(){this.$emit("remove:share",this.share)}}},bt=At,wt=r(63665),St={};St.styleTagTransform=W(),St.setAttributes=Y(),St.insert=H().bind(null,"head"),St.domAPI=I(),St.insertStyleElement=M(),N()(wt.Z,St),wt.Z&&wt.Z.locals&&wt.Z.locals;var Et=(0,Z.Z)(bt,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":e.share}},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":!0,"icon-class":e.isEmailShareType?"avatar-link-share icon-mail-white":"avatar-link-share icon-public-white"}}),e._v(" "),t("div",{staticClass:"sharing-entry__desc"},[t("span",{staticClass:"sharing-entry__title",attrs:{title:e.title}},[e._v("\n\t\t\t"+e._s(e.title)+"\n\t\t")]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t"+e._s(e.subtitle)+"\n\t\t")]):e._e()]),e._v(" "),e.share&&!e.isEmailShareType&&e.share.token?t("NcActions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[t("NcActionLink",{attrs:{href:e.shareLink,target:"_blank","aria-label":e.t("files_sharing","Copy public link to clipboard"),icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.copyLink.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.clipboardTooltip)+"\n\t\t")])],1):e._e(),e._v(" "),e.pending||!e.pendingPassword&&!e.pendingExpirationDate?e.loading?t("div",{staticClass:"icon-loading-small sharing-entry__loading"}):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onMenuClose}},[e.share?[e.share.canEdit&&e.canReshare?[t("NcActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.label,show:e.errors.label,trigger:"manual",defaultContainer:".app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.label,\n\t\t\t\t\t\tshow: errors.label,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '.app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"label",class:{error:e.errors.label},attrs:{disabled:e.saving,"aria-label":e.t("files_sharing","Share label"),value:void 0!==e.share.newLabel?e.share.newLabel:e.share.label,icon:"icon-edit",maxlength:"255"},on:{"update:value":e.onLabelChange,submit:e.onLabelSubmit}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Share label"))+"\n\t\t\t\t")]),e._v(" "),t("SharePermissionsEditor",{attrs:{"can-reshare":e.canReshare,share:e.share,"file-info":e.fileInfo},on:{"update:share":function(t){e.share=t}}}),e._v(" "),t("NcActionSeparator"),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.share.hideDownload,disabled:e.saving||e.canChangeHideDownload},on:{"update:checked":function(t){return e.$set(e.share,"hideDownload",t)},change:function(t){return e.queueUpdate("hideDownload")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Hide download"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t\t\t"+e._s(e.config.enforcePasswordForPublicLink?e.t("files_sharing","Password protection (enforced)"):e.t("files_sharing","Password protect"))+"\n\t\t\t\t")]),e._v(" "),e.isPasswordProtected?t("NcActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.password,show:e.errors.password,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.password,\n\t\t\t\t\t\tshow: errors.password,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"password",staticClass:"share-link-password",class:{error:e.errors.password},attrs:{disabled:e.saving,required:e.config.enforcePasswordForPublicLink,value:e.hasUnsavedPassword?e.share.newPassword:"***************",icon:"icon-password",autocomplete:"new-password",type:e.hasUnsavedPassword?"text":"password"},on:{"update:value":e.onPasswordChange,submit:e.onPasswordSubmit}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isEmailShareType&&e.passwordExpirationTime?t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Password expires {passwordExpirationTime}",{passwordExpirationTime:e.passwordExpirationTime}))+"\n\t\t\t\t")]):e.isEmailShareType&&null!==e.passwordExpirationTime?t("NcActionText",{attrs:{icon:"icon-error"}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Password expired"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isPasswordProtectedByTalkAvailable?t("NcActionCheckbox",{staticClass:"share-link-password-talk-checkbox",attrs:{checked:e.isPasswordProtectedByTalk,disabled:!e.canTogglePasswordProtectedByTalkAvailable||e.saving},on:{"update:checked":function(t){e.isPasswordProtectedByTalk=t},change:e.onPasswordProtectedByTalkChange}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Video verification"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{staticClass:"share-link-expire-date-checkbox",attrs:{checked:e.hasExpirationDate,disabled:e.config.isDefaultExpireDateEnforced||e.saving},on:{"update:checked":function(t){e.hasExpirationDate=t},uncheck:e.onExpirationDisable}},[e._v("\n\t\t\t\t\t"+e._s(e.config.isDefaultExpireDateEnforced?e.t("files_sharing","Expiration date (enforced)"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcActionInput",{ref:"expireDate",staticClass:"share-link-expire-date",class:{error:e.errors.expireDate},attrs:{"is-native-picker":!0,"hide-label":!0,disabled:e.saving,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.hasNote,disabled:e.saving},on:{"update:checked":function(t){e.hasNote=t},uncheck:function(t){return e.queueUpdate("note")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.hasNote?t("NcActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.note,show:e.errors.note,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.note,\n\t\t\t\t\t\tshow: errors.note,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"note",class:{error:e.errors.note},attrs:{disabled:e.saving,placeholder:e.t("files_sharing","Enter a note for the share recipient"),value:e.share.newNote||e.share.note,icon:"icon-edit"},on:{"update:value":e.onNoteChange,submit:e.onNoteSubmit}}):e._e()]:e._e(),e._v(" "),t("NcActionSeparator"),e._v(" "),e._l(e.externalLinkActions,(function(n){return t("ExternalShareAction",{key:n.id,attrs:{id:n.id,action:n,"file-info":e.fileInfo,share:e.share}})})),e._v(" "),e._l(e.externalLegacyLinkActions,(function(n,r){var i=n.icon,a=n.url,s=n.name;return t("NcActionLink",{key:r,attrs:{href:a(e.shareLink),icon:i,target:"_blank"}},[e._v("\n\t\t\t\t"+e._s(s)+"\n\t\t\t")])})),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t\t")]):e._e(),e._v(" "),!e.isEmailShareType&&e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Add another link"))+"\n\t\t\t")]):e._e()]:e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{icon:e.loading?"icon-loading-small":"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create a new share link"))+"\n\t\t")]):e._e()],2):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onNewLinkShare}},[e.errors.pending?t("NcActionText",{class:{error:e.errors.pending},attrs:{icon:"icon-error"}},[e._v("\n\t\t\t"+e._s(e.errors.pending)+"\n\t\t")]):t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Please enter the following required information before creating the share"))+"\n\t\t")]),e._v(" "),e.pendingPassword?t("NcActionText",{attrs:{icon:"icon-password"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection (enforced)"))+"\n\t\t")]):e.config.enableLinkPasswordByDefault?t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingPassword||e.share.password?t("NcActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.password,show:e.errors.password,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\tcontent: errors.password,\n\t\t\t\tshow: errors.password,\n\t\t\t\ttrigger: 'manual',\n\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t}",modifiers:{auto:!0}}],staticClass:"share-link-password",attrs:{value:e.share.password,disabled:e.saving,required:e.config.enableLinkPasswordByDefault||e.config.enforcePasswordForPublicLink,minlength:e.isPasswordPolicyEnabled&&e.config.passwordPolicy.minLength,icon:"",autocomplete:"new-password"},on:{"update:value":function(t){return e.$set(e.share,"password",t)},submit:e.onNewLinkShare}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionText",{attrs:{icon:"icon-calendar-dark"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Expiration date (enforced)"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionInput",{staticClass:"share-link-expire-date",attrs:{disabled:e.saving,"is-native-picker":!0,"hide-label":!0,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t")]):e._e(),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-checkmark"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create share"))+"\n\t\t")]),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCancel.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t")])],1)],1)}),[],!1,null,"a30e9c06",null),Ct={name:"SharingLinkList",components:{SharingEntryLink:Et.exports},mixins:[w],props:{fileInfo:{type:Object,default:function(){},required:!0},shares:{type:Array,default:function(){return[]},required:!0},canReshare:{type:Boolean,required:!0}},data:function(){return{canLinkShare:OC.getCapabilities().files_sharing.public.enabled}},computed:{hasLinkShares:function(){var e=this;return this.shares.filter((function(t){return t.type===e.SHARE_TYPES.SHARE_TYPE_LINK})).length>0},hasShares:function(){return this.shares.length>0}},methods:{addShare:function(e,t){this.shares.unshift(e),this.awaitForShare(e,t)},awaitForShare:function(e,t){var n=this;this.$nextTick((function(){var r=n.$children.find((function(t){return t.share===e}));r&&t(r)}))},removeShare:function(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}},xt=(0,Z.Z)(Ct,(function(){var e=this,t=e._self._c;return e.canLinkShare?t("ul",{staticClass:"sharing-link-list"},[!e.hasLinkShares&&e.canReshare?t("SharingEntryLink",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo},on:{"add:share":e.addShare}}):e._e(),e._v(" "),e.hasShares?e._l(e.shares,(function(n,r){return t("SharingEntryLink",{key:n.id,attrs:{"can-reshare":e.canReshare,share:e.shares[r],"file-info":e.fileInfo},on:{"update:share":[function(t){return e.$set(e.shares,r,t)},function(t){return e.awaitForShare.apply(e,arguments)}],"add:share":function(t){return e.addShare.apply(e,arguments)},"remove:share":e.removeShare}})})):e._e()],2):e._e()}),[],!1,null,null,null),kt=xt.exports;function Pt(e){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(e)}var Dt={name:"SharingEntry",components:{NcActions:k(),NcActionButton:ke(),NcActionCheckbox:Ke(),NcActionInput:ze(),NcActionTextEditable:tt(),NcAvatar:h()},directives:{Tooltip:D()},mixins:[Le],data:function(){return{permissionsEdit:OC.PERMISSION_UPDATE,permissionsCreate:OC.PERMISSION_CREATE,permissionsDelete:OC.PERMISSION_DELETE,permissionsRead:OC.PERMISSION_READ,permissionsShare:OC.PERMISSION_SHARE}},computed:{title:function(){var e=this.share.shareWithDisplayName;return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?e+=" (".concat(t("files_sharing","group"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?e+=" (".concat(t("files_sharing","conversation"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE?e+=" (".concat(t("files_sharing","remote"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP?e+=" (".concat(t("files_sharing","remote group"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_GUEST&&(e+=" (".concat(t("files_sharing","guest"),")")),e},tooltip:function(){if(this.share.owner!==this.share.uidFileOwner){var e={user:this.share.shareWithDisplayName,owner:this.share.ownerDisplayName};return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?t("files_sharing","Shared with the group {user} by {owner}",e):this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?t("files_sharing","Shared with the conversation {user} by {owner}",e):t("files_sharing","Shared with {user} by {owner}",e)}return null},canHaveNote:function(){return!this.isRemote},isRemote:function(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE||this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP},canSetEdit:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_UPDATE||this.canEdit},canSetCreate:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_CREATE||this.canCreate},canSetDelete:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_DELETE||this.canDelete},canSetReshare:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_SHARE||this.canReshare},canSetDownload:function(){return this.fileInfo.canDownload()||this.canDownload},canEdit:{get:function(){return this.share.hasUpdatePermission},set:function(e){this.updatePermissions({isEditChecked:e})}},canCreate:{get:function(){return this.share.hasCreatePermission},set:function(e){this.updatePermissions({isCreateChecked:e})}},canDelete:{get:function(){return this.share.hasDeletePermission},set:function(e){this.updatePermissions({isDeleteChecked:e})}},canReshare:{get:function(){return this.share.hasSharePermission},set:function(e){this.updatePermissions({isReshareChecked:e})}},canDownload:{get:function(){return this.share.hasDownloadPermission},set:function(e){this.updatePermissions({isDownloadChecked:e})}},hasRead:{get:function(){return this.share.hasReadPermission}},isFolder:function(){return"dir"===this.fileInfo.type},hasExpirationDate:{get:function(){return this.config.isDefaultInternalExpireDateEnforced||!!this.share.expireDate},set:function(e){var t=this.config.defaultInternalExpirationDate||new Date((new Date).setDate((new Date).getDate()+1));this.share.expireDate=e?this.formatDateToString(t):"",console.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced:function(){return!this.isRemote&&this.config.isDefaultInternalExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+1+this.config.defaultInternalExpireDate)):this.config.isDefaultRemoteExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+1+this.config.defaultRemoteExpireDate)):null},hasStatus:function(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER&&"object"===Pt(this.share.status)&&!Array.isArray(this.share.status)},allowDownloadText:function(){return t("files_sharing","Allow download")},isSetDownloadButtonVisible:function(){return this.isFolder||["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation"].includes(this.fileInfo.mimetype)}},methods:{updatePermissions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isEditChecked,n=void 0===t?this.canEdit:t,r=e.isCreateChecked,i=void 0===r?this.canCreate:r,a=e.isDeleteChecked,s=void 0===a?this.canDelete:a,o=e.isReshareChecked,c=void 0===o?this.canReshare:o,l=e.isDownloadChecked,u=void 0===l?this.canDownload:l,h=0|(this.hasRead?this.permissionsRead:0)|(i?this.permissionsCreate:0)|(s?this.permissionsDelete:0)|(n?this.permissionsEdit:0)|(c?this.permissionsShare:0);this.share.permissions=h,this.share.hasDownloadPermission!==u&&(this.share.hasDownloadPermission=u),this.queueUpdate("permissions","attributes")},onMenuClose:function(){this.onNoteSubmit()}}},Tt=Dt,Rt=r(78054),Nt={};Nt.styleTagTransform=W(),Nt.setAttributes=Y(),Nt.insert=H().bind(null,"head"),Nt.domAPI=I(),Nt.insertStyleElement=M(),N()(Rt.Z,Nt),Rt.Z&&Rt.Z.locals&&Rt.Z.locals;var Ot=(0,Z.Z)(Tt,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":e.share.type!==e.SHARE_TYPES.SHARE_TYPE_USER,user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"tooltip-message":e.share.type===e.SHARE_TYPES.SHARE_TYPE_USER?e.share.shareWith:"","menu-position":"left",url:e.share.shareWithAvatar}}),e._v(" "),t(e.share.shareWithLink?"a":"div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.tooltip,expression:"tooltip",modifiers:{auto:!0}}],tag:"component",staticClass:"sharing-entry__desc",attrs:{href:e.share.shareWithLink}},[t("span",[e._v(e._s(e.title)),e.isUnique?e._e():t("span",{staticClass:"sharing-entry__desc-unique"},[e._v(" ("+e._s(e.share.shareWithDisplayNameUnique)+")")])]),e._v(" "),e.hasStatus?t("p",[t("span",[e._v(e._s(e.share.status.icon||""))]),e._v(" "),t("span",[e._v(e._s(e.share.status.message||""))])]):e._e()]),e._v(" "),t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right"},on:{close:e.onMenuClose}},[e.share.canEdit?[t("NcActionCheckbox",{ref:"canEdit",attrs:{checked:e.canEdit,value:e.permissionsEdit,disabled:e.saving||!e.canSetEdit},on:{"update:checked":function(t){e.canEdit=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t\t")]),e._v(" "),e.isFolder?t("NcActionCheckbox",{ref:"canCreate",attrs:{checked:e.canCreate,value:e.permissionsCreate,disabled:e.saving||!e.canSetCreate},on:{"update:checked":function(t){e.canCreate=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow creating"))+"\n\t\t\t")]):e._e(),e._v(" "),e.isFolder?t("NcActionCheckbox",{ref:"canDelete",attrs:{checked:e.canDelete,value:e.permissionsDelete,disabled:e.saving||!e.canSetDelete},on:{"update:checked":function(t){e.canDelete=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow deleting"))+"\n\t\t\t")]):e._e(),e._v(" "),e.config.isResharingAllowed?t("NcActionCheckbox",{ref:"canReshare",attrs:{checked:e.canReshare,value:e.permissionsShare,disabled:e.saving||!e.canSetReshare},on:{"update:checked":function(t){e.canReshare=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow resharing"))+"\n\t\t\t")]):e._e(),e._v(" "),e.isSetDownloadButtonVisible?t("NcActionCheckbox",{ref:"canDownload",attrs:{checked:e.canDownload,disabled:e.saving||!e.canSetDownload},on:{"update:checked":function(t){e.canDownload=t}}},[e._v("\n\t\t\t\t"+e._s(e.allowDownloadText)+"\n\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.hasExpirationDate,disabled:e.config.isDefaultInternalExpireDateEnforced||e.saving},on:{"update:checked":function(t){e.hasExpirationDate=t},uncheck:e.onExpirationDisable}},[e._v("\n\t\t\t\t"+e._s(e.config.isDefaultInternalExpireDateEnforced?e.t("files_sharing","Expiration date enforced"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcActionInput",{ref:"expireDate",class:{error:e.errors.expireDate},attrs:{"is-native-picker":!0,"hide-label":!0,disabled:e.saving,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t\t")]):e._e(),e._v(" "),e.canHaveNote?[t("NcActionCheckbox",{attrs:{checked:e.hasNote,disabled:e.saving},on:{"update:checked":function(t){e.hasNote=t},uncheck:function(t){return e.queueUpdate("note")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.hasNote?t("NcActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.note,show:e.errors.note,trigger:"manual"},expression:"{\n\t\t\t\t\t\tcontent: errors.note,\n\t\t\t\t\t\tshow: errors.note,\n\t\t\t\t\t\ttrigger: 'manual'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"note",class:{error:e.errors.note},attrs:{disabled:e.saving,value:e.share.newNote||e.share.note,icon:"icon-edit"},on:{"update:value":e.onNoteChange,submit:e.onNoteSubmit}}):e._e()]:e._e()]:e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t")]):e._e()],2)],1)}),[],!1,null,"708928fe",null);function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lt={name:"SharingList",components:{SharingEntry:Ot.exports},mixins:[w],props:{fileInfo:{type:Object,default:function(){},required:!0},shares:{type:Array,default:function(){return[]},required:!0}},computed:{hasShares:function(){return 0===this.shares.length},isUnique:function(){var e=this;return function(t){return(n=e.shares,function(e){if(Array.isArray(e))return It(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return It(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?It(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(n){return t.type===e.SHARE_TYPES.SHARE_TYPE_USER&&t.shareWithDisplayName===n.shareWithDisplayName})).length<=1;var n}}},methods:{removeShare:function(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}},Ht=(0,Z.Z)(Lt,(function(){var e=this,t=e._self._c;return t("ul",{staticClass:"sharing-sharee-list"},e._l(e.shares,(function(n){return t("SharingEntry",{key:n.id,attrs:{"file-info":e.fileInfo,share:n,"is-unique":e.isUnique(n)},on:{"remove:share":e.removeShare}})})),1)}),[],!1,null,null,null).exports;function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yt(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function jt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){Yt(a,r,i,s,o,"next",e)}function o(e){Yt(a,r,i,s,o,"throw",e)}s(void 0)}))}}var Mt={name:"SharingTab",components:{NcAvatar:h(),CollectionList:c.G,SharingEntryInternal:X,SharingEntrySimple:$,SharingInherited:Ge,SharingInput:Ce,SharingLinkList:kt,SharingList:Ht},mixins:[w],data:function(){return{config:new g,error:"",expirationInterval:null,loading:!0,fileInfo:null,reshare:null,sharedWithMe:{},shares:[],linkShares:[],sections:OCA.Sharing.ShareTabSections.getSections(),projectsEnabled:(0,f.j)("core","projects_enabled",!1)}},computed:{isSharedWithMe:function(){return Object.keys(this.sharedWithMe).length>0},canReshare:function(){return!!(this.fileInfo.permissions&OC.PERMISSION_SHARE)||!!(this.reshare&&this.reshare.hasSharePermission&&this.config.isResharingAllowed)}},methods:{update:function(e){var t=this;return jt(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.fileInfo=e,t.resetState(),t.getShares();case 3:case"end":return n.stop()}}),n)})))()},getShares:function(){var e=this;return jt(regeneratorRuntime.mark((function n(){var r,i,a,s,o,c,u,h,f,p,m,g;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e.loading=!0,r=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/shares"),i="json",a=(e.fileInfo.path+"/"+e.fileInfo.name).replace("//","/"),s=d.default.get(r,{params:{format:i,path:a,reshares:!0}}),o=d.default.get(r,{params:{format:i,path:a,shared_with_me:!0}}),n.next=9,Promise.all([s,o]);case 9:c=n.sent,y=2,u=function(e){if(Array.isArray(e))return e}(v=c)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,s,o=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}(v,y)||function(e,t){if(e){if("string"==typeof e)return Ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ut(e,t):void 0}}(v,y)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=u[0],f=u[1],e.loading=!1,e.processSharedWithMe(f),e.processShares(h),n.next=23;break;case 18:n.prev=18,n.t0=n.catch(0),null!==(p=n.t0.response.data)&&void 0!==p&&null!==(m=p.ocs)&&void 0!==m&&null!==(g=m.meta)&&void 0!==g&&g.message?e.error=n.t0.response.data.ocs.meta.message:e.error=t("files_sharing","Unable to load the shares list"),e.loading=!1,console.error("Error loading the shares list",n.t0);case 23:case"end":return n.stop()}var v,y}),n,null,[[0,18]])})))()},resetState:function(){clearInterval(this.expirationInterval),this.loading=!0,this.error="",this.sharedWithMe={},this.shares=[],this.linkShares=[]},updateExpirationSubtitle:function(e){var n=moment(e.expireDate).unix();this.$set(this.sharedWithMe,"subtitle",t("files_sharing","Expires {relativetime}",{relativetime:OC.Util.relativeModifiedDate(1e3*n)})),moment().unix()>n&&(clearInterval(this.expirationInterval),this.$set(this.sharedWithMe,"subtitle",t("files_sharing","this share just expired.")))},processShares:function(e){var t=this,n=e.data;if(n.ocs&&n.ocs.data&&n.ocs.data.length>0){var r=n.ocs.data.map((function(e){return new b(e)})).sort((function(e,t){return t.createdTime-e.createdTime}));this.linkShares=r.filter((function(e){return e.type===t.SHARE_TYPES.SHARE_TYPE_LINK||e.type===t.SHARE_TYPES.SHARE_TYPE_EMAIL})),this.shares=r.filter((function(e){return e.type!==t.SHARE_TYPES.SHARE_TYPE_LINK&&e.type!==t.SHARE_TYPES.SHARE_TYPE_EMAIL})),console.debug("Processed",this.linkShares.length,"link share(s)"),console.debug("Processed",this.shares.length,"share(s)")}},processSharedWithMe:function(e){var n=e.data;if(n.ocs&&n.ocs.data&&n.ocs.data[0]){var r=new b(n),i=function(e){return e.type===v.D.SHARE_TYPE_GROUP?t("files_sharing","Shared with you and the group {group} by {owner}",{group:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===v.D.SHARE_TYPE_CIRCLE?t("files_sharing","Shared with you and {circle} by {owner}",{circle:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===v.D.SHARE_TYPE_ROOM?e.shareWithDisplayName?t("files_sharing","Shared with you and the conversation {conversation} by {owner}",{conversation:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you in a conversation by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1})}(r),a=r.ownerDisplayName,s=r.owner;this.sharedWithMe={displayName:a,title:i,user:s},this.reshare=r,r.expireDate&&moment(r.expireDate).unix()>moment().unix()&&(this.updateExpirationSubtitle(r),this.expirationInterval=setInterval(this.updateExpirationSubtitle,1e4,r))}else this.fileInfo&&void 0!==this.fileInfo.shareOwnerId&&this.fileInfo.shareOwnerId!==OC.currentUser&&(this.sharedWithMe={displayName:this.fileInfo.shareOwner,title:t("files_sharing","Shared with you by {owner}",{owner:this.fileInfo.shareOwner},void 0,{escape:!1}),user:this.fileInfo.shareOwnerId})},addShare:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(e):this.shares.unshift(e),this.awaitForShare(e,t)},awaitForShare:function(e,t){var n=this.$refs.shareList;e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL&&(n=this.$refs.linkShareList),this.$nextTick((function(){var r=n.$children.find((function(t){return t.share===e}));r&&t(r)}))}}},Bt=Mt,Wt=r(27785),qt={};qt.styleTagTransform=W(),qt.setAttributes=Y(),qt.insert=H().bind(null,"head"),qt.domAPI=I(),qt.insertStyleElement=M(),N()(Wt.Z,qt),Wt.Z&&Wt.Z.locals&&Wt.Z.locals;var Ft=(0,Z.Z)(Bt,(function(){var e=this,t=e._self._c;return t("div",{class:{"icon-loading":e.loading}},[e.error?t("div",{staticClass:"emptycontent",class:{emptyContentWithSections:e.sections.length>0}},[t("div",{staticClass:"icon icon-error"}),e._v(" "),t("h2",[e._v(e._s(e.error))])]):t("div",{staticClass:"sharingTab__content"},[e.isSharedWithMe?t("SharingEntrySimple",e._b({staticClass:"sharing-entry__reshare",scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.sharedWithMe.user,"display-name":e.sharedWithMe.displayName,"tooltip-message":""}})]},proxy:!0}],null,!1,1656378807)},"SharingEntrySimple",e.sharedWithMe,!1)):e._e(),e._v(" "),e.loading?e._e():t("SharingInput",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,"link-shares":e.linkShares,reshare:e.reshare,shares:e.shares},on:{"add:share":e.addShare}}),e._v(" "),e.loading?e._e():t("SharingLinkList",{ref:"linkShareList",attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,shares:e.linkShares}}),e._v(" "),e.loading?e._e():t("SharingList",{ref:"shareList",attrs:{shares:e.shares,"file-info":e.fileInfo}}),e._v(" "),e.canReshare&&!e.loading?t("SharingInherited",{attrs:{"file-info":e.fileInfo}}):e._e(),e._v(" "),t("SharingEntryInternal",{attrs:{"file-info":e.fileInfo}}),e._v(" "),e.projectsEnabled&&e.fileInfo?t("CollectionList",{attrs:{id:"".concat(e.fileInfo.id),type:"file",name:e.fileInfo.name}}):e._e()],1),e._v(" "),e._l(e.sections,(function(n,r){return t("div",{key:r,ref:"section-"+r,refInFor:!0,staticClass:"sharingTab__additionalContent"},[t(n(e.$refs["section-"+r],e.fileInfo),{tag:"component",attrs:{"file-info":e.fileInfo}})],1)}))],2)}),[],!1,null,"59d829c2",null).exports;function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function $t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gt(r.key),r)}}function Gt(e){var t=function(e,t){if("object"!==Zt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Zt(t)?t:String(t)}var Vt=function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=void 0,(n=Gt(n="_state"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this._state={},this._state.results=[],console.debug("OCA.Sharing.ShareSearch initialized")}var t,n;return t=e,(n=[{key:"state",get:function(){return this._state}},{key:"addNewResult",value:function(e){return""!==e.displayName.trim()&&"function"==typeof e.handler?(this._state.results.push(e),!0):(console.error("Invalid search result provided",e),!1)}}])&&$t(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kt(e){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kt(e)}function Qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zt(r.key),r)}}function zt(e){var t=function(e,t){if("object"!==Kt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Kt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Kt(t)?t:String(t)}var Jt=function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=void 0,(n=zt(n="_state"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this._state={},this._state.actions=[],console.debug("OCA.Sharing.ExternalLinkActions initialized")}var t,n;return t=e,(n=[{key:"state",get:function(){return this._state}},{key:"registerAction",value:function(e){return console.warn("OCA.Sharing.ExternalLinkActions is deprecated, use OCA.Sharing.ExternalShareAction instead"),"object"===Kt(e)&&e.icon&&e.name&&e.url?(this._state.actions.push(e),!0):(console.error("Invalid action provided",e),!1)}}])&&Qt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Xt(e){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(e)}function en(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tn(r.key),r)}}function tn(e){var t=function(e,t){if("object"!==Xt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Xt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Xt(t)?t:String(t)}var nn=function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=void 0,(n=tn(n="_state"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this._state={},this._state.actions=[],console.debug("OCA.Sharing.ExternalShareActions initialized")}var t,n;return t=e,(n=[{key:"state",get:function(){return this._state}},{key:"registerAction",value:function(e){return"object"===Xt(e)&&"string"==typeof e.id&&"function"==typeof e.data&&Array.isArray(e.shareType)&&"object"===Xt(e.handlers)&&Object.values(e.handlers).every((function(e){return"function"==typeof e}))?this._state.actions.findIndex((function(t){return t.id===e.id}))>-1?(console.error("An action with the same id ".concat(e.id," already exists"),e),!1):(this._state.actions.push(e),!0):(console.error("Invalid action provided",e),!1)}}])&&en(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function rn(e){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rn(e)}function an(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sn(r.key),r)}}function sn(e){var t=function(e,t){if("object"!==rn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==rn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===rn(t)?t:String(t)}var on=function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=void 0,(n=sn(n="_sections"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this._sections=[]}var t,n;return t=e,(n=[{key:"registerSection",value:function(e){this._sections.push(e)}},{key:"getSections",value:function(){return this._sections}}])&&an(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),cn=r(44582);function ln(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}window.OCA.Sharing||(window.OCA.Sharing={}),Object.assign(window.OCA.Sharing,{ShareSearch:new Vt}),Object.assign(window.OCA.Sharing,{ExternalLinkActions:new Jt}),Object.assign(window.OCA.Sharing,{ExternalShareActions:new nn}),Object.assign(window.OCA.Sharing,{ShareTabSections:new on}),i.ZP.prototype.t=o.translate,i.ZP.prototype.n=o.translatePlural,i.ZP.use(s());var un=i.ZP.extend(Ft),hn=null;window.addEventListener("DOMContentLoaded",(function(){OCA.Files&&OCA.Files.Sidebar&&OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({id:"sharing",name:(0,o.translate)("files_sharing","Sharing"),iconSvg:cn,mount:function(e,t,n){return(r=regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return hn&&hn.$destroy(),hn=new un({parent:n}),r.next=4,hn.update(t);case 4:hn.$mount(e);case 5:case"end":return r.stop()}}),r)})),function(){var e=this,t=arguments;return new Promise((function(n,i){var a=r.apply(e,t);function s(e){ln(a,n,i,s,o,"next",e)}function o(e){ln(a,n,i,s,o,"throw",e)}s(void 0)}))})();var r},update:function(e){hn.update(e)},destroy:function(){hn.$destroy(),hn=null}}))}))},73286:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".error[data-v-5e957d09] .action-checkbox__label:before{border:1px solid var(--color-error)}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharePermissionsEditor.vue"],names:[],mappings:"AAEC,uDACC,mCAAA",sourcesContent:["\n.error {\n\t::v-deep .action-checkbox__label:before {\n\t\tborder: 1px solid var(--color-error);\n\t}\n}\n"],sourceRoot:""}]),t.Z=s},78054:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".sharing-entry[data-v-708928fe]{display:flex;align-items:center;height:44px}.sharing-entry__desc[data-v-708928fe]{display:flex;flex-direction:column;justify-content:space-between;padding:8px;line-height:1.2em}.sharing-entry__desc p[data-v-708928fe]{color:var(--color-text-maxcontrast)}.sharing-entry__desc-unique[data-v-708928fe]{color:var(--color-text-maxcontrast)}.sharing-entry__actions[data-v-708928fe]{margin-left:auto}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntry.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,WAAA,CACA,sCACC,YAAA,CACA,qBAAA,CACA,6BAAA,CACA,WAAA,CACA,iBAAA,CACA,wCACC,mCAAA,CAED,6CACC,mCAAA,CAGF,yCACC,gBAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\theight: 44px;\n\t&__desc {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tjustify-content: space-between;\n\t\tpadding: 8px;\n\t\tline-height: 1.2em;\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t\t&-unique {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\t&__actions {\n\t\tmargin-left: auto;\n\t}\n}\n"],sourceRoot:""}]),t.Z=s},15547:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".sharing-entry[data-v-2bbe78b4]{display:flex;align-items:center;height:44px}.sharing-entry__desc[data-v-2bbe78b4]{display:flex;flex-direction:column;justify-content:space-between;padding:8px;line-height:1.2em}.sharing-entry__desc p[data-v-2bbe78b4]{color:var(--color-text-maxcontrast)}.sharing-entry__actions[data-v-2bbe78b4]{margin-left:auto}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryInherited.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,WAAA,CACA,sCACC,YAAA,CACA,qBAAA,CACA,6BAAA,CACA,WAAA,CACA,iBAAA,CACA,wCACC,mCAAA,CAGF,yCACC,gBAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\theight: 44px;\n\t&__desc {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tjustify-content: space-between;\n\t\tpadding: 8px;\n\t\tline-height: 1.2em;\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\t&__actions {\n\t\tmargin-left: auto;\n\t}\n}\n"],sourceRoot:""}]),t.Z=s},64344:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".sharing-entry__internal .avatar-external[data-v-120e5240]{width:32px;height:32px;line-height:32px;font-size:18px;background-color:var(--color-text-maxcontrast);border-radius:50%;flex-shrink:0}.sharing-entry__internal .icon-checkmark-color[data-v-120e5240]{opacity:1}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryInternal.vue"],names:[],mappings:"AAEC,2DACC,UAAA,CACA,WAAA,CACA,gBAAA,CACA,cAAA,CACA,8CAAA,CACA,iBAAA,CACA,aAAA,CAED,gEACC,SAAA",sourcesContent:["\n.sharing-entry__internal {\n\t.avatar-external {\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tline-height: 32px;\n\t\tfont-size: 18px;\n\t\tbackground-color: var(--color-text-maxcontrast);\n\t\tborder-radius: 50%;\n\t\tflex-shrink: 0;\n\t}\n\t.icon-checkmark-color {\n\t\topacity: 1;\n\t}\n}\n"],sourceRoot:""}]),t.Z=s},63665:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".sharing-entry[data-v-a30e9c06]{display:flex;align-items:center;min-height:44px}.sharing-entry__desc[data-v-a30e9c06]{display:flex;flex-direction:column;justify-content:space-between;padding:8px;line-height:1.2em;overflow:hidden}.sharing-entry__desc p[data-v-a30e9c06]{color:var(--color-text-maxcontrast)}.sharing-entry__title[data-v-a30e9c06]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.sharing-entry:not(.sharing-entry--share) .sharing-entry__actions .new-share-link[data-v-a30e9c06]{border-top:1px solid var(--color-border)}.sharing-entry[data-v-a30e9c06] .avatar-link-share{background-color:var(--color-primary)}.sharing-entry .sharing-entry__action--public-upload[data-v-a30e9c06]{border-bottom:1px solid var(--color-border)}.sharing-entry__loading[data-v-a30e9c06]{width:44px;height:44px;margin:0;padding:14px;margin-left:auto}.sharing-entry .action-item[data-v-a30e9c06]{margin-left:auto}.sharing-entry .action-item~.action-item[data-v-a30e9c06],.sharing-entry .action-item~.sharing-entry__loading[data-v-a30e9c06]{margin-left:0}.sharing-entry .icon-checkmark-color[data-v-a30e9c06]{opacity:1}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryLink.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,eAAA,CACA,sCACC,YAAA,CACA,qBAAA,CACA,6BAAA,CACA,WAAA,CACA,iBAAA,CACA,eAAA,CAEA,wCACC,mCAAA,CAGF,uCACC,sBAAA,CACA,eAAA,CACA,kBAAA,CAIA,mGACC,wCAAA,CAIF,mDACC,qCAAA,CAGD,sEACC,2CAAA,CAGD,yCACC,UAAA,CACA,WAAA,CACA,QAAA,CACA,YAAA,CACA,gBAAA,CAKD,6CACC,gBAAA,CACA,+HAEC,aAAA,CAIF,sDACC,SAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\tmin-height: 44px;\n\t&__desc {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tjustify-content: space-between;\n\t\tpadding: 8px;\n\t\tline-height: 1.2em;\n\t\toverflow: hidden;\n\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\t&__title {\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t}\n\n\t&:not(.sharing-entry--share) &__actions {\n\t\t.new-share-link {\n\t\t\tborder-top: 1px solid var(--color-border);\n\t\t}\n\t}\n\n\t::v-deep .avatar-link-share {\n\t\tbackground-color: var(--color-primary);\n\t}\n\n\t.sharing-entry__action--public-upload {\n\t\tborder-bottom: 1px solid var(--color-border);\n\t}\n\n\t&__loading {\n\t\twidth: 44px;\n\t\theight: 44px;\n\t\tmargin: 0;\n\t\tpadding: 14px;\n\t\tmargin-left: auto;\n\t}\n\n\t// put menus to the left\n\t// but only the first one\n\t.action-item {\n\t\tmargin-left: auto;\n\t\t~ .action-item,\n\t\t~ .sharing-entry__loading {\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n\n\t.icon-checkmark-color {\n\t\topacity: 1;\n\t}\n}\n"],sourceRoot:""}]),t.Z=s},60154:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".sharing-entry[data-v-73184f79]{display:flex;align-items:center;min-height:44px}.sharing-entry__desc[data-v-73184f79]{padding:8px;line-height:1.2em;position:relative;flex:1 1;min-width:0}.sharing-entry__desc p[data-v-73184f79]{color:var(--color-text-maxcontrast)}.sharing-entry__title[data-v-73184f79]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:inherit}.sharing-entry__actions[data-v-73184f79]{margin-left:auto !important}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntrySimple.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,eAAA,CACA,sCACC,WAAA,CACA,iBAAA,CACA,iBAAA,CACA,QAAA,CACA,WAAA,CACA,wCACC,mCAAA,CAGF,uCACC,kBAAA,CACA,sBAAA,CACA,eAAA,CACA,iBAAA,CAED,yCACC,2BAAA",sourcesContent:["\n.sharing-entry {\n\tdisplay: flex;\n\talign-items: center;\n\tmin-height: 44px;\n\t&__desc {\n\t\tpadding: 8px;\n\t\tline-height: 1.2em;\n\t\tposition: relative;\n\t\tflex: 1 1;\n\t\tmin-width: 0;\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\t&__title {\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tmax-width: inherit;\n\t}\n\t&__actions {\n\t\tmargin-left: auto !important;\n\t}\n}\n"],sourceRoot:""}]),t.Z=s},7440:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".sharing-search{display:flex;flex-direction:column;margin-bottom:4px}.sharing-search label[for=sharing-search-input]{margin-bottom:2px}.sharing-search__input{width:100%;margin:10px 0}.sharing-search__input .multiselect__option span[lookup] .avatardiv{background-image:var(--icon-search-white);background-repeat:no-repeat;background-position:center;background-color:var(--color-text-maxcontrast) !important}.sharing-search__input .multiselect__option span[lookup] .avatardiv div{display:none}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingInput.vue"],names:[],mappings:"AACA,gBACC,YAAA,CACA,qBAAA,CACA,iBAAA,CAEA,gDACC,iBAAA,CAGD,uBACC,UAAA,CACA,aAAA,CAKE,oEACC,yCAAA,CACA,2BAAA,CACA,0BAAA,CACA,yDAAA,CACA,wEACC,YAAA",sourcesContent:['\n.sharing-search {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin-bottom: 4px;\n\n\tlabel[for="sharing-search-input"] {\n\t\tmargin-bottom: 2px;\n\t}\n\n\t&__input {\n\t\twidth: 100%;\n\t\tmargin: 10px 0;\n\n\t\t// properly style the lookup entry\n\t\t.multiselect__option {\n\t\t\tspan[lookup] {\n\t\t\t\t.avatardiv {\n\t\t\t\t\tbackground-image: var(--icon-search-white);\n\t\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\t\tbackground-position: center;\n\t\t\t\t\tbackground-color: var(--color-text-maxcontrast) !important;\n\t\t\t\t\tdiv {\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]),t.Z=s},45057:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".sharing-entry__inherited .avatar-shared[data-v-2d3dafb9]{width:32px;height:32px;line-height:32px;font-size:18px;background-color:var(--color-text-maxcontrast);border-radius:50%;flex-shrink:0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingInherited.vue"],names:[],mappings:"AAEC,0DACC,UAAA,CACA,WAAA,CACA,gBAAA,CACA,cAAA,CACA,8CAAA,CACA,iBAAA,CACA,aAAA",sourcesContent:["\n.sharing-entry__inherited {\n\t.avatar-shared {\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tline-height: 32px;\n\t\tfont-size: 18px;\n\t\tbackground-color: var(--color-text-maxcontrast);\n\t\tborder-radius: 50%;\n\t\tflex-shrink: 0;\n\t}\n}\n"],sourceRoot:""}]),t.Z=s},27785:function(e,t,n){var r=n(87537),i=n.n(r),a=n(23645),s=n.n(a)()(i());s.push([e.id,".emptyContentWithSections[data-v-59d829c2]{margin:1rem auto}.sharingTab__content[data-v-59d829c2]{padding:0 6px}.sharingTab__additionalContent[data-v-59d829c2]{margin:44px 0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingTab.vue"],names:[],mappings:"AACA,2CACC,gBAAA,CAIA,sCACC,aAAA,CAED,gDACC,aAAA",sourcesContent:["\n.emptyContentWithSections {\n\tmargin: 1rem auto;\n}\n\n.sharingTab {\n\t&__content {\n\t\tpadding: 0 6px;\n\t}\n\t&__additionalContent {\n\t\tmargin: 44px 0;\n\t}\n}\n"],sourceRoot:""}]),t.Z=s}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}i.m=n,i.amdD=function(){throw new Error("define cannot be used indirect")},i.amdO={},e=[],i.O=function(t,n,r,a){if(!n){var s=1/0;for(u=0;u<e.length;u++){n=e[u][0],r=e[u][1],a=e[u][2];for(var o=!0,c=0;c<n.length;c++)(!1&a||s>=a)&&Object.keys(i.O).every((function(e){return i.O[e](n[c])}))?n.splice(c--,1):(o=!1,a<s&&(s=a));if(o){e.splice(u--,1);var l=r();void 0!==l&&(t=l)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,r,a]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},i.j=7870,function(){i.b=document.baseURI||self.location.href;var e={7870:0};i.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,a,s=n[0],o=n[1],c=n[2],l=0;if(s.some((function(t){return 0!==e[t]}))){for(r in o)i.o(o,r)&&(i.m[r]=o[r]);if(c)var u=c(i)}for(t&&t(n);l<s.length;l++)a=s[l],i.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return i.O(u)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),i.nc=void 0;var a=i.O(void 0,[7874],(function(){return i(25564)}));a=i.O(a)}();
//# sourceMappingURL=files_sharing-files_sharing_tab.js.map?v=af7ad6cc49d6a3a9fbd9