server/core/js/dist/share_backend.js
John Molakvoæ (skjnldsv) a826176f79
Re-open popover on link password save failure
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-01-02 14:45:14 +01:00

24 lines
No EOL
129 KiB
JavaScript

!function(e){var a={};function n(t){if(a[t])return a[t].exports;var l=a[t]={i:t,l:!1,exports:{}};return e[t].call(l.exports,l,l.exports,n),l.l=!0,l.exports}n.m=e,n.c=a,n.d=function(e,a,t){n.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,a){if(1&a&&(e=n(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var l in e)n.d(t,l,function(a){return e[a]}.bind(null,l));return t},n.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(a,"a",a),a},n.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},n.p="",n(n.s=0)}([function(e,a,n){"use strict";n.r(a);n(1),n(2),n(3),n(4),n(5),n(6),n(7),n(8),n(9)},function(e,a){!function(){OC.Share||(OC.Share={},OC.Share.Types={});var e=OC.Backbone.Model.extend({defaults:{publicUploadEnabled:!1,enforcePasswordForPublicLink:OC.appConfig.core.enforcePasswordForPublicLink,enableLinkPasswordByDefault:OC.appConfig.core.enableLinkPasswordByDefault,isDefaultExpireDateEnforced:!0===OC.appConfig.core.defaultExpireDateEnforced,isDefaultExpireDateEnabled:!0===OC.appConfig.core.defaultExpireDateEnabled,isRemoteShareAllowed:OC.appConfig.core.remoteShareAllowed,isMailShareAllowed:void 0!==OC.appConfig.shareByMailEnabled,defaultExpireDate:OC.appConfig.core.defaultExpireDate,isResharingAllowed:OC.appConfig.core.resharingAllowed,isPasswordForMailSharesRequired:void 0!==OC.appConfig.shareByMail&&OC.appConfig.shareByMail.enforcePasswordProtection,allowGroupSharing:OC.appConfig.core.allowGroupSharing},isPublicUploadEnabled:function(){return"yes"===$("#filestable").data("allow-public-upload")},isShareWithLinkAllowed:function(){return"yes"===$("#allowShareWithLink").val()},getFederatedShareDocLink:function(){return OC.appConfig.core.federatedCloudShareDoc},getDefaultExpirationDateString:function(){var e="";if(this.get("isDefaultExpireDateEnabled")){var a=moment.utc(),n=this.get("defaultExpireDate");a.add(n,"days"),e=a.format("YYYY-MM-DD 00:00:00")}return e}});OC.Share.ShareConfigModel=e}()},function(e,a){function n(e){return(n="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})(e)}var t,l;t=Handlebars.template,(l=OC.Share.Templates=OC.Share.Templates||{}).sharedialoglinkshareview=t({1:function(e,a,n,t,l){var i,s=null!=a?a:e.nullContext||{};return'<ul class="shareWithList">\n'+(null!=(i=n.if.call(s,null!=a?a.nolinkShares:a,{name:"if",hash:{},fn:e.program(2,l,0),inverse:e.noop,data:l,loc:{start:{line:3,column:1},end:{line:17,column:8}}}))?i:"")+(null!=(i=n.each.call(s,null!=a?a.linkShares:a,{name:"each",hash:{},fn:e.program(7,l,0),inverse:e.noop,data:l,loc:{start:{line:18,column:1},end:{line:36,column:10}}}))?i:"")+"</ul>\n"},2:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d=e.escapeExpression;return'\t\t<li data-share-id="'+d("function"===n(o=null!=(o=t.newShareId||(null!=a?a.newShareId:a))?o:c)?o.call(r,{name:"newShareId",hash:{},data:i,loc:{start:{line:4,column:21},end:{line:4,column:35}}}):o)+'">\n\t\t\t<div class="avatar icon-public-white"></div>\n\t\t\t<span class="username">'+d("function"===n(o=null!=(o=t.newShareLabel||(null!=a?a.newShareLabel:a))?o:c)?o.call(r,{name:"newShareLabel",hash:{},data:i,loc:{start:{line:6,column:26},end:{line:6,column:43}}}):o)+'</span>\n\t\t\t<span class="sharingOptionsGroup">\n\t\t\t\t<div class="share-menu">\n\t\t\t\t\t<a href="#" class="icon icon-add new-share has-tooltip '+(null!=(s=t.if.call(r,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i,loc:{start:{line:9,column:60},end:{line:9,column:92}}}))?s:"")+'" title="'+d("function"===n(o=null!=(o=t.newShareTitle||(null!=a?a.newShareTitle:a))?o:c)?o.call(r,{name:"newShareTitle",hash:{},data:i,loc:{start:{line:9,column:101},end:{line:9,column:118}}}):o)+'"></a>\n\t\t\t\t\t<span class="icon icon-loading-small '+(null!=(s=t.unless.call(r,null!=a?a.showPending:a,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i,loc:{start:{line:10,column:42},end:{line:10,column:82}}}))?s:"")+'"></span>\n'+(null!=(s=t.if.call(r,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i,loc:{start:{line:11,column:5},end:{line:13,column:12}}}))?s:"")+"\t\t\t\t</div>\n\t\t\t</span>\n\t\t</li>\n"},3:function(e,a,n,t,l){return"hidden"},5:function(e,a,n,t,l){var i,s;return"\t\t\t\t\t\t"+(null!=(i="function"==typeof(s=null!=(s=n.pendingPopoverMenu||(null!=a?a.pendingPopoverMenu:a))?s:e.hooks.helperMissing)?s.call(null!=a?a:e.nullContext||{},{name:"pendingPopoverMenu",hash:{},data:l,loc:{start:{line:12,column:6},end:{line:12,column:30}}}):s)?i:"")+"\n"},7:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\t\t<li data-share-id="'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:19,column:21},end:{line:19,column:28}}}):o)+'">\n\t\t\t<div class="avatar icon-public-white"></div>\n\t\t\t<span class="username" title="'+h(n(o=null!=(o=t.linkShareCreationDate||(null!=a?a.linkShareCreationDate:a))?o:c)===d?o.call(r,{name:"linkShareCreationDate",hash:{},data:i,loc:{start:{line:21,column:33},end:{line:21,column:58}}}):o)+'">'+h(n(o=null!=(o=t.linkShareLabel||(null!=a?a.linkShareLabel:a))?o:c)===d?o.call(r,{name:"linkShareLabel",hash:{},data:i,loc:{start:{line:21,column:60},end:{line:21,column:78}}}):o)+'</span>\n\t\t\t\n\t\t\t<span class="sharingOptionsGroup">\n\t\t\t\t<a href="#" class="clipboard-button icon icon-clippy has-tooltip" data-clipboard-text="'+h(n(o=null!=(o=t.shareLinkURL||(null!=a?a.shareLinkURL:a))?o:c)===d?o.call(r,{name:"shareLinkURL",hash:{},data:i,loc:{start:{line:24,column:91},end:{line:24,column:107}}}):o)+'" title="'+h(n(o=null!=(o=t.copyLabel||(null!=a?a.copyLabel:a))?o:c)===d?o.call(r,{name:"copyLabel",hash:{},data:i,loc:{start:{line:24,column:116},end:{line:24,column:129}}}):o)+'"></a>\n\t\t\t\t<div class="share-menu">\n\t\t\t\t\t<a href="#" class="icon icon-more '+(null!=(s=t.if.call(r,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i,loc:{start:{line:26,column:39},end:{line:26,column:71}}}))?s:"")+'"></a>\n\t\t\t\t\t<span class="icon icon-loading-small '+(null!=(s=t.unless.call(r,null!=a?a.showPending:a,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i,loc:{start:{line:27,column:42},end:{line:27,column:82}}}))?s:"")+'"></span>\n'+(null!=(s=t.if.call(r,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.program(8,i,0),data:i,loc:{start:{line:28,column:5},end:{line:32,column:12}}}))?s:"")+"\t\t\t\t</div>\n\t\t\t</span>\n\t\t</li>\n"},8:function(e,a,n,t,l){var i,s;return"\t\t\t\t\t\t"+(null!=(i="function"==typeof(s=null!=(s=n.popoverMenu||(null!=a?a.popoverMenu:a))?s:e.hooks.helperMissing)?s.call(null!=a?a:e.nullContext||{},{name:"popoverMenu",hash:{},data:l,loc:{start:{line:31,column:6},end:{line:31,column:23}}}):s)?i:"")+"\n"},10:function(e,a,n,t,l){var i;return(null!=(i=n.if.call(null!=a?a:e.nullContext||{},null!=a?a.noSharingPlaceholder:a,{name:"if",hash:{},fn:e.program(11,l,0),inverse:e.noop,data:l,loc:{start:{line:39,column:0},end:{line:39,column:161}}}))?i:"")+"\n"},11:function(e,a,t,l,i){var s,o=null!=a?a:e.nullContext||{},r=e.hooks.helperMissing,c=e.escapeExpression;return'<input id="shareWith-'+c("function"===n(s=null!=(s=t.cid||(null!=a?a.cid:a))?s:r)?s.call(o,{name:"cid",hash:{},data:i,loc:{start:{line:39,column:49},end:{line:39,column:56}}}):s)+'" class="shareWithField" type="text" placeholder="'+c("function"===n(s=null!=(s=t.noSharingPlaceholder||(null!=a?a.noSharingPlaceholder:a))?s:r)?s.call(o,{name:"noSharingPlaceholder",hash:{},data:i,loc:{start:{line:39,column:106},end:{line:39,column:130}}}):s)+'" disabled="disabled" />'},compiler:[8,">= 4.3.0"],main:function(e,a,n,t,l){var i;return null!=(i=n.if.call(null!=a?a:e.nullContext||{},null!=a?a.shareAllowed:a,{name:"if",hash:{},fn:e.program(1,l,0),inverse:e.program(10,l,0),data:l,loc:{start:{line:1,column:0},end:{line:40,column:7}}}))?i:""},useData:!0}),l.sharedialoglinkshareview_popover_menu=t({1:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="radio" name="publicUpload" value="'+h(n(o=null!=(o=t.publicUploadRValue||(null!=a?a.publicUploadRValue:a))?o:c)===d?o.call(r,{name:"publicUploadRValue",hash:{},data:i,loc:{start:{line:12,column:52},end:{line:12,column:74}}}):o)+'" id="sharingDialogAllowPublicUpload-r-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:12,column:113},end:{line:12,column:120}}}):o)+'" class="radio publicUploadRadio" '+(null!=(s=n(o=null!=(o=t.publicUploadRChecked||(null!=a?a.publicUploadRChecked:a))?o:c)===d?o.call(r,{name:"publicUploadRChecked",hash:{},data:i,loc:{start:{line:12,column:154},end:{line:12,column:180}}}):o)?s:"")+' />\n\t\t\t\t\t<label for="sharingDialogAllowPublicUpload-r-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:13,column:50},end:{line:13,column:57}}}):o)+'">'+h(n(o=null!=(o=t.publicUploadRLabel||(null!=a?a.publicUploadRLabel:a))?o:c)===d?o.call(r,{name:"publicUploadRLabel",hash:{},data:i,loc:{start:{line:13,column:59},end:{line:13,column:81}}}):o)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="radio" name="publicUpload" value="'+h(n(o=null!=(o=t.publicUploadRWValue||(null!=a?a.publicUploadRWValue:a))?o:c)===d?o.call(r,{name:"publicUploadRWValue",hash:{},data:i,loc:{start:{line:19,column:52},end:{line:19,column:75}}}):o)+'" id="sharingDialogAllowPublicUpload-rw-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:19,column:115},end:{line:19,column:122}}}):o)+'" class="radio publicUploadRadio" '+(null!=(s=n(o=null!=(o=t.publicUploadRWChecked||(null!=a?a.publicUploadRWChecked:a))?o:c)===d?o.call(r,{name:"publicUploadRWChecked",hash:{},data:i,loc:{start:{line:19,column:156},end:{line:19,column:183}}}):o)?s:"")+' />\n\t\t\t\t\t<label for="sharingDialogAllowPublicUpload-rw-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:20,column:51},end:{line:20,column:58}}}):o)+'">'+h(n(o=null!=(o=t.publicUploadRWLabel||(null!=a?a.publicUploadRWLabel:a))?o:c)===d?o.call(r,{name:"publicUploadRWLabel",hash:{},data:i,loc:{start:{line:20,column:60},end:{line:20,column:83}}}):o)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="radio" name="publicUpload" value="'+h(n(o=null!=(o=t.publicUploadWValue||(null!=a?a.publicUploadWValue:a))?o:c)===d?o.call(r,{name:"publicUploadWValue",hash:{},data:i,loc:{start:{line:26,column:52},end:{line:26,column:74}}}):o)+'" id="sharingDialogAllowPublicUpload-w-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:26,column:113},end:{line:26,column:120}}}):o)+'" class="radio publicUploadRadio" '+(null!=(s=n(o=null!=(o=t.publicUploadWChecked||(null!=a?a.publicUploadWChecked:a))?o:c)===d?o.call(r,{name:"publicUploadWChecked",hash:{},data:i,loc:{start:{line:26,column:154},end:{line:26,column:180}}}):o)?s:"")+' />\n\t\t\t\t\t<label for="sharingDialogAllowPublicUpload-w-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:27,column:50},end:{line:27,column:57}}}):o)+'">'+h(n(o=null!=(o=t.publicUploadWLabel||(null!=a?a.publicUploadWLabel:a))?o:c)===d?o.call(r,{name:"publicUploadWLabel",hash:{},data:i,loc:{start:{line:27,column:59},end:{line:27,column:81}}}):o)+"</label>\n\t\t\t\t</span>\n\t\t\t</li>\n"},3:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d=e.escapeExpression;return'\t\t\t<li id="allowPublicEditingWrapper">\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="checkbox" name="allowPublicEditing" id="sharingDialogAllowPublicEditing-'+d("function"===n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:35,column:90},end:{line:35,column:97}}}):o)+'" class="checkbox publicEditingCheckbox" '+(null!=(s="function"===n(o=null!=(o=t.publicEditingChecked||(null!=a?a.publicEditingChecked:a))?o:c)?o.call(r,{name:"publicEditingChecked",hash:{},data:i,loc:{start:{line:35,column:138},end:{line:35,column:164}}}):o)?s:"")+' />\n\t\t\t\t\t<label for="sharingDialogAllowPublicEditing-'+d("function"===n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:36,column:49},end:{line:36,column:56}}}):o)+'">'+d("function"===n(o=null!=(o=t.publicEditingLabel||(null!=a?a.publicEditingLabel:a))?o:c)?o.call(r,{name:"publicEditingLabel",hash:{},data:i,loc:{start:{line:36,column:58},end:{line:36,column:80}}}):o)+"</label>\n\t\t\t\t</span>\n\t\t\t</li>\n"},5:function(e,a,n,t,l){return'checked="checked"'},7:function(e,a,n,t,l){return'disabled="disabled"'},9:function(e,a,n,t,l){return"hidden"},11:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<span class="shareOption menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="checkbox" name="passwordByTalk" id="passwordByTalk-'+d("function"===n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:66,column:69},end:{line:66,column:76}}}):o)+'" class="checkbox passwordByTalkCheckbox"\n\t\t\t\t\t'+(null!=(s=t.if.call(r,null!=a?a.isPasswordByTalkSet:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i,loc:{start:{line:67,column:5},end:{line:67,column:56}}}))?s:"")+' />\n\t\t\t\t\t<label for="passwordByTalk-'+d("function"===n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:68,column:32},end:{line:68,column:39}}}):o)+'">'+d("function"===n(o=null!=(o=t.passwordByTalkLabel||(null!=a?a.passwordByTalkLabel:a))?o:c)?o.call(r,{name:"passwordByTalkLabel",hash:{},data:i,loc:{start:{line:68,column:41},end:{line:68,column:64}}}):o)+"</label>\n\t\t\t\t</span>\n\t\t\t</li>\n"},13:function(e,a,n,t,l){return"datepicker"},15:function(e,a,n,t,l){var i;return e.escapeExpression("function"==typeof(i=null!=(i=n.expireDate||(null!=a?a.expireDate:a))?i:e.hooks.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"expireDate",hash:{},data:l,loc:{start:{line:84,column:77},end:{line:84,column:91}}}):i)},17:function(e,a,n,t,l){var i;return e.escapeExpression("function"==typeof(i=null!=(i=n.defaultExpireDate||(null!=a?a.defaultExpireDate:a))?i:e.hooks.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"defaultExpireDate",hash:{},data:l,loc:{start:{line:84,column:99},end:{line:84,column:120}}}):i)},19:function(e,a,n,t,l){return"readonly"},21:function(e,a,t,l,i){var s,o=null!=a?a:e.nullContext||{},r=e.hooks.helperMissing,c=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<a href="#" class="menuitem pop-up" data-url="'+c("function"===n(s=null!=(s=t.url||(null!=a?a.url:a))?s:r)?s.call(o,{name:"url",hash:{},data:i,loc:{start:{line:104,column:50},end:{line:104,column:57}}}):s)+'" data-window="'+c("function"===n(s=null!=(s=t.newWindow||(null!=a?a.newWindow:a))?s:r)?s.call(o,{name:"newWindow",hash:{},data:i,loc:{start:{line:104,column:72},end:{line:104,column:85}}}):s)+'">\n\t\t\t\t\t<span class="icon '+c("function"===n(s=null!=(s=t.iconClass||(null!=a?a.iconClass:a))?s:r)?s.call(o,{name:"iconClass",hash:{},data:i,loc:{start:{line:105,column:23},end:{line:105,column:36}}}):s)+'"></span>\n\t\t\t\t\t<span>'+c("function"===n(s=null!=(s=t.label||(null!=a?a.label:a))?s:r)?s.call(o,{name:"label",hash:{},data:i,loc:{start:{line:106,column:11},end:{line:106,column:20}}}):s)+"</span>\n\t\t\t\t</a>\n\t\t\t</li>\n"},compiler:[8,">= 4.3.0"],main:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'<div class="popovermenu menu">\n\t<ul>\n\t\t<li class="hidden linkTextMenu">\n\t\t\t<span class="menuitem icon-link-text">\n\t\t\t\t<input id="linkText-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:5,column:24},end:{line:5,column:31}}}):o)+'" class="linkText" type="text" readonly="readonly" value="'+h(n(o=null!=(o=t.shareLinkURL||(null!=a?a.shareLinkURL:a))?o:c)===d?o.call(r,{name:"shareLinkURL",hash:{},data:i,loc:{start:{line:5,column:89},end:{line:5,column:105}}}):o)+'" />\n\t\t\t</span>\n\t\t</li>\n'+(null!=(s=t.if.call(r,null!=a?a.publicUpload:a,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i,loc:{start:{line:8,column:2},end:{line:30,column:9}}}))?s:"")+(null!=(s=t.if.call(r,null!=a?a.publicEditing:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i,loc:{start:{line:31,column:2},end:{line:39,column:9}}}))?s:"")+'\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="checkbox" name="hideDownload" id="sharingDialogHideDownload-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:43,column:78},end:{line:43,column:85}}}):o)+'" class="checkbox hideDownloadCheckbox"\n\t\t\t\t\t'+(null!=(s=t.if.call(r,null!=a?a.hideDownload:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i,loc:{start:{line:44,column:5},end:{line:44,column:49}}}))?s:"")+' />\n\t\t\t\t\t<label for="sharingDialogHideDownload-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:45,column:43},end:{line:45,column:50}}}):o)+'">'+h(n(o=null!=(o=t.hideDownloadLabel||(null!=a?a.hideDownloadLabel:a))?o:c)===d?o.call(r,{name:"hideDownloadLabel",hash:{},data:i,loc:{start:{line:45,column:52},end:{line:45,column:73}}}):o)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<input type="checkbox" name="showPassword" id="showPassword-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:50,column:65},end:{line:50,column:72}}}):o)+'" class="checkbox showPasswordCheckbox"\n\t\t\t\t\t'+(null!=(s=t.if.call(r,null!=a?a.isPasswordSet:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i,loc:{start:{line:51,column:5},end:{line:51,column:50}}}))?s:"")+" "+(null!=(s=t.if.call(r,null!=a?a.isPasswordEnforced:a,{name:"if",hash:{},fn:e.program(7,i,0),inverse:e.noop,data:i,loc:{start:{line:51,column:51},end:{line:51,column:103}}}))?s:"")+' value="1" />\n\t\t\t\t\t<label for="showPassword-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:52,column:30},end:{line:52,column:37}}}):o)+'">'+h(n(o=null!=(o=t.enablePasswordLabel||(null!=a?a.enablePasswordLabel:a))?o:c)===d?o.call(r,{name:"enablePasswordLabel",hash:{},data:i,loc:{start:{line:52,column:39},end:{line:52,column:62}}}):o)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li class="'+(null!=(s=t.unless.call(r,null!=a?a.isPasswordSet:a,{name:"unless",hash:{},fn:e.program(9,i,0),inverse:e.noop,data:i,loc:{start:{line:55,column:14},end:{line:55,column:56}}}))?s:"")+' linkPassMenu">\n\t\t\t\t<span class="menuitem icon-share-pass">\n\t\t\t\t\t<input id="linkPassText-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:57,column:29},end:{line:57,column:36}}}):o)+'" class="linkPassText" type="password" placeholder="'+h(n(o=null!=(o=t.passwordPlaceholder||(null!=a?a.passwordPlaceholder:a))?o:c)===d?o.call(r,{name:"passwordPlaceholder",hash:{},data:i,loc:{start:{line:57,column:88},end:{line:57,column:111}}}):o)+'" autocomplete="new-password" />\n\t\t\t\t\t<input type="submit" class="icon-confirm share-pass-submit" value="" />\n\t\t\t\t\t<span class="icon icon-loading-small hidden"></span>\n\t\t\t\t</span>\n\t\t\t</li>\n'+(null!=(s=t.if.call(r,null!=a?a.showPasswordByTalkCheckBox:a,{name:"if",hash:{},fn:e.program(11,i,0),inverse:e.noop,data:i,loc:{start:{line:62,column:2},end:{line:71,column:9}}}))?s:"")+'\t\t<li>\n\t\t\t<span class="menuitem">\n\t\t\t\t<input id="expireDate-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:74,column:26},end:{line:74,column:33}}}):o)+'" type="checkbox" name="expirationDate" class="expireDate checkbox"\n\t\t\t\t'+(null!=(s=t.if.call(r,null!=a?a.hasExpireDate:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i,loc:{start:{line:75,column:4},end:{line:75,column:49}}}))?s:"")+" "+(null!=(s=t.if.call(r,null!=a?a.isExpirationEnforced:a,{name:"if",hash:{},fn:e.program(7,i,0),inverse:e.noop,data:i,loc:{start:{line:75,column:50},end:{line:75,column:104}}}))?s:"")+' />\n\t\t\t\t<label for="expireDate-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:76,column:27},end:{line:76,column:34}}}):o)+'">'+h(n(o=null!=(o=t.expireDateLabel||(null!=a?a.expireDateLabel:a))?o:c)===d?o.call(r,{name:"expireDateLabel",hash:{},data:i,loc:{start:{line:76,column:36},end:{line:76,column:55}}}):o)+'</label>\n\t\t\t</span>\n\t\t</li>\n\t\t<li class="'+(null!=(s=t.unless.call(r,null!=a?a.hasExpireDate:a,{name:"unless",hash:{},fn:e.program(9,i,0),inverse:e.noop,data:i,loc:{start:{line:79,column:13},end:{line:79,column:55}}}))?s:"")+'">\n\t\t\t<span class="menuitem icon-expiredate expirationDateContainer-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:80,column:65},end:{line:80,column:72}}}):o)+'">\n\t\t\t\t<label for="expirationDatePicker-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:81,column:37},end:{line:81,column:44}}}):o)+'" class="hidden-visually" value="'+h(n(o=null!=(o=t.expirationDate||(null!=a?a.expirationDate:a))?o:c)===d?o.call(r,{name:"expirationDate",hash:{},data:i,loc:{start:{line:81,column:77},end:{line:81,column:95}}}):o)+'">'+h(n(o=null!=(o=t.expirationLabel||(null!=a?a.expirationLabel:a))?o:c)===d?o.call(r,{name:"expirationLabel",hash:{},data:i,loc:{start:{line:81,column:97},end:{line:81,column:116}}}):o)+'</label>\n\t\t\t\t\x3c!-- do not use the datepicker if enforced --\x3e\n\t\t\t\t<input id="expirationDatePicker-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:83,column:36},end:{line:83,column:43}}}):o)+'" class="'+(null!=(s=t.unless.call(r,null!=a?a.isExpirationEnforced:a,{name:"unless",hash:{},fn:e.program(13,i,0),inverse:e.noop,data:i,loc:{start:{line:83,column:52},end:{line:83,column:105}}}))?s:"")+'" type="text"\n\t\t\t\t\tplaceholder="'+h(n(o=null!=(o=t.expirationDatePlaceholder||(null!=a?a.expirationDatePlaceholder:a))?o:c)===d?o.call(r,{name:"expirationDatePlaceholder",hash:{},data:i,loc:{start:{line:84,column:18},end:{line:84,column:47}}}):o)+'" value="'+(null!=(s=t.if.call(r,null!=a?a.hasExpireDate:a,{name:"if",hash:{},fn:e.program(15,i,0),inverse:e.program(17,i,0),data:i,loc:{start:{line:84,column:56},end:{line:84,column:127}}}))?s:"")+'"\n\t\t\t\t\tdata-max-date="'+h(n(o=null!=(o=t.maxDate||(null!=a?a.maxDate:a))?o:c)===d?o.call(r,{name:"maxDate",hash:{},data:i,loc:{start:{line:85,column:20},end:{line:85,column:31}}}):o)+'" '+(null!=(s=t.if.call(r,null!=a?a.isExpirationEnforced:a,{name:"if",hash:{},fn:e.program(19,i,0),inverse:e.noop,data:i,loc:{start:{line:85,column:33},end:{line:85,column:76}}}))?s:"")+' />\n\t\t\t</span>\n\t\t\t</li>\n\t\t<li>\n\t\t\t<a href="#" class="share-add">\n\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t<span class="icon icon-edit"></span>\n\t\t\t\t<span>'+h(n(o=null!=(o=t.addNoteLabel||(null!=a?a.addNoteLabel:a))?o:c)===d?o.call(r,{name:"addNoteLabel",hash:{},data:i,loc:{start:{line:92,column:10},end:{line:92,column:26}}}):o)+'</span>\n\t\t\t\t<input type="button" class="share-note-delete icon-delete '+(null!=(s=t.unless.call(r,null!=a?a.hasNote:a,{name:"unless",hash:{},fn:e.program(9,i,0),inverse:e.noop,data:i,loc:{start:{line:93,column:62},end:{line:93,column:98}}}))?s:"")+'">\n\t\t\t</a>\n\t\t</li>\n\t\t<li class="share-note-form share-note-link '+(null!=(s=t.unless.call(r,null!=a?a.hasNote:a,{name:"unless",hash:{},fn:e.program(9,i,0),inverse:e.noop,data:i,loc:{start:{line:96,column:45},end:{line:96,column:81}}}))?s:"")+'">\n\t\t\t<span class="menuitem icon-note">\n\t\t\t\t<textarea class="share-note">'+h(n(o=null!=(o=t.shareNote||(null!=a?a.shareNote:a))?o:c)===d?o.call(r,{name:"shareNote",hash:{},data:i,loc:{start:{line:98,column:33},end:{line:98,column:46}}}):o)+'</textarea>\n\t\t\t\t<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-'+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:99,column:86},end:{line:99,column:97}}}):o)+'" />\n\t\t\t</span>\n\t\t</li>\n'+(null!=(s=t.each.call(r,null!=a?a.social:a,{name:"each",hash:{},fn:e.program(21,i,0),inverse:e.noop,data:i,loc:{start:{line:102,column:2},end:{line:109,column:11}}}))?s:"")+'\t\t<li>\n\t\t\t<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span>'+h(n(o=null!=(o=t.unshareLinkLabel||(null!=a?a.unshareLinkLabel:a))?o:c)===d?o.call(r,{name:"unshareLinkLabel",hash:{},data:i,loc:{start:{line:111,column:122},end:{line:111,column:142}}}):o)+'</span></a>\n\t\t</li>\n\t\t<li>\n\t\t\t<a href="#" class="new-share">\n\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t<span class="icon icon-add"></span>\n\t\t\t\t<span>'+h(n(o=null!=(o=t.newShareLabel||(null!=a?a.newShareLabel:a))?o:c)===d?o.call(r,{name:"newShareLabel",hash:{},data:i,loc:{start:{line:117,column:10},end:{line:117,column:27}}}):o)+"</span>\n\t\t\t</a>\n\t\t</li>\n\t</ul>\n</div>\n"},useData:!0}),l.sharedialoglinkshareview_popover_menu_pending=t({1:function(e,a,t,l,i){var s,o=null!=a?a:e.nullContext||{},r=e.hooks.helperMissing,c=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<span class="menuitem icon-info">\n\t\t\t\t\t<p>'+c("function"===n(s=null!=(s=t.enforcedPasswordLabel||(null!=a?a.enforcedPasswordLabel:a))?s:r)?s.call(o,{name:"enforcedPasswordLabel",hash:{},data:i,loc:{start:{line:6,column:8},end:{line:6,column:33}}}):s)+'</p>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li class="linkPassMenu">\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<form autocomplete="off" class="enforcedPassForm">\n\t\t\t\t\t\t<input id="enforcedPassText" required class="enforcedPassText" type="password"\n\t\t\t\t\t\t\tplaceholder="'+c("function"===n(s=null!=(s=t.passwordPlaceholder||(null!=a?a.passwordPlaceholder:a))?s:r)?s.call(o,{name:"passwordPlaceholder",hash:{},data:i,loc:{start:{line:13,column:20},end:{line:13,column:43}}}):s)+'" autocomplete="enforcedPassText" minlength="'+c("function"===n(s=null!=(s=t.minPasswordLength||(null!=a?a.minPasswordLength:a))?s:r)?s.call(o,{name:"minPasswordLength",hash:{},data:i,loc:{start:{line:13,column:88},end:{line:13,column:109}}}):s)+'" />\n\t\t\t\t\t\t<input type="submit" value=" " class="primary icon-checkmark-white">\n\t\t\t\t\t</form>\n\t\t\t\t</span>\n\t\t\t</li>\n'},compiler:[8,">= 4.3.0"],main:function(e,a,n,t,l){var i;return'<div class="popovermenu open menu pending">\n\t<ul>\n'+(null!=(i=n.if.call(null!=a?a:e.nullContext||{},null!=a?a.isPasswordEnforced:a,{name:"if",hash:{},fn:e.program(1,l,0),inverse:e.noop,data:l,loc:{start:{line:3,column:2},end:{line:18,column:9}}}))?i:"")+"\t</ul>\n</div>\n"},useData:!0}),l.sharedialogresharerinfoview=t({1:function(e,a,n,t,l){var i;return'<div class="share-note">'+e.escapeExpression("function"==typeof(i=null!=(i=n.shareNote||(null!=a?a.shareNote:a))?i:e.hooks.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"shareNote",hash:{},data:l,loc:{start:{line:5,column:44},end:{line:5,column:57}}}):i)+"</div>"},compiler:[8,">= 4.3.0"],main:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d=e.escapeExpression;return'<span class="reshare">\n\t<div class="avatar" data-userName="'+d("function"===n(o=null!=(o=t.reshareOwner||(null!=a?a.reshareOwner:a))?o:c)?o.call(r,{name:"reshareOwner",hash:{},data:i,loc:{start:{line:2,column:36},end:{line:2,column:52}}}):o)+'"></div>\n\t'+d("function"===n(o=null!=(o=t.sharedByText||(null!=a?a.sharedByText:a))?o:c)?o.call(r,{name:"sharedByText",hash:{},data:i,loc:{start:{line:3,column:1},end:{line:3,column:17}}}):o)+"\n</span>\n"+(null!=(s=t.if.call(r,null!=a?a.hasShareNote:a,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i,loc:{start:{line:5,column:0},end:{line:5,column:70}}}))?s:"")+"\n"},useData:!0}),l.sharedialogshareelistview=t({1:function(e,a,n,t,l){var i;return null!=(i=n.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isShareWithCurrentUser:a,{name:"unless",hash:{},fn:e.program(2,l,0),inverse:e.noop,data:l,loc:{start:{line:3,column:8},end:{line:21,column:12}}}))?i:""},2:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\t\t<li data-share-id="'+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:4,column:21},end:{line:4,column:32}}}):o)+'" data-share-type="'+h(n(o=null!=(o=t.shareType||(null!=a?a.shareType:a))?o:c)===d?o.call(r,{name:"shareType",hash:{},data:i,loc:{start:{line:4,column:51},end:{line:4,column:64}}}):o)+'" data-share-with="'+h(n(o=null!=(o=t.shareWith||(null!=a?a.shareWith:a))?o:c)===d?o.call(r,{name:"shareWith",hash:{},data:i,loc:{start:{line:4,column:83},end:{line:4,column:96}}}):o)+'">\n\t\t\t<div class="avatar '+(null!=(s=t.if.call(r,null!=a?a.modSeed:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i,loc:{start:{line:5,column:22},end:{line:5,column:64}}}))?s:"")+'" data-username="'+h(n(o=null!=(o=t.shareWith||(null!=a?a.shareWith:a))?o:c)===d?o.call(r,{name:"shareWith",hash:{},data:i,loc:{start:{line:5,column:81},end:{line:5,column:94}}}):o)+'" data-avatar="'+h(n(o=null!=(o=t.shareWithAvatar||(null!=a?a.shareWithAvatar:a))?o:c)===d?o.call(r,{name:"shareWithAvatar",hash:{},data:i,loc:{start:{line:5,column:109},end:{line:5,column:128}}}):o)+'" data-displayname="'+h(n(o=null!=(o=t.shareWithDisplayName||(null!=a?a.shareWithDisplayName:a))?o:c)===d?o.call(r,{name:"shareWithDisplayName",hash:{},data:i,loc:{start:{line:5,column:148},end:{line:5,column:172}}}):o)+'" '+(null!=(s=t.if.call(r,null!=a?a.modSeed:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i,loc:{start:{line:5,column:174},end:{line:5,column:235}}}))?s:"")+'></div>\n\t\t\t<span class="username" title="'+h(n(o=null!=(o=t.shareWithTitle||(null!=a?a.shareWithTitle:a))?o:c)===d?o.call(r,{name:"shareWithTitle",hash:{},data:i,loc:{start:{line:6,column:33},end:{line:6,column:51}}}):o)+'">'+h(n(o=null!=(o=t.shareWithDisplayName||(null!=a?a.shareWithDisplayName:a))?o:c)===d?o.call(r,{name:"shareWithDisplayName",hash:{},data:i,loc:{start:{line:6,column:53},end:{line:6,column:77}}}):o)+"</span>\n"+(null!=(s=t.if.call(r,null!=a?a.canUpdateShareSettings:a,{name:"if",hash:{},fn:e.program(7,i,0),inverse:e.noop,data:i,loc:{start:{line:7,column:3},end:{line:19,column:10}}}))?s:"")+"\t\t</li>\n"},3:function(e,a,n,t,l){return"imageplaceholderseed"},5:function(e,a,t,l,i){var s,o=null!=a?a:e.nullContext||{},r=e.hooks.helperMissing,c=e.escapeExpression;return'data-seed="'+c("function"===n(s=null!=(s=t.shareWith||(null!=a?a.shareWith:a))?s:r)?s.call(o,{name:"shareWith",hash:{},data:i,loc:{start:{line:5,column:200},end:{line:5,column:213}}}):s)+" "+c("function"===n(s=null!=(s=t.shareType||(null!=a?a.shareType:a))?s:r)?s.call(o,{name:"shareType",hash:{},data:i,loc:{start:{line:5,column:214},end:{line:5,column:227}}}):s)+'"'},7:function(e,a,n,t,l){var i,s,o=null!=a?a:e.nullContext||{};return'\t\t\t<span class="sharingOptionsGroup">\n'+(null!=(i=n.if.call(o,null!=a?a.editPermissionPossible:a,{name:"if",hash:{},fn:e.program(8,l,0),inverse:e.noop,data:l,loc:{start:{line:9,column:4},end:{line:14,column:11}}}))?i:"")+'\t\t\t\t<div tabindex="0" class="share-menu"><span class="icon icon-more"></span>\n\t\t\t\t\t'+(null!=(i="function"==typeof(s=null!=(s=n.popoverMenu||(null!=a?a.popoverMenu:a))?s:e.hooks.helperMissing)?s.call(o,{name:"popoverMenu",hash:{},data:l,loc:{start:{line:16,column:5},end:{line:16,column:22}}}):s)?i:"")+"\n\t\t\t\t</div>\n\t\t\t</span>\n"},8:function(e,a,t,l,i){var s,o=null!=a?a:e.nullContext||{},r=e.hooks.helperMissing,c="function",d=e.escapeExpression;return'\t\t\t\t\t<span>\n\t\t\t\t\t\t<input id="canEdit-'+d(n(s=null!=(s=t.cid||(null!=a?a.cid:a))?s:r)===c?s.call(o,{name:"cid",hash:{},data:i,loc:{start:{line:11,column:25},end:{line:11,column:32}}}):s)+"-"+d(n(s=null!=(s=t.shareId||(null!=a?a.shareId:a))?s:r)===c?s.call(o,{name:"shareId",hash:{},data:i,loc:{start:{line:11,column:33},end:{line:11,column:44}}}):s)+'" type="checkbox" name="edit" class="permissions checkbox" />\n\t\t\t\t\t\t<label for="canEdit-'+d(n(s=null!=(s=t.cid||(null!=a?a.cid:a))?s:r)===c?s.call(o,{name:"cid",hash:{},data:i,loc:{start:{line:12,column:26},end:{line:12,column:33}}}):s)+"-"+d(n(s=null!=(s=t.shareId||(null!=a?a.shareId:a))?s:r)===c?s.call(o,{name:"shareId",hash:{},data:i,loc:{start:{line:12,column:34},end:{line:12,column:45}}}):s)+'">'+d(n(s=null!=(s=t.canEditLabel||(null!=a?a.canEditLabel:a))?s:r)===c?s.call(o,{name:"canEditLabel",hash:{},data:i,loc:{start:{line:12,column:47},end:{line:12,column:63}}}):s)+"</label>\n\t\t\t\t\t</span>\n"},10:function(e,a,t,l,i){var s,o=null!=a?a:e.nullContext||{},r=e.hooks.helperMissing,c="function",d=e.escapeExpression;return'\t\t<li data-share-id="'+d(n(s=null!=(s=t.shareId||(null!=a?a.shareId:a))?s:r)===c?s.call(o,{name:"shareId",hash:{},data:i,loc:{start:{line:24,column:21},end:{line:24,column:32}}}):s)+'" data-share-type="'+d(n(s=null!=(s=t.shareType||(null!=a?a.shareType:a))?s:r)===c?s.call(o,{name:"shareType",hash:{},data:i,loc:{start:{line:24,column:51},end:{line:24,column:64}}}):s)+'">\n\t\t\t<div class="avatar" data-username="'+d(n(s=null!=(s=t.shareInitiator||(null!=a?a.shareInitiator:a))?s:r)===c?s.call(o,{name:"shareInitiator",hash:{},data:i,loc:{start:{line:25,column:38},end:{line:25,column:56}}}):s)+'"></div>\n\t\t\t<span class="has-tooltip username" title="'+d(n(s=null!=(s=t.shareInitiator||(null!=a?a.shareInitiator:a))?s:r)===c?s.call(o,{name:"shareInitiator",hash:{},data:i,loc:{start:{line:26,column:45},end:{line:26,column:63}}}):s)+'">'+d(n(s=null!=(s=t.shareInitiatorText||(null!=a?a.shareInitiatorText:a))?s:r)===c?s.call(o,{name:"shareInitiatorText",hash:{},data:i,loc:{start:{line:26,column:65},end:{line:26,column:87}}}):s)+'</span>\n\t\t\t<span class="sharingOptionsGroup">\n\t\t\t\t<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">'+d(n(s=null!=(s=t.unshareLabel||(null!=a?a.unshareLabel:a))?s:r)===c?s.call(o,{name:"unshareLabel",hash:{},data:i,loc:{start:{line:28,column:147},end:{line:28,column:163}}}):s)+"</span></a>\n\t\t\t</span>\n\t\t</li>\n"},compiler:[8,">= 4.3.0"],main:function(e,a,n,t,l){var i,s=null!=a?a:e.nullContext||{};return'<ul id="shareWithList" class="shareWithList">\n'+(null!=(i=n.each.call(s,null!=a?a.sharees:a,{name:"each",hash:{},fn:e.program(1,l,0),inverse:e.noop,data:l,loc:{start:{line:2,column:1},end:{line:22,column:10}}}))?i:"")+(null!=(i=n.each.call(s,null!=a?a.linkReshares:a,{name:"each",hash:{},fn:e.program(10,l,0),inverse:e.noop,data:l,loc:{start:{line:23,column:1},end:{line:31,column:10}}}))?i:"")+"</ul>\n"},useData:!0}),l.sharedialogshareelistview_popover_menu=t({1:function(e,a,n,t,l){var i;return" "+(null!=(i=n.if.call(null!=a?a:e.nullContext||{},null!=a?a.sharePermissionPossible:a,{name:"if",hash:{},fn:e.program(2,l,0),inverse:e.noop,data:l,loc:{start:{line:3,column:29},end:{line:10,column:22}}}))?i:"")+" "},2:function(e,a,n,t,l){var i;return" "+(null!=(i=n.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isMailShare:a,{name:"unless",hash:{},fn:e.program(3,l,0),inverse:e.noop,data:l,loc:{start:{line:3,column:61},end:{line:10,column:14}}}))?i:"")+" "},3:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\n\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<input id="canShare-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:6,column:25},end:{line:6,column:32}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:6,column:33},end:{line:6,column:44}}}):o)+'" type="checkbox" name="share" class="permissions checkbox" '+(null!=(s=t.if.call(r,null!=a?a.hasSharePermission:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i,loc:{start:{line:6,column:104},end:{line:6,column:154}}}))?s:"")+' data-permissions="'+h(n(o=null!=(o=t.sharePermission||(null!=a?a.sharePermission:a))?o:c)===d?o.call(r,{name:"sharePermission",hash:{},data:i,loc:{start:{line:6,column:173},end:{line:6,column:192}}}):o)+'" />\n\t\t\t\t\t<label for="canShare-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:7,column:26},end:{line:7,column:33}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:7,column:34},end:{line:7,column:45}}}):o)+'">'+h(n(o=null!=(o=t.canShareLabel||(null!=a?a.canShareLabel:a))?o:c)===d?o.call(r,{name:"canShareLabel",hash:{},data:i,loc:{start:{line:7,column:47},end:{line:7,column:64}}}):o)+"</label>\n\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t"},4:function(e,a,n,t,l){return'checked="checked"'},6:function(e,a,n,t,l){var i,s=null!=a?a:e.nullContext||{};return"\t\t\t"+(null!=(i=n.if.call(s,null!=a?a.createPermissionPossible:a,{name:"if",hash:{},fn:e.program(7,l,0),inverse:e.noop,data:l,loc:{start:{line:12,column:3},end:{line:19,column:21}}}))?i:"")+"\n\t\t\t"+(null!=(i=n.if.call(s,null!=a?a.updatePermissionPossible:a,{name:"if",hash:{},fn:e.program(10,l,0),inverse:e.noop,data:l,loc:{start:{line:20,column:3},end:{line:27,column:22}}}))?i:"")+"\n\t\t\t"+(null!=(i=n.if.call(s,null!=a?a.deletePermissionPossible:a,{name:"if",hash:{},fn:e.program(13,l,0),inverse:e.noop,data:l,loc:{start:{line:28,column:3},end:{line:35,column:22}}}))?i:"")+"\n"},7:function(e,a,n,t,l){var i;return null!=(i=n.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isMailShare:a,{name:"unless",hash:{},fn:e.program(8,l,0),inverse:e.noop,data:l,loc:{start:{line:12,column:35},end:{line:19,column:14}}}))?i:""},8:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\n\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="canCreate-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:15,column:27},end:{line:15,column:34}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:15,column:35},end:{line:15,column:46}}}):o)+'" type="checkbox" name="create" class="permissions checkbox" '+(null!=(s=t.if.call(r,null!=a?a.hasCreatePermission:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i,loc:{start:{line:15,column:107},end:{line:15,column:158}}}))?s:"")+' data-permissions="'+h(n(o=null!=(o=t.createPermission||(null!=a?a.createPermission:a))?o:c)===d?o.call(r,{name:"createPermission",hash:{},data:i,loc:{start:{line:15,column:177},end:{line:15,column:197}}}):o)+'"/>\n\t\t\t\t\t\t<label for="canCreate-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:16,column:28},end:{line:16,column:35}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:16,column:36},end:{line:16,column:47}}}):o)+'">'+h(n(o=null!=(o=t.createPermissionLabel||(null!=a?a.createPermissionLabel:a))?o:c)===d?o.call(r,{name:"createPermissionLabel",hash:{},data:i,loc:{start:{line:16,column:49},end:{line:16,column:74}}}):o)+"</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t"},10:function(e,a,n,t,l){var i;return null!=(i=n.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isMailShare:a,{name:"unless",hash:{},fn:e.program(11,l,0),inverse:e.noop,data:l,loc:{start:{line:20,column:35},end:{line:27,column:15}}}))?i:""},11:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\n\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="canUpdate-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:23,column:27},end:{line:23,column:34}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:23,column:35},end:{line:23,column:46}}}):o)+'" type="checkbox" name="update" class="permissions checkbox" '+(null!=(s=t.if.call(r,null!=a?a.hasUpdatePermission:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i,loc:{start:{line:23,column:107},end:{line:23,column:158}}}))?s:"")+' data-permissions="'+h(n(o=null!=(o=t.updatePermission||(null!=a?a.updatePermission:a))?o:c)===d?o.call(r,{name:"updatePermission",hash:{},data:i,loc:{start:{line:23,column:177},end:{line:23,column:197}}}):o)+'"/>\n\t\t\t\t\t\t<label for="canUpdate-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:24,column:28},end:{line:24,column:35}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:24,column:36},end:{line:24,column:47}}}):o)+'">'+h(n(o=null!=(o=t.updatePermissionLabel||(null!=a?a.updatePermissionLabel:a))?o:c)===d?o.call(r,{name:"updatePermissionLabel",hash:{},data:i,loc:{start:{line:24,column:49},end:{line:24,column:74}}}):o)+"</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t"},13:function(e,a,n,t,l){var i;return null!=(i=n.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isMailShare:a,{name:"unless",hash:{},fn:e.program(14,l,0),inverse:e.noop,data:l,loc:{start:{line:28,column:35},end:{line:35,column:15}}}))?i:""},14:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\n\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="canDelete-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:31,column:27},end:{line:31,column:34}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:31,column:35},end:{line:31,column:46}}}):o)+'" type="checkbox" name="delete" class="permissions checkbox" '+(null!=(s=t.if.call(r,null!=a?a.hasDeletePermission:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i,loc:{start:{line:31,column:107},end:{line:31,column:158}}}))?s:"")+' data-permissions="'+h(n(o=null!=(o=t.deletePermission||(null!=a?a.deletePermission:a))?o:c)===d?o.call(r,{name:"deletePermission",hash:{},data:i,loc:{start:{line:31,column:177},end:{line:31,column:197}}}):o)+'"/>\n\t\t\t\t\t\t<label for="canDelete-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:32,column:28},end:{line:32,column:35}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:32,column:36},end:{line:32,column:47}}}):o)+'">'+h(n(o=null!=(o=t.deletePermissionLabel||(null!=a?a.deletePermissionLabel:a))?o:c)===d?o.call(r,{name:"deletePermissionLabel",hash:{},data:i,loc:{start:{line:32,column:49},end:{line:32,column:74}}}):o)+"</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t"},16:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return(null!=(s=t.if.call(r,null!=a?a.hasCreatePermission:a,{name:"if",hash:{},fn:e.program(17,i,0),inverse:e.noop,data:i,loc:{start:{line:38,column:3},end:{line:45,column:10}}}))?s:"")+'\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<input id="password-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:48,column:25},end:{line:48,column:32}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:48,column:33},end:{line:48,column:44}}}):o)+'" type="checkbox" name="password" class="password checkbox" '+(null!=(s=t.if.call(r,null!=a?a.isPasswordSet:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i,loc:{start:{line:48,column:104},end:{line:48,column:149}}}))?s:"")+(null!=(s=t.if.call(r,null!=a?a.isPasswordSet:a,{name:"if",hash:{},fn:e.program(19,i,0),inverse:e.noop,data:i,loc:{start:{line:48,column:149},end:{line:48,column:234}}}))?s:"")+'" />\n\t\t\t\t\t<label for="password-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:49,column:26},end:{line:49,column:33}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:49,column:34},end:{line:49,column:45}}}):o)+'">'+h(n(o=null!=(o=t.passwordLabel||(null!=a?a.passwordLabel:a))?o:c)===d?o.call(r,{name:"passwordLabel",hash:{},data:i,loc:{start:{line:49,column:47},end:{line:49,column:64}}}):o)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li class="passwordMenu-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:52,column:27},end:{line:52,column:34}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:52,column:35},end:{line:52,column:46}}}):o)+" "+(null!=(s=t.unless.call(r,null!=a?a.isPasswordSet:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i,loc:{start:{line:52,column:47},end:{line:52,column:89}}}))?s:"")+'">\n\t\t\t\t<span class="passwordContainer-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:53,column:35},end:{line:53,column:42}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:53,column:43},end:{line:53,column:54}}}):o)+' icon-passwordmail menuitem">\n\t\t\t\t\t<label for="passwordField-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:54,column:31},end:{line:54,column:38}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:54,column:39},end:{line:54,column:50}}}):o)+'" class="hidden-visually" value="'+h(n(o=null!=(o=t.password||(null!=a?a.password:a))?o:c)===d?o.call(r,{name:"password",hash:{},data:i,loc:{start:{line:54,column:83},end:{line:54,column:95}}}):o)+'">'+h(n(o=null!=(o=t.passwordLabel||(null!=a?a.passwordLabel:a))?o:c)===d?o.call(r,{name:"passwordLabel",hash:{},data:i,loc:{start:{line:54,column:97},end:{line:54,column:114}}}):o)+'</label>\n\t\t\t\t\t<input id="passwordField-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:55,column:30},end:{line:55,column:37}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:55,column:38},end:{line:55,column:49}}}):o)+'" class="passwordField" type="password" placeholder="'+h(n(o=null!=(o=t.passwordPlaceholder||(null!=a?a.passwordPlaceholder:a))?o:c)===d?o.call(r,{name:"passwordPlaceholder",hash:{},data:i,loc:{start:{line:55,column:102},end:{line:55,column:125}}}):o)+'" value="'+h(n(o=null!=(o=t.passwordValue||(null!=a?a.passwordValue:a))?o:c)===d?o.call(r,{name:"passwordValue",hash:{},data:i,loc:{start:{line:55,column:134},end:{line:55,column:151}}}):o)+'" autocomplete="new-password" />\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t</span>\n\t\t\t</li>\n'+(null!=(s=t.if.call(r,null!=a?a.isTalkEnabled:a,{name:"if",hash:{},fn:e.program(24,i,0),inverse:e.noop,data:i,loc:{start:{line:59,column:3},end:{line:73,column:11}}}))?s:"")},17:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="secureDrop-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:41,column:28},end:{line:41,column:35}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:41,column:36},end:{line:41,column:47}}}):o)+'" type="checkbox" name="secureDrop" class="checkbox secureDrop" '+(null!=(s=t.if.call(r,null!=a?a.secureDropMode:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i,loc:{start:{line:41,column:111},end:{line:41,column:157}}}))?s:"")+' data-permissions="'+h(n(o=null!=(o=t.readPermission||(null!=a?a.readPermission:a))?o:c)===d?o.call(r,{name:"readPermission",hash:{},data:i,loc:{start:{line:41,column:176},end:{line:41,column:194}}}):o)+'"/>\n\t\t\t\t\t\t<label for="secureDrop-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:42,column:29},end:{line:42,column:36}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:42,column:37},end:{line:42,column:48}}}):o)+'">'+h(n(o=null!=(o=t.secureDropLabel||(null!=a?a.secureDropLabel:a))?o:c)===d?o.call(r,{name:"secureDropLabel",hash:{},data:i,loc:{start:{line:42,column:50},end:{line:42,column:69}}}):o)+"</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n"},19:function(e,a,n,t,l){var i;return null!=(i=n.if.call(null!=a?a:e.nullContext||{},null!=a?a.isPasswordForMailSharesRequired:a,{name:"if",hash:{},fn:e.program(20,l,0),inverse:e.noop,data:l,loc:{start:{line:48,column:170},end:{line:48,column:227}}}))?i:""},20:function(e,a,n,t,l){return'disabled=""'},22:function(e,a,n,t,l){return"hidden"},24:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="passwordByTalk-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:62,column:32},end:{line:62,column:39}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:62,column:40},end:{line:62,column:51}}}):o)+'" type="checkbox" name="passwordByTalk" class="passwordByTalk checkbox" '+(null!=(s=t.if.call(r,null!=a?a.isPasswordByTalkSet:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i,loc:{start:{line:62,column:123},end:{line:62,column:174}}}))?s:"")+' />\n\t\t\t\t\t\t<label for="passwordByTalk-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:63,column:33},end:{line:63,column:40}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:63,column:41},end:{line:63,column:52}}}):o)+'">'+h(n(o=null!=(o=t.passwordByTalkLabel||(null!=a?a.passwordByTalkLabel:a))?o:c)===d?o.call(r,{name:"passwordByTalkLabel",hash:{},data:i,loc:{start:{line:63,column:54},end:{line:63,column:77}}}):o)+'</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t<li class="passwordByTalkMenu-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:66,column:34},end:{line:66,column:41}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:66,column:42},end:{line:66,column:53}}}):o)+" "+(null!=(s=t.unless.call(r,null!=a?a.isPasswordByTalkSet:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i,loc:{start:{line:66,column:54},end:{line:66,column:102}}}))?s:"")+'">\n\t\t\t\t\t<span class="passwordByTalkContainer-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:67,column:42},end:{line:67,column:49}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:67,column:50},end:{line:67,column:61}}}):o)+' icon-passwordtalk menuitem">\n\t\t\t\t\t\t<label for="passwordByTalkField-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:68,column:38},end:{line:68,column:45}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:68,column:46},end:{line:68,column:57}}}):o)+'" class="hidden-visually" value="'+h(n(o=null!=(o=t.password||(null!=a?a.password:a))?o:c)===d?o.call(r,{name:"password",hash:{},data:i,loc:{start:{line:68,column:90},end:{line:68,column:102}}}):o)+'">'+h(n(o=null!=(o=t.passwordByTalkLabel||(null!=a?a.passwordByTalkLabel:a))?o:c)===d?o.call(r,{name:"passwordByTalkLabel",hash:{},data:i,loc:{start:{line:68,column:104},end:{line:68,column:127}}}):o)+'</label>\n\t\t\t\t\t\t<input id="passwordByTalkField-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:69,column:37},end:{line:69,column:44}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:69,column:45},end:{line:69,column:56}}}):o)+'" class="passwordField" type="password" placeholder="'+h(n(o=null!=(o=t.passwordByTalkPlaceholder||(null!=a?a.passwordByTalkPlaceholder:a))?o:c)===d?o.call(r,{name:"passwordByTalkPlaceholder",hash:{},data:i,loc:{start:{line:69,column:109},end:{line:69,column:138}}}):o)+'" value="'+h(n(o=null!=(o=t.passwordValue||(null!=a?a.passwordValue:a))?o:c)===d?o.call(r,{name:"passwordValue",hash:{},data:i,loc:{start:{line:69,column:147},end:{line:69,column:164}}}):o)+'" autocomplete="new-password" />\n\t\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n'},26:function(e,a,n,t,l){var i;return e.escapeExpression("function"==typeof(i=null!=(i=n.expireDate||(null!=a?a.expireDate:a))?i:e.hooks.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"expireDate",hash:{},data:l,loc:{start:{line:84,column:160},end:{line:84,column:174}}}):i)},28:function(e,a,n,t,l){var i;return e.escapeExpression("function"==typeof(i=null!=(i=n.defaultExpireDate||(null!=a?a.defaultExpireDate:a))?i:e.hooks.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"defaultExpireDate",hash:{},data:l,loc:{start:{line:84,column:182},end:{line:84,column:203}}}):i)},30:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<a href="#" class="share-add">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<span class="icon icon-edit"></span>\n\t\t\t\t\t<span>'+d("function"===n(o=null!=(o=t.addNoteLabel||(null!=a?a.addNoteLabel:a))?o:c)?o.call(r,{name:"addNoteLabel",hash:{},data:i,loc:{start:{line:92,column:11},end:{line:92,column:27}}}):o)+'</span>\n\t\t\t\t\t<input type="button" class="share-note-delete icon-delete '+(null!=(s=t.unless.call(r,null!=a?a.hasNote:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i,loc:{start:{line:93,column:63},end:{line:93,column:99}}}))?s:"")+'">\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li class="share-note-form '+(null!=(s=t.unless.call(r,null!=a?a.hasNote:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i,loc:{start:{line:96,column:30},end:{line:96,column:66}}}))?s:"")+'">\n\t\t\t\t<span class="menuitem icon-note">\n\t\t\t\t\t<textarea class="share-note">'+d("function"===n(o=null!=(o=t.shareNote||(null!=a?a.shareNote:a))?o:c)?o.call(r,{name:"shareNote",hash:{},data:i,loc:{start:{line:98,column:34},end:{line:98,column:47}}}):o)+'</textarea>\n\t\t\t\t\t<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-'+d("function"===n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:99,column:87},end:{line:99,column:98}}}):o)+'" />\n\t\t\t\t</span>\n\t\t\t</li>\n'},compiler:[8,">= 4.3.0"],main:function(e,a,t,l,i){var s,o,r=null!=a?a:e.nullContext||{},c=e.hooks.helperMissing,d="function",h=e.escapeExpression;return'<div class="popovermenu bubble hidden menu">\n\t<ul>\n\t\t'+(null!=(s=t.if.call(r,null!=a?a.isResharingAllowed:a,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i,loc:{start:{line:3,column:2},end:{line:10,column:30}}}))?s:"")+"\n"+(null!=(s=t.if.call(r,null!=a?a.isFolder:a,{name:"if",hash:{},fn:e.program(6,i,0),inverse:e.noop,data:i,loc:{start:{line:11,column:2},end:{line:36,column:10}}}))?s:"")+(null!=(s=t.if.call(r,null!=a?a.isMailShare:a,{name:"if",hash:{},fn:e.program(16,i,0),inverse:e.noop,data:i,loc:{start:{line:37,column:2},end:{line:74,column:10}}}))?s:"")+'\t\t<li>\n\t\t\t<span class="menuitem">\n\t\t\t\t<input id="expireDate-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:77,column:26},end:{line:77,column:33}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:77,column:34},end:{line:77,column:45}}}):o)+'" type="checkbox" name="expirationDate" class="expireDate checkbox" '+(null!=(s=t.if.call(r,null!=a?a.hasExpireDate:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i,loc:{start:{line:77,column:113},end:{line:77,column:158}}}))?s:"")+'" />\n\t\t\t\t<label for="expireDate-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:78,column:27},end:{line:78,column:34}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:78,column:35},end:{line:78,column:46}}}):o)+'">'+h(n(o=null!=(o=t.expireDateLabel||(null!=a?a.expireDateLabel:a))?o:c)===d?o.call(r,{name:"expireDateLabel",hash:{},data:i,loc:{start:{line:78,column:48},end:{line:78,column:67}}}):o)+'</label>\n\t\t\t</span>\n\t\t</li>\n\t\t<li class="expirationDateMenu-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:81,column:32},end:{line:81,column:39}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:81,column:40},end:{line:81,column:51}}}):o)+" "+(null!=(s=t.unless.call(r,null!=a?a.hasExpireDate:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i,loc:{start:{line:81,column:52},end:{line:81,column:94}}}))?s:"")+'">\n\t\t\t<span class="expirationDateContainer-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:82,column:40},end:{line:82,column:47}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:82,column:48},end:{line:82,column:59}}}):o)+' icon-expiredate menuitem">\n\t\t\t\t<label for="expirationDatePicker-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:83,column:37},end:{line:83,column:44}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:83,column:45},end:{line:83,column:56}}}):o)+'" class="hidden-visually" value="'+h(n(o=null!=(o=t.expirationDate||(null!=a?a.expirationDate:a))?o:c)===d?o.call(r,{name:"expirationDate",hash:{},data:i,loc:{start:{line:83,column:89},end:{line:83,column:107}}}):o)+'">'+h(n(o=null!=(o=t.expirationLabel||(null!=a?a.expirationLabel:a))?o:c)===d?o.call(r,{name:"expirationLabel",hash:{},data:i,loc:{start:{line:83,column:109},end:{line:83,column:128}}}):o)+'</label>\n\t\t\t\t<input id="expirationDatePicker-'+h(n(o=null!=(o=t.cid||(null!=a?a.cid:a))?o:c)===d?o.call(r,{name:"cid",hash:{},data:i,loc:{start:{line:84,column:36},end:{line:84,column:43}}}):o)+"-"+h(n(o=null!=(o=t.shareId||(null!=a?a.shareId:a))?o:c)===d?o.call(r,{name:"shareId",hash:{},data:i,loc:{start:{line:84,column:44},end:{line:84,column:55}}}):o)+'" class="datepicker" type="text" placeholder="'+h(n(o=null!=(o=t.expirationDatePlaceholder||(null!=a?a.expirationDatePlaceholder:a))?o:c)===d?o.call(r,{name:"expirationDatePlaceholder",hash:{},data:i,loc:{start:{line:84,column:101},end:{line:84,column:130}}}):o)+'" value="'+(null!=(s=t.if.call(r,null!=a?a.hasExpireDate:a,{name:"if",hash:{},fn:e.program(26,i,0),inverse:e.program(28,i,0),data:i,loc:{start:{line:84,column:139},end:{line:84,column:210}}}))?s:"")+'" />\n\t\t\t</span>\n\t\t</li>\n'+(null!=(s=t.if.call(r,null!=a?a.isNoteAvailable:a,{name:"if",hash:{},fn:e.program(30,i,0),inverse:e.noop,data:i,loc:{start:{line:87,column:2},end:{line:102,column:9}}}))?s:"")+'\t\t<li>\n\t\t\t<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span>'+h(n(o=null!=(o=t.unshareLabel||(null!=a?a.unshareLabel:a))?o:c)===d?o.call(r,{name:"unshareLabel",hash:{},data:i,loc:{start:{line:104,column:122},end:{line:104,column:138}}}):o)+"</span></a>\n\t\t</li>\n\t</ul>\n</div>\n"},useData:!0}),l.sharedialogview=t({1:function(e,a,t,l,i){var s,o=null!=a?a:e.nullContext||{},r=e.hooks.helperMissing,c=e.escapeExpression;return'\t<label for="shareWith-'+c("function"===n(s=null!=(s=t.cid||(null!=a?a.cid:a))?s:r)?s.call(o,{name:"cid",hash:{},data:i,loc:{start:{line:3,column:23},end:{line:3,column:30}}}):s)+'" class="hidden-visually">'+c("function"===n(s=null!=(s=t.shareLabel||(null!=a?a.shareLabel:a))?s:r)?s.call(o,{name:"shareLabel",hash:{},data:i,loc:{start:{line:3,column:56},end:{line:3,column:70}}}):s)+'</label>\n\t<div class="oneline">\n\t\t<input id="shareWith-'+c("function"===n(s=null!=(s=t.cid||(null!=a?a.cid:a))?s:r)?s.call(o,{name:"cid",hash:{},data:i,loc:{start:{line:5,column:23},end:{line:5,column:30}}}):s)+'" class="shareWithField" type="text" placeholder="'+c("function"===n(s=null!=(s=t.sharePlaceholder||(null!=a?a.sharePlaceholder:a))?s:r)?s.call(o,{name:"sharePlaceholder",hash:{},data:i,loc:{start:{line:5,column:80},end:{line:5,column:100}}}):s)+'" />\n\t\t<span class="shareWithLoading icon-loading-small hidden"></span>\n\t\t<span class="shareWithConfirm icon icon-confirm"></span>\n\t</div>\n'},compiler:[8,">= 4.3.0"],main:function(e,a,n,t,l){var i;return'<div class="resharerInfoView subView"></div>\n'+(null!=(i=n.if.call(null!=a?a:e.nullContext||{},null!=a?a.isSharingAllowed:a,{name:"if",hash:{},fn:e.program(1,l,0),inverse:e.noop,data:l,loc:{start:{line:2,column:0},end:{line:9,column:7}}}))?i:"")+'<div class="linkShareView subView"></div>\n<div class="shareeListView subView"></div>\n<div class="loading hidden" style="height: 50px"></div>\n'},useData:!0})},function(e,a){!function(){OC.Share||(OC.Share={},OC.Share.Types={});var e=["id","file_parent","mail_send","file_source","item_source","permissions","storage","share_type","parent","stime"],a=OC.Backbone.Model.extend({_linkShareId:null,initialize:function(e,a){_.isUndefined(a.configModel)||(this.configModel=a.configModel),_.isUndefined(a.fileInfoModel)||(this.fileInfoModel=a.fileInfoModel),_.bindAll(this,"addShare")},defaults:{allowPublicUploadStatus:!1,permissions:0,linkShares:[]},saveLinkShare:function(e,a){a=a||{};var n,t=null;(e=_.extend({},e)).expiration&&(e.expireDate=e.expiration,delete e.expiration);var l=this.get("linkShares"),i=_.findIndex(l,function(a){return a.id===e.cid});return l.length>0&&-1!==i?(t=l[i].id,n=this.updateShare(t,e,a)):(e=_.defaults(e,{hideDownload:!1,password:"",passwordChanged:!1,sendPasswordByTalk:!1,permissions:OC.PERMISSION_READ,expireDate:this.configModel.getDefaultExpirationDateString(),shareType:OC.Share.SHARE_TYPE_LINK}),n=this.addShare(e,a)),n},addShare:function(e,a){e.shareType;e=_.extend({},e);var n=OC.getCapabilities().files_sharing.default_permissions||OC.PERMISSION_ALL,t=OC.PERMISSION_READ;return this.updatePermissionPossible()&&(t|=OC.PERMISSION_UPDATE),this.createPermissionPossible()&&(t|=OC.PERMISSION_CREATE),this.deletePermissionPossible()&&(t|=OC.PERMISSION_DELETE),this.configModel.get("isResharingAllowed")&&this.sharePermissionPossible()&&(t|=OC.PERMISSION_SHARE),e.permissions=n&t,_.isUndefined(e.path)&&(e.path=this.fileInfoModel.getFullPath()),this._addOrUpdateShare({type:"POST",url:this._getUrl("shares"),data:e,dataType:"json"},a)},updateShare:function(e,a,n){return this._addOrUpdateShare({type:"PUT",url:this._getUrl("shares/"+encodeURIComponent(e)),data:a,dataType:"json"},n)},_addOrUpdateShare:function(e,a){var n=this;return a=a||{},$.ajax(e).always(function(){_.isFunction(a.complete)&&a.complete(n)}).done(function(){n.fetch().done(function(){_.isFunction(a.success)&&a.success(n)})}).fail(function(e){var l=t("core","Error"),i=e.responseJSON;i&&i.ocs&&i.ocs.meta&&(l=i.ocs.meta.message),_.isFunction(a.error)?a.error(n,l):OC.dialogs.alert(l,t("core","Error while sharing"))})},removeShare:function(e,a){var n=this;return a=a||{},$.ajax({type:"DELETE",url:this._getUrl("shares/"+encodeURIComponent(e))}).done(function(){n.fetch({success:function(){_.isFunction(a.success)&&a.success(n)}})}).fail(function(e){var l=t("core","Error"),i=e.responseJSON;i.ocs&&i.ocs.meta&&(l=i.ocs.meta.message),_.isFunction(a.error)?a.error(n,l):OC.dialogs.alert(l,t("core","Error removing share"))})},isPublicUploadAllowed:function(){return this.get("allowPublicUploadStatus")},isPublicEditingAllowed:function(){return this.get("allowPublicEditingStatus")},isHideFileListSet:function(){return this.get("hideFileListStatus")},isFolder:function(){return"folder"===this.get("itemType")},isFile:function(){return"file"===this.get("itemType")},hasReshare:function(){var e=this.get("reshare");return _.isObject(e)&&!_.isUndefined(e.uid_owner)},hasUserShares:function(){return this.getSharesWithCurrentItem().length>0},hasLinkShares:function(){var e=this.get("linkShares");return!!(e&&e.length>0)},getReshareOwner:function(){return this.get("reshare").uid_owner},getReshareOwnerDisplayname:function(){return this.get("reshare").displayname_owner},getReshareNote:function(){return this.get("reshare").note},getReshareWith:function(){return this.get("reshare").share_with},getReshareWithDisplayName:function(){var e=this.get("reshare");return e.share_with_displayname||e.share_with},getReshareType:function(){return this.get("reshare").share_type},getExpireDate:function(e){return this._shareExpireDate(e)},getNote:function(e){return this._shareNote(e)},getSharesWithCurrentItem:function(){var e=this.get("shares")||[],a=this.fileInfoModel.get("id");return _.filter(e,function(e){return e.item_source===a})},getShareWith:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.share_with},getShareWithDisplayName:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.share_with_displayname},getShareWithAvatar:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.share_with_avatar},getSharedBy:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.uid_owner},getSharedByDisplayName:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.displayname_owner},getFileOwnerUid:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.uid_file_owner},findShareWithIndex:function(e){var a=this.get("shares");if(!_.isArray(a))throw"Unknown Share";for(var n=0;n<a.length;n++){if(a[n].id===e)return n}throw"Unknown Sharee"},getShareType:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.share_type},_shareHasPermission:function(e,a){var n=this.get("shares")[e];if(!_.isObject(n))throw"Unknown Share";return(n.permissions&a)===a},_shareExpireDate:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.expiration},_shareNote:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.note},getPermissions:function(){return this.get("permissions")},sharePermissionPossible:function(){return(this.get("permissions")&OC.PERMISSION_SHARE)===OC.PERMISSION_SHARE},hasSharePermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_SHARE)},createPermissionPossible:function(){return(this.get("permissions")&OC.PERMISSION_CREATE)===OC.PERMISSION_CREATE},hasCreatePermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_CREATE)},updatePermissionPossible:function(){return(this.get("permissions")&OC.PERMISSION_UPDATE)===OC.PERMISSION_UPDATE},hasUpdatePermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_UPDATE)},deletePermissionPossible:function(){return(this.get("permissions")&OC.PERMISSION_DELETE)===OC.PERMISSION_DELETE},hasDeletePermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_DELETE)},hasReadPermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_READ)},editPermissionPossible:function(){return this.createPermissionPossible()||this.updatePermissionPossible()||this.deletePermissionPossible()},editPermissionState:function(e){var a=this.hasCreatePermission(e),n=this.hasUpdatePermission(e),t=this.hasDeletePermission(e);return this.isFile()?a||n||t?"checked":"":a||n||t?this.createPermissionPossible()&&!a||this.updatePermissionPossible()&&!n||this.deletePermissionPossible()&&!t?"indeterminate":"checked":""},linkSharePermissions:function(e){var a=this.get("linkShares"),n=_.findIndex(a,function(a){return a.id===e});return this.hasLinkShares()&&a.length>0&&-1!==n?a[n].permissions:-1},_getUrl:function(e,a){return a=_.extend({format:"json"},a||{}),OC.linkToOCS("apps/files_sharing/api/v1",2)+e+"?"+OC.buildQueryString(a)},_fetchShares:function(){var e=this.fileInfoModel.getFullPath();return $.ajax({type:"GET",url:this._getUrl("shares",{path:e,reshares:!0})})},_fetchReshare:function(){if(this._reshareFetched)return $.Deferred().resolve([{ocs:{data:[this.get("reshare")]}}]);var e=this.fileInfoModel.getFullPath();return this._reshareFetched=!0,$.ajax({type:"GET",url:this._getUrl("shares",{path:e,shared_with_me:!0})})},_groupReshares:function(e){if(!e||!e.length)return!1;var a=e.shift(),n=a.permissions;return _.each(e,function(e){e.share_type===OC.Share.SHARE_TYPE_USER&&a.share_type===OC.Share.SHARE_TYPE_GROUP&&(a=e),n|=e.permissions}),a.permissions=n,a},fetch:function(e){var a=this;this.trigger("request",this);var n=$.when(this._fetchShares(),this._fetchReshare());return n.done(function(n,t){a.trigger("sync","GET",this);var l={};_.each(n[0].ocs.data,function(e){l[e.id]=e});var i=!1;t[0].ocs.data.length&&(i=a._groupReshares(t[0].ocs.data)),a.set(a.parse({shares:l,reshare:i})),!_.isUndefined(e)&&_.isFunction(e.success)&&e.success()}),n},_legacyFillCurrentShares:function(e){var a=this.fileInfoModel.get("id");if(!e||!e.length)return delete OC.Share.statuses[a],OC.Share.currentShares={},void(OC.Share.itemShares=[]);var n=OC.Share.statuses[a];n||(n={link:!1},OC.Share.statuses[a]=n),n.link=!1,OC.Share.currentShares={},OC.Share.itemShares=[],_.each(e,function(e){e.share_type===OC.Share.SHARE_TYPE_LINK?(OC.Share.itemShares[e.share_type]=!0,n.link=!0):(OC.Share.itemShares[e.share_type]||(OC.Share.itemShares[e.share_type]=[]),OC.Share.itemShares[e.share_type].push(e.share_with))})},parse:function(a){if(!1===a)return console.warn("no data was returned"),this.trigger("fetchError"),{};var n=this.fileInfoModel.get("permissions");_.isUndefined(a.reshare)||_.isUndefined(a.reshare.permissions)||a.reshare.uid_owner===OC.currentUser||(n&=a.reshare.permissions);var t=!1;_.isUndefined(a.shares)||$.each(a.shares,function(e,a){if(a.share_type===OC.Share.SHARE_TYPE_LINK)return t=!!(a.permissions&OC.PERMISSION_CREATE),!0});var l=!0;_.isUndefined(a.shares)||$.each(a.shares,function(e,a){if(a.share_type===OC.Share.SHARE_TYPE_LINK)return l=!!(a.permissions&OC.PERMISSION_UPDATE),!0});var i=!1;_.isUndefined(a.shares)||$.each(a.shares,function(e,a){if(a.share_type===OC.Share.SHARE_TYPE_LINK)return i=!(a.permissions&OC.PERMISSION_READ),!0});var s=_.map(a.shares,function(a){var n;for(n=0;n<e.length;n++){var t=e[n];_.isUndefined(a[t])||(a[t]=parseInt(a[t],10))}return a});this._legacyFillCurrentShares(s);var o=[];return s=_.reject(s,function(e){if(e.share_type===OC.Share.SHARE_TYPE_LINK&&(e.file_source===this.get("itemSource")||e.item_source===this.get("itemSource"))){if(e.uid_owner!==OC.currentUser)return;window.location.protocol,window.location.host;if(e.token)OC.generateUrl("/s/")+e.token;else{var a=this.fileInfoModel.get("path")+"/"+this.fileInfoModel.get("name"),n="/"+OC.currentUser+"/files"+a,t=this.fileInfoModel.isDirectory()?"folder":"file";OC.linkTo("","public.php")+"?service=files&"+t+"="+encodeURIComponent(n)}return o.push(_.extend({},e,{hideDownload:!!e.hide_download,password:e.share_with,sendPasswordByTalk:e.send_password_by_talk})),e}},this),{reshare:a.reshare,shares:s,linkShares:o,permissions:n,allowPublicUploadStatus:t,allowPublicEditingStatus:l,hideFileListStatus:i}},_parseTime:function(e){if(_.isString(e)){if(""===e||e.length>1&&"0"===e[0]&&"x"===e[1])return null;e=parseInt(e,10),isNaN(e)&&(e=null)}return e},getShareTypes:function(){var e;return e=_.pluck(this.getSharesWithCurrentItem(),"share_type"),this.hasLinkShares()&&e.push(OC.Share.SHARE_TYPE_LINK),_.uniq(e)}});OC.Share.ShareItemModel=a}()},function(e,a){
/**
* @copyright 2017, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
!function(){OC.Share||(OC.Share={}),OC.Share.Social={};var e=OC.Backbone.Model.extend({defaults:{key:null,url:null,name:null,iconClass:null,newWindow:!0}});OC.Share.Social.Model=e;var a=OC.Backbone.Collection.extend({model:OC.Share.Social.Model,comparator:"key"});OC.Share.Social.Collection=new a}()},function(e,a){!function(){OC.Share||(OC.Share={});var e=OC.Backbone.View.extend({id:"shareDialogResharerInfo",tagName:"div",className:"reshare",configModel:void 0,_template:void 0,initialize:function(e){var a=this;if(this.model.on("change:reshare",function(){a.render()}),_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel},render:function(){if(!this.model.hasReshare()||this.model.getReshareOwner()===OC.currentUser)return this.$el.empty(),this;var e=this.template(),a=this.model.getReshareOwnerDisplayname(),n=this.model.getReshareNote(),l="";return l=this.model.getReshareType()===OC.Share.SHARE_TYPE_GROUP?t("core","Shared with you and the group {group} by {owner}",{group:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):this.model.getReshareType()===OC.Share.SHARE_TYPE_CIRCLE?t("core","Shared with you and {circle} by {owner}",{circle:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):this.model.getReshareType()===OC.Share.SHARE_TYPE_ROOM?this.model.get("reshare").share_with_displayname?t("core","Shared with you and the conversation {conversation} by {owner}",{conversation:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):t("core","Shared with you in a conversation by {owner}",{owner:a},void 0,{escape:!1}):t("core","Shared with you by {owner}",{owner:a},void 0,{escape:!1}),this.$el.html(e({reshareOwner:this.model.getReshareOwner(),sharedByText:l,shareNote:n,hasShareNote:""!==n})),this.$el.find(".avatar").each(function(){var e=$(this);e.avatar(e.data("username"),32)}),this.$el.find(".reshare").contactsMenu(this.model.getReshareOwner(),OC.Share.SHARE_TYPE_USER,this.$el),this},template:function(){return OC.Share.Templates.sharedialogresharerinfoview}});OC.Share.ShareDialogResharerInfoView=e}()},function(e,a){!function(){OC.Share||(OC.Share={});var e=t("core","Choose a password for the public link"),a=t("core",'Choose a password for the public link or press the "Enter" key'),n=OC.Backbone.View.extend({id:"shareDialogLinkShare",configModel:void 0,showLink:!0,showPending:!1,hasPasswordChanged:!1,password:"",newShareId:"new-share",events:{"click .share-menu .icon-more":"onToggleMenu","change .hideDownloadCheckbox":"onHideDownloadChange","click input.share-pass-submit":"onPasswordEntered","keyup input.linkPassText":"onPasswordKeyUp","change .showPasswordCheckbox":"onShowPasswordClick","change .passwordByTalkCheckbox":"onPasswordByTalkChange","change .publicEditingCheckbox":"onAllowPublicEditingChange","click .linkText":"onLinkTextClick","click .pop-up":"onPopUpClick","change .publicUploadRadio":"onPublicUploadChange","click .expireDate":"onExpireDateChange","change .datepicker":"onChangeExpirationDate","click .datepicker":"showDatePicker","click .share-add":"showNoteForm","click .share-note-delete":"deleteNote","click .share-note-submit":"updateNote","click .unshare":"onUnshare","click .new-share":"newShare","submit .enforcedPassForm":"enforcedPasswordSet"},initialize:function(e){var a=this;if(this.model.on("change:permissions",function(){a.render()}),this.model.on("change:itemType",function(){a.render()}),this.model.on("change:allowPublicUploadStatus",function(){a.render()}),this.model.on("change:hideFileListStatus",function(){a.render()}),this.model.on("change:linkShares",function(e,n){var t,l=e.previous("linkShares");if(l.length===n.length)for(t=0;t<n.length;t++){if(n[t].id!==l[t].id)return;if(n[t].password!==l[t].password)return void a.render()}}),_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel;var n=new Clipboard(".clipboard-button");n.on("success",function(e){var a=$(e.trigger);a.tooltip("hide").attr("data-original-title",t("core","Copied!")).tooltip("fixTitle").tooltip({placement:"bottom",trigger:"manual"}).tooltip("show"),_.delay(function(){a.tooltip("hide").attr("data-original-title",t("core","Copy link")).tooltip("fixTitle")},3e3)}),n.on("error",function(e){var a=$(e.trigger),n=a.next(".share-menu").find(".popovermenu"),l=n.find("li.linkTextMenu"),i=l.find(".linkText");a.closest("li[data-share-id]").data("share-id");OC.showMenu(null,n);var s="";s=/iPhone|iPad/i.test(navigator.userAgent)?t("core","Not supported!"):/Mac/i.test(navigator.userAgent)?t("core","Press ⌘-C to copy."):t("core","Press Ctrl-C to copy."),l.removeClass("hidden"),i.select(),i.tooltip("hide").attr("data-original-title",s).tooltip("fixTitle").tooltip({placement:"bottom",trigger:"manual"}).tooltip("show"),_.delay(function(){i.tooltip("hide"),i.attr("data-original-title",t("core","Copy")).tooltip("fixTitle")},3e3)})},newShare:function(e){var a=this,n=$(e.target).closest("li[data-share-id]"),l=n.data("share-id"),i=n.find(".share-menu > .icon-loading-small");if(!i.hasClass("hidden")&&""===this.password)return!1;n.find(".icon").addClass("hidden"),i.removeClass("hidden"),OC.hideMenus();var s={},o=this.configModel.get("enforcePasswordForPublicLink");if(this.configModel.get("isDefaultExpireDateEnforced")){var r=this.configModel.get("defaultExpireDate"),c=moment().add(r,"day").format("DD-MM-YYYY");s.expireDate=c}o&&""!==this.password&&(s.password=this.password);var d=!1;o&&!this.showPending&&""===this.password?(this.showPending=l,(a=this.render()).$el.find(".pending #enforcedPassText").focus()):$.when(this.model.saveLinkShare(s,{success:function(){if(i.addClass("hidden"),n.find(".icon").removeClass("hidden"),a.render(),d)a.$el.find("li[data-share-id]"),a.$el.find('li[data-share-id="'+d+'"]')},error:function(){}})).fail(function(e){if(a.password="",o&&e&&e.responseJSON&&e.responseJSON.ocs.meta&&e.responseJSON.ocs.meta.message){var l=a.$el.find(".pending #enforcedPassText");l.tooltip("destroy"),l.attr("title",e.responseJSON.ocs.meta.message),l.tooltip({placement:"bottom",trigger:"manual"}),l.tooltip("show")}else OC.Notification.showTemporary(t("core","Unable to create a link share")),i.addClass("hidden"),n.find(".icon").removeClass("hidden")}).then(function(e){d=e.ocs.data.id})},enforcedPasswordSet:function(e){e.preventDefault();var a=$(e.target).find("input.enforcedPassText");this.password=a.val(),this.showPending=!1,this.newShare(e)},onLinkTextClick:function(e){var a=$(e.target).closest("li[data-share-id]").find(".linkText");a.focus(),a.select()},onHideDownloadChange:function(e){var a=$(e.target).closest("li[data-share-id]"),n=a.data("share-id"),l=a.find(".hideDownloadCheckbox");l.siblings(".icon-loading-small").removeClass("hidden").addClass("inlineblock");var i=!1;l.is(":checked")&&(i=!0),this.model.saveLinkShare({hideDownload:i,cid:n},{success:function(){l.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")},error:function(e,a){OC.Notification.showTemporary(t("core","Unable to toggle this option")),l.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")}})},onShowPasswordClick:function(e){var a=$(e.target).closest("li[data-share-id]"),n=a.data("share-id");a.find(".linkPass").slideToggle(OC.menuSpeed),a.find(".linkPassMenu").toggleClass("hidden"),a.find(".showPasswordCheckbox").is(":checked")?OC.Util.isIE()||a.find(".linkPassText").focus():(this.model.saveLinkShare({password:"",cid:n}),this.hasPasswordChanged=!1)},onPasswordKeyUp:function(e){var a=$(e.target).closest("li[data-share-id]").data("share-id");13===e.keyCode?this.onPasswordEntered(e):this.hasPasswordChanged=a},onPasswordEntered:function(n){var t=this,l=$(n.target).closest("li[data-share-id]"),i=l.data("share-id"),s=l.find(".linkPassMenu .icon-loading-small");if(s.hasClass("hidden")){var o=l.find(".linkPassText");o.removeClass("error"),o.parent().find("input").removeClass("error");var r=o.val();if(l.find(".linkPassText").attr("placeholder")===a)r===a&&(r="");else if(""===r||"**********"===r||r===e)return;s.removeClass("hidden").addClass("inlineblock"),this.hasPasswordChanged=!1,this.model.saveLinkShare({password:r,cid:i},{complete:function(e){s.removeClass("inlineblock").addClass("hidden")},error:function(e,a){n&&t.onToggleMenu(n),o.parent().find("input").addClass("error");var l=o.parent();l.tooltip("destroy"),o.addClass("error"),l.attr("title",a),l.tooltip({placement:"bottom",trigger:"manual"}),l.tooltip("show")}})}},onPasswordByTalkChange:function(e){var a=$(e.target).closest("li[data-share-id]"),n=a.data("share-id"),l=a.find(".passwordByTalkCheckbox");l.siblings(".icon-loading-small").removeClass("hidden").addClass("inlineblock");var i=!1;l.is(":checked")&&(i=!0),this.model.saveLinkShare({sendPasswordByTalk:i,cid:n},{success:function(){l.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")},error:function(e,a){OC.Notification.showTemporary(t("core","Unable to toggle this option")),l.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")}})},onAllowPublicEditingChange:function(e){var a=$(e.target).closest("li[data-share-id]"),n=a.data("share-id"),l=a.find(".publicEditingCheckbox");l.siblings(".icon-loading-small").removeClass("hidden").addClass("inlineblock");var i=OC.PERMISSION_READ;l.is(":checked")&&(i=OC.PERMISSION_UPDATE|OC.PERMISSION_READ),this.model.saveLinkShare({permissions:i,cid:n},{success:function(){l.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")},error:function(e,a){OC.Notification.showTemporary(t("core","Unable to toggle this option")),l.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")}})},onPublicUploadChange:function(e){var a=$(e.target).closest("li[data-share-id]").data("share-id"),n=e.currentTarget.value;this.model.saveLinkShare({permissions:n,cid:a})},showNoteForm:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=(a.closest("li[data-share-id]"),a.closest("li")),t=n.next("li.share-note-form");n.find(".share-note-delete").toggleClass("hidden"),t.toggleClass("hidden"),t.find("textarea").focus()},deleteNote:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=a.closest("li[data-share-id]").data("share-id"),t=a.closest("li"),l=t.next("li.share-note-form");l.find(".share-note").val(""),l.addClass("hidden"),t.find(".share-note-delete").addClass("hidden"),this.sendNote("",n,t)},updateNote:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=a.closest("li[data-share-id]").data("share-id"),t=a.closest("li.share-note-form"),l=t.prev("li"),i=t.find(".share-note").val().trim();i.length<1||this.sendNote(i,n,l)},sendNote:function(e,a,n){var t=n.next("li.share-note-form"),l=t.find("input.share-note-submit"),i=t.find("input.share-note-error");l.prop("disabled",!0),n.find(".icon-loading-small").removeClass("hidden"),n.find(".icon-edit").hide();$.ajax({method:"PUT",url:OC.linkToOCS("apps/files_sharing/api/v1/shares",2)+a+"?"+OC.buildQueryString({format:"json"}),data:{note:e},complete:function(){l.prop("disabled",!1),n.find(".icon-loading-small").addClass("hidden"),n.find(".icon-edit").show()},error:function(){i.show(),setTimeout(function(){i.hide()},3e3)}})},render:function(){this.$el.find(".has-tooltip").tooltip(),this.password="";var n=this.template(),l=this.model.sharePermissionPossible();if(!l||!this.showLink||!this.configModel.isShareWithLinkAllowed()){var i={shareAllowed:!1};return l||(i.noSharingPlaceholder=t("core","Resharing is not allowed")),this.$el.html(n(i)),this}var s=this.model.isFolder()&&this.model.createPermissionPossible()&&this.configModel.isPublicUploadEnabled(),o="";this.model.isPublicEditingAllowed()&&(o='checked="checked"');var r=this.configModel.get("enforcePasswordForPublicLink"),c=(this.configModel.get("enableLinkPasswordByDefault"),this.configModel.get("enforcePasswordForPublicLink")?e:a),d=!this.model.isFolder()&&this.model.updatePermissionPossible(),h=this.configModel.get("isDefaultExpireDateEnforced"),u=new Date;u.setDate(u.getDate()+1),$.datepicker.setDefaults({minDate:u}),this.$el.find(".datepicker").datepicker({dateFormat:"dd-mm-yy"});var m=4;OC.getCapabilities().password_policy&&OC.getCapabilities().password_policy.minLength&&(m=OC.getCapabilities().password_policy.minLength);var p={urlLabel:t("core","Link"),hideDownloadLabel:t("core","Hide download"),enablePasswordLabel:r?t("core","Password protection enforced"):t("core","Password protect"),passwordLabel:t("core","Password"),passwordPlaceholderInitial:c,publicUpload:s,publicEditing:d,publicEditingChecked:o,publicEditingLabel:t("core","Allow editing"),mailPrivatePlaceholder:t("core","Email link to person"),mailButtonText:t("core","Send"),publicUploadRWLabel:t("core","Allow upload and editing"),publicUploadRLabel:t("core","Read only"),publicUploadWLabel:t("core","File drop (upload only)"),publicUploadRWValue:OC.PERMISSION_UPDATE|OC.PERMISSION_CREATE|OC.PERMISSION_READ|OC.PERMISSION_DELETE,publicUploadRValue:OC.PERMISSION_READ,publicUploadWValue:OC.PERMISSION_CREATE,expireDateLabel:h?t("core","Expiration date enforced"):t("core","Set expiration date"),expirationLabel:t("core","Expiration"),expirationDatePlaceholder:t("core","Expiration date"),isExpirationEnforced:h,isPasswordEnforced:r,defaultExpireDate:moment().add(1,"day").format("DD-MM-YYYY"),addNoteLabel:t("core","Note to recipient"),unshareLabel:t("core","Unshare"),unshareLinkLabel:t("core","Delete share link"),newShareLabel:t("core","Add another link")},f={isPasswordEnforced:r,enforcedPasswordLabel:t("core","Password protection for links is mandatory"),passwordPlaceholder:c,minPasswordLength:m},g=this.pendingPopoverMenuTemplate(_.extend({},f)),v=this.getShareeList();if(_.isArray(v))for(var S=0;S<v.length;S++){var C=[];OC.Share.Social.Collection.each(function(e){var a=e.get("url");a=a.replace("{{reference}}",v[S].shareLinkURL),C.push({url:a,label:t("core","Share to {name}",{name:e.get("name")}),name:e.get("name"),iconClass:e.get("iconClass"),newWindow:e.get("newWindow")})});var w=this.getPopoverObject(v[S]);v[S].popoverMenu=this.popoverMenuTemplate(_.extend({},p,w,{social:C})),v[S].pendingPopoverMenu=g}return this.$el.on("beforeHide",function(e){this.onMenuhide(e)}.bind(this)),this.$el.html(n({linkShares:v,shareAllowed:!0,nolinkShares:0===v.length,newShareLabel:t("core","Share link"),newShareTitle:t("core","New share link"),pendingPopoverMenu:g,showPending:this.showPending===this.newShareId,newShareId:this.newShareId})),this.delegateEvents(),autosize(this.$el.find(".share-note-form .share-note")),this},onToggleMenu:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target).closest("li[data-share-id]"),n=a.find(".sharingOptionsGroup .popovermenu");a.data("share-id");OC.showMenu(null,n);var t=!0===this.configModel.get("enableLinkPasswordByDefault");!(""!==n.find(".linkPassText").val())&&t&&n.find(".linkPassText").focus()},onMenuhide:function(e){if(this.hasPasswordChanged){var a=this.hasPasswordChanged,n=this.$el.find("li[data-share-id="+a+"] #linkPassText-"+a);console.debug("Force saving password for share number ",a),this.onPasswordEntered(_.extend(e,{target:n}))}this.$el.find("[data-original-title]").tooltip("hide")},template:function(){return OC.Share.Templates.sharedialoglinkshareview},popoverMenuTemplate:function(e){return OC.Share.Templates.sharedialoglinkshareview_popover_menu(e)},pendingPopoverMenuTemplate:function(e){return OC.Share.Templates.sharedialoglinkshareview_popover_menu_pending(e)},onPopUpClick:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.currentTarget).data("url"),n=$(e.currentTarget).data("window");if($(e.currentTarget).tooltip("hide"),a)if(!0===n){var t=screen.width/2-300,l=screen.height/2-200;window.open(a,"name","width=600, height=400, top="+l+", left="+t)}else window.location.href=a},onExpireDateChange:function(e){var a=$(e.target),n=a.closest("li[data-share-id]").data("share-id"),t=$("#expirationDateContainer-"+n),l=a.prop("checked");t.toggleClass("hidden",!l),l?(a.closest("li").next("li").removeClass("hidden"),this.showDatePicker(e)):(a.closest("li").next("li").addClass("hidden"),this.setExpirationDate("",n))},showDatePicker:function(e){var a=$(e.target),n=a.closest("li[data-share-id]").data("share-id"),t=a.data("max-date"),l="#expirationDatePicker-"+n,i=this;$(l).datepicker({dateFormat:"dd-mm-yy",onSelect:function(e){i.setExpirationDate(e,n)},maxDate:t}),$(l).datepicker("show"),$(l).focus()},setExpirationDate:function(e,a){this.model.saveLinkShare({expireDate:e,cid:a})},onChangeExpirationDate:function(e){var a=$(e.target),n=a.val(),t=a.closest("li[data-share-id]").data("share-id"),l="#expirationDatePicker-"+t;this.setExpirationDate(n,t),$(l).datepicker("hide")},getShareeList:function(){var e=this.model.get("linkShares");if(!this.model.hasLinkShares())return[];for(var a=[],n=0;n<e.length;n++){var t=this.getShareeObject(n);a.push(_.extend({},t))}return a},getShareeObject:function(e){var a=this.model.get("linkShares")[e];return _.extend({},a,{cid:a.id,shareAllowed:!0,linkShareLabel:a.label?a.label:t("core","Share link"),popoverMenu:{},shareLinkURL:a.url,newShareTitle:t("core","New share link"),copyLabel:t("core","Copy link"),showPending:this.showPending===a.id,linkShareCreationDate:t("core","Created on {time}",{time:moment(1e3*a.stime).format("LLLL")})})},getPopoverObject:function(a){var n="",l="",i="";switch(this.model.linkSharePermissions(a.id)){case OC.PERMISSION_READ:l="checked";break;case OC.PERMISSION_CREATE:i="checked";break;case OC.PERMISSION_UPDATE|OC.PERMISSION_CREATE|OC.PERMISSION_READ|OC.PERMISSION_DELETE:n="checked"}var s,o=!!a.password,r=!0===this.configModel.get("enableLinkPasswordByDefault"),c=this.configModel.get("enforcePasswordForPublicLink"),d=this.configModel.get("isDefaultExpireDateEnforced"),h=this.configModel.get("defaultExpireDate"),u=!!a.expiration||d;u&&(s=moment(a.expiration,"YYYY-MM-DD").format("DD-MM-YYYY"));var m=void 0!==OC.appswebroots.spreed,p=a.sendPasswordByTalk,f=a.hideDownload,g=null;if(u&&d){var v=a.stime;_.isNumber(v)&&(v=new Date(1e3*v)),v||(v=new Date),v=OC.Util.stripTime(v).getTime(),g=new Date(v+24*h*3600*1e3)}return{cid:a.id,shareLinkURL:a.url,passwordPlaceholder:o?"**********":e,isPasswordSet:o||r||c,showPasswordByTalkCheckBox:m&&o,passwordByTalkLabel:t("core","Password protect by Talk"),isPasswordByTalkSet:p,publicUploadRWChecked:n,publicUploadRChecked:l,publicUploadWChecked:i,hasExpireDate:u,expireDate:s,shareNote:a.note,hasNote:""!==a.note,maxDate:g,hideDownload:f,isExpirationEnforced:d}},onUnshare:function(e){e.preventDefault(),e.stopPropagation();var a=this,n=$(e.target);n.is("a")||(n=n.closest("a"));var l=n.find(".icon-loading-small").eq(0);if(!l.hasClass("hidden"))return!1;l.removeClass("hidden");var i=n.closest("li[data-share-id]"),s=i.data("share-id");return a.model.removeShare(s,{success:function(){i.remove(),a.render()},error:function(){l.addClass("hidden"),OC.Notification.showTemporary(t("core","Could not unshare"))}}),!1}});OC.Share.ShareDialogLinkShareView=n}()},function(e,a){!function(){var e=t("core","Choose a password for the mail share");OC.Share||(OC.Share={});var a=OC.Backbone.View.extend({id:"shareDialogLinkShare",configModel:void 0,_menuOpen:!1,_renderPermissionChange:!1,events:{"click .unshare":"onUnshare","click .share-add":"showNoteForm","click .share-note-delete":"deleteNote","click .share-note-submit":"updateNote","click .share-menu .icon-more":"onToggleMenu","click .permissions":"onPermissionChange","click .expireDate":"onExpireDateChange","click .password":"onMailSharePasswordProtectChange","click .passwordByTalk":"onMailSharePasswordProtectByTalkChange","click .secureDrop":"onSecureDropChange","keyup input.passwordField":"onMailSharePasswordKeyUp","focusout input.passwordField":"onMailSharePasswordEntered","change .datepicker":"onChangeExpirationDate","click .datepicker":"showDatePicker"},initialize:function(e){if(_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel;var a=this;this.model.on("change:shares",function(){a.render()})},getShareeObject:function(a){var n=this.model.getShareWith(a),l=this.model.getShareWithDisplayName(a),i=this.model.getShareWithAvatar(a),s="",o=this.model.getShareType(a),r=this.model.getSharedBy(a),c=this.model.getSharedByDisplayName(a),d=this.model.getFileOwnerUid(a);if(o===OC.Share.SHARE_TYPE_GROUP?l=l+" ("+t("core","group")+")":o===OC.Share.SHARE_TYPE_REMOTE?l=l+" ("+t("core","remote")+")":o===OC.Share.SHARE_TYPE_REMOTE_GROUP?l=l+" ("+t("core","remote group")+")":o===OC.Share.SHARE_TYPE_EMAIL?l=l+" ("+t("core","email")+")":o===OC.Share.SHARE_TYPE_CIRCLE||o===OC.Share.SHARE_TYPE_ROOM&&(l=l+" ("+t("core","conversation")+")"),o===OC.Share.SHARE_TYPE_GROUP?s=n+" ("+t("core","group")+")":o===OC.Share.SHARE_TYPE_REMOTE?s=n+" ("+t("core","remote")+")":o===OC.Share.SHARE_TYPE_REMOTE_GROUP?s=n+" ("+t("core","remote group")+")":o===OC.Share.SHARE_TYPE_EMAIL?s=n+" ("+t("core","email")+")":o===OC.Share.SHARE_TYPE_CIRCLE&&(s=n,n="circle-"+a),r!==OC.getCurrentUser().uid){var h=""===s;h||(s+=" ("),s+=t("core","shared by {sharer}",{sharer:c}),h||(s+=")")}var u=this.model.get("shares")[a],m=u.password,p=null!==m&&""!==m,f=u.send_password_by_talk,g=this.model.getNote(a);return _.extend({},{cid:this.cid,hasSharePermission:this.model.hasSharePermission(a),editPermissionState:this.model.editPermissionState(a),hasCreatePermission:this.model.hasCreatePermission(a),hasUpdatePermission:this.model.hasUpdatePermission(a),hasDeletePermission:this.model.hasDeletePermission(a),sharedBy:r,sharedByDisplayName:c,shareWith:n,shareWithDisplayName:l,shareWithAvatar:i,shareWithTitle:s,shareType:o,shareId:this.model.get("shares")[a].id,modSeed:i||o!==OC.Share.SHARE_TYPE_USER&&o!==OC.Share.SHARE_TYPE_CIRCLE&&o!==OC.Share.SHARE_TYPE_ROOM,owner:d,isShareWithCurrentUser:o===OC.Share.SHARE_TYPE_USER&&n===OC.getCurrentUser().uid,canUpdateShareSettings:r===OC.getCurrentUser().uid||d===OC.getCurrentUser().uid,isRemoteShare:o===OC.Share.SHARE_TYPE_REMOTE,isRemoteGroupShare:o===OC.Share.SHARE_TYPE_REMOTE_GROUP,isNoteAvailable:o!==OC.Share.SHARE_TYPE_REMOTE&&o!==OC.Share.SHARE_TYPE_REMOTE_GROUP,isMailShare:o===OC.Share.SHARE_TYPE_EMAIL,isCircleShare:o===OC.Share.SHARE_TYPE_CIRCLE,isFileSharedByMail:o===OC.Share.SHARE_TYPE_EMAIL&&!this.model.isFolder(),isPasswordSet:p&&!f,isPasswordByTalkSet:p&&f,isTalkEnabled:void 0!==OC.appswebroots.spreed,secureDropMode:!this.model.hasReadPermission(a),hasExpireDate:null!==this.model.getExpireDate(a),shareNote:g,hasNote:""!==g,expireDate:moment(this.model.getExpireDate(a),"YYYY-MM-DD").format("DD-MM-YYYY"),passwordPlaceholder:p?"**********":e,passwordByTalkPlaceholder:p&&f?"**********":e})},getShareProperties:function(){return{unshareLabel:t("core","Unshare"),addNoteLabel:t("core","Note to recipient"),canShareLabel:t("core","Can reshare"),canEditLabel:t("core","Can edit"),createPermissionLabel:t("core","Can create"),updatePermissionLabel:t("core","Can change"),deletePermissionLabel:t("core","Can delete"),secureDropLabel:t("core","File drop (upload only)"),expireDateLabel:t("core","Set expiration date"),passwordLabel:t("core","Password protect"),passwordByTalkLabel:t("core","Password protect by Talk"),crudsLabel:t("core","Access control"),expirationDatePlaceholder:t("core","Expiration date"),defaultExpireDate:moment().add(1,"day").format("DD-MM-YYYY"),triangleSImage:OC.imagePath("core","actions/triangle-s"),isResharingAllowed:this.configModel.get("isResharingAllowed"),isPasswordForMailSharesRequired:this.configModel.get("isPasswordForMailSharesRequired"),sharePermissionPossible:this.model.sharePermissionPossible(),editPermissionPossible:this.model.editPermissionPossible(),createPermissionPossible:this.model.createPermissionPossible(),updatePermissionPossible:this.model.updatePermissionPossible(),deletePermissionPossible:this.model.deletePermissionPossible(),sharePermission:OC.PERMISSION_SHARE,createPermission:OC.PERMISSION_CREATE,updatePermission:OC.PERMISSION_UPDATE,deletePermission:OC.PERMISSION_DELETE,readPermission:OC.PERMISSION_READ,isFolder:this.model.isFolder()}},getShareeList:function(){var e=this.getShareProperties();if(!this.model.hasUserShares())return[];for(var a=this.model.get("shares"),n=[],t=0;t<a.length;t++){var l=this.getShareeObject(t);l.shareType!==OC.Share.SHARE_TYPE_LINK&&n.push(_.extend({},e,l))}return n},getLinkReshares:function(){var e={unshareLabel:t("core","Unshare")};if(!this.model.hasUserShares())return[];for(var a=this.model.get("shares"),n=[],l=0;l<a.length;l++){var i=this.getShareeObject(l);i.shareType===OC.Share.SHARE_TYPE_LINK&&n.push(_.extend({},e,i,{shareInitiator:a[l].uid_owner,shareInitiatorText:t("core","{shareInitiatorDisplayName} shared via link",{shareInitiatorDisplayName:a[l].displayname_owner})}))}return n},render:function(){if(this._renderPermissionChange){var e=parseInt(this._renderPermissionChange,10),a=this.model.findShareWithIndex(e),n=this.getShareeObject(a);$.extend(n,this.getShareProperties()),this.$("li[data-share-id="+e+"]").find(".sharingOptionsGroup .popovermenu").replaceWith(this.popoverMenuTemplate(n))}else this.$el.html(this.template({cid:this.cid,sharees:this.getShareeList(),linkReshares:this.getLinkReshares()})),this.$(".avatar").each(function(){var e=$(this);e.hasClass("imageplaceholderseed")?(e.css({width:32,height:32}),e.data("avatar")?(e.css("border-radius","0%"),e.css("background","url("+e.data("avatar")+") no-repeat"),e.css("background-size","31px")):e.imageplaceholder(e.data("seed"))):e.avatar(e.data("username"),32,void 0,void 0,void 0,e.data("displayname"))}),this.$(".has-tooltip").tooltip({placement:"bottom"}),this.$("ul.shareWithList > li").each(function(){var e=$(this),a=e.data("share-with"),n=e.data("share-type");e.find("div.avatar, span.username").contactsMenu(a,n,e)});var t=this;if(this.getShareeList().forEach(function(e){var a=t.$("#canEdit-"+t.cid+"-"+e.shareId);1===a.length&&(a.prop("checked","checked"===e.editPermissionState),e.isFolder&&a.prop("indeterminate","indeterminate"===e.editPermissionState))}),this.$(".popovermenu").on("afterHide",function(){t._menuOpen=!1}),this.$(".popovermenu").on("beforeHide",function(){var e=parseInt(t._menuOpen,10);if(!_.isNaN(e)){var a=".expirationDateContainer-"+t.cid+"-"+e,n="#expirationDatePicker-"+t.cid+"-"+e,l="#expireDate-"+t.cid+"-"+e;$(l).prop("checked")&&($(n).removeClass("hidden-visually"),$(a).removeClass("hasDatepicker"),$(a+" .ui-datepicker").hide())}}),!1!==this._menuOpen){var l=parseInt(this._menuOpen,10);if(!_.isNaN(l)){var i="li[data-share-id="+l+"]";OC.showMenu(null,this.$(i+" .sharingOptionsGroup .popovermenu"))}}return this._renderPermissionChange=!1,autosize(this.$el.find(".share-note-form .share-note")),this.delegateEvents(),this},template:function(e){var a=e.sharees;if(_.isArray(a))for(var n=0;n<a.length;n++)e.sharees[n].popoverMenu=this.popoverMenuTemplate(a[n]);return OC.Share.Templates.sharedialogshareelistview(e)},popoverMenuTemplate:function(e){return OC.Share.Templates.sharedialogshareelistview_popover_menu(e)},showNoteForm:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target).closest("li"),n=a.next("li.share-note-form");a.find(".share-note-delete").toggleClass("hidden"),n.toggleClass("hidden"),n.find("textarea").focus()},deleteNote:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=a.closest("li[data-share-id]").data("share-id"),t=a.closest("li"),l=t.next("li.share-note-form");console.log(l.find(".share-note")),l.find(".share-note").val(""),l.addClass("hidden"),t.find(".share-note-delete").addClass("hidden"),this.sendNote("",n,t)},updateNote:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=a.closest("li[data-share-id]").data("share-id"),t=a.closest("li.share-note-form"),l=t.prev("li"),i=t.find(".share-note").val().trim();i.length<1||this.sendNote(i,n,l)},sendNote:function(e,a,n){var t=n.next("li.share-note-form"),l=t.find("input.share-note-submit"),i=t.find("input.share-note-error");l.prop("disabled",!0),n.find(".icon-loading-small").removeClass("hidden"),n.find(".icon-edit").hide();$.ajax({method:"PUT",url:OC.linkToOCS("apps/files_sharing/api/v1/shares",2)+a+"?"+OC.buildQueryString({format:"json"}),data:{note:e},complete:function(){l.prop("disabled",!1),n.find(".icon-loading-small").addClass("hidden"),n.find(".icon-edit").show()},error:function(){i.show(),setTimeout(function(){i.hide()},3e3)}})},onUnshare:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target);a.is("a")||(a=a.closest("a"));var n=a.find(".icon-loading-small").eq(0);if(!n.hasClass("hidden"))return!1;n.removeClass("hidden");var l=a.closest("li[data-share-id]"),i=l.data("share-id");return this.model.removeShare(i).done(function(){l.remove()}).fail(function(){n.addClass("hidden"),OC.Notification.showTemporary(t("core","Could not unshare"))}),!1},onToggleMenu:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target).closest("li[data-share-id]"),n=a.find(".sharingOptionsGroup .popovermenu");OC.showMenu(null,n),this._menuOpen=a.data("share-id")},onExpireDateChange:function(e){var a=$(e.target),n=a.closest("li[data-share-id]").data("share-id"),t=".expirationDateContainer-"+this.cid+"-"+n,l=$(t),i=a.prop("checked");l.toggleClass("hidden",!i),i?(a.closest("li").next("li").removeClass("hidden"),this.showDatePicker(e)):(a.closest("li").next("li").addClass("hidden"),this.setExpirationDate(n,""))},showDatePicker:function(e){var a=$(e.target).closest("li[data-share-id]").data("share-id"),n="#expirationDatePicker-"+this.cid+"-"+a,t=this;$(n).datepicker({dateFormat:"dd-mm-yy",onSelect:function(e){t.setExpirationDate(a,e)}}),$(n).focus()},setExpirationDate:function(e,a){this.model.updateShare(e,{expireDate:a},{})},onMailSharePasswordProtectChange:function(a){var n=$(a.target),t=n.closest("li[data-share-id]").data("share-id"),l=".passwordMenu-"+this.cid+"-"+t,i=$(l),s=this.$el.find(l+" .icon-loading-small"),o="#passwordField-"+this.cid+"-"+t,r=$(o),c=n.prop("checked"),d=$("#passwordByTalk-"+this.cid+"-"+t),h=d.prop("checked");if(c||h){if(c){if(h){this.model.updateShare(t,{sendPasswordByTalk:!1});var u=".passwordByTalkMenu-"+this.cid+"-"+t;$(u).addClass("hidden"),d.prop("checked",!1)}i.toggleClass("hidden",!c),r="#passwordField-"+this.cid+"-"+t,this.$(r).focus()}}else this.model.updateShare(t,{password:"",sendPasswordByTalk:!1}),r.attr("value",""),r.removeClass("error"),r.tooltip("hide"),s.addClass("hidden"),r.attr("placeholder",e),i.toggleClass("hidden",!c)},onMailSharePasswordProtectByTalkChange:function(a){var n=$(a.target),t=n.closest("li[data-share-id]").data("share-id"),l=".passwordByTalkMenu-"+this.cid+"-"+t,i=$(l),s=this.$el.find(l+" .icon-loading-small"),o="#passwordByTalkField-"+this.cid+"-"+t,r=$(o),c=n.prop("checked"),d=$("#password-"+this.cid+"-"+t),h=d.prop("checked");if(c){if(c){if(h){var u=".passwordMenu-"+this.cid+"-"+t;$(u).addClass("hidden"),d.prop("checked",!1)}i.toggleClass("hidden",!c),r="#passwordByTalkField-"+this.cid+"-"+t,this.$(r).focus()}}else this.model.updateShare(t,{password:"",sendPasswordByTalk:!1}),r.attr("value",""),r.removeClass("error"),r.tooltip("hide"),s.addClass("hidden"),r.attr("placeholder",e),i.toggleClass("hidden",!c)},onMailSharePasswordKeyUp:function(e){13===e.keyCode&&this.onMailSharePasswordEntered(e)},onMailSharePasswordEntered:function(a){var n,t=$(a.target),l=t.closest("li[data-share-id]").data("share-id"),i=".passwordMenu-"+this.cid+"-"+l,s=".passwordByTalkMenu-"+this.cid+"-"+l,o=t.attr("id").startsWith("passwordByTalk");if((n=o?this.$el.find(s+" .icon-loading-small"):this.$el.find(i+" .icon-loading-small")).hasClass("hidden")){t.removeClass("error");var r=t.val();""!==r&&"**********"!==r&&r!==e&&(n.removeClass("hidden").addClass("inlineblock"),this.model.updateShare(l,{password:r,sendPasswordByTalk:o},{error:function(e,a){t.tooltip("destroy"),n.removeClass("inlineblock").addClass("hidden"),t.addClass("error"),t.attr("title",a),t.tooltip({placement:"bottom",trigger:"manual"}),t.tooltip("show")},success:function(e,a){t.blur(),t.attr("value",""),t.attr("placeholder","**********"),n.removeClass("inlineblock").addClass("hidden")}}))}},onPermissionChange:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=a.closest("li[data-share-id]"),l=n.data("share-id"),i=OC.PERMISSION_READ;if(this.model.isFolder()){var s,o=$(".permissions",n).not('input[name="edit"]').not('input[name="share"]');if("edit"===a.attr("name"))s=a.is(":checked"),$(o).prop("checked",s),s&&(i|=OC.PERMISSION_CREATE|OC.PERMISSION_UPDATE|OC.PERMISSION_DELETE);else{var r=o.filter(":checked").length;s=r===o.length;var c=$('input[name="edit"]',n);c.prop("checked",s),c.prop("indeterminate",!s&&r>0)}}else"edit"===a.attr("name")&&a.is(":checked")&&(i|=OC.PERMISSION_UPDATE);$(".permissions",n).not('input[name="edit"]').filter(":checked").each(function(e,a){i|=$(a).data("permissions")}),n.find("input[type=checkbox]").prop("disabled",!0);var d=function(){n.find("input[type=checkbox]").prop("disabled",!1)};this.model.updateShare(l,{permissions:i},{error:function(e,a){OC.dialogs.alert(a,t("core","Error while sharing")),d()},success:d}),this._renderPermissionChange=l},onSecureDropChange:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=a.closest("li[data-share-id]"),l=n.data("share-id"),i=OC.PERMISSION_CREATE|OC.PERMISSION_UPDATE|OC.PERMISSION_DELETE|OC.PERMISSION_READ;a.is(":checked")&&(i=OC.PERMISSION_CREATE|OC.PERMISSION_UPDATE|OC.PERMISSION_DELETE),n.find("input[type=checkbox]").prop("disabled",!0);var s=function(){n.find("input[type=checkbox]").prop("disabled",!1)};this.model.updateShare(l,{permissions:i},{error:function(e,a){OC.dialogs.alert(a,t("core","Error while sharing")),s()},success:s}),this._renderPermissionChange=l}});OC.Share.ShareDialogShareeListView=a}()},function(e,a){!function(){OC.Share||(OC.Share={});var e=OC.Backbone.View.extend({_templates:{},_showLink:!0,_lookup:!1,_lookupAllowed:!1,tagName:"div",configModel:void 0,resharerInfoView:void 0,linkShareView:void 0,shareeListView:void 0,_lastSuggestions:void 0,_lastRecommendations:void 0,_pendingOperationsCount:0,events:{"focus .shareWithField":"onShareWithFieldFocus","input .shareWithField":"onShareWithFieldChanged","click .shareWithConfirm":"_confirmShare"},initialize:function(e){var a=this;if(this.model.on("fetchError",function(){OC.Notification.showTemporary(t("core","Share details could not be loaded for this item."))}),_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel,this.configModel.on("change:isRemoteShareAllowed",function(){a.render()}),this.configModel.on("change:isRemoteGroupShareAllowed",function(){a.render()}),this.model.on("change:permissions",function(){a.render()}),this.model.on("request",this._onRequest,this),this.model.on("sync",this._onEndRequest,this);var n={model:this.model,configModel:this.configModel},l={resharerInfoView:"ShareDialogResharerInfoView",linkShareView:"ShareDialogLinkShareView",shareeListView:"ShareDialogShareeListView"};for(var i in l){var s=l[i];this[i]=_.isUndefined(e[i])?new OC.Share[s](n):e[i]}_.bindAll(this,"autocompleteHandler","_onSelectRecipient","onShareWithFieldChanged","onShareWithFieldFocus"),OC.Plugins.attach("OC.Share.ShareDialogView",this)},onShareWithFieldChanged:function(){var e=this.$el.find(".shareWithField");e.val().length<2&&e.removeClass("error").tooltip("hide")},onShareWithFieldFocus:function(){var e=this.$el.find(".shareWithField");e.autocomplete("search",e.val())},_getSuggestions:function(e,a,n,l){if(this._lastSuggestions&&this._lastSuggestions.searchTerm===e&&this._lastSuggestions.lookup===l&&this._lastSuggestions.perPage===a&&this._lastSuggestions.model===n)return this._lastSuggestions.promise;var i=$.Deferred(),s=this,o=OC.getCapabilities();return o.files_sharing&&o.files_sharing.sharee&&o.files_sharing.sharee.query_lookup_default&&(this._lookup=!0),$.get(OC.linkToOCS("apps/files_sharing/api/v1")+"sharees",{format:"json",search:e,lookup:l,perPage:a,itemType:n.get("itemType")},function(l){if(100===l.ocs.meta.statuscode){var o=function(e,a,t,l,i,s,o){var r,c,d,h,u,m,p,f,g;for(void 0===i&&(i=[]),void 0===s&&(s=[]),void 0===o&&(o=[]),r=e.length,f=0;f<r;f++)if(e[f].value.shareWith===OC.currentUser){e.splice(f,1);break}if(n.hasReshare())for(r=e.length,f=0;f<r;f++)if(e[f].value.shareWith===n.getReshareOwner()){e.splice(f,1);break}var v=n.get("shares"),S=v.length;for(f=0;f<S;f++){var C=v[f];if(C.share_type===OC.Share.SHARE_TYPE_USER){for(r=e.length,g=0;g<r;g++)if(e[g].value.shareWith===C.share_with){e.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_GROUP){for(c=a.length,g=0;g<c;g++)if(a[g].value.shareWith===C.share_with){a.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_REMOTE){for(d=t.length,g=0;g<d;g++)if(t[g].value.shareWith===C.share_with){t.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_REMOTE_GROUP){for(h=l.length,g=0;g<h;g++)if(l[g].value.shareWith===C.share_with){l.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_EMAIL){for(u=i.length,g=0;g<u;g++)if(i[g].value.shareWith===C.share_with){i.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_CIRCLE){for(m=s.length,g=0;g<m;g++)if(s[g].value.shareWith===C.share_with){s.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_ROOM)for(p=o.length,g=0;g<p;g++)if(o[g].value.shareWith===C.share_with){o.splice(g,1);break}}};o(l.ocs.data.exact.users,l.ocs.data.exact.groups,l.ocs.data.exact.remotes,l.ocs.data.exact.remote_groups,l.ocs.data.exact.emails,l.ocs.data.exact.circles,l.ocs.data.exact.rooms);var r=l.ocs.data.exact.users,c=l.ocs.data.exact.groups,d=l.ocs.data.exact.remotes,h=l.ocs.data.exact.remote_groups,u=[];void 0!==l.ocs.data.emails&&(u=l.ocs.data.exact.emails);var m=[];void 0!==l.ocs.data.circles&&(m=l.ocs.data.exact.circles);var p=[];void 0!==l.ocs.data.rooms&&(p=l.ocs.data.exact.rooms);var f=r.concat(c).concat(d).concat(h).concat(u).concat(m).concat(p);o(l.ocs.data.users,l.ocs.data.groups,l.ocs.data.remotes,l.ocs.data.remote_groups,l.ocs.data.emails,l.ocs.data.circles,l.ocs.data.rooms);var g=l.ocs.data.users,v=l.ocs.data.groups,S=l.ocs.data.remotes,C=l.ocs.data.remote_groups,w=l.ocs.data.lookup,b=l.ocs.data.lookupEnabled,P=[];void 0!==l.ocs.data.emails&&(P=l.ocs.data.emails);var _=[];void 0!==l.ocs.data.circles&&(_=l.ocs.data.circles);var E=[];void 0!==l.ocs.data.rooms&&(E=l.ocs.data.rooms);for(var k=f.concat(g).concat(v).concat(S).concat(C).concat(P).concat(_).concat(E).concat(w).sort((R="uuid",function(e,a){var n="",t="";return void 0!==e[R]&&(n=e[R]),void 0!==a[R]&&(t=a[R]),n<t?-1:n>t?1:0})),O=null,x=k.length,y=(l=[],0);y<x;y++)void 0!==k[y].uuid&&k[y].uuid===O&&(k[y].merged=!0),e!==k[y].name&&void 0!==k[y].merged||l.push(k[y]),O=k[y].uuid;var T=OC.config["sharing.maxAutocompleteResults"]>0&&Math.min(a,OC.config["sharing.maxAutocompleteResults"])<=Math.max(g.length+r.length,v.length+c.length,C.length+h.length,S.length+d.length,P.length+u.length,_.length+m.length,E.length+p.length,w.length);!s._lookup&&b&&l.push({label:t("core","Search globally"),value:{},lookup:!0}),i.resolve(l,f,T,b)}else i.reject(l.ocs.meta.message);var R}).fail(function(){i.reject()}),this._lastSuggestions={searchTerm:e,lookup:l,perPage:a,model:n,promise:i.promise()},this._lastSuggestions.promise},_getRecommendations:function(e){if(this._lastRecommendations&&this._lastRecommendations.model===e)return this._lastRecommendations.promise;var a=$.Deferred();return $.get(OC.linkToOCS("apps/files_sharing/api/v1")+"sharees_recommended",{format:"json",itemType:e.get("itemType")},function(n){if(100===n.ocs.meta.statuscode){var t=function(a,n,t,l,i,s,o){var r,c,d,h,u,m,p,f,g;for(void 0===i&&(i=[]),void 0===s&&(s=[]),void 0===o&&(o=[]),r=a.length,f=0;f<r;f++)if(a[f].value.shareWith===OC.currentUser){a.splice(f,1);break}if(e.hasReshare())for(r=a.length,f=0;f<r;f++)if(a[f].value.shareWith===e.getReshareOwner()){a.splice(f,1);break}var v=e.get("shares"),S=v.length;for(f=0;f<S;f++){var C=v[f];if(C.share_type===OC.Share.SHARE_TYPE_USER){for(r=a.length,g=0;g<r;g++)if(a[g].value.shareWith===C.share_with){a.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_GROUP){for(c=n.length,g=0;g<c;g++)if(n[g].value.shareWith===C.share_with){n.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_REMOTE){for(d=t.length,g=0;g<d;g++)if(t[g].value.shareWith===C.share_with){t.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_REMOTE_GROUP){for(h=l.length,g=0;g<h;g++)if(l[g].value.shareWith===C.share_with){l.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_EMAIL){for(u=i.length,g=0;g<u;g++)if(i[g].value.shareWith===C.share_with){i.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_CIRCLE){for(m=s.length,g=0;g<m;g++)if(s[g].value.shareWith===C.share_with){s.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_ROOM)for(p=o.length,g=0;g<p;g++)if(o[g].value.shareWith===C.share_with){o.splice(g,1);break}}};t(n.ocs.data.exact.users,n.ocs.data.exact.groups,n.ocs.data.exact.remotes,n.ocs.data.exact.remote_groups,n.ocs.data.exact.emails,n.ocs.data.exact.circles,n.ocs.data.exact.rooms);var l=n.ocs.data.exact.users,i=n.ocs.data.exact.groups,s=n.ocs.data.exact.remotes||[],o=n.ocs.data.exact.remote_groups||[],r=[];void 0!==n.ocs.data.emails&&(r=n.ocs.data.exact.emails);var c=[];void 0!==n.ocs.data.circles&&(c=n.ocs.data.exact.circles);var d=[];void 0!==n.ocs.data.rooms&&(d=n.ocs.data.exact.rooms);var h=l.concat(i).concat(s).concat(o).concat(r).concat(c).concat(d);t(n.ocs.data.users,n.ocs.data.groups,n.ocs.data.remotes,n.ocs.data.remote_groups,n.ocs.data.emails,n.ocs.data.circles,n.ocs.data.rooms);var u=n.ocs.data.users,m=n.ocs.data.groups,p=n.ocs.data.remotes||[],f=n.ocs.data.remote_groups||[],g=n.ocs.data.lookup||[],v=[];void 0!==n.ocs.data.emails&&(v=n.ocs.data.emails);var S=[];void 0!==n.ocs.data.circles&&(S=n.ocs.data.circles);var C=[];void 0!==n.ocs.data.rooms&&(C=n.ocs.data.rooms);for(var w=h.concat(u).concat(m).concat(p).concat(f).concat(v).concat(S).concat(C).concat(g).sort((E="uuid",function(e,a){var n="",t="";return void 0!==e[E]&&(n=e[E]),void 0!==a[E]&&(t=a[E]),n<t?-1:n>t?1:0})),b=null,P=w.length,_=(n=[],0);_<P;_++)void 0!==w[_].uuid&&w[_].uuid===b&&(w[_].merged=!0),void 0===w[_].merged&&n.push(w[_]),b=w[_].uuid;a.resolve(n,h,!1)}else a.reject(n.ocs.meta.message);var E}).fail(function(){a.reject()}),this._lastRecommendations={model:e,promise:a.promise()},this._lastRecommendations.promise},recommendationHandler:function(e){var a=$(".shareWithField");this._getRecommendations(this.model).done(function(n){console.info("recommendations",n),n.length>0?(a.autocomplete("option","autoFocus",!0),e(n)):(console.info("no sharing recommendations found"),e())}).fail(function(e){console.error("could not load recommendations",e)})},autocompleteHandler:function(e,a){if(0===e.term.length)return console.info(e.term,"empty search term -> using recommendations"),void this.recommendationHandler(a);var l=$(".shareWithField"),i=this,s=this.$el.find(".shareWithLoading"),o=this.$el.find(".shareWithConfirm"),r=OC.config["sharing.minSearchStringLength"];if(e.term.trim().length<r){var c=n("core","At least {count} character is needed for autocompletion","At least {count} characters are needed for autocompletion",r,{count:r});return l.addClass("error").attr("data-original-title",c).tooltip("hide").tooltip({placement:"bottom",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),void a()}s.removeClass("hidden"),s.addClass("inlineblock"),o.addClass("hidden"),this._pendingOperationsCount++,l.removeClass("error").tooltip("hide");var d=parseInt(OC.config["sharing.maxAutocompleteResults"],10)||200;this._getSuggestions(e.term.trim(),d,i.model,i._lookup).done(function(e,n,r){if(i._pendingOperationsCount--,0===i._pendingOperationsCount&&(s.addClass("hidden"),s.removeClass("inlineblock"),o.removeClass("hidden")),e.length>0){if(l.autocomplete("option","autoFocus",!0),a(e),r){var c=t("core","This list is maybe truncated - please refine your search term to see more results.");$(".ui-autocomplete").append('<li class="autocomplete-note">'+c+"</li>")}}else{var d=t("core","No users or groups found for {search}",{search:l.val()});i.configModel.get("allowGroupSharing")||(d=t("core","No users found for {search}",{search:$(".shareWithField").val()})),l.addClass("error").attr("data-original-title",d).tooltip("hide").tooltip({placement:"top",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),a()}}).fail(function(e){i._pendingOperationsCount--,0===i._pendingOperationsCount&&(s.addClass("hidden"),s.removeClass("inlineblock"),o.removeClass("hidden")),e?OC.Notification.showTemporary(t("core",'An error occurred ("{message}"). Please try again',{message:e})):OC.Notification.showTemporary(t("core","An error occurred. Please try again"))})},autocompleteRenderItem:function(e,a){var n="icon-user",l=escapeHTML(a.label),i="",s="";void 0!==a.type&&null!==a.type&&(s=function(e){switch(e){case"HOME":return t("core","Home");case"WORK":return t("core","Work");case"OTHER":return t("core","Other");default:return""+e}}(a.type)+" "),void 0!==a.name&&(l=escapeHTML(a.name)),a.value.shareType===OC.Share.SHARE_TYPE_GROUP?n="icon-contacts-dark":a.value.shareType===OC.Share.SHARE_TYPE_REMOTE?(n="icon-shared",i+=a.value.shareWith):a.value.shareType===OC.Share.SHARE_TYPE_REMOTE_GROUP?(l=t("core","{sharee} (remote group)",{sharee:l},void 0,{escape:!1}),n="icon-shared",i+=a.value.shareWith):a.value.shareType===OC.Share.SHARE_TYPE_EMAIL?(n="icon-mail",i+=a.value.shareWith):a.value.shareType===OC.Share.SHARE_TYPE_CIRCLE?(l=t("core","{sharee} ({type}, {owner})",{sharee:l,type:a.value.circleInfo,owner:a.value.circleOwner},void 0,{escape:!1}),n="icon-circle"):a.value.shareType===OC.Share.SHARE_TYPE_ROOM&&(n="icon-talk");var o=$("<div class='share-autocomplete-item'/>");if(a.merged)o.addClass("merged"),l=a.value.shareWith,i=s;else if(a.lookup)l=a.label,n=!1,o.append('<span class="icon icon-search search-globally"></span>');else{var r=$("<div class='avatardiv'></div>").appendTo(o);a.value.shareType===OC.Share.SHARE_TYPE_USER||a.value.shareType===OC.Share.SHARE_TYPE_CIRCLE?r.avatar(a.value.shareWith,32,void 0,void 0,void 0,a.label):(void 0===a.uuid&&(a.uuid=l),r.imageplaceholder(a.uuid,l,32)),i=s+i}return""!==i&&o.addClass("with-description"),$("<div class='autocomplete-item-text'></div>").html(l.replace(new RegExp(this.term,"gi"),"<span class='ui-state-highlight'>$&</span>")+'<span class="autocomplete-item-details">'+i+"</span>").appendTo(o),o.attr("title",a.value.shareWith),n&&o.append('<span class="icon '+n+'" title="'+l+'"></span>'),o=$("<a>").append(o),$("<li>").addClass(a.value.shareType===OC.Share.SHARE_TYPE_GROUP?"group":"user").append(o).appendTo(e)},_onSelectRecipient:function(e,a){var n=this;if(9==e.keyCode)return e.preventDefault(),void 0!==a.item.name?e.target.value=a.item.name:e.target.value=a.item.label,setTimeout(function(){$(e.target).attr("disabled",!1).autocomplete("search",$(e.target).val())},0),!1;if(a.item.lookup){this._lookup=!0;var t=this.$el.find(".shareWithField"),l=t.val();return setTimeout(function(){console.debug("searching again, but globally. search term: "+l),t.autocomplete("search",l)},0),!1}e.preventDefault(),e.stopImmediatePropagation(),$(e.target).attr("disabled",!0).val(a.item.label);var i=this.$el.find(".shareWithLoading"),s=this.$el.find(".shareWithConfirm");i.removeClass("hidden"),i.addClass("inlineblock"),s.addClass("hidden"),this._pendingOperationsCount++,this.model.addShare(a.item.value,{success:function(){n._lastSuggestions=void 0,$(e.target).val("").attr("disabled",!1),n._pendingOperationsCount--,0===n._pendingOperationsCount&&(i.addClass("hidden"),i.removeClass("inlineblock"),s.removeClass("hidden"))},error:function(a,t){OC.Notification.showTemporary(t),$(e.target).attr("disabled",!1).autocomplete("search",$(e.target).val()),n._pendingOperationsCount--,0===n._pendingOperationsCount&&(i.addClass("hidden"),i.removeClass("inlineblock"),s.removeClass("hidden"))}})},_confirmShare:function(){var e=this,a=$(".shareWithField"),n=this.$el.find(".shareWithLoading"),t=this.$el.find(".shareWithConfirm");n.removeClass("hidden"),n.addClass("inlineblock"),t.addClass("hidden"),this._pendingOperationsCount++,a.prop("disabled",!0),a.autocomplete("close"),a.autocomplete("disable");var l=function(){e._pendingOperationsCount--,0===e._pendingOperationsCount&&(n.addClass("hidden"),n.removeClass("inlineblock"),t.removeClass("hidden")),a.prop("disabled",!1),a.focus()},i=parseInt(OC.config["sharing.maxAutocompleteResults"],10)||200;this._getSuggestions(a.val(),i,this.model,this._lookup).done(function(n,t){if(0===n.length)return l(),void a.autocomplete("enable");if(1!==t.length)return l(),void a.autocomplete("enable");e.model.addShare(t[0].value,{success:function(){e._lastSuggestions=void 0,a.val(""),l(),a.autocomplete("enable")},error:function(e,n){l(),a.autocomplete("enable"),OC.Notification.showTemporary(n)}})}).fail(function(e){l(),a.autocomplete("enable")})},_toggleLoading:function(e){this._loading=e,this.$el.find(".subView").toggleClass("hidden",e),this.$el.find(".loading").toggleClass("hidden",!e)},_onRequest:function(){this._loadingOnce||this._toggleLoading(!0)},_onEndRequest:function(){this._toggleLoading(!1),this._loadingOnce||(this._loadingOnce=!0)},render:function(){var e=this,a=OC.Share.Templates.sharedialogview;this.$el.html(a({cid:this.cid,shareLabel:t("core","Share"),sharePlaceholder:this._renderSharePlaceholderPart(),isSharingAllowed:this.model.sharePermissionPossible()}));var n=this.$el.find(".shareWithField");if(n.length){n.autocomplete({minLength:0,delay:750,focus:function(e){e.preventDefault()},source:this.autocompleteHandler,select:this._onSelectRecipient,open:function(){var e=$(this).autocomplete("widget"),a=e.find("li").size();e.removeClass("item-count-1"),e.removeClass("item-count-2"),a<=2&&e.addClass("item-count-"+a)}}).data("ui-autocomplete")._renderItem=this.autocompleteRenderItem,n.on("keydown",null,function(a){return 13!==a.keyCode||(e._confirmShare(),!1)})}return this.resharerInfoView.$el=this.$el.find(".resharerInfoView"),this.resharerInfoView.render(),this.linkShareView.$el=this.$el.find(".linkShareView"),this.linkShareView.render(),this.shareeListView.$el=this.$el.find(".shareeListView"),this.shareeListView.render(),this.$el.find(".hasTooltip").tooltip(),this},setShowLink:function(e){this._showLink="boolean"!=typeof e||e,this.linkShareView.showLink=this._showLink},_renderSharePlaceholderPart:function(){var e=this.configModel.get("isRemoteShareAllowed"),a=this.configModel.get("isMailShareAllowed");return!e&&a?t("core","Name or email address..."):e&&!a?t("core","Name or federated cloud ID..."):e&&a?t("core","Name, federated cloud ID or email address..."):t("core","Name...")}});OC.Share.ShareDialogView=e}()},function(e,a){OC.Share=_.extend(OC.Share||{},{SHARE_TYPE_USER:0,SHARE_TYPE_GROUP:1,SHARE_TYPE_LINK:3,SHARE_TYPE_EMAIL:4,SHARE_TYPE_REMOTE:6,SHARE_TYPE_CIRCLE:7,SHARE_TYPE_GUEST:8,SHARE_TYPE_REMOTE_GROUP:9,SHARE_TYPE_ROOM:10,_REMOTE_OWNER_REGEXP:new RegExp("^([^@]*)@(([^@]*)@)?([^/]*)([/](.*)?)?$"),itemShares:[],statuses:{},currentShares:{},droppedDown:!1,loadIcons:function(e,a,n){var t=a.dirInfo.path;"/"===t&&(t=""),t+="/"+a.dirInfo.name,$.get(OC.linkToOCS("apps/files_sharing/api/v1",2)+"shares",{subfiles:"true",path:t,format:"json"},function(t){t&&200===t.ocs.meta.statuscode&&(OC.Share.statuses={},$.each(t.ocs.data,function(e,a){a.item_source in OC.Share.statuses||(OC.Share.statuses[a.item_source]={link:!1}),a.share_type===OC.Share.SHARE_TYPE_LINK&&(OC.Share.statuses[a.item_source]={link:!0})}),_.isFunction(n)?n(OC.Share.statuses):OC.Share.updateIcons(e,a))})},updateIcons:function(e,a){var n,l,i;for(n in!a&&OCA.Files&&(a=OCA.Files.App.fileList),a&&(l=a.$fileList,i=a.getCurrentDirectory()),OC.Share.statuses){var s="icon-shared",o=OC.Share.statuses[n],r=o.link;if(r&&(s="icon-public"),"file"!==e&&"folder"!==e)$('a.share[data-item="'+n+'"] .icon').removeClass("icon-shared icon-public").addClass(s);else{var c,d=l.find('tr[data-id="'+n+'"]'),h=OC.imagePath("core","filetypes/folder-shared");if(d.length>0)this.markFileAsShared(d,!0,r);else{var u=i;if(u.length>1)for(var m="",p=u;p!=m;){if(p===o.path&&!o.link){var f,g=l.find('.fileactions .action[data-action="Share"]'),v=l.find(".filename");for(f=0;f<g.length;f++)(c=$(g[f]).find("img")).attr("src")!==OC.imagePath("core","actions/public")&&(c.attr("src",image),$(g[f]).addClass("permanent"),$(g[f]).html("<span> "+t("core","Shared")+"</span>").prepend(c));for(f=0;f<v.length;f++)"dir"===$(v[f]).closest("tr").data("type")&&$(v[f]).find(".thumbnail").css("background-image","url("+h+")")}m=p,p=OC.Share.dirname(p)}}}}},updateIcon:function(e,a){var n=!1,t=!1,l="";if($.each(OC.Share.itemShares,function(e){if(OC.Share.itemShares[e])if(e==OC.Share.SHARE_TYPE_LINK){if(1==OC.Share.itemShares[e])return n=!0,l="icon-public",void(t=!0)}else OC.Share.itemShares[e].length>0&&(n=!0,l="icon-shared")}),"file"!=e&&"folder"!=e)$('a.share[data-item="'+a+'"] .icon').removeClass("icon-shared icon-public").addClass(l);else{var i=$("tr").filterAttr("data-id",String(a));i.length>0&&i.each(function(){OC.Share.markFileAsShared($(this),n,t)})}n?(OC.Share.statuses[a]=OC.Share.statuses[a]||{},OC.Share.statuses[a].link=t):delete OC.Share.statuses[a]},_formatRemoteShare:function(e,a,n){var t=this._REMOTE_OWNER_REGEXP.exec(e);if(!t)return'<span class="avatar" data-username="'+escapeHTML(e)+'" title="'+n+" "+escapeHTML(a)+'"></span>'+('<span class="hidden-visually">'+n+" "+escapeHTML(a)+"</span> ");var l=t[1],i=t[3],s=t[4],o=n+" "+l;i&&(o+="@"+i),s&&(i||(i="…"),o+="@"+s);var r='<span class="remoteAddress" title="'+escapeHTML(o)+'">';return r+='<span class="username">'+escapeHTML(l)+"</span>",i&&(r+='<span class="userDomain">@'+escapeHTML(i)+"</span>"),r+="</span> "},_formatShareList:function(e){var a=this;return(e=_.toArray(e)).sort(function(e,a){return e.shareWithDisplayName.localeCompare(a.shareWithDisplayName)}),$.map(e,function(e){return a._formatRemoteShare(e.shareWith,e.shareWithDisplayName,t("core","Shared with"))})},markFileAsShared:function(e,a,n){var l,i,s,o,r=e.find('.fileactions .action[data-action="Share"]'),c=e.data("type"),d=r.find(".icon"),h=e.attr("data-share-owner-id"),u=e.attr("data-share-owner"),m=e.attr("data-mounttype"),p="icon-shared";if(r.removeClass("shared-style"),"dir"===c&&(a||n||h))o=void 0!==m&&"shared-root"!==m&&"shared"!==m?OC.MimeType.getIconUrl("dir-"+m):n?OC.MimeType.getIconUrl("dir-public"):OC.MimeType.getIconUrl("dir-shared"),e.find(".filename .thumbnail").css("background-image","url("+o+")"),e.attr("data-icon",o);else if("dir"===c){"true"===e.attr("data-e2eencrypted")?(o=OC.MimeType.getIconUrl("dir-encrypted"),e.attr("data-icon",o)):m&&0===m.indexOf("external")?(o=OC.MimeType.getIconUrl("dir-external"),e.attr("data-icon",o)):(o=OC.MimeType.getIconUrl("dir"),e.removeAttr("data-icon")),e.find(".filename .thumbnail").css("background-image","url("+o+")")}a||h?(i=e.data("share-recipient-data"),r.addClass("shared-style"),s="<span>"+t("core","Shared")+"</span>",h?(l=t("core","Shared by"),s=this._formatRemoteShare(h,u,l)):i&&(s=this._formatShareList(i)),r.html(s).prepend(d),(h||i)&&(r.find(".avatar").each(function(){$(this).avatar($(this).data("username"),32)}),r.find("span[title]").tooltip({placement:"top"}))):r.html('<span class="hidden-visually">'+t("core","Shared")+"</span>").prepend(d);n&&(p="icon-public"),d.removeClass("icon-shared icon-public").addClass(p)},showDropDown:function(e,a,n,t,l,i){var s=new OC.Share.ShareConfigModel,o={itemType:e,itemSource:a,possiblePermissions:l},r=new OC.Share.ShareItemModel(o,{configModel:s}),c=new OC.Share.ShareDialogView({id:"dropdown",model:r,configModel:s,className:"drop shareDropDown",attributes:{"data-item-source-name":i,"data-item-type":e,"data-item-source":a}});c.setShowLink(t);var d=c.render().$el;d.appendTo(n),d.slideDown(OC.menuSpeed,function(){OC.Share.droppedDown=!0}),r.fetch()},hideDropDown:function(e){OC.Share.currentShares=null,$("#dropdown").slideUp(OC.menuSpeed,function(){OC.Share.droppedDown=!1,$("#dropdown").remove(),"undefined"!=typeof FileActions&&$("tr").removeClass("mouseOver"),e&&e.call()})},dirname:function(e){return e.replace(/\\/g,"/").replace(/\/[^\/]*$/,"")}}),$(document).ready(function(){if("undefined"!=typeof monthNames){var e=new Date;e.setDate(e.getDate()+1),$.datepicker.setDefaults({monthNames:monthNames,monthNamesShort:monthNamesShort,dayNames:dayNames,dayNamesMin:dayNamesMin,dayNamesShort:dayNamesShort,firstDay:firstDay,minDate:e})}$(this).click(function(e){var a=$(e.target),n=!a.is(".drop, .ui-datepicker-next, .ui-datepicker-prev, .ui-icon")&&!a.closest("#ui-datepicker-div").length&&!a.closest(".ui-autocomplete").length;OC.Share&&OC.Share.droppedDown&&n&&0===$("#dropdown").has(e.target).length&&OC.Share.hideDropDown()})})}]);
//# sourceMappingURL=share_backend.js.map