.',
+ el.rawAttrsMap['style']
+ );
+ }
+ }
+ el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
+ }
+
+ var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
+ if (styleBinding) {
+ el.styleBinding = styleBinding;
+ }
+ }
+
+ function genData$1 (el) {
+ var data = '';
+ if (el.staticStyle) {
+ data += "staticStyle:" + (el.staticStyle) + ",";
+ }
+ if (el.styleBinding) {
+ data += "style:(" + (el.styleBinding) + "),";
+ }
+ return data
+ }
+
+ var style$1 = {
+ staticKeys: ['staticStyle'],
+ transformNode: transformNode$1,
+ genData: genData$1
+ };
+
+ /* */
+
+ var decoder;
+
+ var he = {
+ decode: function decode (html) {
+ decoder = decoder || document.createElement('div');
+ decoder.innerHTML = html;
+ return decoder.textContent
+ }
+ };
+
+ /* */
+
+ var isUnaryTag = makeMap(
+ 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
+ 'link,meta,param,source,track,wbr'
+ );
+
+ // Elements that you can, intentionally, leave open
+ // (and which close themselves)
+ var canBeLeftOpenTag = makeMap(
+ 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
+ );
+
+ // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
+ // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
+ var isNonPhrasingTag = makeMap(
+ 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
+ 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
+ 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
+ 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
+ 'title,tr,track'
+ );
+
+ /**
+ * Not type-checking this file because it's mostly vendor code.
+ */
+
+ // Regular Expressions for parsing tags and attributes
+ var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
+ var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
+ var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
+ var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
+ var startTagOpen = new RegExp(("^<" + qnameCapture));
+ var startTagClose = /^\s*(\/?)>/;
+ var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
+ var doctype = /^]+>/i;
+ // #7298: escape - to avoid being passed as HTML comment when inlined in page
+ var comment = /^',
+ '"': '"',
+ '&': '&',
+ '
': '\n',
+ ' ': '\t',
+ ''': "'"
+ };
+ var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
+ var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
+
+ // #5992
+ var isIgnoreNewlineTag = makeMap('pre,textarea', true);
+ var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
+
+ function decodeAttr (value, shouldDecodeNewlines) {
+ var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
+ return value.replace(re, function (match) { return decodingMap[match]; })
+ }
+
+ function parseHTML (html, options) {
+ var stack = [];
+ var expectHTML = options.expectHTML;
+ var isUnaryTag$$1 = options.isUnaryTag || no;
+ var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
+ var index = 0;
+ var last, lastTag;
+ while (html) {
+ last = html;
+ // Make sure we're not in a plaintext content element like script/style
+ if (!lastTag || !isPlainTextElement(lastTag)) {
+ var textEnd = html.indexOf('<');
+ if (textEnd === 0) {
+ // Comment:
+ if (comment.test(html)) {
+ var commentEnd = html.indexOf('-->');
+
+ if (commentEnd >= 0) {
+ if (options.shouldKeepComment) {
+ options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
+ }
+ advance(commentEnd + 3);
+ continue
+ }
+ }
+
+ // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
+ if (conditionalComment.test(html)) {
+ var conditionalEnd = html.indexOf(']>');
+
+ if (conditionalEnd >= 0) {
+ advance(conditionalEnd + 2);
+ continue
+ }
+ }
+
+ // Doctype:
+ var doctypeMatch = html.match(doctype);
+ if (doctypeMatch) {
+ advance(doctypeMatch[0].length);
+ continue
+ }
+
+ // End tag:
+ var endTagMatch = html.match(endTag);
+ if (endTagMatch) {
+ var curIndex = index;
+ advance(endTagMatch[0].length);
+ parseEndTag(endTagMatch[1], curIndex, index);
+ continue
+ }
+
+ // Start tag:
+ var startTagMatch = parseStartTag();
+ if (startTagMatch) {
+ handleStartTag(startTagMatch);
+ if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
+ advance(1);
+ }
+ continue
+ }
+ }
+
+ var text = (void 0), rest = (void 0), next = (void 0);
+ if (textEnd >= 0) {
+ rest = html.slice(textEnd);
+ while (
+ !endTag.test(rest) &&
+ !startTagOpen.test(rest) &&
+ !comment.test(rest) &&
+ !conditionalComment.test(rest)
+ ) {
+ // < in plain text, be forgiving and treat it as text
+ next = rest.indexOf('<', 1);
+ if (next < 0) { break }
+ textEnd += next;
+ rest = html.slice(textEnd);
+ }
+ text = html.substring(0, textEnd);
+ }
+
+ if (textEnd < 0) {
+ text = html;
+ }
+
+ if (text) {
+ advance(text.length);
+ }
+
+ if (options.chars && text) {
+ options.chars(text, index - text.length, index);
+ }
+ } else {
+ var endTagLength = 0;
+ var stackedTag = lastTag.toLowerCase();
+ var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(' + stackedTag + '[^>]*>)', 'i'));
+ var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
+ endTagLength = endTag.length;
+ if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
+ text = text
+ .replace(//g, '$1') // #7298
+ .replace(//g, '$1');
+ }
+ if (shouldIgnoreFirstNewline(stackedTag, text)) {
+ text = text.slice(1);
+ }
+ if (options.chars) {
+ options.chars(text);
+ }
+ return ''
+ });
+ index += html.length - rest$1.length;
+ html = rest$1;
+ parseEndTag(stackedTag, index - endTagLength, index);
+ }
+
+ if (html === last) {
+ options.chars && options.chars(html);
+ if (!stack.length && options.warn) {
+ options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
+ }
+ break
+ }
+ }
+
+ // Clean up any remaining tags
+ parseEndTag();
+
+ function advance (n) {
+ index += n;
+ html = html.substring(n);
+ }
+
+ function parseStartTag () {
+ var start = html.match(startTagOpen);
+ if (start) {
+ var match = {
+ tagName: start[1],
+ attrs: [],
+ start: index
+ };
+ advance(start[0].length);
+ var end, attr;
+ while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
+ attr.start = index;
+ advance(attr[0].length);
+ attr.end = index;
+ match.attrs.push(attr);
+ }
+ if (end) {
+ match.unarySlash = end[1];
+ advance(end[0].length);
+ match.end = index;
+ return match
+ }
+ }
+ }
+
+ function handleStartTag (match) {
+ var tagName = match.tagName;
+ var unarySlash = match.unarySlash;
+
+ if (expectHTML) {
+ if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
+ parseEndTag(lastTag);
+ }
+ if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
+ parseEndTag(tagName);
+ }
+ }
+
+ var unary = isUnaryTag$$1(tagName) || !!unarySlash;
+
+ var l = match.attrs.length;
+ var attrs = new Array(l);
+ for (var i = 0; i < l; i++) {
+ var args = match.attrs[i];
+ var value = args[3] || args[4] || args[5] || '';
+ var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
+ ? options.shouldDecodeNewlinesForHref
+ : options.shouldDecodeNewlines;
+ attrs[i] = {
+ name: args[1],
+ value: decodeAttr(value, shouldDecodeNewlines)
+ };
+ if (options.outputSourceRange) {
+ attrs[i].start = args.start + args[0].match(/^\s*/).length;
+ attrs[i].end = args.end;
+ }
+ }
+
+ if (!unary) {
+ stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
+ lastTag = tagName;
+ }
+
+ if (options.start) {
+ options.start(tagName, attrs, unary, match.start, match.end);
+ }
+ }
+
+ function parseEndTag (tagName, start, end) {
+ var pos, lowerCasedTagName;
+ if (start == null) { start = index; }
+ if (end == null) { end = index; }
+
+ // Find the closest opened tag of the same type
+ if (tagName) {
+ lowerCasedTagName = tagName.toLowerCase();
+ for (pos = stack.length - 1; pos >= 0; pos--) {
+ if (stack[pos].lowerCasedTag === lowerCasedTagName) {
+ break
+ }
+ }
+ } else {
+ // If no tag name is provided, clean shop
+ pos = 0;
+ }
+
+ if (pos >= 0) {
+ // Close all the open elements, up the stack
+ for (var i = stack.length - 1; i >= pos; i--) {
+ if (i > pos || !tagName &&
+ options.warn
+ ) {
+ options.warn(
+ ("tag <" + (stack[i].tag) + "> has no matching end tag."),
+ { start: stack[i].start, end: stack[i].end }
+ );
+ }
+ if (options.end) {
+ options.end(stack[i].tag, start, end);
+ }
+ }
+
+ // Remove the open elements from the stack
+ stack.length = pos;
+ lastTag = pos && stack[pos - 1].tag;
+ } else if (lowerCasedTagName === 'br') {
+ if (options.start) {
+ options.start(tagName, [], true, start, end);
+ }
+ } else if (lowerCasedTagName === 'p') {
+ if (options.start) {
+ options.start(tagName, [], false, start, end);
+ }
+ if (options.end) {
+ options.end(tagName, start, end);
+ }
+ }
+ }
+ }
+
+ /* */
+
+ var onRE = /^@|^v-on:/;
+ var dirRE = /^v-|^@|^:|^#/;
+ var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
+ var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
+ var stripParensRE = /^\(|\)$/g;
+ var dynamicArgRE = /^\[.*\]$/;
+
+ var argRE = /:(.*)$/;
+ var bindRE = /^:|^\.|^v-bind:/;
+ var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
+
+ var slotRE = /^v-slot(:|$)|^#/;
+
+ var lineBreakRE = /[\r\n]/;
+ var whitespaceRE$1 = /[ \f\t\r\n]+/g;
+
+ var invalidAttributeRE = /[\s"'<>\/=]/;
+
+ var decodeHTMLCached = cached(he.decode);
+
+ var emptySlotScopeToken = "_empty_";
+
+ // configurable state
+ var warn$2;
+ var delimiters;
+ var transforms;
+ var preTransforms;
+ var postTransforms;
+ var platformIsPreTag;
+ var platformMustUseProp;
+ var platformGetTagNamespace;
+ var maybeComponent;
+
+ function createASTElement (
+ tag,
+ attrs,
+ parent
+ ) {
+ return {
+ type: 1,
+ tag: tag,
+ attrsList: attrs,
+ attrsMap: makeAttrsMap(attrs),
+ rawAttrsMap: {},
+ parent: parent,
+ children: []
+ }
+ }
+
+ /**
+ * Convert HTML string to AST.
+ */
+ function parse (
+ template,
+ options
+ ) {
+ warn$2 = options.warn || baseWarn;
+
+ platformIsPreTag = options.isPreTag || no;
+ platformMustUseProp = options.mustUseProp || no;
+ platformGetTagNamespace = options.getTagNamespace || no;
+ var isReservedTag = options.isReservedTag || no;
+ maybeComponent = function (el) { return !!(
+ el.component ||
+ el.attrsMap[':is'] ||
+ el.attrsMap['v-bind:is'] ||
+ !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag))
+ ); };
+ transforms = pluckModuleFunction(options.modules, 'transformNode');
+ preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
+ postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
+
+ delimiters = options.delimiters;
+
+ var stack = [];
+ var preserveWhitespace = options.preserveWhitespace !== false;
+ var whitespaceOption = options.whitespace;
+ var root;
+ var currentParent;
+ var inVPre = false;
+ var inPre = false;
+ var warned = false;
+
+ function warnOnce (msg, range) {
+ if (!warned) {
+ warned = true;
+ warn$2(msg, range);
+ }
+ }
+
+ function closeElement (element) {
+ trimEndingWhitespace(element);
+ if (!inVPre && !element.processed) {
+ element = processElement(element, options);
+ }
+ // tree management
+ if (!stack.length && element !== root) {
+ // allow root elements with v-if, v-else-if and v-else
+ if (root.if && (element.elseif || element.else)) {
+ {
+ checkRootConstraints(element);
+ }
+ addIfCondition(root, {
+ exp: element.elseif,
+ block: element
+ });
+ } else {
+ warnOnce(
+ "Component template should contain exactly one root element. " +
+ "If you are using v-if on multiple elements, " +
+ "use v-else-if to chain them instead.",
+ { start: element.start }
+ );
+ }
+ }
+ if (currentParent && !element.forbidden) {
+ if (element.elseif || element.else) {
+ processIfConditions(element, currentParent);
+ } else {
+ if (element.slotScope) {
+ // scoped slot
+ // keep it in the children list so that v-else(-if) conditions can
+ // find it as the prev node.
+ var name = element.slotTarget || '"default"'
+ ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
+ }
+ currentParent.children.push(element);
+ element.parent = currentParent;
+ }
+ }
+
+ // final children cleanup
+ // filter out scoped slots
+ element.children = element.children.filter(function (c) { return !(c).slotScope; });
+ // remove trailing whitespace node again
+ trimEndingWhitespace(element);
+
+ // check pre state
+ if (element.pre) {
+ inVPre = false;
+ }
+ if (platformIsPreTag(element.tag)) {
+ inPre = false;
+ }
+ // apply post-transforms
+ for (var i = 0; i < postTransforms.length; i++) {
+ postTransforms[i](element, options);
+ }
+ }
+
+ function trimEndingWhitespace (el) {
+ // remove trailing whitespace node
+ if (!inPre) {
+ var lastNode;
+ while (
+ (lastNode = el.children[el.children.length - 1]) &&
+ lastNode.type === 3 &&
+ lastNode.text === ' '
+ ) {
+ el.children.pop();
+ }
+ }
+ }
+
+ function checkRootConstraints (el) {
+ if (el.tag === 'slot' || el.tag === 'template') {
+ warnOnce(
+ "Cannot use <" + (el.tag) + "> as component root element because it may " +
+ 'contain multiple nodes.',
+ { start: el.start }
+ );
+ }
+ if (el.attrsMap.hasOwnProperty('v-for')) {
+ warnOnce(
+ 'Cannot use v-for on stateful component root element because ' +
+ 'it renders multiple elements.',
+ el.rawAttrsMap['v-for']
+ );
+ }
+ }
+
+ parseHTML(template, {
+ warn: warn$2,
+ expectHTML: options.expectHTML,
+ isUnaryTag: options.isUnaryTag,
+ canBeLeftOpenTag: options.canBeLeftOpenTag,
+ shouldDecodeNewlines: options.shouldDecodeNewlines,
+ shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
+ shouldKeepComment: options.comments,
+ outputSourceRange: options.outputSourceRange,
+ start: function start (tag, attrs, unary, start$1, end) {
+ // check namespace.
+ // inherit parent ns if there is one
+ var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
+
+ // handle IE svg bug
+ /* istanbul ignore if */
+ if (isIE && ns === 'svg') {
+ attrs = guardIESVGBug(attrs);
+ }
+
+ var element = createASTElement(tag, attrs, currentParent);
+ if (ns) {
+ element.ns = ns;
+ }
+
+ {
+ if (options.outputSourceRange) {
+ element.start = start$1;
+ element.end = end;
+ element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
+ cumulated[attr.name] = attr;
+ return cumulated
+ }, {});
+ }
+ attrs.forEach(function (attr) {
+ if (invalidAttributeRE.test(attr.name)) {
+ warn$2(
+ "Invalid dynamic argument expression: attribute names cannot contain " +
+ "spaces, quotes, <, >, / or =.",
+ {
+ start: attr.start + attr.name.indexOf("["),
+ end: attr.start + attr.name.length
+ }
+ );
+ }
+ });
+ }
+
+ if (isForbiddenTag(element) && !isServerRendering()) {
+ element.forbidden = true;
+ warn$2(
+ 'Templates should only be responsible for mapping the state to the ' +
+ 'UI. Avoid placing tags with side-effects in your templates, such as ' +
+ "<" + tag + ">" + ', as they will not be parsed.',
+ { start: element.start }
+ );
+ }
+
+ // apply pre-transforms
+ for (var i = 0; i < preTransforms.length; i++) {
+ element = preTransforms[i](element, options) || element;
+ }
+
+ if (!inVPre) {
+ processPre(element);
+ if (element.pre) {
+ inVPre = true;
+ }
+ }
+ if (platformIsPreTag(element.tag)) {
+ inPre = true;
+ }
+ if (inVPre) {
+ processRawAttrs(element);
+ } else if (!element.processed) {
+ // structural directives
+ processFor(element);
+ processIf(element);
+ processOnce(element);
+ }
+
+ if (!root) {
+ root = element;
+ {
+ checkRootConstraints(root);
+ }
+ }
+
+ if (!unary) {
+ currentParent = element;
+ stack.push(element);
+ } else {
+ closeElement(element);
+ }
+ },
+
+ end: function end (tag, start, end$1) {
+ var element = stack[stack.length - 1];
+ // pop stack
+ stack.length -= 1;
+ currentParent = stack[stack.length - 1];
+ if (options.outputSourceRange) {
+ element.end = end$1;
+ }
+ closeElement(element);
+ },
+
+ chars: function chars (text, start, end) {
+ if (!currentParent) {
+ {
+ if (text === template) {
+ warnOnce(
+ 'Component template requires a root element, rather than just text.',
+ { start: start }
+ );
+ } else if ((text = text.trim())) {
+ warnOnce(
+ ("text \"" + text + "\" outside root element will be ignored."),
+ { start: start }
+ );
+ }
+ }
+ return
+ }
+ // IE textarea placeholder bug
+ /* istanbul ignore if */
+ if (isIE &&
+ currentParent.tag === 'textarea' &&
+ currentParent.attrsMap.placeholder === text
+ ) {
+ return
+ }
+ var children = currentParent.children;
+ if (inPre || text.trim()) {
+ text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
+ } else if (!children.length) {
+ // remove the whitespace-only node right after an opening tag
+ text = '';
+ } else if (whitespaceOption) {
+ if (whitespaceOption === 'condense') {
+ // in condense mode, remove the whitespace node if it contains
+ // line break, otherwise condense to a single space
+ text = lineBreakRE.test(text) ? '' : ' ';
+ } else {
+ text = ' ';
+ }
+ } else {
+ text = preserveWhitespace ? ' ' : '';
+ }
+ if (text) {
+ if (!inPre && whitespaceOption === 'condense') {
+ // condense consecutive whitespaces into single space
+ text = text.replace(whitespaceRE$1, ' ');
+ }
+ var res;
+ var child;
+ if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
+ child = {
+ type: 2,
+ expression: res.expression,
+ tokens: res.tokens,
+ text: text
+ };
+ } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
+ child = {
+ type: 3,
+ text: text
+ };
+ }
+ if (child) {
+ if (options.outputSourceRange) {
+ child.start = start;
+ child.end = end;
+ }
+ children.push(child);
+ }
+ }
+ },
+ comment: function comment (text, start, end) {
+ // adding anything as a sibling to the root node is forbidden
+ // comments should still be allowed, but ignored
+ if (currentParent) {
+ var child = {
+ type: 3,
+ text: text,
+ isComment: true
+ };
+ if (options.outputSourceRange) {
+ child.start = start;
+ child.end = end;
+ }
+ currentParent.children.push(child);
+ }
+ }
+ });
+ return root
+ }
+
+ function processPre (el) {
+ if (getAndRemoveAttr(el, 'v-pre') != null) {
+ el.pre = true;
+ }
+ }
+
+ function processRawAttrs (el) {
+ var list = el.attrsList;
+ var len = list.length;
+ if (len) {
+ var attrs = el.attrs = new Array(len);
+ for (var i = 0; i < len; i++) {
+ attrs[i] = {
+ name: list[i].name,
+ value: JSON.stringify(list[i].value)
+ };
+ if (list[i].start != null) {
+ attrs[i].start = list[i].start;
+ attrs[i].end = list[i].end;
+ }
+ }
+ } else if (!el.pre) {
+ // non root node in pre blocks with no attributes
+ el.plain = true;
+ }
+ }
+
+ function processElement (
+ element,
+ options
+ ) {
+ processKey(element);
+
+ // determine whether this is a plain element after
+ // removing structural attributes
+ element.plain = (
+ !element.key &&
+ !element.scopedSlots &&
+ !element.attrsList.length
+ );
+
+ processRef(element);
+ processSlotContent(element);
+ processSlotOutlet(element);
+ processComponent(element);
+ for (var i = 0; i < transforms.length; i++) {
+ element = transforms[i](element, options) || element;
+ }
+ processAttrs(element);
+ return element
+ }
+
+ function processKey (el) {
+ var exp = getBindingAttr(el, 'key');
+ if (exp) {
+ {
+ if (el.tag === 'template') {
+ warn$2(
+ "
cannot be keyed. Place the key on real elements instead.",
+ getRawBindingAttr(el, 'key')
+ );
+ }
+ if (el.for) {
+ var iterator = el.iterator2 || el.iterator1;
+ var parent = el.parent;
+ if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
+ warn$2(
+ "Do not use v-for index as key on children, " +
+ "this is the same as not using keys.",
+ getRawBindingAttr(el, 'key'),
+ true /* tip */
+ );
+ }
+ }
+ }
+ el.key = exp;
+ }
+ }
+
+ function processRef (el) {
+ var ref = getBindingAttr(el, 'ref');
+ if (ref) {
+ el.ref = ref;
+ el.refInFor = checkInFor(el);
+ }
+ }
+
+ function processFor (el) {
+ var exp;
+ if ((exp = getAndRemoveAttr(el, 'v-for'))) {
+ var res = parseFor(exp);
+ if (res) {
+ extend(el, res);
+ } else {
+ warn$2(
+ ("Invalid v-for expression: " + exp),
+ el.rawAttrsMap['v-for']
+ );
+ }
+ }
+ }
+
+
+
+ function parseFor (exp) {
+ var inMatch = exp.match(forAliasRE);
+ if (!inMatch) { return }
+ var res = {};
+ res.for = inMatch[2].trim();
+ var alias = inMatch[1].trim().replace(stripParensRE, '');
+ var iteratorMatch = alias.match(forIteratorRE);
+ if (iteratorMatch) {
+ res.alias = alias.replace(forIteratorRE, '').trim();
+ res.iterator1 = iteratorMatch[1].trim();
+ if (iteratorMatch[2]) {
+ res.iterator2 = iteratorMatch[2].trim();
+ }
+ } else {
+ res.alias = alias;
+ }
+ return res
+ }
+
+ function processIf (el) {
+ var exp = getAndRemoveAttr(el, 'v-if');
+ if (exp) {
+ el.if = exp;
+ addIfCondition(el, {
+ exp: exp,
+ block: el
+ });
+ } else {
+ if (getAndRemoveAttr(el, 'v-else') != null) {
+ el.else = true;
+ }
+ var elseif = getAndRemoveAttr(el, 'v-else-if');
+ if (elseif) {
+ el.elseif = elseif;
+ }
+ }
+ }
+
+ function processIfConditions (el, parent) {
+ var prev = findPrevElement(parent.children);
+ if (prev && prev.if) {
+ addIfCondition(prev, {
+ exp: el.elseif,
+ block: el
+ });
+ } else {
+ warn$2(
+ "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
+ "used on element <" + (el.tag) + "> without corresponding v-if.",
+ el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
+ );
+ }
+ }
+
+ function findPrevElement (children) {
+ var i = children.length;
+ while (i--) {
+ if (children[i].type === 1) {
+ return children[i]
+ } else {
+ if (children[i].text !== ' ') {
+ warn$2(
+ "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
+ "will be ignored.",
+ children[i]
+ );
+ }
+ children.pop();
+ }
+ }
+ }
+
+ function addIfCondition (el, condition) {
+ if (!el.ifConditions) {
+ el.ifConditions = [];
+ }
+ el.ifConditions.push(condition);
+ }
+
+ function processOnce (el) {
+ var once$$1 = getAndRemoveAttr(el, 'v-once');
+ if (once$$1 != null) {
+ el.once = true;
+ }
+ }
+
+ // handle content being passed to a component as slot,
+ // e.g. ,
+ function processSlotContent (el) {
+ var slotScope;
+ if (el.tag === 'template') {
+ slotScope = getAndRemoveAttr(el, 'scope');
+ /* istanbul ignore if */
+ if (slotScope) {
+ warn$2(
+ "the \"scope\" attribute for scoped slots have been deprecated and " +
+ "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
+ "can also be used on plain elements in addition to
to " +
+ "denote scoped slots.",
+ el.rawAttrsMap['scope'],
+ true
+ );
+ }
+ el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
+ } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
+ /* istanbul ignore if */
+ if (el.attrsMap['v-for']) {
+ warn$2(
+ "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
+ "(v-for takes higher priority). Use a wrapper for the " +
+ "scoped slot to make it clearer.",
+ el.rawAttrsMap['slot-scope'],
+ true
+ );
+ }
+ el.slotScope = slotScope;
+ }
+
+ // slot="xxx"
+ var slotTarget = getBindingAttr(el, 'slot');
+ if (slotTarget) {
+ el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
+ el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
+ // preserve slot as an attribute for native shadow DOM compat
+ // only for non-scoped slots.
+ if (el.tag !== 'template' && !el.slotScope) {
+ addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
+ }
+ }
+
+ // 2.6 v-slot syntax
+ {
+ if (el.tag === 'template') {
+ // v-slot on
+ var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
+ if (slotBinding) {
+ {
+ if (el.slotTarget || el.slotScope) {
+ warn$2(
+ "Unexpected mixed usage of different slot syntaxes.",
+ el
+ );
+ }
+ if (el.parent && !maybeComponent(el.parent)) {
+ warn$2(
+ " can only appear at the root level inside " +
+ "the receiving component",
+ el
+ );
+ }
+ }
+ var ref = getSlotName(slotBinding);
+ var name = ref.name;
+ var dynamic = ref.dynamic;
+ el.slotTarget = name;
+ el.slotTargetDynamic = dynamic;
+ el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
+ }
+ } else {
+ // v-slot on component, denotes default slot
+ var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
+ if (slotBinding$1) {
+ {
+ if (!maybeComponent(el)) {
+ warn$2(
+ "v-slot can only be used on components or .",
+ slotBinding$1
+ );
+ }
+ if (el.slotScope || el.slotTarget) {
+ warn$2(
+ "Unexpected mixed usage of different slot syntaxes.",
+ el
+ );
+ }
+ if (el.scopedSlots) {
+ warn$2(
+ "To avoid scope ambiguity, the default slot should also use " +
+ " syntax when there are other named slots.",
+ slotBinding$1
+ );
+ }
+ }
+ // add the component's children to its default slot
+ var slots = el.scopedSlots || (el.scopedSlots = {});
+ var ref$1 = getSlotName(slotBinding$1);
+ var name$1 = ref$1.name;
+ var dynamic$1 = ref$1.dynamic;
+ var slotContainer = slots[name$1] = createASTElement('template', [], el);
+ slotContainer.slotTarget = name$1;
+ slotContainer.slotTargetDynamic = dynamic$1;
+ slotContainer.children = el.children.filter(function (c) {
+ if (!c.slotScope) {
+ c.parent = slotContainer;
+ return true
+ }
+ });
+ slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
+ // remove children as they are returned from scopedSlots now
+ el.children = [];
+ // mark el non-plain so data gets generated
+ el.plain = false;
+ }
+ }
+ }
+ }
+
+ function getSlotName (binding) {
+ var name = binding.name.replace(slotRE, '');
+ if (!name) {
+ if (binding.name[0] !== '#') {
+ name = 'default';
+ } else {
+ warn$2(
+ "v-slot shorthand syntax requires a slot name.",
+ binding
+ );
+ }
+ }
+ return dynamicArgRE.test(name)
+ // dynamic [name]
+ ? { name: name.slice(1, -1), dynamic: true }
+ // static name
+ : { name: ("\"" + name + "\""), dynamic: false }
+ }
+
+ // handle outlets
+ function processSlotOutlet (el) {
+ if (el.tag === 'slot') {
+ el.slotName = getBindingAttr(el, 'name');
+ if (el.key) {
+ warn$2(
+ "`key` does not work on because slots are abstract outlets " +
+ "and can possibly expand into multiple elements. " +
+ "Use the key on a wrapping element instead.",
+ getRawBindingAttr(el, 'key')
+ );
+ }
+ }
+ }
+
+ function processComponent (el) {
+ var binding;
+ if ((binding = getBindingAttr(el, 'is'))) {
+ el.component = binding;
+ }
+ if (getAndRemoveAttr(el, 'inline-template') != null) {
+ el.inlineTemplate = true;
+ }
+ }
+
+ function processAttrs (el) {
+ var list = el.attrsList;
+ var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
+ for (i = 0, l = list.length; i < l; i++) {
+ name = rawName = list[i].name;
+ value = list[i].value;
+ if (dirRE.test(name)) {
+ // mark element as dynamic
+ el.hasBindings = true;
+ // modifiers
+ modifiers = parseModifiers(name.replace(dirRE, ''));
+ // support .foo shorthand syntax for the .prop modifier
+ if (modifiers) {
+ name = name.replace(modifierRE, '');
+ }
+ if (bindRE.test(name)) { // v-bind
+ name = name.replace(bindRE, '');
+ value = parseFilters(value);
+ isDynamic = dynamicArgRE.test(name);
+ if (isDynamic) {
+ name = name.slice(1, -1);
+ }
+ if (
+ value.trim().length === 0
+ ) {
+ warn$2(
+ ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
+ );
+ }
+ if (modifiers) {
+ if (modifiers.prop && !isDynamic) {
+ name = camelize(name);
+ if (name === 'innerHtml') { name = 'innerHTML'; }
+ }
+ if (modifiers.camel && !isDynamic) {
+ name = camelize(name);
+ }
+ if (modifiers.sync) {
+ syncGen = genAssignmentCode(value, "$event");
+ if (!isDynamic) {
+ addHandler(
+ el,
+ ("update:" + (camelize(name))),
+ syncGen,
+ null,
+ false,
+ warn$2,
+ list[i]
+ );
+ if (hyphenate(name) !== camelize(name)) {
+ addHandler(
+ el,
+ ("update:" + (hyphenate(name))),
+ syncGen,
+ null,
+ false,
+ warn$2,
+ list[i]
+ );
+ }
+ } else {
+ // handler w/ dynamic event name
+ addHandler(
+ el,
+ ("\"update:\"+(" + name + ")"),
+ syncGen,
+ null,
+ false,
+ warn$2,
+ list[i],
+ true // dynamic
+ );
+ }
+ }
+ }
+ if ((modifiers && modifiers.prop) || (
+ !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
+ )) {
+ addProp(el, name, value, list[i], isDynamic);
+ } else {
+ addAttr(el, name, value, list[i], isDynamic);
+ }
+ } else if (onRE.test(name)) { // v-on
+ name = name.replace(onRE, '');
+ isDynamic = dynamicArgRE.test(name);
+ if (isDynamic) {
+ name = name.slice(1, -1);
+ }
+ addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
+ } else { // normal directives
+ name = name.replace(dirRE, '');
+ // parse arg
+ var argMatch = name.match(argRE);
+ var arg = argMatch && argMatch[1];
+ isDynamic = false;
+ if (arg) {
+ name = name.slice(0, -(arg.length + 1));
+ if (dynamicArgRE.test(arg)) {
+ arg = arg.slice(1, -1);
+ isDynamic = true;
+ }
+ }
+ addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
+ if (name === 'model') {
+ checkForAliasModel(el, value);
+ }
+ }
+ } else {
+ // literal attribute
+ {
+ var res = parseText(value, delimiters);
+ if (res) {
+ warn$2(
+ name + "=\"" + value + "\": " +
+ 'Interpolation inside attributes has been removed. ' +
+ 'Use v-bind or the colon shorthand instead. For example, ' +
+ 'instead of , use
.',
+ list[i]
+ );
+ }
+ }
+ addAttr(el, name, JSON.stringify(value), list[i]);
+ // #6887 firefox doesn't update muted state if set via attribute
+ // even immediately after element creation
+ if (!el.component &&
+ name === 'muted' &&
+ platformMustUseProp(el.tag, el.attrsMap.type, name)) {
+ addProp(el, name, 'true', list[i]);
+ }
+ }
+ }
+ }
+
+ function checkInFor (el) {
+ var parent = el;
+ while (parent) {
+ if (parent.for !== undefined) {
+ return true
+ }
+ parent = parent.parent;
+ }
+ return false
+ }
+
+ function parseModifiers (name) {
+ var match = name.match(modifierRE);
+ if (match) {
+ var ret = {};
+ match.forEach(function (m) { ret[m.slice(1)] = true; });
+ return ret
+ }
+ }
+
+ function makeAttrsMap (attrs) {
+ var map = {};
+ for (var i = 0, l = attrs.length; i < l; i++) {
+ if (
+ map[attrs[i].name] && !isIE && !isEdge
+ ) {
+ warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
+ }
+ map[attrs[i].name] = attrs[i].value;
+ }
+ return map
+ }
+
+ // for script (e.g. type="x/template") or style, do not decode content
+ function isTextTag (el) {
+ return el.tag === 'script' || el.tag === 'style'
+ }
+
+ function isForbiddenTag (el) {
+ return (
+ el.tag === 'style' ||
+ (el.tag === 'script' && (
+ !el.attrsMap.type ||
+ el.attrsMap.type === 'text/javascript'
+ ))
+ )
+ }
+
+ var ieNSBug = /^xmlns:NS\d+/;
+ var ieNSPrefix = /^NS\d+:/;
+
+ /* istanbul ignore next */
+ function guardIESVGBug (attrs) {
+ var res = [];
+ for (var i = 0; i < attrs.length; i++) {
+ var attr = attrs[i];
+ if (!ieNSBug.test(attr.name)) {
+ attr.name = attr.name.replace(ieNSPrefix, '');
+ res.push(attr);
+ }
+ }
+ return res
+ }
+
+ function checkForAliasModel (el, value) {
+ var _el = el;
+ while (_el) {
+ if (_el.for && _el.alias === value) {
+ warn$2(
+ "<" + (el.tag) + " v-model=\"" + value + "\">: " +
+ "You are binding v-model directly to a v-for iteration alias. " +
+ "This will not be able to modify the v-for source array because " +
+ "writing to the alias is like modifying a function local variable. " +
+ "Consider using an array of objects and use v-model on an object property instead.",
+ el.rawAttrsMap['v-model']
+ );
+ }
+ _el = _el.parent;
+ }
+ }
+
+ /* */
+
+ function preTransformNode (el, options) {
+ if (el.tag === 'input') {
+ var map = el.attrsMap;
+ if (!map['v-model']) {
+ return
+ }
+
+ var typeBinding;
+ if (map[':type'] || map['v-bind:type']) {
+ typeBinding = getBindingAttr(el, 'type');
+ }
+ if (!map.type && !typeBinding && map['v-bind']) {
+ typeBinding = "(" + (map['v-bind']) + ").type";
+ }
+
+ if (typeBinding) {
+ var ifCondition = getAndRemoveAttr(el, 'v-if', true);
+ var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
+ var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
+ var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
+ // 1. checkbox
+ var branch0 = cloneASTElement(el);
+ // process for on the main node
+ processFor(branch0);
+ addRawAttr(branch0, 'type', 'checkbox');
+ processElement(branch0, options);
+ branch0.processed = true; // prevent it from double-processed
+ branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
+ addIfCondition(branch0, {
+ exp: branch0.if,
+ block: branch0
+ });
+ // 2. add radio else-if condition
+ var branch1 = cloneASTElement(el);
+ getAndRemoveAttr(branch1, 'v-for', true);
+ addRawAttr(branch1, 'type', 'radio');
+ processElement(branch1, options);
+ addIfCondition(branch0, {
+ exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
+ block: branch1
+ });
+ // 3. other
+ var branch2 = cloneASTElement(el);
+ getAndRemoveAttr(branch2, 'v-for', true);
+ addRawAttr(branch2, ':type', typeBinding);
+ processElement(branch2, options);
+ addIfCondition(branch0, {
+ exp: ifCondition,
+ block: branch2
+ });
+
+ if (hasElse) {
+ branch0.else = true;
+ } else if (elseIfCondition) {
+ branch0.elseif = elseIfCondition;
+ }
+
+ return branch0
+ }
+ }
+ }
+
+ function cloneASTElement (el) {
+ return createASTElement(el.tag, el.attrsList.slice(), el.parent)
+ }
+
+ var model$1 = {
+ preTransformNode: preTransformNode
+ };
+
+ var modules$1 = [
+ klass$1,
+ style$1,
+ model$1
+ ];
+
+ /* */
+
+ function text (el, dir) {
+ if (dir.value) {
+ addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
+ }
+ }
+
+ /* */
+
+ function html (el, dir) {
+ if (dir.value) {
+ addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
+ }
+ }
+
+ var directives$1 = {
+ model: model,
+ text: text,
+ html: html
+ };
+
+ /* */
+
+ var baseOptions = {
+ expectHTML: true,
+ modules: modules$1,
+ directives: directives$1,
+ isPreTag: isPreTag,
+ isUnaryTag: isUnaryTag,
+ mustUseProp: mustUseProp,
+ canBeLeftOpenTag: canBeLeftOpenTag,
+ isReservedTag: isReservedTag,
+ getTagNamespace: getTagNamespace,
+ staticKeys: genStaticKeys(modules$1)
+ };
+
+ /* */
+
+ var isStaticKey;
+ var isPlatformReservedTag;
+
+ var genStaticKeysCached = cached(genStaticKeys$1);
+
+ /**
+ * Goal of the optimizer: walk the generated template AST tree
+ * and detect sub-trees that are purely static, i.e. parts of
+ * the DOM that never needs to change.
+ *
+ * Once we detect these sub-trees, we can:
+ *
+ * 1. Hoist them into constants, so that we no longer need to
+ * create fresh nodes for them on each re-render;
+ * 2. Completely skip them in the patching process.
+ */
+ function optimize (root, options) {
+ if (!root) { return }
+ isStaticKey = genStaticKeysCached(options.staticKeys || '');
+ isPlatformReservedTag = options.isReservedTag || no;
+ // first pass: mark all non-static nodes.
+ markStatic$1(root);
+ // second pass: mark static roots.
+ markStaticRoots(root, false);
+ }
+
+ function genStaticKeys$1 (keys) {
+ return makeMap(
+ 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
+ (keys ? ',' + keys : '')
+ )
+ }
+
+ function markStatic$1 (node) {
+ node.static = isStatic(node);
+ if (node.type === 1) {
+ // do not make component slot content static. this avoids
+ // 1. components not able to mutate slot nodes
+ // 2. static slot content fails for hot-reloading
+ if (
+ !isPlatformReservedTag(node.tag) &&
+ node.tag !== 'slot' &&
+ node.attrsMap['inline-template'] == null
+ ) {
+ return
+ }
+ for (var i = 0, l = node.children.length; i < l; i++) {
+ var child = node.children[i];
+ markStatic$1(child);
+ if (!child.static) {
+ node.static = false;
+ }
+ }
+ if (node.ifConditions) {
+ for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
+ var block = node.ifConditions[i$1].block;
+ markStatic$1(block);
+ if (!block.static) {
+ node.static = false;
+ }
+ }
+ }
+ }
+ }
+
+ function markStaticRoots (node, isInFor) {
+ if (node.type === 1) {
+ if (node.static || node.once) {
+ node.staticInFor = isInFor;
+ }
+ // For a node to qualify as a static root, it should have children that
+ // are not just static text. Otherwise the cost of hoisting out will
+ // outweigh the benefits and it's better off to just always render it fresh.
+ if (node.static && node.children.length && !(
+ node.children.length === 1 &&
+ node.children[0].type === 3
+ )) {
+ node.staticRoot = true;
+ return
+ } else {
+ node.staticRoot = false;
+ }
+ if (node.children) {
+ for (var i = 0, l = node.children.length; i < l; i++) {
+ markStaticRoots(node.children[i], isInFor || !!node.for);
+ }
+ }
+ if (node.ifConditions) {
+ for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
+ markStaticRoots(node.ifConditions[i$1].block, isInFor);
+ }
+ }
+ }
+ }
+
+ function isStatic (node) {
+ if (node.type === 2) { // expression
+ return false
+ }
+ if (node.type === 3) { // text
+ return true
+ }
+ return !!(node.pre || (
+ !node.hasBindings && // no dynamic bindings
+ !node.if && !node.for && // not v-if or v-for or v-else
+ !isBuiltInTag(node.tag) && // not a built-in
+ isPlatformReservedTag(node.tag) && // not a component
+ !isDirectChildOfTemplateFor(node) &&
+ Object.keys(node).every(isStaticKey)
+ ))
+ }
+
+ function isDirectChildOfTemplateFor (node) {
+ while (node.parent) {
+ node = node.parent;
+ if (node.tag !== 'template') {
+ return false
+ }
+ if (node.for) {
+ return true
+ }
+ }
+ return false
+ }
+
+ /* */
+
+ var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
+ var fnInvokeRE = /\([^)]*?\);*$/;
+ var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
+
+ // KeyboardEvent.keyCode aliases
+ var keyCodes = {
+ esc: 27,
+ tab: 9,
+ enter: 13,
+ space: 32,
+ up: 38,
+ left: 37,
+ right: 39,
+ down: 40,
+ 'delete': [8, 46]
+ };
+
+ // KeyboardEvent.key aliases
+ var keyNames = {
+ // #7880: IE11 and Edge use `Esc` for Escape key name.
+ esc: ['Esc', 'Escape'],
+ tab: 'Tab',
+ enter: 'Enter',
+ // #9112: IE11 uses `Spacebar` for Space key name.
+ space: [' ', 'Spacebar'],
+ // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
+ up: ['Up', 'ArrowUp'],
+ left: ['Left', 'ArrowLeft'],
+ right: ['Right', 'ArrowRight'],
+ down: ['Down', 'ArrowDown'],
+ // #9112: IE11 uses `Del` for Delete key name.
+ 'delete': ['Backspace', 'Delete', 'Del']
+ };
+
+ // #4868: modifiers that prevent the execution of the listener
+ // need to explicitly return null so that we can determine whether to remove
+ // the listener for .once
+ var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
+
+ var modifierCode = {
+ stop: '$event.stopPropagation();',
+ prevent: '$event.preventDefault();',
+ self: genGuard("$event.target !== $event.currentTarget"),
+ ctrl: genGuard("!$event.ctrlKey"),
+ shift: genGuard("!$event.shiftKey"),
+ alt: genGuard("!$event.altKey"),
+ meta: genGuard("!$event.metaKey"),
+ left: genGuard("'button' in $event && $event.button !== 0"),
+ middle: genGuard("'button' in $event && $event.button !== 1"),
+ right: genGuard("'button' in $event && $event.button !== 2")
+ };
+
+ function genHandlers (
+ events,
+ isNative
+ ) {
+ var prefix = isNative ? 'nativeOn:' : 'on:';
+ var staticHandlers = "";
+ var dynamicHandlers = "";
+ for (var name in events) {
+ var handlerCode = genHandler(events[name]);
+ if (events[name] && events[name].dynamic) {
+ dynamicHandlers += name + "," + handlerCode + ",";
+ } else {
+ staticHandlers += "\"" + name + "\":" + handlerCode + ",";
+ }
+ }
+ staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
+ if (dynamicHandlers) {
+ return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
+ } else {
+ return prefix + staticHandlers
+ }
+ }
+
+ function genHandler (handler) {
+ if (!handler) {
+ return 'function(){}'
+ }
+
+ if (Array.isArray(handler)) {
+ return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
+ }
+
+ var isMethodPath = simplePathRE.test(handler.value);
+ var isFunctionExpression = fnExpRE.test(handler.value);
+ var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
+
+ if (!handler.modifiers) {
+ if (isMethodPath || isFunctionExpression) {
+ return handler.value
+ }
+ return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
+ } else {
+ var code = '';
+ var genModifierCode = '';
+ var keys = [];
+ for (var key in handler.modifiers) {
+ if (modifierCode[key]) {
+ genModifierCode += modifierCode[key];
+ // left/right
+ if (keyCodes[key]) {
+ keys.push(key);
+ }
+ } else if (key === 'exact') {
+ var modifiers = (handler.modifiers);
+ genModifierCode += genGuard(
+ ['ctrl', 'shift', 'alt', 'meta']
+ .filter(function (keyModifier) { return !modifiers[keyModifier]; })
+ .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
+ .join('||')
+ );
+ } else {
+ keys.push(key);
+ }
+ }
+ if (keys.length) {
+ code += genKeyFilter(keys);
+ }
+ // Make sure modifiers like prevent and stop get executed after key filtering
+ if (genModifierCode) {
+ code += genModifierCode;
+ }
+ var handlerCode = isMethodPath
+ ? ("return " + (handler.value) + ".apply(null, arguments)")
+ : isFunctionExpression
+ ? ("return (" + (handler.value) + ").apply(null, arguments)")
+ : isFunctionInvocation
+ ? ("return " + (handler.value))
+ : handler.value;
+ return ("function($event){" + code + handlerCode + "}")
+ }
+ }
+
+ function genKeyFilter (keys) {
+ return (
+ // make sure the key filters only apply to KeyboardEvents
+ // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
+ // key events that do not have keyCode property...
+ "if(!$event.type.indexOf('key')&&" +
+ (keys.map(genFilterCode).join('&&')) + ")return null;"
+ )
+ }
+
+ function genFilterCode (key) {
+ var keyVal = parseInt(key, 10);
+ if (keyVal) {
+ return ("$event.keyCode!==" + keyVal)
+ }
+ var keyCode = keyCodes[key];
+ var keyName = keyNames[key];
+ return (
+ "_k($event.keyCode," +
+ (JSON.stringify(key)) + "," +
+ (JSON.stringify(keyCode)) + "," +
+ "$event.key," +
+ "" + (JSON.stringify(keyName)) +
+ ")"
+ )
+ }
+
+ /* */
+
+ function on (el, dir) {
+ if (dir.modifiers) {
+ warn("v-on without argument does not support modifiers.");
+ }
+ el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
+ }
+
+ /* */
+
+ function bind$1 (el, dir) {
+ el.wrapData = function (code) {
+ return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
+ };
+ }
+
+ /* */
+
+ var baseDirectives = {
+ on: on,
+ bind: bind$1,
+ cloak: noop
+ };
+
+ /* */
+
+
+
+
+
+ var CodegenState = function CodegenState (options) {
+ this.options = options;
+ this.warn = options.warn || baseWarn;
+ this.transforms = pluckModuleFunction(options.modules, 'transformCode');
+ this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
+ this.directives = extend(extend({}, baseDirectives), options.directives);
+ var isReservedTag = options.isReservedTag || no;
+ this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
+ this.onceId = 0;
+ this.staticRenderFns = [];
+ this.pre = false;
+ };
+
+
+
+ function generate (
+ ast,
+ options
+ ) {
+ var state = new CodegenState(options);
+ // fix #11483, Root level
+
+
+
+ {{message}}
+ {{show}}
+
+
+
+
+
+
+