{"version":3,"file":"stimulus-CX-q2A3x.js","sources":["../../../node_modules/stimulus-reveal-controller/dist/stimulus-reveal-controller.mjs","../../../node_modules/stimulus-hotkeys/dist/index.m.js","../../../node_modules/stimulus-dropdown/node_modules/stimulus-use/dist/index.js","../../../node_modules/stimulus-dropdown/dist/stimulus-dropdown.mjs","../../../node_modules/stimulus-textarea-autogrow/dist/stimulus-textarea-autogrow.mjs","../../../node_modules/stimulus-read-more/dist/stimulus-read-more.mjs","../../../node_modules/stimulus-popover/dist/stimulus-popover.mjs","../../../node_modules/stimulus-vite-helpers/dist/index.js","../../../app/javascript/entrypoints/stimulus.js"],"sourcesContent":["import { Controller as e } from \"@hotwired/stimulus\";\nclass t extends e {\n connect() {\n this.class = this.hasHiddenClass ? this.hiddenClass : \"hidden\";\n }\n toggle() {\n this.itemTargets.forEach((s) => {\n s.classList.toggle(this.class);\n });\n }\n show() {\n this.itemTargets.forEach((s) => {\n s.classList.remove(this.class);\n });\n }\n hide() {\n this.itemTargets.forEach((s) => {\n s.classList.add(this.class);\n });\n }\n}\nt.targets = [\"item\"];\nt.classes = [\"hidden\"];\nexport {\n t as default\n};\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\n/*\nStimulus 3.0.1\nCopyright © 2021 Basecamp, LLC\n */\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\n\nfunction capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\n\nfunction dasherize(value) {\n return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce((values, constructor) => {\n getOwnStaticArrayValues(constructor, propertyName).forEach(name => values.add(name));\n return values;\n }, new Set()));\n}\n\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce((pairs, constructor) => {\n pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n return pairs;\n }, []);\n}\n\nfunction getAncestorsForConstructor(constructor) {\n const ancestors = [];\n\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n\n return ancestors.reverse();\n}\n\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n const definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\n\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n const definition = constructor[propertyName];\n return definition ? Object.keys(definition).map(key => [key, definition[key]]) : [];\n}\n\nconst extend = (() => {\n function extendWithReflect(constructor) {\n function extended() {\n return Reflect.construct(constructor, arguments, new.target);\n }\n\n extended.prototype = Object.create(constructor.prototype, {\n constructor: {\n value: extended\n }\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n\n function testReflectExtension() {\n const a = function () {\n this.a.call(this);\n };\n\n const b = extendWithReflect(a);\n\n b.prototype.a = function () {};\n\n return new b();\n }\n\n try {\n testReflectExtension();\n return extendWithReflect;\n } catch (error) {\n return constructor => class extended extends constructor {};\n }\n})();\n\nfunction ClassPropertiesBlessing(constructor) {\n const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce((properties, classDefinition) => {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\n\nfunction propertiesForClassDefinition(key) {\n return {\n [`${key}Class`]: {\n get() {\n const {\n classes\n } = this;\n\n if (classes.has(key)) {\n return classes.get(key);\n } else {\n const attribute = classes.getAttributeName(key);\n throw new Error(`Missing attribute \"${attribute}\"`);\n }\n }\n\n },\n [`${key}Classes`]: {\n get() {\n return this.classes.getAll(key);\n }\n\n },\n [`has${capitalize(key)}Class`]: {\n get() {\n return this.classes.has(key);\n }\n\n }\n };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce((properties, targetDefinition) => {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\n\nfunction propertiesForTargetDefinition(name) {\n return {\n [`${name}Target`]: {\n get() {\n const target = this.targets.find(name);\n\n if (target) {\n return target;\n } else {\n throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n }\n }\n\n },\n [`${name}Targets`]: {\n get() {\n return this.targets.findAll(name);\n }\n\n },\n [`has${capitalize(name)}Target`]: {\n get() {\n return this.targets.has(name);\n }\n\n }\n };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n const propertyDescriptorMap = {\n valueDescriptorMap: {\n get() {\n return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);\n const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, {\n [attributeName]: valueDescriptor\n });\n }, {});\n }\n\n }\n };\n return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\n\nfunction propertiesForValueDefinitionPair(valueDefinitionPair) {\n const definition = parseValueDefinitionPair(valueDefinitionPair);\n const {\n key,\n name,\n reader: read,\n writer: write\n } = definition;\n return {\n [name]: {\n get() {\n const value = this.data.get(key);\n\n if (value !== null) {\n return read(value);\n } else {\n return definition.defaultValue;\n }\n },\n\n set(value) {\n if (value === undefined) {\n this.data.delete(key);\n } else {\n this.data.set(key, write(value));\n }\n }\n\n },\n [`has${capitalize(name)}`]: {\n get() {\n return this.data.has(key) || definition.hasCustomDefaultValue;\n }\n\n }\n };\n}\n\nfunction parseValueDefinitionPair([token, typeDefinition]) {\n return valueDescriptorForTokenAndTypeDefinition(token, typeDefinition);\n}\n\nfunction parseValueTypeConstant(constant) {\n switch (constant) {\n case Array:\n return \"array\";\n\n case Boolean:\n return \"boolean\";\n\n case Number:\n return \"number\";\n\n case Object:\n return \"object\";\n\n case String:\n return \"string\";\n }\n}\n\nfunction parseValueTypeDefault(defaultValue) {\n switch (typeof defaultValue) {\n case \"boolean\":\n return \"boolean\";\n\n case \"number\":\n return \"number\";\n\n case \"string\":\n return \"string\";\n }\n\n if (Array.isArray(defaultValue)) return \"array\";\n if (Object.prototype.toString.call(defaultValue) === \"[object Object]\") return \"object\";\n}\n\nfunction parseValueTypeObject(typeObject) {\n const typeFromObject = parseValueTypeConstant(typeObject.type);\n\n if (typeFromObject) {\n const defaultValueType = parseValueTypeDefault(typeObject.default);\n\n if (typeFromObject !== defaultValueType) {\n throw new Error(`Type \"${typeFromObject}\" must match the type of the default value. Given default value: \"${typeObject.default}\" as \"${defaultValueType}\"`);\n }\n\n return typeFromObject;\n }\n}\n\nfunction parseValueTypeDefinition(typeDefinition) {\n const typeFromObject = parseValueTypeObject(typeDefinition);\n const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n const typeFromConstant = parseValueTypeConstant(typeDefinition);\n const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n if (type) return type;\n throw new Error(`Unknown value type \"${typeDefinition}\"`);\n}\n\nfunction defaultValueForDefinition(typeDefinition) {\n const constant = parseValueTypeConstant(typeDefinition);\n if (constant) return defaultValuesByType[constant];\n const defaultValue = typeDefinition.default;\n if (defaultValue !== undefined) return defaultValue;\n return typeDefinition;\n}\n\nfunction valueDescriptorForTokenAndTypeDefinition(token, typeDefinition) {\n const key = `${dasherize(token)}-value`;\n const type = parseValueTypeDefinition(typeDefinition);\n return {\n type,\n key,\n name: camelize(key),\n\n get defaultValue() {\n return defaultValueForDefinition(typeDefinition);\n },\n\n get hasCustomDefaultValue() {\n return parseValueTypeDefault(typeDefinition) !== undefined;\n },\n\n reader: readers[type],\n writer: writers[type] || writers.default\n };\n}\n\nconst defaultValuesByType = {\n get array() {\n return [];\n },\n\n boolean: false,\n number: 0,\n\n get object() {\n return {};\n },\n\n string: \"\"\n};\nconst readers = {\n array(value) {\n const array = JSON.parse(value);\n\n if (!Array.isArray(array)) {\n throw new TypeError(\"Expected array\");\n }\n\n return array;\n },\n\n boolean(value) {\n return !(value == \"0\" || value == \"false\");\n },\n\n number(value) {\n return Number(value);\n },\n\n object(value) {\n const object = JSON.parse(value);\n\n if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n throw new TypeError(\"Expected object\");\n }\n\n return object;\n },\n\n string(value) {\n return value;\n }\n\n};\nconst writers = {\n default: writeString,\n array: writeJSON,\n object: writeJSON\n};\n\nfunction writeJSON(value) {\n return JSON.stringify(value);\n}\n\nfunction writeString(value) {\n return `${value}`;\n}\n\nclass Controller {\n constructor(context) {\n this.context = context;\n }\n\n static get shouldLoad() {\n return true;\n }\n\n get application() {\n return this.context.application;\n }\n\n get scope() {\n return this.context.scope;\n }\n\n get element() {\n return this.scope.element;\n }\n\n get identifier() {\n return this.scope.identifier;\n }\n\n get targets() {\n return this.scope.targets;\n }\n\n get classes() {\n return this.scope.classes;\n }\n\n get data() {\n return this.scope.data;\n }\n\n initialize() {}\n\n connect() {}\n\n disconnect() {}\n\n dispatch(eventName, {\n target = this.element,\n detail = {},\n prefix = this.identifier,\n bubbles = true,\n cancelable = true\n } = {}) {\n const type = prefix ? `${prefix}:${eventName}` : eventName;\n const event = new CustomEvent(type, {\n detail,\n bubbles,\n cancelable\n });\n target.dispatchEvent(event);\n return event;\n }\n\n}\n\nController.blessings = [ClassPropertiesBlessing, TargetPropertiesBlessing, ValuePropertiesBlessing];\nController.targets = [];\nController.values = {};\n\n/*!\n * hotkeys-js v3.8.7\n * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.\n * \n * Copyright (c) 2021 kenny wong \n * http://jaywcjlove.github.io/hotkeys\n * \n * Licensed under the MIT license.\n */\nvar isff = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase().indexOf('firefox') > 0 : false; // 绑定事件\n\nfunction addEvent(object, event, method) {\n if (object.addEventListener) {\n object.addEventListener(event, method, false);\n } else if (object.attachEvent) {\n object.attachEvent(\"on\".concat(event), function () {\n method(window.event);\n });\n }\n} // 修饰键转换成对应的键码\n\n\nfunction getMods(modifier, key) {\n var mods = key.slice(0, key.length - 1);\n\n for (var i = 0; i < mods.length; i++) {\n mods[i] = modifier[mods[i].toLowerCase()];\n }\n\n return mods;\n} // 处理传的key字符串转换成数组\n\n\nfunction getKeys(key) {\n if (typeof key !== 'string') key = '';\n key = key.replace(/\\s/g, ''); // 匹配任何空白字符,包括空格、制表符、换页符等等\n\n var keys = key.split(','); // 同时设置多个快捷键,以','分割\n\n var index = keys.lastIndexOf(''); // 快捷键可能包含',',需特殊处理\n\n for (; index >= 0;) {\n keys[index - 1] += ',';\n keys.splice(index, 1);\n index = keys.lastIndexOf('');\n }\n\n return keys;\n} // 比较修饰键的数组\n\n\nfunction compareArray(a1, a2) {\n var arr1 = a1.length >= a2.length ? a1 : a2;\n var arr2 = a1.length >= a2.length ? a2 : a1;\n var isIndex = true;\n\n for (var i = 0; i < arr1.length; i++) {\n if (arr2.indexOf(arr1[i]) === -1) isIndex = false;\n }\n\n return isIndex;\n}\n\nvar _keyMap = {\n backspace: 8,\n tab: 9,\n clear: 12,\n enter: 13,\n return: 13,\n esc: 27,\n escape: 27,\n space: 32,\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n del: 46,\n delete: 46,\n ins: 45,\n insert: 45,\n home: 36,\n end: 35,\n pageup: 33,\n pagedown: 34,\n capslock: 20,\n num_0: 96,\n num_1: 97,\n num_2: 98,\n num_3: 99,\n num_4: 100,\n num_5: 101,\n num_6: 102,\n num_7: 103,\n num_8: 104,\n num_9: 105,\n num_multiply: 106,\n num_add: 107,\n num_enter: 108,\n num_subtract: 109,\n num_decimal: 110,\n num_divide: 111,\n '⇪': 20,\n ',': 188,\n '.': 190,\n '/': 191,\n '`': 192,\n '-': isff ? 173 : 189,\n '=': isff ? 61 : 187,\n ';': isff ? 59 : 186,\n '\\'': 222,\n '[': 219,\n ']': 221,\n '\\\\': 220\n}; // Modifier Keys\n\nvar _modifier = {\n // shiftKey\n '⇧': 16,\n shift: 16,\n // altKey\n '⌥': 18,\n alt: 18,\n option: 18,\n // ctrlKey\n '⌃': 17,\n ctrl: 17,\n control: 17,\n // metaKey\n '⌘': 91,\n cmd: 91,\n command: 91\n};\nvar modifierMap = {\n 16: 'shiftKey',\n 18: 'altKey',\n 17: 'ctrlKey',\n 91: 'metaKey',\n shiftKey: 16,\n ctrlKey: 17,\n altKey: 18,\n metaKey: 91\n};\nvar _mods = {\n 16: false,\n 18: false,\n 17: false,\n 91: false\n};\nvar _handlers = {}; // F1~F12 special key\n\nfor (var k = 1; k < 20; k++) {\n _keyMap[\"f\".concat(k)] = 111 + k;\n}\n\nvar _downKeys = []; // 记录摁下的绑定键\n\nvar _scope = 'all'; // 默认热键范围\n\nvar elementHasBindEvent = []; // 已绑定事件的节点记录\n// 返回键码\n\nvar code = function code(x) {\n return _keyMap[x.toLowerCase()] || _modifier[x.toLowerCase()] || x.toUpperCase().charCodeAt(0);\n}; // 设置获取当前范围(默认为'所有')\n\n\nfunction setScope(scope) {\n _scope = scope || 'all';\n} // 获取当前范围\n\n\nfunction getScope() {\n return _scope || 'all';\n} // 获取摁下绑定键的键值\n\n\nfunction getPressedKeyCodes() {\n return _downKeys.slice(0);\n} // 表单控件控件判断 返回 Boolean\n// hotkey is effective only when filter return true\n\n\nfunction filter(event) {\n var target = event.target || event.srcElement;\n var tagName = target.tagName;\n var flag = true; // ignore: isContentEditable === 'true', and