5019-5019.js 52 KB

12
  1. "use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[5019],{31989:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(71354),a=i.n(n),s=i(76314),r=i.n(s)()(a());r.push([t.id,"/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n/**\n * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n/*\n* Ensure proper alignment of the vue material icons\n*/\n.material-design-icon[data-v-470fc02d] {\n display: flex;\n align-self: center;\n justify-self: center;\n align-items: center;\n justify-content: center;\n}\n.nc-chip[data-v-470fc02d] {\n --chip-size: 24px;\n --chip-radius: calc(var(--chip-size) / 2);\n height: var(--chip-size);\n max-width: fit-content;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-radius: var(--chip-radius);\n background-color: var(--color-background-hover);\n}\n.nc-chip--primary[data-v-470fc02d] {\n background-color: var(--color-primary-element);\n color: var(--color-primary-text);\n}\n.nc-chip--secondary[data-v-470fc02d] {\n background-color: var(--color-primary-element-light);\n color: var(--color-primary-element-light-text);\n}\n.nc-chip--no-actions .nc-chip__text[data-v-470fc02d] {\n padding-inline-end: calc(1.5 * var(--default-grid-baseline));\n}\n.nc-chip--no-icon .nc-chip__text[data-v-470fc02d] {\n padding-inline-start: calc(1.5 * var(--default-grid-baseline));\n}\n.nc-chip__text[data-v-470fc02d] {\n flex: 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n text-wrap: nowrap;\n}\n.nc-chip__icon[data-v-470fc02d] {\n flex: 0 0 var(--chip-size);\n margin-inline-end: var(--default-grid-baseline);\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n height: var(--chip-size);\n width: var(--chip-size);\n}\n.nc-chip__actions[data-v-470fc02d] {\n flex: 0 0 var(--chip-size);\n --default-clickable-area: var(--chip-size);\n --border-radius-element: var(--chip-radius);\n}","",{version:3,sources:["webpack://./node_modules/@nextcloud/vue/dist/assets/NcChip-CEKw1zaK.css"],names:[],mappings:"AAAA;;;EAGE;AACF;;;EAGE;AACF;;CAEC;AACD;EACE,aAAa;EACb,kBAAkB;EAClB,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;AACzB;AACA;EACE,iBAAiB;EACjB,yCAAyC;EACzC,wBAAwB;EACxB,sBAAsB;EACtB,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,iCAAiC;EACjC,+CAA+C;AACjD;AACA;EACE,8CAA8C;EAC9C,gCAAgC;AAClC;AACA;EACE,oDAAoD;EACpD,8CAA8C;AAChD;AACA;EACE,4DAA4D;AAC9D;AACA;EACE,8DAA8D;AAChE;AACA;EACE,YAAY;EACZ,gBAAgB;EAChB,uBAAuB;EACvB,iBAAiB;AACnB;AACA;EACE,0BAA0B;EAC1B,+CAA+C;EAC/C,cAAc;EACd,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,gBAAgB;EAChB,wBAAwB;EACxB,uBAAuB;AACzB;AACA;EACE,0BAA0B;EAC1B,0CAA0C;EAC1C,2CAA2C;AAC7C",sourcesContent:["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n/**\n * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n/*\n* Ensure proper alignment of the vue material icons\n*/\n.material-design-icon[data-v-470fc02d] {\n display: flex;\n align-self: center;\n justify-self: center;\n align-items: center;\n justify-content: center;\n}\n.nc-chip[data-v-470fc02d] {\n --chip-size: 24px;\n --chip-radius: calc(var(--chip-size) / 2);\n height: var(--chip-size);\n max-width: fit-content;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-radius: var(--chip-radius);\n background-color: var(--color-background-hover);\n}\n.nc-chip--primary[data-v-470fc02d] {\n background-color: var(--color-primary-element);\n color: var(--color-primary-text);\n}\n.nc-chip--secondary[data-v-470fc02d] {\n background-color: var(--color-primary-element-light);\n color: var(--color-primary-element-light-text);\n}\n.nc-chip--no-actions .nc-chip__text[data-v-470fc02d] {\n padding-inline-end: calc(1.5 * var(--default-grid-baseline));\n}\n.nc-chip--no-icon .nc-chip__text[data-v-470fc02d] {\n padding-inline-start: calc(1.5 * var(--default-grid-baseline));\n}\n.nc-chip__text[data-v-470fc02d] {\n flex: 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n text-wrap: nowrap;\n}\n.nc-chip__icon[data-v-470fc02d] {\n flex: 0 0 var(--chip-size);\n margin-inline-end: var(--default-grid-baseline);\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n height: var(--chip-size);\n width: var(--chip-size);\n}\n.nc-chip__actions[data-v-470fc02d] {\n flex: 0 0 var(--chip-size);\n --default-clickable-area: var(--chip-size);\n --border-radius-element: var(--chip-radius);\n}"],sourceRoot:""}]);const l=r},27718:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(71354),a=i.n(n),s=i(76314),r=i.n(s)()(a());r.push([t.id,".file-request-dialog{--margin: 18px}.file-request-dialog__header{margin:0 var(--margin)}.file-request-dialog__form{position:relative;overflow:auto;padding:var(--margin) var(--margin);margin-top:calc(-1*var(--margin))}.file-request-dialog fieldset{display:flex;flex-direction:column;width:100%;margin-top:var(--margin)}.file-request-dialog fieldset legend{display:flex;align-items:center;width:100%}.file-request-dialog__info{color:var(--color-text-maxcontrast);padding-block:4px;display:flex;align-items:center}.file-request-dialog__info .file-request-dialog__info-icon{margin-inline-end:8px}.file-request-dialog .dialog__actions{width:auto;margin-inline:12px}.file-request-dialog .dialog__actions span.dialog__actions-separator{margin-inline-start:auto}.file-request-dialog .input-field__helper-text-message{color:var(--color-text-maxcontrast)}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/NewFileRequestDialog.vue"],names:[],mappings:"AACA,qBACC,cAAA,CAEA,6BACC,sBAAA,CAGD,2BACC,iBAAA,CACA,aAAA,CACA,mCAAA,CAEA,iCAAA,CAGD,8BACC,YAAA,CACA,qBAAA,CACA,UAAA,CACA,wBAAA,CAEA,qCACC,YAAA,CACA,kBAAA,CACA,UAAA,CAMF,2BACC,mCAAA,CACA,iBAAA,CACA,YAAA,CACA,kBAAA,CACA,2DACC,qBAAA,CAIF,sCACC,UAAA,CACA,kBAAA,CACA,qEACC,wBAAA,CAIF,uDAEC,mCAAA",sourceRoot:""}]);const l=r},36225:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(71354),a=i.n(n),s=i(76314),r=i.n(s)()(a());r.push([t.id,".file-request-dialog__password-field[data-v-7ee0b01a]{display:flex;align-items:flex-start;gap:8px;margin-top:12px}.file-request-dialog__password-field>div[data-v-7ee0b01a]{margin:0}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue"],names:[],mappings:"AACA,sDACC,YAAA,CACA,sBAAA,CACA,OAAA,CAEA,eAAA,CACA,0DAEC,QAAA",sourceRoot:""}]);const l=r},39226:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(71354),a=i.n(n),s=i(76314),r=i.n(s)()(a());r.push([t.id,"\n.input-field[data-v-09e7c1ac],\n.file-request-dialog__emails[data-v-09e7c1ac] {\n\tmargin-top: var(--margin);\n}\n.file-request-dialog__emails[data-v-09e7c1ac] {\n\tdisplay: flex;\n\tgap: var(--default-grid-baseline);\n\tflex-wrap: wrap;\n}\n","",{version:3,sources:["webpack://./apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogFinish.vue"],names:[],mappings:";AAiOA;;CAEA,yBAAA;AACA;AAEA;CACA,aAAA;CACA,iCAAA;CACA,eAAA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n<template>\n\t<div>\n\t\t\x3c!-- Request note --\x3e\n\t\t<NcNoteCard type=\"success\">\n\t\t\t{{ t('files_sharing', 'You can now share the link below to allow people to upload files to your directory.') }}\n\t\t</NcNoteCard>\n\n\t\t\x3c!-- Copy share link --\x3e\n\t\t<NcInputField ref=\"clipboard\"\n\t\t\t:value=\"shareLink\"\n\t\t\t:label=\"t('files_sharing', 'Share link')\"\n\t\t\t:readonly=\"true\"\n\t\t\t:show-trailing-button=\"true\"\n\t\t\t:trailing-button-label=\"t('files_sharing', 'Copy to clipboard')\"\n\t\t\tdata-cy-file-request-dialog-fieldset=\"link\"\n\t\t\t@click=\"copyShareLink\"\n\t\t\t@trailing-button-click=\"copyShareLink\">\n\t\t\t<template #trailing-button-icon>\n\t\t\t\t<IconCheck v-if=\"isCopied\" :size=\"20\" />\n\t\t\t\t<IconClipboard v-else :size=\"20\" />\n\t\t\t</template>\n\t\t</NcInputField>\n\n\t\t<template v-if=\"isShareByMailEnabled\">\n\t\t\t\x3c!-- Email share--\x3e\n\t\t\t<NcTextField :value.sync=\"email\"\n\t\t\t\t:label=\"t('files_sharing', 'Send link via email')\"\n\t\t\t\t:placeholder=\"t('files_sharing', 'Enter an email address or paste a list')\"\n\t\t\t\tdata-cy-file-request-dialog-fieldset=\"email\"\n\t\t\t\ttype=\"email\"\n\t\t\t\t@keypress.enter.stop=\"addNewEmail\"\n\t\t\t\t@paste.stop.prevent=\"onPasteEmails\"\n\t\t\t\t@focusout.native=\"addNewEmail\" />\n\n\t\t\t\x3c!-- Email list --\x3e\n\t\t\t<div v-if=\"emails.length > 0\" class=\"file-request-dialog__emails\">\n\t\t\t\t<NcChip v-for=\"mail in emails\"\n\t\t\t\t\t:key=\"mail\"\n\t\t\t\t\t:aria-label-close=\"t('files_sharing', 'Remove email')\"\n\t\t\t\t\t:text=\"mail\"\n\t\t\t\t\t@close=\"$emit('remove-email', mail)\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<NcAvatar :disable-menu=\"true\"\n\t\t\t\t\t\t\t:disable-tooltip=\"true\"\n\t\t\t\t\t\t\t:display-name=\"mail\"\n\t\t\t\t\t\t\t:is-no-user=\"true\"\n\t\t\t\t\t\t\t:show-user-status=\"false\"\n\t\t\t\t\t\t\t:size=\"24\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcChip>\n\t\t\t</div>\n\t\t</template>\n\t</div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport Share from '../../models/Share.ts'\n\nimport { defineComponent } from 'vue'\nimport { generateUrl, getBaseUrl } from '@nextcloud/router'\nimport { showError, showSuccess } from '@nextcloud/dialogs'\nimport { n, t } from '@nextcloud/l10n'\n\nimport NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'\nimport NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'\nimport NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'\nimport NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'\nimport NcChip from '@nextcloud/vue/dist/Components/NcChip.js'\n\nimport IconCheck from 'vue-material-design-icons/Check.vue'\nimport IconClipboard from 'vue-material-design-icons/ClipboardText.vue'\n\nexport default defineComponent({\n\tname: 'NewFileRequestDialogFinish',\n\n\tcomponents: {\n\t\tIconCheck,\n\t\tIconClipboard,\n\t\tNcAvatar,\n\t\tNcInputField,\n\t\tNcNoteCard,\n\t\tNcTextField,\n\t\tNcChip,\n\t},\n\n\tprops: {\n\t\tshare: {\n\t\t\ttype: Object as PropType<Share>,\n\t\t\trequired: true,\n\t\t},\n\t\temails: {\n\t\t\ttype: Array as PropType<string[]>,\n\t\t\trequired: true,\n\t\t},\n\t\tisShareByMailEnabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\temits: ['add-email', 'remove-email'],\n\n\tsetup() {\n\t\treturn {\n\t\t\tn, t,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tisCopied: false,\n\t\t\temail: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tshareLink() {\n\t\t\treturn generateUrl('/s/{token}', { token: this.share.token }, { baseURL: getBaseUrl() })\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync copyShareLink(event: MouseEvent) {\n\t\t\tif (this.isCopied) {\n\t\t\t\tthis.isCopied = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!navigator.clipboard) {\n\t\t\t\t// Clipboard API not available\n\t\t\t\twindow.prompt(t('files_sharing', 'Automatically copying failed, please copy the share link manually'), this.shareLink)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tawait navigator.clipboard.writeText(this.shareLink)\n\n\t\t\tshowSuccess(t('files_sharing', 'Link copied to clipboard'))\n\t\t\tthis.isCopied = true\n\t\t\tevent.target?.select?.()\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.isCopied = false\n\t\t\t}, 3000)\n\t\t},\n\n\t\taddNewEmail(e: KeyboardEvent) {\n\t\t\tif (this.email.trim() === '') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (e.target instanceof HTMLInputElement) {\n\t\t\t\t// Reset the custom validity\n\t\t\t\te.target.setCustomValidity('')\n\n\t\t\t\t// Check if the field is valid\n\t\t\t\tif (e.target.checkValidity() === false) {\n\t\t\t\t\te.target.reportValidity()\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// The email is already in the list\n\t\t\t\tif (this.emails.includes(this.email.trim())) {\n\t\t\t\t\te.target.setCustomValidity(t('files_sharing', 'Email already added'))\n\t\t\t\t\te.target.reportValidity()\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Check if the email is valid\n\t\t\t\tif (!this.isValidEmail(this.email.trim())) {\n\t\t\t\t\te.target.setCustomValidity(t('files_sharing', 'Invalid email address'))\n\t\t\t\t\te.target.reportValidity()\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.$emit('add-email', this.email.trim())\n\t\t\t\tthis.email = ''\n\t\t\t}\n\t\t},\n\n\t\t// Handle dumping a list of emails\n\t\tonPasteEmails(e: ClipboardEvent) {\n\t\t\tconst clipboardData = e.clipboardData\n\t\t\tif (!clipboardData) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst pastedText = clipboardData.getData('text')\n\t\t\tconst emails = pastedText.split(/[\\s,;]+/).filter(Boolean).map((email) => email.trim())\n\n\t\t\tconst duplicateEmails = emails.filter((email) => this.emails.includes(email))\n\t\t\tconst validEmails = emails.filter((email) => this.isValidEmail(email) && !duplicateEmails.includes(email))\n\t\t\tconst invalidEmails = emails.filter((email) => !this.isValidEmail(email))\n\t\t\tvalidEmails.forEach((email) => this.$emit('add-email', email))\n\n\t\t\t// Warn about invalid emails\n\t\t\tif (invalidEmails.length > 0) {\n\t\t\t\tshowError(n('files_sharing', 'The following email address is not valid: {emails}', 'The following email addresses are not valid: {emails}', invalidEmails.length, { emails: invalidEmails.join(', ') }))\n\t\t\t}\n\n\t\t\t// Warn about duplicate emails\n\t\t\tif (duplicateEmails.length > 0) {\n\t\t\t\tshowError(n('files_sharing', '{count} email address already added', '{count} email addresses already added', duplicateEmails.length, { count: duplicateEmails.length }))\n\t\t\t}\n\n\t\t\tif (validEmails.length > 0) {\n\t\t\t\tshowSuccess(n('files_sharing', '{count} email address added', '{count} email addresses added', validEmails.length, { count: validEmails.length }))\n\t\t\t}\n\n\t\t\tthis.email = ''\n\t\t},\n\n\t\t// No need to have a fancy regex, just check for an @\n\t\tisValidEmail(email: string): boolean {\n\t\t\treturn email.includes('@')\n\t\t},\n\t},\n})\n<\/script>\n<style scoped>\n.input-field,\n.file-request-dialog__emails {\n\tmargin-top: var(--margin);\n}\n\n.file-request-dialog__emails {\n\tdisplay: flex;\n\tgap: var(--default-grid-baseline);\n\tflex-wrap: wrap;\n}\n</style>\n"],sourceRoot:""}]);const l=r},44197:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(71354),a=i.n(n),s=i(76314),r=i.n(s)()(a());r.push([t.id,"\n.file-request-dialog__note[data-v-0778d7a9] textarea {\n\twidth: 100% !important;\n\tmin-height: 80px;\n}\n","",{version:3,sources:["webpack://./apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogIntro.vue"],names:[],mappings:";AAiKA;CACA,sBAAA;CACA,gBAAA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n<template>\n\t<div>\n\t\t\x3c!-- Request label --\x3e\n\t\t<fieldset class=\"file-request-dialog__label\" data-cy-file-request-dialog-fieldset=\"label\">\n\t\t\t<legend>\n\t\t\t\t{{ t('files_sharing', 'What are you requesting?') }}\n\t\t\t</legend>\n\t\t\t<NcTextField :value=\"label\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:label=\"t('files_sharing', 'Request subject')\"\n\t\t\t\t:placeholder=\"t('files_sharing', 'Birthday party photos, History assignment…')\"\n\t\t\t\t:required=\"false\"\n\t\t\t\tname=\"label\"\n\t\t\t\t@update:value=\"$emit('update:label', $event)\" />\n\t\t</fieldset>\n\n\t\t\x3c!-- Request destination --\x3e\n\t\t<fieldset class=\"file-request-dialog__destination\" data-cy-file-request-dialog-fieldset=\"destination\">\n\t\t\t<legend>\n\t\t\t\t{{ t('files_sharing', 'Where should these files go?') }}\n\t\t\t</legend>\n\t\t\t<NcTextField :value=\"destination\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:label=\"t('files_sharing', 'Upload destination')\"\n\t\t\t\t:minlength=\"2/* cannot share root */\"\n\t\t\t\t:placeholder=\"t('files_sharing', 'Select a destination')\"\n\t\t\t\t:readonly=\"false /* cannot validate a readonly input */\"\n\t\t\t\t:required=\"true /* cannot be empty */\"\n\t\t\t\t:show-trailing-button=\"destination !== context.path\"\n\t\t\t\t:trailing-button-icon=\"'undo'\"\n\t\t\t\t:trailing-button-label=\"t('files_sharing', 'Revert to default')\"\n\t\t\t\tname=\"destination\"\n\t\t\t\t@click=\"onPickDestination\"\n\t\t\t\t@keypress.prevent.stop=\"/* prevent typing in the input, we use the picker */\"\n\t\t\t\t@paste.prevent.stop=\"/* prevent pasting in the input, we use the picker */\"\n\t\t\t\t@trailing-button-click=\"$emit('update:destination', '')\">\n\t\t\t\t<IconFolder :size=\"18\" />\n\t\t\t</NcTextField>\n\n\t\t\t<p class=\"file-request-dialog__info\">\n\t\t\t\t<IconLock :size=\"18\" class=\"file-request-dialog__info-icon\" />\n\t\t\t\t{{ t('files_sharing', 'The uploaded files are visible only to you unless you choose to share them.') }}\n\t\t\t</p>\n\t\t</fieldset>\n\n\t\t\x3c!-- Request note --\x3e\n\t\t<fieldset class=\"file-request-dialog__note\" data-cy-file-request-dialog-fieldset=\"note\">\n\t\t\t<legend>\n\t\t\t\t{{ t('files_sharing', 'Add a note') }}\n\t\t\t</legend>\n\t\t\t<NcTextArea :value=\"note\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:label=\"t('files_sharing', 'Note for recipient')\"\n\t\t\t\t:placeholder=\"t('files_sharing', 'Add a note to help people understand what you are requesting.')\"\n\t\t\t\t:required=\"false\"\n\t\t\t\tname=\"note\"\n\t\t\t\t@update:value=\"$emit('update:note', $event)\" />\n\n\t\t\t<p class=\"file-request-dialog__info\">\n\t\t\t\t<IconInfo :size=\"18\" class=\"file-request-dialog__info-icon\" />\n\t\t\t\t{{ t('files_sharing', 'You can add links, date or any other information that will help the recipient understand what you are requesting.') }}\n\t\t\t</p>\n\t\t</fieldset>\n\t</div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { Folder, Node } from '@nextcloud/files'\n\nimport { defineComponent } from 'vue'\nimport { getFilePickerBuilder } from '@nextcloud/dialogs'\nimport { t } from '@nextcloud/l10n'\n\nimport IconFolder from 'vue-material-design-icons/Folder.vue'\nimport IconInfo from 'vue-material-design-icons/Information.vue'\nimport IconLock from 'vue-material-design-icons/Lock.vue'\nimport NcTextArea from '@nextcloud/vue/dist/Components/NcTextArea.js'\nimport NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'\n\nexport default defineComponent({\n\tname: 'NewFileRequestDialogIntro',\n\n\tcomponents: {\n\t\tIconFolder,\n\t\tIconInfo,\n\t\tIconLock,\n\t\tNcTextArea,\n\t\tNcTextField,\n\t},\n\n\tprops: {\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: false,\n\t\t},\n\t\tcontext: {\n\t\t\ttype: Object as PropType<Folder>,\n\t\t\trequired: true,\n\t\t},\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tdestination: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tnote: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:destination',\n\t\t'update:label',\n\t\t'update:note',\n\t],\n\n\tsetup() {\n\t\treturn {\n\t\t\tt,\n\t\t}\n\t},\n\n\tmethods: {\n\t\tonPickDestination() {\n\t\t\tconst filepicker = getFilePickerBuilder(t('files_sharing', 'Select a destination'))\n\t\t\t\t.addMimeTypeFilter('httpd/unix-directory')\n\t\t\t\t.allowDirectories(true)\n\t\t\t\t.addButton({\n\t\t\t\t\tlabel: t('files_sharing', 'Select'),\n\t\t\t\t\tcallback: this.onPickedDestination,\n\t\t\t\t})\n\t\t\t\t.setFilter(node => node.path !== '/')\n\t\t\t\t.startAt(this.destination)\n\t\t\t\t.build()\n\t\t\ttry {\n\t\t\t\tfilepicker.pick()\n\t\t\t} catch (e) {\n\t\t\t\t// ignore cancel\n\t\t\t}\n\t\t},\n\n\t\tonPickedDestination(nodes: Node[]) {\n\t\t\tconst node = nodes[0]\n\t\t\tif (node) {\n\t\t\t\tthis.$emit('update:destination', node.path)\n\t\t\t}\n\t\t},\n\t},\n})\n<\/script>\n<style scoped>\n.file-request-dialog__note :deep(textarea) {\n\twidth: 100% !important;\n\tmin-height: 80px;\n}\n</style>\n"],sourceRoot:""}]);const l=r},85019:(t,e,i)=>{i.r(e),i.d(e,{default:()=>St});var n=i(85471),a=i(61338),s=i(63814),r=i(35810),l=i(77905),o=i(85168),d=i(53334),c=i(65043),u=i(18740),p=i(94219),h=i(84237),f=i(80910),m=i(85338),g=i(9191),A=i(7145),_=i(32073),v=i(31126),y=i(16044);const C={name:"InformationIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var w=i(14486);const b=(0,w.A)(C,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon information-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,x={name:"AutoFixIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},E=(0,w.A)(x,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon auto-fix-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.5,5.6L5,7L6.4,4.5L5,2L7.5,3.4L10,2L8.6,4.5L10,7L7.5,5.6M19.5,15.4L22,14L20.6,16.5L22,19L19.5,17.6L17,19L18.4,16.5L17,14L19.5,15.4M22,2L20.6,4.5L22,7L19.5,5.6L17,7L18.4,4.5L17,2L19.5,3.4L22,2M13.34,12.78L15.78,10.34L13.66,8.22L11.22,10.66L13.34,12.78M14.37,7.29L16.71,9.63C17.1,10 17.1,10.65 16.71,11.04L5.04,22.71C4.65,23.1 4,23.1 3.63,22.71L1.29,20.37C0.9,20 0.9,19.35 1.29,18.96L12.96,7.29C13.35,6.9 14,6.9 14.37,7.29Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,S=new A.A,k=new A.A,N=(0,n.pM)({name:"NewFileRequestDialogDatePassword",components:{IconInfo:b,IconPasswordGen:E,NcButton:u.A,NcCheckboxRadioSwitch:_.A,NcDateTimePickerNative:v.A,NcNoteCard:f.A,NcPasswordField:y.A},props:{disabled:{type:Boolean,required:!1,default:!1},expirationDate:{type:Date,required:!1,default:null},password:{type:String,required:!1,default:null}},emits:["update:expirationDate","update:password"],setup:()=>({t:d.t,defaultExpireDate:k.defaultExpireDate,defaultExpireDateEnabled:k.isDefaultExpireDateEnabled,defaultExpireDateEnforced:k.isDefaultExpireDateEnforced,enableLinkPasswordByDefault:k.enableLinkPasswordByDefault,enforcePasswordForPublicLink:k.enforcePasswordForPublicLink}),data:()=>({maxDate:null,minDate:new Date((new Date).setDate((new Date).getDate()+1))}),computed:{passwordAndExpirationSummary(){return this.expirationDate&&this.password?(0,d.t)("files_sharing","The request will expire on {date} at midnight and will be password protected.",{date:this.expirationDate.toLocaleDateString()}):this.expirationDate?(0,d.t)("files_sharing","The request will expire on {date} at midnight.",{date:this.expirationDate.toLocaleDateString()}):this.password?(0,d.t)("files_sharing","The request will be password protected."):""}},mounted(){this.defaultExpireDate&&this.$emit("update:expirationDate",k.defaultExpirationDate),this.defaultExpireDateEnforced&&(this.maxDate=k.defaultExpirationDate),this.enableLinkPasswordByDefault&&this.generatePassword()},methods:{onToggleDeadline(t){this.$emit("update:expirationDate",t?this.maxDate||this.minDate:null)},async onTogglePassword(t){t?this.generatePassword():this.$emit("update:password",null)},async onGeneratePassword(){await this.generatePassword(),this.showPassword()},async generatePassword(){await async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(S.passwordPolicy.api&&S.passwordPolicy.api.generate)try{const e=await c.Ay.get(S.passwordPolicy.api.generate);if(e.data.ocs.data.password)return t&&(0,o.Te)((0,d.Tl)("files_sharing","Password created successfully")),e.data.ocs.data.password}catch(e){console.info("Error generating password from password_policy",e),t&&(0,o.Qg)((0,d.Tl)("files_sharing","Error generating password from password policy"))}const e=new Uint8Array(10),i=52/255;self.crypto.getRandomValues(e);let n="";for(let t=0;t<e.length;t++)n+="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789".charAt(e[t]*i);return n}().then((t=>{this.$emit("update:password",t)}))},showPassword(){this.$refs.passwordField.isPasswordHidden=!1}}});var D=i(85072),q=i.n(D),P=i(97825),T=i.n(P),B=i(77659),L=i.n(B),I=i(55056),F=i.n(I),R=i(10540),z=i.n(R),M=i(41113),V=i.n(M),$=i(36225),O={};O.styleTagTransform=V(),O.setAttributes=F(),O.insert=L().bind(null,"head"),O.domAPI=T(),O.insertStyleElement=z(),q()($.A,O),$.A&&$.A.locals&&$.A.locals;const H=(0,w.A)(N,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[t.passwordAndExpirationSummary?e("NcNoteCard",{attrs:{type:"success"}},[t._v("\n\t\t"+t._s(t.passwordAndExpirationSummary)+"\n\t")]):t._e(),t._v(" "),e("fieldset",{staticClass:"file-request-dialog__expiration",attrs:{"data-cy-file-request-dialog-fieldset":"expiration"}},[e("legend",[t._v(t._s(t.t("files_sharing","When should the request expire?")))]),t._v(" "),e("NcCheckboxRadioSwitch",{directives:[{name:"show",rawName:"v-show",value:!t.defaultExpireDateEnforced,expression:"!defaultExpireDateEnforced"}],attrs:{checked:t.defaultExpireDateEnforced||null!==t.expirationDate,disabled:t.disabled||t.defaultExpireDateEnforced},on:{"update:checked":t.onToggleDeadline}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Set a submission expiration date"))+"\n\t\t")]),t._v(" "),null!==t.expirationDate?e("NcDateTimePickerNative",{attrs:{id:"file-request-dialog-expirationDate",disabled:t.disabled,"hide-label":!0,label:t.t("files_sharing","Expiration date"),max:t.maxDate,min:t.minDate,placeholder:t.t("files_sharing","Select a date"),required:t.defaultExpireDateEnforced,value:t.expirationDate,name:"expirationDate",type:"date"},on:{input:function(e){return t.$emit("update:expirationDate",e)}}}):t._e(),t._v(" "),t.defaultExpireDateEnforced?e("p",{staticClass:"file-request-dialog__info"},[e("IconInfo",{staticClass:"file-request-dialog__info-icon",attrs:{size:18}}),t._v("\n\t\t\t"+t._s(t.t("files_sharing","Your administrator has enforced a {count} days expiration policy.",{count:t.defaultExpireDate}))+"\n\t\t")],1):t._e()],1),t._v(" "),e("fieldset",{staticClass:"file-request-dialog__password",attrs:{"data-cy-file-request-dialog-fieldset":"password"}},[e("legend",[t._v(t._s(t.t("files_sharing","What password should be used for the request?")))]),t._v(" "),e("NcCheckboxRadioSwitch",{directives:[{name:"show",rawName:"v-show",value:!t.enforcePasswordForPublicLink,expression:"!enforcePasswordForPublicLink"}],attrs:{checked:t.enforcePasswordForPublicLink||null!==t.password,disabled:t.disabled||t.enforcePasswordForPublicLink},on:{"update:checked":t.onTogglePassword}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Set a password"))+"\n\t\t")]),t._v(" "),null!==t.password?e("div",{staticClass:"file-request-dialog__password-field"},[e("NcPasswordField",{ref:"passwordField",attrs:{"check-password-strength":!0,disabled:t.disabled,label:t.t("files_sharing","Password"),placeholder:t.t("files_sharing","Enter a valid password"),required:!1,value:t.password,name:"password"},on:{"update:value":function(e){return t.$emit("update:password",e)}}}),t._v(" "),e("NcButton",{attrs:{"aria-label":t.t("files_sharing","Generate a new password"),title:t.t("files_sharing","Generate a new password"),type:"tertiary-no-background"},on:{click:t.onGeneratePassword},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconPasswordGen",{attrs:{size:20}})]},proxy:!0}],null,!1,1334968784)})],1):t._e(),t._v(" "),t.enforcePasswordForPublicLink?e("p",{staticClass:"file-request-dialog__info"},[e("IconInfo",{staticClass:"file-request-dialog__info-icon",attrs:{size:18}}),t._v("\n\t\t\t"+t._s(t.t("files_sharing","Your administrator has enforced a password protection."))+"\n\t\t")],1):t._e()],1)],1)}),[],!1,null,"7ee0b01a",null).exports;var j=i(18709);class G{constructor(t){if(e=this,n=void 0,(i=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(i="_share"))in e?Object.defineProperty(e,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[i]=n,t.ocs&&t.ocs.data&&t.ocs.data[0]&&(t=t.ocs.data[0]),t.hide_download=!!t.hide_download,t.mail_send=!!t.mail_send,t.attributes&&"string"==typeof t.attributes)try{t.attributes=JSON.parse(t.attributes)}catch(e){console.warn("Could not parse share attributes returned by server",t.attributes)}var e,i,n;t.attributes=t.attributes??[],this._share=t}get state(){return this._share}get id(){return this._share.id}get type(){return this._share.share_type}get permissions(){return this._share.permissions}get attributes(){return this._share.attributes}set permissions(t){this._share.permissions=t}get owner(){return this._share.uid_owner}get ownerDisplayName(){return this._share.displayname_owner}get shareWith(){return this._share.share_with}get shareWithDisplayName(){return this._share.share_with_displayname||this._share.share_with}get shareWithDisplayNameUnique(){return this._share.share_with_displayname_unique||this._share.share_with}get shareWithLink(){return this._share.share_with_link}get shareWithAvatar(){return this._share.share_with_avatar}get uidFileOwner(){return this._share.uid_file_owner}get displaynameFileOwner(){return this._share.displayname_file_owner||this._share.uid_file_owner}get createdTime(){return this._share.stime}get expireDate(){return this._share.expiration}set expireDate(t){this._share.expiration=t}get token(){return this._share.token}get note(){return this._share.note}set note(t){this._share.note=t}get label(){return this._share.label??""}set label(t){this._share.label=t}get mailSend(){return!0===this._share.mail_send}get hideDownload(){return!0===this._share.hide_download}set hideDownload(t){this._share.hide_download=!0===t}get password(){return this._share.password}set password(t){this._share.password=t}get passwordExpirationTime(){return this._share.password_expiration_time}set passwordExpirationTime(t){this._share.password_expiration_time=t}get sendPasswordByTalk(){return this._share.send_password_by_talk}set sendPasswordByTalk(t){this._share.send_password_by_talk=t}get path(){return this._share.path}get itemType(){return this._share.item_type}get mimetype(){return this._share.mimetype}get fileSource(){return this._share.file_source}get fileTarget(){return this._share.file_target}get fileParent(){return this._share.file_parent}get hasReadPermission(){return!!(this.permissions&window.OC.PERMISSION_READ)}get hasCreatePermission(){return!!(this.permissions&window.OC.PERMISSION_CREATE)}get hasDeletePermission(){return!!(this.permissions&window.OC.PERMISSION_DELETE)}get hasUpdatePermission(){return!!(this.permissions&window.OC.PERMISSION_UPDATE)}get hasSharePermission(){return!!(this.permissions&window.OC.PERMISSION_SHARE)}get hasDownloadPermission(){return this.attributes.some((t=>"permissions"===t.scope&&"download"===t.key&&!1===t.value))}get isFileRequest(){return(0,j.C)(JSON.stringify(this.attributes))}set hasDownloadPermission(t){this.setAttribute("permissions","download",!!t)}setAttribute(t,e,i){const n={scope:t,key:e,value:i};for(const t in this._share.attributes){const e=this._share.attributes[t];if(e.scope===n.scope&&e.key===n.key)return void this._share.attributes.splice(t,1,n)}this._share.attributes.push(n)}get canEdit(){return!0===this._share.can_edit}get canDelete(){return!0===this._share.can_delete}get viaFileid(){return this._share.via_fileid}get viaPath(){return this._share.via_path}get parent(){return this._share.parent}get storageId(){return this._share.storage_id}get storage(){return this._share.storage}get itemSource(){return this._share.item_source}get status(){return this._share.status}}var W=i(41944),U=i(63407),X=i(82182),Y=i(31989),K={};K.styleTagTransform=V(),K.setAttributes=F(),K.insert=L().bind(null,"head"),K.domAPI=T(),K.insertStyleElement=z(),q()(Y.A,K),Y.A&&Y.A.locals&&Y.A.locals;var Q=i(53981),Z=i(24997),J=i(89257),tt=i(96338),et=i(51431);(0,Q.r)(Q.u);const it={__name:"NcChip",props:{ariaLabelClose:{type:String,default:(0,Q.a)("Close")},text:{type:String,default:""},type:{type:String,default:"secondary",validator:t=>["primary","secondary","tertiary"].includes(t)},iconPath:{type:String,default:null},iconSvg:{type:String,default:null},noClose:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const i=t,a=(0,n.Ht)(),s=(0,n.EW)((()=>!i.noClose));return{__sfc:!0,props:i,emit:e,slots:a,canClose:s,hasActions:()=>{var t;return Boolean(null==(t=a.actions)?void 0:t.call(a))},hasIcon:()=>{var t;return Boolean(i.iconPath||i.iconSvg||!!(null==(t=a.icon)?void 0:t.call(a)))},onClose:()=>{e("close")},mdiClose:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",NcActions:Z.N,NcActionButton:J.A,NcIconSvgWrapper:tt.N}}};var nt=function(){var t=this,e=t._self._c,i=t._self._setupProxy;return e("div",{staticClass:"nc-chip",class:{["nc-chip--".concat(t.type)]:!0,"nc-chip--no-actions":t.noClose&&!i.hasActions(),"nc-chip--no-icon":!i.hasIcon()}},[i.hasIcon()?e("span",{staticClass:"nc-chip__icon"},[t._t("icon",(function(){return[t.iconPath||t.iconSvg?e(i.NcIconSvgWrapper,{attrs:{inline:"",path:t.iconPath,svg:t.iconPath?void 0:t.iconSvg,size:18}}):t._e()]}))],2):t._e(),e("span",{staticClass:"nc-chip__text"},[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2),i.canClose||i.hasActions()?e(i.NcActions,{staticClass:"nc-chip__actions",attrs:{"force-menu":!i.canClose,type:"tertiary-no-background"}},[i.canClose?e(i.NcActionButton,{attrs:{"close-after-click":""},on:{click:i.onClose},scopedSlots:t._u([{key:"icon",fn:function(){return[e(i.NcIconSvgWrapper,{attrs:{path:i.mdiClose,size:20}})]},proxy:!0}],null,!1,2547223506)},[t._v(" "+t._s(t.ariaLabelClose)+" ")]):t._e(),t._t("actions")],2):t._e()],1)},at=[];const st=(0,et.n)(it,nt,at,!1,null,"470fc02d").exports,rt={name:"ClipboardTextIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},lt=(0,w.A)(rt,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon clipboard-text-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M17,9H7V7H17M17,13H7V11H17M14,17H7V15H14M12,3A1,1 0 0,1 13,4A1,1 0 0,1 12,5A1,1 0 0,1 11,4A1,1 0 0,1 12,3M19,3H14.82C14.4,1.84 13.3,1 12,1C10.7,1 9.6,1.84 9.18,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,ot=(0,n.pM)({name:"NewFileRequestDialogFinish",components:{IconCheck:m.A,IconClipboard:lt,NcAvatar:W.A,NcInputField:U.A,NcNoteCard:f.A,NcTextField:X.A,NcChip:st},props:{share:{type:Object,required:!0},emails:{type:Array,required:!0},isShareByMailEnabled:{type:Boolean,required:!0}},emits:["add-email","remove-email"],setup:()=>({n:d.n,t:d.t}),data:()=>({isCopied:!1,email:""}),computed:{shareLink(){return(0,s.Jv)("/s/{token}",{token:this.share.token},{baseURL:(0,s.$_)()})}},methods:{async copyShareLink(t){this.isCopied?this.isCopied=!1:navigator.clipboard?(await navigator.clipboard.writeText(this.shareLink),(0,o.Te)((0,d.t)("files_sharing","Link copied to clipboard")),this.isCopied=!0,t.target?.select?.(),setTimeout((()=>{this.isCopied=!1}),3e3)):window.prompt((0,d.t)("files_sharing","Automatically copying failed, please copy the share link manually"),this.shareLink)},addNewEmail(t){if(""!==this.email.trim()&&t.target instanceof HTMLInputElement){if(t.target.setCustomValidity(""),!1===t.target.checkValidity())return void t.target.reportValidity();if(this.emails.includes(this.email.trim()))return t.target.setCustomValidity((0,d.t)("files_sharing","Email already added")),void t.target.reportValidity();if(!this.isValidEmail(this.email.trim()))return t.target.setCustomValidity((0,d.t)("files_sharing","Invalid email address")),void t.target.reportValidity();this.$emit("add-email",this.email.trim()),this.email=""}},onPasteEmails(t){const e=t.clipboardData;if(!e)return;const i=e.getData("text").split(/[\s,;]+/).filter(Boolean).map((t=>t.trim())),n=i.filter((t=>this.emails.includes(t))),a=i.filter((t=>this.isValidEmail(t)&&!n.includes(t))),s=i.filter((t=>!this.isValidEmail(t)));a.forEach((t=>this.$emit("add-email",t))),s.length>0&&(0,o.Qg)((0,d.n)("files_sharing","The following email address is not valid: {emails}","The following email addresses are not valid: {emails}",s.length,{emails:s.join(", ")})),n.length>0&&(0,o.Qg)((0,d.n)("files_sharing","{count} email address already added","{count} email addresses already added",n.length,{count:n.length})),a.length>0&&(0,o.Te)((0,d.n)("files_sharing","{count} email address added","{count} email addresses added",a.length,{count:a.length})),this.email=""},isValidEmail:t=>t.includes("@")}});var dt=i(39226),ct={};ct.styleTagTransform=V(),ct.setAttributes=F(),ct.insert=L().bind(null,"head"),ct.domAPI=T(),ct.insertStyleElement=z(),q()(dt.A,ct),dt.A&&dt.A.locals&&dt.A.locals;const ut=(0,w.A)(ot,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[e("NcNoteCard",{attrs:{type:"success"}},[t._v("\n\t\t"+t._s(t.t("files_sharing","You can now share the link below to allow people to upload files to your directory."))+"\n\t")]),t._v(" "),e("NcInputField",{ref:"clipboard",attrs:{value:t.shareLink,label:t.t("files_sharing","Share link"),readonly:!0,"show-trailing-button":!0,"trailing-button-label":t.t("files_sharing","Copy to clipboard"),"data-cy-file-request-dialog-fieldset":"link"},on:{click:t.copyShareLink,"trailing-button-click":t.copyShareLink},scopedSlots:t._u([{key:"trailing-button-icon",fn:function(){return[t.isCopied?e("IconCheck",{attrs:{size:20}}):e("IconClipboard",{attrs:{size:20}})]},proxy:!0}])}),t._v(" "),t.isShareByMailEnabled?[e("NcTextField",{attrs:{value:t.email,label:t.t("files_sharing","Send link via email"),placeholder:t.t("files_sharing","Enter an email address or paste a list"),"data-cy-file-request-dialog-fieldset":"email",type:"email"},on:{"update:value":function(e){t.email=e},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),t.addNewEmail.apply(null,arguments))},paste:function(e){return e.stopPropagation(),e.preventDefault(),t.onPasteEmails.apply(null,arguments)}},nativeOn:{focusout:function(e){return t.addNewEmail.apply(null,arguments)}}}),t._v(" "),t.emails.length>0?e("div",{staticClass:"file-request-dialog__emails"},t._l(t.emails,(function(i){return e("NcChip",{key:i,attrs:{"aria-label-close":t.t("files_sharing","Remove email"),text:i},on:{close:function(e){return t.$emit("remove-email",i)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("NcAvatar",{attrs:{"disable-menu":!0,"disable-tooltip":!0,"display-name":i,"is-no-user":!0,"show-user-status":!1,size:24}})]},proxy:!0}],null,!0)})})),1):t._e()]:t._e()],2)}),[],!1,null,"09e7c1ac",null).exports;var pt=i(11358);const ht={name:"LockIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ft=(0,w.A)(ht,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon lock-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports;var mt=i(42740);const gt=(0,n.pM)({name:"NewFileRequestDialogIntro",components:{IconFolder:pt.A,IconInfo:b,IconLock:ft,NcTextArea:mt.A,NcTextField:X.A},props:{disabled:{type:Boolean,required:!1,default:!1},context:{type:Object,required:!0},label:{type:String,required:!0},destination:{type:String,required:!0},note:{type:String,required:!0}},emits:["update:destination","update:label","update:note"],setup:()=>({t:d.t}),methods:{onPickDestination(){const t=(0,o.a1)((0,d.t)("files_sharing","Select a destination")).addMimeTypeFilter("httpd/unix-directory").allowDirectories(!0).addButton({label:(0,d.t)("files_sharing","Select"),callback:this.onPickedDestination}).setFilter((t=>"/"!==t.path)).startAt(this.destination).build();try{t.pick()}catch(t){}},onPickedDestination(t){const e=t[0];e&&this.$emit("update:destination",e.path)}}});var At=i(44197),_t={};_t.styleTagTransform=V(),_t.setAttributes=F(),_t.insert=L().bind(null,"head"),_t.domAPI=T(),_t.insertStyleElement=z(),q()(At.A,_t),At.A&&At.A.locals&&At.A.locals;const vt=(0,w.A)(gt,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[e("fieldset",{staticClass:"file-request-dialog__label",attrs:{"data-cy-file-request-dialog-fieldset":"label"}},[e("legend",[t._v("\n\t\t\t"+t._s(t.t("files_sharing","What are you requesting?"))+"\n\t\t")]),t._v(" "),e("NcTextField",{attrs:{value:t.label,disabled:t.disabled,label:t.t("files_sharing","Request subject"),placeholder:t.t("files_sharing","Birthday party photos, History assignment…"),required:!1,name:"label"},on:{"update:value":function(e){return t.$emit("update:label",e)}}})],1),t._v(" "),e("fieldset",{staticClass:"file-request-dialog__destination",attrs:{"data-cy-file-request-dialog-fieldset":"destination"}},[e("legend",[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Where should these files go?"))+"\n\t\t")]),t._v(" "),e("NcTextField",{attrs:{value:t.destination,disabled:t.disabled,label:t.t("files_sharing","Upload destination"),minlength:2,placeholder:t.t("files_sharing","Select a destination"),readonly:!1,required:!0,"show-trailing-button":t.destination!==t.context.path,"trailing-button-icon":"undo","trailing-button-label":t.t("files_sharing","Revert to default"),name:"destination"},on:{click:t.onPickDestination,keypress:function(t){t.preventDefault(),t.stopPropagation()},paste:function(t){t.preventDefault(),t.stopPropagation()},"trailing-button-click":function(e){return t.$emit("update:destination","")}}},[e("IconFolder",{attrs:{size:18}})],1),t._v(" "),e("p",{staticClass:"file-request-dialog__info"},[e("IconLock",{staticClass:"file-request-dialog__info-icon",attrs:{size:18}}),t._v("\n\t\t\t"+t._s(t.t("files_sharing","The uploaded files are visible only to you unless you choose to share them."))+"\n\t\t")],1)],1),t._v(" "),e("fieldset",{staticClass:"file-request-dialog__note",attrs:{"data-cy-file-request-dialog-fieldset":"note"}},[e("legend",[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Add a note"))+"\n\t\t")]),t._v(" "),e("NcTextArea",{attrs:{value:t.note,disabled:t.disabled,label:t.t("files_sharing","Note for recipient"),placeholder:t.t("files_sharing","Add a note to help people understand what you are requesting."),required:!1,name:"note"},on:{"update:value":function(e){return t.$emit("update:note",e)}}}),t._v(" "),e("p",{staticClass:"file-request-dialog__info"},[e("IconInfo",{staticClass:"file-request-dialog__info-icon",attrs:{size:18}}),t._v("\n\t\t\t"+t._s(t.t("files_sharing","You can add links, date or any other information that will help the recipient understand what you are requesting."))+"\n\t\t")],1)],1)])}),[],!1,null,"0778d7a9",null).exports;var yt,Ct=i(62746);!function(t){t[t.FIRST=0]="FIRST",t[t.SECOND=1]="SECOND",t[t.LAST=2]="LAST"}(yt||(yt={}));const wt=new A.A,bt=(0,n.pM)({name:"NewFileRequestDialog",components:{FileRequestDatePassword:H,FileRequestFinish:ut,FileRequestIntro:vt,IconCheck:m.A,IconNext:g.A,NcButton:u.A,NcDialog:p.A,NcLoadingIcon:h.A,NcNoteCard:f.A},props:{context:{type:Object,required:!0},content:{type:Array,required:!0}},setup:()=>({STEP:yt,n:d.n,t:d.t,isShareByMailEnabled:wt.isMailShareAllowed}),data(){return{currentStep:yt.FIRST,loading:!1,destination:this.context.path||"/",label:"",note:"",expirationDate:null,password:null,share:null,emails:[]}},computed:{finishButtonLabel(){return 0===this.emails.length?(0,d.t)("files_sharing","Close"):(0,d.n)("files_sharing","Send email and close","Send {count} emails and close",this.emails.length,{count:this.emails.length})}},methods:{onPageNext(){const t=this.$refs.form;if(t.checkValidity()){if("/"===this.destination||""===this.destination){const e=t.querySelector('input[name="destination"]');return e?.setCustomValidity((0,d.t)("files_sharing","Please select a folder, you cannot share the root directory.")),void t.reportValidity()}this.currentStep!==yt.FIRST?this.createShare():this.currentStep=yt.SECOND}else t.reportValidity()},onRemoveEmail(t){const e=this.emails.indexOf(t);this.emails.splice(e,1)},onCancel(){this.$emit("close")},async onFinish(){if(0===this.emails.length||!1===this.isShareByMailEnabled)return(0,o.Te)((0,d.t)("files_sharing","File request created")),void this.$emit("close");wt.isMailShareAllowed&&this.emails.length>0?(await this.setShareEmails(),await this.sendEmails(),(0,o.Te)((0,d.n)("files_sharing","File request created and email sent","File request created and {count} emails sent",this.emails.length,{count:this.emails.length}))):(0,o.Te)((0,d.t)("files_sharing","File request created")),this.$emit("close")},async createShare(){this.loading=!0;let t="";this.expirationDate&&(t=`${this.expirationDate.getFullYear()}-${(this.expirationDate.getMonth()+1).toString().padStart(2,"0")}-${this.expirationDate.getDate().toString().padStart(2,"0")}`);const e=(0,s.KT)("apps/files_sharing/api/v1/shares");try{const i=await c.Ay.post(e,{shareType:wt.isMailShareAllowed?l.I.Email:l.I.Link,permissions:r.aX.CREATE,label:this.label,path:this.destination,note:this.note,password:this.password||void 0,expireDate:t||void 0,shareWith:"",attributes:JSON.stringify([{value:!0,key:"enabled",scope:"fileRequest"}])});if(!i?.data?.ocs)throw i;const n=new G(i.data.ocs.data);this.share=n,Ct.A.info("New file request created",{share:n}),(0,a.Ic)("files_sharing:share:created",{share:n}),this.currentStep=yt.LAST}catch(t){const e=t?.response?.data?.ocs?.meta?.message;throw(0,o.Qg)(e?(0,d.t)("files_sharing","Error creating the share: {errorMessage}",{errorMessage:e}):(0,d.t)("files_sharing","Error creating the share")),Ct.A.error("Error while creating share",{error:t,errorMessage:e}),t}finally{this.loading=!1}},async setShareEmails(){if(this.loading=!0,!this.share||!this.share?.id)throw new Error("Share ID is missing");const t=(0,s.KT)("apps/files_sharing/api/v1/shares/{id}",{id:this.share.id});try{const e=await c.Ay.put(t,{attributes:JSON.stringify([{value:this.emails,key:"emails",scope:"shareWith"},{value:!0,key:"enabled",scope:"fileRequest"}])});if(!e?.data?.ocs)throw e}catch(t){throw this.onEmailSendError(t),t}finally{this.loading=!1}},async sendEmails(){if(this.loading=!0,!this.share||!this.share?.id)throw new Error("Share ID is missing");const t=(0,s.KT)("apps/files_sharing/api/v1/shares/{id}/send-email",{id:this.share.id});try{const e=await c.Ay.post(t,{password:this.password||void 0});if(!e?.data?.ocs)throw e}catch(t){throw this.onEmailSendError(t),t}finally{this.loading=!1}},onEmailSendError(t){const e=t.response?.data?.ocs?.meta?.message;(0,o.Qg)(e?(0,d.t)("files_sharing","Error sending emails: {errorMessage}",{errorMessage:e}):(0,d.t)("files_sharing","Error sending emails")),Ct.A.error("Error while sending emails",{error:t,errorMessage:e})}}});var xt=i(27718),Et={};Et.styleTagTransform=V(),Et.setAttributes=F(),Et.insert=L().bind(null,"head"),Et.domAPI=T(),Et.insertStyleElement=z(),q()(xt.A,Et),xt.A&&xt.A.locals&&xt.A.locals;const St=(0,w.A)(bt,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcDialog",{staticClass:"file-request-dialog",attrs:{"can-close":"","data-cy-file-request-dialog":"","close-on-click-outside":!1,name:t.currentStep!==t.STEP.LAST?t.t("files_sharing","Create a file request"):t.t("files_sharing","File request created"),size:"normal"},on:{closing:t.onCancel},scopedSlots:t._u([{key:"actions",fn:function(){return[e("NcButton",{directives:[{name:"show",rawName:"v-show",value:t.currentStep===t.STEP.SECOND,expression:"currentStep === STEP.SECOND"}],attrs:{"aria-label":t.t("files_sharing","Previous step"),disabled:t.loading,"data-cy-file-request-dialog-controls":"back",type:"tertiary"},on:{click:function(e){t.currentStep=t.STEP.FIRST}}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Previous step"))+"\n\t\t")]),t._v(" "),e("span",{staticClass:"dialog__actions-separator"}),t._v(" "),t.currentStep!==t.STEP.LAST?e("NcButton",{attrs:{"aria-label":t.t("files_sharing","Cancel"),disabled:t.loading,title:t.t("files_sharing","Cancel the file request creation"),"data-cy-file-request-dialog-controls":"cancel",type:"tertiary"},on:{click:t.onCancel}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Cancel"))+"\n\t\t")]):0!==t.emails.length?e("NcButton",{attrs:{"aria-label":t.t("files_sharing","Close without sending emails"),disabled:t.loading,title:t.t("files_sharing","Close without sending emails"),"data-cy-file-request-dialog-controls":"cancel",type:"tertiary"},on:{click:t.onCancel}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Close"))+"\n\t\t")]):t._e(),t._v(" "),t.currentStep!==t.STEP.LAST?e("NcButton",{attrs:{"aria-label":t.t("files_sharing","Continue"),disabled:t.loading,"data-cy-file-request-dialog-controls":"next"},on:{click:t.onPageNext},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon"):e("IconNext",{attrs:{size:20}})]},proxy:!0}],null,!1,3563923451)},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Continue"))+"\n\t\t")]):e("NcButton",{attrs:{"aria-label":t.finishButtonLabel,disabled:t.loading,"data-cy-file-request-dialog-controls":"finish",type:"primary"},on:{click:t.onFinish},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon"):e("IconCheck",{attrs:{size:20}})]},proxy:!0}])},[t._v("\n\t\t\t"+t._s(t.finishButtonLabel)+"\n\t\t")])]},proxy:!0}])},[e("NcNoteCard",{directives:[{name:"show",rawName:"v-show",value:t.currentStep===t.STEP.FIRST,expression:"currentStep === STEP.FIRST"}],staticClass:"file-request-dialog__header",attrs:{type:"info"}},[e("p",{staticClass:"file-request-dialog__description",attrs:{id:"file-request-dialog-description"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Collect files from others even if they do not have an account."))+"\n\t\t\t"+t._s(t.t("files_sharing","To ensure you can receive files, verify you have enough storage available."))+"\n\t\t")])]),t._v(" "),e("form",{ref:"form",staticClass:"file-request-dialog__form",attrs:{"aria-describedby":"file-request-dialog-description","aria-label":t.t("files_sharing","File request"),"aria-live":"polite","data-cy-file-request-dialog-form":""},on:{submit:function(t){t.preventDefault(),t.stopPropagation()}}},[e("FileRequestIntro",{directives:[{name:"show",rawName:"v-show",value:t.currentStep===t.STEP.FIRST,expression:"currentStep === STEP.FIRST"}],attrs:{context:t.context,destination:t.destination,disabled:t.loading,label:t.label,note:t.note},on:{"update:destination":function(e){t.destination=e},"update:label":function(e){t.label=e},"update:note":function(e){t.note=e}}}),t._v(" "),e("FileRequestDatePassword",{directives:[{name:"show",rawName:"v-show",value:t.currentStep===t.STEP.SECOND,expression:"currentStep === STEP.SECOND"}],attrs:{disabled:t.loading,"expiration-date":t.expirationDate,password:t.password},on:{"update:expirationDate":function(e){t.expirationDate=e},"update:expiration-date":function(e){t.expirationDate=e},"update:password":function(e){t.password=e}}}),t._v(" "),t.share?e("FileRequestFinish",{directives:[{name:"show",rawName:"v-show",value:t.currentStep===t.STEP.LAST,expression:"currentStep === STEP.LAST"}],attrs:{emails:t.emails,"is-share-by-mail-enabled":t.isShareByMailEnabled,share:t.share},on:{"add-email":e=>t.emails.push(e),"remove-email":t.onRemoveEmail}}):t._e()],1)],1)}),[],!1,null,null,null).exports}}]);
  2. //# sourceMappingURL=5019-5019.js.map?v=9ca0650e07a2467c5e76