{"version":3,"sources":["webpack:///./src/views/news/components/AddArticleButton.vue?a70d","webpack:///./src/views/news/components/AddArticleButton.vue","webpack:///./src/views/news/components/AddArticleButton.vue?8569","webpack:///./src/views/news/components/AddArticleButton.vue?d848","webpack:///../../../src/mixins/rippleable/index.ts","webpack:///./src/core/utils/getLinks.ts","webpack:///./node_modules/core-js/modules/es.string.match-all.js","webpack:///../../../src/components/VTextarea/VTextarea.ts","webpack:///../../../src/components/VSwitch/VSwitch.ts","webpack:///../../../src/mixins/selectable/index.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","VDialog","attrs","scopedSlots","_u","key","fn","ref","on","VBtn","_g","addArticleLoading","_v","_s","$t","staticClass","VIcon","model","value","callback","$$v","addDialog","expression","VCard","VSpacer","$event","VDivider","preventDefault","addArticle","VImg","bannerImagePreview","_e","VTextField","textRules","title","VTextarea","previewLinks","body","links","length","_l","link","VSwitch","hasBannerImage","VFileInput","handleBannerImage","files","canSubmit","staticRenderFns","placeholderImage","AddArticleButton","bannerImage","v","toString","trim","getLinks","file","reader","FileReader","onload","result","readAsDataURL","data","FormData","append","forEach","addArticleAction","Vue","__decorate","Getter","Action","Function","Watch","Component","components","LinkPreview","component","extend","name","directives","ripple","props","type","Boolean","Object","default","methods","genRipple","push","center","urlRegex","text","strs","matchAll","map","x","Set","$","createIteratorConstructor","requireObjectCoercible","toLength","aFunction","anObject","classof","isRegExp","getRegExpFlags","createNonEnumerableProperty","fails","wellKnownSymbol","speciesConstructor","advanceStringIndex","InternalStateModule","IS_PURE","MATCH_ALL","REGEXP_STRING","REGEXP_STRING_ITERATOR","setInternalState","set","getInternalState","getterFor","RegExpPrototype","RegExp","prototype","regExpBuiltinExec","exec","nativeMatchAll","WORKS_WITH_NON_GLOBAL_REGEX","regExpExec","R","S","call","TypeError","$RegExpStringIterator","regexp","string","global","fullUnicode","unicode","done","state","undefined","match","String","lastIndex","$matchAll","C","flagsValue","flags","matcher","source","indexOf","target","proto","forced","rx","O","apply","arguments","baseMixins","mixins","autoGrow","noResize","rowHeight","Number","validator","isNaN","parseFloat","rows","parseInt","computed","classes","noResizeHandle","options","watch","val","$nextTick","calculateInputHeight","$refs","input","_a","style","removeProperty","lazyValue","mounted","setTimeout","height","scrollHeight","minHeight","Math","max","genInput","tag","onInput","e","onKeyDown","isFocused","keyCode","stopPropagation","$emit","Selectable","Touch","inset","loading","flat","VInput","isActive","isDisabled","role","validationState","hasError","shouldValidate","hasSuccess","hasColor","computedColor","switchData","setTextColor","class","themeClasses","genDefaultSlot","genSwitch","genLabel","attrs$","switchAttrs","left","onSwipeLeft","right","onSwipeRight","genProgress","VFabTransition","$slots","progress","VProgressCircular","color","size","width","indeterminate","onChange","onKeydown","keyCodes","prevent","Rippleable","Comparable","prop","event","id","inputValue","falseValue","trueValue","multiple","label","isDark","appIsDark","isMultiple","Array","isArray","internalValue","some","item","valueComparator","isDirty","rippleState","click","assign","disabled","computedId","domProps","checked","blur","onBlur","change","focus","onFocus","keydown","onClick","isInteractive","filter","validate"],"mappings":"oSAcIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAGE,EAAA,KAAQ,CAACC,MAAM,CAAC,YAAY,SAASC,YAAYR,EAAIS,GAAG,CAAC,CAACC,IAAI,YAAYC,GAAG,SAASC,GACzL,IAAIC,EAAKD,EAAIC,GACb,MAAO,CAACT,EAAG,MAAM,CAACA,EAAGU,EAAA,KAAKd,EAAIe,GAAG,CAACR,MAAM,CAAC,KAAO,GAAG,UAAY,IAAI,QAAUP,EAAIgB,kBAAkB,SAAWhB,EAAIgB,oBAAoBH,GAAI,CAACT,EAAG,OAAO,CAACJ,EAAIiB,GAAGjB,EAAIkB,GAAGlB,EAAImB,GAAG,sDAAsDf,EAAG,MAAM,CAACgB,YAAY,SAAShB,EAAG,MAAM,CAACgB,YAAY,2CAA2C,CAAChB,EAAGiB,EAAA,KAAM,CAACrB,EAAIiB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I,EAAM3I,OAErB2I,EAAQA,EAAMiG,QAAQ,SAAAlB,GAAD,OAAgB,EAAKC,gBAAgBD,EAAM/O,MAE5DgK,EAAM3I,SAAWA,GACnB2I,EAAM1F,KAAKtE,QAGbgK,OAD4BtC,IAAnBhJ,KAAK2P,gBAA+C3G,IAApBhJ,KAAK0P,WACtC1P,KAAKsQ,gBAAgBhF,EAAOtL,KAAK2P,WAAa3P,KAAK0P,WAAa1P,KAAK2P,UACpErO,EACDtB,KAAKsQ,gBAAgBhF,EAAOhK,GAAS,KAAOA,GAE3CgK,EAGXtL,KAAKwR,UAAS,EAAMlG,GACpBtL,KAAKmQ,cAAgB7E,EACrBtL,KAAKwN,SAAWlC,IAElB6F,QAAO,SAAE9E,GACPrM,KAAKuM,WAAY,EACjBvM,KAAK0M,MAAM,QAASL,IAEtB2E,OAAM,SAAE3E,GACNrM,KAAKuM,WAAY,EACjBvM,KAAK0M,MAAM,OAAQL,IAGrB4C,UAAS,SAAE5C","file":"assets/js/chunk-d867dcce.b8cdc003.js","sourcesContent":["import { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VCardTitle } from 'vuetify/lib/components/VCard';\nimport { VDialog } from 'vuetify/lib/components/VDialog';\nimport { VDivider } from 'vuetify/lib/components/VDivider';\nimport { VFileInput } from 'vuetify/lib/components/VFileInput';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VImg } from 'vuetify/lib/components/VImg';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VSwitch } from 'vuetify/lib/components/VSwitch';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\nimport { VTextarea } from 'vuetify/lib/components/VTextarea';\n\nvar render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(VDialog,{attrs:{\"max-width\":\"800px\"},scopedSlots:_vm._u([{key:\"activator\",fn:function(ref){\nvar on = ref.on;\nreturn [_c('div',[_c(VBtn,_vm._g({attrs:{\"text\":\"\",\"elevation\":\"0\",\"loading\":_vm.addArticleLoading,\"disabled\":_vm.addArticleLoading}},on),[_c('span',[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.addArticleButton.addArticle\")))]),_c('div',{staticClass:\"mx-1\"}),_c('div',{staticClass:\"primary other--text pa-1 rounded-circle\"},[_c(VIcon,[_vm._v(\"mdi-plus\")])],1)])],1)]}}]),model:{value:(_vm.addDialog),callback:function ($$v) {_vm.addDialog=$$v},expression:\"addDialog\"}},[_c(VCard,[_c(VCardTitle,[_c('span',[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.addArticleButton.addNewsArticle\")))]),_c(VSpacer),_c(VBtn,{attrs:{\"icon\":\"\"},on:{\"click\":function($event){_vm.addDialog = false}}},[_c(VIcon,[_vm._v(\"mdi-close\")])],1)],1),_c(VDivider),_c(VCardText,{staticClass:\"pa-6\"},[(_vm.addDialog)?_c('form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.addArticle($event)}}},[(_vm.hasBannerImage)?_c(VImg,{staticClass:\"mb-4\",attrs:{\"src\":_vm.bannerImagePreview}}):_vm._e(),_c(VTextField,{attrs:{\"label\":_vm.$t('latestNewsSections.addArticleButton.articleTitle'),\"rules\":_vm.textRules},model:{value:(_vm.title),callback:function ($$v) {_vm.title=$$v},expression:\"title\"}}),_c(VTextarea,{attrs:{\"label\":_vm.$t('latestNewsSections.addArticleButton.articleBody'),\"rules\":_vm.textRules,\"clearable\":\"\",\"auto-grow\":\"\",\"rows\":\"2\"},on:{\"change\":_vm.previewLinks},model:{value:(_vm.body),callback:function ($$v) {_vm.body=$$v},expression:\"body\"}}),(_vm.links.length > 0)?_c('div',_vm._l((_vm.links),function(link){return _c('LinkPreview',{key:link,attrs:{\"link\":link}})}),1):_vm._e(),_c(VSwitch,{attrs:{\"label\":_vm.$t('latestNewsSections.addArticleButton.addBannerImage')},model:{value:(_vm.hasBannerImage),callback:function ($$v) {_vm.hasBannerImage=$$v},expression:\"hasBannerImage\"}}),(_vm.hasBannerImage)?_c(VFileInput,{attrs:{\"placeholder\":_vm.$t('latestNewsSections.addArticleButton.bannerImage'),\"accept\":\"image/*\"},on:{\"change\":_vm.handleBannerImage}}):_vm._e(),_c(VFileInput,{attrs:{\"placeholder\":_vm.$t('latestNewsSections.addArticleButton.otherFiles'),\"accept\":\"application/pdf, image/*, video/*\",\"show-size\":\"\",\"multiple\":\"\",\"counter\":\"\",\"chips\":\"\"},model:{value:(_vm.files),callback:function ($$v) {_vm.files=$$v},expression:\"files\"}}),_c(VBtn,{staticClass:\"mt-6\",attrs:{\"disabled\":!_vm.canSubmit,\"color\":\"primary\",\"type\":\"submit\",\"elevation\":\"0\",\"block\":\"\"}},[_c('span',[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.addArticleButton.addArticle\")))])])],1):_vm._e()])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Vue from \"vue\";\r\nimport { Action, Getter } from \"vuex-class\";\r\nimport { getLinks } from \"@/core/utils/getLinks\";\r\nimport { Component, Watch } from \"vue-property-decorator\";\r\nimport LinkPreview from \"@/components/common/LinkPreview.vue\";\r\n\r\nconst placeholderImage =\r\n \"https://www.geographicexperiences.com/wp-content/uploads/revslider/home5/placeholder-1200x500.png\";\r\n@Component({ components: { LinkPreview } })\r\nexport default class AddArticleButton extends Vue {\r\n @Getter(\"news/addArticleLoading\") addArticleLoading!: boolean;\r\n @Action(\"news/addArticle\") addArticleAction!: Function;\r\n\r\n body = \"\";\r\n title = \"\";\r\n addDialog = false;\r\n files: File[] = [];\r\n links: string[] = [];\r\n hasBannerImage = false;\r\n bannerImagePreview: any = \"\";\r\n bannerImage: File | null = null;\r\n\r\n previewLinks() {\r\n this.links = getLinks(this.body);\r\n }\r\n\r\n textRules = [\r\n (v: string) => {\r\n if (v == null) return this.$t(\"forms.reqfield\").toString();\r\n if (v.trim().length == 0) return this.$t(\"forms.reqfield\").toString();\r\n else return true;\r\n },\r\n ];\r\n\r\n get canSubmit() {\r\n return this.title.length > 0 && this.body.length > 0;\r\n }\r\n\r\n handleBannerImage(file: File) {\r\n this.bannerImage = file;\r\n if (!file) this.bannerImagePreview = placeholderImage;\r\n else {\r\n let reader = new FileReader();\r\n reader.onload = () => (this.bannerImagePreview = reader.result);\r\n reader.readAsDataURL(this.bannerImage);\r\n }\r\n }\r\n addArticle() {\r\n if (this.addArticleLoading) return;\r\n if (\r\n this.title.length == 0 ||\r\n this.body.length == 0 ||\r\n (this.hasBannerImage && this.bannerImage == null)\r\n )\r\n return;\r\n\r\n const data = new FormData();\r\n data.append(\"title\", this.title.trim());\r\n data.append(\"body\", this.body.trim());\r\n data.append(\"bannerImage\", this.bannerImage!);\r\n this.files.forEach(file => data.append(\"files\", file));\r\n this.addArticleAction(data);\r\n this.addDialog = false;\r\n }\r\n\r\n @Watch(\"addDialog\")\r\n toggleDialog() {\r\n this.title = \"\";\r\n this.body = \"\";\r\n this.hasBannerImage = false;\r\n this.bannerImage = null;\r\n this.bannerImagePreview = placeholderImage;\r\n this.files = [];\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AddArticleButton.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AddArticleButton.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./AddArticleButton.vue?vue&type=template&id=9ffc60bc&\"\nimport script from \"./AddArticleButton.vue?vue&type=script&lang=ts&\"\nexport * from \"./AddArticleButton.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","// Directives\nimport ripple from '../../directives/ripple'\n\n// Types\nimport Vue, { VNode, VNodeData, VNodeDirective } from 'vue'\n\nexport default Vue.extend({\n name: 'rippleable',\n\n directives: { ripple },\n\n props: {\n ripple: {\n type: [Boolean, Object],\n default: true,\n },\n },\n\n methods: {\n genRipple (data: VNodeData = {}): VNode | null {\n if (!this.ripple) return null\n\n data.staticClass = 'v-input--selection-controls__ripple'\n\n data.directives = data.directives || []\n data.directives.push({\n name: 'ripple',\n value: { center: true },\n } as VNodeDirective)\n\n return this.$createElement('div', data)\n },\n },\n})\n","export const urlRegex = /(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g;\r\nexport const getLinks = (text: string) => {\r\n const strs = [...text.matchAll(urlRegex)].map(x => x[0]);\r\n return [...new Set(strs)];\r\n};\r\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toLength = require('../internals/to-length');\nvar aFunction = require('../internals/a-function');\nvar anObject = require('../internals/an-object');\nvar classof = require('../internals/classof-raw');\nvar isRegExp = require('../internals/is-regexp');\nvar getRegExpFlags = require('../internals/regexp-flags');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar InternalStateModule = require('../internals/internal-state');\nvar IS_PURE = require('../internals/is-pure');\n\nvar MATCH_ALL = wellKnownSymbol('matchAll');\nvar REGEXP_STRING = 'RegExp String';\nvar REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR);\nvar RegExpPrototype = RegExp.prototype;\nvar regExpBuiltinExec = RegExpPrototype.exec;\nvar nativeMatchAll = ''.matchAll;\n\nvar WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails(function () {\n 'a'.matchAll(/./);\n});\n\nvar regExpExec = function (R, S) {\n var exec = R.exec;\n var result;\n if (typeof exec == 'function') {\n result = exec.call(R, S);\n if (typeof result != 'object') throw TypeError('Incorrect exec result');\n return result;\n } return regExpBuiltinExec.call(R, S);\n};\n\n// eslint-disable-next-line max-len\nvar $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, global, fullUnicode) {\n setInternalState(this, {\n type: REGEXP_STRING_ITERATOR,\n regexp: regexp,\n string: string,\n global: global,\n unicode: fullUnicode,\n done: false\n });\n}, REGEXP_STRING, function next() {\n var state = getInternalState(this);\n if (state.done) return { value: undefined, done: true };\n var R = state.regexp;\n var S = state.string;\n var match = regExpExec(R, S);\n if (match === null) return { value: undefined, done: state.done = true };\n if (state.global) {\n if (String(match[0]) == '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode);\n return { value: match, done: false };\n }\n state.done = true;\n return { value: match, done: false };\n});\n\nvar $matchAll = function (string) {\n var R = anObject(this);\n var S = String(string);\n var C, flagsValue, flags, matcher, global, fullUnicode;\n C = speciesConstructor(R, RegExp);\n flagsValue = R.flags;\n if (flagsValue === undefined && R instanceof RegExp && !('flags' in RegExpPrototype)) {\n flagsValue = getRegExpFlags.call(R);\n }\n flags = flagsValue === undefined ? '' : String(flagsValue);\n matcher = new C(C === RegExp ? R.source : R, flags);\n global = !!~flags.indexOf('g');\n fullUnicode = !!~flags.indexOf('u');\n matcher.lastIndex = toLength(R.lastIndex);\n return new $RegExpStringIterator(matcher, S, global, fullUnicode);\n};\n\n// `String.prototype.matchAll` method\n// https://github.com/tc39/proposal-string-matchall\n$({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {\n matchAll: function matchAll(regexp) {\n var O = requireObjectCoercible(this);\n var flags, S, matcher, rx;\n if (regexp != null) {\n if (isRegExp(regexp)) {\n flags = String(requireObjectCoercible('flags' in RegExpPrototype\n ? regexp.flags\n : getRegExpFlags.call(regexp)\n ));\n if (!~flags.indexOf('g')) throw TypeError('`.matchAll` does not allow non-global regexes');\n }\n if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments);\n matcher = regexp[MATCH_ALL];\n if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll;\n if (matcher != null) return aFunction(matcher).call(regexp, O);\n } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments);\n S = String(O);\n rx = new RegExp(regexp, 'g');\n return IS_PURE ? $matchAll.call(rx, S) : rx[MATCH_ALL](S);\n }\n});\n\nIS_PURE || MATCH_ALL in RegExpPrototype || createNonEnumerableProperty(RegExpPrototype, MATCH_ALL, $matchAll);\n","// Styles\nimport './VTextarea.sass'\n\n// Extensions\nimport VTextField from '../VTextField/VTextField'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\n// Types\nimport Vue from 'vue'\n\ninterface options extends Vue {\n $refs: {\n input: HTMLTextAreaElement\n }\n}\n\nconst baseMixins = mixins\n>(\n VTextField\n)\n\n/* @vue/component */\nexport default baseMixins.extend({\n name: 'v-textarea',\n\n props: {\n autoGrow: Boolean,\n noResize: Boolean,\n rowHeight: {\n type: [Number, String],\n default: 24,\n validator: (v: any) => !isNaN(parseFloat(v)),\n },\n rows: {\n type: [Number, String],\n default: 5,\n validator: (v: any) => !isNaN(parseInt(v, 10)),\n },\n },\n\n computed: {\n classes (): object {\n return {\n 'v-textarea': true,\n 'v-textarea--auto-grow': this.autoGrow,\n 'v-textarea--no-resize': this.noResizeHandle,\n ...VTextField.options.computed.classes.call(this),\n }\n },\n noResizeHandle (): boolean {\n return this.noResize || this.autoGrow\n },\n },\n\n watch: {\n autoGrow (val: boolean) {\n this.$nextTick(() => {\n val\n ? this.calculateInputHeight()\n : this.$refs.input?.style.removeProperty('height')\n })\n },\n lazyValue () {\n this.autoGrow && this.$nextTick(this.calculateInputHeight)\n },\n rowHeight () {\n this.autoGrow && this.$nextTick(this.calculateInputHeight)\n },\n },\n\n mounted () {\n setTimeout(() => {\n this.autoGrow && this.calculateInputHeight()\n }, 0)\n },\n\n methods: {\n calculateInputHeight () {\n const input = this.$refs.input\n if (!input) return\n\n input.style.height = '0'\n const height = input.scrollHeight\n const minHeight = parseInt(this.rows, 10) * parseFloat(this.rowHeight)\n // This has to be done ASAP, waiting for Vue\n // to update the DOM causes ugly layout jumping\n input.style.height = Math.max(minHeight, height) + 'px'\n },\n genInput () {\n const input = VTextField.options.methods.genInput.call(this)\n\n input.tag = 'textarea'\n delete input.data!.attrs!.type\n input.data!.attrs!.rows = this.rows\n\n return input\n },\n onInput (e: Event) {\n VTextField.options.methods.onInput.call(this, e)\n this.autoGrow && this.calculateInputHeight()\n },\n onKeyDown (e: KeyboardEvent) {\n // Prevents closing of a\n // dialog when pressing\n // enter\n if (this.isFocused && e.keyCode === 13) {\n e.stopPropagation()\n }\n\n this.$emit('keydown', e)\n },\n },\n})\n","// Styles\nimport '../../styles/components/_selection-controls.sass'\nimport './VSwitch.sass'\n\n// Mixins\nimport Selectable from '../../mixins/selectable'\nimport VInput from '../VInput'\n\n// Directives\nimport Touch from '../../directives/touch'\n\n// Components\nimport { VFabTransition } from '../transitions'\nimport VProgressCircular from '../VProgressCircular/VProgressCircular'\n\n// Helpers\nimport { keyCodes } from '../../util/helpers'\n\n// Types\nimport { VNode, VNodeData } from 'vue'\n\n/* @vue/component */\nexport default Selectable.extend({\n name: 'v-switch',\n\n directives: { Touch },\n\n props: {\n inset: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n flat: {\n type: Boolean,\n default: false,\n },\n },\n\n computed: {\n classes (): object {\n return {\n ...VInput.options.computed.classes.call(this),\n 'v-input--selection-controls v-input--switch': true,\n 'v-input--switch--flat': this.flat,\n 'v-input--switch--inset': this.inset,\n }\n },\n attrs (): object {\n return {\n 'aria-checked': String(this.isActive),\n 'aria-disabled': String(this.isDisabled),\n role: 'switch',\n }\n },\n // Do not return undefined if disabled,\n // according to spec, should still show\n // a color when disabled and active\n validationState (): string | undefined {\n if (this.hasError && this.shouldValidate) return 'error'\n if (this.hasSuccess) return 'success'\n if (this.hasColor !== null) return this.computedColor\n return undefined\n },\n switchData (): VNodeData {\n return this.setTextColor(this.loading ? undefined : this.validationState, {\n class: this.themeClasses,\n })\n },\n },\n\n methods: {\n genDefaultSlot (): (VNode | null)[] {\n return [\n this.genSwitch(),\n this.genLabel(),\n ]\n },\n genSwitch (): VNode {\n const { title, ...switchAttrs } = this.attrs$\n\n return this.$createElement('div', {\n staticClass: 'v-input--selection-controls__input',\n }, [\n this.genInput('checkbox', {\n ...this.attrs,\n ...switchAttrs,\n }),\n this.genRipple(this.setTextColor(this.validationState, {\n directives: [{\n name: 'touch',\n value: {\n left: this.onSwipeLeft,\n right: this.onSwipeRight,\n },\n }],\n })),\n this.$createElement('div', {\n staticClass: 'v-input--switch__track',\n ...this.switchData,\n }),\n this.$createElement('div', {\n staticClass: 'v-input--switch__thumb',\n ...this.switchData,\n }, [this.genProgress()]),\n ])\n },\n genProgress (): VNode {\n return this.$createElement(VFabTransition, {}, [\n this.loading === false\n ? null\n : this.$slots.progress || this.$createElement(VProgressCircular, {\n props: {\n color: (this.loading === true || this.loading === '')\n ? (this.color || 'primary')\n : this.loading,\n size: 16,\n width: 2,\n indeterminate: true,\n },\n }),\n ])\n },\n onSwipeLeft () {\n if (this.isActive) this.onChange()\n },\n onSwipeRight () {\n if (!this.isActive) this.onChange()\n },\n onKeydown (e: KeyboardEvent) {\n if (\n (e.keyCode === keyCodes.left && this.isActive) ||\n (e.keyCode === keyCodes.right && !this.isActive)\n ) this.onChange()\n },\n },\n})\n","// Components\nimport VInput from '../../components/VInput'\n\n// Mixins\nimport Rippleable from '../rippleable'\nimport Comparable from '../comparable'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\nexport function prevent (e: Event) {\n e.preventDefault()\n}\n\n/* @vue/component */\nexport default mixins(\n VInput,\n Rippleable,\n Comparable\n).extend({\n name: 'selectable',\n\n model: {\n prop: 'inputValue',\n event: 'change',\n },\n\n props: {\n id: String,\n inputValue: null as any,\n falseValue: null as any,\n trueValue: null as any,\n multiple: {\n type: Boolean,\n default: null,\n },\n label: String,\n },\n\n data () {\n return {\n hasColor: this.inputValue,\n lazyValue: this.inputValue,\n }\n },\n\n computed: {\n computedColor (): string | undefined {\n if (!this.isActive) return undefined\n if (this.color) return this.color\n if (this.isDark && !this.appIsDark) return 'white'\n return 'primary'\n },\n isMultiple (): boolean {\n return this.multiple === true || (this.multiple === null && Array.isArray(this.internalValue))\n },\n isActive (): boolean {\n const value = this.value\n const input = this.internalValue\n\n if (this.isMultiple) {\n if (!Array.isArray(input)) return false\n\n return input.some(item => this.valueComparator(item, value))\n }\n\n if (this.trueValue === undefined || this.falseValue === undefined) {\n return value\n ? this.valueComparator(value, input)\n : Boolean(input)\n }\n\n return this.valueComparator(input, this.trueValue)\n },\n isDirty (): boolean {\n return this.isActive\n },\n rippleState (): string | undefined {\n return !this.isDisabled && !this.validationState\n ? undefined\n : this.validationState\n },\n },\n\n watch: {\n inputValue (val) {\n this.lazyValue = val\n this.hasColor = val\n },\n },\n\n methods: {\n genLabel () {\n const label = VInput.options.methods.genLabel.call(this)\n\n if (!label) return label\n\n label!.data!.on = {\n // Label shouldn't cause the input to focus\n click: prevent,\n }\n\n return label\n },\n genInput (type: string, attrs: object) {\n return this.$createElement('input', {\n attrs: Object.assign({\n 'aria-checked': this.isActive.toString(),\n disabled: this.isDisabled,\n id: this.computedId,\n role: type,\n type,\n }, attrs),\n domProps: {\n value: this.value,\n checked: this.isActive,\n },\n on: {\n blur: this.onBlur,\n change: this.onChange,\n focus: this.onFocus,\n keydown: this.onKeydown,\n click: prevent,\n },\n ref: 'input',\n })\n },\n onClick (e: Event) {\n this.onChange()\n this.$emit('click', e)\n },\n onChange () {\n if (!this.isInteractive) return\n\n const value = this.value\n let input = this.internalValue\n\n if (this.isMultiple) {\n if (!Array.isArray(input)) {\n input = []\n }\n\n const length = input.length\n\n input = input.filter((item: any) => !this.valueComparator(item, value))\n\n if (input.length === length) {\n input.push(value)\n }\n } else if (this.trueValue !== undefined && this.falseValue !== undefined) {\n input = this.valueComparator(input, this.trueValue) ? this.falseValue : this.trueValue\n } else if (value) {\n input = this.valueComparator(input, value) ? null : value\n } else {\n input = !input\n }\n\n this.validate(true, input)\n this.internalValue = input\n this.hasColor = input\n },\n onFocus (e: FocusEvent) {\n this.isFocused = true\n this.$emit('focus', e)\n },\n onBlur (e: FocusEvent) {\n this.isFocused = false\n this.$emit('blur', e)\n },\n /** @abstract */\n onKeydown (e: Event) {},\n },\n})\n"],"sourceRoot":""}