{"version":3,"file":"forms-main.mjs","sources":["../node_modules/vue-material-design-icons/LockOutline.vue","../node_modules/@nextcloud/vue/dist/Components/NcActionCaption.mjs","../node_modules/@nextcloud/vue/dist/Components/NcAppNavigationList.mjs","../node_modules/@nextcloud/vue/dist/chunks/NcAppNavigation-B2JTHiIB.mjs","../node_modules/@nextcloud/vue/dist/chunks/NcAppNavigationCaption-t7dcgEKd.mjs","../node_modules/@nextcloud/vue/dist/chunks/NcAppNavigationNew-t3Rkrwjh.mjs","../node_modules/@nextcloud/vue/dist/Components/NcAppSidebarTab.mjs","../src/views/Create.vue","../node_modules/@mdi/svg/svg/delete.svg?raw","../node_modules/vue-material-design-icons/TrayArrowDown.vue","../node_modules/vue-material-design-icons/FileDelimitedOutline.vue","../node_modules/@mdi/svg/svg/file-delimited-outline.svg?raw","../node_modules/vue-material-design-icons/FileExcelOutline.vue","../node_modules/@mdi/svg/svg/file-excel-outline.svg?raw","../node_modules/vue-material-design-icons/FolderOutline.vue","../node_modules/vue-material-design-icons/Link.vue","../node_modules/@mdi/svg/svg/link.svg?raw","../node_modules/vue-material-design-icons/LinkOff.vue","../node_modules/@mdi/svg/svg/link-off.svg?raw","../node_modules/vue-material-design-icons/Poll.vue","../node_modules/vue-material-design-icons/Refresh.vue","../node_modules/vue-material-design-icons/Table.vue","../node_modules/@mdi/svg/svg/table.svg?raw","../node_modules/vue-material-design-icons/Magnify.vue","../src/components/Results/ResultsSummary.vue","../src/components/Results/Answer.vue","../src/components/Results/Submission.vue","../node_modules/vue-material-design-icons/ChevronRight.vue","../node_modules/vue-material-design-icons/PageFirst.vue","../node_modules/vue-material-design-icons/PageLast.vue","../src/components/PaginationToolbar.vue","../src/views/Results.vue","../src/router.js","../node_modules/vue-material-design-icons/ArchiveOutline.vue","../node_modules/vue-material-design-icons/ArchiveOffOutline.vue","../src/components/AppNavigationForm.vue","../src/components/ArchivedFormsModal.vue","../node_modules/vue-material-design-icons/CogOutline.vue","../node_modules/vue-material-design-icons/AccountMultipleOutline.vue","../node_modules/vue-material-design-icons/CodeBrackets.vue","../node_modules/vue-material-design-icons/LinkBoxOutline.vue","../node_modules/vue-material-design-icons/Qrcode.vue","../src/components/Icons/IconCopyAll.vue","../node_modules/@mdi/svg/svg/account.svg?raw","../node_modules/@mdi/svg/svg/account-group.svg?raw","../node_modules/@mdi/svg/svg/email.svg?raw","../node_modules/@mdi/svg/svg/chat.svg?raw","../node_modules/@mdi/svg/svg/circle-outline.svg?raw","../src/mixins/ShareTypes.js","../src/mixins/UserSearchMixin.js","../src/components/SidebarTabs/SharingSearchDiv.vue","../src/components/SidebarTabs/SharingShareDiv.vue","../node_modules/qrcode/lib/can-promise.js","../node_modules/qrcode/lib/core/utils.js","../node_modules/qrcode/lib/core/error-correction-level.js","../node_modules/qrcode/lib/core/bit-buffer.js","../node_modules/qrcode/lib/core/bit-matrix.js","../node_modules/qrcode/lib/core/alignment-pattern.js","../node_modules/qrcode/lib/core/finder-pattern.js","../node_modules/qrcode/lib/core/mask-pattern.js","../node_modules/qrcode/lib/core/error-correction-code.js","../node_modules/qrcode/lib/core/galois-field.js","../node_modules/qrcode/lib/core/polynomial.js","../node_modules/qrcode/lib/core/reed-solomon-encoder.js","../node_modules/qrcode/lib/core/version-check.js","../node_modules/qrcode/lib/core/regex.js","../node_modules/qrcode/lib/core/mode.js","../node_modules/qrcode/lib/core/version.js","../node_modules/qrcode/lib/core/format-info.js","../node_modules/qrcode/lib/core/numeric-data.js","../node_modules/qrcode/lib/core/alphanumeric-data.js","../node_modules/qrcode/lib/core/byte-data.js","../node_modules/qrcode/lib/core/kanji-data.js","../node_modules/dijkstrajs/dijkstra.js","../node_modules/qrcode/lib/core/segments.js","../node_modules/qrcode/lib/core/qrcode.js","../node_modules/qrcode/lib/renderer/utils.js","../node_modules/qrcode/lib/renderer/canvas.js","../node_modules/qrcode/lib/renderer/svg-tag.js","../node_modules/qrcode/lib/browser.js","../src/components/QRDialog.vue","../src/mixins/ShareLinkMixin.js","../src/components/SidebarTabs/SharingSidebarTab.vue","../src/components/SidebarTabs/TransferOwnership.vue","../node_modules/v-click-outside/dist/v-click-outside.umd.js","../img/lock_open.svg?raw","../src/components/SidebarTabs/SettingsSidebarTab.vue","../src/views/Sidebar.vue","../src/Forms.vue","../src/main.js"],"sourcesContent":["<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon lock-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M12,17C10.89,17 10,16.1 10,15C10,13.89 10.89,13 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10C4,8.89 4.89,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"LockOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","import '../assets/NcActionCaption-BNDtcWJ7.css';\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n  name: \"NcActionCaption\",\n  inject: {\n    isInSemanticMenu: {\n      from: \"NcActions:isSemanticMenu\",\n      default: false\n    }\n  },\n  props: {\n    /**\n     * The caption's text\n     */\n    name: {\n      type: String,\n      required: true\n    }\n  }\n};\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c;\n  return _c(\"li\", { staticClass: \"app-navigation-caption\", attrs: { \"role\": _vm.isInSemanticMenu && \"presentation\" } }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"7bf21eca\"\n);\nconst NcActionCaption = __component__.exports;\nexport {\n  NcActionCaption as default\n};\n//# sourceMappingURL=NcActionCaption.mjs.map\n","import '../assets/NcAppNavigationList-DnKj0-Zq.css';\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n  name: \"NcAppNavigationList\"\n};\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c;\n  return _c(\"ul\", { staticClass: \"app-navigation-list\" }, [_vm._t(\"default\")], 2);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"058e6060\"\n);\nconst NcAppNavigationList = __component__.exports;\nexport {\n  NcAppNavigationList as default\n};\n//# sourceMappingURL=NcAppNavigationList.mjs.map\n","import '../assets/NcAppNavigation-Dbpqdigp.css';\nimport { emit, unsubscribe, subscribe } from \"@nextcloud/event-bus\";\nimport { createFocusTrap } from \"focus-trap\";\nimport { tabbable } from \"tabbable\";\nimport Vue from \"vue\";\nimport { useHotKey } from \"../Composables/useHotKey.mjs\";\nimport { useIsMobile } from \"../Composables/useIsMobile.mjs\";\nimport { g as getTrapStack } from \"./focusTrap-HJQ4pqHV.mjs\";\nimport { l as logger } from \"./logger-D3RVzcfQ.mjs\";\nimport NcAppNavigationList from \"../Components/NcAppNavigationList.mjs\";\nimport { N as NcAppNavigationToggle } from \"./NcAppNavigationToggle-mKsXvFzS.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n  name: \"NcAppNavigation\",\n  components: {\n    NcAppNavigationList,\n    NcAppNavigationToggle\n  },\n  // Injected from NcContent\n  inject: {\n    setHasAppNavigation: {\n      default: () => () => Vue.util.warn(\"NcAppNavigation is not mounted inside NcContent, this is probably an error.\"),\n      from: \"NcContent:setHasAppNavigation\"\n    }\n  },\n  props: {\n    /**\n     * The aria label to describe the navigation\n     */\n    ariaLabel: {\n      type: String,\n      default: \"\"\n    },\n    /**\n     * aria-labelledby attribute to describe the navigation\n     */\n    ariaLabelledby: {\n      type: String,\n      default: \"\"\n    }\n  },\n  setup() {\n    return {\n      isMobile: useIsMobile()\n    };\n  },\n  data() {\n    return {\n      open: !this.isMobile,\n      focusTrap: null\n    };\n  },\n  watch: {\n    isMobile() {\n      this.open = !this.isMobile;\n      this.toggleFocusTrap();\n    },\n    open() {\n      this.toggleFocusTrap();\n    }\n  },\n  mounted() {\n    this.setHasAppNavigation(true);\n    subscribe(\"toggle-navigation\", this.toggleNavigationByEventBus);\n    emit(\"navigation-toggled\", {\n      open: this.open\n    });\n    this.focusTrap = createFocusTrap(this.$refs.appNavigationContainer, {\n      allowOutsideClick: true,\n      fallbackFocus: this.$refs.appNavigationContainer,\n      trapStack: getTrapStack(),\n      escapeDeactivates: false\n    });\n    this.toggleFocusTrap();\n    useHotKey(\"n\", this.onKeyDown, {\n      prevent: true,\n      stop: true\n    });\n  },\n  unmounted() {\n    this.setHasAppNavigation(false);\n    unsubscribe(\"toggle-navigation\", this.toggleNavigationByEventBus);\n    this.focusTrap.deactivate();\n  },\n  methods: {\n    /**\n     * Toggle the navigation\n     *\n     * @param {boolean} [state] set the state instead of inverting the current one\n     */\n    async toggleNavigation(state) {\n      if (this.open === state) {\n        emit(\"navigation-toggled\", {\n          open: this.open\n        });\n        return;\n      }\n      this.open = typeof state === \"undefined\" ? !this.open : state;\n      const bodyStyles = getComputedStyle(document.body);\n      const animationLength = parseInt(bodyStyles.getPropertyValue(\"--animation-quick\")) || 100;\n      if (this.open) {\n        await this.$nextTick();\n        this.focusFirstElement();\n      }\n      setTimeout(() => {\n        emit(\"navigation-toggled\", {\n          open: this.open\n        });\n      }, 1.5 * animationLength);\n    },\n    toggleNavigationByEventBus({ open }) {\n      this.toggleNavigation(open);\n    },\n    /**\n     * Activate focus trap if it is currently needed, otherwise deactivate\n     */\n    toggleFocusTrap() {\n      if (this.isMobile && this.open) {\n        this.focusTrap.activate();\n      } else {\n        this.focusTrap.deactivate();\n      }\n    },\n    handleEsc() {\n      if (this.isMobile && this.open) {\n        this.toggleNavigation(false);\n      }\n    },\n    focusFirstElement() {\n      const element = tabbable(this.$refs.appNavigationContainer)[0];\n      if (element) {\n        element.focus();\n        logger.debug(\"Focusing first element in the navigation\", { element });\n      }\n    },\n    onKeyDown(event) {\n      if (event.key === \"n\") {\n        if (!this.open) {\n          this.toggleNavigation(true);\n          return;\n        }\n        if (this.isFocusWithinNavigation()) {\n          this.toggleNavigation(false);\n        }\n      }\n    },\n    isFocusWithinNavigation() {\n      const activeElement = document.activeElement;\n      return this.$refs.appNavigationContainer?.contains(activeElement);\n    }\n  }\n};\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c;\n  return _c(\"div\", { ref: \"appNavigationContainer\", staticClass: \"app-navigation\", class: { \"app-navigation--close\": !_vm.open } }, [_c(\"nav\", { staticClass: \"app-navigation__content\", attrs: { \"id\": \"app-navigation-vue\", \"aria-hidden\": _vm.open ? \"false\" : \"true\", \"aria-label\": _vm.ariaLabel || void 0, \"aria-labelledby\": _vm.ariaLabelledby || void 0, \"inert\": !_vm.open || void 0 }, on: { \"keydown\": function($event) {\n    if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"esc\", 27, $event.key, [\"Esc\", \"Escape\"])) return null;\n    return _vm.handleEsc.apply(null, arguments);\n  } } }, [_c(\"div\", { staticClass: \"app-navigation__search\" }, [_vm._t(\"search\")], 2), _c(\"div\", { staticClass: \"app-navigation__body\", class: { \"app-navigation__body--no-list\": !_vm.$scopedSlots.list } }, [_vm._t(\"default\")], 2), _vm.$scopedSlots.list ? _c(\"NcAppNavigationList\", { staticClass: \"app-navigation__list\" }, [_vm._t(\"list\")], 2) : _vm._e(), _vm._t(\"footer\")], 2), _c(\"NcAppNavigationToggle\", { attrs: { \"open\": _vm.open }, on: { \"update:open\": _vm.toggleNavigation } })], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"119f2aad\"\n);\nconst NcAppNavigation = __component__.exports;\nexport {\n  NcAppNavigation as N\n};\n//# sourceMappingURL=NcAppNavigation-B2JTHiIB.mjs.map\n","import '../assets/NcAppNavigationCaption-C7GtQb_y.css';\nimport { N as NcActions } from \"./NcActions-w6duYgSh.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n  name: \"NcAppNavigationCaption\",\n  components: {\n    NcActions\n  },\n  inheritAttrs: false,\n  props: {\n    /**\n     * The text of the caption\n     */\n    name: {\n      type: String,\n      required: true\n    },\n    /**\n     * `id` to set on the inner caption\n     * Can be used for connecting the `NcActionCaption` with `NcActionList` using `aria-labelledby`.\n     */\n    headingId: {\n      type: String,\n      default: null\n    },\n    /**\n     * Enable when used as a heading\n     * e.g. Before NcAppNavigationList\n     */\n    isHeading: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * If `isHeading` is set, this defines the heading level that should be used\n     */\n    headingLevel: {\n      type: Number,\n      default: 2\n    },\n    /**\n     * Any [NcActions](#/Components/NcActions?id=ncactions-1) prop\n     */\n    // Not an actual prop but needed to show in vue-styleguidist docs\n    // eslint-disable-next-line\n    \" \": {}\n  },\n  computed: {\n    wrapperTag() {\n      return this.isHeading ? \"div\" : \"li\";\n    },\n    captionTag() {\n      const headingLevel = Math.max(2, this.headingLevel);\n      return this.isHeading ? `h${headingLevel}` : \"span\";\n    },\n    // Check if the actions slot is populated\n    hasActions() {\n      return !!this.$slots.actions;\n    }\n  }\n};\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c;\n  return _c(_vm.wrapperTag, { tag: \"component\", staticClass: \"app-navigation-caption\", class: { \"app-navigation-caption--heading\": _vm.isHeading } }, [_c(_vm.captionTag, { tag: \"component\", staticClass: \"app-navigation-caption__name\", attrs: { \"id\": _vm.headingId } }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]), _vm.hasActions ? _c(\"div\", { staticClass: \"app-navigation-caption__actions\" }, [_c(\"NcActions\", _vm._g(_vm._b({ scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n    return [_vm._t(\"actionsTriggerIcon\")];\n  }, proxy: true }], null, true) }, \"NcActions\", _vm.$attrs, false), _vm.$listeners), [_vm._t(\"actions\")], 2)], 1) : _vm._e()], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"fac69d4a\"\n);\nconst NcAppNavigationCaption = __component__.exports;\nexport {\n  NcAppNavigationCaption as N\n};\n//# sourceMappingURL=NcAppNavigationCaption-t7dcgEKd.mjs.map\n","import '../assets/NcAppNavigationNew-D8_2ab9R.css';\nimport { N as NcButton } from \"./NcButton-Dz2O6cSU.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n  components: {\n    NcButton\n  },\n  props: {\n    /**\n     * Id of the button\n     */\n    buttonId: {\n      type: String,\n      required: false,\n      default: \"\"\n    },\n    /**\n     * Disabled state of the button\n     */\n    disabled: {\n      type: Boolean,\n      required: false,\n      default: false\n    },\n    /**\n     * Main text of the button\n     */\n    text: {\n      type: String,\n      required: true\n    },\n    /**\n     * @deprecated use `variant` instead - will be removed with v9\n     */\n    type: {\n      type: String,\n      default: \"primary\",\n      validator(value) {\n        return [\"primary\", \"secondary\", \"tertiary\"].indexOf(value) !== -1;\n      }\n    },\n    /**\n     * The color variant to use.\n     *\n     * @default 'primary'\n     */\n    variant: {\n      type: String,\n      default: \"primary\",\n      validator(value) {\n        return [\"primary\", \"secondary\", \"tertiary\"].indexOf(value) !== -1;\n      }\n    }\n  },\n  emits: [\"click\"]\n};\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c;\n  return _c(\"div\", { staticClass: \"app-navigation-new\" }, [_c(\"NcButton\", { attrs: { \"id\": _vm.buttonId, \"disabled\": _vm.disabled, \"variant\": _vm.type !== \"primary\" ? _vm.type : _vm.variant }, on: { \"click\": function($event) {\n    return _vm.$emit(\"click\");\n  } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n    return [_vm._t(\"icon\")];\n  }, proxy: true }], null, true) }, [_vm._v(\" \" + _vm._s(_vm.text) + \" \")])], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"6f255eb3\"\n);\nconst NcAppNavigationNew = __component__.exports;\nexport {\n  NcAppNavigationNew as N\n};\n//# sourceMappingURL=NcAppNavigationNew-t3Rkrwjh.mjs.map\n","import '../assets/NcAppSidebarTab-IcebyGtN.css';\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n  name: \"NcAppSidebarTab\",\n  inject: [\"registerTab\", \"unregisterTab\", \"getActiveTab\", \"isTablistShown\"],\n  props: {\n    /**\n     * Unique id of the sidebar tab\n     */\n    id: {\n      type: String,\n      required: true\n    },\n    /**\n     * Tab name in navigation\n     */\n    name: {\n      type: String,\n      required: true\n    },\n    /**\n     * Tab icon's html class in navigation. Used if #icon slot is not provided\n     */\n    icon: {\n      type: String,\n      default: \"\"\n    },\n    /**\n     * Tab order in navigation. If not provided, name is used.\n     */\n    order: {\n      type: Number,\n      default: 0\n    }\n  },\n  emits: [\n    \"bottom-reached\",\n    \"scroll\"\n  ],\n  expose: [\"id\", \"name\", \"icon\", \"order\", \"renderIcon\"],\n  computed: {\n    /**\n     * Is the current tab an active tab, that should be shown?\n     *\n     * @return {boolean}\n     */\n    isActive() {\n      return this.getActiveTab() === this.id;\n    }\n  },\n  created() {\n    this.registerTab(this);\n  },\n  beforeDestroy() {\n    this.unregisterTab(this.id);\n  },\n  methods: {\n    onScroll(event) {\n      if (this.$el.scrollHeight - this.$el.scrollTop === this.$el.clientHeight) {\n        this.$emit(\"bottom-reached\", event);\n      }\n      this.$emit(\"scroll\", event);\n    },\n    /**\n     * Render tab's icon slot if any\n     *\n     * @return {import('vue').VNode[]}\n     */\n    renderIcon() {\n      return this.$scopedSlots.icon?.();\n    }\n  }\n};\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c;\n  return _c(\"section\", { staticClass: \"app-sidebar__tab\", class: { \"app-sidebar__tab--active\": _vm.isActive }, attrs: { \"id\": `tab-${_vm.id}`, \"aria-hidden\": !_vm.isActive, \"aria-label\": _vm.isTablistShown() ? void 0 : _vm.name, \"aria-labelledby\": _vm.isTablistShown() ? `tab-button-${_vm.id}` : void 0, \"tabindex\": _vm.isTablistShown() ? 0 : -1, \"role\": _vm.isTablistShown() ? \"tabpanel\" : void 0 }, on: { \"scroll\": _vm.onScroll } }, [_c(\"h3\", { staticClass: \"hidden-visually\" }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]), _vm._t(\"default\")], 2);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"bc553f62\"\n);\nconst NcAppSidebarTab = __component__.exports;\nexport {\n  NcAppSidebarTab as default\n};\n//# sourceMappingURL=NcAppSidebarTab.mjs.map\n","<!--\n  - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<NcAppContent\n\t\t:page-heading=\"\n\t\t\tform.title ? t('forms', 'Edit form') : t('forms', 'Create form')\n\t\t\">\n\t\t<!-- Show results & sidebar button -->\n\t\t<TopBar\n\t\t\t:archived=\"isFormArchived\"\n\t\t\t:locked=\"isFormLocked\"\n\t\t\t:permissions=\"form?.permissions\"\n\t\t\t:sidebar-opened=\"sidebarOpened\"\n\t\t\t:submission-count=\"form?.submissionCount\"\n\t\t\t@share-form=\"onShareForm\" />\n\n\t\t<NcEmptyContent\n\t\t\tv-if=\"isLoadingForm\"\n\t\t\tclass=\"emtpycontent\"\n\t\t\t:name=\"t('forms', 'Loading {title} …', { title: form.title })\">\n\t\t\t<template #icon>\n\t\t\t\t<NcLoadingIcon :size=\"64\" />\n\t\t\t</template>\n\t\t</NcEmptyContent>\n\n\t\t<NcEmptyContent\n\t\t\tv-else-if=\"isFormArchived\"\n\t\t\tclass=\"emtpycontent\"\n\t\t\t:name=\"t('forms', 'Form is archived')\"\n\t\t\t:description=\"\n\t\t\t\tt('forms', 'Form \\'{title}\\' is archived and cannot be modified.', {\n\t\t\t\t\ttitle: form.title,\n\t\t\t\t})\n\t\t\t\">\n\t\t\t<template #icon>\n\t\t\t\t<IconLock :size=\"64\" />\n\t\t\t</template>\n\t\t</NcEmptyContent>\n\n\t\t<NcEmptyContent\n\t\t\tv-else-if=\"isFormLocked\"\n\t\t\tclass=\"emtpycontent\"\n\t\t\t:name=\"t('forms', 'Form is locked')\"\n\t\t\t:description=\"\n\t\t\t\tt(\n\t\t\t\t\t'forms',\n\t\t\t\t\t'Form \\'{title}\\' is locked by {lockedBy} and cannot be modified. The lock expires: {lockedUntil}',\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: form.title,\n\t\t\t\t\t\tlockedBy: form.lockedBy,\n\t\t\t\t\t\tlockedUntil:\n\t\t\t\t\t\t\tform.lockedUntil === 0\n\t\t\t\t\t\t\t\t? t('forms', 'never')\n\t\t\t\t\t\t\t\t: lockedUntilFormatted,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\">\n\t\t\t<template #icon>\n\t\t\t\t<IconLock :size=\"64\" />\n\t\t\t</template>\n\t\t</NcEmptyContent>\n\n\t\t<template v-else>\n\t\t\t<!-- Forms title & description-->\n\t\t\t<header>\n\t\t\t\t<h2>\n\t\t\t\t\t<label class=\"hidden-visually\" for=\"form-title\">{{\n\t\t\t\t\t\tt('forms', 'Form title')\n\t\t\t\t\t}}</label>\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tid=\"form-title\"\n\t\t\t\t\t\tref=\"title\"\n\t\t\t\t\t\tv-model=\"form.title\"\n\t\t\t\t\t\tclass=\"form-title\"\n\t\t\t\t\t\trows=\"1\"\n\t\t\t\t\t\tdir=\"auto\"\n\t\t\t\t\t\t:maxlength=\"maxStringLengths.formTitle\"\n\t\t\t\t\t\t:placeholder=\"t('forms', 'Form title')\"\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t@keydown.enter.prevent\n\t\t\t\t\t\t@input=\"onTitleChange\" />\n\t\t\t\t</h2>\n\t\t\t\t<label class=\"hidden-visually\" for=\"form-desc\">\n\t\t\t\t\t{{ t('forms', 'Description') }}\n\t\t\t\t</label>\n\t\t\t\t<textarea\n\t\t\t\t\tid=\"form-desc\"\n\t\t\t\t\tref=\"description\"\n\t\t\t\t\tclass=\"form-desc\"\n\t\t\t\t\trows=\"1\"\n\t\t\t\t\tdir=\"auto\"\n\t\t\t\t\t:value=\"form.description\"\n\t\t\t\t\t:placeholder=\"\n\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t'forms',\n\t\t\t\t\t\t\t'Description (formatting using Markdown is supported)',\n\t\t\t\t\t\t)\n\t\t\t\t\t\"\n\t\t\t\t\t:maxlength=\"maxStringLengths.formDescription\"\n\t\t\t\t\t@input=\"updateDescription\" />\n\t\t\t\t<!-- Show expiration message-->\n\t\t\t\t<p v-if=\"form.expires && form.showExpiration\" class=\"info-message\">\n\t\t\t\t\t{{ expirationMessage }}\n\t\t\t\t</p>\n\t\t\t\t<!-- Generate form information message-->\n\t\t\t\t<p v-if=\"infoMessage\" class=\"info-message\">\n\t\t\t\t\t{{ infoMessage }}\n\t\t\t\t</p>\n\t\t\t</header>\n\n\t\t\t<section>\n\t\t\t\t<!-- Questions list -->\n\t\t\t\t<Draggable\n\t\t\t\t\tv-model=\"form.questions\"\n\t\t\t\t\t:animation=\"200\"\n\t\t\t\t\ttag=\"ul\"\n\t\t\t\t\thandle=\".question__drag-handle\"\n\t\t\t\t\t@change=\"onQuestionOrderChange\"\n\t\t\t\t\t@start=\"isDragging = true\"\n\t\t\t\t\t@end=\"isDragging = false\">\n\t\t\t\t\t<transition-group\n\t\t\t\t\t\t:name=\"\n\t\t\t\t\t\t\tisDragging\n\t\t\t\t\t\t\t\t? 'no-external-transition-on-drag'\n\t\t\t\t\t\t\t\t: 'question-list'\n\t\t\t\t\t\t\">\n\t\t\t\t\t\t<component\n\t\t\t\t\t\t\t:is=\"answerTypes[question.type].component\"\n\t\t\t\t\t\t\tv-for=\"(question, index) in form.questions\"\n\t\t\t\t\t\t\tref=\"questions\"\n\t\t\t\t\t\t\t:key=\"question.id\"\n\t\t\t\t\t\t\t:can-move-down=\"index < form.questions.length - 1\"\n\t\t\t\t\t\t\t:can-move-up=\"index > 0\"\n\t\t\t\t\t\t\t:answer-type=\"answerTypes[question.type]\"\n\t\t\t\t\t\t\t:index=\"index + 1\"\n\t\t\t\t\t\t\t:max-string-lengths=\"maxStringLengths\"\n\t\t\t\t\t\t\tv-bind.sync=\"form.questions[index]\"\n\t\t\t\t\t\t\t@clone=\"cloneQuestion(question)\"\n\t\t\t\t\t\t\t@delete=\"deleteQuestion(question.id)\"\n\t\t\t\t\t\t\t@move-down=\"onMoveDown(index)\"\n\t\t\t\t\t\t\t@move-up=\"onMoveUp(index)\" />\n\t\t\t\t\t</transition-group>\n\t\t\t\t</Draggable>\n\n\t\t\t\t<!-- Add new questions menu -->\n\t\t\t\t<div class=\"question-menu\">\n\t\t\t\t\t<NcActions\n\t\t\t\t\t\tref=\"questionMenu\"\n\t\t\t\t\t\t:open.sync=\"questionMenuOpened\"\n\t\t\t\t\t\t:menu-name=\"t('forms', 'Add a question')\"\n\t\t\t\t\t\t:aria-label=\"t('forms', 'Add a question')\"\n\t\t\t\t\t\tprimary>\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<NcLoadingIcon v-if=\"isLoadingQuestions\" :size=\"20\" />\n\t\t\t\t\t\t\t<IconPlus v-else :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-for=\"(answer, type) in answerTypesFilter\"\n\t\t\t\t\t\t\t:key=\"answer.label\"\n\t\t\t\t\t\t\tclose-after-click\n\t\t\t\t\t\t\t:disabled=\"isLoadingQuestions\"\n\t\t\t\t\t\t\tclass=\"question-menu__question\"\n\t\t\t\t\t\t\t@click=\"addQuestion(type)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Icon :is=\"answer.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ answer.label }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t</NcActions>\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t</template>\n\t</NcAppContent>\n</template>\n\n<script>\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { loadState } from '@nextcloud/initial-state'\nimport { showError } from '@nextcloud/dialogs'\nimport { emit } from '@nextcloud/event-bus'\nimport axios from '@nextcloud/axios'\nimport moment from '@nextcloud/moment'\nimport debounce from 'debounce'\nimport Draggable from 'vuedraggable'\n\nimport NcActionButton from '@nextcloud/vue/components/NcActionButton'\nimport NcActions from '@nextcloud/vue/components/NcActions'\nimport NcAppContent from '@nextcloud/vue/components/NcAppContent'\nimport NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'\nimport NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'\nimport NcNoteCard from '@nextcloud/vue/components/NcNoteCard'\nimport IconLock from 'vue-material-design-icons/LockOutline.vue'\nimport IconPlus from 'vue-material-design-icons/Plus.vue'\n\nimport { FormState, INPUT_DEBOUNCE_MS } from '../models/Constants.ts'\nimport answerTypes from '../models/AnswerTypes.js'\nimport Question from '../components/Questions/Question.vue'\nimport QuestionLong from '../components/Questions/QuestionLong.vue'\nimport QuestionMultiple from '../components/Questions/QuestionMultiple.vue'\nimport QuestionShort from '../components/Questions/QuestionShort.vue'\nimport TopBar from '../components/TopBar.vue'\nimport ViewsMixin from '../mixins/ViewsMixin.js'\nimport logger from '../utils/Logger.js'\nimport SetWindowTitle from '../utils/SetWindowTitle.js'\nimport OcsResponse2Data from '../utils/OcsResponse2Data.js'\n\nwindow.axios = axios\n\nexport default {\n\tname: 'Create',\n\tcomponents: {\n\t\tDraggable,\n\t\tIconLock,\n\t\tIconPlus,\n\t\tNcActionButton,\n\t\tNcActions,\n\t\tNcAppContent,\n\t\tNcEmptyContent,\n\t\tNcLoadingIcon,\n\t\tNcNoteCard,\n\t\tQuestion,\n\t\tQuestionLong,\n\t\tQuestionShort,\n\t\tQuestionMultiple,\n\t\tTopBar,\n\t},\n\n\tmixins: [ViewsMixin],\n\n\tdata() {\n\t\treturn {\n\t\t\tanswerTypes,\n\n\t\t\t// Various states\n\t\t\tisLoadingQuestions: false,\n\t\t\tisDragging: false,\n\n\t\t\tmaxStringLengths: loadState('forms', 'maxStringLengths'),\n\t\t\tquestionMenuOpened: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\thasQuestions() {\n\t\t\treturn this.form.questions && this.form.questions.length === 0\n\t\t},\n\n\t\tisRequiredUsed() {\n\t\t\treturn this.form.questions.reduce(\n\t\t\t\t(isUsed, question) => isUsed || question.isRequired,\n\t\t\t\tfalse,\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Check if form is expired\n\t\t */\n\t\tisExpired() {\n\t\t\treturn this.form.expires && moment().unix() > this.form.expires\n\t\t},\n\n\t\t/**\n\t\t * Check if the form was archived\n\t\t */\n\t\tisFormArchived() {\n\t\t\treturn this.form.state === FormState.FormArchived\n\t\t},\n\n\t\tinfoMessage() {\n\t\t\tlet message = ''\n\t\t\tif (this.form.isAnonymous) {\n\t\t\t\tmessage += t('forms', 'Responses are anonymous.')\n\t\t\t}\n\n\t\t\t// On Submit, this is dependent on `isLoggedIn`. Create-view is always logged in and the variable isLoggedIn does not exist.\n\t\t\tif (!this.form.isAnonymous && true) {\n\t\t\t\tmessage += t('forms', 'Responses are connected to your account.')\n\t\t\t}\n\n\t\t\tif (this.isRequiredUsed) {\n\t\t\t\tmessage +=\n\t\t\t\t\t' '\n\t\t\t\t\t+ t('forms', 'An asterisk (*) indicates mandatory questions.')\n\t\t\t}\n\n\t\t\treturn message\n\t\t},\n\n\t\texpirationMessage() {\n\t\t\tconst relativeDate = moment(this.form.expires, 'X')\n\t\t\t\t.locale(window.OC.getLanguage())\n\t\t\t\t.fromNow()\n\t\t\tif (this.isExpired) {\n\t\t\t\treturn t('forms', 'Expired {relativeDate}.', { relativeDate })\n\t\t\t}\n\t\t\treturn t('forms', 'Expires {relativeDate}.', { relativeDate })\n\t\t},\n\n\t\t// Remove properties from answerTypes for create button\n\t\tanswerTypesFilter() {\n\t\t\t// Extract property datetime from answerTypes and copy rest to filteredAnswerTypes\n\t\t\tconst { datetime, ...filteredAnswerTypes } = answerTypes\n\t\t\treturn filteredAnswerTypes\n\t\t},\n\n\t\tlockedUntilFormatted() {\n\t\t\treturn moment(this.form.lockedUntil, 'X').fromNow()\n\t\t},\n\t},\n\n\twatch: {\n\t\t// Fetch full form on change\n\t\thash() {\n\t\t\tthis.fetchFullForm(this.form.id)\n\t\t},\n\n\t\t// Update Window-Title on title change\n\t\t'form.title'() {\n\t\t\tSetWindowTitle(this.formTitle)\n\t\t},\n\n\t\t// resize description if form is loaded\n\t\tisLoadingForm(value) {\n\t\t\tif (!value) {\n\t\t\t\tthis.resizeTitle()\n\t\t\t\tthis.resizeDescription()\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.fetchFullForm(this.form.id)\n\t\tSetWindowTitle(this.formTitle)\n\t},\n\n\tmethods: {\n\t\tonMoveUp(index) {\n\t\t\tif (index > 0) {\n\t\t\t\t;[this.form.questions[index - 1], this.form.questions[index]] = [\n\t\t\t\t\tthis.form.questions[index],\n\t\t\t\t\tthis.form.questions[index - 1],\n\t\t\t\t]\n\t\t\t\tthis.onQuestionOrderChange()\n\t\t\t}\n\t\t},\n\t\tonMoveDown(index) {\n\t\t\t// only if not the last one\n\t\t\tif (index < this.form.questions.length - 1) {\n\t\t\t\tthis.onMoveUp(index + 1)\n\t\t\t}\n\t\t},\n\t\tonTitleChange() {\n\t\t\tthis.resizeTitle()\n\t\t\tthis.saveTitle()\n\t\t},\n\n\t\t/**\n\t\t * Auto adjust the title height based its scroll height\n\t\t */\n\t\tresizeTitle() {\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tconst textarea = this.$refs.title\n\t\t\t\ttextarea.style.cssText = 'height: 0'\n\t\t\t\t// include 2px border\n\t\t\t\ttextarea.style.cssText = `height: ${textarea.scrollHeight + 4}px`\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Auto adjust the description height based on its scroll height\n\t\t */\n\t\tresizeDescription() {\n\t\t\t// nextTick to ensure textarea is attached to DOM\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tconst textarea = this.$refs.description\n\t\t\t\ttextarea.style.cssText = 'height: 0'\n\t\t\t\t// include 2px border\n\t\t\t\ttextarea.style.cssText = `height: ${textarea.scrollHeight + 4}px`\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Update the description\n\t\t *\n\t\t * @param {InputEvent} ev The input event of the textarea\n\t\t */\n\t\tupdateDescription({ target }) {\n\t\t\tthis.form.description = target.value\n\t\t\tthis.resizeDescription()\n\t\t\tthis.saveDescription()\n\t\t},\n\n\t\t/**\n\t\t * Title & description save methods\n\t\t */\n\t\tsaveTitle: debounce(async function () {\n\t\t\tthis.saveFormProperty('title')\n\t\t}, INPUT_DEBOUNCE_MS),\n\t\tsaveDescription: debounce(async function () {\n\t\t\tthis.saveFormProperty('description')\n\t\t}, INPUT_DEBOUNCE_MS),\n\n\t\t/**\n\t\t * Add a new question to the current form\n\t\t *\n\t\t * @param {string} type the question type, see AnswerTypes\n\t\t */\n\t\tasync addQuestion(type) {\n\t\t\tconst text = ''\n\t\t\tthis.isLoadingQuestions = true\n\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/questions', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\ttext,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tconst question = OcsResponse2Data(response)\n\n\t\t\t\t// Add newly created question\n\t\t\t\tthis.form.questions.push(\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tanswers: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tquestion,\n\t\t\t\t\t),\n\t\t\t\t)\n\n\t\t\t\t// Focus newly added question\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tconst lastQuestion =\n\t\t\t\t\t\tthis.$refs.questions[this.$refs.questions.length - 1]\n\t\t\t\t\tlastQuestion.focus()\n\t\t\t\t})\n\n\t\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while adding new question', { error })\n\t\t\t\tshowError(\n\t\t\t\t\tt('forms', 'There was an error while adding the new question'),\n\t\t\t\t)\n\t\t\t} finally {\n\t\t\t\tthis.isLoadingQuestions = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete a question\n\t\t *\n\t\t * @param {number} questionId the question id to delete\n\t\t */\n\t\tasync deleteQuestion(questionId) {\n\t\t\tthis.isLoadingQuestions = true\n\n\t\t\ttry {\n\t\t\t\tawait axios.delete(\n\t\t\t\t\tgenerateOcsUrl(\n\t\t\t\t\t\t'apps/forms/api/v3/forms/{id}/questions/{questionId}',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t\tquestionId,\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tconst index = this.form.questions.findIndex(\n\t\t\t\t\t(search) => search.id === questionId,\n\t\t\t\t)\n\t\t\t\tthis.form.questions.splice(index, 1)\n\t\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error(`Error while removing question ${questionId}`, {\n\t\t\t\t\terror,\n\t\t\t\t})\n\t\t\t\tshowError(\n\t\t\t\t\tt('forms', 'There was an error while removing the question'),\n\t\t\t\t)\n\t\t\t} finally {\n\t\t\t\tthis.isLoadingQuestions = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Clone a question\n\t\t *\n\t\t * @param {number} id the question id to clone in the current form\n\t\t */\n\t\tasync cloneQuestion({ id }) {\n\t\t\tthis.isLoadingQuestions = true\n\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(\n\t\t\t\t\tgenerateOcsUrl(\n\t\t\t\t\t\t'apps/forms/api/v3/forms/{id}/questions?fromId={questionId}',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t\tquestionId: id,\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tconst question = OcsResponse2Data(response)\n\n\t\t\t\tthis.form.questions.push(\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tanswers: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tquestion,\n\t\t\t\t\t),\n\t\t\t\t)\n\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tconst lastQuestion =\n\t\t\t\t\t\tthis.$refs.questions[this.$refs.questions.length - 1]\n\t\t\t\t\tlastQuestion.focus()\n\t\t\t\t})\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error(`Error while duplicating question ${id}`, {\n\t\t\t\t\terror,\n\t\t\t\t})\n\t\t\t\tshowError('There was an error while duplicating the question')\n\t\t\t} finally {\n\t\t\t\tthis.isLoadingQuestions = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Reorder questions on dragEnd\n\t\t */\n\t\tasync onQuestionOrderChange() {\n\t\t\tthis.isLoadingQuestions = true\n\t\t\tconst newOrder = this.form.questions.map((question) => question.id)\n\n\t\t\ttry {\n\t\t\t\tawait axios.patch(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/questions', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\tnewOrder,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while saving form', { error })\n\t\t\t\tshowError(t('forms', 'Error while saving form'))\n\t\t\t} finally {\n\t\t\t\tthis.isLoadingQuestions = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n.question-list-move {\n\ttransition: all 0.2s ease;\n}\n</style>\n\n<style lang=\"scss\" scoped>\n@import '../scssmixins/markdownOutput';\n\n.emptycontent {\n\tdisplay: flex;\n\theight: 100%;\n}\n\n.app-content {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-direction: column;\n\n\theader,\n\tsection {\n\t\twidth: 100%;\n\t\tmax-width: 750px;\n\t}\n\n\t// Title & description header\n\theader {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmargin: 0;\n\t\tmargin-block-end: 24px;\n\t\tpadding-inline-start: 32px;\n\t\tmargin-inline-end: -24px;\n\n\t\t.form-title {\n\t\t\tfont-size: 28px;\n\t\t\tfont-weight: bold;\n\t\t\tline-height: 34px;\n\t\t\tcolor: var(--color-main-text);\n\t\t\tmin-height: 36px;\n\t\t\t// padding and margin should be aligned with the submit view (but keep the 2px border in mind)\n\t\t\tpadding-block: 4px;\n\t\t\tpadding-inline: 10px;\n\t\t\tmargin-block: 22px 14px;\n\t\t\tmargin-inline: 0;\n\t\t\twidth: calc(\n\t\t\t\t100% - 58px\n\t\t\t); // margin of header, needed if screen is < 806px (max-width + margin-left)\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tresize: none;\n\n\t\t\t&::placeholder {\n\t\t\t\tfont-size: 28px;\n\t\t\t}\n\t\t}\n\n\t\t.form-desc,\n\t\t.info-message {\n\t\t\tfont-size: 100%;\n\t\t\tmin-height: unset;\n\t\t\tpadding-block: 0px 20px;\n\t\t\tpadding-inline: 12px;\n\t\t\twidth: calc(100% - 58px);\n\t\t}\n\n\t\t.form-desc {\n\t\t\tcolor: var(--color-main-text);\n\t\t\tline-height: 22px;\n\t\t\tmin-height: 47px; // one line (25px padding + 22px text height)\n\t\t\tpadding-block-start: 5px; // spacing border<>text\n\t\t\tmargin: 0px;\n\t\t\tpadding-block: 3px 18px; // 2px smaller because of border\n\t\t\tpadding-inline: 10px;\n\t\t\tresize: none;\n\t\t}\n\n\t\t.info-message {\n\t\t\tmargin-block-start: 4px;\n\t\t\tresize: none;\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\n\t// Questions container\n\tsection {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmargin-block-end: 250px;\n\n\t\t.question-menu {\n\t\t\tposition: sticky;\n\t\t\tinset-block-end: 0px;\n\t\t\tpadding-block-end: 16px;\n\t\t\t// Above other menus\n\t\t\tz-index: 55;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\talign-self: flex-start;\n\n\t\t\t// To align with text\n\t\t\tmargin-inline-start: var(--default-clickable-area);\n\t\t}\n\t}\n}\n</style>\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-delete\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z\\\" /></svg>\"","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon tray-arrow-down-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"TrayArrowDownIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon file-delimited-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2M18 20H6V4H13V9H18V20M10 19L12 15H9V10H15V15L13 19H10\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"FileDelimitedOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-file-delimited-outline\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2M18 20H6V4H13V9H18V20M10 19L12 15H9V10H15V15L13 19H10\\\" /></svg>\"","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon file-excel-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M12.9 14.5L15.8 19H14L12 15.6L10 19H8.2L11.1 14.5L8.2 10H10L12 13.4L14 10H15.8L12.9 14.5Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"FileExcelOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-file-excel-outline\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M12.9 14.5L15.8 19H14L12 15.6L10 19H8.2L11.1 14.5L8.2 10H10L12 13.4L14 10H15.8L12.9 14.5Z\\\" /></svg>\"","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon folder-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"FolderOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon link-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"LinkIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-link\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z\\\" /></svg>\"","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon link-off-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.43 19.12,14.63 17.79,15L19.25,16.44C20.88,15.61 22,13.95 22,12A5,5 0 0,0 17,7M16,11H13.81L15.81,13H16V11M2,4.27L5.11,7.38C3.29,8.12 2,9.91 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12C3.9,10.41 5.11,9.1 6.66,8.93L8.73,11H8V13H10.73L13,15.27V17H14.73L18.74,21L20,19.74L3.27,3L2,4.27Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"LinkOffIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-link-off\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.43 19.12,14.63 17.79,15L19.25,16.44C20.88,15.61 22,13.95 22,12A5,5 0 0,0 17,7M16,11H13.81L15.81,13H16V11M2,4.27L5.11,7.38C3.29,8.12 2,9.91 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12C3.9,10.41 5.11,9.1 6.66,8.93L8.73,11H8V13H10.73L13,15.27V17H14.73L18.74,21L20,19.74L3.27,3L2,4.27Z\\\" /></svg>\"","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon poll-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M3,22V8H7V22H3M10,22V2H14V22H10M17,22V14H21V22H17Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"PollIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon refresh-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"RefreshIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon table-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M5,4H19A2,2 0 0,1 21,6V18A2,2 0 0,1 19,20H5A2,2 0 0,1 3,18V6A2,2 0 0,1 5,4M5,8V12H11V8H5M13,8V12H19V8H13M5,14V18H11V14H5M13,14V18H19V14H13Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"TableIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-table\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M5,4H19A2,2 0 0,1 21,6V18A2,2 0 0,1 19,20H5A2,2 0 0,1 3,18V6A2,2 0 0,1 5,4M5,8V12H11V8H5M13,8V12H19V8H13M5,14V18H11V14H5M13,14V18H19V14H13Z\\\" /></svg>\"","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon magnify-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"MagnifyIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<!--\n  - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div class=\"section question-summary\">\n\t\t<h3 dir=\"auto\">\n\t\t\t{{ question.text }}\n\t\t</h3>\n\t\t<p class=\"question-summary__detail\">\n\t\t\t{{ questionTypeLabel }}\n\t\t</p>\n\n\t\t<!-- Answers with countable results for visualization -->\n\t\t<ol\n\t\t\tv-if=\"answerTypes[question.type].predefined\"\n\t\t\tclass=\"question-summary__statistic\">\n\t\t\t<li v-for=\"option in questionOptions\" :key=\"option.id\">\n\t\t\t\t<label :for=\"`option-${option.questionId}-${option.id}`\">\n\t\t\t\t\t{{ option.count }}\n\t\t\t\t\t<span class=\"question-summary__statistic-percentage\">\n\t\t\t\t\t\t({{ option.percentage }}%):\n\t\t\t\t\t</span>\n\t\t\t\t\t<span\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'question-summary__statistic-text--best': option.best,\n\t\t\t\t\t\t}\">\n\t\t\t\t\t\t{{ option.text }}\n\t\t\t\t\t</span>\n\t\t\t\t</label>\n\t\t\t\t<meter\n\t\t\t\t\t:id=\"`option-${option.questionId}-${option.id}`\"\n\t\t\t\t\tmin=\"0\"\n\t\t\t\t\t:max=\"submissions.length\"\n\t\t\t\t\t:value=\"option.count\" />\n\t\t\t</li>\n\t\t</ol>\n\n\t\t<!-- Text answers are simply listed for now, could be automatically grouped in the future -->\n\t\t<ul v-else class=\"question-summary__text\">\n\t\t\t<!-- Do not wrap the following line between tags! `white-space:pre-line` respects `\\n` but would produce additional empty first line -->\n\t\t\t<!-- eslint-disable-next-line -->\n\t\t\t<li v-for=\"(answer, index) in answers\" :key=\"answer.id\" dir=\"auto\">\n\t\t\t\t<template v-if=\"answer.url\">\n\t\t\t\t\t<a :href=\"answer.url\" target=\"_blank\">\n\t\t\t\t\t\t<IconFile :size=\"20\" class=\"question-summary__text-icon\" />\n\t\t\t\t\t\t{{ answer.text }}\n\t\t\t\t\t</a>\n\t\t\t\t</template>\n\t\t\t\t<template v-else-if=\"question.type === 'color'\">\n\t\t\t\t\t<div class=\"color__result\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-if=\"answer.id !== 0\"\n\t\t\t\t\t\t\t:style=\"{ 'background-color': answer.text }\"\n\t\t\t\t\t\t\t:class=\"\n\t\t\t\t\t\t\t\tindex === 1\n\t\t\t\t\t\t\t\t\t? 'color__field color__field__first'\n\t\t\t\t\t\t\t\t\t: 'color__field'\n\t\t\t\t\t\t\t\" />\n\t\t\t\t\t\t{{ answer.text }}\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t\t<template v-else>\n\t\t\t\t\t{{ answer.text }}\n\t\t\t\t</template>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport answerTypes from '../../models/AnswerTypes.js'\nimport { generateUrl } from '@nextcloud/router'\nimport IconFile from 'vue-material-design-icons/FileOutline.vue'\n\nexport default {\n\tname: 'ResultsSummary',\n\n\tcomponents: {\n\t\tIconFile,\n\t},\n\n\tprops: {\n\t\tsubmissions: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t\tquestion: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tanswerTypes,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tquestionTypeLabel() {\n\t\t\tconst label = this.answerTypes[this.question.type].label\n\n\t\t\tif (this.question.type === 'linearscale') {\n\t\t\t\tconst labelLowest =\n\t\t\t\t\tthis.question.extraSettings?.optionsLabelLowest\n\t\t\t\t\t?? t('forms', 'Strongly disagree')\n\t\t\t\tconst labelHighest =\n\t\t\t\t\tthis.question.extraSettings?.optionsLabelHighest\n\t\t\t\t\t?? t('forms', 'Strongly agree')\n\t\t\t\tconst optionsLowest =\n\t\t\t\t\tthis.question.extraSettings?.optionsLowest?.toString() ?? '1'\n\t\t\t\tconst optionsHighest =\n\t\t\t\t\tthis.question.extraSettings?.optionsHighest?.toString() ?? '5'\n\n\t\t\t\tconst descriptionParts = []\n\t\t\t\tif (labelLowest !== '') {\n\t\t\t\t\tdescriptionParts.push(`${optionsLowest}: ${labelLowest}`)\n\t\t\t\t}\n\t\t\t\tif (labelHighest !== '') {\n\t\t\t\t\tdescriptionParts.push(`${optionsHighest}: ${labelHighest}`)\n\t\t\t\t}\n\t\t\t\tconst description = ` (${descriptionParts.join(', ')})`\n\t\t\t\treturn label + description\n\t\t\t}\n\n\t\t\treturn label\n\t\t},\n\n\t\t// For countable questions like multiple choice and checkboxes\n\t\tquestionOptions() {\n\t\t\t// Build list of question options\n\t\t\tlet questionOptionsStats\n\t\t\tif (this.question.type !== 'linearscale') {\n\t\t\t\tquestionOptionsStats = this.question.options.map((option) => ({\n\t\t\t\t\t...option,\n\t\t\t\t\tcount: 0,\n\t\t\t\t\tpercentage: 0,\n\t\t\t\t}))\n\t\t\t} else {\n\t\t\t\tquestionOptionsStats = Array.from(\n\t\t\t\t\t{\n\t\t\t\t\t\tlength:\n\t\t\t\t\t\t\t(this.question.extraSettings?.optionsHighest ?? 5)\n\t\t\t\t\t\t\t- (this.question.extraSettings?.optionsLowest ?? 1)\n\t\t\t\t\t\t\t+ 1,\n\t\t\t\t\t},\n\t\t\t\t\t(_, i) => ({\n\t\t\t\t\t\ttext: (\n\t\t\t\t\t\t\ti + (this.question.extraSettings?.optionsLowest ?? 1)\n\t\t\t\t\t\t).toString(),\n\t\t\t\t\t\tcount: 0,\n\t\t\t\t\t\tpercentage: 0,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// Also record 'Other'\n\t\t\tif (this.question.extraSettings?.allowOtherAnswer) {\n\t\t\t\tquestionOptionsStats.unshift({\n\t\t\t\t\ttext: t('forms', 'Other'),\n\t\t\t\t\tcount: 0,\n\t\t\t\t\tpercentage: 0,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// Also record 'No response'\n\t\t\tquestionOptionsStats.unshift({\n\t\t\t\t// TRANSLATORS Counts on Results-Summary, how many users did not respond to this question.\n\t\t\t\ttext: t('forms', 'No response'),\n\t\t\t\tcount: 0,\n\t\t\t\tpercentage: 0,\n\t\t\t})\n\n\t\t\t// Go through submissions to check which options have how many responses\n\t\t\tthis.submissions.forEach((submission) => {\n\t\t\t\tconst answers = submission.answers.filter(\n\t\t\t\t\t(answer) => answer.questionId === this.question.id,\n\t\t\t\t)\n\t\t\t\tif (!answers.length) {\n\t\t\t\t\t// Record 'No response'\n\t\t\t\t\tquestionOptionsStats[0].count++\n\t\t\t\t}\n\n\t\t\t\t// Check question options to find which needs to be increased\n\t\t\t\tanswers.forEach((answer) => {\n\t\t\t\t\tconst optionsStatIndex = questionOptionsStats.findIndex(\n\t\t\t\t\t\t(option) => option.text === answer.text,\n\t\t\t\t\t)\n\t\t\t\t\tif (optionsStatIndex < 0) {\n\t\t\t\t\t\tif (this.question.extraSettings?.allowOtherAnswer) {\n\t\t\t\t\t\t\tquestionOptionsStats[1].count++\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tquestionOptionsStats.push({\n\t\t\t\t\t\t\t\ttext: answer.text,\n\t\t\t\t\t\t\t\tcount: 1,\n\t\t\t\t\t\t\t\tpercentage: 0,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquestionOptionsStats[optionsStatIndex].count++\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\n\t\t\t// Sort options by response count\n\t\t\tif (this.question.type !== 'linearscale') {\n\t\t\t\tquestionOptionsStats.sort((object1, object2) => {\n\t\t\t\t\treturn object2.count - object1.count\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// for linear scale questions move the \"No response\" element to the end\n\t\t\t\tquestionOptionsStats.push(questionOptionsStats.shift())\n\t\t\t}\n\n\t\t\tquestionOptionsStats.forEach((questionOptionsStat) => {\n\t\t\t\t// Fill percentage values\n\t\t\t\tquestionOptionsStat.percentage = Math.round(\n\t\t\t\t\t(100 * questionOptionsStat.count) / this.submissions.length,\n\t\t\t\t)\n\t\t\t\t// Mark all best results\n\t\t\t\tconst maxCount = Math.max(\n\t\t\t\t\t...questionOptionsStats.map((option) => option.count),\n\t\t\t\t)\n\t\t\t\tquestionOptionsStat.best = questionOptionsStat.count === maxCount\n\t\t\t})\n\n\t\t\treturn questionOptionsStats\n\t\t},\n\n\t\t// For text answers like short answer and long text\n\t\tanswers() {\n\t\t\tconst answersModels = []\n\n\t\t\t// Also record 'No response'\n\t\t\tlet noResponseCount = 0\n\n\t\t\t// Go through submissions to check which options have how many responses\n\t\t\tthis.submissions.forEach((submission) => {\n\t\t\t\tconst answers = submission.answers.filter(\n\t\t\t\t\t(answer) => answer.questionId === this.question.id,\n\t\t\t\t)\n\t\t\t\tif (!answers.length) {\n\t\t\t\t\t// Record 'No response'\n\t\t\t\t\tnoResponseCount++\n\t\t\t\t}\n\n\t\t\t\t// Add text answers\n\t\t\t\tif (\n\t\t\t\t\t['date', 'time'].includes(this.question.type)\n\t\t\t\t\t&& answers.length === 2\n\t\t\t\t) {\n\t\t\t\t\t// Combine the first two answers in order for date range questions\n\t\t\t\t\tanswersModels.push({\n\t\t\t\t\t\tid: `${answers[0].id}-${answers[1].id}`,\n\t\t\t\t\t\ttext: `${answers[0].text} - ${answers[1].text}`,\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tanswers.forEach((answer) => {\n\t\t\t\t\t\tif (answer.fileId) {\n\t\t\t\t\t\t\tanswersModels.push({\n\t\t\t\t\t\t\t\tid: answer.id,\n\t\t\t\t\t\t\t\ttext: answer.text,\n\t\t\t\t\t\t\t\turl: generateUrl('/f/{fileId}', {\n\t\t\t\t\t\t\t\t\tfileId: answer.fileId,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tanswersModels.push({\n\t\t\t\t\t\t\t\tid: answer.id,\n\t\t\t\t\t\t\t\ttext: answer.text,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// Calculate no response percentage\n\t\t\tconst noResponsePercentage = Math.round(\n\t\t\t\t(100 * noResponseCount) / this.submissions.length,\n\t\t\t)\n\t\t\tanswersModels.unshift({\n\t\t\t\tid: 0,\n\t\t\t\ttext:\n\t\t\t\t\tnoResponseCount\n\t\t\t\t\t+ ' ('\n\t\t\t\t\t+ noResponsePercentage\n\t\t\t\t\t+ '%): '\n\t\t\t\t\t+ t('forms', 'No response'),\n\t\t\t})\n\n\t\t\treturn answersModels\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.question-summary {\n\tpadding-inline: var(--default-clickable-area) 16px;\n\n\th3 {\n\t\tfont-weight: bold;\n\t}\n\n\t&__detail {\n\t\tcolor: var(--color-text-lighter);\n\t\tmargin-block-start: -8px;\n\t}\n\n\t&__text,\n\t&__statistic {\n\t\tmargin-block-start: 8px;\n\t}\n\n\t&__text {\n\t\tlist-style-type: initial;\n\n\t\tli {\n\t\t\tpadding-block: 4px;\n\t\t\tpadding-inline: 0;\n\t\t\twhite-space: pre-line;\n\n\t\t\t&:first-child {\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\t\t}\n\n\t\t&-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t}\n\t}\n\n\t&__statistic {\n\t\tlist-style-type: none;\n\n\t\tli {\n\t\t\tposition: relative;\n\t\t\tpadding-block: 8px;\n\t\t\tpadding-inline: 0;\n\n\t\t\tlabel {\n\t\t\t\tcursor: default;\n\t\t\t}\n\n\t\t\t.question-summary__statistic-text--best {\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\n\t\t\t.question-summary__statistic-percentage {\n\t\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\t}\n\n\t\t\tmeter {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t\tmargin-block-start: 4px;\n\t\t\t\tbackground: var(--color-background-dark);\n\t\t\t\theight: calc(var(--border-radius) * 2);\n\t\t\t\tborder-radius: var(--border-radius);\n\n\t\t\t\t&::-webkit-meter-bar {\n\t\t\t\t\theight: calc(var(--border-radius) * 2);\n\t\t\t\t}\n\n\t\t\t\t// The pseudo-classes of -moz and -webkit have to stay separated even with SCSS, otherwise they don’t work\n\t\t\t\t&::-webkit-meter-optimum-value {\n\t\t\t\t\t// TODO switch to old gradient if it becomes available in server\n\t\t\t\t\tbackground: var(--gradient-primary-background);\n\t\t\t\t\tborder-radius: var(--border-radius);\n\t\t\t\t}\n\n\t\t\t\t&::-moz-meter-bar {\n\t\t\t\t\t// TODO switch to old gradient if it becomes available in server\n\t\t\t\t\tbackground: var(--gradient-primary-background);\n\t\t\t\t\tborder-radius: var(--border-radius);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.color__field {\n\t\twidth: 100px;\n\t\theight: var(--default-clickable-area);\n\t\tborder-radius: var(--border-radius-element);\n\t\tposition: relative;\n\t\tinset-block-start: 12px;\n\n\t\t&__first {\n\t\t\tmargin-block-start: -12px;\n\t\t}\n\t}\n\n\t.color__result {\n\t\talign-items: baseline;\n\t\tdisplay: flex;\n\t\tgap: calc(var(--clickable-area-small) / 2);\n\t}\n}\n</style>\n","<!--\n  - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div class=\"answer\">\n\t\t<h4 class=\"answer__question-text\" dir=\"auto\">\n\t\t\t{{ questionText }}\n\t\t</h4>\n\t\t<!-- Do not wrap the following line between tags! `white-space:pre-line` respects `\\n` but would produce additional empty first line -->\n\t\t<!-- eslint-disable-next-line -->\n\t\t<template v-if=\"answers.length\">\n\t\t\t<p\n\t\t\t\tv-for=\"answer of answers\"\n\t\t\t\t:key=\"answer.id\"\n\t\t\t\tclass=\"answer__text\"\n\t\t\t\tdir=\"auto\">\n\t\t\t\t<a :href=\"answer.url\" target=\"_blank\">\n\t\t\t\t\t<IconFile :size=\"20\" class=\"answer__text-icon\" />\n\t\t\t\t\t<NcHighlight :text=\"answer.text\" :search=\"highlight\" />\n\t\t\t\t</a>\n\t\t\t</p>\n\t\t</template>\n\t\t<template v-else-if=\"questionType === 'color'\">\n\t\t\t<div class=\"color__result\">\n\t\t\t\t<div\n\t\t\t\t\t:style=\"{ 'background-color': answerText }\"\n\t\t\t\t\tclass=\"color__field\" />\n\t\t\t\t<NcHighlight :text=\"answerText\" :search=\"highlight\" />\n\t\t\t</div>\n\t\t</template>\n\t\t<p v-else class=\"answer__text\" dir=\"auto\">\n\t\t\t<NcHighlight :text=\"answerText\" :search=\"highlight\" />\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport IconFile from 'vue-material-design-icons/FileOutline.vue'\nimport NcHighlight from '@nextcloud/vue/components/NcHighlight'\n\nexport default {\n\tname: 'Answer',\n\tcomponents: {\n\t\tIconFile,\n\t\tNcHighlight,\n\t},\n\n\tprops: {\n\t\tanswers: {\n\t\t\ttype: Array,\n\t\t\trequired: false,\n\t\t\tdefault: () => [],\n\t\t},\n\t\tanswerText: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: '',\n\t\t},\n\t\tquestionText: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tquestionType: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\thighlight: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: '',\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.answer {\n\tmargin-block-start: 12px;\n\twidth: 100%;\n\n\t&__question-text {\n\t\tfont-weight: bold;\n\t}\n\n\t&__text {\n\t\twhite-space: pre-line;\n\n\t\t&-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t}\n\t}\n\n\t.color__field {\n\t\twidth: 100px;\n\t\theight: var(--default-clickable-area);\n\t\tborder-radius: var(--border-radius-element);\n\t\tposition: relative;\n\t\tinset-block-start: 12px;\n\t\tmargin-block-start: -12px;\n\t}\n\n\t.color__result {\n\t\talign-items: baseline;\n\t\tdisplay: flex;\n\t\tgap: calc(var(--clickable-area-small) / 2);\n\t}\n}\n</style>\n","<!--\n  - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div class=\"section submission\">\n\t\t<div class=\"submission-head\">\n\t\t\t<h3 dir=\"auto\">\n\t\t\t\t{{ submission.userDisplayName }}\n\t\t\t</h3>\n\t\t\t<NcActions class=\"submission-menu\" force-menu>\n\t\t\t\t<NcActionRouter\n\t\t\t\t\tv-if=\"canEditSubmission\"\n\t\t\t\t\t:to=\"{\n\t\t\t\t\t\tname: 'submit',\n\t\t\t\t\t\tparams: { hash: formHash, submissionId: submission.id },\n\t\t\t\t\t}\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<IconPencil :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ t('forms', 'Edit this response') }}\n\t\t\t\t</NcActionRouter>\n\t\t\t\t<NcActionButton v-if=\"canDeleteSubmission\" @click=\"onDelete\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<IconDelete :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ t('forms', 'Delete this response') }}\n\t\t\t\t</NcActionButton>\n\t\t\t</NcActions>\n\t\t</div>\n\t\t<p class=\"submission-date\">\n\t\t\t{{ submissionDateTime }}\n\t\t</p>\n\n\t\t<Answer\n\t\t\tv-for=\"question in answeredQuestions\"\n\t\t\t:key=\"question.id\"\n\t\t\t:highlight=\"highlight\"\n\t\t\t:answer-text=\"question.squashedAnswers\"\n\t\t\t:answers=\"question.answers\"\n\t\t\t:question-text=\"question.text\"\n\t\t\t:question-type=\"question.type\" />\n\t</div>\n</template>\n\n<script>\nimport NcActions from '@nextcloud/vue/components/NcActions'\nimport NcActionButton from '@nextcloud/vue/components/NcActionButton'\nimport NcActionRouter from '@nextcloud/vue/components/NcActionRouter'\nimport moment from '@nextcloud/moment'\nimport IconDelete from 'vue-material-design-icons/TrashCanOutline.vue'\nimport IconPencil from 'vue-material-design-icons/PencilOutline.vue'\n\nimport Answer from './Answer.vue'\nimport { generateUrl } from '@nextcloud/router'\n\nexport default {\n\tname: 'Submission',\n\n\tcomponents: {\n\t\tAnswer,\n\t\tIconDelete,\n\t\tIconPencil,\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcActionRouter,\n\t},\n\n\tprops: {\n\t\tformHash: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tsubmission: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tquestions: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t\tcanDeleteSubmission: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\tcanEditSubmission: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\thighlight: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t// Format submission-timestamp to DateTime\n\t\tsubmissionDateTime() {\n\t\t\treturn moment(this.submission.timestamp, 'X').format('LLLL')\n\t\t},\n\n\t\t/**\n\t\t * Join answered Questions with corresponding answers.\n\t\t * Multiple answers to a question are squashed into one string.\n\t\t *\n\t\t * @return {Array}\n\t\t */\n\t\tansweredQuestions() {\n\t\t\tconst answeredQuestionsArray = []\n\n\t\t\tthis.questions.forEach((question) => {\n\t\t\t\tconst answers = this.submission.answers.filter(\n\t\t\t\t\t(answer) => answer.questionId === question.id,\n\t\t\t\t)\n\t\t\t\tif (!answers.length) {\n\t\t\t\t\treturn // no answers, go to next question\n\t\t\t\t}\n\n\t\t\t\tif (question.type === 'file') {\n\t\t\t\t\tansweredQuestionsArray.push({\n\t\t\t\t\t\tid: question.id,\n\t\t\t\t\t\ttext: question.text,\n\t\t\t\t\t\ttype: question.type,\n\t\t\t\t\t\tanswers: answers.map((answer) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tid: answer.id,\n\t\t\t\t\t\t\t\ttext: answer.text,\n\t\t\t\t\t\t\t\turl: generateUrl('/f/{fileId}', {\n\t\t\t\t\t\t\t\t\tfileId: answer.fileId,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t})\n\t\t\t\t} else if (['date', 'time'].includes(question.type)) {\n\t\t\t\t\tconst squashedAnswers = answers\n\t\t\t\t\t\t.map((answer) => answer.text)\n\t\t\t\t\t\t.join(' - ')\n\n\t\t\t\t\tansweredQuestionsArray.push({\n\t\t\t\t\t\tid: question.id,\n\t\t\t\t\t\ttext: question.text,\n\t\t\t\t\t\ttype: question.type,\n\t\t\t\t\t\tsquashedAnswers,\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tconst squashedAnswers = answers\n\t\t\t\t\t\t.map((answer) => answer.text)\n\t\t\t\t\t\t.join('; ')\n\n\t\t\t\t\tansweredQuestionsArray.push({\n\t\t\t\t\t\tid: question.id,\n\t\t\t\t\t\ttext: question.text,\n\t\t\t\t\t\ttype: question.type,\n\t\t\t\t\t\tsquashedAnswers,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn answeredQuestionsArray\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonDelete() {\n\t\t\tthis.$emit('delete')\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.submission {\n\tpadding-inline: var(--default-clickable-area) 16px;\n\n\t&-head {\n\t\tdisplay: flex;\n\t\talign-items: flex-end;\n\n\t\th3 {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n\n\t&-menu {\n\t\tmargin: 0 0 12px var(--default-grid-baseline);\n\t\tdisplay: inline-block;\n\t}\n\n\t&-date {\n\t\tcolor: var(--color-text-lighter);\n\t\tmargin-block-start: -8px;\n\t}\n}\n</style>\n","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon chevron-right-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"ChevronRightIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon page-first-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M18.41,16.59L13.82,12L18.41,7.41L17,6L11,12L17,18L18.41,16.59M6,6H8V18H6V6Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"PageFirstIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon page-last-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,6L5.59,7.41M16,6H18V18H16V6Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"PageLastIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<!--\n  - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div class=\"pagination-block\">\n\t\t<div class=\"pagination-items\">\n\t\t\t<NcButton\n\t\t\t\ttype=\"tertiary\"\n\t\t\t\t:disabled=\"totalPages === 1 || pageNumber <= 1\"\n\t\t\t\t:aria-label=\"t('forms', 'Go to first page')\"\n\t\t\t\t@click=\"pageNumber = 1\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<PageFirstIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t\t<NcButton\n\t\t\t\ttype=\"tertiary\"\n\t\t\t\t:disabled=\"totalPages === 1 || pageNumber <= 1\"\n\t\t\t\t:aria-label=\"t('forms', 'Go to previous page')\"\n\t\t\t\t@click=\"pageNumber--\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconChevronLeft :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t\t<div class=\"page-number\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"pageNumber\"\n\t\t\t\t\t:options=\"allPageNumbersArray\"\n\t\t\t\t\t:aria-label-combobox=\"t('forms', 'Page number')\">\n\t\t\t\t\t<template #selected-option-container=\"{ option }\">\n\t\t\t\t\t\t<span class=\"selected-page\">\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\tt('forms', '{page} of {totalPages}', {\n\t\t\t\t\t\t\t\t\tpage: option.label,\n\t\t\t\t\t\t\t\t\ttotalPages,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</template>\n\t\t\t\t</NcSelect>\n\t\t\t</div>\n\t\t\t<NcButton\n\t\t\t\ttype=\"tertiary\"\n\t\t\t\t:disabled=\"totalPages === 1 || pageNumber >= totalPages\"\n\t\t\t\t:aria-label=\"t('forms', 'Go to next page')\"\n\t\t\t\t@click=\"pageNumber++\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconChevronRight :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t\t<NcButton\n\t\t\t\ttype=\"tertiary\"\n\t\t\t\t:disabled=\"totalPages === 1 || pageNumber >= totalPages\"\n\t\t\t\t:aria-label=\"t('forms', 'Go to last page')\"\n\t\t\t\t@click=\"pageNumber = totalPages\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<PageLastIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport IconChevronLeft from 'vue-material-design-icons/ChevronLeft.vue'\nimport IconChevronRight from 'vue-material-design-icons/ChevronRight.vue'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcSelect from '@nextcloud/vue/components/NcSelect'\nimport PageFirstIcon from 'vue-material-design-icons/PageFirst.vue'\nimport PageLastIcon from 'vue-material-design-icons/PageLast.vue'\n\nexport default {\n\tname: 'PaginationToolbar',\n\tcomponents: {\n\t\tIconChevronLeft,\n\t\tIconChevronRight,\n\t\tNcButton,\n\t\tNcSelect,\n\t\tPageFirstIcon,\n\t\tPageLastIcon,\n\t},\n\n\tprops: {\n\t\ttotalItemsCount: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tlimit: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\t\toffset: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\temits: ['update:offset'],\n\n\tcomputed: {\n\t\tallPageNumbersArray() {\n\t\t\treturn Array.from(\n\t\t\t\t{ length: this.totalPages },\n\t\t\t\t(value, index) => 1 + index,\n\t\t\t)\n\t\t},\n\t\ttotalPages() {\n\t\t\treturn Math.max(1, Math.ceil(this.totalItemsCount / this.limit))\n\t\t},\n\t\tpageNumber: {\n\t\t\tget() {\n\t\t\t\treturn Math.floor(this.offset / this.limit) + 1\n\t\t\t},\n\t\t\tset(pageNumber) {\n\t\t\t\tthis.$emit('update:offset', (pageNumber - 1) * this.limit)\n\t\t\t},\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n:deep(.vs__clear) {\n\tdisplay: none;\n}\n\n:deep(.v-select) {\n\tmin-width: 95px !important;\n\t.vs__dropdown-toggle {\n\t\tbackground: none;\n\t}\n}\n\n.selected-page {\n\tpadding-left: 5px;\n\n\tdisplay: inline-flex;\n\talign-items: center;\n}\n\n.page-number {\n\tpadding-inline: 5px;\n\tpadding-top: 5px;\n\tpadding-bottom: 1px;\n}\n\n.pagination-items {\n\tbackground-color: var(--color-main-background);\n\tborder-radius: var(--border-radius-large);\n\tpointer-events: all;\n\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.pagination-block {\n\twidth: 100%;\n\tpointer-events: none;\n\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n</style>\n","<!--\n  - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<NcAppContent :page-heading=\"t('forms', 'Results')\">\n\t\t<NcDialog\n\t\t\t:open.sync=\"showLinkedFileNotAvailableDialog\"\n\t\t\t:name=\"t('forms', 'Linked file not available')\"\n\t\t\t:message=\"\n\t\t\t\tt(\n\t\t\t\t\t'forms',\n\t\t\t\t\t'Linked file is not available, would you like to link a new file?',\n\t\t\t\t)\n\t\t\t\"\n\t\t\t:buttons=\"linkedFileNotAvailableButtons\"\n\t\t\tsize=\"normal\"\n\t\t\tno-close />\n\n\t\t<TopBar\n\t\t\t:archived=\"isFormArchived\"\n\t\t\t:locked=\"isFormLocked\"\n\t\t\t:permissions=\"form?.permissions\"\n\t\t\t:sidebar-opened=\"sidebarOpened\"\n\t\t\t:submission-count=\"form?.submissionCount\"\n\t\t\t@share-form=\"onShareForm\" />\n\n\t\t<!-- Showing submissions -->\n\t\t<header>\n\t\t\t<h2 dir=\"auto\">\n\t\t\t\t{{ formTitle }}\n\t\t\t</h2>\n\t\t\t<p>\n\t\t\t\t{{\n\t\t\t\t\tt('forms', '{amount} responses', {\n\t\t\t\t\t\tamount: filteredSubmissionsCount,\n\t\t\t\t\t})\n\t\t\t\t}}\n\t\t\t</p>\n\n\t\t\t<!-- View switcher between Summary and Responses -->\n\t\t\t<div class=\"response-actions\">\n\t\t\t\t<PillMenu\n\t\t\t\t\t:disabled=\"noSubmissions\"\n\t\t\t\t\t:options=\"responseViews\"\n\t\t\t\t\t:active.sync=\"activeResponseView\"\n\t\t\t\t\tclass=\"response-actions__toggle\"\n\t\t\t\t\t@update:active=\"loadFormResults\" />\n\n\t\t\t\t<!-- Action menu for cloud export and deletion -->\n\t\t\t\t<NcActions\n\t\t\t\t\tv-if=\"canExportSubmissions\"\n\t\t\t\t\t:aria-label=\"t('forms', 'Options')\"\n\t\t\t\t\tforce-name\n\t\t\t\t\t:inline=\"isMobile ? 0 : 1\"\n\t\t\t\t\t@blur=\"isDownloadActionOpened = false\"\n\t\t\t\t\t@close=\"isDownloadActionOpened = false\">\n\t\t\t\t\t<template v-if=\"!isDownloadActionOpened\">\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"canEditForm && !form.fileId && !isFormLocked\"\n\t\t\t\t\t\t\t@click=\"onLinkFile\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconLink :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ t('forms', 'Create spreadsheet') }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<template v-if=\"canEditForm && form.fileId\">\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\t:href=\"fileUrl\"\n\t\t\t\t\t\t\t\ttype=\"tertiary-no-background\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<IconTable :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ t('forms', 'Open spreadsheet') }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionButton close-after-click @click=\"onReExport\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<IconRefresh :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ t('forms', 'Re-export spreadsheet') }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\tclose-after-click\n\t\t\t\t\t\t\t\t:disabled=\"isFormLocked\"\n\t\t\t\t\t\t\t\t@click=\"onUnlinkFile\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<IconLinkVariantOff :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ t('forms', 'Unlink spreadsheet') }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionSeparator v-if=\"!noSubmissions\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"!noSubmissions\"\n\t\t\t\t\t\t\tclose-after-click\n\t\t\t\t\t\t\t@click=\"onStoreToFiles\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconFolder :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ t('forms', 'Save copy to Files') }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"!noSubmissions\"\n\t\t\t\t\t\t\t:close-after-click=\"false\"\n\t\t\t\t\t\t\tis-menu\n\t\t\t\t\t\t\t@click=\"isDownloadActionOpened = true\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconDownload :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ t('forms', 'Download') }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"canDeleteSubmissions && !noSubmissions\"\n\t\t\t\t\t\t\tclose-after-click\n\t\t\t\t\t\t\t@click=\"deleteAllSubmissions\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconDelete :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ t('forms', 'Delete all responses') }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t</template>\n\n\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t<!-- Back to top-level button -->\n\t\t\t\t\t\t<NcActionButton @click=\"isDownloadActionOpened = false\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconChevronLeft :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ t('forms', 'Download') }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionSeparator />\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tclose-after-click\n\t\t\t\t\t\t\t@click=\"onDownloadFile('csv')\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconFileDelimited :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\tCSV\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tclose-after-click\n\t\t\t\t\t\t\t@click=\"onDownloadFile('ods')\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconTable :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\tODS\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tclose-after-click\n\t\t\t\t\t\t\t@click=\"onDownloadFile('xlsx')\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconFileExcelOutline :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\tXSLX\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t</template>\n\t\t\t\t</NcActions>\n\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"\n\t\t\t\t\t\t(!noSubmissions\n\t\t\t\t\t\t\t|| loadingResults\n\t\t\t\t\t\t\t|| submissionSearch.length > 0)\n\t\t\t\t\t\t&& activeResponseView.id !== 'summary'\n\t\t\t\t\t\"\n\t\t\t\t\tclass=\"search-wrapper\">\n\t\t\t\t\t<NcTextField\n\t\t\t\t\t\tv-model=\"submissionSearch\"\n\t\t\t\t\t\t:label=\"t('forms', 'Search')\"\n\t\t\t\t\t\ttrailing-button-icon=\"close\"\n\t\t\t\t\t\t:show-trailing-button=\"submissionSearch.length > 0\"\n\t\t\t\t\t\t@trailing-button-click=\"submissionSearch = ''\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconMagnify :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcTextField>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</header>\n\n\t\t<!-- Loading submissions -->\n\t\t<NcEmptyContent\n\t\t\tv-if=\"loadingResults\"\n\t\t\tclass=\"forms-emptycontent\"\n\t\t\t:name=\"t('forms', 'Loading responses …')\">\n\t\t\t<template #icon>\n\t\t\t\t<NcLoadingIcon :size=\"64\" />\n\t\t\t</template>\n\t\t</NcEmptyContent>\n\n\t\t<!-- Empty search results -->\n\t\t<NcEmptyContent\n\t\t\tv-else-if=\"noFilteredSubmissions && submissionSearch.length > 0\"\n\t\t\t:name=\"t('forms', 'No results found')\"\n\t\t\tclass=\"forms-emptycontent\"\n\t\t\t:description=\"\n\t\t\t\tt('forms', 'No results found for {submissionSearch}', {\n\t\t\t\t\tsubmissionSearch,\n\t\t\t\t})\n\t\t\t\">\n\t\t\t<template #icon>\n\t\t\t\t<IconPoll :size=\"64\" />\n\t\t\t</template>\n\t\t</NcEmptyContent>\n\n\t\t<!-- No submissions -->\n\t\t<NcEmptyContent\n\t\t\tv-else-if=\"noSubmissions\"\n\t\t\t:name=\"t('forms', 'No responses yet')\"\n\t\t\tclass=\"forms-emptycontent\"\n\t\t\t:description=\"\n\t\t\t\tt('forms', 'Results of submitted forms will show up here')\n\t\t\t\">\n\t\t\t<template #icon>\n\t\t\t\t<IconPoll :size=\"64\" />\n\t\t\t</template>\n\t\t\t<template #action>\n\t\t\t\t<div class=\"response-actions\">\n\t\t\t\t\t<NcButton variant=\"primary\" @click=\"onShareForm\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconShareVariant :size=\"20\" decorative />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('forms', 'Share form') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</template>\n\t\t</NcEmptyContent>\n\n\t\t<!-- Summary view for visualization -->\n\t\t<section v-else-if=\"activeResponseView.id === 'summary'\">\n\t\t\t<ResultsSummary\n\t\t\t\tv-for=\"question in questions\"\n\t\t\t\t:key=\"question.id\"\n\t\t\t\t:question=\"question\"\n\t\t\t\t:submissions=\"submissions\" />\n\t\t</section>\n\n\t\t<!-- Responses view for individual responses -->\n\t\t<section v-else>\n\t\t\t<Submission\n\t\t\t\tv-for=\"submission in submissions\"\n\t\t\t\t:key=\"submission.id\"\n\t\t\t\t:form-hash=\"form.hash\"\n\t\t\t\t:submission=\"submission\"\n\t\t\t\t:questions=\"questions\"\n\t\t\t\t:highlight=\"submissionSearch\"\n\t\t\t\t:can-delete-submission=\"canDeleteSubmission(submission.userId)\"\n\t\t\t\t:can-edit-submission=\"canEditSubmission(submission.userId)\"\n\t\t\t\t@delete=\"deleteSubmission(submission.id)\" />\n\n\t\t\t<PaginationToolbar\n\t\t\t\tclass=\"bottom-pagination\"\n\t\t\t\t:total-items-count=\"filteredSubmissionsCount\"\n\t\t\t\t:limit.sync=\"limit\"\n\t\t\t\t:offset.sync=\"offset\" />\n\t\t</section>\n\n\t\t<!-- Confirmation dialog for deleting all submissions -->\n\t\t<NcDialog\n\t\t\t:open.sync=\"showConfirmDeleteDialog\"\n\t\t\t:name=\"t('forms', 'Delete submissions')\"\n\t\t\t:message=\"\n\t\t\t\tt(\n\t\t\t\t\t'forms',\n\t\t\t\t\t'Are you sure you want to delete all responses of {title}?',\n\t\t\t\t\t{ title: formTitle },\n\t\t\t\t)\n\t\t\t\"\n\t\t\t:buttons=\"confirmDeleteButtons\" />\n\t</NcAppContent>\n</template>\n\n<script>\nimport { getCurrentUser, getRequestToken } from '@nextcloud/auth'\nimport { getFilePickerBuilder, showError, showSuccess } from '@nextcloud/dialogs'\nimport { emit } from '@nextcloud/event-bus'\nimport { FileType } from '@nextcloud/files'\nimport { generateOcsUrl, generateUrl } from '@nextcloud/router'\nimport { useIsSmallMobile } from '@nextcloud/vue'\n\nimport NcActions from '@nextcloud/vue/components/NcActions'\nimport NcActionButton from '@nextcloud/vue/components/NcActionButton'\nimport NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'\nimport NcAppContent from '@nextcloud/vue/components/NcAppContent'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcDialog from '@nextcloud/vue/components/NcDialog'\nimport NcTextField from '@nextcloud/vue/components/NcTextField'\nimport NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'\nimport NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'\nimport axios from '@nextcloud/axios'\nimport moment from '@nextcloud/moment'\n\nimport IconCancelSvg from '@mdi/svg/svg/cancel.svg?raw'\nimport IconChevronLeft from 'vue-material-design-icons/ChevronLeft.vue'\nimport IconDelete from 'vue-material-design-icons/TrashCanOutline.vue'\nimport IconDeleteSvg from '@mdi/svg/svg/delete.svg?raw'\nimport IconDownload from 'vue-material-design-icons/TrayArrowDown.vue'\nimport IconFileDelimited from 'vue-material-design-icons/FileDelimitedOutline.vue'\nimport IconFileDelimitedSvg from '@mdi/svg/svg/file-delimited-outline.svg?raw'\nimport IconFileExcelOutline from 'vue-material-design-icons/FileExcelOutline.vue'\nimport IconFileExcelOutlineSvg from '@mdi/svg/svg/file-excel-outline.svg?raw'\nimport IconFolder from 'vue-material-design-icons/FolderOutline.vue'\nimport IconLink from 'vue-material-design-icons/Link.vue'\nimport IconLinkSvg from '@mdi/svg/svg/link.svg?raw'\nimport IconLinkVariantOff from 'vue-material-design-icons/LinkOff.vue'\nimport IconLinkVariantOffSvg from '@mdi/svg/svg/link-off.svg?raw'\nimport IconPoll from 'vue-material-design-icons/Poll.vue'\nimport IconRefresh from 'vue-material-design-icons/Refresh.vue'\nimport IconShareVariant from 'vue-material-design-icons/ShareVariantOutline.vue'\nimport IconTable from 'vue-material-design-icons/Table.vue'\nimport IconTableSvg from '@mdi/svg/svg/table.svg?raw'\nimport IconMagnify from 'vue-material-design-icons/Magnify.vue'\n\nimport { FormState, INPUT_DEBOUNCE_MS } from '../models/Constants.ts'\nimport ResultsSummary from '../components/Results/ResultsSummary.vue'\nimport Submission from '../components/Results/Submission.vue'\nimport TopBar from '../components/TopBar.vue'\nimport ViewsMixin from '../mixins/ViewsMixin.js'\nimport answerTypes from '../models/AnswerTypes.js'\nimport logger from '../utils/Logger.js'\nimport SetWindowTitle from '../utils/SetWindowTitle.js'\nimport OcsResponse2Data from '../utils/OcsResponse2Data.js'\nimport PaginationToolbar from '../components/PaginationToolbar.vue'\nimport PermissionTypes from '../mixins/PermissionTypes.js'\nimport PillMenu from '../components/PillMenu.vue'\nimport debounce from 'debounce'\n\nconst SUPPORTED_FILE_FORMATS = {\n\tods: IconTableSvg,\n\tcsv: IconFileDelimitedSvg,\n\txlsx: IconFileExcelOutlineSvg,\n}\nlet fileFormat = 'csv'\n\nconst responseViews = [\n\t{\n\t\ttitle: t('forms', 'Summary'),\n\t\tid: 'summary',\n\t},\n\t{\n\t\ttitle: t('forms', 'Responses'),\n\t\tid: 'responses',\n\t},\n]\n\nexport default {\n\tname: 'Results',\n\n\tcomponents: {\n\t\tIconChevronLeft,\n\t\tIconDelete,\n\t\tIconDownload,\n\t\tIconFileDelimited,\n\t\tIconFileExcelOutline,\n\t\tIconFolder,\n\t\tIconLink,\n\t\tIconLinkVariantOff,\n\t\tIconPoll,\n\t\tIconRefresh,\n\t\tIconShareVariant,\n\t\tIconTable,\n\t\tNcActionButton,\n\t\tNcActionSeparator,\n\t\tNcActions,\n\t\tNcAppContent,\n\t\tNcButton,\n\t\tNcDialog,\n\t\tNcTextField,\n\t\tPaginationToolbar,\n\t\tIconMagnify,\n\t\tNcEmptyContent,\n\t\tNcLoadingIcon,\n\t\tPillMenu,\n\t\tResultsSummary,\n\t\tSubmission,\n\t\tTopBar,\n\t},\n\n\tmixins: [PermissionTypes, ViewsMixin],\n\n\tsetup() {\n\t\treturn {\n\t\t\tisMobile: useIsSmallMobile(),\n\n\t\t\t// non reactive props\n\t\t\tresponseViews,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tactiveResponseView: responseViews[0],\n\n\t\t\tquestions: [],\n\t\t\tsubmissions: [],\n\t\t\tfilteredSubmissionsCount: 0,\n\n\t\t\tisDownloadActionOpened: false,\n\t\t\tloadingResults: true,\n\t\t\tskipReloadOnOffsetChange: false,\n\n\t\t\tpicker: null,\n\t\t\tshowConfirmDeleteDialog: false,\n\n\t\t\tsubmissionSearch: '',\n\t\t\tlimit: 20,\n\t\t\toffset: 0,\n\n\t\t\tlinkedFileNotAvailableButtons: [\n\t\t\t\t{\n\t\t\t\t\tlabel: t('forms', 'Unlink spreadsheet'),\n\t\t\t\t\ticon: IconLinkVariantOffSvg,\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tthis.onUnlinkFile()\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t('forms', 'Create spreadsheet'),\n\t\t\t\t\ticon: IconLinkSvg,\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tthis.onLinkFile()\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tconfirmDeleteButtons: [\n\t\t\t\t{\n\t\t\t\t\tlabel: t('forms', 'Cancel'),\n\t\t\t\t\ticon: IconCancelSvg,\n\t\t\t\t\ttype: 'tertiary',\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tthis.showConfirmDeleteDialog = false\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t('forms', 'Delete submissions'),\n\t\t\t\t\ticon: IconDeleteSvg,\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tthis.deleteAllSubmissionsConfirmed()\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisFormArchived() {\n\t\t\treturn this.form.state === FormState.FormArchived\n\t\t},\n\n\t\tcanExportSubmissions() {\n\t\t\treturn this.form.permissions.includes(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_RESULTS,\n\t\t\t)\n\t\t},\n\n\t\tcanDeleteSubmissions() {\n\t\t\treturn (\n\t\t\t\tthis.form.permissions.includes(\n\t\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_RESULTS_DELETE,\n\t\t\t\t) && !this.isFormArchived\n\t\t\t)\n\t\t},\n\n\t\tcanEditForm() {\n\t\t\treturn this.form.permissions.includes(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_EDIT,\n\t\t\t)\n\t\t},\n\n\t\tnoSubmissions() {\n\t\t\treturn this.form?.submissionCount === 0\n\t\t},\n\n\t\tnoFilteredSubmissions() {\n\t\t\treturn this.submissions.length === 0\n\t\t},\n\n\t\t/**\n\t\t * Generate link to linked file\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tfileUrl() {\n\t\t\tif (this.form.fileId) {\n\t\t\t\treturn generateUrl('/f/{fileId}', { fileId: this.form.fileId })\n\t\t\t}\n\t\t\treturn window.location.href\n\t\t},\n\n\t\tshowLinkedFileNotAvailableDialog() {\n\t\t\tif (this.form.partial) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tthis.canEditForm\n\t\t\t\t&& this.form.fileId\n\t\t\t\t&& !this.form.filePath\n\t\t\t\t&& !this.isFormLocked\n\t\t\t)\n\t\t},\n\t},\n\n\twatch: {\n\t\t// Reload results when form changes\n\t\tasync hash() {\n\t\t\tawait this.fetchFullForm(this.form.id)\n\t\t\tthis.loadFormResults()\n\t\t\tSetWindowTitle(this.formTitle)\n\t\t},\n\t\tlimit() {\n\t\t\tthis.loadFormResults()\n\t\t},\n\t\toffset() {\n\t\t\t// Only load results if we're not changing offset from submissionSearch watch\n\t\t\tif (!this.skipReloadOnOffsetChange) {\n\t\t\t\tthis.loadFormResults()\n\t\t\t}\n\t\t},\n\t\tsubmissionSearch: debounce(function () {\n\t\t\tthis.skipReloadOnOffsetChange = true\n\t\t\tthis.offset = 0\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.skipReloadOnOffsetChange = false\n\t\t\t})\n\t\t\tthis.loadFormResults()\n\t\t}, INPUT_DEBOUNCE_MS),\n\t},\n\n\tasync beforeMount() {\n\t\tawait this.fetchFullForm(this.form.id)\n\t\tthis.loadFormResults()\n\t\tSetWindowTitle(this.formTitle)\n\t},\n\n\tmethods: {\n\t\tasync onUnlinkFile() {\n\t\t\tawait axios.patch(\n\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{formId}', {\n\t\t\t\t\tformId: this.form.id,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tkeyValuePairs: {\n\t\t\t\t\t\tfileId: null,\n\t\t\t\t\t\tfileFormat: null,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tconst updatedForm = {\n\t\t\t\t...this.form,\n\t\t\t\tfileFormat: null,\n\t\t\t\tfileId: null,\n\t\t\t\tfilePath: null,\n\t\t\t}\n\t\t\tthis.$emit('update:form', updatedForm)\n\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t},\n\n\t\tasync loadFormResults() {\n\t\t\tthis.loadingResults = true\n\t\t\tlogger.debug(`Loading results for form ${this.form.hash}`)\n\n\t\t\ttry {\n\t\t\t\tlet response = null\n\t\t\t\tif (this.activeResponseView.id === 'summary') {\n\t\t\t\t\tresponse = await axios.get(\n\t\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/submissions', {\n\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\tresponse = await axios.get(\n\t\t\t\t\t\tgenerateOcsUrl(\n\t\t\t\t\t\t\t'apps/forms/api/v3/forms/{id}/submissions?limit={limit}&offset={offset}&query={query}',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t\t\tlimit: this.limit,\n\t\t\t\t\t\t\t\toffset: this.offset,\n\t\t\t\t\t\t\t\tquery: this.submissionSearch,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tconst data = OcsResponse2Data(response)\n\n\t\t\t\t// Append questions & submissions\n\t\t\t\tthis.submissions = this.formatDateAnswers(\n\t\t\t\t\tdata.submissions,\n\t\t\t\t\tdata.questions,\n\t\t\t\t)\n\t\t\t\tthis.questions = data.questions\n\t\t\t\tthis.filteredSubmissionsCount = data.filteredSubmissionsCount\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while loading results', { error })\n\t\t\t\tshowError(t('forms', 'There was an error while loading the results'))\n\t\t\t} finally {\n\t\t\t\tthis.loadingResults = false\n\t\t\t}\n\t\t},\n\n\t\tasync onDownloadFile(fileFormat) {\n\t\t\tconst exportUrl =\n\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/submissions', {\n\t\t\t\t\tid: this.form.id,\n\t\t\t\t})\n\t\t\t\t+ '?requesttoken='\n\t\t\t\t+ encodeURIComponent(getRequestToken())\n\t\t\t\t+ '&fileFormat='\n\t\t\t\t+ fileFormat\n\t\t\twindow.open(exportUrl, '_self')\n\t\t},\n\n\t\tasync onLinkFile() {\n\t\t\ttry {\n\t\t\t\tawait this.getPicker()\n\t\t\t\t\t.pick()\n\t\t\t\t\t.then(async (path) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait axios.patch(\n\t\t\t\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}', {\n\t\t\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tkeyValuePairs: {\n\t\t\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\t\t\tfileFormat,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tawait this.fetchFullForm(this.form.id)\n\t\t\t\t\t\t\tawait this.loadFormResults()\n\n\t\t\t\t\t\t\tshowSuccess(\n\t\t\t\t\t\t\t\tt('forms', 'File {file} successfully linked', {\n\t\t\t\t\t\t\t\t\tfile: this.form.filePath.split('/').pop(),\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t\t\t'Error while exporting to Files and linking',\n\t\t\t\t\t\t\t\t{ error },\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tshowError(\n\t\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t\t'forms',\n\t\t\t\t\t\t\t\t\t'There was an error while linking the file',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t} catch (error) {\n\t\t\t\t// User aborted\n\t\t\t\tlogger.debug('No file selected', { error })\n\t\t\t}\n\t\t},\n\n\t\t// Show Filepicker, then call API to store\n\t\tasync onStoreToFiles() {\n\t\t\ttry {\n\t\t\t\tawait this.getPicker()\n\t\t\t\t\t.pick()\n\t\t\t\t\t.then(async (path) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst response = await axios.post(\n\t\t\t\t\t\t\t\tgenerateOcsUrl(\n\t\t\t\t\t\t\t\t\t'apps/forms/api/v3/forms/{id}/submissions/export',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\t\tfileFormat,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tshowSuccess(\n\t\t\t\t\t\t\t\tt('forms', 'Export successful to {file}', {\n\t\t\t\t\t\t\t\t\tfile: OcsResponse2Data(response),\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tlogger.error('Error while exporting to Files', {\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tshowError(\n\t\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t\t'forms',\n\t\t\t\t\t\t\t\t\t'There was an error while exporting to Files',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t} catch (error) {\n\t\t\t\t// User aborted\n\t\t\t\tlogger.debug('No file selected', { error })\n\t\t\t}\n\t\t},\n\n\t\tasync onReExport() {\n\t\t\tif (!this.form.fileId) {\n\t\t\t\t// Theoretically this will never fire\n\t\t\t\tshowError(t('forms', 'File is not linked'))\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(\n\t\t\t\t\tgenerateOcsUrl(\n\t\t\t\t\t\t'apps/forms/api/v3/forms/{id}/submissions/export',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tpath: this.form.filePath,\n\t\t\t\t\t\tfileFormat: this.form.fileFormat,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tshowSuccess(\n\t\t\t\t\tt('forms', 'Export successful to {file}', {\n\t\t\t\t\t\tfile: OcsResponse2Data(response),\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while exporting to Files', { error })\n\t\t\t\tshowError(t('forms', 'There was an error, while exporting to Files'))\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Determines if a submission can be deleted.\n\t\t *\n\t\t * @param {string} submissionUser - The ID of the user who created the submission.\n\t\t * @return {boolean} - Returns true if the submission can be deleted, otherwise false.\n\t\t *                     \tA submission can be deleted if:\n\t\t *                      - The user has the `canDeleteSubmissions` permission, or\n\t\t *                      - The form allows editing (`form.allowEditSubmissions`) and the current user is the owner of the submission.\n\t\t */\n\t\tcanDeleteSubmission(submissionUser) {\n\t\t\treturn (\n\t\t\t\tthis.canDeleteSubmissions\n\t\t\t\t|| (this.form.allowEditSubmissions\n\t\t\t\t\t&& getCurrentUser().uid === submissionUser)\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Determines if a submission can be edited.\n\t\t *\n\t\t * @param {string} submissionUser - The ID of the user who created the submission.\n\t\t * @return {boolean} - Returns true if the submission can be edited, otherwise false.\n\t\t */\n\t\tcanEditSubmission(submissionUser) {\n\t\t\treturn (\n\t\t\t\tthis.form.allowEditSubmissions\n\t\t\t\t&& getCurrentUser().uid === submissionUser\n\t\t\t)\n\t\t},\n\n\t\tasync deleteSubmission(id) {\n\t\t\tthis.loadingResults = true\n\n\t\t\ttry {\n\t\t\t\tawait axios.delete(\n\t\t\t\t\tgenerateOcsUrl(\n\t\t\t\t\t\t'apps/forms/api/v3/forms/{id}/submissions/{submissionId}',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t\tsubmissionId: id,\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\tshowSuccess(t('forms', 'Submission deleted'))\n\t\t\t\tconst index = this.submissions.findIndex(\n\t\t\t\t\t(search) => search.id === id,\n\t\t\t\t)\n\t\t\t\tthis.submissions.splice(index, 1)\n\t\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error(`Error while removing response ${id}`, { error })\n\t\t\t\tshowError(\n\t\t\t\t\tt('forms', 'There was an error while removing this response'),\n\t\t\t\t)\n\t\t\t} finally {\n\t\t\t\tthis.loadingResults = false\n\t\t\t}\n\t\t},\n\n\t\tdeleteAllSubmissions() {\n\t\t\tthis.showConfirmDeleteDialog = true\n\t\t},\n\n\t\tasync deleteAllSubmissionsConfirmed() {\n\t\t\tthis.showConfirmDeleteDialog = false\n\t\t\tthis.loadingResults = true\n\t\t\ttry {\n\t\t\t\tawait axios.delete(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/submissions', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\tthis.submissions = []\n\t\t\t\tthis.form.submissionCount = 0\n\t\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while removing responses', { error })\n\t\t\t\tshowError(t('forms', 'There was an error while removing responses'))\n\t\t\t} finally {\n\t\t\t\tthis.loadingResults = false\n\t\t\t}\n\t\t},\n\n\t\tformatDateAnswers(submissions, questions) {\n\t\t\t// Filter questions that are date/datetime/time\n\t\t\tconst dateQuestions = Object.fromEntries(\n\t\t\t\tquestions\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t(question) =>\n\t\t\t\t\t\t\t(question.type === 'date')\n\t\t\t\t\t\t\t| (question.type === 'datetime')\n\t\t\t\t\t\t\t| (question.type === 'time'),\n\t\t\t\t\t)\n\t\t\t\t\t.map((question) => [question.id, question.type]),\n\t\t\t)\n\n\t\t\t// Go through submissions and reformat answers to date/time questions\n\t\t\tsubmissions.forEach((submission) => {\n\t\t\t\tsubmission.answers\n\t\t\t\t\t.filter((answer) => answer.questionId in dateQuestions)\n\t\t\t\t\t.forEach((answer) => {\n\t\t\t\t\t\tconst date = moment(\n\t\t\t\t\t\t\tanswer.text,\n\t\t\t\t\t\t\tanswerTypes[dateQuestions[answer.questionId]]\n\t\t\t\t\t\t\t\t.storageFormat,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tif (date.isValid()) {\n\t\t\t\t\t\t\tanswer.text = date.format(\n\t\t\t\t\t\t\t\tanswerTypes[dateQuestions[answer.questionId]]\n\t\t\t\t\t\t\t\t\t.momentFormat,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t})\n\n\t\t\treturn submissions\n\t\t},\n\n\t\tgetPicker() {\n\t\t\tif (this.picker !== null) {\n\t\t\t\treturn this.picker\n\t\t\t}\n\n\t\t\tthis.picker = getFilePickerBuilder(\n\t\t\t\tt('forms', 'Choose spreadsheet location'),\n\t\t\t)\n\t\t\t\t.setMultiSelect(false)\n\t\t\t\t.allowDirectories(true)\n\t\t\t\t.setCanPick((node) => {\n\t\t\t\t\tif (node.type === FileType.Folder) {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\n\t\t\t\t\tconst extension = node.extension?.slice(1).toLowerCase()\n\t\t\t\t\treturn !!extension && extension in SUPPORTED_FILE_FORMATS\n\t\t\t\t})\n\t\t\t\t.setButtonFactory((selectedNodes) => {\n\t\t\t\t\tconst [node] = selectedNodes\n\t\t\t\t\tif (node && node.type === FileType.File) {\n\t\t\t\t\t\tconst extension = node.extension?.slice(1).toLowerCase()\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: t('forms', 'Select {file}', {\n\t\t\t\t\t\t\t\t\tfile: selectedNodes[0].basename,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\ticon: SUPPORTED_FILE_FORMATS[extension],\n\t\t\t\t\t\t\t\tcallback() {\n\t\t\t\t\t\t\t\t\tfileFormat = extension\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tvariant: 'primary',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\n\t\t\t\t\t// no node selected (pick current folder) or folder selected\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: t('forms', 'Create XLSX'),\n\t\t\t\t\t\t\ticon: IconFileExcelOutlineSvg,\n\t\t\t\t\t\t\tcallback() {\n\t\t\t\t\t\t\t\tfileFormat = 'xlsx'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tvariant: 'secondary',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: t('forms', 'Create CSV'),\n\t\t\t\t\t\t\ticon: IconFileDelimitedSvg,\n\t\t\t\t\t\t\tcallback() {\n\t\t\t\t\t\t\t\tfileFormat = 'csv'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tvariant: 'secondary',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: t('forms', 'Create ODS'),\n\t\t\t\t\t\t\ticon: IconTableSvg,\n\t\t\t\t\t\t\tcallback() {\n\t\t\t\t\t\t\t\tfileFormat = 'ods'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tvariant: 'primary',\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t\t.build()\n\n\t\t\treturn this.picker\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.forms-emptycontent {\n\theight: 100%;\n}\n\n.app-content {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-direction: column;\n\n\theader,\n\tsection {\n\t\twidth: 100%;\n\t\tmax-width: 750px;\n\t}\n\n\t// Title & description header\n\theader {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmargin-block-end: 24px;\n\t\tmargin-inline-start: 40px;\n\n\t\th2 {\n\t\t\tmargin-block-end: 0; // because the input field has enough padding\n\t\t\tfont-size: 28px;\n\t\t\tfont-weight: bold;\n\t\t\tmargin-block-start: 32px;\n\t\t\tpadding-inline-start: 14px;\n\t\t\tpadding-block-end: 8px;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\tp {\n\t\t\tpadding-inline-start: 14px;\n\t\t}\n\t}\n\n\t.response-actions {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tmargin-block-start: 8px;\n\t\tmargin-inline-start: 8px;\n\t\tpadding-inline-start: calc(14px - var(--border-radius-pill));\n\n\t\t&__toggle {\n\t\t\tmargin-inline-end: 1em;\n\t\t}\n\t}\n}\n\n.search-wrapper {\n\tmargin-block-start: calc(-1 * var(--default-grid-baseline));\n\tmargin-inline-start: auto;\n\tmargin-inline-end: var(--default-clickable-area);\n}\n\n.bottom-pagination {\n\tmargin-bottom: 24px;\n}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Vue from 'vue'\nimport Router from 'vue-router'\nimport { generateUrl } from '@nextcloud/router'\n\nimport Create from './views/Create.vue'\nimport Results from './views/Results.vue'\nimport Submit from './views/Submit.vue'\n\nVue.use(Router)\n\nexport default new Router({\n\tmode: 'history',\n\n\t// if index.php is in the url AND we got this far, then it's working:\n\t// let's keep using index.php in the url\n\tbase: generateUrl('/apps/forms', ''),\n\tlinkActiveClass: 'active',\n\n\troutes: [\n\t\t{\n\t\t\tpath: '/',\n\t\t\tname: 'root',\n\t\t},\n\t\t{\n\t\t\tpath: '/:hash',\n\t\t\tredirect: { name: 'submit' },\n\t\t\tname: 'formRoot',\n\t\t\tprops: true,\n\t\t},\n\t\t{\n\t\t\tpath: '/:hash/edit',\n\t\t\tcomponents: {\n\t\t\t\tdefault: Create,\n\t\t\t},\n\t\t\tname: 'edit',\n\t\t\tprops: { default: true },\n\t\t},\n\t\t{\n\t\t\tpath: '/:hash/results',\n\t\t\tcomponents: {\n\t\t\t\tdefault: Results,\n\t\t\t},\n\t\t\tname: 'results',\n\t\t\tprops: { default: true },\n\t\t},\n\t\t{\n\t\t\tpath: '/:hash/submit/:submissionId?',\n\t\t\tcomponents: {\n\t\t\t\tdefault: Submit,\n\t\t\t},\n\t\t\tname: 'submit',\n\t\t\tprops: { default: true },\n\t\t},\n\t],\n})\n","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon archive-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M20 21H4V10H6V19H18V10H20V21M3 3H21V9H3V3M9.5 11H14.5C14.78 11 15 11.22 15 11.5V13H9V11.5C9 11.22 9.22 11 9.5 11M5 5V7H19V5H5Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"ArchiveOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon archive-off-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M8.2 5L6.2 3H21V9H12.2L10.2 7H19V5H8.2M20 16.8V10H18V14.8L20 16.8M20 19.35V19.34L18 17.34V17.35L9.66 9H9.66L7.66 7H7.66L6.13 5.47L2.39 1.73L1.11 3L3 4.89V9H7.11L17.11 19H6V10H4V21H19.11L20.84 22.73L22.11 21.46L20 19.35Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"ArchiveOffOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<!--\n  - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<NcListItem\n\t\tref=\"navigationItem\"\n\t\t:active=\"isActive\"\n\t\t:actions-aria-label=\"t('forms', 'Form actions')\"\n\t\t:counter-number=\"form.submissionCount\"\n\t\tcompact\n\t\t:force-display-actions=\"forceDisplayActions\"\n\t\t:name=\"formTitle\"\n\t\t:to=\"{\n\t\t\tname: routerTarget,\n\t\t\tparams: { hash: form.hash },\n\t\t}\"\n\t\t@click=\"mobileCloseNavigation\">\n\t\t<template #icon>\n\t\t\t<NcLoadingIcon v-if=\"loading\" :size=\"16\" />\n\t\t\t<IconCheck v-else-if=\"isExpired\" :size=\"16\" />\n\t\t\t<FormsIcon v-else :size=\"16\" />\n\t\t</template>\n\t\t<template v-if=\"hasSubtitle\" #subname>\n\t\t\t{{ formSubtitle }}\n\t\t</template>\n\t\t<template\n\t\t\tv-if=\"!loading && (!readOnly || canEdit || canSeeResults)\"\n\t\t\t#actions>\n\t\t\t<NcActionRouter\n\t\t\t\tv-if=\"!isArchived && canEdit\"\n\t\t\t\tclose-after-click\n\t\t\t\t:disabled=\"isFormLocked\"\n\t\t\t\texact\n\t\t\t\t:to=\"{ name: 'edit', params: { hash: form.hash } }\"\n\t\t\t\t@click=\"mobileCloseNavigation\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconPencil :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('forms', 'Edit form') }}\n\t\t\t</NcActionRouter>\n\t\t\t<NcActionButton\n\t\t\t\tv-if=\"!isArchived && !readOnly\"\n\t\t\t\tclose-after-click\n\t\t\t\t@click=\"onShareForm\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconShareVariant :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('forms', 'Share form') }}\n\t\t\t</NcActionButton>\n\t\t\t<NcActionRouter\n\t\t\t\tv-if=\"canSeeResults\"\n\t\t\t\tclose-after-click\n\t\t\t\texact\n\t\t\t\t:to=\"{ name: 'results', params: { hash: form.hash } }\"\n\t\t\t\t@click=\"mobileCloseNavigation\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconPoll :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('forms', 'Results') }}\n\t\t\t</NcActionRouter>\n\t\t\t<NcActionButton v-if=\"canEdit\" close-after-click @click=\"onCloneForm\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconContentCopy :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('forms', 'Copy form') }}\n\t\t\t</NcActionButton>\n\t\t\t<NcActionSeparator v-if=\"canEdit && !readOnly\" />\n\t\t\t<NcActionButton\n\t\t\t\tv-if=\"canEdit && !readOnly\"\n\t\t\t\tclose-after-click\n\t\t\t\t:disabled=\"isFormLocked\"\n\t\t\t\t@click=\"onToggleArchive\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconArchiveOff v-if=\"isArchived\" :size=\"20\" />\n\t\t\t\t\t<IconArchive v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{\n\t\t\t\t\tisArchived\n\t\t\t\t\t\t? t('forms', 'Unarchive form')\n\t\t\t\t\t\t: t('forms', 'Archive form')\n\t\t\t\t}}\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton\n\t\t\t\tv-if=\"canEdit && !readOnly\"\n\t\t\t\tclose-after-click\n\t\t\t\t:disabled=\"isFormLocked\"\n\t\t\t\t@click=\"onConfirmDelete\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconDelete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('forms', 'Delete form') }}\n\t\t\t</NcActionButton>\n\t\t</template>\n\t</NcListItem>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { showConfirmation, showError } from '@nextcloud/dialogs'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport NcActionButton from '@nextcloud/vue/components/NcActionButton'\nimport NcActionRouter from '@nextcloud/vue/components/NcActionRouter'\nimport NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'\nimport NcListItem from '@nextcloud/vue/components/NcListItem'\nimport NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'\nimport axios from '@nextcloud/axios'\nimport moment from '@nextcloud/moment'\nimport IconArchive from 'vue-material-design-icons/ArchiveOutline.vue'\nimport IconArchiveOff from 'vue-material-design-icons/ArchiveOffOutline.vue'\nimport IconCheck from 'vue-material-design-icons/Check.vue'\nimport IconContentCopy from 'vue-material-design-icons/ContentCopy.vue'\nimport IconDelete from 'vue-material-design-icons/TrashCanOutline.vue'\nimport IconPencil from 'vue-material-design-icons/PencilOutline.vue'\nimport IconPoll from 'vue-material-design-icons/Poll.vue'\nimport IconShareVariant from 'vue-material-design-icons/ShareVariantOutline.vue'\n\nimport FormsIcon from './Icons/FormsIcon.vue'\n\nimport { FormState } from '../models/Constants.ts'\nimport PermissionTypes from '../mixins/PermissionTypes.js'\nimport logger from '../utils/Logger.js'\n\nexport default {\n\tname: 'AppNavigationForm',\n\n\tcomponents: {\n\t\tFormsIcon,\n\t\tIconArchive,\n\t\tIconArchiveOff,\n\t\tIconCheck,\n\t\tIconContentCopy,\n\t\tIconDelete,\n\t\tIconPencil,\n\t\tIconPoll,\n\t\tIconShareVariant,\n\t\tNcActionButton,\n\t\tNcActionRouter,\n\t\tNcActionSeparator,\n\t\tNcListItem,\n\t\tNcLoadingIcon,\n\t},\n\n\tmixins: [PermissionTypes],\n\n\tprops: {\n\t\tform: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tforceDisplayActions: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t\trequired: false,\n\t\t},\n\t\treadOnly: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tloading: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcanEdit() {\n\t\t\treturn this.form.permissions.includes(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_EDIT,\n\t\t\t)\n\t\t},\n\n\t\tcanSeeResults() {\n\t\t\treturn (\n\t\t\t\tthis.form.permissions.includes(\n\t\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_RESULTS,\n\t\t\t\t) || this.form.submissionCount > 0\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Check if form is current form and set active\n\t\t */\n\t\tisActive() {\n\t\t\treturn this.form.hash === this.$route.params.hash\n\t\t},\n\n\t\t/**\n\t\t * Check if the form is archived\n\t\t */\n\t\tisArchived() {\n\t\t\treturn this.form.state === FormState.FormArchived\n\t\t},\n\n\t\t/**\n\t\t * Check if form is expired\n\t\t */\n\t\tisExpired() {\n\t\t\treturn this.form.expires && moment().unix() > this.form.expires\n\t\t},\n\n\t\t/**\n\t\t * Check if form is locked\n\t\t */\n\t\tisFormLocked() {\n\t\t\treturn (\n\t\t\t\tthis.form.lockedUntil === 0\n\t\t\t\t|| (this.form.lockedUntil > moment().unix()\n\t\t\t\t\t&& this.form.lockedBy !== getCurrentUser().uid)\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Return form title, or placeholder if not set\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tformTitle() {\n\t\t\tif (this.form.title) {\n\t\t\t\treturn this.form.title\n\t\t\t}\n\t\t\treturn t('forms', 'New form')\n\t\t},\n\n\t\t/**\n\t\t * Return expiration details for subtitle\n\t\t */\n\t\tformSubtitle() {\n\t\t\tif (this.form.state === FormState.FormClosed) {\n\t\t\t\t// TRANSLATORS: The form was closed manually so it does not take new submissions\n\t\t\t\treturn t('forms', 'Form closed')\n\t\t\t}\n\t\t\tif (this.form.expires) {\n\t\t\t\tconst relativeDate = moment(this.form.expires, 'X')\n\t\t\t\t\t.locale(window.OC.getLanguage())\n\t\t\t\t\t.fromNow()\n\t\t\t\tif (this.isExpired) {\n\t\t\t\t\treturn t('forms', 'Expired {relativeDate}', {\n\t\t\t\t\t\trelativeDate,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn t('forms', 'Expires {relativeDate}', { relativeDate })\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/**\n\t\t * Return, if form has Subtitle\n\t\t */\n\t\thasSubtitle() {\n\t\t\treturn this.formSubtitle !== ''\n\t\t},\n\n\t\t/**\n\t\t * Route to use, depending on readOnly\n\t\t *\n\t\t * @return {string} Route to 'submit' or 'formRoot'\n\t\t */\n\t\trouterTarget() {\n\t\t\tif (this.readOnly) {\n\t\t\t\treturn 'submit'\n\t\t\t}\n\n\t\t\treturn 'formRoot'\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Closes the App-Navigation on mobile-devices\n\t\t */\n\t\tmobileCloseNavigation() {\n\t\t\tthis.$emit('mobile-close-navigation')\n\t\t},\n\n\t\tonShareForm() {\n\t\t\tthis.$emit('open-sharing', this.form.hash)\n\t\t},\n\n\t\tonCloneForm() {\n\t\t\tthis.$emit('clone', this.form.id)\n\t\t},\n\n\t\tasync onConfirmDelete() {\n\t\t\tconst shouldDelete = await showConfirmation({\n\t\t\t\tname: t('forms', 'Delete form'),\n\t\t\t\ttext: t('forms', 'Are you sure you want to delete {title}?', {\n\t\t\t\t\ttitle: this.formTitle,\n\t\t\t\t}),\n\t\t\t\tlabelConfirm: t('forms', 'Delete form'),\n\t\t\t\tlabelReject: t('forms', 'Cancel'),\n\t\t\t})\n\n\t\t\tif (shouldDelete) {\n\t\t\t\tawait this.onDeleteForm()\n\t\t\t}\n\t\t},\n\n\t\tasync onToggleArchive() {\n\t\t\ttry {\n\t\t\t\t// TODO: add loading status feedback ?\n\t\t\t\tawait axios.patch(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyValuePairs: {\n\t\t\t\t\t\t\tstate: this.isArchived\n\t\t\t\t\t\t\t\t? FormState.FormClosed\n\t\t\t\t\t\t\t\t: FormState.FormArchived,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.$set(\n\t\t\t\t\tthis.form,\n\t\t\t\t\t'state',\n\t\t\t\t\tthis.isArchived ? FormState.FormClosed : FormState.FormArchived,\n\t\t\t\t)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error changing archived state of form', {\n\t\t\t\t\terror,\n\t\t\t\t})\n\t\t\t\tshowError(t('forms', 'Error changing archived state of form'))\n\t\t\t}\n\t\t},\n\n\t\tasync onDeleteForm() {\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tawait axios.delete(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\tthis.$emit('delete', this.form.id)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error(`Error while deleting ${this.formTitle}`, {\n\t\t\t\t\terror: error.response,\n\t\t\t\t})\n\t\t\t\tshowError(\n\t\t\t\t\tt('forms', 'Error while deleting {title}', {\n\t\t\t\t\t\ttitle: this.formTitle,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n","<!--\n  - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<NcDialog\n\t\tcontent-classes=\"archived-forms\"\n\t\t:name=\"t('forms', 'Archived forms')\"\n\t\t:open=\"open\"\n\t\tsize=\"normal\"\n\t\t@update:open=\"$emit('update:open', $event)\">\n\t\t<ul :aria-label=\"t('forms', 'Archived forms')\">\n\t\t\t<AppNavigationForm\n\t\t\t\tv-for=\"(form, key) in shownForms\"\n\t\t\t\t:key=\"key\"\n\t\t\t\t:form=\"form\"\n\t\t\t\t:read-only=\"false\"\n\t\t\t\tforce-display-actions\n\t\t\t\t@clone=\"onCloneForm(form.id)\"\n\t\t\t\t@delete=\"onDelete(form)\"\n\t\t\t\t@mobile-close-navigation=\"$emit('update:open', false)\" />\n\t\t</ul>\n\t</NcDialog>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { defineComponent } from 'vue'\n\nimport NcDialog from '@nextcloud/vue/components/NcDialog'\nimport AppNavigationForm from './AppNavigationForm.vue'\n\nexport default defineComponent({\n\tname: 'ArchivedFormsModal',\n\n\tcomponents: {\n\t\tAppNavigationForm,\n\t\tNcDialog,\n\t},\n\n\tprops: {\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\tforms: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tshownForms: [],\n\t\t}\n\t},\n\n\twatch: {\n\t\tforms: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.shownForms = [...this.forms]\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\tonCloneForm(formId) {\n\t\t\tthis.$emit('clone', formId)\n\t\t\tthis.$emit('update:open', false)\n\t\t},\n\n\t\tonDelete(form) {\n\t\t\tthis.shownForms = this.shownForms.filter(({ id }) => id !== form.id)\n\t\t},\n\t},\n})\n</script>\n\n<style scoped>\n:deep(.archived-forms) {\n\tmin-height: 50vh !important;\n\tpadding-block-end: 22px;\n}\n</style>\n","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon cog-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"CogOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon account-multiple-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M13.07 10.41A5 5 0 0 0 13.07 4.59A3.39 3.39 0 0 1 15 4A3.5 3.5 0 0 1 15 11A3.39 3.39 0 0 1 13.07 10.41M5.5 7.5A3.5 3.5 0 1 1 9 11A3.5 3.5 0 0 1 5.5 7.5M7.5 7.5A1.5 1.5 0 1 0 9 6A1.5 1.5 0 0 0 7.5 7.5M16 17V19H2V17S2 13 9 13 16 17 16 17M14 17C13.86 16.22 12.67 15 9 15S4.07 16.31 4 17M15.95 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"AccountMultipleOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon code-brackets-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M15,4V6H18V18H15V20H20V4M4,4V20H9V18H6V6H9V4H4Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"CodeBracketsIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon link-box-outline-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M19,19H5V5H19V19M11,16H10C8.39,16 6,14.94 6,12C6,9.07 8.39,8 10,8H11V10H10C9.54,10 8,10.17 8,12C8,13.9 9.67,14 10,14H11V16M14,16H13V14H14C14.46,14 16,13.83 16,12C16,10.1 14.33,10 14,10H13V8H14C15.61,8 18,9.07 18,12C18,14.94 15.61,16 14,16M15,13H9V11H15V13Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"LinkBoxOutlineIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<template>\n  <span v-bind=\"$attrs\"\n        :aria-hidden=\"title ? null : 'true'\"\n        :aria-label=\"title\"\n        class=\"material-design-icon qrcode-icon\"\n        role=\"img\"\n        @click=\"$emit('click', $event)\">\n    <svg :fill=\"fillColor\"\n         class=\"material-design-icon__svg\"\n         :width=\"size\"\n         :height=\"size\"\n         viewBox=\"0 0 24 24\">\n      <path d=\"M3,11H5V13H3V11M11,5H13V9H11V5M9,11H13V15H11V13H9V11M15,11H17V13H19V11H21V13H19V15H21V19H19V21H17V19H13V21H11V17H15V15H17V13H15V11M19,19V15H17V19H19M15,3H21V9H15V3M17,5V7H19V5H17M3,3H9V9H3V3M5,5V7H7V5H5M3,15H9V21H3V15M5,17V19H7V17H5Z\">\n        <title v-if=\"title\">{{ title }}</title>\n      </path>\n    </svg>\n  </span>\n</template>\n\n<script>\nexport default {\n  name: \"QrcodeIcon\",\n  emits: ['click'],\n  props: {\n    title: {\n      type: String,\n    },\n    fillColor: {\n      type: String,\n      default: \"currentColor\"\n    },\n    size: {\n      type: Number,\n      default: 24\n    }\n  }\n}\n</script>","<!--\n  - SPDX-FileCopyrightText: 2022 Jonas Rittershofer <jotoeri@users.noreply.github.com>\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<span\n\t\t:aria-hidden=\"!title\"\n\t\t:aria-label=\"title\"\n\t\tclass=\"material-design-icon copy-all-icon\"\n\t\trole=\"img\"\n\t\tv-bind=\"$attrs\"\n\t\t@click=\"$emit('click', $event)\">\n\t\t<svg\n\t\t\t:fill=\"fillColor\"\n\t\t\tclass=\"material-design-icon__svg\"\n\t\t\t:height=\"size\"\n\t\t\t:width=\"size\"\n\t\t\tviewBox=\"0 0 16 16\">\n\t\t\t<path\n\t\t\t\td=\"M 13.5 0 h -8 C 4.67 0 4 0.67 4 1.5 v 10 C 4 12.33 4.67 13 5.5 13 h 8 c 0.83 0 1.5 -0.67 1.5 -1.5 v -10 C 15 0.67 14.33 0 13.5 0 z M 13.5 11.5 h -8 v -10 h 8 V 11.5 z M 1 10 v -1.5 h 1.5 V 10 H 1 z M 1 13 v -1.5 h 1.5 V 13 H 1 z M 7 14.5 h 1.5 V 16 H 7 V 14.5 z M 1 5.5 h 1.5 V 7 H 1 V 5.5 z M 5.5 16 H 4 v -1.5 h 1.5 V 16 z M 2.5 16 C 1.67 16 1 15.33 1 14.5 h 1.5 V 16 z M 2.5 4 H 1 c 0 -0.83 0.67 -1.5 1.5 -1.5 V 4 z M 11.49 14.5 c 0 0.83 -0.67 1.5 -1.5 1.5 h 0 v -1.5 L 11.49 14.5 L 11.49 14.5 z\" />\n\t\t\t<title v-if=\"title\">{{ title }}</title>\n\t\t</svg>\n\t</span>\n</template>\n\n<script>\nexport default {\n\tname: 'IconCopyAll',\n\tprops: {\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\tfillColor: {\n\t\t\ttype: String,\n\t\t\tdefault: 'currentColor',\n\t\t},\n\t\tsize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\t},\n}\n</script>\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-account\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z\\\" /></svg>\"","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-account-group\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z\\\" /></svg>\"","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-email\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z\\\" /></svg>\"","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-chat\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M12,3C17.5,3 22,6.58 22,11C22,15.42 17.5,19 12,19C10.76,19 9.57,18.82 8.47,18.5C5.55,21 2,21 2,21C4.33,18.67 4.7,17.1 4.75,16.5C3.05,15.07 2,13.13 2,11C2,6.58 6.5,3 12,3Z\\\" /></svg>\"","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-circle-outline\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z\\\" /></svg>\"","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n/* eslint-disable import/no-unresolved */\nimport IconUserSvg from '@mdi/svg/svg/account.svg?raw'\nimport IconGroupSvg from '@mdi/svg/svg/account-group.svg?raw'\nimport IconMailSvg from '@mdi/svg/svg/email.svg?raw'\nimport IconChatSvg from '@mdi/svg/svg/chat.svg?raw'\nimport IconCircleSvg from '@mdi/svg/svg/circle-outline.svg?raw'\n/* eslint-enable import/no-unresolved */\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tSHARE_TYPES: {\n\t\t\t\tSHARE_TYPE_USER: OC.Share.SHARE_TYPE_USER,\n\t\t\t\tSHARE_TYPE_GROUP: OC.Share.SHARE_TYPE_GROUP,\n\t\t\t\tSHARE_TYPE_LINK: OC.Share.SHARE_TYPE_LINK,\n\t\t\t\tSHARE_TYPE_EMAIL: OC.Share.SHARE_TYPE_EMAIL,\n\t\t\t\tSHARE_TYPE_REMOTE: OC.Share.SHARE_TYPE_REMOTE,\n\t\t\t\tSHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE,\n\t\t\t\tSHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST,\n\t\t\t\tSHARE_TYPE_REMOTE_GROUP: OC.Share.SHARE_TYPE_REMOTE_GROUP,\n\t\t\t\tSHARE_TYPE_ROOM: OC.Share.SHARE_TYPE_ROOM,\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * !!! Keep in Sync with lib/Constants.php !!\n\t\t\t */\n\t\t\tSHARE_TYPES_USED: [\n\t\t\t\tOC.Share.SHARE_TYPE_USER,\n\t\t\t\tOC.Share.SHARE_TYPE_GROUP,\n\t\t\t\tOC.Share.SHARE_TYPE_LINK,\n\t\t\t\tOC.Share.SHARE_TYPE_CIRCLE,\n\t\t\t],\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Get the icon based on the share type\n\t\t * Default share is a user, other icons are here to differenciate from it, so let's not display the user icon.\n\t\t *\n\t\t * @param {number} type the share type\n\t\t * @return {string} the icon as raw svg\n\t\t */\n\t\tshareTypeToIcon(type) {\n\t\t\tswitch (type) {\n\t\t\t\tcase this.SHARE_TYPES.SHARE_TYPE_GUEST:\n\t\t\t\t\t// case this.SHARE_TYPES.SHARE_TYPE_REMOTE:\n\t\t\t\t\t// case this.SHARE_TYPES.SHARE_TYPE_USER:\n\t\t\t\t\treturn IconUserSvg\n\t\t\t\tcase this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:\n\t\t\t\tcase this.SHARE_TYPES.SHARE_TYPE_GROUP:\n\t\t\t\t\treturn IconGroupSvg\n\t\t\t\tcase this.SHARE_TYPES.SHARE_TYPE_EMAIL:\n\t\t\t\t\treturn IconMailSvg\n\t\t\t\tcase this.SHARE_TYPES.SHARE_TYPE_CIRCLE:\n\t\t\t\t\treturn IconCircleSvg\n\t\t\t\tcase this.SHARE_TYPES.SHARE_TYPE_ROOM:\n\t\t\t\t\treturn IconChatSvg\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn ''\n\t\t\t}\n\t\t},\n\t},\n}\n","/**\n * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport debounce from 'debounce'\n\nimport { INPUT_DEBOUNCE_MS } from '../models/Constants.ts'\nimport OcsResponse2Data from '../utils/OcsResponse2Data.js'\nimport logger from '../utils/Logger.js'\nimport ShareTypes from './ShareTypes.js'\n\nexport default {\n\tmixins: [ShareTypes],\n\tdata() {\n\t\treturn {\n\t\t\tloading: false,\n\n\t\t\tquery: '',\n\t\t\t// TODO: have a global mixin for this, shared with server?\n\t\t\tmaxAutocompleteResults:\n\t\t\t\tparseInt(OC.config['sharing.maxAutocompleteResults'], 10) || 200,\n\t\t\tminSearchStringLength:\n\t\t\t\tparseInt(OC.config['sharing.minSearchStringLength'], 10) || 0,\n\t\t\t// Search Results\n\t\t\trecommendations: [],\n\t\t\tsuggestions: [],\n\t\t}\n\t},\n\tcomputed: {\n\t\t/**\n\t\t * Is the search query valid ?\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisValidQuery() {\n\t\t\treturn (\n\t\t\t\tthis.query\n\t\t\t\t&& this.query.trim() !== ''\n\t\t\t\t&& this.query.length > this.minSearchStringLength\n\t\t\t)\n\t\t},\n\t\t/**\n\t\t * Text when there is no Results to be shown\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnoResultText() {\n\t\t\tif (!this.query) {\n\t\t\t\treturn t('forms', 'No recommendations. Start typing.')\n\t\t\t}\n\t\t\treturn t('forms', 'No elements found.')\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Search for suggestions\n\t\t *\n\t\t * @param {string} query The search query to search for\n\t\t * @param {number[]|undefined} shareType The type of recipient to search.\n\t\t */\n\t\tasync asyncSearch(query, shareType) {\n\t\t\t// save query to check if valid\n\t\t\tthis.query = query.trim()\n\t\t\tif (this.isValidQuery) {\n\t\t\t\t// already set loading to have proper ux feedback during debounce\n\t\t\t\tthis.loading = true\n\t\t\t\tthis.debounceGetSuggestions(query, shareType)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Debounce getSuggestions\n\t\t *\n\t\t * @param {...*} args arguments to pass\n\t\t */\n\t\tdebounceGetSuggestions: debounce(function (...args) {\n\t\t\tthis.getSuggestions(...args)\n\t\t}, INPUT_DEBOUNCE_MS),\n\n\t\t/**\n\t\t * Get suggestions\n\t\t *\n\t\t * @param {string} query the search query\n\t\t * @param {number[]|undefined} shareType The type of recipient to search.\n\t\t */\n\t\tasync getSuggestions(query, shareType) {\n\t\t\tthis.loading = true\n\n\t\t\t// Search for all used share-types, except public link.\n\t\t\tshareType ??= this.SHARE_TYPES_USED.filter(\n\t\t\t\t(type) => type !== this.SHARE_TYPES.SHARE_TYPE_LINK,\n\t\t\t)\n\n\t\t\ttry {\n\t\t\t\tconst request = await axios.get(\n\t\t\t\t\tgenerateOcsUrl('apps/files_sharing/api/v1/sharees'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\t\titemType: 'file',\n\t\t\t\t\t\t\tperPage: this.maxAutocompleteResults,\n\t\t\t\t\t\t\tsearch: query,\n\t\t\t\t\t\t\tshareType,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst data = OcsResponse2Data(request)\n\t\t\t\tconst exact = data.exact\n\t\t\t\tdelete data.exact // removing exact from general results\n\n\t\t\t\tconst exactSuggestions = this.formatSearchResults(exact)\n\t\t\t\tconst suggestions = this.formatSearchResults(data)\n\n\t\t\t\tthis.suggestions = exactSuggestions.concat(suggestions)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Loading Suggestions failed.', { error })\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Get the sharing recommendations\n\t\t */\n\t\tasync getRecommendations() {\n\t\t\tthis.loading = true\n\n\t\t\ttry {\n\t\t\t\tconst request = await axios.get(\n\t\t\t\t\tgenerateOcsUrl('apps/files_sharing/api/v1/sharees_recommended'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\t\titemType: 'file',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tthis.recommendations = this.formatSearchResults(\n\t\t\t\t\tOcsResponse2Data(request).exact,\n\t\t\t\t)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Fetching recommendations failed.', { error })\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * A OCS Sharee response\n\t\t * @typedef {{label: string, shareWithDisplayNameUnique: string, value: { shareType: number, shareWith: string }, status?: unknown }} Sharee\n\t\t */\n\n\t\t/**\n\t\t * Format search results\n\t\t *\n\t\t * @param {Record<string, Sharee>} results Results as returned by search\n\t\t * @return {Sharee[]} results as we use them on storage\n\t\t */\n\t\tformatSearchResults(results) {\n\t\t\t// flatten array of arrays\n\t\t\tconst flatResults = Object.values(results).flat()\n\n\t\t\treturn (\n\t\t\t\tthis.filterUnwantedShares(flatResults)\n\t\t\t\t\t.map((share) => this.formatForMultiselect(share))\n\t\t\t\t\t// sort by type so we can get user&groups first...\n\t\t\t\t\t.sort((a, b) => a.shareType - b.shareType)\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Remove static unwanted shares from search results\n\t\t * Existing shares must be done dynamically to account for new shares.\n\t\t *\n\t\t * @param {Sharee[]} shares the array of share objects\n\t\t * @return {Sharee[]}\n\t\t */\n\t\tfilterUnwantedShares(shares) {\n\t\t\treturn shares.filter((share) => {\n\t\t\t\t// only use proper objects\n\t\t\t\tif (typeof share !== 'object') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\t// filter out current user\n\t\t\t\t\tif (\n\t\t\t\t\t\tshare.value.shareType === this.SHARE_TYPES.SHARE_TYPE_USER\n\t\t\t\t\t\t&& share.value.shareWith === getCurrentUser().uid\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\n\t\t\t\t\t// All good, let's add the suggestion\n\t\t\t\t\treturn true\n\t\t\t\t} catch {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Format shares for the multiselect options\n\t\t *\n\t\t * @param {Sharee} share Share in search formatting\n\t\t * @return {object} Share in multiselect formatting\n\t\t */\n\t\tformatForMultiselect(share) {\n\t\t\treturn {\n\t\t\t\tshareWith: share.value.shareWith,\n\t\t\t\tshareType: share.value.shareType,\n\t\t\t\tuser: share.value.shareWith,\n\t\t\t\tisNoUser: share.value.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER,\n\t\t\t\tid: share.value.shareWith,\n\t\t\t\tdisplayName: share.label,\n\t\t\t\tsubname: share.shareWithDisplayNameUnique,\n\t\t\t\ticonSvg: this.shareTypeToIcon(share.value.shareType),\n\t\t\t\t// Vue unique binding to render within Multiselect's AvatarSelectOption\n\t\t\t\tkey: share.value.shareWith + '-' + share.value.shareType,\n\t\t\t}\n\t\t},\n\t},\n}\n","<!--\n  - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div>\n\t\t<NcSelectUsers\n\t\t\tkeep-open\n\t\t\t:loading=\"showLoadingCircle\"\n\t\t\t:disabled=\"locked || !isCurrentUserOwner\"\n\t\t\t:options=\"options\"\n\t\t\t:placeholder=\"t('forms', 'Search for user, group or team …')\"\n\t\t\t:aria-label-listbox=\"t('forms', 'Search for user, group or team …')\"\n\t\t\t@search=\"asyncSearch\"\n\t\t\t@update:modelValue=\"addShare\">\n\t\t\t<template #no-options>\n\t\t\t\t{{ noResultText }}\n\t\t\t</template>\n\t\t</NcSelectUsers>\n\t</div>\n</template>\n\n<script>\nimport NcSelectUsers from '@nextcloud/vue/components/NcSelectUsers'\n\nimport UserSearchMixin from '../../mixins/UserSearchMixin.js'\n\nexport default {\n\tcomponents: {\n\t\tNcSelectUsers,\n\t},\n\n\tmixins: [UserSearchMixin],\n\n\tprops: {\n\t\tcurrentShares: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\tshowLoading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tlocked: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\tisCurrentUserOwner: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Multiselect options. Recommendations by default, direct search when search query is valid.\n\t\t * Filter out existing shares\n\t\t *\n\t\t * @return {Array}\n\t\t */\n\t\toptions() {\n\t\t\tif (this.isValidQuery) {\n\t\t\t\t// Suggestions without existing shares\n\t\t\t\treturn this.suggestions.filter(\n\t\t\t\t\t(item) =>\n\t\t\t\t\t\t!this.currentShares.find(\n\t\t\t\t\t\t\t(share) =>\n\t\t\t\t\t\t\t\tshare.shareWith === item.shareWith\n\t\t\t\t\t\t\t\t&& share.shareType === item.shareType,\n\t\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t\t// Recommendations without existing shares\n\t\t\treturn this.recommendations.filter(\n\t\t\t\t(item) =>\n\t\t\t\t\t!this.currentShares.find(\n\t\t\t\t\t\t(share) =>\n\t\t\t\t\t\t\tshare.shareWith === item.shareWith\n\t\t\t\t\t\t\t&& share.shareType === item.shareType,\n\t\t\t\t\t),\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Show Loading if loading is either set by parent or by this module (search)\n\t\t */\n\t\tshowLoadingCircle() {\n\t\t\treturn this.showLoading || this.loading\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Preloading recommendations\n\t\tthis.getRecommendations()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Format share for form.shares and add it.\n\t\t *\n\t\t * @param {object} share New share to share with, format still for multiselect.\n\t\t */\n\t\taddShare(share) {\n\t\t\tconst newShare = {\n\t\t\t\tshareWith: share.shareWith,\n\t\t\t\tdisplayName: share.displayName,\n\t\t\t\tshareType: share.shareType,\n\t\t\t}\n\t\t\tthis.$emit('add-share', newShare)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.select {\n\tmargin-block-end: 8px !important;\n\twidth: 100%;\n}\n</style>\n","<!--\n  - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<li class=\"share-div\">\n\t\t<NcAvatar\n\t\t\t:user=\"share.shareWith\"\n\t\t\tdisable-menu\n\t\t\t:display-name=\"displayName\"\n\t\t\t:is-no-user=\"isNoUser\" />\n\t\t<div class=\"share-div__desc\">\n\t\t\t<span>{{ displayName }}</span>\n\t\t\t<span>{{ displayNameAppendix }}</span>\n\t\t</div>\n\t\t<NcActions class=\"share-div__actions\" :disabled=\"!isCurrentUserOwner\">\n\t\t\t<NcActionCaption :name=\"t('forms', 'Permissions')\" />\n\t\t\t<NcActionCheckbox\n\t\t\t\t:model-value=\"canEditForm\"\n\t\t\t\t:disabled=\"locked\"\n\t\t\t\t@update:model-value=\"updatePermissionEdit\">\n\t\t\t\t{{ t('forms', 'Edit form') }}\n\t\t\t</NcActionCheckbox>\n\t\t\t<NcActionCheckbox\n\t\t\t\t:model-value=\"canAccessResults\"\n\t\t\t\t:disabled=\"locked\"\n\t\t\t\t@update:model-value=\"updatePermissionResults\">\n\t\t\t\t{{ t('forms', 'View responses') }}\n\t\t\t</NcActionCheckbox>\n\t\t\t<NcActionCheckbox\n\t\t\t\t:model-value=\"canDeleteResults\"\n\t\t\t\t:disabled=\"!canAccessResults || locked\"\n\t\t\t\t@update:model-value=\"updatePermissionDeleteResults\">\n\t\t\t\t{{ t('forms', 'Delete responses') }}\n\t\t\t</NcActionCheckbox>\n\t\t\t<NcActionSeparator />\n\t\t\t<NcActionButton :disabled=\"locked\" @click=\"removeShare\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconClose :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('forms', 'Delete') }}\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</li>\n</template>\n\n<script>\nimport NcActions from '@nextcloud/vue/components/NcActions'\nimport NcActionButton from '@nextcloud/vue/components/NcActionButton'\nimport NcActionCaption from '@nextcloud/vue/components/NcActionCaption'\nimport NcActionCheckbox from '@nextcloud/vue/components/NcActionCheckbox'\nimport NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'\nimport NcAvatar from '@nextcloud/vue/components/NcAvatar'\n\nimport IconClose from 'vue-material-design-icons/Close.vue'\nimport ShareTypes from '../../mixins/ShareTypes.js'\nimport PermissionTypes from '../../mixins/PermissionTypes.js'\n\nexport default {\n\tcomponents: {\n\t\tIconClose,\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcActionCaption,\n\t\tNcActionCheckbox,\n\t\tNcActionSeparator,\n\t\tNcAvatar,\n\t},\n\n\tmixins: [PermissionTypes, ShareTypes],\n\n\tprops: {\n\t\tshare: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\tlocked: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\tisCurrentUserOwner: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\tcanAccessResults() {\n\t\t\treturn this.share.permissions.includes(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_RESULTS,\n\t\t\t)\n\t\t},\n\t\tcanDeleteResults() {\n\t\t\treturn this.share.permissions.includes(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_RESULTS_DELETE,\n\t\t\t)\n\t\t},\n\t\tcanEditForm() {\n\t\t\treturn this.share.permissions.includes(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_EDIT,\n\t\t\t)\n\t\t},\n\t\tisNoUser() {\n\t\t\treturn this.share.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER\n\t\t},\n\t\tdisplayName() {\n\t\t\treturn !this.share.displayName\n\t\t\t\t? this.share.shareWith\n\t\t\t\t: this.share.displayName\n\t\t},\n\t\tdisplayNameAppendix() {\n\t\t\tswitch (this.share.shareType) {\n\t\t\t\tcase this.SHARE_TYPES.SHARE_TYPE_GROUP:\n\t\t\t\t\treturn `(${t('forms', 'Group')})`\n\t\t\t\tcase this.SHARE_TYPES.SHARE_TYPE_CIRCLE:\n\t\t\t\t\treturn `(${t('forms', 'Team')})`\n\t\t\t\tdefault:\n\t\t\t\t\treturn ''\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\tremoveShare() {\n\t\t\tthis.$emit('remove-share', this.share)\n\t\t},\n\n\t\t/**\n\t\t * @param {boolean} hasPermission If the results permission should be granted\n\t\t */\n\t\tupdatePermissionResults(hasPermission) {\n\t\t\tif (hasPermission === false) {\n\t\t\t\t// ensure to remove the delete permission if results permission is dropped\n\t\t\t\tthis.updatePermission(\n\t\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_RESULTS_DELETE,\n\t\t\t\t\tfalse,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn this.updatePermission(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_RESULTS,\n\t\t\t\thasPermission,\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * @param {boolean} hasPermission If the results_delete permission should be granted\n\t\t */\n\t\tupdatePermissionDeleteResults(hasPermission) {\n\t\t\treturn this.updatePermission(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_RESULTS_DELETE,\n\t\t\t\thasPermission,\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * @param {boolean} hasPermission If the results_delete permission should be granted\n\t\t */\n\t\tupdatePermissionEdit(hasPermission) {\n\t\t\treturn this.updatePermission(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_EDIT,\n\t\t\t\thasPermission,\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Grant or remove permission from share\n\t\t *\n\t\t * @param {string} permission The permission to grant or remove\n\t\t * @param {boolean} hasPermission True if granted, False if removed\n\t\t */\n\t\tupdatePermission(permission, hasPermission) {\n\t\t\tconst share = { ...this.share }\n\t\t\tif (hasPermission) {\n\t\t\t\tshare.permissions = [...new Set([...share.permissions, permission])]\n\t\t\t} else {\n\t\t\t\tshare.permissions = share.permissions.filter(\n\t\t\t\t\t(perm) => perm !== permission,\n\t\t\t\t)\n\t\t\t}\n\t\t\tthis.$emit('update:share', share)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.share-div {\n\tdisplay: flex;\n\theight: var(--default-clickable-area);\n\talign-items: center;\n\n\t&__desc {\n\t\tpadding: 8px;\n\t\tflex-grow: 1;\n\t}\n}\n</style>\n","// can-promise has a crash in some versions of react native that dont have\n// standard global objects\n// https://github.com/soldair/node-qrcode/issues/157\n\nmodule.exports = function () {\n  return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then\n}\n","let toSJISFunction\nconst CODEWORDS_COUNT = [\n  0, // Not used\n  26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n  404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n  1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n  2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param  {Number} version QR Code version\n * @return {Number}         size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n  if (!version) throw new Error('\"version\" cannot be null or undefined')\n  if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n  return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param  {Number} version QR Code version\n * @return {Number}         Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n  return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param  {Number} data Value to encode\n * @return {Number}      Encoded value\n */\nexports.getBCHDigit = function (data) {\n  let digit = 0\n\n  while (data !== 0) {\n    digit++\n    data >>>= 1\n  }\n\n  return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n  if (typeof f !== 'function') {\n    throw new Error('\"toSJISFunc\" is not a valid function.')\n  }\n\n  toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n  return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n  return toSJISFunction(kanji)\n}\n","exports.L = { bit: 1 }\nexports.M = { bit: 0 }\nexports.Q = { bit: 3 }\nexports.H = { bit: 2 }\n\nfunction fromString (string) {\n  if (typeof string !== 'string') {\n    throw new Error('Param is not a string')\n  }\n\n  const lcStr = string.toLowerCase()\n\n  switch (lcStr) {\n    case 'l':\n    case 'low':\n      return exports.L\n\n    case 'm':\n    case 'medium':\n      return exports.M\n\n    case 'q':\n    case 'quartile':\n      return exports.Q\n\n    case 'h':\n    case 'high':\n      return exports.H\n\n    default:\n      throw new Error('Unknown EC Level: ' + string)\n  }\n}\n\nexports.isValid = function isValid (level) {\n  return level && typeof level.bit !== 'undefined' &&\n    level.bit >= 0 && level.bit < 4\n}\n\nexports.from = function from (value, defaultValue) {\n  if (exports.isValid(value)) {\n    return value\n  }\n\n  try {\n    return fromString(value)\n  } catch (e) {\n    return defaultValue\n  }\n}\n","function BitBuffer () {\n  this.buffer = []\n  this.length = 0\n}\n\nBitBuffer.prototype = {\n\n  get: function (index) {\n    const bufIndex = Math.floor(index / 8)\n    return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1\n  },\n\n  put: function (num, length) {\n    for (let i = 0; i < length; i++) {\n      this.putBit(((num >>> (length - i - 1)) & 1) === 1)\n    }\n  },\n\n  getLengthInBits: function () {\n    return this.length\n  },\n\n  putBit: function (bit) {\n    const bufIndex = Math.floor(this.length / 8)\n    if (this.buffer.length <= bufIndex) {\n      this.buffer.push(0)\n    }\n\n    if (bit) {\n      this.buffer[bufIndex] |= (0x80 >>> (this.length % 8))\n    }\n\n    this.length++\n  }\n}\n\nmodule.exports = BitBuffer\n","/**\n * Helper class to handle QR Code symbol modules\n *\n * @param {Number} size Symbol size\n */\nfunction BitMatrix (size) {\n  if (!size || size < 1) {\n    throw new Error('BitMatrix size must be defined and greater than 0')\n  }\n\n  this.size = size\n  this.data = new Uint8Array(size * size)\n  this.reservedBit = new Uint8Array(size * size)\n}\n\n/**\n * Set bit value at specified location\n * If reserved flag is set, this bit will be ignored during masking process\n *\n * @param {Number}  row\n * @param {Number}  col\n * @param {Boolean} value\n * @param {Boolean} reserved\n */\nBitMatrix.prototype.set = function (row, col, value, reserved) {\n  const index = row * this.size + col\n  this.data[index] = value\n  if (reserved) this.reservedBit[index] = true\n}\n\n/**\n * Returns bit value at specified location\n *\n * @param  {Number}  row\n * @param  {Number}  col\n * @return {Boolean}\n */\nBitMatrix.prototype.get = function (row, col) {\n  return this.data[row * this.size + col]\n}\n\n/**\n * Applies xor operator at specified location\n * (used during masking process)\n *\n * @param {Number}  row\n * @param {Number}  col\n * @param {Boolean} value\n */\nBitMatrix.prototype.xor = function (row, col, value) {\n  this.data[row * this.size + col] ^= value\n}\n\n/**\n * Check if bit at specified location is reserved\n *\n * @param {Number}   row\n * @param {Number}   col\n * @return {Boolean}\n */\nBitMatrix.prototype.isReserved = function (row, col) {\n  return this.reservedBit[row * this.size + col]\n}\n\nmodule.exports = BitMatrix\n","/**\n * Alignment pattern are fixed reference pattern in defined positions\n * in a matrix symbology, which enables the decode software to re-synchronise\n * the coordinate mapping of the image modules in the event of moderate amounts\n * of distortion of the image.\n *\n * Alignment patterns are present only in QR Code symbols of version 2 or larger\n * and their number depends on the symbol version.\n */\n\nconst getSymbolSize = require('./utils').getSymbolSize\n\n/**\n * Calculate the row/column coordinates of the center module of each alignment pattern\n * for the specified QR Code version.\n *\n * The alignment patterns are positioned symmetrically on either side of the diagonal\n * running from the top left corner of the symbol to the bottom right corner.\n *\n * Since positions are simmetrical only half of the coordinates are returned.\n * Each item of the array will represent in turn the x and y coordinate.\n * @see {@link getPositions}\n *\n * @param  {Number} version QR Code version\n * @return {Array}          Array of coordinate\n */\nexports.getRowColCoords = function getRowColCoords (version) {\n  if (version === 1) return []\n\n  const posCount = Math.floor(version / 7) + 2\n  const size = getSymbolSize(version)\n  const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2\n  const positions = [size - 7] // Last coord is always (size - 7)\n\n  for (let i = 1; i < posCount - 1; i++) {\n    positions[i] = positions[i - 1] - intervals\n  }\n\n  positions.push(6) // First coord is always 6\n\n  return positions.reverse()\n}\n\n/**\n * Returns an array containing the positions of each alignment pattern.\n * Each array's element represent the center point of the pattern as (x, y) coordinates\n *\n * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}\n * and filtering out the items that overlaps with finder pattern\n *\n * @example\n * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.\n * The alignment patterns, therefore, are to be centered on (row, column)\n * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).\n * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns\n * and are not therefore used for alignment patterns.\n *\n * let pos = getPositions(7)\n * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]\n *\n * @param  {Number} version QR Code version\n * @return {Array}          Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n  const coords = []\n  const pos = exports.getRowColCoords(version)\n  const posLength = pos.length\n\n  for (let i = 0; i < posLength; i++) {\n    for (let j = 0; j < posLength; j++) {\n      // Skip if position is occupied by finder patterns\n      if ((i === 0 && j === 0) || // top-left\n          (i === 0 && j === posLength - 1) || // bottom-left\n          (i === posLength - 1 && j === 0)) { // top-right\n        continue\n      }\n\n      coords.push([pos[i], pos[j]])\n    }\n  }\n\n  return coords\n}\n","const getSymbolSize = require('./utils').getSymbolSize\nconst FINDER_PATTERN_SIZE = 7\n\n/**\n * Returns an array containing the positions of each finder pattern.\n * Each array's element represent the top-left point of the pattern as (x, y) coordinates\n *\n * @param  {Number} version QR Code version\n * @return {Array}          Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n  const size = getSymbolSize(version)\n\n  return [\n    // top-left\n    [0, 0],\n    // top-right\n    [size - FINDER_PATTERN_SIZE, 0],\n    // bottom-left\n    [0, size - FINDER_PATTERN_SIZE]\n  ]\n}\n","/**\n * Data mask pattern reference\n * @type {Object}\n */\nexports.Patterns = {\n  PATTERN000: 0,\n  PATTERN001: 1,\n  PATTERN010: 2,\n  PATTERN011: 3,\n  PATTERN100: 4,\n  PATTERN101: 5,\n  PATTERN110: 6,\n  PATTERN111: 7\n}\n\n/**\n * Weighted penalty scores for the undesirable features\n * @type {Object}\n */\nconst PenaltyScores = {\n  N1: 3,\n  N2: 3,\n  N3: 40,\n  N4: 10\n}\n\n/**\n * Check if mask pattern value is valid\n *\n * @param  {Number}  mask    Mask pattern\n * @return {Boolean}         true if valid, false otherwise\n */\nexports.isValid = function isValid (mask) {\n  return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7\n}\n\n/**\n * Returns mask pattern from a value.\n * If value is not valid, returns undefined\n *\n * @param  {Number|String} value        Mask pattern value\n * @return {Number}                     Valid mask pattern or undefined\n */\nexports.from = function from (value) {\n  return exports.isValid(value) ? parseInt(value, 10) : undefined\n}\n\n/**\n* Find adjacent modules in row/column with the same color\n* and assign a penalty value.\n*\n* Points: N1 + i\n* i is the amount by which the number of adjacent modules of the same color exceeds 5\n*/\nexports.getPenaltyN1 = function getPenaltyN1 (data) {\n  const size = data.size\n  let points = 0\n  let sameCountCol = 0\n  let sameCountRow = 0\n  let lastCol = null\n  let lastRow = null\n\n  for (let row = 0; row < size; row++) {\n    sameCountCol = sameCountRow = 0\n    lastCol = lastRow = null\n\n    for (let col = 0; col < size; col++) {\n      let module = data.get(row, col)\n      if (module === lastCol) {\n        sameCountCol++\n      } else {\n        if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n        lastCol = module\n        sameCountCol = 1\n      }\n\n      module = data.get(col, row)\n      if (module === lastRow) {\n        sameCountRow++\n      } else {\n        if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n        lastRow = module\n        sameCountRow = 1\n      }\n    }\n\n    if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n    if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n  }\n\n  return points\n}\n\n/**\n * Find 2x2 blocks with the same color and assign a penalty value\n *\n * Points: N2 * (m - 1) * (n - 1)\n */\nexports.getPenaltyN2 = function getPenaltyN2 (data) {\n  const size = data.size\n  let points = 0\n\n  for (let row = 0; row < size - 1; row++) {\n    for (let col = 0; col < size - 1; col++) {\n      const last = data.get(row, col) +\n        data.get(row, col + 1) +\n        data.get(row + 1, col) +\n        data.get(row + 1, col + 1)\n\n      if (last === 4 || last === 0) points++\n    }\n  }\n\n  return points * PenaltyScores.N2\n}\n\n/**\n * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,\n * preceded or followed by light area 4 modules wide\n *\n * Points: N3 * number of pattern found\n */\nexports.getPenaltyN3 = function getPenaltyN3 (data) {\n  const size = data.size\n  let points = 0\n  let bitsCol = 0\n  let bitsRow = 0\n\n  for (let row = 0; row < size; row++) {\n    bitsCol = bitsRow = 0\n    for (let col = 0; col < size; col++) {\n      bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col)\n      if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++\n\n      bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row)\n      if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++\n    }\n  }\n\n  return points * PenaltyScores.N3\n}\n\n/**\n * Calculate proportion of dark modules in entire symbol\n *\n * Points: N4 * k\n *\n * k is the rating of the deviation of the proportion of dark modules\n * in the symbol from 50% in steps of 5%\n */\nexports.getPenaltyN4 = function getPenaltyN4 (data) {\n  let darkCount = 0\n  const modulesCount = data.data.length\n\n  for (let i = 0; i < modulesCount; i++) darkCount += data.data[i]\n\n  const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10)\n\n  return k * PenaltyScores.N4\n}\n\n/**\n * Return mask value at given position\n *\n * @param  {Number} maskPattern Pattern reference value\n * @param  {Number} i           Row\n * @param  {Number} j           Column\n * @return {Boolean}            Mask value\n */\nfunction getMaskAt (maskPattern, i, j) {\n  switch (maskPattern) {\n    case exports.Patterns.PATTERN000: return (i + j) % 2 === 0\n    case exports.Patterns.PATTERN001: return i % 2 === 0\n    case exports.Patterns.PATTERN010: return j % 3 === 0\n    case exports.Patterns.PATTERN011: return (i + j) % 3 === 0\n    case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0\n    case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0\n    case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0\n    case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0\n\n    default: throw new Error('bad maskPattern:' + maskPattern)\n  }\n}\n\n/**\n * Apply a mask pattern to a BitMatrix\n *\n * @param  {Number}    pattern Pattern reference number\n * @param  {BitMatrix} data    BitMatrix data\n */\nexports.applyMask = function applyMask (pattern, data) {\n  const size = data.size\n\n  for (let col = 0; col < size; col++) {\n    for (let row = 0; row < size; row++) {\n      if (data.isReserved(row, col)) continue\n      data.xor(row, col, getMaskAt(pattern, row, col))\n    }\n  }\n}\n\n/**\n * Returns the best mask pattern for data\n *\n * @param  {BitMatrix} data\n * @return {Number} Mask pattern reference number\n */\nexports.getBestMask = function getBestMask (data, setupFormatFunc) {\n  const numPatterns = Object.keys(exports.Patterns).length\n  let bestPattern = 0\n  let lowerPenalty = Infinity\n\n  for (let p = 0; p < numPatterns; p++) {\n    setupFormatFunc(p)\n    exports.applyMask(p, data)\n\n    // Calculate penalty\n    const penalty =\n      exports.getPenaltyN1(data) +\n      exports.getPenaltyN2(data) +\n      exports.getPenaltyN3(data) +\n      exports.getPenaltyN4(data)\n\n    // Undo previously applied mask\n    exports.applyMask(p, data)\n\n    if (penalty < lowerPenalty) {\n      lowerPenalty = penalty\n      bestPattern = p\n    }\n  }\n\n  return bestPattern\n}\n","const ECLevel = require('./error-correction-level')\r\n\r\nconst EC_BLOCKS_TABLE = [\r\n// L  M  Q  H\r\n  1, 1, 1, 1,\r\n  1, 1, 1, 1,\r\n  1, 1, 2, 2,\r\n  1, 2, 2, 4,\r\n  1, 2, 4, 4,\r\n  2, 4, 4, 4,\r\n  2, 4, 6, 5,\r\n  2, 4, 6, 6,\r\n  2, 5, 8, 8,\r\n  4, 5, 8, 8,\r\n  4, 5, 8, 11,\r\n  4, 8, 10, 11,\r\n  4, 9, 12, 16,\r\n  4, 9, 16, 16,\r\n  6, 10, 12, 18,\r\n  6, 10, 17, 16,\r\n  6, 11, 16, 19,\r\n  6, 13, 18, 21,\r\n  7, 14, 21, 25,\r\n  8, 16, 20, 25,\r\n  8, 17, 23, 25,\r\n  9, 17, 23, 34,\r\n  9, 18, 25, 30,\r\n  10, 20, 27, 32,\r\n  12, 21, 29, 35,\r\n  12, 23, 34, 37,\r\n  12, 25, 34, 40,\r\n  13, 26, 35, 42,\r\n  14, 28, 38, 45,\r\n  15, 29, 40, 48,\r\n  16, 31, 43, 51,\r\n  17, 33, 45, 54,\r\n  18, 35, 48, 57,\r\n  19, 37, 51, 60,\r\n  19, 38, 53, 63,\r\n  20, 40, 56, 66,\r\n  21, 43, 59, 70,\r\n  22, 45, 62, 74,\r\n  24, 47, 65, 77,\r\n  25, 49, 68, 81\r\n]\r\n\r\nconst EC_CODEWORDS_TABLE = [\r\n// L  M  Q  H\r\n  7, 10, 13, 17,\r\n  10, 16, 22, 28,\r\n  15, 26, 36, 44,\r\n  20, 36, 52, 64,\r\n  26, 48, 72, 88,\r\n  36, 64, 96, 112,\r\n  40, 72, 108, 130,\r\n  48, 88, 132, 156,\r\n  60, 110, 160, 192,\r\n  72, 130, 192, 224,\r\n  80, 150, 224, 264,\r\n  96, 176, 260, 308,\r\n  104, 198, 288, 352,\r\n  120, 216, 320, 384,\r\n  132, 240, 360, 432,\r\n  144, 280, 408, 480,\r\n  168, 308, 448, 532,\r\n  180, 338, 504, 588,\r\n  196, 364, 546, 650,\r\n  224, 416, 600, 700,\r\n  224, 442, 644, 750,\r\n  252, 476, 690, 816,\r\n  270, 504, 750, 900,\r\n  300, 560, 810, 960,\r\n  312, 588, 870, 1050,\r\n  336, 644, 952, 1110,\r\n  360, 700, 1020, 1200,\r\n  390, 728, 1050, 1260,\r\n  420, 784, 1140, 1350,\r\n  450, 812, 1200, 1440,\r\n  480, 868, 1290, 1530,\r\n  510, 924, 1350, 1620,\r\n  540, 980, 1440, 1710,\r\n  570, 1036, 1530, 1800,\r\n  570, 1064, 1590, 1890,\r\n  600, 1120, 1680, 1980,\r\n  630, 1204, 1770, 2100,\r\n  660, 1260, 1860, 2220,\r\n  720, 1316, 1950, 2310,\r\n  750, 1372, 2040, 2430\r\n]\r\n\r\n/**\r\n * Returns the number of error correction block that the QR Code should contain\r\n * for the specified version and error correction level.\r\n *\r\n * @param  {Number} version              QR Code version\r\n * @param  {Number} errorCorrectionLevel Error correction level\r\n * @return {Number}                      Number of error correction blocks\r\n */\r\nexports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {\r\n  switch (errorCorrectionLevel) {\r\n    case ECLevel.L:\r\n      return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]\r\n    case ECLevel.M:\r\n      return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]\r\n    case ECLevel.Q:\r\n      return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]\r\n    case ECLevel.H:\r\n      return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]\r\n    default:\r\n      return undefined\r\n  }\r\n}\r\n\r\n/**\r\n * Returns the number of error correction codewords to use for the specified\r\n * version and error correction level.\r\n *\r\n * @param  {Number} version              QR Code version\r\n * @param  {Number} errorCorrectionLevel Error correction level\r\n * @return {Number}                      Number of error correction codewords\r\n */\r\nexports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {\r\n  switch (errorCorrectionLevel) {\r\n    case ECLevel.L:\r\n      return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]\r\n    case ECLevel.M:\r\n      return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]\r\n    case ECLevel.Q:\r\n      return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]\r\n    case ECLevel.H:\r\n      return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]\r\n    default:\r\n      return undefined\r\n  }\r\n}\r\n","const EXP_TABLE = new Uint8Array(512)\nconst LOG_TABLE = new Uint8Array(256)\n/**\n * Precompute the log and anti-log tables for faster computation later\n *\n * For each possible value in the galois field 2^8, we will pre-compute\n * the logarithm and anti-logarithm (exponential) of this value\n *\n * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}\n */\n;(function initTables () {\n  let x = 1\n  for (let i = 0; i < 255; i++) {\n    EXP_TABLE[i] = x\n    LOG_TABLE[x] = i\n\n    x <<= 1 // multiply by 2\n\n    // The QR code specification says to use byte-wise modulo 100011101 arithmetic.\n    // This means that when a number is 256 or larger, it should be XORed with 0x11D.\n    if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)\n      x ^= 0x11D\n    }\n  }\n\n  // Optimization: double the size of the anti-log table so that we don't need to mod 255 to\n  // stay inside the bounds (because we will mainly use this table for the multiplication of\n  // two GF numbers, no more).\n  // @see {@link mul}\n  for (let i = 255; i < 512; i++) {\n    EXP_TABLE[i] = EXP_TABLE[i - 255]\n  }\n}())\n\n/**\n * Returns log value of n inside Galois Field\n *\n * @param  {Number} n\n * @return {Number}\n */\nexports.log = function log (n) {\n  if (n < 1) throw new Error('log(' + n + ')')\n  return LOG_TABLE[n]\n}\n\n/**\n * Returns anti-log value of n inside Galois Field\n *\n * @param  {Number} n\n * @return {Number}\n */\nexports.exp = function exp (n) {\n  return EXP_TABLE[n]\n}\n\n/**\n * Multiplies two number inside Galois Field\n *\n * @param  {Number} x\n * @param  {Number} y\n * @return {Number}\n */\nexports.mul = function mul (x, y) {\n  if (x === 0 || y === 0) return 0\n\n  // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized\n  // @see {@link initTables}\n  return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]\n}\n","const GF = require('./galois-field')\n\n/**\n * Multiplies two polynomials inside Galois Field\n *\n * @param  {Uint8Array} p1 Polynomial\n * @param  {Uint8Array} p2 Polynomial\n * @return {Uint8Array}    Product of p1 and p2\n */\nexports.mul = function mul (p1, p2) {\n  const coeff = new Uint8Array(p1.length + p2.length - 1)\n\n  for (let i = 0; i < p1.length; i++) {\n    for (let j = 0; j < p2.length; j++) {\n      coeff[i + j] ^= GF.mul(p1[i], p2[j])\n    }\n  }\n\n  return coeff\n}\n\n/**\n * Calculate the remainder of polynomials division\n *\n * @param  {Uint8Array} divident Polynomial\n * @param  {Uint8Array} divisor  Polynomial\n * @return {Uint8Array}          Remainder\n */\nexports.mod = function mod (divident, divisor) {\n  let result = new Uint8Array(divident)\n\n  while ((result.length - divisor.length) >= 0) {\n    const coeff = result[0]\n\n    for (let i = 0; i < divisor.length; i++) {\n      result[i] ^= GF.mul(divisor[i], coeff)\n    }\n\n    // remove all zeros from buffer head\n    let offset = 0\n    while (offset < result.length && result[offset] === 0) offset++\n    result = result.slice(offset)\n  }\n\n  return result\n}\n\n/**\n * Generate an irreducible generator polynomial of specified degree\n * (used by Reed-Solomon encoder)\n *\n * @param  {Number} degree Degree of the generator polynomial\n * @return {Uint8Array}    Buffer containing polynomial coefficients\n */\nexports.generateECPolynomial = function generateECPolynomial (degree) {\n  let poly = new Uint8Array([1])\n  for (let i = 0; i < degree; i++) {\n    poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]))\n  }\n\n  return poly\n}\n","const Polynomial = require('./polynomial')\n\nfunction ReedSolomonEncoder (degree) {\n  this.genPoly = undefined\n  this.degree = degree\n\n  if (this.degree) this.initialize(this.degree)\n}\n\n/**\n * Initialize the encoder.\n * The input param should correspond to the number of error correction codewords.\n *\n * @param  {Number} degree\n */\nReedSolomonEncoder.prototype.initialize = function initialize (degree) {\n  // create an irreducible generator polynomial\n  this.degree = degree\n  this.genPoly = Polynomial.generateECPolynomial(this.degree)\n}\n\n/**\n * Encodes a chunk of data\n *\n * @param  {Uint8Array} data Buffer containing input data\n * @return {Uint8Array}      Buffer containing encoded data\n */\nReedSolomonEncoder.prototype.encode = function encode (data) {\n  if (!this.genPoly) {\n    throw new Error('Encoder not initialized')\n  }\n\n  // Calculate EC for this data block\n  // extends data size to data+genPoly size\n  const paddedData = new Uint8Array(data.length + this.degree)\n  paddedData.set(data)\n\n  // The error correction codewords are the remainder after dividing the data codewords\n  // by a generator polynomial\n  const remainder = Polynomial.mod(paddedData, this.genPoly)\n\n  // return EC data blocks (last n byte, where n is the degree of genPoly)\n  // If coefficients number in remainder are less than genPoly degree,\n  // pad with 0s to the left to reach the needed number of coefficients\n  const start = this.degree - remainder.length\n  if (start > 0) {\n    const buff = new Uint8Array(this.degree)\n    buff.set(remainder, start)\n\n    return buff\n  }\n\n  return remainder\n}\n\nmodule.exports = ReedSolomonEncoder\n","/**\n * Check if QR Code version is valid\n *\n * @param  {Number}  version QR Code version\n * @return {Boolean}         true if valid version, false otherwise\n */\nexports.isValid = function isValid (version) {\n  return !isNaN(version) && version >= 1 && version <= 40\n}\n","const numeric = '[0-9]+'\nconst alphanumeric = '[A-Z $%*+\\\\-./:]+'\nlet kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +\n  '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +\n  '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +\n  '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'\nkanji = kanji.replace(/u/g, '\\\\u')\n\nconst byte = '(?:(?![A-Z0-9 $%*+\\\\-./:]|' + kanji + ')(?:.|[\\r\\n]))+'\n\nexports.KANJI = new RegExp(kanji, 'g')\nexports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\\\-./:]+', 'g')\nexports.BYTE = new RegExp(byte, 'g')\nexports.NUMERIC = new RegExp(numeric, 'g')\nexports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')\n\nconst TEST_KANJI = new RegExp('^' + kanji + '$')\nconst TEST_NUMERIC = new RegExp('^' + numeric + '$')\nconst TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\\\-./:]+$')\n\nexports.testKanji = function testKanji (str) {\n  return TEST_KANJI.test(str)\n}\n\nexports.testNumeric = function testNumeric (str) {\n  return TEST_NUMERIC.test(str)\n}\n\nexports.testAlphanumeric = function testAlphanumeric (str) {\n  return TEST_ALPHANUMERIC.test(str)\n}\n","const VersionCheck = require('./version-check')\nconst Regex = require('./regex')\n\n/**\n * Numeric mode encodes data from the decimal digit set (0 - 9)\n * (byte values 30HEX to 39HEX).\n * Normally, 3 data characters are represented by 10 bits.\n *\n * @type {Object}\n */\nexports.NUMERIC = {\n  id: 'Numeric',\n  bit: 1 << 0,\n  ccBits: [10, 12, 14]\n}\n\n/**\n * Alphanumeric mode encodes data from a set of 45 characters,\n * i.e. 10 numeric digits (0 - 9),\n *      26 alphabetic characters (A - Z),\n *   and 9 symbols (SP, $, %, *, +, -, ., /, :).\n * Normally, two input characters are represented by 11 bits.\n *\n * @type {Object}\n */\nexports.ALPHANUMERIC = {\n  id: 'Alphanumeric',\n  bit: 1 << 1,\n  ccBits: [9, 11, 13]\n}\n\n/**\n * In byte mode, data is encoded at 8 bits per character.\n *\n * @type {Object}\n */\nexports.BYTE = {\n  id: 'Byte',\n  bit: 1 << 2,\n  ccBits: [8, 16, 16]\n}\n\n/**\n * The Kanji mode efficiently encodes Kanji characters in accordance with\n * the Shift JIS system based on JIS X 0208.\n * The Shift JIS values are shifted from the JIS X 0208 values.\n * JIS X 0208 gives details of the shift coded representation.\n * Each two-byte character value is compacted to a 13-bit binary codeword.\n *\n * @type {Object}\n */\nexports.KANJI = {\n  id: 'Kanji',\n  bit: 1 << 3,\n  ccBits: [8, 10, 12]\n}\n\n/**\n * Mixed mode will contain a sequences of data in a combination of any of\n * the modes described above\n *\n * @type {Object}\n */\nexports.MIXED = {\n  bit: -1\n}\n\n/**\n * Returns the number of bits needed to store the data length\n * according to QR Code specifications.\n *\n * @param  {Mode}   mode    Data mode\n * @param  {Number} version QR Code version\n * @return {Number}         Number of bits\n */\nexports.getCharCountIndicator = function getCharCountIndicator (mode, version) {\n  if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)\n\n  if (!VersionCheck.isValid(version)) {\n    throw new Error('Invalid version: ' + version)\n  }\n\n  if (version >= 1 && version < 10) return mode.ccBits[0]\n  else if (version < 27) return mode.ccBits[1]\n  return mode.ccBits[2]\n}\n\n/**\n * Returns the most efficient mode to store the specified data\n *\n * @param  {String} dataStr Input data string\n * @return {Mode}           Best mode\n */\nexports.getBestModeForData = function getBestModeForData (dataStr) {\n  if (Regex.testNumeric(dataStr)) return exports.NUMERIC\n  else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC\n  else if (Regex.testKanji(dataStr)) return exports.KANJI\n  else return exports.BYTE\n}\n\n/**\n * Return mode name as string\n *\n * @param {Mode} mode Mode object\n * @returns {String}  Mode name\n */\nexports.toString = function toString (mode) {\n  if (mode && mode.id) return mode.id\n  throw new Error('Invalid mode')\n}\n\n/**\n * Check if input param is a valid mode object\n *\n * @param   {Mode}    mode Mode object\n * @returns {Boolean} True if valid mode, false otherwise\n */\nexports.isValid = function isValid (mode) {\n  return mode && mode.bit && mode.ccBits\n}\n\n/**\n * Get mode object from its name\n *\n * @param   {String} string Mode name\n * @returns {Mode}          Mode object\n */\nfunction fromString (string) {\n  if (typeof string !== 'string') {\n    throw new Error('Param is not a string')\n  }\n\n  const lcStr = string.toLowerCase()\n\n  switch (lcStr) {\n    case 'numeric':\n      return exports.NUMERIC\n    case 'alphanumeric':\n      return exports.ALPHANUMERIC\n    case 'kanji':\n      return exports.KANJI\n    case 'byte':\n      return exports.BYTE\n    default:\n      throw new Error('Unknown mode: ' + string)\n  }\n}\n\n/**\n * Returns mode from a value.\n * If value is not a valid mode, returns defaultValue\n *\n * @param  {Mode|String} value        Encoding mode\n * @param  {Mode}        defaultValue Fallback value\n * @return {Mode}                     Encoding mode\n */\nexports.from = function from (value, defaultValue) {\n  if (exports.isValid(value)) {\n    return value\n  }\n\n  try {\n    return fromString(value)\n  } catch (e) {\n    return defaultValue\n  }\n}\n","const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n  for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n    if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n      return currentVersion\n    }\n  }\n\n  return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n  // Character count indicator + mode indicator bits\n  return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n  let totalBits = 0\n\n  segments.forEach(function (data) {\n    const reservedBits = getReservedBitsCount(data.mode, version)\n    totalBits += reservedBits + data.getBitsLength()\n  })\n\n  return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n  for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n    const length = getTotalBitsFromDataArray(segments, currentVersion)\n    if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n      return currentVersion\n    }\n  }\n\n  return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param  {Number|String} value        QR Code version\n * @param  {Number}        defaultValue Fallback value\n * @return {Number}                     QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n  if (VersionCheck.isValid(value)) {\n    return parseInt(value, 10)\n  }\n\n  return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param  {Number} version              QR Code version (1-40)\n * @param  {Number} errorCorrectionLevel Error correction level\n * @param  {Mode}   mode                 Data mode\n * @return {Number}                      Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n  if (!VersionCheck.isValid(version)) {\n    throw new Error('Invalid QR Code version')\n  }\n\n  // Use Byte mode as default\n  if (typeof mode === 'undefined') mode = Mode.BYTE\n\n  // Total codewords for this QR code version (Data + Error correction)\n  const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n  // Total number of error correction codewords\n  const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n  // Total number of data codewords\n  const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n  if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n  const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n  // Return max number of storable codewords\n  switch (mode) {\n    case Mode.NUMERIC:\n      return Math.floor((usableBits / 10) * 3)\n\n    case Mode.ALPHANUMERIC:\n      return Math.floor((usableBits / 11) * 2)\n\n    case Mode.KANJI:\n      return Math.floor(usableBits / 13)\n\n    case Mode.BYTE:\n    default:\n      return Math.floor(usableBits / 8)\n  }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param  {Segment} data                    Segment of data\n * @param  {Number} [errorCorrectionLevel=H] Error correction level\n * @param  {Mode} mode                       Data mode\n * @return {Number}                          QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n  let seg\n\n  const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n  if (Array.isArray(data)) {\n    if (data.length > 1) {\n      return getBestVersionForMixedData(data, ecl)\n    }\n\n    if (data.length === 0) {\n      return 1\n    }\n\n    seg = data[0]\n  } else {\n    seg = data\n  }\n\n  return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param  {Number} version QR Code version\n * @return {Number}         Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n  if (!VersionCheck.isValid(version) || version < 7) {\n    throw new Error('Invalid QR Code version')\n  }\n\n  let d = version << 12\n\n  while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n    d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n  }\n\n  return (version << 12) | d\n}\n","const Utils = require('./utils')\n\nconst G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)\nconst G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)\nconst G15_BCH = Utils.getBCHDigit(G15)\n\n/**\n * Returns format information with relative error correction bits\n *\n * The format information is a 15-bit sequence containing 5 data bits,\n * with 10 error correction bits calculated using the (15, 5) BCH code.\n *\n * @param  {Number} errorCorrectionLevel Error correction level\n * @param  {Number} mask                 Mask pattern\n * @return {Number}                      Encoded format information bits\n */\nexports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {\n  const data = ((errorCorrectionLevel.bit << 3) | mask)\n  let d = data << 10\n\n  while (Utils.getBCHDigit(d) - G15_BCH >= 0) {\n    d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH))\n  }\n\n  // xor final data with mask pattern in order to ensure that\n  // no combination of Error Correction Level and data mask pattern\n  // will result in an all-zero data string\n  return ((data << 10) | d) ^ G15_MASK\n}\n","const Mode = require('./mode')\n\nfunction NumericData (data) {\n  this.mode = Mode.NUMERIC\n  this.data = data.toString()\n}\n\nNumericData.getBitsLength = function getBitsLength (length) {\n  return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)\n}\n\nNumericData.prototype.getLength = function getLength () {\n  return this.data.length\n}\n\nNumericData.prototype.getBitsLength = function getBitsLength () {\n  return NumericData.getBitsLength(this.data.length)\n}\n\nNumericData.prototype.write = function write (bitBuffer) {\n  let i, group, value\n\n  // The input data string is divided into groups of three digits,\n  // and each group is converted to its 10-bit binary equivalent.\n  for (i = 0; i + 3 <= this.data.length; i += 3) {\n    group = this.data.substr(i, 3)\n    value = parseInt(group, 10)\n\n    bitBuffer.put(value, 10)\n  }\n\n  // If the number of input digits is not an exact multiple of three,\n  // the final one or two digits are converted to 4 or 7 bits respectively.\n  const remainingNum = this.data.length - i\n  if (remainingNum > 0) {\n    group = this.data.substr(i)\n    value = parseInt(group, 10)\n\n    bitBuffer.put(value, remainingNum * 3 + 1)\n  }\n}\n\nmodule.exports = NumericData\n","const Mode = require('./mode')\n\n/**\n * Array of characters available in alphanumeric mode\n *\n * As per QR Code specification, to each character\n * is assigned a value from 0 to 44 which in this case coincides\n * with the array index\n *\n * @type {Array}\n */\nconst ALPHA_NUM_CHARS = [\n  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n  'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n  'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n  ' ', '$', '%', '*', '+', '-', '.', '/', ':'\n]\n\nfunction AlphanumericData (data) {\n  this.mode = Mode.ALPHANUMERIC\n  this.data = data\n}\n\nAlphanumericData.getBitsLength = function getBitsLength (length) {\n  return 11 * Math.floor(length / 2) + 6 * (length % 2)\n}\n\nAlphanumericData.prototype.getLength = function getLength () {\n  return this.data.length\n}\n\nAlphanumericData.prototype.getBitsLength = function getBitsLength () {\n  return AlphanumericData.getBitsLength(this.data.length)\n}\n\nAlphanumericData.prototype.write = function write (bitBuffer) {\n  let i\n\n  // Input data characters are divided into groups of two characters\n  // and encoded as 11-bit binary codes.\n  for (i = 0; i + 2 <= this.data.length; i += 2) {\n    // The character value of the first character is multiplied by 45\n    let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45\n\n    // The character value of the second digit is added to the product\n    value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1])\n\n    // The sum is then stored as 11-bit binary number\n    bitBuffer.put(value, 11)\n  }\n\n  // If the number of input data characters is not a multiple of two,\n  // the character value of the final character is encoded as a 6-bit binary number.\n  if (this.data.length % 2) {\n    bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6)\n  }\n}\n\nmodule.exports = AlphanumericData\n","const Mode = require('./mode')\n\nfunction ByteData (data) {\n  this.mode = Mode.BYTE\n  if (typeof (data) === 'string') {\n    this.data = new TextEncoder().encode(data)\n  } else {\n    this.data = new Uint8Array(data)\n  }\n}\n\nByteData.getBitsLength = function getBitsLength (length) {\n  return length * 8\n}\n\nByteData.prototype.getLength = function getLength () {\n  return this.data.length\n}\n\nByteData.prototype.getBitsLength = function getBitsLength () {\n  return ByteData.getBitsLength(this.data.length)\n}\n\nByteData.prototype.write = function (bitBuffer) {\n  for (let i = 0, l = this.data.length; i < l; i++) {\n    bitBuffer.put(this.data[i], 8)\n  }\n}\n\nmodule.exports = ByteData\n","const Mode = require('./mode')\nconst Utils = require('./utils')\n\nfunction KanjiData (data) {\n  this.mode = Mode.KANJI\n  this.data = data\n}\n\nKanjiData.getBitsLength = function getBitsLength (length) {\n  return length * 13\n}\n\nKanjiData.prototype.getLength = function getLength () {\n  return this.data.length\n}\n\nKanjiData.prototype.getBitsLength = function getBitsLength () {\n  return KanjiData.getBitsLength(this.data.length)\n}\n\nKanjiData.prototype.write = function (bitBuffer) {\n  let i\n\n  // In the Shift JIS system, Kanji characters are represented by a two byte combination.\n  // These byte values are shifted from the JIS X 0208 values.\n  // JIS X 0208 gives details of the shift coded representation.\n  for (i = 0; i < this.data.length; i++) {\n    let value = Utils.toSJIS(this.data[i])\n\n    // For characters with Shift JIS values from 0x8140 to 0x9FFC:\n    if (value >= 0x8140 && value <= 0x9FFC) {\n      // Subtract 0x8140 from Shift JIS value\n      value -= 0x8140\n\n    // For characters with Shift JIS values from 0xE040 to 0xEBBF\n    } else if (value >= 0xE040 && value <= 0xEBBF) {\n      // Subtract 0xC140 from Shift JIS value\n      value -= 0xC140\n    } else {\n      throw new Error(\n        'Invalid SJIS character: ' + this.data[i] + '\\n' +\n        'Make sure your charset is UTF-8')\n    }\n\n    // Multiply most significant byte of result by 0xC0\n    // and add least significant byte to product\n    value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff)\n\n    // Convert result to a 13-bit binary string\n    bitBuffer.put(value, 13)\n  }\n}\n\nmodule.exports = KanjiData\n","'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n *   Wyatt Baldwin <self@wyattbaldwin.com>\n *   All rights reserved\n *\n * Licensed under the MIT license.\n *\n *   http://www.opensource.org/licenses/mit-license.php\n *\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\n * THE SOFTWARE.\n *****************************************************************************/\nvar dijkstra = {\n  single_source_shortest_paths: function(graph, s, d) {\n    // Predecessor map for each node that has been encountered.\n    // node ID => predecessor node ID\n    var predecessors = {};\n\n    // Costs of shortest paths from s to all nodes encountered.\n    // node ID => cost\n    var costs = {};\n    costs[s] = 0;\n\n    // Costs of shortest paths from s to all nodes encountered; differs from\n    // `costs` in that it provides easy access to the node that currently has\n    // the known shortest path from s.\n    // XXX: Do we actually need both `costs` and `open`?\n    var open = dijkstra.PriorityQueue.make();\n    open.push(s, 0);\n\n    var closest,\n        u, v,\n        cost_of_s_to_u,\n        adjacent_nodes,\n        cost_of_e,\n        cost_of_s_to_u_plus_cost_of_e,\n        cost_of_s_to_v,\n        first_visit;\n    while (!open.empty()) {\n      // In the nodes remaining in graph that have a known cost from s,\n      // find the node, u, that currently has the shortest path from s.\n      closest = open.pop();\n      u = closest.value;\n      cost_of_s_to_u = closest.cost;\n\n      // Get nodes adjacent to u...\n      adjacent_nodes = graph[u] || {};\n\n      // ...and explore the edges that connect u to those nodes, updating\n      // the cost of the shortest paths to any or all of those nodes as\n      // necessary. v is the node across the current edge from u.\n      for (v in adjacent_nodes) {\n        if (adjacent_nodes.hasOwnProperty(v)) {\n          // Get the cost of the edge running from u to v.\n          cost_of_e = adjacent_nodes[v];\n\n          // Cost of s to u plus the cost of u to v across e--this is *a*\n          // cost from s to v that may or may not be less than the current\n          // known cost to v.\n          cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n          // If we haven't visited v yet OR if the current known cost from s to\n          // v is greater than the new cost we just found (cost of s to u plus\n          // cost of u to v across e), update v's cost in the cost list and\n          // update v's predecessor in the predecessor list (it's now u).\n          cost_of_s_to_v = costs[v];\n          first_visit = (typeof costs[v] === 'undefined');\n          if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n            costs[v] = cost_of_s_to_u_plus_cost_of_e;\n            open.push(v, cost_of_s_to_u_plus_cost_of_e);\n            predecessors[v] = u;\n          }\n        }\n      }\n    }\n\n    if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n      var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n      throw new Error(msg);\n    }\n\n    return predecessors;\n  },\n\n  extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n    var nodes = [];\n    var u = d;\n    var predecessor;\n    while (u) {\n      nodes.push(u);\n      predecessor = predecessors[u];\n      u = predecessors[u];\n    }\n    nodes.reverse();\n    return nodes;\n  },\n\n  find_path: function(graph, s, d) {\n    var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n    return dijkstra.extract_shortest_path_from_predecessor_list(\n      predecessors, d);\n  },\n\n  /**\n   * A very naive priority queue implementation.\n   */\n  PriorityQueue: {\n    make: function (opts) {\n      var T = dijkstra.PriorityQueue,\n          t = {},\n          key;\n      opts = opts || {};\n      for (key in T) {\n        if (T.hasOwnProperty(key)) {\n          t[key] = T[key];\n        }\n      }\n      t.queue = [];\n      t.sorter = opts.sorter || T.default_sorter;\n      return t;\n    },\n\n    default_sorter: function (a, b) {\n      return a.cost - b.cost;\n    },\n\n    /**\n     * Add a new item to the queue and ensure the highest priority element\n     * is at the front of the queue.\n     */\n    push: function (value, cost) {\n      var item = {value: value, cost: cost};\n      this.queue.push(item);\n      this.queue.sort(this.sorter);\n    },\n\n    /**\n     * Return the highest priority element in the queue.\n     */\n    pop: function () {\n      return this.queue.shift();\n    },\n\n    empty: function () {\n      return this.queue.length === 0;\n    }\n  }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n  module.exports = dijkstra;\n}\n","const Mode = require('./mode')\nconst NumericData = require('./numeric-data')\nconst AlphanumericData = require('./alphanumeric-data')\nconst ByteData = require('./byte-data')\nconst KanjiData = require('./kanji-data')\nconst Regex = require('./regex')\nconst Utils = require('./utils')\nconst dijkstra = require('dijkstrajs')\n\n/**\n * Returns UTF8 byte length\n *\n * @param  {String} str Input string\n * @return {Number}     Number of byte\n */\nfunction getStringByteLength (str) {\n  return unescape(encodeURIComponent(str)).length\n}\n\n/**\n * Get a list of segments of the specified mode\n * from a string\n *\n * @param  {Mode}   mode Segment mode\n * @param  {String} str  String to process\n * @return {Array}       Array of object with segments data\n */\nfunction getSegments (regex, mode, str) {\n  const segments = []\n  let result\n\n  while ((result = regex.exec(str)) !== null) {\n    segments.push({\n      data: result[0],\n      index: result.index,\n      mode: mode,\n      length: result[0].length\n    })\n  }\n\n  return segments\n}\n\n/**\n * Extracts a series of segments with the appropriate\n * modes from a string\n *\n * @param  {String} dataStr Input string\n * @return {Array}          Array of object with segments data\n */\nfunction getSegmentsFromString (dataStr) {\n  const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)\n  const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)\n  let byteSegs\n  let kanjiSegs\n\n  if (Utils.isKanjiModeEnabled()) {\n    byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)\n    kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)\n  } else {\n    byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)\n    kanjiSegs = []\n  }\n\n  const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)\n\n  return segs\n    .sort(function (s1, s2) {\n      return s1.index - s2.index\n    })\n    .map(function (obj) {\n      return {\n        data: obj.data,\n        mode: obj.mode,\n        length: obj.length\n      }\n    })\n}\n\n/**\n * Returns how many bits are needed to encode a string of\n * specified length with the specified mode\n *\n * @param  {Number} length String length\n * @param  {Mode} mode     Segment mode\n * @return {Number}        Bit length\n */\nfunction getSegmentBitsLength (length, mode) {\n  switch (mode) {\n    case Mode.NUMERIC:\n      return NumericData.getBitsLength(length)\n    case Mode.ALPHANUMERIC:\n      return AlphanumericData.getBitsLength(length)\n    case Mode.KANJI:\n      return KanjiData.getBitsLength(length)\n    case Mode.BYTE:\n      return ByteData.getBitsLength(length)\n  }\n}\n\n/**\n * Merges adjacent segments which have the same mode\n *\n * @param  {Array} segs Array of object with segments data\n * @return {Array}      Array of object with segments data\n */\nfunction mergeSegments (segs) {\n  return segs.reduce(function (acc, curr) {\n    const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null\n    if (prevSeg && prevSeg.mode === curr.mode) {\n      acc[acc.length - 1].data += curr.data\n      return acc\n    }\n\n    acc.push(curr)\n    return acc\n  }, [])\n}\n\n/**\n * Generates a list of all possible nodes combination which\n * will be used to build a segments graph.\n *\n * Nodes are divided by groups. Each group will contain a list of all the modes\n * in which is possible to encode the given text.\n *\n * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.\n * The group for '12345' will contain then 3 objects, one for each\n * possible encoding mode.\n *\n * Each node represents a possible segment.\n *\n * @param  {Array} segs Array of object with segments data\n * @return {Array}      Array of object with segments data\n */\nfunction buildNodes (segs) {\n  const nodes = []\n  for (let i = 0; i < segs.length; i++) {\n    const seg = segs[i]\n\n    switch (seg.mode) {\n      case Mode.NUMERIC:\n        nodes.push([seg,\n          { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },\n          { data: seg.data, mode: Mode.BYTE, length: seg.length }\n        ])\n        break\n      case Mode.ALPHANUMERIC:\n        nodes.push([seg,\n          { data: seg.data, mode: Mode.BYTE, length: seg.length }\n        ])\n        break\n      case Mode.KANJI:\n        nodes.push([seg,\n          { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n        ])\n        break\n      case Mode.BYTE:\n        nodes.push([\n          { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n        ])\n    }\n  }\n\n  return nodes\n}\n\n/**\n * Builds a graph from a list of nodes.\n * All segments in each node group will be connected with all the segments of\n * the next group and so on.\n *\n * At each connection will be assigned a weight depending on the\n * segment's byte length.\n *\n * @param  {Array} nodes    Array of object with segments data\n * @param  {Number} version QR Code version\n * @return {Object}         Graph of all possible segments\n */\nfunction buildGraph (nodes, version) {\n  const table = {}\n  const graph = { start: {} }\n  let prevNodeIds = ['start']\n\n  for (let i = 0; i < nodes.length; i++) {\n    const nodeGroup = nodes[i]\n    const currentNodeIds = []\n\n    for (let j = 0; j < nodeGroup.length; j++) {\n      const node = nodeGroup[j]\n      const key = '' + i + j\n\n      currentNodeIds.push(key)\n      table[key] = { node: node, lastCount: 0 }\n      graph[key] = {}\n\n      for (let n = 0; n < prevNodeIds.length; n++) {\n        const prevNodeId = prevNodeIds[n]\n\n        if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {\n          graph[prevNodeId][key] =\n            getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -\n            getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)\n\n          table[prevNodeId].lastCount += node.length\n        } else {\n          if (table[prevNodeId]) table[prevNodeId].lastCount = node.length\n\n          graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +\n            4 + Mode.getCharCountIndicator(node.mode, version) // switch cost\n        }\n      }\n    }\n\n    prevNodeIds = currentNodeIds\n  }\n\n  for (let n = 0; n < prevNodeIds.length; n++) {\n    graph[prevNodeIds[n]].end = 0\n  }\n\n  return { map: graph, table: table }\n}\n\n/**\n * Builds a segment from a specified data and mode.\n * If a mode is not specified, the more suitable will be used.\n *\n * @param  {String} data             Input data\n * @param  {Mode | String} modesHint Data mode\n * @return {Segment}                 Segment\n */\nfunction buildSingleSegment (data, modesHint) {\n  let mode\n  const bestMode = Mode.getBestModeForData(data)\n\n  mode = Mode.from(modesHint, bestMode)\n\n  // Make sure data can be encoded\n  if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {\n    throw new Error('\"' + data + '\"' +\n      ' cannot be encoded with mode ' + Mode.toString(mode) +\n      '.\\n Suggested mode is: ' + Mode.toString(bestMode))\n  }\n\n  // Use Mode.BYTE if Kanji support is disabled\n  if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {\n    mode = Mode.BYTE\n  }\n\n  switch (mode) {\n    case Mode.NUMERIC:\n      return new NumericData(data)\n\n    case Mode.ALPHANUMERIC:\n      return new AlphanumericData(data)\n\n    case Mode.KANJI:\n      return new KanjiData(data)\n\n    case Mode.BYTE:\n      return new ByteData(data)\n  }\n}\n\n/**\n * Builds a list of segments from an array.\n * Array can contain Strings or Objects with segment's info.\n *\n * For each item which is a string, will be generated a segment with the given\n * string and the more appropriate encoding mode.\n *\n * For each item which is an object, will be generated a segment with the given\n * data and mode.\n * Objects must contain at least the property \"data\".\n * If property \"mode\" is not present, the more suitable mode will be used.\n *\n * @param  {Array} array Array of objects with segments data\n * @return {Array}       Array of Segments\n */\nexports.fromArray = function fromArray (array) {\n  return array.reduce(function (acc, seg) {\n    if (typeof seg === 'string') {\n      acc.push(buildSingleSegment(seg, null))\n    } else if (seg.data) {\n      acc.push(buildSingleSegment(seg.data, seg.mode))\n    }\n\n    return acc\n  }, [])\n}\n\n/**\n * Builds an optimized sequence of segments from a string,\n * which will produce the shortest possible bitstream.\n *\n * @param  {String} data    Input string\n * @param  {Number} version QR Code version\n * @return {Array}          Array of segments\n */\nexports.fromString = function fromString (data, version) {\n  const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n\n  const nodes = buildNodes(segs)\n  const graph = buildGraph(nodes, version)\n  const path = dijkstra.find_path(graph.map, 'start', 'end')\n\n  const optimizedSegs = []\n  for (let i = 1; i < path.length - 1; i++) {\n    optimizedSegs.push(graph.table[path[i]].node)\n  }\n\n  return exports.fromArray(mergeSegments(optimizedSegs))\n}\n\n/**\n * Splits a string in various segments with the modes which\n * best represent their content.\n * The produced segments are far from being optimized.\n * The output of this function is only used to estimate a QR Code version\n * which may contain the data.\n *\n * @param  {string} data Input string\n * @return {Array}       Array of segments\n */\nexports.rawSplit = function rawSplit (data) {\n  return exports.fromArray(\n    getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n  )\n}\n","const Utils = require('./utils')\nconst ECLevel = require('./error-correction-level')\nconst BitBuffer = require('./bit-buffer')\nconst BitMatrix = require('./bit-matrix')\nconst AlignmentPattern = require('./alignment-pattern')\nconst FinderPattern = require('./finder-pattern')\nconst MaskPattern = require('./mask-pattern')\nconst ECCode = require('./error-correction-code')\nconst ReedSolomonEncoder = require('./reed-solomon-encoder')\nconst Version = require('./version')\nconst FormatInfo = require('./format-info')\nconst Mode = require('./mode')\nconst Segments = require('./segments')\n\n/**\n * QRCode for JavaScript\n *\n * modified by Ryan Day for nodejs support\n * Copyright (c) 2011 Ryan Day\n *\n * Licensed under the MIT license:\n *   http://www.opensource.org/licenses/mit-license.php\n *\n//---------------------------------------------------------------------\n// QRCode for JavaScript\n//\n// Copyright (c) 2009 Kazuhiko Arase\n//\n// URL: http://www.d-project.com/\n//\n// Licensed under the MIT license:\n//   http://www.opensource.org/licenses/mit-license.php\n//\n// The word \"QR Code\" is registered trademark of\n// DENSO WAVE INCORPORATED\n//   http://www.denso-wave.com/qrcode/faqpatent-e.html\n//\n//---------------------------------------------------------------------\n*/\n\n/**\n * Add finder patterns bits to matrix\n *\n * @param  {BitMatrix} matrix  Modules matrix\n * @param  {Number}    version QR Code version\n */\nfunction setupFinderPattern (matrix, version) {\n  const size = matrix.size\n  const pos = FinderPattern.getPositions(version)\n\n  for (let i = 0; i < pos.length; i++) {\n    const row = pos[i][0]\n    const col = pos[i][1]\n\n    for (let r = -1; r <= 7; r++) {\n      if (row + r <= -1 || size <= row + r) continue\n\n      for (let c = -1; c <= 7; c++) {\n        if (col + c <= -1 || size <= col + c) continue\n\n        if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||\n          (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||\n          (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {\n          matrix.set(row + r, col + c, true, true)\n        } else {\n          matrix.set(row + r, col + c, false, true)\n        }\n      }\n    }\n  }\n}\n\n/**\n * Add timing pattern bits to matrix\n *\n * Note: this function must be called before {@link setupAlignmentPattern}\n *\n * @param  {BitMatrix} matrix Modules matrix\n */\nfunction setupTimingPattern (matrix) {\n  const size = matrix.size\n\n  for (let r = 8; r < size - 8; r++) {\n    const value = r % 2 === 0\n    matrix.set(r, 6, value, true)\n    matrix.set(6, r, value, true)\n  }\n}\n\n/**\n * Add alignment patterns bits to matrix\n *\n * Note: this function must be called after {@link setupTimingPattern}\n *\n * @param  {BitMatrix} matrix  Modules matrix\n * @param  {Number}    version QR Code version\n */\nfunction setupAlignmentPattern (matrix, version) {\n  const pos = AlignmentPattern.getPositions(version)\n\n  for (let i = 0; i < pos.length; i++) {\n    const row = pos[i][0]\n    const col = pos[i][1]\n\n    for (let r = -2; r <= 2; r++) {\n      for (let c = -2; c <= 2; c++) {\n        if (r === -2 || r === 2 || c === -2 || c === 2 ||\n          (r === 0 && c === 0)) {\n          matrix.set(row + r, col + c, true, true)\n        } else {\n          matrix.set(row + r, col + c, false, true)\n        }\n      }\n    }\n  }\n}\n\n/**\n * Add version info bits to matrix\n *\n * @param  {BitMatrix} matrix  Modules matrix\n * @param  {Number}    version QR Code version\n */\nfunction setupVersionInfo (matrix, version) {\n  const size = matrix.size\n  const bits = Version.getEncodedBits(version)\n  let row, col, mod\n\n  for (let i = 0; i < 18; i++) {\n    row = Math.floor(i / 3)\n    col = i % 3 + size - 8 - 3\n    mod = ((bits >> i) & 1) === 1\n\n    matrix.set(row, col, mod, true)\n    matrix.set(col, row, mod, true)\n  }\n}\n\n/**\n * Add format info bits to matrix\n *\n * @param  {BitMatrix} matrix               Modules matrix\n * @param  {ErrorCorrectionLevel}    errorCorrectionLevel Error correction level\n * @param  {Number}    maskPattern          Mask pattern reference value\n */\nfunction setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {\n  const size = matrix.size\n  const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)\n  let i, mod\n\n  for (i = 0; i < 15; i++) {\n    mod = ((bits >> i) & 1) === 1\n\n    // vertical\n    if (i < 6) {\n      matrix.set(i, 8, mod, true)\n    } else if (i < 8) {\n      matrix.set(i + 1, 8, mod, true)\n    } else {\n      matrix.set(size - 15 + i, 8, mod, true)\n    }\n\n    // horizontal\n    if (i < 8) {\n      matrix.set(8, size - i - 1, mod, true)\n    } else if (i < 9) {\n      matrix.set(8, 15 - i - 1 + 1, mod, true)\n    } else {\n      matrix.set(8, 15 - i - 1, mod, true)\n    }\n  }\n\n  // fixed module\n  matrix.set(size - 8, 8, 1, true)\n}\n\n/**\n * Add encoded data bits to matrix\n *\n * @param  {BitMatrix}  matrix Modules matrix\n * @param  {Uint8Array} data   Data codewords\n */\nfunction setupData (matrix, data) {\n  const size = matrix.size\n  let inc = -1\n  let row = size - 1\n  let bitIndex = 7\n  let byteIndex = 0\n\n  for (let col = size - 1; col > 0; col -= 2) {\n    if (col === 6) col--\n\n    while (true) {\n      for (let c = 0; c < 2; c++) {\n        if (!matrix.isReserved(row, col - c)) {\n          let dark = false\n\n          if (byteIndex < data.length) {\n            dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)\n          }\n\n          matrix.set(row, col - c, dark)\n          bitIndex--\n\n          if (bitIndex === -1) {\n            byteIndex++\n            bitIndex = 7\n          }\n        }\n      }\n\n      row += inc\n\n      if (row < 0 || size <= row) {\n        row -= inc\n        inc = -inc\n        break\n      }\n    }\n  }\n}\n\n/**\n * Create encoded codewords from data input\n *\n * @param  {Number}   version              QR Code version\n * @param  {ErrorCorrectionLevel}   errorCorrectionLevel Error correction level\n * @param  {ByteData} data                 Data input\n * @return {Uint8Array}                    Buffer containing encoded codewords\n */\nfunction createData (version, errorCorrectionLevel, segments) {\n  // Prepare data buffer\n  const buffer = new BitBuffer()\n\n  segments.forEach(function (data) {\n    // prefix data with mode indicator (4 bits)\n    buffer.put(data.mode.bit, 4)\n\n    // Prefix data with character count indicator.\n    // The character count indicator is a string of bits that represents the\n    // number of characters that are being encoded.\n    // The character count indicator must be placed after the mode indicator\n    // and must be a certain number of bits long, depending on the QR version\n    // and data mode\n    // @see {@link Mode.getCharCountIndicator}.\n    buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))\n\n    // add binary data sequence to buffer\n    data.write(buffer)\n  })\n\n  // Calculate required number of bits\n  const totalCodewords = Utils.getSymbolTotalCodewords(version)\n  const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n  const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n  // Add a terminator.\n  // If the bit string is shorter than the total number of required bits,\n  // a terminator of up to four 0s must be added to the right side of the string.\n  // If the bit string is more than four bits shorter than the required number of bits,\n  // add four 0s to the end.\n  if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {\n    buffer.put(0, 4)\n  }\n\n  // If the bit string is fewer than four bits shorter, add only the number of 0s that\n  // are needed to reach the required number of bits.\n\n  // After adding the terminator, if the number of bits in the string is not a multiple of 8,\n  // pad the string on the right with 0s to make the string's length a multiple of 8.\n  while (buffer.getLengthInBits() % 8 !== 0) {\n    buffer.putBit(0)\n  }\n\n  // Add pad bytes if the string is still shorter than the total number of required bits.\n  // Extend the buffer to fill the data capacity of the symbol corresponding to\n  // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)\n  // and 00010001 (0x11) alternately.\n  const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8\n  for (let i = 0; i < remainingByte; i++) {\n    buffer.put(i % 2 ? 0x11 : 0xEC, 8)\n  }\n\n  return createCodewords(buffer, version, errorCorrectionLevel)\n}\n\n/**\n * Encode input data with Reed-Solomon and return codewords with\n * relative error correction bits\n *\n * @param  {BitBuffer} bitBuffer            Data to encode\n * @param  {Number}    version              QR Code version\n * @param  {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @return {Uint8Array}                     Buffer containing encoded codewords\n */\nfunction createCodewords (bitBuffer, version, errorCorrectionLevel) {\n  // Total codewords for this QR code version (Data + Error correction)\n  const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n  // Total number of error correction codewords\n  const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n  // Total number of data codewords\n  const dataTotalCodewords = totalCodewords - ecTotalCodewords\n\n  // Total number of blocks\n  const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)\n\n  // Calculate how many blocks each group should contain\n  const blocksInGroup2 = totalCodewords % ecTotalBlocks\n  const blocksInGroup1 = ecTotalBlocks - blocksInGroup2\n\n  const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)\n\n  const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)\n  const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1\n\n  // Number of EC codewords is the same for both groups\n  const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1\n\n  // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount\n  const rs = new ReedSolomonEncoder(ecCount)\n\n  let offset = 0\n  const dcData = new Array(ecTotalBlocks)\n  const ecData = new Array(ecTotalBlocks)\n  let maxDataSize = 0\n  const buffer = new Uint8Array(bitBuffer.buffer)\n\n  // Divide the buffer into the required number of blocks\n  for (let b = 0; b < ecTotalBlocks; b++) {\n    const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2\n\n    // extract a block of data from buffer\n    dcData[b] = buffer.slice(offset, offset + dataSize)\n\n    // Calculate EC codewords for this data block\n    ecData[b] = rs.encode(dcData[b])\n\n    offset += dataSize\n    maxDataSize = Math.max(maxDataSize, dataSize)\n  }\n\n  // Create final data\n  // Interleave the data and error correction codewords from each block\n  const data = new Uint8Array(totalCodewords)\n  let index = 0\n  let i, r\n\n  // Add data codewords\n  for (i = 0; i < maxDataSize; i++) {\n    for (r = 0; r < ecTotalBlocks; r++) {\n      if (i < dcData[r].length) {\n        data[index++] = dcData[r][i]\n      }\n    }\n  }\n\n  // Apped EC codewords\n  for (i = 0; i < ecCount; i++) {\n    for (r = 0; r < ecTotalBlocks; r++) {\n      data[index++] = ecData[r][i]\n    }\n  }\n\n  return data\n}\n\n/**\n * Build QR Code symbol\n *\n * @param  {String} data                 Input string\n * @param  {Number} version              QR Code version\n * @param  {ErrorCorretionLevel} errorCorrectionLevel Error level\n * @param  {MaskPattern} maskPattern     Mask pattern\n * @return {Object}                      Object containing symbol data\n */\nfunction createSymbol (data, version, errorCorrectionLevel, maskPattern) {\n  let segments\n\n  if (Array.isArray(data)) {\n    segments = Segments.fromArray(data)\n  } else if (typeof data === 'string') {\n    let estimatedVersion = version\n\n    if (!estimatedVersion) {\n      const rawSegments = Segments.rawSplit(data)\n\n      // Estimate best version that can contain raw splitted segments\n      estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)\n    }\n\n    // Build optimized segments\n    // If estimated version is undefined, try with the highest version\n    segments = Segments.fromString(data, estimatedVersion || 40)\n  } else {\n    throw new Error('Invalid data')\n  }\n\n  // Get the min version that can contain data\n  const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)\n\n  // If no version is found, data cannot be stored\n  if (!bestVersion) {\n    throw new Error('The amount of data is too big to be stored in a QR Code')\n  }\n\n  // If not specified, use min version as default\n  if (!version) {\n    version = bestVersion\n\n  // Check if the specified version can contain the data\n  } else if (version < bestVersion) {\n    throw new Error('\\n' +\n      'The chosen QR Code version cannot contain this amount of data.\\n' +\n      'Minimum version required to store current data is: ' + bestVersion + '.\\n'\n    )\n  }\n\n  const dataBits = createData(version, errorCorrectionLevel, segments)\n\n  // Allocate matrix buffer\n  const moduleCount = Utils.getSymbolSize(version)\n  const modules = new BitMatrix(moduleCount)\n\n  // Add function modules\n  setupFinderPattern(modules, version)\n  setupTimingPattern(modules)\n  setupAlignmentPattern(modules, version)\n\n  // Add temporary dummy bits for format info just to set them as reserved.\n  // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}\n  // since the masking operation must be performed only on the encoding region.\n  // These blocks will be replaced with correct values later in code.\n  setupFormatInfo(modules, errorCorrectionLevel, 0)\n\n  if (version >= 7) {\n    setupVersionInfo(modules, version)\n  }\n\n  // Add data codewords\n  setupData(modules, dataBits)\n\n  if (isNaN(maskPattern)) {\n    // Find best mask pattern\n    maskPattern = MaskPattern.getBestMask(modules,\n      setupFormatInfo.bind(null, modules, errorCorrectionLevel))\n  }\n\n  // Apply mask pattern\n  MaskPattern.applyMask(maskPattern, modules)\n\n  // Replace format info bits with correct values\n  setupFormatInfo(modules, errorCorrectionLevel, maskPattern)\n\n  return {\n    modules: modules,\n    version: version,\n    errorCorrectionLevel: errorCorrectionLevel,\n    maskPattern: maskPattern,\n    segments: segments\n  }\n}\n\n/**\n * QR Code\n *\n * @param {String | Array} data                 Input data\n * @param {Object} options                      Optional configurations\n * @param {Number} options.version              QR Code version\n * @param {String} options.errorCorrectionLevel Error correction level\n * @param {Function} options.toSJISFunc         Helper func to convert utf8 to sjis\n */\nexports.create = function create (data, options) {\n  if (typeof data === 'undefined' || data === '') {\n    throw new Error('No input text')\n  }\n\n  let errorCorrectionLevel = ECLevel.M\n  let version\n  let mask\n\n  if (typeof options !== 'undefined') {\n    // Use higher error correction level as default\n    errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)\n    version = Version.from(options.version)\n    mask = MaskPattern.from(options.maskPattern)\n\n    if (options.toSJISFunc) {\n      Utils.setToSJISFunction(options.toSJISFunc)\n    }\n  }\n\n  return createSymbol(data, version, errorCorrectionLevel, mask)\n}\n","function hex2rgba (hex) {\n  if (typeof hex === 'number') {\n    hex = hex.toString()\n  }\n\n  if (typeof hex !== 'string') {\n    throw new Error('Color should be defined as hex string')\n  }\n\n  let hexCode = hex.slice().replace('#', '').split('')\n  if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {\n    throw new Error('Invalid hex color: ' + hex)\n  }\n\n  // Convert from short to long form (fff -> ffffff)\n  if (hexCode.length === 3 || hexCode.length === 4) {\n    hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {\n      return [c, c]\n    }))\n  }\n\n  // Add default alpha value\n  if (hexCode.length === 6) hexCode.push('F', 'F')\n\n  const hexValue = parseInt(hexCode.join(''), 16)\n\n  return {\n    r: (hexValue >> 24) & 255,\n    g: (hexValue >> 16) & 255,\n    b: (hexValue >> 8) & 255,\n    a: hexValue & 255,\n    hex: '#' + hexCode.slice(0, 6).join('')\n  }\n}\n\nexports.getOptions = function getOptions (options) {\n  if (!options) options = {}\n  if (!options.color) options.color = {}\n\n  const margin = typeof options.margin === 'undefined' ||\n    options.margin === null ||\n    options.margin < 0\n    ? 4\n    : options.margin\n\n  const width = options.width && options.width >= 21 ? options.width : undefined\n  const scale = options.scale || 4\n\n  return {\n    width: width,\n    scale: width ? 4 : scale,\n    margin: margin,\n    color: {\n      dark: hex2rgba(options.color.dark || '#000000ff'),\n      light: hex2rgba(options.color.light || '#ffffffff')\n    },\n    type: options.type,\n    rendererOpts: options.rendererOpts || {}\n  }\n}\n\nexports.getScale = function getScale (qrSize, opts) {\n  return opts.width && opts.width >= qrSize + opts.margin * 2\n    ? opts.width / (qrSize + opts.margin * 2)\n    : opts.scale\n}\n\nexports.getImageWidth = function getImageWidth (qrSize, opts) {\n  const scale = exports.getScale(qrSize, opts)\n  return Math.floor((qrSize + opts.margin * 2) * scale)\n}\n\nexports.qrToImageData = function qrToImageData (imgData, qr, opts) {\n  const size = qr.modules.size\n  const data = qr.modules.data\n  const scale = exports.getScale(size, opts)\n  const symbolSize = Math.floor((size + opts.margin * 2) * scale)\n  const scaledMargin = opts.margin * scale\n  const palette = [opts.color.light, opts.color.dark]\n\n  for (let i = 0; i < symbolSize; i++) {\n    for (let j = 0; j < symbolSize; j++) {\n      let posDst = (i * symbolSize + j) * 4\n      let pxColor = opts.color.light\n\n      if (i >= scaledMargin && j >= scaledMargin &&\n        i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {\n        const iSrc = Math.floor((i - scaledMargin) / scale)\n        const jSrc = Math.floor((j - scaledMargin) / scale)\n        pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]\n      }\n\n      imgData[posDst++] = pxColor.r\n      imgData[posDst++] = pxColor.g\n      imgData[posDst++] = pxColor.b\n      imgData[posDst] = pxColor.a\n    }\n  }\n}\n","const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n  ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n  if (!canvas.style) canvas.style = {}\n  canvas.height = size\n  canvas.width = size\n  canvas.style.height = size + 'px'\n  canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n  try {\n    return document.createElement('canvas')\n  } catch (e) {\n    throw new Error('You need to specify a canvas element')\n  }\n}\n\nexports.render = function render (qrData, canvas, options) {\n  let opts = options\n  let canvasEl = canvas\n\n  if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n    opts = canvas\n    canvas = undefined\n  }\n\n  if (!canvas) {\n    canvasEl = getCanvasElement()\n  }\n\n  opts = Utils.getOptions(opts)\n  const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n  const ctx = canvasEl.getContext('2d')\n  const image = ctx.createImageData(size, size)\n  Utils.qrToImageData(image.data, qrData, opts)\n\n  clearCanvas(ctx, canvasEl, size)\n  ctx.putImageData(image, 0, 0)\n\n  return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n  let opts = options\n\n  if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n    opts = canvas\n    canvas = undefined\n  }\n\n  if (!opts) opts = {}\n\n  const canvasEl = exports.render(qrData, canvas, opts)\n\n  const type = opts.type || 'image/png'\n  const rendererOpts = opts.rendererOpts || {}\n\n  return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n","const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n  const alpha = color.a / 255\n  const str = attrib + '=\"' + color.hex + '\"'\n\n  return alpha < 1\n    ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n    : str\n}\n\nfunction svgCmd (cmd, x, y) {\n  let str = cmd + x\n  if (typeof y !== 'undefined') str += ' ' + y\n\n  return str\n}\n\nfunction qrToPath (data, size, margin) {\n  let path = ''\n  let moveBy = 0\n  let newRow = false\n  let lineLength = 0\n\n  for (let i = 0; i < data.length; i++) {\n    const col = Math.floor(i % size)\n    const row = Math.floor(i / size)\n\n    if (!col && !newRow) newRow = true\n\n    if (data[i]) {\n      lineLength++\n\n      if (!(i > 0 && col > 0 && data[i - 1])) {\n        path += newRow\n          ? svgCmd('M', col + margin, 0.5 + row + margin)\n          : svgCmd('m', moveBy, 0)\n\n        moveBy = 0\n        newRow = false\n      }\n\n      if (!(col + 1 < size && data[i + 1])) {\n        path += svgCmd('h', lineLength)\n        lineLength = 0\n      }\n    } else {\n      moveBy++\n    }\n  }\n\n  return path\n}\n\nexports.render = function render (qrData, options, cb) {\n  const opts = Utils.getOptions(options)\n  const size = qrData.modules.size\n  const data = qrData.modules.data\n  const qrcodesize = size + opts.margin * 2\n\n  const bg = !opts.color.light.a\n    ? ''\n    : '<path ' + getColorAttrib(opts.color.light, 'fill') +\n      ' d=\"M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z\"/>'\n\n  const path =\n    '<path ' + getColorAttrib(opts.color.dark, 'stroke') +\n    ' d=\"' + qrToPath(data, size, opts.margin) + '\"/>'\n\n  const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n  const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n  const svgTag = '<svg xmlns=\"http://www.w3.org/2000/svg\" ' + width + viewBox + ' shape-rendering=\"crispEdges\">' + bg + path + '</svg>\\n'\n\n  if (typeof cb === 'function') {\n    cb(null, svgTag)\n  }\n\n  return svgTag\n}\n","\nconst canPromise = require('./can-promise')\n\nconst QRCode = require('./core/qrcode')\nconst CanvasRenderer = require('./renderer/canvas')\nconst SvgRenderer = require('./renderer/svg-tag.js')\n\nfunction renderCanvas (renderFunc, canvas, text, opts, cb) {\n  const args = [].slice.call(arguments, 1)\n  const argsNum = args.length\n  const isLastArgCb = typeof args[argsNum - 1] === 'function'\n\n  if (!isLastArgCb && !canPromise()) {\n    throw new Error('Callback required as last argument')\n  }\n\n  if (isLastArgCb) {\n    if (argsNum < 2) {\n      throw new Error('Too few arguments provided')\n    }\n\n    if (argsNum === 2) {\n      cb = text\n      text = canvas\n      canvas = opts = undefined\n    } else if (argsNum === 3) {\n      if (canvas.getContext && typeof cb === 'undefined') {\n        cb = opts\n        opts = undefined\n      } else {\n        cb = opts\n        opts = text\n        text = canvas\n        canvas = undefined\n      }\n    }\n  } else {\n    if (argsNum < 1) {\n      throw new Error('Too few arguments provided')\n    }\n\n    if (argsNum === 1) {\n      text = canvas\n      canvas = opts = undefined\n    } else if (argsNum === 2 && !canvas.getContext) {\n      opts = text\n      text = canvas\n      canvas = undefined\n    }\n\n    return new Promise(function (resolve, reject) {\n      try {\n        const data = QRCode.create(text, opts)\n        resolve(renderFunc(data, canvas, opts))\n      } catch (e) {\n        reject(e)\n      }\n    })\n  }\n\n  try {\n    const data = QRCode.create(text, opts)\n    cb(null, renderFunc(data, canvas, opts))\n  } catch (e) {\n    cb(e)\n  }\n}\n\nexports.create = QRCode.create\nexports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render)\nexports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL)\n\n// only svg for now.\nexports.toString = renderCanvas.bind(null, function (data, _, opts) {\n  return SvgRenderer.render(data, opts)\n})\n","<!--\n  - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<NcDialog\n\t\tclose-on-click-outside\n\t\t:name=\"title\"\n\t\t:open=\"isOpen\"\n\t\t@close=\"isOpen = false\"\n\t\t@update:open=\"$emit('closed', true)\">\n\t\t<div class=\"qr-dialog__content\">\n\t\t\t<img\n\t\t\t\t:src=\"uri\"\n\t\t\t\t:title=\"text\"\n\t\t\t\t:alt=\"\n\t\t\t\t\tt('forms', 'QR code representation of {text}', {\n\t\t\t\t\t\ttext: text,\n\t\t\t\t\t})\n\t\t\t\t\" />\n\t\t</div>\n\t</NcDialog>\n</template>\n\n<script>\nimport QRCode from 'qrcode'\n\nimport NcDialog from '@nextcloud/vue/components/NcDialog'\n\nexport default {\n\tname: 'QRDialog',\n\n\tcomponents: {\n\t\tNcDialog,\n\t},\n\n\tprops: {\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\ttext: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['closed'],\n\n\tdata() {\n\t\treturn {\n\t\t\turi: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\tisOpen: {\n\t\t\t\ttype: Boolean,\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t}\n\t},\n\n\twatch: {\n\t\ttext: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.generateQr()\n\t\t\t\tthis.isOpen = !!this.text\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync generateQr() {\n\t\t\tif (this.text) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.uri = await QRCode.toDataURL(this.text, {\n\t\t\t\t\t\twidth: 256,\n\t\t\t\t\t})\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error(err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.uri = null\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n.qr-dialog__content {\n\tdisplay: flex;\n\tjustify-content: space-around;\n\twidth: 100%;\n}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { generateUrl } from '@nextcloud/router'\nimport { showError, showSuccess } from '@nextcloud/dialogs'\nimport logger from '../utils/Logger.js'\n\nexport default {\n\tmethods: {\n\t\t/**\n\t\t * Get the internal link for sharing the form\n\t\t *\n\t\t * @param {string} formHash Internal form hash\n\t\t * @return {string} link\n\t\t */\n\t\tgetInternalShareLink(formHash) {\n\t\t\treturn (\n\t\t\t\twindow.location.protocol\n\t\t\t\t+ '//'\n\t\t\t\t+ window.location.host\n\t\t\t\t+ generateUrl(`/apps/forms/${this.form.hash}`)\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Get the publish share link for a given share\n\t\t *\n\t\t * @param {object} share The share\n\t\t * @return {string} link\n\t\t */\n\t\tgetPublicShareLink(share) {\n\t\t\tlet url\n\t\t\tif (this.isEmbeddingAllowed(share)) {\n\t\t\t\turl = generateUrl(`/apps/forms/embed/${share.shareWith}`)\n\t\t\t} else {\n\t\t\t\turl = generateUrl(`/apps/forms/s/${share.shareWith}`)\n\t\t\t}\n\t\t\treturn new URL(url, window.location).href\n\t\t},\n\n\t\t/**\n\t\t * Check if a share can be used for embedding\n\t\t * @param {{ shareType: number, permissions: string[] }} share The share to check\n\t\t */\n\t\tisEmbeddingAllowed(share) {\n\t\t\treturn (\n\t\t\t\tshare.shareType === this.SHARE_TYPES.SHARE_TYPE_LINK\n\t\t\t\t&& share.permissions?.includes(\n\t\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_EMBED,\n\t\t\t\t)\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Copy link to clipboard.\n\t\t *\n\t\t * @param {object} event Origin event of function call.\n\t\t * @param {string} link Link to copy\n\t\t */\n\t\tasync copyLink(event, link) {\n\t\t\t// Copy link, boolean return indicates success or fail.\n\t\t\ttry {\n\t\t\t\tawait navigator.clipboard.writeText(link)\n\t\t\t\tshowSuccess(t('forms', 'Form link copied'))\n\t\t\t} catch (error) {\n\t\t\t\tshowError(t('forms', 'Cannot copy, please copy the link manually'))\n\t\t\t\tlogger.error('Copy link failed', { error })\n\t\t\t}\n\t\t\t// Set back focus as clipboard removes focus\n\t\t\tevent.target.focus()\n\t\t},\n\n\t\t/**\n\t\t * Copy code to embed public share inside external websites\n\t\t *\n\t\t * @param {object} share Public link-share\n\t\t */\n\t\tasync copyEmbeddingCode(share) {\n\t\t\tconst code = `<iframe src=\"${this.getPublicShareLink(share)}\" width=\"750\" height=\"900\"></iframe>`\n\t\t\ttry {\n\t\t\t\tawait navigator.clipboard.writeText(code)\n\t\t\t\tshowSuccess(t('forms', 'Embedding code copied'))\n\t\t\t} catch (error) {\n\t\t\t\tshowError(t('forms', 'Cannot copy the code'))\n\t\t\t\tlogger.error('Copy embedding code failed', { error })\n\t\t\t}\n\t\t\t// Set back focus as clipboard removes focus\n\t\t\tevent.target.focus()\n\t\t},\n\t},\n}\n","<!--\n  - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div class=\"sidebar-tabs__content\">\n\t\t<NcNoteCard\n\t\t\tv-if=\"locked\"\n\t\t\ttype=\"info\"\n\t\t\t:heading=\"t('forms', 'Form is locked')\"\n\t\t\t:text=\"\n\t\t\t\tt('forms', 'Lock by {lockedBy}, expires: {lockedUntil}', {\n\t\t\t\t\tlockedBy: form.lockedBy ? form.lockedBy : form.ownerId,\n\t\t\t\t\tlockedUntil:\n\t\t\t\t\t\tlockedUntil === '' ? t('forms', 'never') : lockedUntil,\n\t\t\t\t})\n\t\t\t\" />\n\t\t<SharingSearchDiv\n\t\t\t:current-shares=\"form.shares\"\n\t\t\t:show-loading=\"isLoading\"\n\t\t\t:locked=\"locked\"\n\t\t\t:is-current-user-owner=\"isCurrentUserOwner\"\n\t\t\t@add-share=\"addShare\" />\n\n\t\t<!-- Public Link -->\n\t\t<div\n\t\t\tv-if=\"!hasPublicLink && appConfig.allowPublicLink\"\n\t\t\tclass=\"share-div share-div--link\">\n\t\t\t<div class=\"share-div__avatar\">\n\t\t\t\t<IconLinkVariant :size=\"20\" />\n\t\t\t</div>\n\t\t\t<span class=\"share-div__desc\">{{ t('forms', 'Share link') }}</span>\n\t\t\t<NcActions>\n\t\t\t\t<NcActionButton\n\t\t\t\t\t:disabled=\"locked || !isCurrentUserOwner\"\n\t\t\t\t\t@click=\"addPublicLink\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<IconPlus :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ t('forms', 'Add link') }}\n\t\t\t\t</NcActionButton>\n\t\t\t</NcActions>\n\t\t</div>\n\t\t<TransitionGroup v-else tag=\"div\">\n\t\t\t<div\n\t\t\t\tv-for=\"share in publicLinkShares\"\n\t\t\t\t:key=\"'share-' + share.shareType + '-' + share.shareWith\"\n\t\t\t\t:set=\"void (isEmbeddable = isEmbeddingAllowed(share))\"\n\t\t\t\tclass=\"share-div share-div--link\"\n\t\t\t\t:class=\"{ 'share-div--embeddable': isEmbeddingAllowed(share) }\">\n\t\t\t\t<div class=\"share-div__avatar\">\n\t\t\t\t\t<IconLinkBoxVariantOutline v-if=\"isEmbeddable\" :size=\"20\" />\n\t\t\t\t\t<IconLinkVariant v-else :size=\"20\" />\n\t\t\t\t</div>\n\t\t\t\t<span class=\"share-div__desc\">{{\n\t\t\t\t\tisEmbeddable\n\t\t\t\t\t\t? t('forms', 'Embeddable link')\n\t\t\t\t\t\t: t('forms', 'Share link')\n\t\t\t\t}}</span>\n\t\t\t\t<NcActions :inline=\"1\">\n\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\t:href=\"getPublicShareLink(share)\"\n\t\t\t\t\t\t@click.prevent=\"copyLink($event, getPublicShareLink(share))\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconCopyAll :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('forms', 'Copy to clipboard') }}\n\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t<NcActionButton @click=\"openQrDialog(share)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconQr :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('forms', 'Show QR code') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"isEmbeddable\"\n\t\t\t\t\t\t@click=\"copyEmbeddingCode(share)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconCodeBrackets :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('forms', 'Copy embedding code') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:disabled=\"locked || !isCurrentUserOwner\"\n\t\t\t\t\t\t@click=\"makeEmbeddable(share)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconLinkBoxVariantOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<!-- TRANSLATORS: This means the link can be embedded into external websites -->\n\t\t\t\t\t\t{{ t('forms', 'Convert to embeddable link') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t:disabled=\"locked || !isCurrentUserOwner\"\n\t\t\t\t\t\t@click=\"removeShare(share)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconDelete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('forms', 'Remove link') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"appConfig.allowPublicLink\"\n\t\t\t\t\t\tclose-after-click\n\t\t\t\t\t\t:disabled=\"locked || !isCurrentUserOwner\"\n\t\t\t\t\t\t@click=\"addPublicLink\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconPlus :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('forms', 'Add link') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</NcActions>\n\t\t\t</div>\n\t\t</TransitionGroup>\n\n\t\t<QRDialog\n\t\t\t:title=\"\n\t\t\t\tt(\n\t\t\t\t\t'forms',\n\t\t\t\t\t'Share {formTitle}',\n\t\t\t\t\t{ formTitle: form.title },\n\t\t\t\t\t{ escape: false, sanitize: false },\n\t\t\t\t)\n\t\t\t\"\n\t\t\t:text=\"qrDialogText\"\n\t\t\t@closed=\"qrDialogText = ''\" />\n\n\t\t<!-- Internal link -->\n\t\t<div class=\"share-div\">\n\t\t\t<div class=\"share-div__avatar\">\n\t\t\t\t<IconLinkVariant :size=\"20\" />\n\t\t\t</div>\n\t\t\t<div class=\"share-div__desc share-div__desc--twoline\">\n\t\t\t\t<span>{{ t('forms', 'Internal link') }}</span>\n\t\t\t\t<span>{{\n\t\t\t\t\tt(\n\t\t\t\t\t\t'forms',\n\t\t\t\t\t\t'Only works for logged in accounts with access rights',\n\t\t\t\t\t)\n\t\t\t\t}}</span>\n\t\t\t</div>\n\t\t\t<NcActions>\n\t\t\t\t<NcActionLink\n\t\t\t\t\t:href=\"getInternalShareLink(form.hash)\"\n\t\t\t\t\t@click.prevent=\"\n\t\t\t\t\t\tcopyLink($event, getInternalShareLink(form.hash))\n\t\t\t\t\t\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<IconCopyAll :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ t('forms', 'Copy to clipboard') }}\n\t\t\t\t</NcActionLink>\n\t\t\t</NcActions>\n\t\t</div>\n\n\t\t<!-- All users on Instance -->\n\t\t<div v-if=\"appConfig.allowPermitAll\">\n\t\t\t<div class=\"share-div\">\n\t\t\t\t<div class=\"share-div__avatar\">\n\t\t\t\t\t<IconAccountMultiple :size=\"20\" />\n\t\t\t\t</div>\n\t\t\t\t<label for=\"share-switch__permit-all\" class=\"share-div__desc\">\n\t\t\t\t\t{{ t('forms', 'Permit access to all logged in accounts') }}\n\t\t\t\t</label>\n\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\tid=\"share-switch__permit-all\"\n\t\t\t\t\t:checked=\"form.access.permitAllUsers\"\n\t\t\t\t\t:disabled=\"locked || !isCurrentUserOwner\"\n\t\t\t\t\ttype=\"switch\"\n\t\t\t\t\t@update:checked=\"onPermitAllUsersChange\" />\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tv-if=\"appConfig.allowShowToAll && form.access.permitAllUsers\"\n\t\t\t\tclass=\"share-div share-div--indent\">\n\t\t\t\t<div class=\"share-div__avatar\">\n\t\t\t\t\t<FormsIcon :size=\"16\" />\n\t\t\t\t</div>\n\t\t\t\t<label for=\"share-switch__show-to-all\" class=\"share-div__desc\">\n\t\t\t\t\t{{ t('forms', 'Show to all accounts on sidebar') }}\n\t\t\t\t</label>\n\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\tid=\"share-switch__show-to-all\"\n\t\t\t\t\t:checked=\"form.access.showToAllUsers\"\n\t\t\t\t\t:disabled=\"locked || !isCurrentUserOwner\"\n\t\t\t\t\ttype=\"switch\"\n\t\t\t\t\t@update:checked=\"onShowToAllUsersChange\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Single shares -->\n\t\t<TransitionGroup tag=\"ul\">\n\t\t\t<SharingShareDiv\n\t\t\t\tv-for=\"share in sortedShares\"\n\t\t\t\t:key=\"'share-' + share.shareType + '-' + share.shareWith\"\n\t\t\t\t:share=\"share\"\n\t\t\t\t:locked=\"locked\"\n\t\t\t\t:is-current-user-owner=\"isCurrentUserOwner\"\n\t\t\t\t@remove-share=\"removeShare\"\n\t\t\t\t@update:share=\"updateShare\" />\n\t\t</TransitionGroup>\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { loadState } from '@nextcloud/initial-state'\nimport { showError } from '@nextcloud/dialogs'\n\nimport axios from '@nextcloud/axios'\nimport NcActions from '@nextcloud/vue/components/NcActions'\nimport NcActionButton from '@nextcloud/vue/components/NcActionButton'\nimport NcActionLink from '@nextcloud/vue/components/NcActionLink'\nimport NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'\nimport NcNoteCard from '@nextcloud/vue/components/NcNoteCard'\nimport IconAccountMultiple from 'vue-material-design-icons/AccountMultipleOutline.vue'\nimport IconCodeBrackets from 'vue-material-design-icons/CodeBrackets.vue'\nimport IconDelete from 'vue-material-design-icons/TrashCanOutline.vue'\nimport IconLinkBoxVariantOutline from 'vue-material-design-icons/LinkBoxOutline.vue'\nimport IconLinkVariant from 'vue-material-design-icons/Link.vue'\nimport IconPlus from 'vue-material-design-icons/Plus.vue'\nimport IconQr from 'vue-material-design-icons/Qrcode.vue'\n\nimport FormsIcon from '../Icons/FormsIcon.vue'\nimport IconCopyAll from '../Icons/IconCopyAll.vue'\nimport SharingSearchDiv from './SharingSearchDiv.vue'\nimport SharingShareDiv from './SharingShareDiv.vue'\nimport PermissionTypes from '../../mixins/PermissionTypes.js'\nimport QRDialog from '../QRDialog.vue'\nimport ShareTypes from '../../mixins/ShareTypes.js'\nimport ShareLinkMixin from '../../mixins/ShareLinkMixin.js'\nimport OcsResponse2Data from '../../utils/OcsResponse2Data.js'\nimport logger from '../../utils/Logger.js'\n\nexport default {\n\tcomponents: {\n\t\tFormsIcon,\n\t\tIconAccountMultiple,\n\t\tIconCodeBrackets,\n\t\tIconCopyAll,\n\t\tIconDelete,\n\t\tIconLinkBoxVariantOutline,\n\t\tIconLinkVariant,\n\t\tIconPlus,\n\t\tIconQr,\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcActionLink,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcNoteCard,\n\t\tQRDialog,\n\t\tSharingSearchDiv,\n\t\tSharingShareDiv,\n\t},\n\n\tmixins: [ShareTypes, ShareLinkMixin, PermissionTypes],\n\n\tprops: {\n\t\tform: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\tlocked: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\tlockedUntil: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tappConfig: loadState(appName, 'appConfig'),\n\t\t\tqrDialogText: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisCurrentUserOwner() {\n\t\t\treturn getCurrentUser().uid === this.form.ownerId\n\t\t},\n\n\t\tsortedShares() {\n\t\t\t// Remove Link-Shares, which are handled separately, then sort\n\t\t\treturn this.form.shares\n\t\t\t\t.filter(\n\t\t\t\t\t(share) => share.shareType !== this.SHARE_TYPES.SHARE_TYPE_LINK,\n\t\t\t\t)\n\t\t\t\t.sort(this.sortByTypeAndDisplayname)\n\t\t},\n\t\thasPublicLink() {\n\t\t\treturn this.publicLinkShares.length !== 0\n\t\t},\n\t\tpublicLinkShares() {\n\t\t\tconst shares = this.form.shares.filter(\n\t\t\t\t(share) => share.shareType === this.SHARE_TYPES.SHARE_TYPE_LINK,\n\t\t\t)\n\t\t\tshares.sort((a, b) =>\n\t\t\t\tthis.isEmbeddingAllowed(a) ? 1 : this.isEmbeddingAllowed(b) ? -1 : 0,\n\t\t\t)\n\t\t\treturn shares\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Add share\n\t\t *\n\t\t * @param {object} newShare the share object\n\t\t */\n\t\tasync addShare(newShare) {\n\t\t\tthis.isLoading = true\n\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/shares', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\tshareType: newShare.shareType,\n\t\t\t\t\t\tshareWith: newShare.shareWith,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tconst share = OcsResponse2Data(response)\n\n\t\t\t\t// Add new share\n\t\t\t\tthis.$emit('add-share', share)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while adding new share', {\n\t\t\t\t\terror,\n\t\t\t\t\tshare: newShare,\n\t\t\t\t})\n\t\t\t\tshowError(t('forms', 'There was an error while adding the share'))\n\t\t\t} finally {\n\t\t\t\tthis.isLoading = false\n\t\t\t}\n\t\t},\n\n\t\tasync addPublicLink() {\n\t\t\tthis.isLoading = true\n\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/shares', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\tshareType: this.SHARE_TYPES.SHARE_TYPE_LINK,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tconst share = OcsResponse2Data(response)\n\n\t\t\t\t// Add new share\n\t\t\t\tthis.$emit('add-share', share)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error adding public link', { error })\n\t\t\t\tshowError(t('forms', 'There was an error while adding the link'))\n\t\t\t} finally {\n\t\t\t\tthis.isLoading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Make a share embeddable into websites (sets the internal permission)\n\t\t * @param {{ permissions: string[] }} share The public link share to make embeddable\n\t\t */\n\t\tmakeEmbeddable(share) {\n\t\t\tthis.updateShare({\n\t\t\t\t...share,\n\t\t\t\tpermissions: [\n\t\t\t\t\t...share.permissions,\n\t\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_EMBED,\n\t\t\t\t],\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Update share\n\t\t *\n\t\t * @param {object} updatedShare the updated object\n\t\t */\n\t\tasync updateShare(updatedShare) {\n\t\t\tthis.isLoading = true\n\n\t\t\ttry {\n\t\t\t\tconst response = await axios.patch(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/shares/{shareId}', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\tshareId: updatedShare.id,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyValuePairs: {\n\t\t\t\t\t\t\tpermissions: updatedShare.permissions,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tconst share = Object.assign(updatedShare, {\n\t\t\t\t\tid: OcsResponse2Data(response),\n\t\t\t\t})\n\n\t\t\t\t// Add new share\n\t\t\t\tthis.$emit('update-share', share)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while updating share', {\n\t\t\t\t\terror,\n\t\t\t\t\tshare: updatedShare,\n\t\t\t\t})\n\t\t\t\tshowError(t('forms', 'There was an error while updating the share'))\n\t\t\t} finally {\n\t\t\t\tthis.isLoading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove share\n\t\t *\n\t\t * @param {object} share the share to delete\n\t\t */\n\t\tasync removeShare(share) {\n\t\t\tthis.isLoading = true\n\n\t\t\ttry {\n\t\t\t\tawait axios.delete(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}/shares/{shareId}', {\n\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\tshareId: share.id,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\tthis.$emit('remove-share', share)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while removing share', { error, share })\n\t\t\t\tshowError(t('forms', 'There was an error while removing the share'))\n\t\t\t} finally {\n\t\t\t\tthis.isLoading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Sort by shareType and DisplayName\n\t\t *\n\t\t * @param {object} a first share for comparison\n\t\t * @param {object} b second share for comparison\n\t\t */\n\t\tsortByTypeAndDisplayname(a, b) {\n\t\t\t// First return, if ShareType does not match\n\t\t\tif (a.shareType < b.shareType) return -1\n\t\t\tif (a.shareType > b.shareType) return 1\n\n\t\t\t// Otherwise sort by displayname\n\t\t\tif (a.displayName.toLowerCase() < b.displayName.toLowerCase()) return -1\n\t\t\tif (a.displayName.toLowerCase() > b.displayName.toLowerCase()) return 1\n\t\t\treturn 0\n\t\t},\n\n\t\tonPermitAllUsersChange(newVal) {\n\t\t\tconst newAccess = { ...this.form.access }\n\t\t\tnewAccess.permitAllUsers = newVal\n\t\t\tthis.$emit('update:formProp', 'access', newAccess)\n\t\t},\n\t\tonShowToAllUsersChange(newVal) {\n\t\t\tconst newAccess = { ...this.form.access }\n\t\t\tnewAccess.showToAllUsers = newVal\n\t\t\tthis.$emit('update:formProp', 'access', newAccess)\n\t\t},\n\n\t\topenQrDialog(share) {\n\t\t\tthis.qrDialogText = this.getPublicShareLink(share)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.sidebar-tabs__content {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.share-div {\n\tdisplay: flex;\n\tmin-height: var(--default-clickable-area);\n\talign-items: center;\n\n\t&--link {\n\t\t.share-div__avatar {\n\t\t\tbackground-color: var(--color-primary-element);\n\t\t\tcolor: var(--color-primary-element-text);\n\t\t}\n\t}\n\n\t&--embeddable {\n\t\t.share-div__avatar {\n\t\t\tbackground-color: var(--color-primary-element-light);\n\t\t\tcolor: var(--color-primary-element-light-text);\n\t\t}\n\t}\n\n\t&--indent {\n\t\tmargin-inline-start: 40px;\n\t}\n\n\t&__avatar {\n\t\theight: 32px;\n\t\twidth: 32px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-shrink: 0;\n\t\tborder-radius: 50%;\n\t\tbackground-color: var(--color-background-dark);\n\n\t\t.material-design-icon {\n\t\t\tmargin: auto;\n\t\t}\n\t}\n\n\t&__desc {\n\t\tpadding: 0px 8px;\n\t\tflex-grow: 1;\n\n\t\t&--twoline {\n\t\t\tspan {\n\t\t\t\tdisplay: block;\n\t\t\t\tmin-height: 18px;\n\t\t\t\tline-height: 1.2em;\n\t\t\t}\n\t\t\t:last-child {\n\t\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\t}\n\t\t}\n\t}\n}\n</style>\n","<!--\n  - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div>\n\t\t<NcButton\n\t\t\tclass=\"transfer-button\"\n\t\t\talignment=\"start\"\n\t\t\tvariant=\"tertiary\"\n\t\t\twide\n\t\t\t:disabled=\"locked || !isOwner\"\n\t\t\t@click=\"openModal\">\n\t\t\t<span class=\"transfer-button__text\">{{\n\t\t\t\tt('forms', 'Transfer ownership')\n\t\t\t}}</span>\n\t\t</NcButton>\n\n\t\t<NcDialog\n\t\t\t:open.sync=\"showModal\"\n\t\t\tcontent-classes=\"modal-content\"\n\t\t\t:name=\"t('forms', 'Transfer ownership')\"\n\t\t\tout-transition\n\t\t\t@close=\"closeModal\">\n\t\t\t<template #default>\n\t\t\t\t<!-- eslint-disable vue/no-v-html -->\n\t\t\t\t<p\n\t\t\t\t\tv-html=\"\n\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t'forms',\n\t\t\t\t\t\t\t'You\\'re going to transfer the ownership of {name} to another account. Please select the account to which you want to transfer ownership.',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: `<strong>${escapedString(form.title)}</strong>`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t{ escape: false },\n\t\t\t\t\t\t)\n\t\t\t\t\t\" />\n\t\t\t\t<!-- eslint-enable vue/no-v-html -->\n\t\t\t\t<NcSelectUsers\n\t\t\t\t\tv-model=\"selected\"\n\t\t\t\t\tclass=\"modal-content__select\"\n\t\t\t\t\t:loading=\"loading\"\n\t\t\t\t\t:options=\"options\"\n\t\t\t\t\t:placeholder=\"t('forms', 'Search for a user')\"\n\t\t\t\t\t@search=\"\n\t\t\t\t\t\t(query) => asyncSearch(query, [SHARE_TYPES.SHARE_TYPE_USER])\n\t\t\t\t\t\">\n\t\t\t\t\t<template #no-options>\n\t\t\t\t\t\t{{ noResultText }}\n\t\t\t\t\t</template>\n\t\t\t\t</NcSelectUsers>\n\n\t\t\t\t<br />\n\n\t\t\t\t<!-- eslint-disable vue/no-v-html -->\n\t\t\t\t<p\n\t\t\t\t\tv-html=\"\n\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t'forms',\n\t\t\t\t\t\t\t'Type {text} to confirm.',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: `<strong>${escapedString(confirmationString)}</strong>`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t{ escape: false },\n\t\t\t\t\t\t)\n\t\t\t\t\t\" />\n\t\t\t\t<!-- eslint-enable vue/no-v-html -->\n\t\t\t\t<NcTextField\n\t\t\t\t\t:label=\"t('forms', 'Confirmation text')\"\n\t\t\t\t\t:value.sync=\"confirmationInput\"\n\t\t\t\t\t:success=\"confirmationInput === confirmationString\" />\n\n\t\t\t\t<br />\n\n\t\t\t\t<p>\n\t\t\t\t\t<strong>{{ t('forms', 'This can not be undone.') }}</strong>\n\t\t\t\t</p>\n\t\t\t</template>\n\t\t\t<template #actions>\n\t\t\t\t<NcButton\n\t\t\t\t\t:disabled=\"!canTransfer\"\n\t\t\t\t\tvariant=\"error\"\n\t\t\t\t\t@click=\"onOwnershipTransfer\">\n\t\t\t\t\t{{ t('forms', 'I understand, transfer this form') }}\n\t\t\t\t</NcButton>\n\t\t\t</template>\n\t\t</NcDialog>\n\t</div>\n</template>\n\n<script>\nimport { showSuccess, showError } from '@nextcloud/dialogs'\nimport { emit } from '@nextcloud/event-bus'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport axios from '@nextcloud/axios'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcDialog from '@nextcloud/vue/components/NcDialog'\nimport NcTextField from '@nextcloud/vue/components/NcTextField'\nimport NcSelectUsers from '@nextcloud/vue/components/NcSelectUsers'\nimport UserSearchMixin from '../../mixins/UserSearchMixin.js'\nimport logger from '../../utils/Logger.js'\n\nexport default {\n\tcomponents: {\n\t\tNcButton,\n\t\tNcDialog,\n\t\tNcTextField,\n\t\tNcSelectUsers,\n\t},\n\tmixins: [UserSearchMixin],\n\n\tprops: {\n\t\tform: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\tisOwner: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\tlocked: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tselected: null,\n\t\t\tshowModal: false,\n\t\t\tconfirmationInput: '',\n\t\t\tloading: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\tcanTransfer() {\n\t\t\treturn (\n\t\t\t\tthis.confirmationInput === this.confirmationString && !!this.selected\n\t\t\t)\n\t\t},\n\t\tconfirmationString() {\n\t\t\treturn `${this.form.ownerId}/${this.form.title.replace(/\\s/g, ' ').trim()}`\n\t\t},\n\t\toptions() {\n\t\t\tif (this.isValidQuery) {\n\t\t\t\t// Suggestions without existing shares\n\t\t\t\treturn this.suggestions\n\t\t\t}\n\t\t\t// Recommendations without existing shares\n\t\t\treturn this.recommendations\n\t\t},\n\t},\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.confirmationInput = ''\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.showModal = false\n\t\t},\n\t\tescapedString(textToEscape) {\n\t\t\treturn '' + textToEscape.replace('<', '&lt;').replace('>', '&gt;')\n\t\t},\n\t\topenModal() {\n\t\t\tthis.showModal = true\n\t\t},\n\t\tasync onOwnershipTransfer() {\n\t\t\tthis.showModal = false\n\t\t\tif (this.form.id && this.selected.shareWith) {\n\t\t\t\ttry {\n\t\t\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t\t\t\tawait axios.patch(\n\t\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}', {\n\t\t\t\t\t\t\tid: this.form.id,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkeyValuePairs: {\n\t\t\t\t\t\t\t\townerId: this.selected.shareWith,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tshowSuccess(\n\t\t\t\t\t\t`${t('forms', 'This form is now owned by')} ${this.selected.displayName}`,\n\t\t\t\t\t)\n\t\t\t\t\temit('forms:ownership-transfered', this.form.id)\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger.error('Error while transfering form ownership', {\n\t\t\t\t\t\terror,\n\t\t\t\t\t})\n\t\t\t\t\tshowError(\n\t\t\t\t\t\tt('forms', 'An error occurred while transfering ownership'),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.error('Null parameters while transfering form ownership', {\n\t\t\t\t\tselectedUser: this.selected,\n\t\t\t\t})\n\t\t\t\tshowError(\n\t\t\t\t\tt('forms', 'An error occurred while transfering ownership'),\n\t\t\t\t)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n:deep(.modal-content) {\n\tpadding-inline: 18px;\n\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.transfer-button__text {\n\tcolor: var(--color-error-text);\n}\n</style>\n","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(e||self)[\"v-click-outside\"]=n()}(this,function(){var e=\"__v-click-outside\",n=\"undefined\"!=typeof window,t=\"undefined\"!=typeof navigator,r=n&&(\"ontouchstart\"in window||t&&navigator.msMaxTouchPoints>0)?[\"touchstart\"]:[\"click\"];function i(e){var n=e.event,t=e.handler;(0,e.middleware)(n)&&t(n)}function a(n,t){var a=function(e){var n=\"function\"==typeof e;if(!n&&\"object\"!=typeof e)throw new Error(\"v-click-outside: Binding value must be a function or an object\");return{handler:n?e:e.handler,middleware:e.middleware||function(e){return e},events:e.events||r,isActive:!(!1===e.isActive),detectIframe:!(!1===e.detectIframe),capture:!!e.capture}}(t.value),d=a.handler,o=a.middleware,c=a.detectIframe,u=a.capture;if(a.isActive){if(n[e]=a.events.map(function(e){return{event:e,srcTarget:document.documentElement,handler:function(e){return function(e){var n=e.el,t=e.event,r=e.handler,a=e.middleware,d=t.composedPath&&t.composedPath()||t.path;(d?d.indexOf(n)<0:!n.contains(t.target))&&i({event:t,handler:r,middleware:a})}({el:n,event:e,handler:d,middleware:o})},capture:u}}),c){var l={event:\"blur\",srcTarget:window,handler:function(e){return function(e){var n=e.el,t=e.event,r=e.handler,a=e.middleware;setTimeout(function(){var e=document.activeElement;e&&\"IFRAME\"===e.tagName&&!n.contains(e)&&i({event:t,handler:r,middleware:a})},0)}({el:n,event:e,handler:d,middleware:o})},capture:u};n[e]=[].concat(n[e],[l])}n[e].forEach(function(t){var r=t.event,i=t.srcTarget,a=t.handler;return setTimeout(function(){n[e]&&i.addEventListener(r,a,u)},0)})}}function d(n){(n[e]||[]).forEach(function(e){return e.srcTarget.removeEventListener(e.event,e.handler,e.capture)}),delete n[e]}var o=n?{bind:a,update:function(e,n){var t=n.value,r=n.oldValue;JSON.stringify(t)!==JSON.stringify(r)&&(d(e),a(e,{value:t}))},unbind:d}:{};return{install:function(e){e.directive(\"click-outside\",o)},directive:o}});\n//# sourceMappingURL=v-click-outside.umd.js.map\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"20px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"20px\\\" fill=\\\"#222222\\\"><path d=\\\"M264-624h336v-96q0-50-35-85t-85-35q-50 0-85 35t-35 85h-72q0-80 56.23-136 56.22-56 136-56Q560-912 616-855.84q56 56.16 56 135.84v96h24q29.7 0 50.85 21.15Q768-581.7 768-552v384q0 29.7-21.16 50.85Q725.68-96 695.96-96H263.72Q234-96 213-117.15T192-168v-384q0-29.7 21.15-50.85Q234.3-624 264-624Zm216.21 336Q510-288 531-309.21t21-51Q552-390 530.79-411t-51-21Q450-432 429-410.79t-21 51Q408-330 429.21-309t51 21Z\\\"/></svg>\"","<!--\n  - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div class=\"sidebar-tabs__content\">\n\t\t<NcNoteCard\n\t\t\tv-if=\"locked\"\n\t\t\ttype=\"info\"\n\t\t\t:heading=\"t('forms', 'Form is locked')\"\n\t\t\t:text=\"\n\t\t\t\tt('forms', 'Lock by {lockedBy}, expires: {lockedUntil}', {\n\t\t\t\t\tlockedBy: form.lockedBy ? form.lockedBy : form.ownerId,\n\t\t\t\t\tlockedUntil:\n\t\t\t\t\t\tlockedUntil === '' ? t('forms', 'never') : lockedUntil,\n\t\t\t\t})\n\t\t\t\" />\n\t\t<NcButton\n\t\t\tv-if=\"locked && isCurrentUserOwner\"\n\t\t\twide\n\t\t\t@click=\"onFormLockChange(false)\">\n\t\t\t<template #icon>\n\t\t\t\t<NcIconSvgWrapper :svg=\"svgLockOpen\" />\n\t\t\t</template>\n\t\t\t<!-- TRANSLATORS text for the action triggered by the button -->\n\t\t\t{{ t('forms', 'Unlock form') }}\n\t\t</NcButton>\n\t\t<NcCheckboxRadioSwitch\n\t\t\t:checked=\"form.isAnonymous\"\n\t\t\t:disabled=\"formArchived || locked\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:checked=\"onAnonChange\">\n\t\t\t<!-- TRANSLATORS Checkbox to select whether responses will be stored anonymously or not -->\n\t\t\t{{ t('forms', 'Store responses anonymously') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch\n\t\t\t:title=\"disableSubmitMultipleExplanation\"\n\t\t\t:checked=\"submitMultiple\"\n\t\t\t:disabled=\"disableSubmitMultiple || formArchived || locked\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:checked=\"onSubmitMultipleChange\">\n\t\t\t{{ t('forms', 'Allow multiple responses per person') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch\n\t\t\t:model-value=\"form.allowEditSubmissions\"\n\t\t\t:disabled=\"formArchived || locked\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:model-value=\"onAllowEditSubmissionsChange\">\n\t\t\t{{ t('forms', 'Allow editing own responses') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch\n\t\t\t:checked=\"formExpires\"\n\t\t\t:disabled=\"formArchived || locked\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:checked=\"onFormExpiresChange\">\n\t\t\t{{ t('forms', 'Set expiration date') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<div v-show=\"formExpires && !formArchived\" class=\"settings-div--indent\">\n\t\t\t<NcDateTimePicker\n\t\t\t\tid=\"expiresDatetimePicker\"\n\t\t\t\t:clearable=\"false\"\n\t\t\t\t:disabled=\"locked\"\n\t\t\t\t:disabled-date=\"notBeforeToday\"\n\t\t\t\t:disabled-time=\"notBeforeNow\"\n\t\t\t\t:editable=\"false\"\n\t\t\t\t:formatter=\"formatter\"\n\t\t\t\t:minute-step=\"5\"\n\t\t\t\t:show-second=\"false\"\n\t\t\t\t:value=\"expirationDate\"\n\t\t\t\ttype=\"datetime\"\n\t\t\t\t@change=\"onExpirationDateChange\" />\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:checked=\"form.showExpiration\"\n\t\t\t\t:disabled=\"locked\"\n\t\t\t\ttype=\"switch\"\n\t\t\t\t@update:checked=\"onShowExpirationChange\">\n\t\t\t\t{{ t('forms', 'Show expiration date on form') }}\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t</div>\n\t\t<NcCheckboxRadioSwitch\n\t\t\t:checked=\"formClosed\"\n\t\t\t:disabled=\"formArchived || locked\"\n\t\t\taria-describedby=\"forms-settings__close-form\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:checked=\"onFormClosedChange\">\n\t\t\t{{ t('forms', 'Close form') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<p id=\"forms-settings__close-form\" class=\"settings-hint\">\n\t\t\t{{ t('forms', 'Closed forms do not accept new submissions.') }}\n\t\t</p>\n\t\t<NcCheckboxRadioSwitch\n\t\t\t:model-value=\"isFormLockedPermanently\"\n\t\t\t:disabled=\"\n\t\t\t\tformArchived\n\t\t\t\t|| (locked && form.lockedUntil !== 0)\n\t\t\t\t|| !isCurrentUserOwner\n\t\t\t\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:model-value=\"onFormLockChange\">\n\t\t\t{{ t('forms', 'Lock form permanently') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch\n\t\t\t:checked=\"formArchived\"\n\t\t\taria-describedby=\"forms-settings__archive-form\"\n\t\t\t:disabled=\"locked || !isCurrentUserOwner\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:checked=\"onFormArchivedChange\">\n\t\t\t{{ t('forms', 'Archive form') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<p id=\"forms-settings__archive-form\" class=\"settings-hint\">\n\t\t\t{{\n\t\t\t\tt(\n\t\t\t\t\t'forms',\n\t\t\t\t\t'Archived forms do not accept new submissions and can not be modified.',\n\t\t\t\t)\n\t\t\t}}\n\t\t</p>\n\t\t<NcCheckboxRadioSwitch\n\t\t\t:checked=\"hasCustomSubmissionMessage\"\n\t\t\t:disabled=\"formArchived || locked\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:checked=\"onUpdateHasCustomSubmissionMessage\">\n\t\t\t{{ t('forms', 'Custom submission message') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<div\n\t\t\tv-show=\"hasCustomSubmissionMessage\"\n\t\t\tclass=\"settings-div--indent submission-message\"\n\t\t\t:tabindex=\"editMessage ? undefined : '0'\"\n\t\t\t@focus=\"editMessage = true\">\n\t\t\t<textarea\n\t\t\t\tv-if=\"!formArchived && (editMessage || !form.submissionMessage)\"\n\t\t\t\tv-click-outside=\"\n\t\t\t\t\t() => {\n\t\t\t\t\t\teditMessage = false\n\t\t\t\t\t}\n\t\t\t\t\"\n\t\t\t\taria-describedby=\"forms-submission-message-description\"\n\t\t\t\t:aria-label=\"t('forms', 'Custom submission message')\"\n\t\t\t\t:value=\"form.submissionMessage\"\n\t\t\t\t:disabled=\"locked\"\n\t\t\t\t:maxlength=\"maxStringLengths.submissionMessage\"\n\t\t\t\t:placeholder=\"\n\t\t\t\t\tt(\n\t\t\t\t\t\t'forms',\n\t\t\t\t\t\t'Message to show after a user submitted the form (formatting using Markdown is supported)',\n\t\t\t\t\t)\n\t\t\t\t\"\n\t\t\t\tclass=\"submission-message__input\"\n\t\t\t\t@blur=\"editMessage = false\"\n\t\t\t\t@change=\"onSubmissionMessageChange\" />\n\t\t\t<!-- eslint-disable vue/no-v-html -->\n\t\t\t<div\n\t\t\t\tv-else\n\t\t\t\t:aria-label=\"t('forms', 'Custom submission message')\"\n\t\t\t\tclass=\"submission-message__output\"\n\t\t\t\tv-html=\"submissionMessageHTML\" />\n\t\t\t<!-- eslint-enable vue/no-v-html -->\n\t\t\t<div\n\t\t\t\tid=\"forms-submission-message-description\"\n\t\t\t\tclass=\"submission-message__description\">\n\t\t\t\t{{\n\t\t\t\t\tt(\n\t\t\t\t\t\t'forms',\n\t\t\t\t\t\t'Message to show after a user submitted the form. Please note that the message will not be translated!',\n\t\t\t\t\t)\n\t\t\t\t}}\n\t\t\t</div>\n\t\t</div>\n\n\t\t<TransferOwnership\n\t\t\t:locked=\"locked\"\n\t\t\t:is-owner=\"isCurrentUserOwner\"\n\t\t\t:form=\"form\" />\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport moment from '@nextcloud/moment'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'\nimport NcDateTimePicker from '@nextcloud/vue/components/NcDateTimePicker'\nimport NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'\nimport NcNoteCard from '@nextcloud/vue/components/NcNoteCard'\nimport ShareTypes from '../../mixins/ShareTypes.js'\nimport TransferOwnership from './TransferOwnership.vue'\n\nimport { directive as ClickOutside } from 'v-click-outside'\nimport { loadState } from '@nextcloud/initial-state'\nimport { FormState } from '../../models/Constants.ts'\nimport svgLockOpen from '../../../img/lock_open.svg?raw'\n\nexport default {\n\tcomponents: {\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcDateTimePicker,\n\t\tNcIconSvgWrapper,\n\t\tNcNoteCard,\n\t\tTransferOwnership,\n\t},\n\n\tdirectives: {\n\t\tClickOutside,\n\t},\n\n\tmixins: [ShareTypes],\n\n\tinject: ['$markdownit'],\n\n\tprops: {\n\t\tform: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\tlocked: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\tlockedUntil: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tformatter: {\n\t\t\t\tstringify: this.stringifyDate,\n\t\t\t\tparse: this.parseTimestampToDate,\n\t\t\t},\n\t\t\tmaxStringLengths: loadState('forms', 'maxStringLengths'),\n\t\t\t/** If custom submission message is shown as input or rendered markdown */\n\t\t\teditMessage: false,\n\t\t\tsvgLockOpen,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisCurrentUserOwner() {\n\t\t\treturn getCurrentUser().uid === this.form.ownerId\n\t\t},\n\n\t\tisFormLockedPermanently() {\n\t\t\treturn this.locked && this.form.lockedUntil === 0\n\t\t},\n\n\t\t/**\n\t\t * If the form has a custom submission message or the user wants to add one (settings switch)\n\t\t */\n\t\thasCustomSubmissionMessage() {\n\t\t\treturn (\n\t\t\t\tthis.form?.submissionMessage !== undefined\n\t\t\t\t&& this.form?.submissionMessage !== null\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Submit Multiple is disabled, if it cannot be controlled.\n\t\t */\n\t\tdisableSubmitMultiple() {\n\t\t\treturn this.hasPublicLink || this.form.isAnonymous\n\t\t},\n\t\tdisableSubmitMultipleExplanation() {\n\t\t\tif (this.disableSubmitMultiple) {\n\t\t\t\treturn t(\n\t\t\t\t\t'forms',\n\t\t\t\t\t'This can not be controlled, if the form has a public link or stores responses anonymously.',\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\t\thasPublicLink() {\n\t\t\treturn (\n\t\t\t\tthis.form.shares.filter(\n\t\t\t\t\t(share) => share.shareType === this.SHARE_TYPES.SHARE_TYPE_LINK,\n\t\t\t\t).length !== 0\n\t\t\t)\n\t\t},\n\n\t\t// If disabled, submitMultiple will be casted to true\n\t\tsubmitMultiple() {\n\t\t\treturn this.disableSubmitMultiple || this.form.submitMultiple\n\t\t},\n\n\t\tformExpires() {\n\t\t\treturn this.form.expires !== 0\n\t\t},\n\n\t\tformArchived() {\n\t\t\treturn this.form.state === FormState.FormArchived\n\t\t},\n\n\t\tformClosed() {\n\t\t\treturn this.form.state !== FormState.FormActive\n\t\t},\n\n\t\tisExpired() {\n\t\t\treturn this.form.expires && moment().unix() > this.form.expires\n\t\t},\n\t\texpirationDate() {\n\t\t\treturn moment(this.form.expires, 'X').toDate()\n\t\t},\n\t\t/**\n\t\t * The submission message rendered as HTML\n\t\t */\n\t\tsubmissionMessageHTML() {\n\t\t\treturn this.$markdownit.render(this.form.submissionMessage || '')\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Save Form-Properties\n\t\t *\n\t\t * @param {boolean} checked New Checkbox/Switch Value to use\n\t\t */\n\t\tonAnonChange(checked) {\n\t\t\tthis.$emit('update:formProp', 'isAnonymous', checked)\n\t\t},\n\t\tonSubmitMultipleChange(checked) {\n\t\t\tthis.$emit('update:formProp', 'submitMultiple', checked)\n\t\t},\n\t\tonAllowEditSubmissionsChange(checked) {\n\t\t\tthis.$emit('update:formProp', 'allowEditSubmissions', checked)\n\t\t},\n\t\tonFormExpiresChange(checked) {\n\t\t\tif (checked) {\n\t\t\t\tthis.$emit(\n\t\t\t\t\t'update:formProp',\n\t\t\t\t\t'expires',\n\t\t\t\t\tmoment().add(1, 'hour').unix(),\n\t\t\t\t) // Expires in one hour.\n\t\t\t} else {\n\t\t\t\tthis.$emit('update:formProp', 'expires', 0)\n\t\t\t}\n\t\t},\n\t\tonShowExpirationChange(checked) {\n\t\t\tthis.$emit('update:formProp', 'showExpiration', checked)\n\t\t},\n\n\t\t/**\n\t\t * On date picker change\n\t\t *\n\t\t * @param {Date} datetime the expiration Date\n\t\t */\n\t\tonExpirationDateChange(datetime) {\n\t\t\tthis.$emit(\n\t\t\t\t'update:formProp',\n\t\t\t\t'expires',\n\t\t\t\tparseInt(moment(datetime).format('X')),\n\t\t\t)\n\t\t},\n\n\t\tonFormClosedChange(isClosed) {\n\t\t\tthis.$emit(\n\t\t\t\t'update:formProp',\n\t\t\t\t'state',\n\t\t\t\tisClosed ? FormState.FormClosed : FormState.FormActive,\n\t\t\t)\n\t\t},\n\n\t\tonFormLockChange(locked) {\n\t\t\tthis.$emit('update:formProp', 'lockedUntil', locked ? 0 : null)\n\t\t},\n\n\t\tonFormArchivedChange(isArchived) {\n\t\t\tthis.$emit(\n\t\t\t\t'update:formProp',\n\t\t\t\t'state',\n\t\t\t\tisArchived ? FormState.FormArchived : FormState.FormClosed,\n\t\t\t)\n\t\t},\n\n\t\tonSubmissionMessageChange({ target }) {\n\t\t\tthis.$emit('update:formProp', 'submissionMessage', target.value)\n\t\t},\n\n\t\t/**\n\t\t * Enable or disable the whole custom submission message\n\t\t * Disabled means the value is set to null.\n\t\t */\n\t\tonUpdateHasCustomSubmissionMessage() {\n\t\t\tif (this.hasCustomSubmissionMessage) {\n\t\t\t\tthis.$emit('update:formProp', 'submissionMessage', null)\n\t\t\t} else {\n\t\t\t\tthis.$emit('update:formProp', 'submissionMessage', '')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Datepicker timestamp to string\n\t\t *\n\t\t * @param {Date} datetime the datepicker Date\n\t\t * @return {string}\n\t\t */\n\t\tstringifyDate(datetime) {\n\t\t\tconst date = moment(datetime).format('LLL')\n\n\t\t\tif (this.isExpired) {\n\t\t\t\treturn t('forms', 'Expired on {date}', { date })\n\t\t\t}\n\t\t\treturn t('forms', 'Expires on {date}', { date })\n\t\t},\n\n\t\t/**\n\t\t * Form expires timestamp to Date of the datepicker\n\t\t *\n\t\t * @param {number} value the expires timestamp\n\t\t * @return {Date}\n\t\t */\n\t\tparseTimestampToDate(value) {\n\t\t\treturn moment(value, 'X').toDate()\n\t\t},\n\n\t\t/**\n\t\t * Prevent selecting a day before today\n\t\t *\n\t\t * @param {Date} datetime the datepicker Date\n\t\t * @return {boolean}\n\t\t */\n\t\tnotBeforeToday(datetime) {\n\t\t\treturn datetime < moment().add(-1, 'day').toDate()\n\t\t},\n\n\t\t/**\n\t\t * Prevent selecting a time before the current one\n\t\t *\n\t\t * @param {Date} datetime the datepicker Date\n\t\t * @return {boolean}\n\t\t */\n\t\tnotBeforeNow(datetime) {\n\t\t\treturn datetime < moment().toDate()\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n#expiresDatetimePicker {\n\twidth: calc(100% - var(--default-clickable-area));\n}\n\n.settings-div--indent {\n\tmargin-inline-start: 40px;\n}\n\n.settings-hint {\n\tcolor: var(--color-text-maxcontrast);\n\tpadding-inline-start: 16px;\n}\n\n.sidebar-tabs__content {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n.submission-message {\n\t&__description {\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tfont-size: 13px;\n\t}\n\n\t&__input,\n\t&__output {\n\t\twidth: 100%;\n\t\tmin-height: 100px;\n\t\tline-height: 24px;\n\t}\n\n\t&__output {\n\t\t@import '../../scssmixins/markdownOutput';\n\n\t\tpadding: 12px;\n\t\tmargin-block: 3px;\n\t\tborder: 2px solid var(--color-border-maxcontrast);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\t&:hover {\n\t\t\tborder-color: var(--color-primary-element);\n\t\t}\n\n\t\t@include markdown-output;\n\t}\n}\n</style>\n","<!--\n  - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<NcAppSidebar\n\t\t:open=\"sidebarOpened\"\n\t\t:active=\"active\"\n\t\t:name=\"t('forms', 'Form settings')\"\n\t\t@update:active=\"onUpdateActive\"\n\t\t@update:open=\"$emit('update:sidebarOpened', $event)\">\n\t\t<NcAppSidebarTab id=\"forms-sharing\" :order=\"0\" :name=\"t('forms', 'Sharing')\">\n\t\t\t<template #icon>\n\t\t\t\t<IconShareVariant :size=\"20\" />\n\t\t\t</template>\n\t\t\t<SharingSidebarTab\n\t\t\t\t:form=\"form\"\n\t\t\t\t:locked=\"isFormLocked\"\n\t\t\t\t:locked-until=\"lockedUntilFormatted\"\n\t\t\t\t@update:formProp=\"onPropertyChange\"\n\t\t\t\t@add-share=\"onAddShare\"\n\t\t\t\t@remove-share=\"onRemoveShare\"\n\t\t\t\t@update-share=\"onUpdateShare\" />\n\t\t</NcAppSidebarTab>\n\n\t\t<NcAppSidebarTab\n\t\t\tid=\"forms-settings\"\n\t\t\t:order=\"1\"\n\t\t\t:name=\"t('forms', 'Settings')\">\n\t\t\t<template #icon>\n\t\t\t\t<IconSettings :size=\"20\" />\n\t\t\t</template>\n\t\t\t<SettingsSidebarTab\n\t\t\t\t:form=\"form\"\n\t\t\t\t:locked=\"isFormLocked\"\n\t\t\t\t:locked-until=\"lockedUntilFormatted\"\n\t\t\t\t@update:formProp=\"onPropertyChange\" />\n\t\t</NcAppSidebarTab>\n\t</NcAppSidebar>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport moment from '@nextcloud/moment'\nimport NcAppSidebar from '@nextcloud/vue/components/NcAppSidebar'\nimport NcAppSidebarTab from '@nextcloud/vue/components/NcAppSidebarTab'\nimport IconSettings from 'vue-material-design-icons/CogOutline.vue'\nimport IconShareVariant from 'vue-material-design-icons/ShareVariantOutline.vue'\n\nimport SharingSidebarTab from '../components/SidebarTabs/SharingSidebarTab.vue'\nimport SettingsSidebarTab from '../components/SidebarTabs/SettingsSidebarTab.vue'\nimport ViewsMixin from '../mixins/ViewsMixin.js'\n\nexport default {\n\tname: 'Sidebar',\n\n\tcomponents: {\n\t\tIconSettings,\n\t\tIconShareVariant,\n\t\tNcAppSidebar,\n\t\tNcAppSidebarTab,\n\t\tSharingSidebarTab,\n\t\tSettingsSidebarTab,\n\t},\n\n\tmixins: [ViewsMixin],\n\n\tprops: {\n\t\tactive: {\n\t\t\ttype: String,\n\t\t\tdefault: 'forms-sharing',\n\t\t},\n\t},\n\n\tcomputed: {\n\t\tlockedUntilFormatted() {\n\t\t\tif (this.form.lockedUntil === 0 || this.form.lockedUntil === null) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn moment(this.form.lockedUntil, 'X')\n\t\t\t\t.locale(window.OC.getLanguage())\n\t\t\t\t.fromNow()\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonUpdateActive(active) {\n\t\t\tthis.$emit('update:active', active)\n\t\t},\n\n\t\t/**\n\t\t * Save Form-Properties\n\t\t *\n\t\t * @param {string} property The Name of the Property to update\n\t\t * @param {any} newVal The new Property value\n\t\t */\n\t\tonPropertyChange(property, newVal) {\n\t\t\tthis.$set(this.form, property, newVal)\n\t\t\tthis.saveFormProperty(property)\n\t\t},\n\n\t\t/**\n\t\t * Adding/Removing Share from the reactive object. API-Request is done in sharing-tab.\n\t\t *\n\t\t * @param {object} share The respective share object\n\t\t */\n\t\tonAddShare(share) {\n\t\t\tthis.form.shares.push(share)\n\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t},\n\t\tonRemoveShare(share) {\n\t\t\tconst index = this.form.shares.findIndex(\n\t\t\t\t(search) => search.id === share.id,\n\t\t\t)\n\t\t\tthis.form.shares.splice(index, 1)\n\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t},\n\t\tonUpdateShare(share) {\n\t\t\tconst index = this.form.shares.findIndex(\n\t\t\t\t(search) => search.id === share.id,\n\t\t\t)\n\t\t\tthis.form.shares.splice(index, 1, share)\n\t\t\temit('forms:last-updated:set', this.form.id)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.app-sidebar__tab:focus {\n\tbox-shadow: none;\n}\n\nh3 {\n\tfont-weight: bold;\n\tmargin-inline-start: 8px;\n\tmargin-block-end: 8px;\n}\n</style>\n","<!--\n  - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<NcContent app-name=\"forms\">\n\t\t<NcAppNavigation\n\t\t\tv-if=\"canCreateForms || hasForms\"\n\t\t\t:aria-label=\"t('forms', 'Forms navigation')\">\n\t\t\t<NcAppNavigationNew\n\t\t\t\tv-if=\"canCreateForms\"\n\t\t\t\t:text=\"t('forms', 'New form')\"\n\t\t\t\t@click=\"onNewForm\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconPlus :size=\"20\" decorative />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationNew>\n\n\t\t\t<!-- Form-Owner-->\n\t\t\t<template v-if=\"ownedForms.length > 0\">\n\t\t\t\t<NcAppNavigationCaption\n\t\t\t\t\tis-heading\n\t\t\t\t\tclass=\"forms-navigation__list-heading\"\n\t\t\t\t\theading-id=\"forms-navigation-your-forms\"\n\t\t\t\t\t:name=\"t('forms', 'Your forms')\" />\n\t\t\t\t<ul aria-labelledby=\"forms-navigation-your-forms\">\n\t\t\t\t\t<AppNavigationForm\n\t\t\t\t\t\tv-for=\"form in ownedForms\"\n\t\t\t\t\t\t:key=\"form.id\"\n\t\t\t\t\t\t:form=\"form\"\n\t\t\t\t\t\t:read-only=\"false\"\n\t\t\t\t\t\t@open-sharing=\"openSharing\"\n\t\t\t\t\t\t@mobile-close-navigation=\"mobileCloseNavigation\"\n\t\t\t\t\t\t@clone=\"onCloneForm\"\n\t\t\t\t\t\t@delete=\"onDeleteForm\" />\n\t\t\t\t</ul>\n\t\t\t</template>\n\n\t\t\t<!-- Shared Forms-->\n\t\t\t<template v-if=\"sharedForms.length > 0\">\n\t\t\t\t<NcAppNavigationCaption\n\t\t\t\t\tis-heading\n\t\t\t\t\tclass=\"forms-navigation__list-heading\"\n\t\t\t\t\theading-id=\"forms-navigation-shared-forms\"\n\t\t\t\t\t:name=\"t('forms', 'Shared with you')\" />\n\t\t\t\t<ul aria-labelledby=\"forms-navigation-shared-forms\">\n\t\t\t\t\t<AppNavigationForm\n\t\t\t\t\t\tv-for=\"form in sharedForms\"\n\t\t\t\t\t\t:key=\"form.id\"\n\t\t\t\t\t\t:form=\"form\"\n\t\t\t\t\t\tread-only\n\t\t\t\t\t\t@open-sharing=\"openSharing\"\n\t\t\t\t\t\t@clone=\"onCloneForm\"\n\t\t\t\t\t\t@mobile-close-navigation=\"mobileCloseNavigation\" />\n\t\t\t\t</ul>\n\t\t\t</template>\n\n\t\t\t<template #footer>\n\t\t\t\t<div v-if=\"archivedForms.length > 0\" class=\"forms-navigation-footer\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\talignment=\"start\"\n\t\t\t\t\t\tclass=\"forms__archived-forms-toggle\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\twide\n\t\t\t\t\t\t@click=\"showArchivedForms = true\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconArchive :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('forms', 'Archived forms') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</template>\n\t\t</NcAppNavigation>\n\n\t\t<!-- No forms & loading emptycontents -->\n\t\t<NcAppContent v-if=\"loading || !routeHash || !routeAllowed\">\n\t\t\t<NcEmptyContent\n\t\t\t\tv-if=\"loading\"\n\t\t\t\tclass=\"forms-emptycontent\"\n\t\t\t\t:name=\"t('forms', 'Loading forms …')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcLoadingIcon :size=\"64\" />\n\t\t\t\t</template>\n\t\t\t</NcEmptyContent>\n\n\t\t\t<NcEmptyContent\n\t\t\t\tv-else-if=\"!hasForms\"\n\t\t\t\tclass=\"forms-emptycontent\"\n\t\t\t\t:name=\"t('forms', 'No forms created yet')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FormsIcon :size=\"64\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"canCreateForms\" #action>\n\t\t\t\t\t<NcButton variant=\"primary\" @click=\"onNewForm\">\n\t\t\t\t\t\t{{ t('forms', 'Create a form') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</template>\n\t\t\t</NcEmptyContent>\n\n\t\t\t<NcEmptyContent\n\t\t\t\tv-else\n\t\t\t\tclass=\"forms-emptycontent\"\n\t\t\t\t:name=\"\n\t\t\t\t\tcanCreateForms\n\t\t\t\t\t\t? t('forms', 'Select a form or create a new one')\n\t\t\t\t\t\t: t('forms', 'Please select a form')\n\t\t\t\t\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FormsIcon :size=\"64\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"canCreateForms\" #action>\n\t\t\t\t\t<NcButton variant=\"primary\" @click=\"onNewForm\">\n\t\t\t\t\t\t{{ t('forms', 'Create new form') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</template>\n\t\t\t</NcEmptyContent>\n\t\t</NcAppContent>\n\n\t\t<!-- No errors show router content -->\n\t\t<template v-else>\n\t\t\t<router-view\n\t\t\t\t:form.sync=\"selectedForm\"\n\t\t\t\t:sidebar-opened.sync=\"sidebarOpened\"\n\t\t\t\t@open-sharing=\"openSharing\" />\n\t\t\t<Sidebar\n\t\t\t\tv-if=\"!selectedForm.partial && canEdit\"\n\t\t\t\t:form=\"selectedForm\"\n\t\t\t\t:sidebar-opened.sync=\"sidebarOpened\"\n\t\t\t\t:active.sync=\"sidebarActive\" />\n\t\t</template>\n\n\t\t<!-- Archived forms modal -->\n\t\t<ArchivedFormsModal\n\t\t\t:open.sync=\"showArchivedForms\"\n\t\t\t:forms=\"archivedForms\"\n\t\t\t@clone=\"onCloneForm\" />\n\t</NcContent>\n</template>\n\n<script>\nimport { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { loadState } from '@nextcloud/initial-state'\nimport { showError } from '@nextcloud/dialogs'\nimport axios from '@nextcloud/axios'\nimport moment from '@nextcloud/moment'\n\nimport { useIsMobile } from '@nextcloud/vue'\nimport NcAppContent from '@nextcloud/vue/components/NcAppContent'\nimport NcAppNavigation from '@nextcloud/vue/components/NcAppNavigation'\nimport NcAppNavigationCaption from '@nextcloud/vue/components/NcAppNavigationCaption'\nimport NcAppNavigationNew from '@nextcloud/vue/components/NcAppNavigationNew'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcContent from '@nextcloud/vue/components/NcContent'\nimport NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'\nimport NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'\n\nimport IconArchive from 'vue-material-design-icons/ArchiveOutline.vue'\nimport IconPlus from 'vue-material-design-icons/Plus.vue'\n\nimport ArchivedFormsModal from './components/ArchivedFormsModal.vue'\nimport AppNavigationForm from './components/AppNavigationForm.vue'\nimport FormsIcon from './components/Icons/FormsIcon.vue'\nimport OcsResponse2Data from './utils/OcsResponse2Data.js'\nimport PermissionTypes from './mixins/PermissionTypes.js'\nimport Sidebar from './views/Sidebar.vue'\nimport logger from './utils/Logger.js'\nimport { FormState } from './models/Constants.ts'\n\nexport default {\n\tname: 'Forms',\n\n\tcomponents: {\n\t\tAppNavigationForm,\n\t\tArchivedFormsModal,\n\t\tFormsIcon,\n\t\tIconArchive,\n\t\tIconPlus,\n\t\tNcAppContent,\n\t\tNcAppNavigation,\n\t\tNcAppNavigationCaption,\n\t\tNcAppNavigationNew,\n\t\tNcButton,\n\t\tNcContent,\n\t\tNcEmptyContent,\n\t\tNcLoadingIcon,\n\t\tSidebar,\n\t},\n\n\tmixins: [PermissionTypes],\n\n\tsetup() {\n\t\treturn {\n\t\t\tisMobile: useIsMobile(),\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tloading: true,\n\t\t\tsidebarOpened: false,\n\t\t\tsidebarActive: 'forms-sharing',\n\t\t\tforms: [],\n\t\t\tallSharedForms: [],\n\n\t\t\tshowArchivedForms: false,\n\n\t\t\tcanCreateForms: loadState(appName, 'appConfig').canCreateForms,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcanEdit() {\n\t\t\treturn this.selectedForm.permissions.includes(\n\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_EDIT,\n\t\t\t)\n\t\t},\n\n\t\thasForms() {\n\t\t\treturn this.allSharedForms.length > 0 || this.forms.length > 0\n\t\t},\n\n\t\t/**\n\t\t * All own active forms\n\t\t */\n\t\townedForms() {\n\t\t\treturn this.forms.filter((form) => form.state !== FormState.FormArchived)\n\t\t},\n\n\t\t/**\n\t\t * All active shared forms\n\t\t */\n\t\tsharedForms() {\n\t\t\treturn this.allSharedForms.filter(\n\t\t\t\t(form) => form.state !== FormState.FormArchived,\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * All forms that have been archived\n\t\t */\n\t\tarchivedForms() {\n\t\t\treturn [...this.forms, ...this.allSharedForms].filter(\n\t\t\t\t(form) => form.state === FormState.FormArchived,\n\t\t\t)\n\t\t},\n\n\t\trouteHash() {\n\t\t\treturn this.$route.params.hash\n\t\t},\n\n\t\t// If the user is allowed to access this route\n\t\trouteAllowed() {\n\t\t\t// Check formId from initial state on app initialization\n\t\t\tif (this.loading && loadState(appName, 'formId') === 'invalid') {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Not allowed, if no hash\n\t\t\tif (!this.routeHash) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Try to find form in owned & shared list\n\t\t\tconst form = [...this.forms, ...this.allSharedForms].find(\n\t\t\t\t(form) => form.hash === this.routeHash,\n\t\t\t)\n\n\t\t\t// If no form found, load it from server. Route will be automatically re-evaluated.\n\t\t\tif (form === undefined) {\n\t\t\t\tthis.fetchPartialForm(this.routeHash)\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif (this.$route.name === 'results') {\n\t\t\t\treturn (\n\t\t\t\t\tform.permissions.includes(this.$route.name)\n\t\t\t\t\t|| form.submissionCount > 0\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// Return whether route is in the permissions-list\n\t\t\treturn form.permissions.includes(this.$route.name)\n\t\t},\n\n\t\tselectedForm: {\n\t\t\tget() {\n\t\t\t\tif (this.routeAllowed) {\n\t\t\t\t\treturn this.forms\n\t\t\t\t\t\t.concat(this.allSharedForms)\n\t\t\t\t\t\t.find((form) => form.hash === this.routeHash)\n\t\t\t\t}\n\t\t\t\treturn {}\n\t\t\t},\n\t\t\tset(form) {\n\t\t\t\t// always close sidebar\n\t\t\t\tthis.sidebarOpened = false\n\n\t\t\t\t// If a owned form\n\t\t\t\tlet index = this.forms.findIndex(\n\t\t\t\t\t(search) => search.hash === this.routeHash,\n\t\t\t\t)\n\t\t\t\tif (index > -1) {\n\t\t\t\t\tthis.$set(this.forms, index, form)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// Otherwise a shared form\n\t\t\t\tindex = this.allSharedForms.findIndex(\n\t\t\t\t\t(search) => search.hash === this.routeHash,\n\t\t\t\t)\n\t\t\t\tif (index > -1) {\n\t\t\t\t\tthis.$set(this.allSharedForms, index, form)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tbeforeMount() {\n\t\tthis.loadForms()\n\t},\n\n\tmounted() {\n\t\tsubscribe('forms:last-updated:set', (id) => this.onLastUpdatedByEventBus(id))\n\t\tsubscribe('forms:ownership-transfered', (id) => this.onDeleteForm(id))\n\t},\n\n\tunmounted() {\n\t\tunsubscribe('forms:last-updated:set', (id) =>\n\t\t\tthis.onLastUpdatedByEventBus(id),\n\t\t)\n\t\tunsubscribe('forms:ownership-transfered', (id) => this.onDeleteForm(id))\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Closes the App-Navigation on mobile-devices\n\t\t */\n\t\tmobileCloseNavigation() {\n\t\t\tif (this.isMobile) {\n\t\t\t\temit('toggle-navigation', { open: false })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Open a form and its sidebar for sharing\n\t\t *\n\t\t * @param {string} hash the hash of the form to load\n\t\t */\n\t\topenSharing(hash) {\n\t\t\tif (hash !== this.routeHash) {\n\t\t\t\tthis.$router.push({ name: 'edit', params: { hash } })\n\t\t\t}\n\t\t\tthis.sidebarActive = 'forms-sharing'\n\t\t\tthis.sidebarOpened = true\n\t\t},\n\n\t\t/**\n\t\t * Initial forms load\n\t\t */\n\t\tasync loadForms() {\n\t\t\tthis.loading = true\n\n\t\t\t// Load Owned forms\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms'),\n\t\t\t\t)\n\t\t\t\tthis.forms = OcsResponse2Data(response)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while loading owned forms list', { error })\n\t\t\t\tshowError(\n\t\t\t\t\tt('forms', 'An error occurred while loading the forms list'),\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// Load shared forms\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms?type=shared'),\n\t\t\t\t)\n\t\t\t\tthis.allSharedForms = OcsResponse2Data(response)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while loading shared forms list', {\n\t\t\t\t\terror,\n\t\t\t\t})\n\t\t\t\tshowError(\n\t\t\t\t\tt('forms', 'An error occurred while loading the forms list'),\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tthis.loading = false\n\t\t},\n\n\t\t/**\n\t\t * Fetch a partial form by its hash and add it to the shared forms list.\n\t\t *\n\t\t * @param {string} hash the hash of the form to load\n\t\t */\n\t\tasync fetchPartialForm(hash) {\n\t\t\tawait new Promise((resolve) => {\n\t\t\t\tconst wait = () => {\n\t\t\t\t\tif (this.loading) {\n\t\t\t\t\t\twindow.setTimeout(wait, 250)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twait()\n\t\t\t})\n\n\t\t\tthis.loading = true\n\t\t\tif (\n\t\t\t\t[...this.forms, ...this.allSharedForms].find(\n\t\t\t\t\t(form) => form.hash === hash,\n\t\t\t\t) === undefined\n\t\t\t) {\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await axios.get(\n\t\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms/{id}', {\n\t\t\t\t\t\t\tid: loadState(appName, 'formId'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t\tconst form = OcsResponse2Data(response)\n\n\t\t\t\t\t// If the user has (at least) submission-permissions, add it to the shared forms\n\t\t\t\t\tif (\n\t\t\t\t\t\tform.permissions.includes(\n\t\t\t\t\t\t\tthis.PERMISSION_TYPES.PERMISSION_SUBMIT,\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.allSharedForms.push(form)\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger.error(`Form ${hash} not found`, { error })\n\t\t\t\t\tshowError(t('forms', 'Form not found'))\n\n\t\t\t\t\tif ([403, 404].includes(error.response?.status)) {\n\t\t\t\t\t\tif (this.$route.name !== 'root') {\n\t\t\t\t\t\t\tthis.$router.push({ name: 'root' })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.loading = false\n\t\t},\n\n\t\tasync onNewForm() {\n\t\t\ttry {\n\t\t\t\t// Request a new empty form\n\t\t\t\tconst response = await axios.post(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms'),\n\t\t\t\t)\n\t\t\t\tconst newForm = OcsResponse2Data(response)\n\t\t\t\tthis.forms.unshift(newForm)\n\t\t\t\tthis.$router.push({\n\t\t\t\t\tname: 'edit',\n\t\t\t\t\tparams: { hash: newForm.hash },\n\t\t\t\t})\n\t\t\t\tthis.mobileCloseNavigation()\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Unable to create new form', { error })\n\t\t\t\tshowError(t('forms', 'Unable to create a new form'))\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Request to clone a form, store returned form and open it.\n\t\t *\n\t\t * @param {number} id id of the form to clone\n\t\t */\n\t\tasync onCloneForm(id) {\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(\n\t\t\t\t\tgenerateOcsUrl('apps/forms/api/v3/forms?fromId={id}', {\n\t\t\t\t\t\tid,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\tconst newForm = OcsResponse2Data(response)\n\t\t\t\tthis.forms.unshift(newForm)\n\t\t\t\tthis.$router.push({\n\t\t\t\t\tname: 'edit',\n\t\t\t\t\tparams: { hash: newForm.hash },\n\t\t\t\t})\n\t\t\t\tthis.mobileCloseNavigation()\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error(`Unable to copy form ${id}`, { error })\n\t\t\t\tshowError(t('forms', 'Unable to copy form'))\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove form from forms list after successful server deletion request\n\t\t *\n\t\t * @param {number} id the form id\n\t\t */\n\t\tasync onDeleteForm(id) {\n\t\t\tconst formIndex = this.forms.findIndex((form) => form.id === id)\n\t\t\tconst deletedHash = this.forms[formIndex].hash\n\n\t\t\tthis.forms.splice(formIndex, 1)\n\n\t\t\t// Redirect if current form has been deleted\n\t\t\tif (deletedHash === this.routeHash && this.$route.name !== 'root') {\n\t\t\t\tthis.$router.push({ name: 'root' })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Update last updated timestamp in given form\n\t\t *\n\t\t * @param {number} id the form id\n\t\t */\n\t\tonLastUpdatedByEventBus(id) {\n\t\t\tconst formIndex = this.forms.findIndex((form) => form.id === id)\n\t\t\tif (formIndex !== -1) {\n\t\t\t\tthis.forms[formIndex].lastUpdated = moment().unix()\n\t\t\t\tthis.forms.sort((b, a) => a.lastUpdated - b.lastUpdated)\n\t\t\t} else {\n\t\t\t\tconst sharedFormIndex = this.allSharedForms.findIndex(\n\t\t\t\t\t(form) => form.id === id,\n\t\t\t\t)\n\t\t\t\tthis.allSharedForms[sharedFormIndex].lastUpdated = moment().unix()\n\t\t\t\tthis.allSharedForms.sort((b, a) => a.lastUpdated - b.lastUpdated)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.forms-navigation-footer {\n\tdisplay: flex;\n\tflex-direction: column;\n\tpadding: var(--app-navigation-padding);\n}\n\n// Fix the margin of the lists\n.forms-navigation__list-heading {\n\tmargin-block: calc(var(--default-grid-baseline) * 2) 0 !important;\n\n\t:deep(h2) {\n\t\t// Make the list more condensed\n\t\tmargin-block: 0;\n\t}\n}\n\n.forms-emptycontent {\n\theight: 100%;\n}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { translate, translatePlural } from '@nextcloud/l10n'\n\nimport Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'\nimport Vue from 'vue'\n\nimport router from './router.js'\nimport Forms from './Forms.vue'\n\n// eslint-disable-next-line import/no-unresolved, n/no-missing-import\nimport 'vite/modulepreload-polyfill'\nimport '@nextcloud/dialogs/style.css'\n\nVue.directive('tooltip', Tooltip)\n\nVue.prototype.t = translate\nVue.prototype.n = translatePlural\n\nexport default new Vue({\n\tel: '#content',\n\t// eslint-disable-next-line vue/match-component-file-name\n\tname: 'FormsRoot',\n\trouter,\n\trender: (h) => h(Forms),\n})\n"],"names":["_sfc_main","_sfc_render","_vm","_c","_sfc_staticRenderFns","__component__","normalizeComponent","NcActionCaption","NcAppNavigationList","NcAppNavigationToggle","Vue","useIsMobile","subscribe","emit","createFocusTrap","getTrapStack","useHotKey","unsubscribe","state","bodyStyles","animationLength","open","element","tabbable","logger","event","activeElement","$event","NcAppNavigation","NcActions","headingLevel","NcAppNavigationCaption","NcButton","value","NcAppNavigationNew","NcAppSidebarTab","axios","Draggable","IconLock","IconPlus","NcActionButton","NcAppContent","NcEmptyContent","NcLoadingIcon","NcNoteCard","Question","QuestionLong","QuestionShort","QuestionMultiple","TopBar","ViewsMixin","answerTypes","loadState","isUsed","question","moment","FormState","message","relativeDate","datetime","filteredAnswerTypes","SetWindowTitle","index","textarea","target","debounce","INPUT_DEBOUNCE_MS","type","response","generateOcsUrl","OcsResponse2Data","error","showError","questionId","search","id","newOrder","IconDeleteSvg","IconFileDelimitedSvg","IconFileExcelOutlineSvg","IconLinkSvg","IconLinkVariantOffSvg","IconTableSvg","IconFile","label","labelLowest","labelHighest","optionsLowest","optionsHighest","descriptionParts","description","questionOptionsStats","option","_","i","submission","answers","answer","optionsStatIndex","object1","object2","questionOptionsStat","maxCount","answersModels","noResponseCount","generateUrl","noResponsePercentage","NcHighlight","Answer","IconDelete","IconPencil","NcActionRouter","answeredQuestionsArray","squashedAnswers","IconChevronLeft","IconChevronRight","NcSelect","PageFirstIcon","PageLastIcon","pageNumber","SUPPORTED_FILE_FORMATS","fileFormat","responseViews","IconDownload","IconFileDelimited","IconFileExcelOutline","IconFolder","IconLink","IconLinkVariantOff","IconPoll","IconRefresh","IconShareVariant","IconTable","NcActionSeparator","NcDialog","NcTextField","PaginationToolbar","IconMagnify","PillMenu","ResultsSummary","Submission","PermissionTypes","useIsSmallMobile","IconCancelSvg","updatedForm","data","exportUrl","getRequestToken","path","showSuccess","submissionUser","getCurrentUser","submissions","questions","dateQuestions","date","getFilePickerBuilder","node","FileType","extension","selectedNodes","Router","router","Create","Results","Submit","FormsIcon","IconArchive","IconArchiveOff","IconCheck","IconContentCopy","NcListItem","showConfirmation","defineComponent","AppNavigationForm","t","formId","form","IconUserSvg","IconGroupSvg","IconMailSvg","IconChatSvg","IconCircleSvg","ShareTypes","UserSearchMixin","query","shareType","args","request","exact","exactSuggestions","suggestions","results","flatResults","share","a","b","shares","NcSelectUsers","item","newShare","IconClose","NcActionCheckbox","NcAvatar","hasPermission","permission","perm","canPromise","toSJISFunction","CODEWORDS_COUNT","utils","version","digit","f","kanji","exports","fromString","string","level","defaultValue","BitBuffer","bufIndex","num","length","bit","bitBuffer","BitMatrix","size","row","col","reserved","bitMatrix","getSymbolSize","require$$0","posCount","intervals","positions","coords","pos","posLength","j","FINDER_PATTERN_SIZE","finderPattern","PenaltyScores","mask","points","sameCountCol","sameCountRow","lastCol","lastRow","module","last","bitsCol","bitsRow","darkCount","modulesCount","getMaskAt","maskPattern","pattern","setupFormatFunc","numPatterns","bestPattern","lowerPenalty","p","penalty","ECLevel","EC_BLOCKS_TABLE","EC_CODEWORDS_TABLE","errorCorrectionCode","errorCorrectionLevel","EXP_TABLE","LOG_TABLE","x","galoisField","n","y","GF","p1","p2","coeff","divident","divisor","result","offset","degree","poly","Polynomial","ReedSolomonEncoder","paddedData","remainder","start","buff","reedSolomonEncoder","versionCheck","numeric","alphanumeric","byte","regex","TEST_KANJI","TEST_NUMERIC","TEST_ALPHANUMERIC","str","VersionCheck","Regex","require$$1","mode","dataStr","Utils","ECCode","require$$2","Mode","require$$3","require$$4","G18","G18_BCH","getBestVersionForDataLength","currentVersion","getReservedBitsCount","getTotalBitsFromDataArray","segments","totalBits","reservedBits","getBestVersionForMixedData","totalCodewords","ecTotalCodewords","dataTotalCodewordsBits","usableBits","seg","ecl","d","G15","G15_MASK","G15_BCH","formatInfo","NumericData","group","remainingNum","numericData","ALPHA_NUM_CHARS","AlphanumericData","alphanumericData","ByteData","l","byteData","KanjiData","kanjiData","dijkstra","graph","s","predecessors","costs","closest","u","v","cost_of_s_to_u","adjacent_nodes","cost_of_e","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","first_visit","msg","nodes","opts","T","key","cost","require$$5","require$$6","require$$7","getStringByteLength","getSegments","getSegmentsFromString","numSegs","alphaNumSegs","byteSegs","kanjiSegs","s1","s2","obj","getSegmentBitsLength","mergeSegments","segs","acc","curr","prevSeg","buildNodes","buildGraph","table","prevNodeIds","nodeGroup","currentNodeIds","prevNodeId","buildSingleSegment","modesHint","bestMode","array","optimizedSegs","AlignmentPattern","FinderPattern","MaskPattern","require$$8","Version","require$$9","FormatInfo","require$$10","require$$11","Segments","require$$12","setupFinderPattern","matrix","r","c","setupTimingPattern","setupAlignmentPattern","setupVersionInfo","bits","mod","setupFormatInfo","setupData","inc","bitIndex","byteIndex","dark","createData","buffer","remainingByte","createCodewords","dataTotalCodewords","ecTotalBlocks","blocksInGroup2","blocksInGroup1","totalCodewordsInGroup1","dataCodewordsInGroup1","dataCodewordsInGroup2","ecCount","rs","dcData","ecData","maxDataSize","dataSize","createSymbol","estimatedVersion","rawSegments","bestVersion","dataBits","moduleCount","modules","qrcode","options","hex2rgba","hex","hexCode","hexValue","margin","width","scale","qrSize","imgData","qr","symbolSize","scaledMargin","palette","posDst","pxColor","iSrc","jSrc","clearCanvas","ctx","canvas","getCanvasElement","qrData","canvasEl","image","rendererOpts","getColorAttrib","color","attrib","alpha","svgCmd","cmd","qrToPath","moveBy","newRow","lineLength","svgTag","cb","qrcodesize","bg","viewBox","QRCode","CanvasRenderer","SvgRenderer","renderCanvas","renderFunc","text","argsNum","isLastArgCb","resolve","reject","e","browser","err","ShareLinkMixin","formHash","url","link","code","IconAccountMultiple","IconCodeBrackets","IconCopyAll","IconLinkBoxVariantOutline","IconLinkVariant","IconQr","NcActionLink","NcCheckboxRadioSwitch","QRDialog","SharingSearchDiv","SharingShareDiv","appName","updatedShare","newVal","newAccess","textToEscape","this","o","svgLockOpen","NcDateTimePicker","NcIconSvgWrapper","TransferOwnership","ClickOutside","checked","isClosed","locked","isArchived","IconSettings","NcAppSidebar","SharingSidebarTab","SettingsSidebarTab","active","property","ArchivedFormsModal","NcContent","Sidebar","hash","wait","newForm","formIndex","deletedHash","sharedFormIndex","Tooltip","translate","translatePlural","h","Forms"],"mappings":";s/BAoBA,MAAAA,GAAA,CACA,KAAA,kBACA,MAAA,CAAA,OAAA,EACA,MAAA,CACA,MAAA,CACA,KAAA,MACA,EACA,UAAA,CACA,KAAA,OACA,QAAA,cACA,EACA,KAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,CACA,oxBClCMA,GAAY,CAChB,KAAM,kBACN,OAAQ,CACN,iBAAkB,CAChB,KAAM,2BACN,QAAS,EACf,CACA,EACE,MAAO,CAIL,KAAM,CACJ,KAAM,OACN,SAAU,EAChB,CACA,CACA,EACA,IAAIC,GAAc,UAAkB,CAClC,IAAIC,EAAM,KAAMC,EAAKD,EAAI,MAAM,GAC/B,OAAOC,EAAG,KAAM,CAAE,YAAa,yBAA0B,MAAO,CAAE,KAAQD,EAAI,kBAAoB,cAAc,CAAE,EAAI,CAACA,EAAI,GAAG,IAAMA,EAAI,GAAGA,EAAI,IAAI,EAAI,GAAG,CAAC,CAAC,CAC9J,EACIE,GAAuB,CAAA,EACvBC,GAAgCC,GAClCN,GACAC,GACAG,GACA,GACA,KACA,UACF,EACA,MAAMG,GAAkBF,GAAc,QC/BhCL,GAAY,CAChB,KAAM,qBACR,EACA,IAAIC,GAAc,UAAkB,CAClC,IAAIC,EAAM,KAAMC,EAAKD,EAAI,MAAM,GAC/B,OAAOC,EAAG,KAAM,CAAE,YAAa,qBAAqB,EAAI,CAACD,EAAI,GAAG,SAAS,CAAC,EAAG,CAAC,CAChF,EACIE,GAAuB,CAAA,EACvBC,GAAgCC,GAClCN,GACAC,GACAG,GACA,GACA,KACA,UACF,EACA,MAAMI,GAAsBH,GAAc,QCNpCL,GAAY,CAChB,KAAM,kBACN,WAAY,CACV,oBAAAQ,GACA,sBAAAC,EACJ,EAEE,OAAQ,CACN,oBAAqB,CACnB,QAAS,IAAM,IAAMC,EAAI,KAAK,KAAK,6EAA6E,EAChH,KAAM,+BACZ,CACA,E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,UAAA,CACA,KAAA,OACA,QAAA,cACA,EACA,KAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,CACA,+uBCpCAgF,GAAe,6UCoBfhF,GAAA,CACA,KAAA,cACA,MAAA,CAAA,OAAA,EACA,MAAA,CACA,MAAA,CACA,KAAA,MACA,EACA,UAAA,CACA,KAAA,OACA,QAAA,cACA,EACA,KAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,CACA,i2BCpCAiF,GAAe,+bCoBfjF,GAAA,CACA,KAAA,WACA,MAAA,CAAA,OAAA,EACA,MAAA,CACA,MAAA,CACA,KAAA,MACA,EACA,UAAA,CACA,KAAA,OACA,QAAA,cACA,EACA,KAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,CACA,ojBChBAA,GAAA,CACA,KAAA,cACA,MAAA,CAAA,OAAA,EACA,MAAA,CACA,MAAA,CACA,KAAA,MACA,EACA,UAAA,CACA,KAAA,OACA,QAAA,cACA,EACA,KAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,CACA,utBChBAA,GAAA,CACA,KAAA,YACA,MAAA,CAAA,OAAA,EACA,MAAA,CACA,MAAA,CACA,KAAA,MACA,EACA,UAAA,CACA,KAAA,OACA,QAAA,cACA,EACA,KAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,CACA,8oBCpCAkF,GAAe,4OCoBflF,GAAA,CACA,KAAA,cACA,MAAA,CAAA,OAAA,EACA,MAAA,CACA,MAAA,CACA,KAAA,MACA,EACA,UAAA,CACA,KAAA,OACA,QAAA,cACA,EACA,KAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,CACA,swBCwCAA,GAAA,CACA,KAAA,iBAEA,WAAA,CACA,SAAAmF,EACA,EAEA,MAAA,CACA,YAAA,CACA,KAAA,MACA,SAAA,EACA,EACA,SAAA,CACA,KAAA,OACA,SAAA,EACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,YAAAhC,EACA,CACA,EAEA,SAAA,CACA,mBAAA,CACA,MAAAiC,EAAA,KAA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