u?te(e,o,r,!0,!1,p):z(t,n,a,o,r,s,l,c,p)},q=(e,t,n,a,o,r,s,l,c)=>{let d=0;const u=t.length;let p=e.length-1,A=u-1;for(;d<=p&&d<=A;){const a=e[d],i=t[d]=c?In(t[d]):Ln(t[d]);if(!xn(a,i))break;y(a,i,n,null,o,r,s,l,c),d++}for(;d<=p&&d<=A;){const a=e[p],i=t[A]=c?In(t[A]):Ln(t[A]);if(!xn(a,i))break;y(a,i,n,null,o,r,s,l,c),p--,A--}if(d>p){if(d<=A){const e=A+1,i=eA)for(;d<=p;)Z(e[d],o,r,!0),d++;else{const h=d,v=d,f=new Map;for(d=v;d<=A;d++){const e=t[d]=c?In(t[d]):Ln(t[d]);null!=e.key&&f.set(e.key,d)}let g,m=0;const b=A-v+1;let C=!1,_=0;const w=new Array(b);for(d=0;d=b){Z(a,o,r,!0);continue}let i;if(null!=a.key)i=f.get(a.key);else for(g=v;g<=A;g++)if(0===w[g-v]&&xn(a,t[g])){i=g;break}void 0===i?Z(a,o,r,!0):(w[i-v]=d+1,i>=_?_=i:C=!0,y(a,t[i],n,null,o,r,s,l,c),m++)}const x=C?function(e){const t=e.slice(),n=[0];let a,i,o,r,s;const l=e.length;for(a=0;a \n\t\t\t\t{{ subtitle }}\n\t\t\t\n\t\t
\n\n\n\n\n\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SharingEntryInternal.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SharingEntryInternal.vue?vue&type=script&lang=js\"","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SharingEntryInternal.vue?vue&type=style&index=0&id=6c4cb23b&prod&lang=scss&scoped=true\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SharingEntryInternal.vue?vue&type=style&index=0&id=6c4cb23b&prod&lang=scss&scoped=true\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./SharingEntryInternal.vue?vue&type=template&id=6c4cb23b&scoped=true\"\nimport script from \"./SharingEntryInternal.vue?vue&type=script&lang=js\"\nexport * from \"./SharingEntryInternal.vue?vue&type=script&lang=js\"\nimport style0 from \"./SharingEntryInternal.vue?vue&type=style&index=0&id=6c4cb23b&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6c4cb23b\",\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"sharing-search\"},[_c('label',{staticClass:\"hidden-visually\",attrs:{\"for\":_vm.shareInputId}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.isExternal\n\t\t\t? _vm.t('files_sharing', 'Enter external recipients')\n\t\t\t: _vm.t('files_sharing', 'Search for internal recipients'))+\"\\n\\t\")]),_vm._v(\" \"),_c('NcSelect',{ref:\"select\",staticClass:\"sharing-search__input\",attrs:{\"input-id\":_vm.shareInputId,\"disabled\":!_vm.canReshare,\"loading\":_vm.loading,\"filterable\":false,\"placeholder\":_vm.inputPlaceholder,\"clear-search-on-blur\":() => false,\"user-select\":true,\"options\":_vm.options,\"label-outside\":true},on:{\"search\":_vm.asyncFind,\"option:selected\":_vm.onSelected},scopedSlots:_vm._u([{key:\"no-options\",fn:function({ search }){return [_vm._v(\"\\n\\t\\t\\t\"+_vm._s(search ? _vm.noResultText : _vm.placeholder)+\"\\n\\t\\t\")]}}]),model:{value:(_vm.value),callback:function ($$v) {_vm.value=$$v},expression:\"value\"}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nexport const ATOMIC_PERMISSIONS = {\n\tNONE: 0,\n\tREAD: 1,\n\tUPDATE: 2,\n\tCREATE: 4,\n\tDELETE: 8,\n\tSHARE: 16,\n}\n\nconst BUNDLED_PERMISSIONS = {\n\tREAD_ONLY: ATOMIC_PERMISSIONS.READ,\n\tUPLOAD_AND_UPDATE: ATOMIC_PERMISSIONS.READ | ATOMIC_PERMISSIONS.UPDATE | ATOMIC_PERMISSIONS.CREATE | ATOMIC_PERMISSIONS.DELETE,\n\tFILE_DROP: ATOMIC_PERMISSIONS.CREATE,\n\tALL: ATOMIC_PERMISSIONS.UPDATE | ATOMIC_PERMISSIONS.CREATE | ATOMIC_PERMISSIONS.READ | ATOMIC_PERMISSIONS.DELETE | ATOMIC_PERMISSIONS.SHARE,\n\tALL_FILE: ATOMIC_PERMISSIONS.UPDATE | ATOMIC_PERMISSIONS.READ | ATOMIC_PERMISSIONS.SHARE,\n}\n\n/**\n * Get bundled permissions based on config.\n *\n * @param {boolean} excludeShare - Whether to exclude SHARE permission from ALL and ALL_FILE bundles.\n * @return {object}\n */\nexport function getBundledPermissions(excludeShare = false) {\n\tif (excludeShare) {\n\t\treturn {\n\t\t\t...BUNDLED_PERMISSIONS,\n\t\t\tALL: BUNDLED_PERMISSIONS.ALL & ~ATOMIC_PERMISSIONS.SHARE,\n\t\t\tALL_FILE: BUNDLED_PERMISSIONS.ALL_FILE & ~ATOMIC_PERMISSIONS.SHARE,\n\t\t}\n\t}\n\treturn BUNDLED_PERMISSIONS\n}\n\n/**\n * Return whether a given permissions set contains some permissions.\n *\n * @param {number} initialPermissionSet - the permissions set.\n * @param {number} permissionsToCheck - the permissions to check.\n * @return {boolean}\n */\nexport function hasPermissions(initialPermissionSet, permissionsToCheck) {\n\treturn initialPermissionSet !== ATOMIC_PERMISSIONS.NONE && (initialPermissionSet & permissionsToCheck) === permissionsToCheck\n}\n\n/**\n * Return whether a given permissions set is valid.\n *\n * @param {number} permissionsSet - the permissions set.\n *\n * @return {boolean}\n */\nexport function permissionsSetIsValid(permissionsSet) {\n\t// Must have at least READ or CREATE permission.\n\tif (!hasPermissions(permissionsSet, ATOMIC_PERMISSIONS.READ) && !hasPermissions(permissionsSet, ATOMIC_PERMISSIONS.CREATE)) {\n\t\treturn false\n\t}\n\n\t// Must have READ permission if have UPDATE or DELETE.\n\tif (!hasPermissions(permissionsSet, ATOMIC_PERMISSIONS.READ) && (\n\t\thasPermissions(permissionsSet, ATOMIC_PERMISSIONS.UPDATE) || hasPermissions(permissionsSet, ATOMIC_PERMISSIONS.DELETE)\n\t)) {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n/**\n * Add some permissions to an initial set of permissions.\n *\n * @param {number} initialPermissionSet - the initial permissions.\n * @param {number} permissionsToAdd - the permissions to add.\n *\n * @return {number}\n */\nexport function addPermissions(initialPermissionSet, permissionsToAdd) {\n\treturn initialPermissionSet | permissionsToAdd\n}\n\n/**\n * Remove some permissions from an initial set of permissions.\n *\n * @param {number} initialPermissionSet - the initial permissions.\n * @param {number} permissionsToSubtract - the permissions to remove.\n *\n * @return {number}\n */\nexport function subtractPermissions(initialPermissionSet, permissionsToSubtract) {\n\treturn initialPermissionSet & ~permissionsToSubtract\n}\n\n/**\n * Toggle some permissions from an initial set of permissions.\n *\n * @param {number} initialPermissionSet - the permissions set.\n * @param {number} permissionsToToggle - the permissions to toggle.\n *\n * @return {number}\n */\nexport function togglePermissions(initialPermissionSet, permissionsToToggle) {\n\tif (hasPermissions(initialPermissionSet, permissionsToToggle)) {\n\t\treturn subtractPermissions(initialPermissionSet, permissionsToToggle)\n\t} else {\n\t\treturn addPermissions(initialPermissionSet, permissionsToToggle)\n\t}\n}\n\n/**\n * Return whether some given permissions can be toggled from a permission set.\n *\n * @param {number} permissionSet - the initial permissions set.\n * @param {number} permissionsToToggle - the permissions to toggle.\n *\n * @return {boolean}\n */\nexport function canTogglePermissions(permissionSet, permissionsToToggle) {\n\treturn permissionsSetIsValid(togglePermissions(permissionSet, permissionsToToggle))\n}\n\n/**\n * The permission bundles the share editor offers, in the order they are matched.\n *\n * @type {string[]}\n */\nconst EDITOR_BUNDLES = ['READ_ONLY', 'ALL', 'ALL_FILE', 'FILE_DROP']\n\n/**\n * Find the permission bundle a share's permissions correspond to.\n *\n * Link and email shares carry the SHARE permission whenever federation on\n * public shares is enabled: the server adds it on top of whatever bundle was\n * picked, so it must be ignored when matching those shares against a bundle.\n *\n * @param {number} permissions - the share permissions.\n * @param {object} [options] - matching options.\n * @param {boolean} [options.isPublicShare] - whether the share is a link or email share.\n * @param {boolean} [options.excludeReshareFromEdit] - whether SHARE is excluded from the editing bundles.\n *\n * @return {string|null} the name of the matching bundle, or `null` for custom permissions.\n */\nexport function matchBundledPermissions(permissions, { isPublicShare = false, excludeReshareFromEdit = false } = {}) {\n\tconst bundles = getBundledPermissions(isPublicShare || excludeReshareFromEdit)\n\tconst comparablePermissions = isPublicShare\n\t\t? subtractPermissions(permissions, ATOMIC_PERMISSIONS.SHARE)\n\t\t: permissions\n\n\treturn EDITOR_BUNDLES.find((bundle) => bundles[bundle] === comparablePermissions) ?? null\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport logger from '../services/logger.ts';\nimport { isFileRequest } from '../services/SharingService.ts';\nexport default class Share {\n _share;\n /**\n * Create the share object\n *\n * @param ocsData ocs request response\n */\n constructor(ocsData) {\n if (ocsData.ocs && ocsData.ocs.data && ocsData.ocs.data[0]) {\n ocsData = ocsData.ocs.data[0];\n }\n // string to int\n if (typeof ocsData.id === 'string') {\n ocsData.id = Number.parseInt(ocsData.id);\n }\n // convert int into boolean\n ocsData.hide_download = !!ocsData.hide_download;\n ocsData.mail_send = !!ocsData.mail_send;\n if (ocsData.attributes && typeof ocsData.attributes === 'string') {\n try {\n ocsData.attributes = JSON.parse(ocsData.attributes);\n }\n catch {\n logger.warn('Could not parse share attributes returned by server', ocsData.attributes);\n }\n }\n ocsData.attributes = ocsData.attributes ?? [];\n // Pre-declared so Vue 2 makes newPassword reactive at observation time,\n // avoiding $set's property-addition path which races with async setters.\n ocsData.newPassword = ocsData.newPassword ?? undefined;\n // store state\n this._share = ocsData;\n }\n /**\n * Get the share state\n * ! used for reactivity purpose\n * Do not remove. It allow vuejs to\n * inject its watchers into the #share\n * state and make the whole class reactive\n *\n * @return the share raw state\n */\n get state() {\n return this._share;\n }\n /**\n * get the share id\n */\n get id() {\n return this._share.id;\n }\n /**\n * Get the share type\n */\n get type() {\n return this._share.share_type;\n }\n /**\n * Get the share permissions\n * See window.OC.PERMISSION_* variables\n */\n get permissions() {\n return this._share.permissions;\n }\n /**\n * Get the share attributes\n */\n get attributes() {\n return this._share.attributes || [];\n }\n /**\n * Set the share permissions\n * See window.OC.PERMISSION_* variables\n */\n set permissions(permissions) {\n this._share.permissions = permissions;\n }\n // SHARE OWNER --------------------------------------------------\n /**\n * Get the share owner uid\n */\n get owner() {\n return this._share.uid_owner;\n }\n /**\n * Get the share owner's display name\n */\n get ownerDisplayName() {\n return this._share.displayname_owner;\n }\n // SHARED WITH --------------------------------------------------\n /**\n * Get the share with entity uid\n */\n get shareWith() {\n return this._share.share_with;\n }\n /**\n * Get the share with entity display name\n * fallback to its uid if none\n */\n get shareWithDisplayName() {\n return this._share.share_with_displayname\n || this._share.share_with;\n }\n /**\n * Unique display name in case of multiple\n * duplicates results with the same name.\n */\n get shareWithDisplayNameUnique() {\n return this._share.share_with_displayname_unique\n || this._share.share_with;\n }\n /**\n * Get the share with entity link\n */\n get shareWithLink() {\n return this._share.share_with_link;\n }\n /**\n * Get the share with avatar if any\n */\n get shareWithAvatar() {\n return this._share.share_with_avatar;\n }\n // SHARED FILE OR FOLDER OWNER ----------------------------------\n /**\n * Get the shared item owner uid\n */\n get uidFileOwner() {\n return this._share.uid_file_owner;\n }\n /**\n * Get the shared item display name\n * fallback to its uid if none\n */\n get displaynameFileOwner() {\n return this._share.displayname_file_owner\n || this._share.uid_file_owner;\n }\n // TIME DATA ----------------------------------------------------\n /**\n * Get the share creation timestamp\n */\n get createdTime() {\n return this._share.stime;\n }\n /**\n * Get the expiration date\n *\n * @return date with YYYY-MM-DD format\n */\n get expireDate() {\n return this._share.expiration;\n }\n /**\n * Set the expiration date\n *\n * @param date the share expiration date with YYYY-MM-DD format\n */\n set expireDate(date) {\n this._share.expiration = date;\n }\n // EXTRA DATA ---------------------------------------------------\n /**\n * Get the public share token\n */\n get token() {\n return this._share.token;\n }\n /**\n * Set the public share token\n */\n set token(token) {\n this._share.token = token;\n }\n /**\n * Get the share note if any\n */\n get note() {\n return this._share.note;\n }\n /**\n * Set the share note if any\n */\n set note(note) {\n this._share.note = note;\n }\n /**\n * Get the share label if any\n * Should only exist on link shares\n */\n get label() {\n return this._share.label ?? '';\n }\n /**\n * Set the share label if any\n * Should only be set on link shares\n */\n set label(label) {\n this._share.label = label;\n }\n /**\n * Have a mail been sent\n */\n get mailSend() {\n return this._share.mail_send === true;\n }\n /**\n * Hide the download button on public page\n */\n get hideDownload() {\n return this._share.hide_download === true\n || this.attributes.find?.(({ scope, key, value }) => scope === 'permissions' && key === 'download' && !value) !== undefined;\n }\n /**\n * Hide the download button on public page\n */\n set hideDownload(state) {\n // disabling hide-download also enables the download permission\n // needed for regression in Nextcloud 31.0.0 until (incl.) 31.0.3\n if (!state) {\n const attribute = this.attributes.find(({ key, scope }) => key === 'download' && scope === 'permissions');\n if (attribute) {\n attribute.value = true;\n }\n }\n this._share.hide_download = state === true;\n }\n /**\n * Password protection of the share\n */\n get password() {\n return this._share.password;\n }\n /**\n * Password protection of the share\n */\n set password(password) {\n this._share.password = password;\n }\n /**\n * Unsaved password (set during share creation or editing).\n * Delegates to _share so reads/writes go through the reactive state.\n */\n get newPassword() {\n return this._share.newPassword;\n }\n set newPassword(value) {\n this._share.newPassword = value;\n }\n /**\n * Password expiration time\n *\n * @return date with YYYY-MM-DD format\n */\n get passwordExpirationTime() {\n return this._share.password_expiration_time;\n }\n /**\n * Password expiration time\n *\n * @param passwordExpirationTime date with YYYY-MM-DD format\n */\n set passwordExpirationTime(passwordExpirationTime) {\n this._share.password_expiration_time = passwordExpirationTime;\n }\n /**\n * Password protection by Talk of the share\n */\n get sendPasswordByTalk() {\n return this._share.send_password_by_talk;\n }\n /**\n * Password protection by Talk of the share\n *\n * @param sendPasswordByTalk whether to send the password by Talk or not\n */\n set sendPasswordByTalk(sendPasswordByTalk) {\n this._share.send_password_by_talk = sendPasswordByTalk;\n }\n // SHARED ITEM DATA ---------------------------------------------\n /**\n * Get the shared item absolute full path\n */\n get path() {\n return this._share.path;\n }\n /**\n * Return the item type: file or folder\n *\n * @return 'folder' | 'file'\n */\n get itemType() {\n return this._share.item_type;\n }\n /**\n * Get the shared item mimetype\n */\n get mimetype() {\n return this._share.mimetype;\n }\n /**\n * Get the shared item id\n */\n get fileSource() {\n return this._share.file_source;\n }\n /**\n * Get the target path on the receiving end\n * e.g the file /xxx/aaa will be shared in\n * the receiving root as /aaa, the fileTarget is /aaa\n */\n get fileTarget() {\n return this._share.file_target;\n }\n /**\n * Get the parent folder id if any\n */\n get fileParent() {\n return this._share.file_parent;\n }\n // PERMISSIONS Shortcuts\n /**\n * Does this share have READ permissions\n */\n get hasReadPermission() {\n return !!((this.permissions & window.OC.PERMISSION_READ));\n }\n /**\n * Does this share have CREATE permissions\n */\n get hasCreatePermission() {\n return !!((this.permissions & window.OC.PERMISSION_CREATE));\n }\n /**\n * Does this share have DELETE permissions\n */\n get hasDeletePermission() {\n return !!((this.permissions & window.OC.PERMISSION_DELETE));\n }\n /**\n * Does this share have UPDATE permissions\n */\n get hasUpdatePermission() {\n return !!((this.permissions & window.OC.PERMISSION_UPDATE));\n }\n /**\n * Does this share have SHARE permissions\n */\n get hasSharePermission() {\n return !!((this.permissions & window.OC.PERMISSION_SHARE));\n }\n /**\n * Does this share have download permissions\n */\n get hasDownloadPermission() {\n const hasDisabledDownload = (attribute) => {\n return attribute.scope === 'permissions' && attribute.key === 'download' && attribute.value === false;\n };\n return !this.attributes.some(hasDisabledDownload);\n }\n /**\n * Is this mail share a file request ?\n */\n get isFileRequest() {\n return isFileRequest(JSON.stringify(this.attributes));\n }\n set hasDownloadPermission(enabled) {\n this.setAttribute('permissions', 'download', !!enabled);\n }\n setAttribute(scope, key, value) {\n const attrUpdate = {\n scope,\n key,\n value,\n };\n // try and replace existing\n for (const i in this._share.attributes) {\n const attr = this._share.attributes[i];\n if (attr.scope === attrUpdate.scope && attr.key === attrUpdate.key) {\n this._share.attributes.splice(i, 1, attrUpdate);\n return;\n }\n }\n this._share.attributes.push(attrUpdate);\n }\n // PERMISSIONS Shortcuts for the CURRENT USER\n // ! the permissions above are the share settings,\n // ! meaning the permissions for the recipient\n /**\n * Can the current user EDIT this share ?\n */\n get canEdit() {\n return this._share.can_edit === true;\n }\n /**\n * Can the current user DELETE this share ?\n */\n get canDelete() {\n return this._share.can_delete === true;\n }\n /**\n * Top level accessible shared folder fileid for the current user\n */\n get viaFileid() {\n return this._share.via_fileid;\n }\n /**\n * Top level accessible shared folder path for the current user\n */\n get viaPath() {\n return this._share.via_path;\n }\n // TODO: SORT THOSE PROPERTIES\n get parent() {\n return this._share.parent;\n }\n get storageId() {\n return this._share.storage_id;\n }\n get storage() {\n return this._share.storage;\n }\n get itemSource() {\n return this._share.item_source;\n }\n get status() {\n return this._share.status;\n }\n /**\n * Is the share from a trusted server\n */\n get isTrustedServer() {\n return !!this._share.is_trusted_server;\n }\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n// TODO: Fix this instead of disabling ESLint!!!\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { getCurrentUser } from '@nextcloud/auth';\nimport axios from '@nextcloud/axios';\nimport { File, Folder, Permission } from '@nextcloud/files';\nimport { getRemoteURL, getRootPath } from '@nextcloud/files/dav';\nimport { generateOcsUrl } from '@nextcloud/router';\nimport logger from './logger.ts';\nconst headers = {\n 'Content-Type': 'application/json',\n};\n/**\n *\n * @param ocsEntry\n * @param unmounted whether the share is not mounted into the filesystem (pending or deleted)\n */\nasync function ocsEntryToNode(ocsEntry, unmounted = false) {\n try {\n // Federated share handling\n if (ocsEntry?.remote_id !== undefined) {\n if (!ocsEntry.mimetype) {\n const mime = (await import('mime')).default;\n // This won't catch files without an extension, but this is the best we can do\n ocsEntry.mimetype = mime.getType(ocsEntry.name);\n }\n const type = ocsEntry.type === 'dir' ? 'folder' : ocsEntry.type;\n ocsEntry.item_type = type || (ocsEntry.mimetype ? 'file' : 'folder');\n // different naming for remote shares\n ocsEntry.item_mtime = ocsEntry.mtime;\n ocsEntry.file_target = ocsEntry.file_target || ocsEntry.mountpoint;\n if (ocsEntry.file_target.includes('TemporaryMountPointName')) {\n ocsEntry.file_target = ocsEntry.name;\n }\n // If the share is not accepted yet we don't know which permissions it will have\n if (!ocsEntry.accepted) {\n // Need to set permissions to NONE for federated shares\n ocsEntry.item_permissions = Permission.NONE;\n ocsEntry.permissions = Permission.NONE;\n }\n ocsEntry.uid_owner = ocsEntry.owner;\n // TODO: have the real display name stored somewhere\n ocsEntry.displayname_owner = ocsEntry.owner;\n }\n // Pending and deleted shares are not mounted into the user's filesystem,\n // so no file operation can act on them until they are accepted or restored.\n if (unmounted) {\n ocsEntry.item_permissions = Permission.NONE;\n ocsEntry.permissions = Permission.NONE;\n }\n const isFolder = ocsEntry?.item_type === 'folder';\n const hasPreview = ocsEntry?.has_preview === true;\n const Node = isFolder ? Folder : File;\n // If this is an external share that is not yet accepted,\n // we don't have an id. We can fallback to the row id temporarily\n // local shares (this server) use `file_source`, but remote shares (federated) use `file_id`\n const fileid = ocsEntry.file_source || ocsEntry.file_id || ocsEntry.id;\n // Generate path and strip double slashes\n const path = ocsEntry.path || ocsEntry.file_target || ocsEntry.name;\n const source = `${getRemoteURL()}${getRootPath()}/${path.replace(/^\\/+/, '')}`;\n let mtime = ocsEntry.item_mtime ? new Date((ocsEntry.item_mtime) * 1000) : undefined;\n // Prefer share time if more recent than item mtime\n if (ocsEntry?.stime > (ocsEntry?.item_mtime || 0)) {\n mtime = new Date((ocsEntry.stime) * 1000);\n }\n let sharees;\n if ('share_with' in ocsEntry) {\n sharees = {\n sharee: {\n id: ocsEntry.share_with,\n 'display-name': ocsEntry.share_with_displayname || ocsEntry.share_with,\n type: ocsEntry.share_type,\n },\n };\n }\n return new Node({\n id: fileid,\n source,\n owner: ocsEntry?.uid_owner,\n mime: ocsEntry?.mimetype || 'application/octet-stream',\n mtime,\n size: ocsEntry?.item_size ?? undefined,\n permissions: ocsEntry?.item_permissions || ocsEntry?.permissions,\n root: getRootPath(),\n attributes: {\n ...ocsEntry,\n // 'id' is a forbidden property name\n 'share-id': ocsEntry.id,\n 'has-preview': hasPreview,\n 'hide-download': ocsEntry?.hide_download === 1,\n // Also check the sharingStatusAction.ts code\n 'owner-id': ocsEntry?.uid_owner,\n 'owner-display-name': ocsEntry?.displayname_owner,\n 'share-types': ocsEntry?.share_type,\n 'share-attributes': ocsEntry?.attributes || '[]',\n sharees,\n favorite: ocsEntry?.tags?.includes(window.OC.TAG_FAVORITE) ? 1 : 0,\n },\n });\n }\n catch (error) {\n logger.error('Error while parsing OCS entry', { error });\n return null;\n }\n}\n/**\n *\n * @param shareWithMe\n */\nfunction getShares(shareWithMe = false) {\n const url = generateOcsUrl('apps/files_sharing/api/v1/shares');\n return axios.get(url, {\n headers,\n params: {\n shared_with_me: shareWithMe,\n include_tags: true,\n },\n });\n}\n/**\n *\n */\nfunction getSharedWithYou() {\n return getShares(true);\n}\n/**\n *\n */\nfunction getSharedWithOthers() {\n return getShares();\n}\n/**\n *\n */\nfunction getRemoteShares() {\n const url = generateOcsUrl('apps/files_sharing/api/v1/remote_shares');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n}\n/**\n *\n */\nfunction getPendingShares() {\n const url = generateOcsUrl('apps/files_sharing/api/v1/shares/pending');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n}\n/**\n *\n */\nfunction getRemotePendingShares() {\n const url = generateOcsUrl('apps/files_sharing/api/v1/remote_shares/pending');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n}\n/**\n *\n */\nfunction getDeletedShares() {\n const url = generateOcsUrl('apps/files_sharing/api/v1/deletedshares');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n}\n/**\n * Check if a file request is enabled\n *\n * @param attributes the share attributes json-encoded array\n */\nexport function isFileRequest(attributes = '[]') {\n const isFileRequest = (attribute) => {\n return attribute.scope === 'fileRequest' && attribute.key === 'enabled' && attribute.value === true;\n };\n try {\n const attributesArray = JSON.parse(attributes);\n return attributesArray.some(isFileRequest);\n }\n catch (error) {\n logger.error('Error while parsing share attributes', { error });\n return false;\n }\n}\n/**\n * Group an array of objects (here Nodes) by a key\n * and return an array of arrays of them.\n *\n * @param nodes Nodes to group\n * @param key The attribute to group by\n */\nfunction groupBy(nodes, key) {\n return Object.values(nodes.reduce(function (acc, curr) {\n (acc[curr[key]] = acc[curr[key]] || []).push(curr);\n return acc;\n }, {}));\n}\n/**\n *\n * @param sharedWithYou\n * @param sharedWithOthers\n * @param pendingShares\n * @param deletedshares\n * @param filterTypes\n */\nexport async function getContents(sharedWithYou = true, sharedWithOthers = true, pendingShares = false, deletedshares = false, filterTypes = []) {\n const requests = [];\n if (sharedWithYou) {\n requests.push({ promise: getSharedWithYou(), unmounted: false }, { promise: getRemoteShares(), unmounted: false });\n }\n if (sharedWithOthers) {\n requests.push({ promise: getSharedWithOthers(), unmounted: false });\n }\n if (pendingShares) {\n requests.push({ promise: getPendingShares(), unmounted: true }, { promise: getRemotePendingShares(), unmounted: true });\n }\n if (deletedshares) {\n requests.push({ promise: getDeletedShares(), unmounted: true });\n }\n const responses = await Promise.all(requests.map(({ promise }) => promise));\n const data = responses.flatMap((response, index) => response.data.ocs.data\n .map((entry) => ({ entry, unmounted: requests[index].unmounted })));\n let contents = (await Promise.all(data.map(({ entry, unmounted }) => ocsEntryToNode(entry, unmounted))))\n .filter((node) => node !== null);\n if (filterTypes.length > 0) {\n contents = contents.filter((node) => filterTypes.includes(node.attributes?.share_type));\n }\n // Merge duplicate shares and group their attributes\n // Also check the sharingStatusAction.ts code\n contents = groupBy(contents, 'source').map((nodes) => {\n const node = nodes[0];\n node.attributes['share-types'] = nodes.map((node) => node.attributes['share-types']);\n return node;\n });\n return {\n folder: new Folder({\n id: 0,\n source: `${getRemoteURL()}${getRootPath()}`,\n owner: getCurrentUser()?.uid || null,\n root: getRootPath(),\n }),\n contents,\n };\n}\n","\n import API from \"!../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../css-loader/dist/cjs.js!./dialog.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../css-loader/dist/cjs.js!./dialog.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcDialog.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcDialog.css\";\n export default content && content.locals ? content.locals : undefined;\n","import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createTextVNode, toDisplayString, renderSlot, createCommentVNode } from \"vue\";\nimport { r as register, f as t34, a as t } from \"./_l10n.mjs\";\nimport { N as NcButton } from \"./NcButton.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper.mjs\";\nimport { N as NcLoadingIcon } from \"./NcLoadingIcon.mjs\";\nregister(t34);\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcDialogButton\",\n props: {\n callback: { type: Function, default: () => {\n } },\n disabled: { type: Boolean, default: false },\n icon: { default: void 0 },\n label: {},\n type: { default: \"button\" },\n variant: { default: \"tertiary\" }\n },\n emits: [\"click\"],\n setup(__props, { emit: __emit }) {\n const props = __props;\n const emit = __emit;\n const isLoading = ref(false);\n async function handleClick(e) {\n if (isLoading.value) {\n return;\n }\n isLoading.value = true;\n try {\n const fallback = props.type === \"reset\" ? false : void 0;\n const result = await props.callback?.() ?? fallback;\n if (result !== false) {\n emit(\"click\", e, result);\n }\n } finally {\n isLoading.value = false;\n }\n }\n return (_ctx, _cache) => {\n return openBlock(), createBlock(unref(NcButton), {\n \"aria-label\": __props.label,\n disabled: __props.disabled,\n type: __props.type,\n variant: __props.variant,\n onClick: handleClick\n }, {\n icon: withCtx(() => [\n renderSlot(_ctx.$slots, \"icon\", {}, () => [\n isLoading.value ? (openBlock(), createBlock(unref(NcLoadingIcon), {\n key: 0,\n name: unref(t)(\"Loading …\")\n /* TRANSLATORS: The button is in a loading state*/\n }, null, 8, [\"name\"])) : __props.icon !== void 0 ? (openBlock(), createBlock(unref(NcIconSvgWrapper), {\n key: 1,\n svg: __props.icon\n }, null, 8, [\"svg\"])) : createCommentVNode(\"\", true)\n ])\n ]),\n default: withCtx(() => [\n createTextVNode(toDisplayString(__props.label) + \" \", 1)\n ]),\n _: 3\n }, 8, [\"aria-label\", \"disabled\", \"type\", \"variant\"]);\n };\n }\n});\nexport {\n _sfc_main as _\n};\n//# sourceMappingURL=NcDialogButton.vue_vue_type_script_setup_true_lang.mjs.map\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcModal.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcModal.css\";\n export default content && content.locals ? content.locals : undefined;\n","import '../assets/NcModal.css';\nimport { getCurrentInstance, warn, defineComponent, useCssVars, useModel, useTemplateRef, onUnmounted, watch, toRef, ref, watchEffect, computed, useSlots, onMounted, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementVNode, mergeProps, unref, createElementBlock, toDisplayString, createCommentVNode, normalizeClass, renderSlot, withModifiers, vShow, mergeModels, nextTick } from \"vue\";\nimport { z as mdiPause, A as mdiPlay, b as mdiClose, B as mdiChevronLeft, c as mdiChevronRight } from \"./mdi.mjs\";\nimport { useIntervalFn, useSwipe } from \"@vueuse/core\";\nimport { createFocusTrap } from \"focus-trap\";\nimport { N as NcActions } from \"./NcActions.mjs\";\nimport { N as NcButton } from \"./NcButton.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper.mjs\";\nimport \"../composables/useFormatDateTime/index.mjs\";\nimport { useHotKey } from \"../composables/useHotKey/index.mjs\";\nimport \"../composables/useIsDarkTheme/index.mjs\";\nimport \"../composables/useIsFullscreen/index.mjs\";\nimport \"../composables/useIsMobile/index.mjs\";\nimport { r as register, D as t37, A as t20, a as t } from \"./_l10n.mjs\";\nimport { c as createElementId } from \"./createElementId.mjs\";\nimport { g as getTrapStack } from \"./focusTrap.mjs\";\nimport { i as isRtl } from \"./rtl.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\n/*!\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nfunction getSameNodeParent(instance) {\n if (!instance.parent) {\n return null;\n }\n if (\"vapor\" in instance || \"vapor\" in instance.parent) {\n warn(\"Vapor instances are not supported in useScopeIdAttrs :(\");\n return null;\n }\n if (instance.parent.subTree !== instance.vnode) {\n return null;\n }\n return instance.parent;\n}\nfunction getSameNodeAncestors(instance) {\n const ancestors = [instance];\n let parent = getSameNodeParent(instance);\n while (parent) {\n ancestors.push(parent);\n parent = getSameNodeParent(parent);\n }\n return ancestors;\n}\nfunction useScopeIdAttrs() {\n const instance = getCurrentInstance();\n if (!instance) {\n throw new Error(\"useScopeId must be called within a setup context\");\n }\n const sameNodeAncestors = getSameNodeAncestors(instance);\n const scopeIds = sameNodeAncestors.map((instance2) => instance2.vnode.scopeId).filter(Boolean);\n const scopeIdAttrs = Object.fromEntries(scopeIds.map((scopeId) => [scopeId, \"\"]));\n return scopeIdAttrs;\n}\nregister(t20, t37);\nconst _hoisted_1 = [\"aria-labelledby\", \"aria-describedby\"];\nconst _hoisted_2 = [\"data-theme-light\", \"data-theme-dark\"];\nconst _hoisted_3 = [\"id\"];\nconst _hoisted_4 = { class: \"icons-menu\" };\nconst _hoisted_5 = [\"title\"];\nconst _hoisted_6 = [\"id\"];\nconst _hoisted_7 = { class: \"modal-container__content\" };\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...{ inheritAttrs: false },\n __name: \"NcModal\",\n props: /* @__PURE__ */ mergeModels({\n name: { default: \"\" },\n hasPrevious: { type: Boolean },\n hasNext: { type: Boolean },\n outTransition: { type: Boolean },\n enableSlideshow: { type: Boolean },\n slideshowDelay: { default: 5e3 },\n slideshowPaused: { type: Boolean },\n disableSwipe: { type: Boolean },\n spreadNavigation: { type: Boolean },\n size: { default: \"normal\" },\n noClose: { type: Boolean },\n closeOnClickOutside: { type: Boolean },\n dark: { type: Boolean },\n lightBackdrop: { type: Boolean },\n container: { default: \"body\" },\n closeButtonOutside: { type: Boolean },\n additionalTrapElements: { default: () => [] },\n inlineActions: { default: 0 },\n labelId: { default: \"\" },\n setReturnFocus: { default: void 0 }\n }, {\n \"show\": { type: Boolean, ...{ default: true } },\n \"showModifiers\": {}\n }),\n emits: /* @__PURE__ */ mergeModels([\"next\", \"previous\", \"close\", \"update:show\"], [\"update:show\"]),\n setup(__props, { emit: __emit }) {\n useCssVars((_ctx) => ({\n \"v046d2bb2\": numHeaderActions.value,\n \"v71f7c020\": cssSlideshowDelay.value\n }));\n const showModal = useModel(__props, \"show\");\n const props = __props;\n const emit = __emit;\n const scopeIdAttrs = useScopeIdAttrs();\n const modalId = createElementId();\n const maskElement = useTemplateRef(\"mask\");\n let focusTrap;\n onUnmounted(() => clearFocusTrap());\n watch(() => props.additionalTrapElements, (elements) => {\n if (focusTrap) {\n focusTrap.updateContainerElements([maskElement.value, ...elements]);\n }\n });\n const {\n isActive: isPlaying,\n pause: stopSlideshow,\n resume: startSlideshow\n } = useIntervalFn(nextSlide, toRef(() => props.slideshowDelay), { immediate: false });\n const animationKey = ref(0);\n const runSlideshow = ref(false);\n watchEffect(() => {\n if (runSlideshow.value && !props.slideshowPaused) {\n startSlideshow();\n } else if (isPlaying.value) {\n stopSlideshow();\n }\n });\n const cssSlideshowDelay = computed(() => `${props.slideshowDelay}ms`);\n const { stop: stopSwipe } = useSwipe(maskElement, {\n onSwipeEnd: handleSwipe\n });\n onUnmounted(stopSwipe);\n useHotKey(\"Escape\", () => {\n const trapStack = getTrapStack();\n if (trapStack.at(-1) === focusTrap) {\n close();\n }\n }, { allowInModal: true });\n useHotKey([\"ArrowLeft\", \"ArrowRight\"], (event) => {\n if (document.activeElement && !maskElement.value.contains(document.activeElement)) {\n return;\n }\n if (event.key === \"ArrowLeft\" !== isRtl) {\n previousSlide();\n } else {\n nextSlide();\n }\n }, { allowInModal: true });\n const slots = useSlots();\n const numHeaderActions = computed(() => {\n let actions = 0;\n if (props.hasNext && props.enableSlideshow) {\n actions++;\n }\n if (!props.noClose && props.closeButtonOutside) {\n actions++;\n }\n if (slots.actions) {\n actions++;\n }\n return actions;\n });\n onMounted(() => {\n if (!props.name && !props.labelId) {\n warn(\"[NcModal] You need either set the name or set a `labelId` for accessibility.\");\n }\n });\n function nextSlide(event) {\n if (!props.hasNext) {\n runSlideshow.value = false;\n return;\n }\n if (event && isPlaying.value) {\n restartSlideshow();\n }\n emit(\"next\", event);\n }\n function previousSlide(event) {\n if (!props.hasPrevious) {\n return;\n }\n if (event && isPlaying.value) {\n restartSlideshow();\n }\n emit(\"previous\", event);\n }\n function handleSwipe(e, direction) {\n if (!props.disableSwipe) {\n if (direction !== \"left\" && direction !== \"right\") {\n return;\n }\n if (direction === \"left\" !== isRtl) {\n nextSlide(e);\n } else {\n previousSlide(e);\n }\n }\n }\n function restartSlideshow() {\n stopSlideshow();\n startSlideshow();\n animationKey.value++;\n }\n function close(event) {\n if (props.noClose) {\n return;\n }\n showModal.value = false;\n setTimeout(() => {\n emit(\"close\", event);\n }, 300);\n }\n function handleClickModalWrapper(event) {\n if (props.closeOnClickOutside) {\n close(event);\n }\n }\n async function useFocusTrap() {\n if (focusTrap) {\n return;\n }\n await nextTick();\n const options = {\n allowOutsideClick: true,\n fallbackFocus: maskElement.value,\n trapStack: getTrapStack(),\n // Esc can be used without stop in content or additionalTrapElements where it should not deactivate modal's focus trap.\n // Focus trap is deactivated on modal close anyway.\n escapeDeactivates: false,\n setReturnFocus: props.setReturnFocus\n };\n focusTrap = createFocusTrap([maskElement.value, ...props.additionalTrapElements], options);\n focusTrap.activate();\n }\n function clearFocusTrap() {\n if (!focusTrap) {\n return;\n }\n focusTrap?.deactivate();\n focusTrap = void 0;\n }\n return (_ctx, _cache) => {\n return openBlock(), createBlock(Teleport, {\n disabled: __props.container === null,\n to: __props.container\n }, [\n createVNode(Transition, {\n name: \"fade\",\n appear: \"\",\n onAfterEnter: useFocusTrap,\n onBeforeLeave: clearFocusTrap\n }, {\n default: withCtx(() => [\n withDirectives(createElementVNode(\"div\", mergeProps({ ..._ctx.$attrs, ...unref(scopeIdAttrs) }, {\n ref: \"mask\",\n class: [\"modal-mask\", {\n \"modal-mask--opaque\": __props.dark || __props.closeButtonOutside || __props.hasPrevious || __props.hasNext,\n \"modal-mask--light\": __props.lightBackdrop\n }],\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-labelledby\": __props.labelId || `modal-name-${unref(modalId)}`,\n \"aria-describedby\": \"modal-description-\" + unref(modalId),\n tabindex: \"-1\"\n }), [\n createVNode(Transition, {\n name: \"fade-visibility\",\n appear: \"\"\n }, {\n default: withCtx(() => [\n createElementVNode(\"div\", {\n class: \"modal-header\",\n \"data-theme-light\": __props.lightBackdrop,\n \"data-theme-dark\": !__props.lightBackdrop\n }, [\n __props.name.trim() !== \"\" ? (openBlock(), createElementBlock(\"h2\", {\n key: 0,\n id: \"modal-name-\" + unref(modalId),\n class: \"modal-header__name\"\n }, toDisplayString(__props.name), 9, _hoisted_3)) : createCommentVNode(\"\", true),\n createElementVNode(\"div\", _hoisted_4, [\n __props.hasNext && __props.enableSlideshow ? (openBlock(), createElementBlock(\"button\", {\n key: 0,\n class: normalizeClass([\"play-pause-icons\", { \"play-pause-icons--paused\": __props.slideshowPaused }]),\n title: unref(isPlaying) ? unref(t)(\"Pause slideshow\") : unref(t)(\"Start slideshow\"),\n type: \"button\",\n onClick: _cache[0] || (_cache[0] = ($event) => runSlideshow.value = !runSlideshow.value)\n }, [\n createVNode(NcIconSvgWrapper, {\n class: \"play-pause-icons__icon\",\n inline: \"\",\n name: unref(isPlaying) ? unref(t)(\"Pause slideshow\") : unref(t)(\"Start slideshow\"),\n path: unref(isPlaying) ? unref(mdiPause) : unref(mdiPlay)\n }, null, 8, [\"name\", \"path\"]),\n unref(isPlaying) ? (openBlock(), createElementBlock(\"svg\", {\n key: `${unref(modalId)}-animation-${animationKey.value}`,\n class: \"progress-ring\",\n height: \"50\",\n width: \"50\"\n }, [..._cache[1] || (_cache[1] = [\n createElementVNode(\"circle\", {\n class: \"progress-ring__circle\",\n stroke: \"white\",\n \"stroke-width\": \"2\",\n fill: \"transparent\",\n r: \"15\",\n cx: \"25\",\n cy: \"25\"\n }, null, -1)\n ])])) : createCommentVNode(\"\", true)\n ], 10, _hoisted_5)) : createCommentVNode(\"\", true),\n createVNode(NcActions, {\n class: \"header-actions\",\n inline: __props.inlineActions\n }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"actions\", {}, void 0, true)\n ]),\n _: 3\n }, 8, [\"inline\"]),\n !__props.noClose && __props.closeButtonOutside ? (openBlock(), createBlock(NcButton, {\n key: 1,\n \"aria-label\": unref(t)(\"Close\"),\n class: \"header-close\",\n variant: \"tertiary\",\n onClick: close\n }, {\n icon: withCtx(() => [\n createVNode(NcIconSvgWrapper, { path: unref(mdiClose) }, null, 8, [\"path\"])\n ]),\n _: 1\n }, 8, [\"aria-label\"])) : createCommentVNode(\"\", true)\n ])\n ], 8, _hoisted_2)\n ]),\n _: 3\n }),\n createVNode(Transition, {\n name: `modal-${__props.outTransition ? \"out\" : \"in\"}`,\n appear: \"\"\n }, {\n default: withCtx(() => [\n withDirectives(createElementVNode(\"div\", {\n class: normalizeClass([\"modal-wrapper\", [\n `modal-wrapper--${__props.size}`,\n { \"modal-wrapper--spread-navigation\": __props.spreadNavigation }\n ]]),\n onMousedown: withModifiers(handleClickModalWrapper, [\"self\"])\n }, [\n createVNode(Transition, {\n name: \"fade-visibility\",\n appear: \"\"\n }, {\n default: withCtx(() => [\n withDirectives(createVNode(NcButton, {\n \"aria-label\": unref(t)(\"Previous\"),\n class: \"prev\",\n variant: \"tertiary-no-background\",\n onClick: previousSlide\n }, {\n icon: withCtx(() => [\n createVNode(NcIconSvgWrapper, {\n directional: \"\",\n path: unref(mdiChevronLeft),\n size: 40\n }, null, 8, [\"path\"])\n ]),\n _: 1\n }, 8, [\"aria-label\"]), [\n [vShow, __props.hasPrevious]\n ])\n ]),\n _: 1\n }),\n createElementVNode(\"div\", {\n id: \"modal-description-\" + unref(modalId),\n class: \"modal-container\"\n }, [\n createElementVNode(\"div\", _hoisted_7, [\n renderSlot(_ctx.$slots, \"default\", {}, void 0, true)\n ]),\n !__props.noClose && !__props.closeButtonOutside ? (openBlock(), createBlock(NcButton, {\n key: 0,\n \"aria-label\": unref(t)(\"Close\"),\n class: \"modal-container__close\",\n variant: \"tertiary\",\n onClick: close\n }, {\n icon: withCtx(() => [\n createVNode(NcIconSvgWrapper, { path: unref(mdiClose) }, null, 8, [\"path\"])\n ]),\n _: 1\n }, 8, [\"aria-label\"])) : createCommentVNode(\"\", true)\n ], 8, _hoisted_6),\n createVNode(Transition, {\n name: \"fade-visibility\",\n appear: \"\"\n }, {\n default: withCtx(() => [\n withDirectives(createVNode(NcButton, {\n \"aria-label\": unref(t)(\"Next\"),\n class: \"next\",\n variant: \"tertiary-no-background\",\n onClick: nextSlide\n }, {\n icon: withCtx(() => [\n createVNode(NcIconSvgWrapper, {\n directional: \"\",\n path: unref(mdiChevronRight),\n size: 40\n }, null, 8, [\"path\"])\n ]),\n _: 1\n }, 8, [\"aria-label\"]), [\n [vShow, __props.hasNext]\n ])\n ]),\n _: 1\n })\n ], 34), [\n [vShow, showModal.value]\n ])\n ]),\n _: 3\n }, 8, [\"name\"])\n ], 16, _hoisted_1), [\n [vShow, showModal.value]\n ])\n ]),\n _: 3\n })\n ], 8, [\"disabled\", \"to\"]);\n };\n }\n});\nconst NcModal = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-3c357e2d\"]]);\nexport {\n NcModal as N\n};\n//# sourceMappingURL=NcModal.mjs.map\n","import '../assets/NcDialog.css';\nimport { defineComponent, useModel, useSlots, useTemplateRef, computed, ref, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, toDisplayString, resolveDynamicComponent, toHandlers, normalizeClass, createElementBlock, renderSlot, createCommentVNode, Fragment, renderList, mergeModels } from \"vue\";\nimport { useElementSize } from \"@vueuse/core\";\nimport { c as createElementId } from \"./createElementId.mjs\";\nimport { _ as _sfc_main$1 } from \"./NcDialogButton.vue_vue_type_script_setup_true_lang.mjs\";\nimport { N as NcModal } from \"./NcModal.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\nconst _hoisted_1 = [\"id\", \"textContent\"];\nconst _hoisted_2 = [\"aria-label\", \"aria-labelledby\"];\nconst _hoisted_3 = { class: \"dialog__text\" };\nconst _hoisted_4 = { class: \"dialog__actions\" };\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcDialog\",\n props: /* @__PURE__ */ mergeModels({\n name: {},\n message: { default: \"\" },\n additionalTrapElements: { default: () => [] },\n container: { default: \"body\" },\n size: { default: \"small\" },\n buttons: { default: () => [] },\n isForm: { type: Boolean },\n noClose: { type: Boolean },\n closeOnClickOutside: { type: Boolean },\n outTransition: { type: Boolean },\n navigationAriaLabel: { default: \"\" },\n navigationAriaLabelledby: { default: \"\" },\n contentClasses: { default: \"\" },\n dialogClasses: { default: \"\" },\n navigationClasses: { default: \"\" }\n }, {\n \"open\": { type: Boolean, ...{ default: true } },\n \"openModifiers\": {}\n }),\n emits: /* @__PURE__ */ mergeModels([\"closing\", \"reset\", \"submit\"], [\"update:open\"]),\n setup(__props, { emit: __emit }) {\n const open = useModel(__props, \"open\");\n const props = __props;\n const emit = __emit;\n const slots = useSlots();\n const wrapperElement = useTemplateRef(\"wrapper\");\n const { width: dialogWidth } = useElementSize(wrapperElement, { width: 900, height: 0 });\n const isNavigationCollapsed = computed(() => dialogWidth.value < 876);\n const hasNavigation = computed(() => slots?.navigation !== void 0);\n const navigationId = createElementId();\n const navigationAriaLabelAttr = computed(() => props.navigationAriaLabel || void 0);\n const navigationAriaLabelledbyAttr = computed(() => {\n if (props.navigationAriaLabel) {\n return void 0;\n }\n return props.navigationAriaLabelledby || navigationId;\n });\n const dialogRootElement = useTemplateRef(\"dialogElement\");\n const dialogTagName = computed(() => props.isForm && !hasNavigation.value ? \"form\" : \"div\");\n const dialogListeners = computed(() => {\n if (dialogTagName.value !== \"form\") {\n return {};\n }\n return {\n /**\n * @param event - Form submit event\n */\n submit(event) {\n event.preventDefault();\n emit(\"submit\", event);\n },\n /**\n * @param event - Form submit event\n */\n reset(event) {\n event.preventDefault();\n emit(\"reset\", event);\n }\n };\n });\n const showModal = ref(true);\n function handleButtonClose(button, result) {\n if (button.type === \"submit\" && dialogTagName.value === \"form\" && \"reportValidity\" in dialogRootElement.value && !dialogRootElement.value.reportValidity()) {\n return;\n }\n handleClosing(result);\n window.setTimeout(() => handleClosed(), 300);\n }\n function handleClosing(result) {\n showModal.value = false;\n emit(\"closing\", result);\n }\n function handleClosed() {\n showModal.value = true;\n open.value = false;\n }\n const modalProps = computed(() => ({\n noClose: props.noClose,\n container: props.container === void 0 ? \"body\" : props.container,\n // we do not pass the name as we already have the name as the headline\n // name: props.name,\n // But we need to set the correct label id so the dialog is labelled\n labelId: navigationId,\n size: props.size,\n show: open.value && showModal.value,\n outTransition: props.outTransition,\n closeOnClickOutside: props.closeOnClickOutside,\n additionalTrapElements: props.additionalTrapElements\n }));\n return (_ctx, _cache) => {\n return open.value ? (openBlock(), createBlock(unref(NcModal), mergeProps({\n key: 0,\n class: \"dialog__modal\",\n disableSwipe: \"\"\n }, modalProps.value, {\n onClose: handleClosed,\n \"onUpdate:show\": _cache[0] || (_cache[0] = ($event) => handleClosing())\n }), {\n default: withCtx(() => [\n createElementVNode(\"h2\", {\n id: unref(navigationId),\n class: \"dialog__name\",\n textContent: toDisplayString(__props.name)\n }, null, 8, _hoisted_1),\n (openBlock(), createBlock(resolveDynamicComponent(dialogTagName.value), mergeProps({\n ref: \"dialogElement\",\n class: [\"dialog\", __props.dialogClasses]\n }, toHandlers(dialogListeners.value)), {\n default: withCtx(() => [\n createElementVNode(\"div\", {\n ref: \"wrapper\",\n class: normalizeClass([\"dialog__wrapper\", [{ \"dialog__wrapper--collapsed\": isNavigationCollapsed.value }]])\n }, [\n hasNavigation.value ? (openBlock(), createElementBlock(\"nav\", {\n key: 0,\n class: normalizeClass([\"dialog__navigation\", __props.navigationClasses]),\n \"aria-label\": navigationAriaLabelAttr.value,\n \"aria-labelledby\": navigationAriaLabelledbyAttr.value\n }, [\n renderSlot(_ctx.$slots, \"navigation\", { isCollapsed: isNavigationCollapsed.value }, void 0, true)\n ], 10, _hoisted_2)) : createCommentVNode(\"\", true),\n createElementVNode(\"div\", {\n class: normalizeClass([\"dialog__content\", __props.contentClasses])\n }, [\n renderSlot(_ctx.$slots, \"default\", {}, () => [\n createElementVNode(\"p\", _hoisted_3, toDisplayString(__props.message), 1)\n ], true)\n ], 2)\n ], 2),\n createElementVNode(\"div\", _hoisted_4, [\n renderSlot(_ctx.$slots, \"actions\", {}, () => [\n (openBlock(true), createElementBlock(Fragment, null, renderList(__props.buttons, (button, idx) => {\n return openBlock(), createBlock(unref(_sfc_main$1), mergeProps({ key: idx }, { ref_for: true }, button, {\n onClick: (_, result) => handleButtonClose(button, result)\n }), null, 16, [\"onClick\"]);\n }), 128))\n ], true)\n ])\n ]),\n _: 3\n }, 16, [\"class\"]))\n ]),\n _: 3\n }, 16)) : createCommentVNode(\"\", true);\n };\n }\n});\nconst NcDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-24e91b99\"]]);\nexport {\n NcDialog as N\n};\n//# sourceMappingURL=NcDialog.mjs.map\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcInputField.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcInputField.css\";\n export default content && content.locals ? content.locals : undefined;\n","import '../assets/NcInputField.css';\nimport { defineComponent, useModel, useAttrs, useTemplateRef, computed, warn, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, mergeProps, toDisplayString, createCommentVNode, withDirectives, renderSlot, vShow, createBlock, withCtx, createTextVNode, mergeModels } from \"vue\";\nimport { d as mdiCheck, j as mdiAlertCircleOutline } from \"./mdi.mjs\";\nimport { N as NcButton } from \"./NcButton.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper.mjs\";\nimport { c as createElementId } from \"./createElementId.mjs\";\nimport { a as isLegacy } from \"./legacy.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\nconst _hoisted_1 = { class: \"input-field__main-wrapper\" };\nconst _hoisted_2 = [\"id\", \"aria-describedby\", \"disabled\", \"placeholder\", \"type\", \"value\"];\nconst _hoisted_3 = [\"for\"];\nconst _hoisted_4 = { class: \"input-field__icon input-field__icon--leading\" };\nconst _hoisted_5 = {\n key: 2,\n class: \"input-field__icon input-field__icon--trailing\"\n};\nconst _hoisted_6 = [\"id\"];\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...{\n inheritAttrs: false\n },\n __name: \"NcInputField\",\n props: /* @__PURE__ */ mergeModels({\n class: { default: \"\" },\n inputClass: { default: \"\" },\n id: { default: () => createElementId() },\n label: { default: void 0 },\n labelOutside: { type: Boolean },\n type: { default: \"text\" },\n placeholder: { default: void 0 },\n showTrailingButton: { type: Boolean },\n trailingButtonLabel: { default: void 0 },\n success: { type: Boolean },\n error: { type: Boolean },\n helperText: { default: \"\" },\n disabled: { type: Boolean },\n pill: { type: Boolean }\n }, {\n \"modelValue\": { required: true },\n \"modelModifiers\": {}\n }),\n emits: /* @__PURE__ */ mergeModels([\"trailingButtonClick\"], [\"update:modelValue\"]),\n setup(__props, { expose: __expose, emit: __emit }) {\n const modelValue = useModel(__props, \"modelValue\");\n const props = __props;\n const emit = __emit;\n __expose({\n focus,\n select\n });\n const attrs = useAttrs();\n const inputElement = useTemplateRef(\"input\");\n const hasTrailingIcon = computed(() => props.showTrailingButton || props.success);\n const internalPlaceholder = computed(() => {\n if (props.placeholder) {\n return props.placeholder;\n }\n if (props.label) {\n return isLegacy ? props.label : \"\";\n }\n return void 0;\n });\n const isValidLabel = computed(() => {\n const isValidLabel2 = props.label || props.labelOutside;\n if (!isValidLabel2) {\n warn(\"You need to add a label to the NcInputField component. Either use the prop label or use an external one, as per the example in the documentation.\");\n }\n return isValidLabel2;\n });\n const ariaDescribedby = computed(() => {\n const ariaDescribedby2 = [];\n if (props.helperText) {\n ariaDescribedby2.push(`${props.id}-helper-text`);\n }\n if (attrs[\"aria-describedby\"]) {\n ariaDescribedby2.push(String(attrs[\"aria-describedby\"]));\n }\n return ariaDescribedby2.join(\" \") || void 0;\n });\n function focus(options) {\n inputElement.value.focus(options);\n }\n function select() {\n inputElement.value.select();\n }\n function handleInput(event) {\n const target = event.target;\n modelValue.value = props.type === \"number\" && typeof modelValue.value === \"number\" ? parseFloat(target.value) : target.value;\n }\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass([\"input-field\", [{\n \"input-field--disabled\": __props.disabled,\n \"input-field--error\": __props.error,\n \"input-field--label-outside\": __props.labelOutside || !isValidLabel.value,\n \"input-field--leading-icon\": !!_ctx.$slots.icon,\n \"input-field--trailing-icon\": hasTrailingIcon.value,\n \"input-field--pill\": __props.pill,\n \"input-field--success\": __props.success,\n \"input-field--legacy\": unref(isLegacy)\n }, _ctx.$props.class]])\n }, [\n createElementVNode(\"div\", _hoisted_1, [\n createElementVNode(\"input\", mergeProps(_ctx.$attrs, {\n id: __props.id,\n ref: \"input\",\n \"aria-describedby\": ariaDescribedby.value,\n \"aria-live\": \"polite\",\n class: [\"input-field__input\", __props.inputClass],\n disabled: __props.disabled,\n placeholder: internalPlaceholder.value,\n type: __props.type,\n value: modelValue.value.toString(),\n onInput: handleInput\n }), null, 16, _hoisted_2),\n !__props.labelOutside && isValidLabel.value ? (openBlock(), createElementBlock(\"label\", {\n key: 0,\n class: \"input-field__label\",\n for: __props.id\n }, toDisplayString(__props.label), 9, _hoisted_3)) : createCommentVNode(\"\", true),\n withDirectives(createElementVNode(\"div\", _hoisted_4, [\n renderSlot(_ctx.$slots, \"icon\", {}, void 0, true)\n ], 512), [\n [vShow, !!_ctx.$slots.icon]\n ]),\n __props.showTrailingButton ? (openBlock(), createBlock(NcButton, {\n key: 1,\n class: \"input-field__trailing-button\",\n \"aria-label\": __props.trailingButtonLabel,\n disabled: __props.disabled,\n variant: \"tertiary-no-background\",\n onClick: _cache[0] || (_cache[0] = ($event) => emit(\"trailingButtonClick\", $event))\n }, {\n icon: withCtx(() => [\n renderSlot(_ctx.$slots, \"trailing-button-icon\", {}, void 0, true)\n ]),\n _: 3\n }, 8, [\"aria-label\", \"disabled\"])) : __props.success || __props.error ? (openBlock(), createElementBlock(\"div\", _hoisted_5, [\n __props.success ? (openBlock(), createBlock(NcIconSvgWrapper, {\n key: 0,\n path: unref(mdiCheck)\n }, null, 8, [\"path\"])) : (openBlock(), createBlock(NcIconSvgWrapper, {\n key: 1,\n path: unref(mdiAlertCircleOutline)\n }, null, 8, [\"path\"]))\n ])) : createCommentVNode(\"\", true)\n ]),\n __props.helperText ? (openBlock(), createElementBlock(\"p\", {\n key: 0,\n id: `${__props.id}-helper-text`,\n class: \"input-field__helper-text-message\"\n }, [\n __props.success ? (openBlock(), createBlock(NcIconSvgWrapper, {\n key: 0,\n class: \"input-field__helper-text-message__icon\",\n path: unref(mdiCheck),\n inline: \"\"\n }, null, 8, [\"path\"])) : __props.error ? (openBlock(), createBlock(NcIconSvgWrapper, {\n key: 1,\n class: \"input-field__helper-text-message__icon\",\n path: unref(mdiAlertCircleOutline),\n inline: \"\"\n }, null, 8, [\"path\"])) : createCommentVNode(\"\", true),\n createTextVNode(\" \" + toDisplayString(__props.helperText), 1)\n ], 8, _hoisted_6)) : createCommentVNode(\"\", true)\n ], 2);\n };\n }\n});\nconst NcInputField = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-feb04bef\"]]);\nexport {\n NcInputField as N\n};\n//# sourceMappingURL=NcInputField.mjs.map\n","/*!\n * qrcode.vue v3.11.0\n * A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3\n * © 2017-PRESENT @scopewu(https://github.com/scopewu)\n * @license MIT.\n */\nimport { defineComponent, ref, computed, h, onMounted, watchEffect, Fragment } from 'vue';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\n/*\n * QR Code generator library (TypeScript)\n *\n * Copyright (c) Project Nayuki. (MIT License)\n * https://www.nayuki.io/page/qr-code-generator-library\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n * - The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * - The Software is provided \"as is\", without warranty of any kind, express or\n * implied, including but not limited to the warranties of merchantability,\n * fitness for a particular purpose and noninfringement. In no event shall the\n * authors or copyright holders be liable for any claim, damages or other\n * liability, whether in an action of contract, tort or otherwise, arising from,\n * out of or in connection with the Software or the use or other dealings in the\n * Software.\n */\nvar qrcodegen;\n(function (qrcodegen) {\n /*---- QR Code symbol class ----*/\n /*\n * A QR Code symbol, which is a type of two-dimension barcode.\n * Invented by Denso Wave and described in the ISO/IEC 18004 standard.\n * Instances of this class represent an immutable square grid of dark and light cells.\n * The class provides static factory functions to create a QR Code from text or binary data.\n * The class covers the QR Code Model 2 specification, supporting all versions (sizes)\n * from 1 to 40, all 4 error correction levels, and 4 character encoding modes.\n *\n * Ways to create a QR Code object:\n * - High level: Take the payload data and call QrCode.encodeText() or QrCode.encodeBinary().\n * - Mid level: Custom-make the list of segments and call QrCode.encodeSegments().\n * - Low level: Custom-make the array of data codeword bytes (including\n * segment headers and final padding, excluding error correction codewords),\n * supply the appropriate version number, and call the QrCode() constructor.\n * (Note that all ways require supplying the desired error correction level.)\n */\n var QrCode = /** @class */ (function () {\n /*-- Constructor (low level) and fields --*/\n // Creates a new QR Code with the given version number,\n // error correction level, data codeword bytes, and mask number.\n // This is a low-level API that most users should not use directly.\n // A mid-level API is the encodeSegments() function.\n function QrCode(\n // The version number of this QR Code, which is between 1 and 40 (inclusive).\n // This determines the size of this barcode.\n version, \n // The error correction level used in this QR Code.\n errorCorrectionLevel, dataCodewords, msk) {\n this.version = version;\n this.errorCorrectionLevel = errorCorrectionLevel;\n // The modules of this QR Code (false = light, true = dark).\n // Immutable after constructor finishes. Accessed through getModule().\n this.modules = [];\n // Indicates function modules that are not subjected to masking. Discarded when constructor finishes.\n this.isFunction = [];\n // Check scalar arguments\n if (version < QrCode.MIN_VERSION || version > QrCode.MAX_VERSION)\n throw new RangeError(\"Version value out of range\");\n if (msk < -1 || msk > 7)\n throw new RangeError(\"Mask value out of range\");\n this.size = version * 4 + 17;\n // Initialize both grids to be size*size arrays of Boolean false\n var row = [];\n for (var i = 0; i < this.size; i++)\n row.push(false);\n for (var i = 0; i < this.size; i++) {\n this.modules.push(row.slice()); // Initially all light\n this.isFunction.push(row.slice());\n }\n // Compute ECC, draw modules\n this.drawFunctionPatterns();\n var allCodewords = this.addEccAndInterleave(dataCodewords);\n this.drawCodewords(allCodewords);\n // Do masking\n if (msk == -1) { // Automatically choose best mask\n var minPenalty = 1000000000;\n for (var i = 0; i < 8; i++) {\n this.applyMask(i);\n this.drawFormatBits(i);\n var penalty = this.getPenaltyScore();\n if (penalty < minPenalty) {\n msk = i;\n minPenalty = penalty;\n }\n this.applyMask(i); // Undoes the mask due to XOR\n }\n }\n assert(0 <= msk && msk <= 7);\n this.mask = msk;\n this.applyMask(msk); // Apply the final choice of mask\n this.drawFormatBits(msk); // Overwrite old format bits\n this.isFunction = [];\n }\n /*-- Static factory functions (high level) --*/\n // Returns a QR Code representing the given Unicode text string at the given error correction level.\n // As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer\n // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible\n // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the\n // ecl argument if it can be done without increasing the version.\n QrCode.encodeText = function (text, ecl) {\n var segs = qrcodegen.QrSegment.makeSegments(text);\n return QrCode.encodeSegments(segs, ecl);\n };\n // Returns a QR Code representing the given binary data at the given error correction level.\n // This function always encodes using the binary segment mode, not any text mode. The maximum number of\n // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.\n // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.\n QrCode.encodeBinary = function (data, ecl) {\n var seg = qrcodegen.QrSegment.makeBytes(data);\n return QrCode.encodeSegments([seg], ecl);\n };\n /*-- Static factory functions (mid level) --*/\n // Returns a QR Code representing the given segments with the given encoding parameters.\n // The smallest possible QR Code version within the given range is automatically\n // chosen for the output. Iff boostEcl is true, then the ECC level of the result\n // may be higher than the ecl argument if it can be done without increasing the\n // version. The mask number is either between 0 to 7 (inclusive) to force that\n // mask, or -1 to automatically choose an appropriate mask (which may be slow).\n // This function allows the user to create a custom sequence of segments that switches\n // between modes (such as alphanumeric and byte) to encode text in less space.\n // This is a mid-level API; the high-level API is encodeText() and encodeBinary().\n QrCode.encodeSegments = function (segs, ecl, minVersion, maxVersion, mask, boostEcl) {\n if (minVersion === void 0) { minVersion = 1; }\n if (maxVersion === void 0) { maxVersion = 40; }\n if (mask === void 0) { mask = -1; }\n if (boostEcl === void 0) { boostEcl = true; }\n if (!(QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= QrCode.MAX_VERSION)\n || mask < -1 || mask > 7)\n throw new RangeError(\"Invalid value\");\n // Find the minimal version number to use\n var version;\n var dataUsedBits;\n for (version = minVersion;; version++) {\n var dataCapacityBits_1 = QrCode.getNumDataCodewords(version, ecl) * 8; // Number of data bits available\n var usedBits = QrSegment.getTotalBits(segs, version);\n if (usedBits <= dataCapacityBits_1) {\n dataUsedBits = usedBits;\n break; // This version number is found to be suitable\n }\n if (version >= maxVersion) // All versions in the range could not fit the given data\n throw new RangeError(\"Data too long\");\n }\n // Increase the error correction level while the data still fits in the current version number\n for (var _i = 0, _a = [QrCode.Ecc.MEDIUM, QrCode.Ecc.QUARTILE, QrCode.Ecc.HIGH]; _i < _a.length; _i++) { // From low to high\n var newEcl = _a[_i];\n if (boostEcl && dataUsedBits <= QrCode.getNumDataCodewords(version, newEcl) * 8)\n ecl = newEcl;\n }\n // Concatenate all segments to create the data bit string\n var bb = [];\n for (var _b = 0, segs_1 = segs; _b < segs_1.length; _b++) {\n var seg = segs_1[_b];\n appendBits(seg.mode.modeBits, 4, bb);\n appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);\n for (var _c = 0, _d = seg.getData(); _c < _d.length; _c++) {\n var b = _d[_c];\n bb.push(b);\n }\n }\n assert(bb.length == dataUsedBits);\n // Add terminator and pad up to a byte if applicable\n var dataCapacityBits = QrCode.getNumDataCodewords(version, ecl) * 8;\n assert(bb.length <= dataCapacityBits);\n appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);\n appendBits(0, (8 - bb.length % 8) % 8, bb);\n assert(bb.length % 8 == 0);\n // Pad with alternating bytes until data capacity is reached\n for (var padByte = 0xEC; bb.length < dataCapacityBits; padByte ^= 0xEC ^ 0x11)\n appendBits(padByte, 8, bb);\n // Pack bits into bytes in big endian\n var dataCodewords = [];\n while (dataCodewords.length * 8 < bb.length)\n dataCodewords.push(0);\n bb.forEach(function (b, i) {\n return dataCodewords[i >>> 3] |= b << (7 - (i & 7));\n });\n // Create the QR Code object\n return new QrCode(version, ecl, dataCodewords, mask);\n };\n /*-- Accessor methods --*/\n // Returns the color of the module (pixel) at the given coordinates, which is false\n // for light or true for dark. The top left corner has the coordinates (x=0, y=0).\n // If the given coordinates are out of bounds, then false (light) is returned.\n QrCode.prototype.getModule = function (x, y) {\n return 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];\n };\n QrCode.prototype.getModules = function () {\n return this.modules;\n };\n /*-- Private helper methods for constructor: Drawing function modules --*/\n // Reads this object's version field, and draws and marks all function modules.\n QrCode.prototype.drawFunctionPatterns = function () {\n // Draw horizontal and vertical timing patterns\n for (var i = 0; i < this.size; i++) {\n this.setFunctionModule(6, i, i % 2 == 0);\n this.setFunctionModule(i, 6, i % 2 == 0);\n }\n // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules)\n this.drawFinderPattern(3, 3);\n this.drawFinderPattern(this.size - 4, 3);\n this.drawFinderPattern(3, this.size - 4);\n // Draw numerous alignment patterns\n var alignPatPos = this.getAlignmentPatternPositions();\n var numAlign = alignPatPos.length;\n for (var i = 0; i < numAlign; i++) {\n for (var j = 0; j < numAlign; j++) {\n // Don't draw on the three finder corners\n if (!(i == 0 && j == 0 || i == 0 && j == numAlign - 1 || i == numAlign - 1 && j == 0))\n this.drawAlignmentPattern(alignPatPos[i], alignPatPos[j]);\n }\n }\n // Draw configuration data\n this.drawFormatBits(0); // Dummy mask value; overwritten later in the constructor\n this.drawVersion();\n };\n // Draws two copies of the format bits (with its own error correction code)\n // based on the given mask and this object's error correction level field.\n QrCode.prototype.drawFormatBits = function (mask) {\n // Calculate error correction code and pack bits\n var data = this.errorCorrectionLevel.formatBits << 3 | mask; // errCorrLvl is uint2, mask is uint3\n var rem = data;\n for (var i = 0; i < 10; i++)\n rem = (rem << 1) ^ ((rem >>> 9) * 0x537);\n var bits = (data << 10 | rem) ^ 0x5412; // uint15\n assert(bits >>> 15 == 0);\n // Draw first copy\n for (var i = 0; i <= 5; i++)\n this.setFunctionModule(8, i, getBit(bits, i));\n this.setFunctionModule(8, 7, getBit(bits, 6));\n this.setFunctionModule(8, 8, getBit(bits, 7));\n this.setFunctionModule(7, 8, getBit(bits, 8));\n for (var i = 9; i < 15; i++)\n this.setFunctionModule(14 - i, 8, getBit(bits, i));\n // Draw second copy\n for (var i = 0; i < 8; i++)\n this.setFunctionModule(this.size - 1 - i, 8, getBit(bits, i));\n for (var i = 8; i < 15; i++)\n this.setFunctionModule(8, this.size - 15 + i, getBit(bits, i));\n this.setFunctionModule(8, this.size - 8, true); // Always dark\n };\n // Draws two copies of the version bits (with its own error correction code),\n // based on this object's version field, iff 7 <= version <= 40.\n QrCode.prototype.drawVersion = function () {\n if (this.version < 7)\n return;\n // Calculate error correction code and pack bits\n var rem = this.version; // version is uint6, in the range [7, 40]\n for (var i = 0; i < 12; i++)\n rem = (rem << 1) ^ ((rem >>> 11) * 0x1F25);\n var bits = this.version << 12 | rem; // uint18\n assert(bits >>> 18 == 0);\n // Draw two copies\n for (var i = 0; i < 18; i++) {\n var color = getBit(bits, i);\n var a = this.size - 11 + i % 3;\n var b = Math.floor(i / 3);\n this.setFunctionModule(a, b, color);\n this.setFunctionModule(b, a, color);\n }\n };\n // Draws a 9*9 finder pattern including the border separator,\n // with the center module at (x, y). Modules can be out of bounds.\n QrCode.prototype.drawFinderPattern = function (x, y) {\n for (var dy = -4; dy <= 4; dy++) {\n for (var dx = -4; dx <= 4; dx++) {\n var dist = Math.max(Math.abs(dx), Math.abs(dy)); // Chebyshev/infinity norm\n var xx = x + dx;\n var yy = y + dy;\n if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size)\n this.setFunctionModule(xx, yy, dist != 2 && dist != 4);\n }\n }\n };\n // Draws a 5*5 alignment pattern, with the center module\n // at (x, y). All modules must be in bounds.\n QrCode.prototype.drawAlignmentPattern = function (x, y) {\n for (var dy = -2; dy <= 2; dy++) {\n for (var dx = -2; dx <= 2; dx++)\n this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);\n }\n };\n // Sets the color of a module and marks it as a function module.\n // Only used by the constructor. Coordinates must be in bounds.\n QrCode.prototype.setFunctionModule = function (x, y, isDark) {\n this.modules[y][x] = isDark;\n this.isFunction[y][x] = true;\n };\n /*-- Private helper methods for constructor: Codewords and masking --*/\n // Returns a new byte string representing the given data with the appropriate error correction\n // codewords appended to it, based on this object's version and error correction level.\n QrCode.prototype.addEccAndInterleave = function (data) {\n var ver = this.version;\n var ecl = this.errorCorrectionLevel;\n if (data.length != QrCode.getNumDataCodewords(ver, ecl))\n throw new RangeError(\"Invalid argument\");\n // Calculate parameter numbers\n var numBlocks = QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n var blockEccLen = QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];\n var rawCodewords = Math.floor(QrCode.getNumRawDataModules(ver) / 8);\n var numShortBlocks = numBlocks - rawCodewords % numBlocks;\n var shortBlockLen = Math.floor(rawCodewords / numBlocks);\n // Split data into blocks and append ECC to each block\n var blocks = [];\n var rsDiv = QrCode.reedSolomonComputeDivisor(blockEccLen);\n for (var i = 0, k = 0; i < numBlocks; i++) {\n var dat = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));\n k += dat.length;\n var ecc = QrCode.reedSolomonComputeRemainder(dat, rsDiv);\n if (i < numShortBlocks)\n dat.push(0);\n blocks.push(dat.concat(ecc));\n }\n // Interleave (not concatenate) the bytes from every block into a single sequence\n var result = [];\n var _loop_1 = function (i) {\n blocks.forEach(function (block, j) {\n // Skip the padding byte in short blocks\n if (i != shortBlockLen - blockEccLen || j >= numShortBlocks)\n result.push(block[i]);\n });\n };\n for (var i = 0; i < blocks[0].length; i++) {\n _loop_1(i);\n }\n assert(result.length == rawCodewords);\n return result;\n };\n // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire\n // data area of this QR Code. Function modules need to be marked off before this is called.\n QrCode.prototype.drawCodewords = function (data) {\n if (data.length != Math.floor(QrCode.getNumRawDataModules(this.version) / 8))\n throw new RangeError(\"Invalid argument\");\n var i = 0; // Bit index into the data\n // Do the funny zigzag scan\n for (var right = this.size - 1; right >= 1; right -= 2) { // Index of right column in each column pair\n if (right == 6)\n right = 5;\n for (var vert = 0; vert < this.size; vert++) { // Vertical counter\n for (var j = 0; j < 2; j++) {\n var x = right - j; // Actual x coordinate\n var upward = ((right + 1) & 2) == 0;\n var y = upward ? this.size - 1 - vert : vert; // Actual y coordinate\n if (!this.isFunction[y][x] && i < data.length * 8) {\n this.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));\n i++;\n }\n // If this QR Code has any remainder bits (0 to 7), they were assigned as\n // 0/false/light by the constructor and are left unchanged by this method\n }\n }\n }\n assert(i == data.length * 8);\n };\n // XORs the codeword modules in this QR Code with the given mask pattern.\n // The function modules must be marked and the codeword bits must be drawn\n // before masking. Due to the arithmetic of XOR, calling applyMask() with\n // the same mask value a second time will undo the mask. A final well-formed\n // QR Code needs exactly one (not zero, two, etc.) mask applied.\n QrCode.prototype.applyMask = function (mask) {\n if (mask < 0 || mask > 7)\n throw new RangeError(\"Mask value out of range\");\n for (var y = 0; y < this.size; y++) {\n for (var x = 0; x < this.size; x++) {\n var invert = void 0;\n switch (mask) {\n case 0:\n invert = (x + y) % 2 == 0;\n break;\n case 1:\n invert = y % 2 == 0;\n break;\n case 2:\n invert = x % 3 == 0;\n break;\n case 3:\n invert = (x + y) % 3 == 0;\n break;\n case 4:\n invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0;\n break;\n case 5:\n invert = x * y % 2 + x * y % 3 == 0;\n break;\n case 6:\n invert = (x * y % 2 + x * y % 3) % 2 == 0;\n break;\n case 7:\n invert = ((x + y) % 2 + x * y % 3) % 2 == 0;\n break;\n default: throw new Error(\"Unreachable\");\n }\n if (!this.isFunction[y][x] && invert)\n this.modules[y][x] = !this.modules[y][x];\n }\n }\n };\n // Calculates and returns the penalty score based on state of this QR Code's current modules.\n // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.\n QrCode.prototype.getPenaltyScore = function () {\n var result = 0;\n // Adjacent modules in row having same color, and finder-like patterns\n for (var y = 0; y < this.size; y++) {\n var runColor = false;\n var runX = 0;\n var runHistory = [0, 0, 0, 0, 0, 0, 0];\n for (var x = 0; x < this.size; x++) {\n if (this.modules[y][x] == runColor) {\n runX++;\n if (runX == 5)\n result += QrCode.PENALTY_N1;\n else if (runX > 5)\n result++;\n }\n else {\n this.finderPenaltyAddHistory(runX, runHistory);\n if (!runColor)\n result += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;\n runColor = this.modules[y][x];\n runX = 1;\n }\n }\n result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * QrCode.PENALTY_N3;\n }\n // Adjacent modules in column having same color, and finder-like patterns\n for (var x = 0; x < this.size; x++) {\n var runColor = false;\n var runY = 0;\n var runHistory = [0, 0, 0, 0, 0, 0, 0];\n for (var y = 0; y < this.size; y++) {\n if (this.modules[y][x] == runColor) {\n runY++;\n if (runY == 5)\n result += QrCode.PENALTY_N1;\n else if (runY > 5)\n result++;\n }\n else {\n this.finderPenaltyAddHistory(runY, runHistory);\n if (!runColor)\n result += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;\n runColor = this.modules[y][x];\n runY = 1;\n }\n }\n result += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * QrCode.PENALTY_N3;\n }\n // 2*2 blocks of modules having same color\n for (var y = 0; y < this.size - 1; y++) {\n for (var x = 0; x < this.size - 1; x++) {\n var color = this.modules[y][x];\n if (color == this.modules[y][x + 1] &&\n color == this.modules[y + 1][x] &&\n color == this.modules[y + 1][x + 1])\n result += QrCode.PENALTY_N2;\n }\n }\n // Balance of dark and light modules\n var dark = 0;\n for (var _i = 0, _a = this.modules; _i < _a.length; _i++) {\n var row = _a[_i];\n dark = row.reduce(function (sum, color) { return sum + (color ? 1 : 0); }, dark);\n }\n var total = this.size * this.size; // Note that size is odd, so dark/total != 1/2\n // Compute the smallest integer k >= 0 such that (45-5k)% <= dark/total <= (55+5k)%\n var k = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;\n assert(0 <= k && k <= 9);\n result += k * QrCode.PENALTY_N4;\n assert(0 <= result && result <= 2568888); // Non-tight upper bound based on default values of PENALTY_N1, ..., N4\n return result;\n };\n /*-- Private helper functions --*/\n // Returns an ascending list of positions of alignment patterns for this version number.\n // Each position is in the range [0,177), and are used on both the x and y axes.\n // This could be implemented as lookup table of 40 variable-length lists of integers.\n QrCode.prototype.getAlignmentPatternPositions = function () {\n if (this.version == 1)\n return [];\n else {\n var numAlign = Math.floor(this.version / 7) + 2;\n var step = Math.floor((this.version * 8 + numAlign * 3 + 5) / (numAlign * 4 - 4)) * 2;\n var result = [6];\n for (var pos = this.size - 7; result.length < numAlign; pos -= step)\n result.splice(1, 0, pos);\n return result;\n }\n };\n // Returns the number of data bits that can be stored in a QR Code of the given version number, after\n // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.\n // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.\n QrCode.getNumRawDataModules = function (ver) {\n if (ver < QrCode.MIN_VERSION || ver > QrCode.MAX_VERSION)\n throw new RangeError(\"Version number out of range\");\n var result = (16 * ver + 128) * ver + 64;\n if (ver >= 2) {\n var numAlign = Math.floor(ver / 7) + 2;\n result -= (25 * numAlign - 10) * numAlign - 55;\n if (ver >= 7)\n result -= 36;\n }\n assert(208 <= result && result <= 29648);\n return result;\n };\n // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any\n // QR Code of the given version number and error correction level, with remainder bits discarded.\n // This stateless pure function could be implemented as a (40*4)-cell lookup table.\n QrCode.getNumDataCodewords = function (ver, ecl) {\n return Math.floor(QrCode.getNumRawDataModules(ver) / 8) -\n QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] *\n QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n };\n // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be\n // implemented as a lookup table over all possible parameter values, instead of as an algorithm.\n QrCode.reedSolomonComputeDivisor = function (degree) {\n if (degree < 1 || degree > 255)\n throw new RangeError(\"Degree out of range\");\n // Polynomial coefficients are stored from highest to lowest power, excluding the leading term which is always 1.\n // For example the polynomial x^3 + 255x^2 + 8x + 93 is stored as the uint8 array [255, 8, 93].\n var result = [];\n for (var i = 0; i < degree - 1; i++)\n result.push(0);\n result.push(1); // Start off with the monomial x^0\n // Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}),\n // and drop the highest monomial term which is always 1x^degree.\n // Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D).\n var root = 1;\n for (var i = 0; i < degree; i++) {\n // Multiply the current product by (x - r^i)\n for (var j = 0; j < result.length; j++) {\n result[j] = QrCode.reedSolomonMultiply(result[j], root);\n if (j + 1 < result.length)\n result[j] ^= result[j + 1];\n }\n root = QrCode.reedSolomonMultiply(root, 0x02);\n }\n return result;\n };\n // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.\n QrCode.reedSolomonComputeRemainder = function (data, divisor) {\n var result = divisor.map(function (_) { return 0; });\n var _loop_2 = function (b) {\n var factor = b ^ result.shift();\n result.push(0);\n divisor.forEach(function (coef, i) {\n return result[i] ^= QrCode.reedSolomonMultiply(coef, factor);\n });\n };\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var b = data_1[_i];\n _loop_2(b);\n }\n return result;\n };\n // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result\n // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.\n QrCode.reedSolomonMultiply = function (x, y) {\n if (x >>> 8 != 0 || y >>> 8 != 0)\n throw new RangeError(\"Byte out of range\");\n // Russian peasant multiplication\n var z = 0;\n for (var i = 7; i >= 0; i--) {\n z = (z << 1) ^ ((z >>> 7) * 0x11D);\n z ^= ((y >>> i) & 1) * x;\n }\n assert(z >>> 8 == 0);\n return z;\n };\n // Can only be called immediately after a light run is added, and\n // returns either 0, 1, or 2. A helper function for getPenaltyScore().\n QrCode.prototype.finderPenaltyCountPatterns = function (runHistory) {\n var n = runHistory[1];\n assert(n <= this.size * 3);\n var core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;\n return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0)\n + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);\n };\n // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().\n QrCode.prototype.finderPenaltyTerminateAndCount = function (currentRunColor, currentRunLength, runHistory) {\n if (currentRunColor) { // Terminate dark run\n this.finderPenaltyAddHistory(currentRunLength, runHistory);\n currentRunLength = 0;\n }\n currentRunLength += this.size; // Add light border to final run\n this.finderPenaltyAddHistory(currentRunLength, runHistory);\n return this.finderPenaltyCountPatterns(runHistory);\n };\n // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().\n QrCode.prototype.finderPenaltyAddHistory = function (currentRunLength, runHistory) {\n if (runHistory[0] == 0)\n currentRunLength += this.size; // Add light border to initial run\n runHistory.pop();\n runHistory.unshift(currentRunLength);\n };\n /*-- Constants and tables --*/\n // The minimum version number supported in the QR Code Model 2 standard.\n QrCode.MIN_VERSION = 1;\n // The maximum version number supported in the QR Code Model 2 standard.\n QrCode.MAX_VERSION = 40;\n // For use in getPenaltyScore(), when evaluating which mask is best.\n QrCode.PENALTY_N1 = 3;\n QrCode.PENALTY_N2 = 3;\n QrCode.PENALTY_N3 = 40;\n QrCode.PENALTY_N4 = 10;\n QrCode.ECC_CODEWORDS_PER_BLOCK = [\n // Version: (note that index 0 is for padding, and is set to an illegal value)\n //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level\n [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // Low\n [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28], // Medium\n [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // Quartile\n [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // High\n ];\n QrCode.NUM_ERROR_CORRECTION_BLOCKS = [\n // Version: (note that index 0 is for padding, and is set to an illegal value)\n //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level\n [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25], // Low\n [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49], // Medium\n [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68], // Quartile\n [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81], // High\n ];\n return QrCode;\n }());\n qrcodegen.QrCode = QrCode;\n // Appends the given number of low-order bits of the given value\n // to the given buffer. Requires 0 <= len <= 31 and 0 <= val < 2^len.\n function appendBits(val, len, bb) {\n if (len < 0 || len > 31 || val >>> len != 0)\n throw new RangeError(\"Value out of range\");\n for (var i = len - 1; i >= 0; i--) // Append bit by bit\n bb.push((val >>> i) & 1);\n }\n // Returns true iff the i'th bit of x is set to 1.\n function getBit(x, i) {\n return ((x >>> i) & 1) != 0;\n }\n // Throws an exception if the given condition is false.\n function assert(cond) {\n if (!cond)\n throw new Error(\"Assertion error\");\n }\n /*---- Data segment class ----*/\n /*\n * A segment of character/binary/control data in a QR Code symbol.\n * Instances of this class are immutable.\n * The mid-level way to create a segment is to take the payload data\n * and call a static factory function such as QrSegment.makeNumeric().\n * The low-level way to create a segment is to custom-make the bit buffer\n * and call the QrSegment() constructor with appropriate values.\n * This segment class imposes no length restrictions, but QR Codes have restrictions.\n * Even in the most favorable conditions, a QR Code can only hold 7089 characters of data.\n * Any segment longer than this is meaningless for the purpose of generating QR Codes.\n */\n var QrSegment = /** @class */ (function () {\n /*-- Constructor (low level) and fields --*/\n // Creates a new QR Code segment with the given attributes and data.\n // The character count (numChars) must agree with the mode and the bit buffer length,\n // but the constraint isn't checked. The given bit buffer is cloned and stored.\n function QrSegment(\n // The mode indicator of this segment.\n mode, \n // The length of this segment's unencoded data. Measured in characters for\n // numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode.\n // Always zero or positive. Not the same as the data's bit length.\n numChars, \n // The data bits of this segment. Accessed through getData().\n bitData) {\n this.mode = mode;\n this.numChars = numChars;\n this.bitData = bitData;\n if (numChars < 0)\n throw new RangeError(\"Invalid argument\");\n this.bitData = bitData.slice(); // Make defensive copy\n }\n /*-- Static factory functions (mid level) --*/\n // Returns a segment representing the given binary data encoded in\n // byte mode. All input byte arrays are acceptable. Any text string\n // can be converted to UTF-8 bytes and encoded as a byte mode segment.\n QrSegment.makeBytes = function (data) {\n var bb = [];\n for (var _i = 0, data_2 = data; _i < data_2.length; _i++) {\n var b = data_2[_i];\n appendBits(b, 8, bb);\n }\n return new QrSegment(QrSegment.Mode.BYTE, data.length, bb);\n };\n // Returns a segment representing the given string of decimal digits encoded in numeric mode.\n QrSegment.makeNumeric = function (digits) {\n if (!QrSegment.isNumeric(digits))\n throw new RangeError(\"String contains non-numeric characters\");\n var bb = [];\n for (var i = 0; i < digits.length;) { // Consume up to 3 digits per iteration\n var n = Math.min(digits.length - i, 3);\n appendBits(parseInt(digits.substring(i, i + n), 10), n * 3 + 1, bb);\n i += n;\n }\n return new QrSegment(QrSegment.Mode.NUMERIC, digits.length, bb);\n };\n // Returns a segment representing the given text string encoded in alphanumeric mode.\n // The characters allowed are: 0 to 9, A to Z (uppercase only), space,\n // dollar, percent, asterisk, plus, hyphen, period, slash, colon.\n QrSegment.makeAlphanumeric = function (text) {\n if (!QrSegment.isAlphanumeric(text))\n throw new RangeError(\"String contains unencodable characters in alphanumeric mode\");\n var bb = [];\n var i;\n for (i = 0; i + 2 <= text.length; i += 2) { // Process groups of 2\n var temp = QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;\n temp += QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));\n appendBits(temp, 11, bb);\n }\n if (i < text.length) // 1 character remaining\n appendBits(QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);\n return new QrSegment(QrSegment.Mode.ALPHANUMERIC, text.length, bb);\n };\n // Returns a new mutable list of zero or more segments to represent the given Unicode text string.\n // The result may use various segment modes and switch modes to optimize the length of the bit stream.\n QrSegment.makeSegments = function (text) {\n // Select the most efficient segment encoding automatically\n if (text == \"\")\n return [];\n else if (QrSegment.isNumeric(text))\n return [QrSegment.makeNumeric(text)];\n else if (QrSegment.isAlphanumeric(text))\n return [QrSegment.makeAlphanumeric(text)];\n else\n return [QrSegment.makeBytes(QrSegment.toUtf8ByteArray(text))];\n };\n // Returns a segment representing an Extended Channel Interpretation\n // (ECI) designator with the given assignment value.\n QrSegment.makeEci = function (assignVal) {\n var bb = [];\n if (assignVal < 0)\n throw new RangeError(\"ECI assignment value out of range\");\n else if (assignVal < (1 << 7))\n appendBits(assignVal, 8, bb);\n else if (assignVal < (1 << 14)) {\n appendBits(2, 2, bb);\n appendBits(assignVal, 14, bb);\n }\n else if (assignVal < 1000000) {\n appendBits(6, 3, bb);\n appendBits(assignVal, 21, bb);\n }\n else\n throw new RangeError(\"ECI assignment value out of range\");\n return new QrSegment(QrSegment.Mode.ECI, 0, bb);\n };\n // Tests whether the given string can be encoded as a segment in numeric mode.\n // A string is encodable iff each character is in the range 0 to 9.\n QrSegment.isNumeric = function (text) {\n return QrSegment.NUMERIC_REGEX.test(text);\n };\n // Tests whether the given string can be encoded as a segment in alphanumeric mode.\n // A string is encodable iff each character is in the following set: 0 to 9, A to Z\n // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.\n QrSegment.isAlphanumeric = function (text) {\n return QrSegment.ALPHANUMERIC_REGEX.test(text);\n };\n /*-- Methods --*/\n // Returns a new copy of the data bits of this segment.\n QrSegment.prototype.getData = function () {\n return this.bitData.slice(); // Make defensive copy\n };\n // (Package-private) Calculates and returns the number of bits needed to encode the given segments at\n // the given version. The result is infinity if a segment has too many characters to fit its length field.\n QrSegment.getTotalBits = function (segs, version) {\n var result = 0;\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n var ccbits = seg.mode.numCharCountBits(version);\n if (seg.numChars >= (1 << ccbits))\n return Infinity; // The segment's length doesn't fit the field's bit width\n result += 4 + ccbits + seg.bitData.length;\n }\n return result;\n };\n // Returns a new array of bytes representing the given string encoded in UTF-8.\n QrSegment.toUtf8ByteArray = function (str) {\n str = encodeURI(str);\n var result = [];\n for (var i = 0; i < str.length; i++) {\n if (str.charAt(i) != \"%\")\n result.push(str.charCodeAt(i));\n else {\n result.push(parseInt(str.substring(i + 1, i + 3), 16));\n i += 2;\n }\n }\n return result;\n };\n /*-- Constants --*/\n // Describes precisely all strings that are encodable in numeric mode.\n QrSegment.NUMERIC_REGEX = /^[0-9]*$/;\n // Describes precisely all strings that are encodable in alphanumeric mode.\n QrSegment.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\\/:-]*$/;\n // The set of all legal characters in alphanumeric mode,\n // where each character value maps to the index in the string.\n QrSegment.ALPHANUMERIC_CHARSET = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\";\n return QrSegment;\n }());\n qrcodegen.QrSegment = QrSegment;\n})(qrcodegen || (qrcodegen = {}));\n/*---- Public helper enumeration ----*/\n(function (qrcodegen) {\n (function (QrCode) {\n /*\n * The error correction level in a QR Code symbol. Immutable.\n */\n var Ecc = /** @class */ (function () {\n /*-- Constructor and fields --*/\n function Ecc(\n // In the range 0 to 3 (unsigned 2-bit integer).\n ordinal, \n // (Package-private) In the range 0 to 3 (unsigned 2-bit integer).\n formatBits) {\n this.ordinal = ordinal;\n this.formatBits = formatBits;\n }\n /*-- Constants --*/\n Ecc.LOW = new Ecc(0, 1); // The QR Code can tolerate about 7% erroneous codewords\n Ecc.MEDIUM = new Ecc(1, 0); // The QR Code can tolerate about 15% erroneous codewords\n Ecc.QUARTILE = new Ecc(2, 3); // The QR Code can tolerate about 25% erroneous codewords\n Ecc.HIGH = new Ecc(3, 2); // The QR Code can tolerate about 30% erroneous codewords\n return Ecc;\n }());\n QrCode.Ecc = Ecc;\n })(qrcodegen.QrCode || (qrcodegen.QrCode = {}));\n})(qrcodegen || (qrcodegen = {}));\n/*---- Public helper enumeration ----*/\n(function (qrcodegen) {\n (function (QrSegment) {\n /*\n * Describes how a segment's data bits are interpreted. Immutable.\n */\n var Mode = /** @class */ (function () {\n /*-- Constructor and fields --*/\n function Mode(\n // The mode indicator bits, which is a uint4 value (range 0 to 15).\n modeBits, \n // Number of character count bits for three different version ranges.\n numBitsCharCount) {\n this.modeBits = modeBits;\n this.numBitsCharCount = numBitsCharCount;\n }\n /*-- Method --*/\n // (Package-private) Returns the bit width of the character count field for a segment in\n // this mode in a QR Code at the given version number. The result is in the range [0, 16].\n Mode.prototype.numCharCountBits = function (ver) {\n return this.numBitsCharCount[Math.floor((ver + 7) / 17)];\n };\n /*-- Constants --*/\n Mode.NUMERIC = new Mode(0x1, [10, 12, 14]);\n Mode.ALPHANUMERIC = new Mode(0x2, [9, 11, 13]);\n Mode.BYTE = new Mode(0x4, [8, 16, 16]);\n Mode.KANJI = new Mode(0x8, [8, 10, 12]);\n Mode.ECI = new Mode(0x7, [0, 0, 0]);\n return Mode;\n }());\n QrSegment.Mode = Mode;\n })(qrcodegen.QrSegment || (qrcodegen.QrSegment = {}));\n})(qrcodegen || (qrcodegen = {}));\nvar QR = qrcodegen;\n\nvar _uid = 0;\nfunction getUid(id) {\n if (id)\n return id;\n return \"v-\".concat(_uid++);\n}\nvar defaultErrorCorrectLevel = 'L';\nvar DEFAULT_QR_SIZE = 100;\nvar DEFAULT_MARGIN = 0;\nvar DEFAULT_IMAGE_SIZE_RATIO = 0.1;\nvar IMAGE_EXCAVATE_THICKNESS = 2;\nvar ErrorCorrectLevelMap = {\n L: QR.QrCode.Ecc.LOW,\n M: QR.QrCode.Ecc.MEDIUM,\n Q: QR.QrCode.Ecc.QUARTILE,\n H: QR.QrCode.Ecc.HIGH,\n};\n// Thanks the `qrcode.react`\nvar SUPPORTS_PATH2D = (function () {\n try {\n new Path2D().addPath(new Path2D());\n }\n catch (e) {\n return false;\n }\n return true;\n})();\nfunction validErrorCorrectLevel(level) {\n return level in ErrorCorrectLevelMap;\n}\nfunction getNeighborFlags(modules, row, col) {\n var north = row > 0 ? modules[row - 1][col] : false;\n var south = row < modules.length - 1 ? modules[row + 1][col] : false;\n var west = col > 0 ? modules[row][col - 1] : false;\n var east = col < modules[row].length - 1 ? modules[row][col + 1] : false;\n return {\n nw: !north && !west,\n ne: !north && !east,\n se: !south && !east,\n sw: !south && !west,\n };\n}\nfunction generateRoundedPath(modules, margin, radius) {\n if (margin === void 0) { margin = 0; }\n if (radius === void 0) { radius = 0; }\n var pathSegments = [];\n var r = Math.min(radius, 0.5);\n for (var row = 0; row < modules.length; row++) {\n for (var col = 0; col < modules[row].length; col++) {\n if (!modules[row][col])\n continue;\n var _a = getNeighborFlags(modules, row, col), nw = _a.nw, ne = _a.ne, se = _a.se, sw = _a.sw;\n var x = col + margin;\n var y = row + margin;\n pathSegments.push(\"M\".concat(x + (nw ? r : 0), \" \").concat(y), \"L\".concat(x + 1 - (ne ? r : 0), \" \").concat(y));\n if (ne) {\n pathSegments.push(\"A\".concat(r, \" \").concat(r, \" 0 0 1 \").concat(x + 1, \" \").concat(y + r));\n }\n pathSegments.push(\"L\".concat(x + 1, \" \").concat(y + 1 - (se ? r : 0)));\n if (se) {\n pathSegments.push(\"A\".concat(r, \" \").concat(r, \" 0 0 1 \").concat(x + 1 - r, \" \").concat(y + 1));\n }\n pathSegments.push(\"L\".concat(x + (sw ? r : 0), \" \").concat(y + 1));\n if (sw) {\n pathSegments.push(\"A\".concat(r, \" \").concat(r, \" 0 0 1 \").concat(x, \" \").concat(y + 1 - r));\n }\n pathSegments.push(\"L\".concat(x, \" \").concat(y + (nw ? r : 0)));\n if (nw) {\n pathSegments.push(\"A\".concat(r, \" \").concat(r, \" 0 0 1 \").concat(x + r, \" \").concat(y));\n }\n pathSegments.push('z');\n }\n }\n return pathSegments.join('');\n}\nfunction generatePath(modules, margin) {\n if (margin === void 0) { margin = 0; }\n var pathSegments = [];\n for (var y = 0; y < modules.length; y++) {\n var row = modules[y];\n var start = null;\n for (var x = 0; x < row.length; x++) {\n var cell = row[x];\n if (!cell && start !== null) {\n // M0 0h7v1H0z injects the space with the move and drops the comma,\n pathSegments.push(\"M\".concat(start + margin, \" \").concat(y + margin, \"h\").concat(x - start, \"v1H\").concat(start + margin, \"z\"));\n start = null;\n continue;\n }\n // end of row, clean up or skip\n if (x === row.length - 1) {\n if (!cell) {\n // We would have closed the op above already so this can only mean\n // 2+ light modules in a row.\n continue;\n }\n if (start === null) {\n // Just a single dark module.\n pathSegments.push(\"M\".concat(x + margin, \",\").concat(y + margin, \" h1v1H\").concat(x + margin, \"z\"));\n }\n else {\n // Otherwise finish the current line.\n pathSegments.push(\"M\".concat(start + margin, \",\").concat(y + margin, \" h\").concat(x + 1 - start, \"v1H\").concat(start + margin, \"z\"));\n }\n continue;\n }\n if (cell && start === null) {\n start = x;\n }\n }\n }\n return pathSegments.join('');\n}\nfunction getImageSettings(cells, size, margin, imageSettings) {\n var width = imageSettings.width, height = imageSettings.height, imageX = imageSettings.x, imageY = imageSettings.y;\n var numCells = cells.length + margin * 2;\n var defaultSize = Math.floor(size * DEFAULT_IMAGE_SIZE_RATIO);\n var scale = numCells / size;\n var w = (width || defaultSize) * scale;\n var h = (height || defaultSize) * scale;\n var x = imageX == null ? cells.length / 2 - w / 2 : imageX * scale;\n var y = imageY == null ? cells.length / 2 - h / 2 : imageY * scale;\n var borderRadius = (imageSettings.borderRadius || 0) * scale;\n return { x: x, y: y, h: h, w: w, borderRadius: borderRadius };\n}\nfunction useQRCode(props) {\n var margin = computed(function () { var _a; return ((_a = props.margin) !== null && _a !== void 0 ? _a : DEFAULT_MARGIN) >>> 0; });\n var cells = computed(function () {\n var level = validErrorCorrectLevel(props.level) ? props.level : defaultErrorCorrectLevel;\n return QR.QrCode.encodeText(props.value, ErrorCorrectLevelMap[level]).getModules();\n });\n var numCells = computed(function () { return cells.value.length + margin.value * 2; });\n var fgPath = computed(function () {\n if (props.radius > 0) {\n return generateRoundedPath(cells.value, margin.value, props.radius);\n }\n return generatePath(cells.value, margin.value);\n });\n var imageProps = computed(function () {\n if (!props.imageSettings.src)\n return null;\n var settings = getImageSettings(cells.value, props.size, margin.value, props.imageSettings);\n return {\n x: settings.x + margin.value,\n y: settings.y + margin.value,\n width: settings.w,\n height: settings.h,\n borderRadius: settings.borderRadius,\n };\n });\n var imageBorderProps = computed(function () {\n if (!props.imageSettings.excavate || !imageProps.value)\n return null;\n var borderThickness = IMAGE_EXCAVATE_THICKNESS / (props.size / numCells.value);\n return {\n x: imageProps.value.x - borderThickness,\n y: imageProps.value.y - borderThickness,\n width: imageProps.value.width + borderThickness * 2,\n height: imageProps.value.height + borderThickness * 2,\n borderRadius: imageProps.value.borderRadius,\n };\n });\n return { margin: margin, numCells: numCells, cells: cells, fgPath: fgPath, imageProps: imageProps, imageBorderProps: imageBorderProps };\n}\nfunction downloadDataURLAsFile(data, filename) {\n var link = document.createElement('a');\n link.download = filename;\n link.href = data;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n}\nvar QRCodeProps = {\n value: {\n type: String,\n required: true,\n default: '',\n },\n size: {\n type: Number,\n default: DEFAULT_QR_SIZE,\n },\n level: {\n type: String,\n default: defaultErrorCorrectLevel,\n validator: function (l) { return validErrorCorrectLevel(l); },\n },\n background: {\n type: String,\n default: '#fff',\n },\n foreground: {\n type: String,\n default: '#000',\n },\n margin: {\n type: Number,\n default: DEFAULT_MARGIN,\n validator: function (m) { return m >= 0; },\n },\n imageSettings: {\n type: Object,\n default: function () { return ({}); },\n },\n gradient: {\n type: Boolean,\n default: false,\n },\n gradientType: {\n type: String,\n default: 'linear',\n validator: function (t) { return ['linear', 'radial'].indexOf(t) > -1; },\n },\n gradientStartColor: {\n type: String,\n default: '#000',\n },\n gradientEndColor: {\n type: String,\n default: '#fff',\n },\n radius: {\n type: Number,\n default: 0,\n validator: function (r) { return !isNaN(r) && r >= 0 && r <= 0.5; },\n },\n id: {\n type: String,\n required: false,\n },\n};\nvar QRCodeVueProps = __assign(__assign({}, QRCodeProps), { renderAs: {\n type: String,\n required: false,\n default: 'canvas',\n validator: function (as) { return ['canvas', 'svg'].indexOf(as) > -1; },\n } });\nvar QrcodeSvg = defineComponent({\n name: 'QRCodeSvg',\n props: QRCodeProps,\n setup: function (props, ctx) {\n var _a = useQRCode(props), numCells = _a.numCells, fgPath = _a.fgPath, imageProps = _a.imageProps, imageBorderProps = _a.imageBorderProps;\n var svgEl = ref();\n var uid = getUid(props.id);\n var qrGradientId = \"qrcode.vue-gradient-\".concat(uid);\n var qrLogoClipPathId = \"qrcode.vue-logo-clip-path-\".concat(uid);\n var gradientVNode = computed(function () {\n if (!props.gradient)\n return null;\n var gradientProps = props.gradientType === 'linear'\n ? {\n x1: '0%',\n y1: '0%',\n x2: '100%',\n y2: '100%',\n }\n : {\n cx: '50%',\n cy: '50%',\n r: '50%',\n fx: '50%',\n fy: '50%',\n };\n return h(props.gradientType === 'linear' ? 'linearGradient' : 'radialGradient', __assign({ id: qrGradientId }, gradientProps), [\n h('stop', {\n offset: '0%',\n style: { stopColor: props.gradientStartColor },\n }),\n h('stop', {\n offset: '100%',\n style: { stopColor: props.gradientEndColor },\n }),\n ]);\n });\n var clipPathVNode = computed(function () {\n if (!imageProps.value)\n return null;\n var borderRadius = imageProps.value.borderRadius;\n if (borderRadius <= 0)\n return null;\n return h('clipPath', { id: qrLogoClipPathId }, [\n h('rect', {\n x: imageProps.value.x,\n y: imageProps.value.y,\n width: imageProps.value.width,\n height: imageProps.value.height,\n rx: borderRadius,\n ry: borderRadius,\n }),\n ]);\n });\n var getSvgDataURL = function (svg) { return 'data:image/svg+xml;charset=utf-8,' +\n encodeURIComponent('' + new XMLSerializer().serializeToString(svg)); };\n ctx.expose({\n toDataURL: function () {\n var svg = svgEl.value;\n if (!svg)\n return;\n return getSvgDataURL(svg);\n },\n download: function (filename) {\n if (filename === void 0) { filename = 'qrcode.svg'; }\n var svg = svgEl.value;\n if (!svg)\n return;\n downloadDataURLAsFile(getSvgDataURL(svg), filename);\n },\n });\n return function () { return h('svg', {\n ref: svgEl,\n width: props.size,\n height: props.size,\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: \"0 0 \".concat(numCells.value, \" \").concat(numCells.value),\n role: 'img',\n }, [\n h('defs', {}, [gradientVNode.value, clipPathVNode.value].filter(Boolean)),\n h('rect', {\n width: '100%',\n height: '100%',\n fill: props.background,\n }),\n h('path', {\n fill: props.gradient ? \"url(#\".concat(qrGradientId, \")\") : props.foreground,\n d: fgPath.value,\n }),\n imageBorderProps.value && h('rect', {\n x: imageBorderProps.value.x,\n y: imageBorderProps.value.y,\n width: imageBorderProps.value.width,\n height: imageBorderProps.value.height,\n fill: props.background,\n rx: imageBorderProps.value.borderRadius,\n ry: imageBorderProps.value.borderRadius,\n }),\n props.imageSettings.src && imageProps.value && h('image', __assign({ href: props.imageSettings.src, crossorigin: props.imageSettings.crossOrigin, 'clip-path': imageProps.value.borderRadius > 0 ? \"url(#\".concat(qrLogoClipPathId, \")\") : void 0 }, imageProps.value)),\n ]); };\n },\n});\nvar QrcodeCanvas = defineComponent({\n name: 'QRCodeCanvas',\n props: QRCodeProps,\n setup: function (props, ctx) {\n var _a = useQRCode(props), margin = _a.margin, cells = _a.cells, numCells = _a.numCells, fgPath = _a.fgPath, imageProps = _a.imageProps, imageBorderProps = _a.imageBorderProps;\n var canvasEl = ref(null);\n var imageEl = ref(null);\n var drawRoundedRect = function (ctx, x, y, width, height, radius) {\n ctx.beginPath();\n if (ctx.roundRect) {\n ctx.roundRect(x, y, width, height, radius);\n }\n else {\n ctx.rect(x, y, width, height);\n }\n };\n var generate = function () {\n var size = props.size, background = props.background, foreground = props.foreground, gradient = props.gradient, gradientType = props.gradientType, gradientStartColor = props.gradientStartColor, gradientEndColor = props.gradientEndColor;\n var canvas = canvasEl.value;\n if (!canvas) {\n return;\n }\n var canvasCtx = canvas.getContext('2d');\n if (!canvasCtx) {\n return;\n }\n var image = imageEl.value;\n var devicePixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n var scale = (size / numCells.value) * devicePixelRatio;\n canvas.height = canvas.width = size * devicePixelRatio;\n canvasCtx.setTransform(scale, 0, 0, scale, 0, 0);\n canvasCtx.fillStyle = background;\n canvasCtx.fillRect(0, 0, numCells.value, numCells.value);\n if (gradient) {\n var grad = void 0;\n if (gradientType === 'linear') {\n grad = canvasCtx.createLinearGradient(0, 0, numCells.value, numCells.value);\n }\n else {\n grad = canvasCtx.createRadialGradient(numCells.value / 2, numCells.value / 2, 0, numCells.value / 2, numCells.value / 2, numCells.value / 2);\n }\n grad.addColorStop(0, gradientStartColor);\n grad.addColorStop(1, gradientEndColor);\n canvasCtx.fillStyle = grad;\n }\n else {\n canvasCtx.fillStyle = foreground;\n }\n if (SUPPORTS_PATH2D) {\n canvasCtx.fill(new Path2D(fgPath.value));\n }\n else {\n cells.value.forEach(function (row, rdx) {\n row.forEach(function (cell, cdx) {\n if (cell) {\n canvasCtx.fillRect(cdx + margin.value, rdx + margin.value, 1, 1);\n }\n });\n });\n }\n var showImage = props.imageSettings.src && image && image.naturalWidth !== 0 && image.naturalHeight !== 0;\n if (showImage && imageProps.value) {\n if (imageBorderProps.value) {\n var imageBorder = imageBorderProps.value;\n canvasCtx.fillStyle = props.background;\n drawRoundedRect(canvasCtx, imageBorder.x, imageBorder.y, imageBorder.width, imageBorder.height, imageBorder.borderRadius);\n canvasCtx.fill();\n }\n var borderRadius = imageProps.value.borderRadius;\n if (borderRadius > 0) {\n canvasCtx.save();\n drawRoundedRect(canvasCtx, imageProps.value.x, imageProps.value.y, imageProps.value.width, imageProps.value.height, borderRadius);\n canvasCtx.clip();\n canvasCtx.drawImage(image, imageProps.value.x, imageProps.value.y, imageProps.value.width, imageProps.value.height);\n canvasCtx.restore();\n }\n else {\n canvasCtx.drawImage(image, imageProps.value.x, imageProps.value.y, imageProps.value.width, imageProps.value.height);\n }\n }\n };\n onMounted(generate);\n watchEffect(generate, { flush: 'post' });\n ctx.expose({\n toDataURL: function (type, quality) { var _a; return (_a = canvasEl.value) === null || _a === void 0 ? void 0 : _a.toDataURL(type, quality); },\n download: function (filename) {\n if (filename === void 0) { filename = 'qrcode.png'; }\n var canvas = canvasEl.value;\n if (!canvas)\n return;\n downloadDataURLAsFile(canvas.toDataURL('image/png'), filename);\n },\n });\n return function () { return h(Fragment, [\n h('canvas', __assign(__assign({}, ctx.attrs), { ref: canvasEl, role: 'img', style: __assign(__assign({}, ctx.attrs.style), { width: \"\".concat(props.size, \"px\"), height: \"\".concat(props.size, \"px\") }) })),\n props.imageSettings.src && h('img', {\n ref: imageEl,\n src: props.imageSettings.src,\n crossorigin: props.imageSettings.crossOrigin,\n style: { display: 'none' },\n onLoad: generate,\n })\n ]); };\n },\n});\nvar QrcodeVue = defineComponent({\n name: 'Qrcode',\n props: QRCodeVueProps,\n setup: function (props, ctx) {\n var childRef = ref();\n ctx.expose({\n toDataURL: function (type, quality) { var _a, _b; return (_b = (_a = childRef.value) === null || _a === void 0 ? void 0 : _a.toDataURL) === null || _b === void 0 ? void 0 : _b.call(_a, type, quality); },\n download: function (filename) { var _a, _b; return (_b = (_a = childRef.value) === null || _a === void 0 ? void 0 : _a.download) === null || _b === void 0 ? void 0 : _b.call(_a, filename); },\n });\n return function () { return h(props.renderAs === 'svg' ? QrcodeSvg : QrcodeCanvas, {\n ref: childRef,\n value: props.value,\n size: props.size,\n margin: props.margin,\n level: props.level,\n background: props.background,\n foreground: props.foreground,\n imageSettings: props.imageSettings,\n gradient: props.gradient,\n gradientType: props.gradientType,\n gradientStartColor: props.gradientStartColor,\n gradientEndColor: props.gradientEndColor,\n radius: props.radius,\n id: props.id,\n }); };\n },\n});\n\nexport { QrcodeCanvas, QrcodeSvg, QrcodeVue as default };\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcNoteCard.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcNoteCard.css\";\n export default content && content.locals ? content.locals : undefined;\n","import '../assets/NcNoteCard.css';\nimport { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createVNode, createElementVNode, toDisplayString, createCommentVNode } from \"vue\";\nimport { k as mdiAlert, l as mdiInformation, n as mdiCheckboxMarkedCircle, o as mdiAlertDecagram } from \"./mdi.mjs\";\nimport { a as isLegacy } from \"./legacy.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\nconst _hoisted_1 = [\"role\"];\nconst _hoisted_2 = {\n key: 0,\n class: \"notecard__heading\"\n};\nconst _hoisted_3 = { class: \"notecard__text\" };\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcNoteCard\",\n props: {\n heading: { default: void 0 },\n showAlert: { type: Boolean },\n text: { default: void 0 },\n type: { default: \"warning\" }\n },\n setup(__props) {\n const props = __props;\n const shouldShowAlert = computed(() => props.showAlert || props.type === \"error\");\n const iconPath = computed(() => {\n switch (props.type) {\n case \"error\":\n return mdiAlertDecagram;\n case \"success\":\n return mdiCheckboxMarkedCircle;\n case \"info\":\n return mdiInformation;\n case \"warning\":\n default:\n return mdiAlert;\n }\n });\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass([\"notecard\", {\n [`notecard--${__props.type}`]: __props.type,\n \"notecard--legacy\": unref(isLegacy)\n }]),\n role: shouldShowAlert.value ? \"alert\" : \"note\"\n }, [\n renderSlot(_ctx.$slots, \"icon\", {}, () => [\n createVNode(unref(NcIconSvgWrapper), {\n path: iconPath.value,\n class: normalizeClass([\"notecard__icon\", { \"notecard__icon--heading\": __props.heading }]),\n inline: \"\"\n }, null, 8, [\"path\", \"class\"])\n ], true),\n createElementVNode(\"div\", null, [\n __props.heading ? (openBlock(), createElementBlock(\"p\", _hoisted_2, toDisplayString(__props.heading), 1)) : createCommentVNode(\"\", true),\n renderSlot(_ctx.$slots, \"default\", {}, () => [\n createElementVNode(\"p\", _hoisted_3, toDisplayString(__props.text), 1)\n ], true)\n ])\n ], 10, _hoisted_1);\n };\n }\n});\nconst NcNoteCard = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-6be9fa31\"]]);\nexport {\n NcNoteCard as N\n};\n//# sourceMappingURL=NcNoteCard.mjs.map\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcRadioGroup.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcRadioGroup.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcFormBox.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcFormBox.css\";\n export default content && content.locals ? content.locals : undefined;\n","import '../assets/NcFormBox.css';\nimport { defineComponent, useCssModule, provide, openBlock, createElementBlock, normalizeClass, renderSlot } from \"vue\";\nimport { N as NC_FORM_BOX_CONTEXT_KEY } from \"./useNcFormBox.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcFormBox\",\n props: {\n row: { type: Boolean }\n },\n setup(__props) {\n const style = useCssModule();\n provide(NC_FORM_BOX_CONTEXT_KEY, {\n isInFormBox: true,\n formBoxItemClass: style.ncFormBox__item\n });\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass([_ctx.$style.ncFormBox, __props.row ? _ctx.$style.ncFormBox_row : _ctx.$style.ncFormBox_col])\n }, [\n renderSlot(_ctx.$slots, \"default\", {\n itemClass: _ctx.$style.ncFormBox__item\n })\n ], 2);\n };\n }\n});\nconst ncFormBox = \"_ncFormBox_DLj7n\";\nconst ncFormBox_row = \"_ncFormBox_row_Fr1lK\";\nconst ncFormBox__item = \"_ncFormBox__item_-SJyo\";\nconst ncFormBox_col = \"_ncFormBox_col_1wgxQ\";\nconst style0 = {\n \"material-design-icon\": \"_material-design-icon_g04W5\",\n ncFormBox,\n ncFormBox_row,\n ncFormBox__item,\n ncFormBox_col\n};\nconst cssModules = {\n \"$style\": style0\n};\nconst NcFormBox = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__cssModules\", cssModules]]);\nexport {\n NcFormBox as N\n};\n//# sourceMappingURL=NcFormBox.mjs.map\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcFormGroup.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcFormGroup.css\";\n export default content && content.locals ? content.locals : undefined;\n","import '../assets/NcFormGroup.css';\nimport { defineComponent, useSlots, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from \"vue\";\nimport { c as createElementId } from \"./createElementId.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\nconst _hoisted_1 = [\"aria-describedby\"];\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcFormGroup\",\n props: {\n label: { default: () => void 0 },\n description: { default: () => void 0 },\n hideLabel: { type: Boolean, default: false },\n hideDescription: { type: Boolean, default: false },\n noGap: { type: Boolean, default: false }\n },\n setup(__props) {\n const slots = useSlots();\n const id = `nc-form-group-${createElementId()}`;\n const descriptionId = `${id}-description`;\n const hasDescription = () => !!__props.description || !!slots.description;\n const getDescriptionId = () => hasDescription() ? descriptionId : void 0;\n const hasContentOnly = () => __props.hideLabel && (!hasDescription() || __props.hideDescription);\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"fieldset\", {\n class: normalizeClass([_ctx.$style.formGroup, { [_ctx.$style.formGroup_noGap]: __props.noGap }]),\n \"aria-describedby\": getDescriptionId()\n }, [\n createElementVNode(\"legend\", {\n class: normalizeClass([_ctx.$style.formGroup__label, { \"hidden-visually\": __props.hideLabel }])\n }, [\n renderSlot(_ctx.$slots, \"label\", {}, () => [\n createTextVNode(toDisplayString(__props.label || \"⚠️ Missing label\"), 1)\n ])\n ], 2),\n hasDescription() ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n id: descriptionId,\n class: normalizeClass([_ctx.$style.formGroup__description, { \"hidden-visually\": __props.hideDescription }])\n }, [\n renderSlot(_ctx.$slots, \"description\", {}, () => [\n createTextVNode(toDisplayString(__props.description), 1)\n ])\n ], 2)) : createCommentVNode(\"\", true),\n createElementVNode(\"div\", {\n class: normalizeClass([_ctx.$style.formGroup__content, { [_ctx.$style.formGroup__content_only]: hasContentOnly() }])\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 2)\n ], 10, _hoisted_1);\n };\n }\n});\nconst formGroup = \"_formGroup_s9Y0Y\";\nconst formGroup_noGap = \"_formGroup_noGap_ni6Ax\";\nconst formGroup__label = \"_formGroup__label_flCX6\";\nconst formGroup__description = \"_formGroup__description_ettaL\";\nconst formGroup__content = \"_formGroup__content_AhX7q\";\nconst formGroup__content_only = \"_formGroup__content_only_h-mqW\";\nconst style0 = {\n \"material-design-icon\": \"_material-design-icon_ux73t\",\n formGroup,\n formGroup_noGap,\n formGroup__label,\n formGroup__description,\n formGroup__content,\n formGroup__content_only\n};\nconst cssModules = {\n \"$style\": style0\n};\nconst NcFormGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__cssModules\", cssModules]]);\nexport {\n NcFormGroup as N\n};\n//# sourceMappingURL=NcFormGroup.mjs.map\n","import '../assets/NcRadioGroup.css';\nimport { defineComponent, useModel, ref, provide, computed, warn, openBlock, createBlock, withCtx, renderSlot, createElementBlock, normalizeClass, mergeModels } from \"vue\";\nimport { N as NcFormBox } from \"./NcFormBox.mjs\";\nimport { N as NcFormGroup } from \"./NcFormGroup.mjs\";\nimport { I as INSIDE_RADIO_GROUP_KEY } from \"./useNcRadioGroup.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcRadioGroup\",\n props: /* @__PURE__ */ mergeModels({\n label: {},\n labelHidden: { type: Boolean },\n hideLabel: { type: Boolean },\n description: {}\n }, {\n \"modelValue\": { required: false, default: \"\" },\n \"modelModifiers\": {}\n }),\n emits: [\"update:modelValue\"],\n setup(__props) {\n const modelValue = useModel(__props, \"modelValue\");\n const buttonVariant = ref();\n provide(INSIDE_RADIO_GROUP_KEY, computed(() => ({\n register,\n modelValue: modelValue.value,\n onUpdate\n })));\n function register(isButton) {\n if (buttonVariant.value !== void 0 && buttonVariant.value !== isButton) {\n warn(\"[NcRadioGroup] Mixing NcCheckboxRadioSwitch and NcRadioGroupButton is not possible!\");\n }\n buttonVariant.value = isButton;\n }\n function onUpdate(value) {\n modelValue.value = value;\n }\n return (_ctx, _cache) => {\n return openBlock(), createBlock(NcFormGroup, {\n label: __props.label,\n description: __props.description,\n hideLabel: __props.labelHidden || __props.hideLabel\n }, {\n default: withCtx(() => [\n buttonVariant.value ? (openBlock(), createBlock(NcFormBox, {\n key: 0,\n row: \"\"\n }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"default\")\n ]),\n _: 3\n })) : (openBlock(), createElementBlock(\"span\", {\n key: 1,\n class: normalizeClass(_ctx.$style.radioGroup_checkboxRadioContainer)\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 2))\n ]),\n _: 3\n }, 8, [\"label\", \"description\", \"hideLabel\"]);\n };\n }\n});\nconst radioGroup_checkboxRadioContainer = \"_radioGroup_checkboxRadioContainer_AUPA7\";\nconst style0 = {\n \"material-design-icon\": \"_material-design-icon_TUacq\",\n radioGroup_checkboxRadioContainer\n};\nconst cssModules = {\n \"$style\": style0\n};\nconst NcRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__cssModules\", cssModules]]);\nexport {\n NcRadioGroup as N\n};\n//# sourceMappingURL=NcRadioGroup.mjs.map\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcRadioGroupButton.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcRadioGroupButton.css\";\n export default content && content.locals ? content.locals : undefined;\n","import '../assets/NcRadioGroupButton.css';\nimport { defineComponent, onMounted, computed, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createCommentVNode, toDisplayString, createElementVNode } from \"vue\";\nimport { c as createElementId } from \"./createElementId.mjs\";\nimport { u as useNcFormBox } from \"./useNcFormBox.mjs\";\nimport { u as useInsideRadioGroup } from \"./useNcRadioGroup.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\nconst _hoisted_1 = [\"id\"];\nconst _hoisted_2 = [\"aria-labelledby\", \"aria-label\", \"checked\", \"disabled\", \"value\"];\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcRadioGroupButton\",\n props: {\n ariaLabel: {},\n label: {},\n value: {},\n disabled: { type: Boolean }\n },\n setup(__props) {\n const props = __props;\n const labelId = createElementId();\n const radioGroup = useInsideRadioGroup();\n const { formBoxItemClass } = useNcFormBox();\n onMounted(() => radioGroup.value.register(true));\n const isChecked = computed(() => radioGroup?.value.modelValue === props.value);\n function onUpdate() {\n if (props.disabled) {\n return;\n }\n radioGroup.value.onUpdate(props.value);\n }\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass([{\n [_ctx.$style.radioGroupButton_active]: isChecked.value,\n [_ctx.$style.radioGroupButton_disabled]: __props.disabled\n }, _ctx.$style.radioGroupButton, unref(formBoxItemClass)]),\n onClick: onUpdate\n }, [\n _ctx.$slots.icon ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n class: normalizeClass(_ctx.$style.radioGroupButton__icon)\n }, [\n renderSlot(_ctx.$slots, \"icon\")\n ], 2)) : createCommentVNode(\"\", true),\n __props.label ? (openBlock(), createElementBlock(\"div\", {\n key: 1,\n id: unref(labelId),\n class: normalizeClass(_ctx.$style.radioGroupButton__label)\n }, toDisplayString(__props.label), 11, _hoisted_1)) : createCommentVNode(\"\", true),\n createElementVNode(\"input\", {\n \"aria-labelledby\": __props.label ? unref(labelId) : void 0,\n \"aria-label\": __props.label ? void 0 : __props.ariaLabel,\n class: \"hidden-visually\",\n checked: isChecked.value,\n type: \"radio\",\n disabled: __props.disabled,\n value: __props.value,\n onInput: onUpdate\n }, null, 40, _hoisted_2)\n ], 2);\n };\n }\n});\nconst radioGroupButton = \"_radioGroupButton_YNoo0\";\nconst radioGroupButton__label = \"_radioGroupButton__label_8W6-c\";\nconst radioGroupButton__icon = \"_radioGroupButton__icon_lPjNx\";\nconst radioGroupButton_disabled = \"_radioGroupButton_disabled_8uxSh\";\nconst radioGroupButton_active = \"_radioGroupButton_active_qTVBh\";\nconst style0 = {\n \"material-design-icon\": \"_material-design-icon_L0tBR\",\n radioGroupButton,\n radioGroupButton__label,\n radioGroupButton__icon,\n radioGroupButton_disabled,\n radioGroupButton_active\n};\nconst cssModules = {\n \"$style\": style0\n};\nconst NcRadioGroupButton = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__cssModules\", cssModules]]);\nexport {\n NcRadioGroupButton as N\n};\n//# sourceMappingURL=NcRadioGroupButton.mjs.map\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcSelectUsers.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcSelectUsers.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcListItemIcon.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcListItemIcon.css\";\n export default content && content.locals ? content.locals : undefined;\n","import { defineComponent, h } from \"vue\";\n/*!\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nfunction findRanges(text, search) {\n const ranges = [];\n let currentIndex = 0;\n let index = text.toLowerCase().indexOf(search.toLowerCase(), currentIndex);\n let i = 0;\n while (index > -1 && i++ < text.length) {\n currentIndex = index + search.length;\n ranges.push({ start: index, end: currentIndex });\n index = text.toLowerCase().indexOf(search.toLowerCase(), currentIndex);\n }\n return ranges;\n}\nconst _sfc_main = defineComponent({\n name: \"NcHighlight\",\n props: {\n /**\n * The string to display\n */\n text: {\n type: String,\n default: \"\"\n },\n /**\n * The string to match and highlight\n */\n search: {\n type: String,\n default: \"\"\n },\n /**\n * The ranges to highlight, takes precedence over the search prop.\n */\n highlight: {\n type: Array,\n default: () => []\n }\n },\n computed: {\n /**\n * The indice ranges which should be highlighted.\n * If an array with ranges is provided, we use it. Otherwise\n * we calculate it based on the provided substring to highlight.\n *\n * @return The array of ranges to highlight\n */\n ranges() {\n let ranges = [];\n if (!this.search && this.highlight.length === 0) {\n return ranges;\n }\n if (this.highlight.length > 0) {\n ranges = this.highlight;\n } else {\n ranges = findRanges(this.text, this.search);\n }\n ranges.forEach((range, i) => {\n if (range.end < range.start) {\n ranges[i] = {\n start: range.end,\n end: range.start\n };\n }\n });\n ranges = ranges.reduce((validRanges, range) => {\n if (range.start < this.text.length && range.end > 0) {\n validRanges.push({\n start: range.start < 0 ? 0 : range.start,\n end: range.end > this.text.length ? this.text.length : range.end\n });\n }\n return validRanges;\n }, []);\n ranges.sort((a, b) => {\n return a.start - b.start;\n });\n ranges = ranges.reduce((mergedRanges, range) => {\n if (!mergedRanges.length) {\n mergedRanges.push(range);\n } else {\n const idx = mergedRanges.length - 1;\n if (mergedRanges[idx].end >= range.start) {\n mergedRanges[idx] = {\n start: mergedRanges[idx].start,\n end: Math.max(mergedRanges[idx].end, range.end)\n };\n } else {\n mergedRanges.push(range);\n }\n }\n return mergedRanges;\n }, []);\n return ranges;\n },\n /**\n * Calculate the different chunks to show based on the ranges to highlight.\n */\n chunks() {\n if (this.ranges.length === 0) {\n return [{\n start: 0,\n end: this.text.length,\n highlight: false,\n text: this.text\n }];\n }\n const chunks = [];\n let currentIndex = 0;\n let currentRange = 0;\n while (currentIndex < this.text.length) {\n const range = this.ranges[currentRange];\n if (range.start === currentIndex) {\n chunks.push({\n ...range,\n highlight: true,\n text: this.text.slice(range.start, range.end)\n });\n currentRange++;\n currentIndex = range.end;\n if (currentRange >= this.ranges.length && currentIndex < this.text.length) {\n chunks.push({\n start: currentIndex,\n end: this.text.length,\n highlight: false,\n text: this.text.slice(currentIndex)\n });\n currentIndex = this.text.length;\n }\n continue;\n }\n chunks.push({\n start: currentIndex,\n end: range.start,\n highlight: false,\n text: this.text.slice(currentIndex, range.start)\n });\n currentIndex = range.start;\n }\n return chunks;\n }\n },\n /**\n * The render function to display the component\n */\n render() {\n if (!this.ranges.length) {\n return h(\"span\", {}, this.text);\n }\n return h(\"span\", {}, this.chunks.map((chunk) => {\n return chunk.highlight ? h(\"strong\", {}, chunk.text) : chunk.text;\n }));\n }\n});\nexport {\n _sfc_main as _,\n findRanges as f\n};\n//# sourceMappingURL=NcHighlight.vue_vue_type_script_lang.mjs.map\n","import '../assets/NcListItemIcon.css';\nimport \"escape-html\";\nimport \"striptags\";\nimport { resolveComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, createVNode, mergeProps, createElementVNode, createBlock, toDisplayString, createCommentVNode, renderSlot } from \"vue\";\nimport \"../composables/useIsDarkTheme/index.mjs\";\nimport \"@nextcloud/router\";\nimport \"../functions/isDarkTheme/index.mjs\";\nimport \"./NcMentionBubble.vue_vue_type_style_index_0_scoped_3c4a673d_lang.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper.mjs\";\nimport { u as userStatus, N as NcAvatar } from \"./NcAvatar.mjs\";\nimport { _ as _sfc_main$1 } from \"./NcHighlight.vue_vue_type_script_lang.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper.mjs\";\nconst margin = 8;\nconst defaultSize = 32;\nconst _sfc_main = {\n name: \"NcListItemIcon\",\n components: {\n NcAvatar,\n NcHighlight: _sfc_main$1,\n NcIconSvgWrapper\n },\n mixins: [\n userStatus\n ],\n props: {\n /**\n * Default first line text\n */\n name: {\n type: String,\n required: true\n },\n /**\n * Secondary optional line\n * Only visible on size of 32 and above\n */\n subname: {\n type: String,\n default: \"\"\n },\n /**\n * Icon class to be displayed at the end of the component\n */\n icon: {\n type: String,\n default: \"\"\n },\n /**\n * SVG icon to be displayed at the end of the component\n */\n iconSvg: {\n type: String,\n default: \"\"\n },\n /**\n * Descriptive name for the icon\n */\n iconName: {\n type: String,\n default: \"\"\n },\n /**\n * Search within the highlight of name/subname\n */\n search: {\n type: String,\n default: \"\"\n },\n /**\n * Set a size in px that will define the avatar height/width\n * and therefore, the height of the component\n */\n avatarSize: {\n type: Number,\n default: defaultSize\n },\n /**\n * Disable the margins of this component.\n * Useful for integration in `NcSelect` for example\n */\n noMargin: {\n type: Boolean,\n default: false\n },\n /**\n * See the [Avatar](#Avatar) displayName prop\n * Fallback to name\n */\n displayName: {\n type: String,\n default: null\n },\n /**\n * See the [Avatar](#Avatar) isNoUser prop\n * Enable/disable the UserStatus fetching\n */\n isNoUser: {\n type: Boolean,\n default: false\n },\n /**\n * Unique list item ID\n */\n id: {\n type: String,\n default: null\n }\n },\n setup() {\n return {\n margin,\n defaultSize\n };\n },\n computed: {\n hasIcon() {\n return this.icon !== \"\";\n },\n hasIconSvg() {\n return this.iconSvg !== \"\";\n },\n isValidSubname() {\n return this.subname?.trim?.() !== \"\";\n },\n isSizeBigEnough() {\n return this.avatarSize >= 26;\n },\n cssVars() {\n const margin2 = this.noMargin ? 0 : this.margin;\n return {\n \"--height\": this.avatarSize + 2 * margin2 + \"px\",\n \"--margin\": this.margin + \"px\"\n };\n },\n /**\n * Separates the search property into two parts, the first one is the search part on the name, the second on the subname.\n *\n * @return {[string, string]}\n */\n searchParts() {\n const EMAIL_NOTATION = /^([^<]*)<([^>]+)>?$/;\n const match = this.search.match(EMAIL_NOTATION);\n if (this.isNoUser || !match) {\n return [this.search, this.search];\n }\n return [match[1].trim(), match[2]];\n }\n },\n beforeMount() {\n if (!this.isNoUser && !this.subname) {\n this.fetchUserStatus(this.user);\n }\n }\n};\nconst _hoisted_1 = [\"id\"];\nconst _hoisted_2 = { class: \"option__details\" };\nconst _hoisted_3 = { key: 1 };\nconst _hoisted_4 = [\"aria-label\"];\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_NcAvatar = resolveComponent(\"NcAvatar\");\n const _component_NcHighlight = resolveComponent(\"NcHighlight\");\n const _component_NcIconSvgWrapper = resolveComponent(\"NcIconSvgWrapper\");\n return openBlock(), createElementBlock(\"span\", {\n id: $props.id,\n class: normalizeClass([\"option\", { \"option--compact\": $props.avatarSize < $setup.defaultSize }]),\n style: normalizeStyle($options.cssVars)\n }, [\n createVNode(_component_NcAvatar, mergeProps(_ctx.$attrs, {\n disableMenu: \"\",\n disableTooltip: \"\",\n displayName: $props.displayName || $props.name,\n isNoUser: $props.isNoUser,\n size: $props.avatarSize,\n class: \"option__avatar\"\n }), null, 16, [\"displayName\", \"isNoUser\", \"size\"]),\n createElementVNode(\"div\", _hoisted_2, [\n createVNode(_component_NcHighlight, {\n class: \"option__lineone\",\n text: $props.name,\n search: $options.searchParts[0]\n }, null, 8, [\"text\", \"search\"]),\n $options.isValidSubname && $options.isSizeBigEnough ? (openBlock(), createBlock(_component_NcHighlight, {\n key: 0,\n class: \"option__linetwo\",\n text: $props.subname,\n search: $options.searchParts[1]\n }, null, 8, [\"text\", \"search\"])) : _ctx.hasStatus ? (openBlock(), createElementBlock(\"span\", _hoisted_3, [\n createElementVNode(\"span\", null, toDisplayString(_ctx.userStatus.icon), 1),\n createElementVNode(\"span\", null, toDisplayString(_ctx.userStatus.message), 1)\n ])) : createCommentVNode(\"\", true)\n ]),\n renderSlot(_ctx.$slots, \"default\", {}, () => [\n $options.hasIconSvg ? (openBlock(), createBlock(_component_NcIconSvgWrapper, {\n key: 0,\n class: \"option__icon\",\n svg: $props.iconSvg,\n name: $props.iconName\n }, null, 8, [\"svg\", \"name\"])) : $options.hasIcon ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n class: normalizeClass([\"icon option__icon\", $props.icon]),\n \"aria-label\": $props.iconName\n }, null, 10, _hoisted_4)) : createCommentVNode(\"\", true)\n ], true)\n ], 14, _hoisted_1);\n}\nconst NcListItemIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"render\", _sfc_render], [\"__scopeId\", \"data-v-0ee94269\"]]);\nexport {\n NcListItemIcon as N\n};\n//# sourceMappingURL=NcListItemIcon.mjs.map\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./NcSelect.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./NcSelect.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js!./index-DuYzGG0a.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js!./index-DuYzGG0a.css\";\n export default content && content.locals ? content.locals : undefined;\n","import './assets/index-DuYzGG0a.css';\nimport { openBlock, createElementBlock, createElementVNode, resolveDirective, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, Fragment, renderList, mergeProps, createTextVNode, toDisplayString, withKeys, withModifiers, createBlock, resolveDynamicComponent, createCommentVNode, toHandlers, withDirectives, vShow, createVNode, Transition, withCtx, warn } from \"vue\";\nconst appendToBody = {\n mounted(el, { instance }) {\n if (instance.appendToBody) {\n document.body.appendChild(el);\n const { height, top, left, width } = instance.$refs.toggle.getBoundingClientRect();\n const scrollX = window.scrollX || window.pageXOffset;\n const scrollY = window.scrollY || window.pageYOffset;\n el.unbindPosition = instance.calculatePosition(el, instance, {\n width: width + \"px\",\n left: scrollX + left + \"px\",\n top: scrollY + top + height + \"px\"\n });\n }\n },\n unmounted(el, { instance }) {\n if (instance.appendToBody) {\n if (el.unbindPosition && typeof el.unbindPosition === \"function\") {\n el.unbindPosition();\n }\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n }\n }\n }\n};\nconst ajax = {\n props: {\n /**\n * Toggles the adding of a 'loading' class to the main\n * .v-select wrapper. Useful to control UI state when\n * results are being processed through AJAX.\n */\n loading: {\n type: Boolean,\n default: false\n }\n },\n data() {\n return {\n mutableLoading: false\n };\n },\n watch: {\n /**\n * Anytime the search string changes, emit the\n * 'search' event. The event is passed with two\n * parameters: the search string, and a function\n * that accepts a boolean parameter to toggle the\n * loading state.\n *\n * @fires 'search'\n */\n search() {\n this.$emit(\"search\", this.search, this.toggleLoading);\n },\n /**\n * Sync the loading prop with the internal\n * mutable loading value.\n *\n * @param val Incoming loading state.\n */\n loading(val) {\n this.mutableLoading = val;\n }\n },\n methods: {\n /**\n * Toggle this.loading. Optionally pass a boolean\n * value. If no value is provided, this.loading\n * will be set to the opposite of it's current value.\n *\n * @param toggle Boolean\n * @return {*}\n */\n toggleLoading(toggle = null) {\n if (toggle === null || toggle === void 0) {\n return this.mutableLoading = !this.mutableLoading;\n }\n return this.mutableLoading = toggle;\n }\n }\n};\nconst pointerScroll = {\n props: {\n autoscroll: {\n type: Boolean,\n default: true\n }\n },\n watch: {\n typeAheadPointer() {\n if (this.autoscroll) {\n this.maybeAdjustScroll();\n }\n },\n open(open) {\n if (this.autoscroll && open) {\n this.$nextTick(() => this.maybeAdjustScroll());\n }\n }\n },\n methods: {\n /**\n * Adjust the scroll position of the dropdown list\n * if the current pointer is outside of the\n * overflow bounds.\n *\n * @return {*}\n */\n maybeAdjustScroll() {\n const optionEl = this.$refs.dropdownMenu?.children[this.typeAheadPointer] || false;\n if (optionEl) {\n const bounds = this.getDropdownViewport();\n const { top, bottom, height } = optionEl.getBoundingClientRect();\n if (top < bounds.top) {\n return this.$refs.dropdownMenu.scrollTop = optionEl.offsetTop;\n } else if (bottom > bounds.bottom) {\n return this.$refs.dropdownMenu.scrollTop = optionEl.offsetTop - (bounds.height - height);\n }\n }\n },\n /**\n * The currently viewable portion of the dropdownMenu.\n *\n * @return {{top: (string|*|number), bottom: *}}\n */\n getDropdownViewport() {\n return this.$refs.dropdownMenu ? this.$refs.dropdownMenu.getBoundingClientRect() : {\n height: 0,\n top: 0,\n bottom: 0\n };\n }\n }\n};\nconst pointer = {\n data() {\n return {\n typeAheadPointer: -1\n };\n },\n watch: {\n filteredOptions() {\n if (!this.resetFocusOnOptionsChange) {\n return;\n }\n for (let i = 0; i < this.filteredOptions.length; i++) {\n if (this.selectable(this.filteredOptions[i])) {\n this.typeAheadPointer = i;\n break;\n }\n }\n },\n open(open) {\n if (open) {\n this.typeAheadToLastSelected();\n }\n },\n selectedValue() {\n if (this.open) {\n this.typeAheadToLastSelected();\n }\n }\n },\n methods: {\n /**\n * Move the typeAheadPointer visually up the list by\n * setting it to the previous selectable option.\n *\n * @return {void}\n */\n typeAheadUp() {\n for (let i = this.typeAheadPointer - 1; i >= 0; i--) {\n if (this.selectable(this.filteredOptions[i])) {\n this.typeAheadPointer = i;\n break;\n }\n }\n },\n /**\n * Move the typeAheadPointer visually down the list by\n * setting it to the next selectable option.\n *\n * @return {void}\n */\n typeAheadDown() {\n for (let i = this.typeAheadPointer + 1; i < this.filteredOptions.length; i++) {\n if (this.selectable(this.filteredOptions[i])) {\n this.typeAheadPointer = i;\n break;\n }\n }\n },\n /**\n * Select the option at the current typeAheadPointer position.\n * Optionally clear the search input on selection.\n *\n * @return {void}\n */\n typeAheadSelect() {\n const typeAheadOption = this.filteredOptions[this.typeAheadPointer];\n if (typeAheadOption && this.selectable(typeAheadOption)) {\n this.select(typeAheadOption);\n }\n },\n /**\n * Moves the pointer to the last selected option.\n */\n typeAheadToLastSelected() {\n const indexOfLastSelected = this.selectedValue.length !== 0 ? this.filteredOptions.indexOf(this.selectedValue[this.selectedValue.length - 1]) : -1;\n if (indexOfLastSelected !== -1) {\n this.typeAheadPointer = indexOfLastSelected;\n }\n }\n }\n};\nfunction sortAndStringify(sortable) {\n const ordered = {};\n Object.keys(sortable).sort().forEach((key) => {\n ordered[key] = sortable[key];\n });\n return JSON.stringify(ordered);\n}\nlet idCount = 0;\nfunction uniqueId() {\n return ++idCount;\n}\nconst _export_sfc = (sfc, props) => {\n const target = sfc.__vccOpts || sfc;\n for (const [key, val] of props) {\n target[key] = val;\n }\n return target;\n};\nconst _sfc_main$2 = {};\nconst _hoisted_1$2 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"10\",\n height: \"10\"\n};\nfunction _sfc_render$2(_ctx, _cache) {\n return openBlock(), createElementBlock(\"svg\", _hoisted_1$2, [..._cache[0] || (_cache[0] = [\n createElementVNode(\"path\", { d: \"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z\" }, null, -1)\n ])]);\n}\nconst Deselect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [[\"render\", _sfc_render$2]]);\nconst _sfc_main$1 = {};\nconst _hoisted_1$1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"14\",\n height: \"10\"\n};\nfunction _sfc_render$1(_ctx, _cache) {\n return openBlock(), createElementBlock(\"svg\", _hoisted_1$1, [..._cache[0] || (_cache[0] = [\n createElementVNode(\"path\", { d: \"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z\" }, null, -1)\n ])]);\n}\nconst OpenIndicator = /* @__PURE__ */ _export_sfc(_sfc_main$1, [[\"render\", _sfc_render$1]]);\nconst childComponents = {\n Deselect,\n OpenIndicator\n};\nconst _sfc_main = {\n components: { ...childComponents },\n directives: { appendToBody },\n mixins: [pointerScroll, pointer, ajax],\n props: {\n /**\n * Contains the currently selected value. Very similar to a\n * `value` attribute on an . You can listen for changes\n * with the 'input' event.\n *\n * @type {object | string | Array | null}\n */\n modelValue: {},\n /**\n * An object with any custom components that you'd like to overwrite\n * the default implementation of in your app. The keys in this object\n * will be merged with the defaults.\n *\n * @see https://vue-select.org/guide/components.html\n * @type {Function}\n */\n components: {\n type: Object,\n default: () => ({})\n },\n /**\n * An array of strings or objects to be used as dropdown choices.\n * If you are using an array of objects, vue-select will look for\n * a `label` key (ex. [{label: 'This is Foo', value: 'foo'}]). A\n * custom label key can be set with the `label` prop.\n *\n * @type {Array}\n */\n options: {\n type: Array,\n default() {\n return [];\n }\n },\n /**\n * Sets the maximum number of options to display in the dropdown list\n *\n * @type {number}\n */\n limit: {\n type: Number,\n default: null\n },\n /**\n * Disable the entire component.\n *\n * @type {boolean}\n */\n disabled: {\n type: Boolean,\n default: false\n },\n /**\n * Can the user clear the selected property.\n *\n * @type {boolean}\n */\n clearable: {\n type: Boolean,\n default: true\n },\n /**\n * Can the user deselect an option by clicking it from\n * within the dropdown.\n *\n * @type {boolean}\n */\n deselectFromDropdown: {\n type: Boolean,\n default: false\n },\n /**\n * Enable/disable filtering the options.\n *\n * @type {boolean}\n */\n searchable: {\n type: Boolean,\n default: true\n },\n /**\n * Equivalent to the `multiple` attribute on a `