{"version":3,"sources":["webpack:///../../../src/components/VGrid/VRow.ts","webpack:///./node_modules/core-js/modules/es.string.ends-with.js","webpack:///../../../src/components/VResponsive/VResponsive.ts","webpack:///../../../src/components/VResponsive/index.ts","webpack:///../../../src/components/VImg/VImg.ts"],"names":["breakpoints","ALIGNMENT","makeProps","props","prefix","def","alignValidator","str","alignProps","type","default","validator","justifyValidator","justifyProps","alignContentValidator","alignContentProps","propMap","align","Object","justify","alignContent","classMap","breakpointClass","className","val","breakpoint","prop","cache","name","functional","tag","dense","noGutters","render","children","cacheKey","String","classList","value","h","data","staticClass","class","$","getOwnPropertyDescriptor","f","toLength","notARegExp","requireObjectCoercible","correctIsRegExpLogic","IS_PURE","$endsWith","endsWith","min","Math","CORRECT_IS_REGEXP_LOGIC","MDN_POLYFILL_BUG","descriptor","prototype","writable","target","proto","forced","searchString","that","this","endPosition","arguments","length","undefined","len","end","search","call","slice","mixins","aspectRatio","contentClass","computed","computedAspectRatio","Number","aspectStyle","paddingBottom","__cachedSizer","$createElement","style","methods","genContent","$slots","on","$listeners","hasIntersect","window","directives","intersect","alt","contain","eager","gradient","lazySrc","options","root","rootMargin","threshold","position","sizes","src","srcset","transition","Boolean","currentSrc","image","isLoading","calculatedAspectRatio","naturalWidth","hasError","normalisedSrc","aspect","__cachedImage","backgroundImage","backgroundPosition","key","attrs","mode","watch","loadImage","init","mounted","lazyImg","onLoad","startsWith","naturalHeight","onError","getSrc","err","console","pollForSize","timeout","poll","img","setTimeout","content","width","__genPlaceholder","placeholder","appear","node","mergeData","role","modifiers","once","handler"],"mappings":"sTAOMA,EAAc,CAAC,KAAM,KAAM,KAAjC,MAEMC,EAAY,CAAC,QAAS,MAA5B,UAEA,SAASC,EAAT,KACE,OAAOF,EAAA,QAAmB,cAExB,OADAG,EAAMC,EAAS,eAAf,IAAkCC,IAClC,IAFF,IAMF,IAAMC,EAAkB,SAAAC,GAAD,MAAc,6CAArC,IACMC,EAAaN,EAAU,SAAS,iBAAO,CAC3CO,K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J,cACEA,KAAA,GAAQ4E,EAAR,WAA8B,CAC5BxD,MAAO,CAAEyD,MAAO,GAAF,OAAK7E,KAAKiD,aAAV,SAIlB,GAEF6B,iBArGO,WAsGL,GAAI9E,KAAKuB,OAAT,YAA6B,CAC3B,IAAMwD,EAAc/E,KAAK+C,UACrB,CAAC/C,KAAKmB,eAAe,MAAO,CAC5B3C,YAAa,wBACZwB,KAAKuB,OAHU,cAApB,GAMA,OAAKvB,KAAL,WAEOA,KAAKmB,eAAe,aAAc,CACvCjF,MAAO,CACL8I,QADK,EAELrH,KAAMqC,KAAK2C,aAHf,GAF6BoC,EAAP,MAY5B/G,OA3OO,SA2OD,GACJ,IAAMiH,EAAO,2BAAb,GAEM1G,EAAO,OAAA2G,EAAA,MAAUD,EAAD,KAAa,CACjCzG,YADiC,UAEjCiF,MAAO,CACL,aAAczD,KADT,IAELmF,KAAMnF,KAAK8B,IAAM,WAAQ1B,GAE3B3B,MAAOuB,KAN0B,aASjC4B,WAAYF,EACR,CAAC,CACD/D,KADC,YAEDyH,UAAW,CAAEC,MAAM,GACnBhH,MAAO,CACLiH,QAAStF,KADJ,KAELmC,QAASnC,KAAKmC,gBAGhB/B,IAUN,OAPA6E,EAAA,SAAgB,CACdjF,KADc,cAEdA,KAFc,cAGdA,KAHc,mBAIdA,KAJF,cAOO1B,EAAE2G,EAAD,MAAiBA,EAAzB","file":"js/chunk-6ce0b9d2.c28ccb6e.js","sourcesContent":["import './VGrid.sass'\n\nimport Vue, { PropOptions } from 'vue'\nimport mergeData from '../../util/mergeData'\nimport { upperFirst } from '../../util/helpers'\n\n// no xs\nconst breakpoints = ['sm', 'md', 'lg', 'xl']\n\nconst ALIGNMENT = ['start', 'end', 'center']\n\nfunction makeProps (prefix: string, def: () => PropOptions) {\n return breakpoints.reduce((props, val) => {\n props[prefix + upperFirst(val)] = def()\n return props\n }, {} as Dictionary)\n}\n\nconst alignValidator = (str: any) => [...ALIGNMENT, 'baseline', 'stretch'].includes(str)\nconst alignProps = makeProps('align', () => ({\n type: String,\n default: null,\n validator: alignValidator,\n}))\n\nconst justifyValidator = (str: any) => [...ALIGNMENT, 'space-between', 'space-around'].includes(str)\nconst justifyProps = makeProps('justify', () => ({\n type: String,\n default: null,\n validator: justifyValidator,\n}))\n\nconst alignContentValidator = (str: any) => [...ALIGNMENT, 'space-between', 'space-around', 'stretch'].includes(str)\nconst alignContentProps = makeProps('alignContent', () => ({\n type: String,\n default: null,\n validator: alignContentValidator,\n}))\n\nconst propMap = {\n align: Object.keys(alignProps),\n justify: Object.keys(justifyProps),\n alignContent: Object.keys(alignContentProps),\n}\n\nconst classMap = {\n align: 'align',\n justify: 'justify',\n alignContent: 'align-content',\n}\n\nfunction breakpointClass (type: keyof typeof propMap, prop: string, val: string) {\n let className = classMap[type]\n if (val == null) {\n return undefined\n }\n if (prop) {\n // alignSm -> Sm\n const breakpoint = prop.replace(type, '')\n className += `-${breakpoint}`\n }\n // .align-items-sm-center\n className += `-${val}`\n return className.toLowerCase()\n}\n\nconst cache = new Map()\n\nexport default Vue.extend({\n name: 'v-row',\n functional: true,\n props: {\n tag: {\n type: String,\n default: 'div',\n },\n dense: Boolean,\n noGutters: Boolean,\n align: {\n type: String,\n default: null,\n validator: alignValidator,\n },\n ...alignProps,\n justify: {\n type: String,\n default: null,\n validator: justifyValidator,\n },\n ...justifyProps,\n alignContent: {\n type: String,\n default: null,\n validator: alignContentValidator,\n },\n ...alignContentProps,\n },\n render (h, { props, data, children }) {\n // Super-fast memoization based on props, 5x faster than JSON.stringify\n let cacheKey = ''\n for (const prop in props) {\n cacheKey += String((props as any)[prop])\n }\n let classList = cache.get(cacheKey)\n\n if (!classList) {\n classList = []\n // Loop through `align`, `justify`, `alignContent` breakpoint props\n let type: keyof typeof propMap\n for (type in propMap) {\n propMap[type].forEach(prop => {\n const value: string = (props as any)[prop]\n const className = breakpointClass(type, prop, value)\n if (className) classList!.push(className)\n })\n }\n\n classList.push({\n 'no-gutters': props.noGutters,\n 'row--dense': props.dense,\n [`align-${props.align}`]: props.align,\n [`justify-${props.justify}`]: props.justify,\n [`align-content-${props.alignContent}`]: props.alignContent,\n })\n\n cache.set(cacheKey, classList)\n }\n\n return h(\n props.tag,\n mergeData(data, {\n staticClass: 'row',\n class: classList,\n }),\n children\n )\n },\n})\n","'use strict';\nvar $ = require('../internals/export');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar toLength = require('../internals/to-length');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\nvar IS_PURE = require('../internals/is-pure');\n\n// eslint-disable-next-line es/no-string-prototype-endswith -- safe\nvar $endsWith = ''.endsWith;\nvar min = Math.min;\n\nvar CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');\n// https://github.com/zloirock/core-js/pull/702\nvar MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {\n var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');\n return descriptor && !descriptor.writable;\n}();\n\n// `String.prototype.endsWith` method\n// https://tc39.es/ecma262/#sec-string.prototype.endswith\n$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = String(requireObjectCoercible(this));\n notARegExp(searchString);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n","import './VResponsive.sass'\n\n// Mixins\nimport Measurable, { NumberOrNumberString } from '../../mixins/measurable'\n\n// Types\nimport { VNode } from 'vue'\n\n// Utils\nimport mixins from '../../util/mixins'\n\n/* @vue/component */\nexport default mixins(Measurable).extend({\n name: 'v-responsive',\n\n props: {\n aspectRatio: [String, Number] as NumberOrNumberString,\n contentClass: String,\n },\n\n computed: {\n computedAspectRatio (): number {\n return Number(this.aspectRatio)\n },\n aspectStyle (): object | undefined {\n return this.computedAspectRatio\n ? { paddingBottom: (1 / this.computedAspectRatio) * 100 + '%' }\n : undefined\n },\n __cachedSizer (): VNode | [] {\n if (!this.aspectStyle) return []\n\n return this.$createElement('div', {\n style: this.aspectStyle,\n staticClass: 'v-responsive__sizer',\n })\n },\n },\n\n methods: {\n genContent (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-responsive__content',\n class: this.contentClass,\n }, this.$slots.default)\n },\n },\n\n render (h): VNode {\n return h('div', {\n staticClass: 'v-responsive',\n style: this.measurableStyles,\n on: this.$listeners,\n }, [\n this.__cachedSizer,\n this.genContent(),\n ])\n },\n})\n","import VResponsive from './VResponsive'\n\nexport { VResponsive }\nexport default VResponsive\n","// Styles\nimport './VImg.sass'\n\n// Directives\nimport intersect from '../../directives/intersect'\n\n// Types\nimport { VNode } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\n// Components\nimport VResponsive from '../VResponsive'\n\n// Mixins\nimport Themeable from '../../mixins/themeable'\n\n// Utils\nimport mixins from '../../util/mixins'\nimport mergeData from '../../util/mergeData'\nimport { consoleWarn } from '../../util/console'\n\n// not intended for public use, this is passed in by vuetify-loader\nexport interface srcObject {\n src: string\n srcset?: string\n lazySrc: string\n aspect: number\n}\n\nconst hasIntersect = typeof window !== 'undefined' && 'IntersectionObserver' in window\n\n/* @vue/component */\nexport default mixins(\n VResponsive,\n Themeable,\n).extend({\n name: 'v-img',\n\n directives: { intersect },\n\n props: {\n alt: String,\n contain: Boolean,\n eager: Boolean,\n gradient: String,\n lazySrc: String,\n options: {\n type: Object,\n // For more information on types, navigate to:\n // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\n default: () => ({\n root: undefined,\n rootMargin: undefined,\n threshold: undefined,\n }),\n } as PropValidator,\n position: {\n type: String,\n default: 'center center',\n },\n sizes: String,\n src: {\n type: [String, Object],\n default: '',\n } as PropValidator,\n srcset: String,\n transition: {\n type: [Boolean, String],\n default: 'fade-transition',\n },\n },\n\n data () {\n return {\n currentSrc: '', // Set from srcset\n image: null as HTMLImageElement | null,\n isLoading: true,\n calculatedAspectRatio: undefined as number | undefined,\n naturalWidth: undefined as number | undefined,\n hasError: false,\n }\n },\n\n computed: {\n computedAspectRatio (): number {\n return Number(this.normalisedSrc.aspect || this.calculatedAspectRatio)\n },\n normalisedSrc (): srcObject {\n return this.src && typeof this.src === 'object'\n ? {\n src: this.src.src,\n srcset: this.srcset || this.src.srcset,\n lazySrc: this.lazySrc || this.src.lazySrc,\n aspect: Number(this.aspectRatio || this.src.aspect),\n } : {\n src: this.src,\n srcset: this.srcset,\n lazySrc: this.lazySrc,\n aspect: Number(this.aspectRatio || 0),\n }\n },\n __cachedImage (): VNode | [] {\n if (!(this.normalisedSrc.src || this.normalisedSrc.lazySrc || this.gradient)) return []\n\n const backgroundImage: string[] = []\n const src = this.isLoading ? this.normalisedSrc.lazySrc : this.currentSrc\n\n if (this.gradient) backgroundImage.push(`linear-gradient(${this.gradient})`)\n if (src) backgroundImage.push(`url(\"${src}\")`)\n\n const image = this.$createElement('div', {\n staticClass: 'v-image__image',\n class: {\n 'v-image__image--preload': this.isLoading,\n 'v-image__image--contain': this.contain,\n 'v-image__image--cover': !this.contain,\n },\n style: {\n backgroundImage: backgroundImage.join(', '),\n backgroundPosition: this.position,\n },\n key: +this.isLoading,\n })\n\n /* istanbul ignore if */\n if (!this.transition) return image\n\n return this.$createElement('transition', {\n attrs: {\n name: this.transition,\n mode: 'in-out',\n },\n }, [image])\n },\n },\n\n watch: {\n src () {\n // Force re-init when src changes\n if (!this.isLoading) this.init(undefined, undefined, true)\n else this.loadImage()\n },\n '$vuetify.breakpoint.width': 'getSrc',\n },\n\n mounted () {\n this.init()\n },\n\n methods: {\n init (\n entries?: IntersectionObserverEntry[],\n observer?: IntersectionObserver,\n isIntersecting?: boolean\n ) {\n // If the current browser supports the intersection\n // observer api, the image is not observable, and\n // the eager prop isn't being used, do not load\n if (\n hasIntersect &&\n !isIntersecting &&\n !this.eager\n ) return\n\n if (this.normalisedSrc.lazySrc) {\n const lazyImg = new Image()\n lazyImg.src = this.normalisedSrc.lazySrc\n this.pollForSize(lazyImg, null)\n }\n /* istanbul ignore else */\n if (this.normalisedSrc.src) this.loadImage()\n },\n onLoad () {\n this.getSrc()\n this.isLoading = false\n this.$emit('load', this.src)\n\n if (\n this.image &&\n (this.normalisedSrc.src.endsWith('.svg') || this.normalisedSrc.src.startsWith('data:image/svg+xml'))\n ) {\n if (this.image.naturalHeight && this.image.naturalWidth) {\n this.naturalWidth = this.image.naturalWidth\n this.calculatedAspectRatio = this.image.naturalWidth / this.image.naturalHeight\n } else {\n this.calculatedAspectRatio = 1\n }\n }\n },\n onError () {\n this.hasError = true\n this.$emit('error', this.src)\n },\n getSrc () {\n /* istanbul ignore else */\n if (this.image) this.currentSrc = this.image.currentSrc || this.image.src\n },\n loadImage () {\n const image = new Image()\n this.image = image\n\n image.onload = () => {\n /* istanbul ignore if */\n if (image.decode) {\n image.decode().catch((err: DOMException) => {\n consoleWarn(\n `Failed to decode image, trying to render anyway\\n\\n` +\n `src: ${this.normalisedSrc.src}` +\n (err.message ? `\\nOriginal error: ${err.message}` : ''),\n this\n )\n }).then(this.onLoad)\n } else {\n this.onLoad()\n }\n }\n image.onerror = this.onError\n\n this.hasError = false\n image.src = this.normalisedSrc.src\n this.sizes && (image.sizes = this.sizes)\n this.normalisedSrc.srcset && (image.srcset = this.normalisedSrc.srcset)\n\n this.aspectRatio || this.pollForSize(image)\n this.getSrc()\n },\n pollForSize (img: HTMLImageElement, timeout: number | null = 100) {\n const poll = () => {\n const { naturalHeight, naturalWidth } = img\n\n if (naturalHeight || naturalWidth) {\n this.naturalWidth = naturalWidth\n this.calculatedAspectRatio = naturalWidth / naturalHeight\n } else if (!img.complete && this.isLoading && !this.hasError && timeout != null) {\n setTimeout(poll, timeout)\n }\n }\n\n poll()\n },\n genContent () {\n const content: VNode = VResponsive.options.methods.genContent.call(this)\n if (this.naturalWidth) {\n this._b(content.data!, 'div', {\n style: { width: `${this.naturalWidth}px` },\n })\n }\n\n return content\n },\n __genPlaceholder (): VNode | void {\n if (this.$slots.placeholder) {\n const placeholder = this.isLoading\n ? [this.$createElement('div', {\n staticClass: 'v-image__placeholder',\n }, this.$slots.placeholder)]\n : []\n\n if (!this.transition) return placeholder[0]\n\n return this.$createElement('transition', {\n props: {\n appear: true,\n name: this.transition,\n },\n }, placeholder)\n }\n },\n },\n\n render (h): VNode {\n const node = VResponsive.options.render.call(this, h)\n\n const data = mergeData(node.data!, {\n staticClass: 'v-image',\n attrs: {\n 'aria-label': this.alt,\n role: this.alt ? 'img' : undefined,\n },\n class: this.themeClasses,\n // Only load intersect directive if it\n // will work in the current browser.\n directives: hasIntersect\n ? [{\n name: 'intersect',\n modifiers: { once: true },\n value: {\n handler: this.init,\n options: this.options,\n },\n }]\n : undefined,\n })\n\n node.children = [\n this.__cachedSizer,\n this.__cachedImage,\n this.__genPlaceholder(),\n this.genContent(),\n ] as VNode[]\n\n return h(node.tag, data, node.children)\n },\n})\n"],"sourceRoot":""}