Wraps a JSX element in a lazy evaluation struct, capturing the arguments that its attributes and children need to render. We identify the struct by the __jsxDOMWrapper property.
433350
function jsxWrapperAST(plugin, ref) {
  const func = t.identifier("func");
  const args = t.identifier("args");

  /**
   * function _jsxWrapper(func, args) {
   *   return {
   *     __jsxDOMWrapper: true,
   *     func: func,
   *     args: args,
   *   };
   * }
   */
  return t.functionExpression(
    ref,
    [func, args],
    t.blockStatement([
      t.returnStatement(t.objectExpression([
        t.objectProperty(t.identifier("__jsxDOMWrapper"), t.booleanLiteral(true)),
        t.objectProperty(func, func),
        t.objectProperty(args, args)
      ]))
    ])
  );
}
166492
def _wrap_attr(self, attrs, context=None):
        """"""
        for attr in attrs:
            if isinstance(attr, UnboundMethod):
                if _is_property(attr):
                    yield from attr.infer_call_result(self, context)
                else:
                    yield BoundMethod(attr, self)
            elif hasattr(attr, "name") and attr.name == "<lambda>":
                if attr.args.args and attr.args.args[0].name == "self":
                    yield BoundMethod(attr, self)
                    continue
                yield attr
            else:
                yield attr
977804
function (parent) {
		var wrapper = this,
			renderer = wrapper.renderer,
			element = wrapper.element,
			box = renderer.box,
			inverted = parent && parent.inverted,

			// get the parent node
			parentNode = parent ?
				parent.element || parent :
				box;


		// if the parent group is inverted, apply inversion on all children
		if (inverted) { // only on groups
			renderer.invertChild(element, parentNode);
		}

		// append it
		parentNode.appendChild(element);

		// align text after adding to be able to read offset
		wrapper.added = true;
		if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) {
			wrapper.updateTransform();
		}

		// fire an event for internal hooks
		fireEvent(wrapper, 'add');

		return wrapper;
	}
963290
function buildJSXOpeningElementAttributes(attribs, file) {
    var _props = [];
    var objs = [];

    var pushProps = function pushProps() {
      if (!_props.length) return;

      objs.push(t.objectExpression(_props));
      _props = [];
    };

    while (attribs.length) {
      var prop = attribs.shift();
      if (t.isJSXSpreadAttribute(prop)) {
        pushProps();
        objs.push(prop.argument);
      } else {
        _props.push(prop);
      }
    }

    pushProps();

    if (objs.length === 1) {
      // only one object
      attribs = objs[0];
    } else {
      // looks like we have multiple objects
      if (!t.isObjectExpression(objs[0])) {
        objs.unshift(t.objectExpression([]));
      }

      // spread it
      attribs = t.callExpression(file.addHelper("extends"), objs);
    }

    return attribs;
  }
827802
function getMarkupWrap(nodeName) {
	  !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
	  if (!markupWrap.hasOwnProperty(nodeName)) {
	    nodeName = '*';
	  }
	  if (!shouldWrap.hasOwnProperty(nodeName)) {
	    if (nodeName === '*') {
	      dummyNode.innerHTML = '<link />';
	    } else {
	      dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
	    }
	    shouldWrap[nodeName] = !dummyNode.firstChild;
	  }
	  return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
	}
539054
function(lazySource) {
        // Only expand if currently collapsed.
        if (this.isLoading || (this.expanded && !lazySource)) { 
            return; 
        }

        var ret = true;

        // When returning from the lazy load handler, expand is called again
        // in order to render the new children.  The "expand" event already
        // fired before fething the new data, so we need to skip it now.
        if (!lazySource) {
            // fire the expand event handler
            ret = this.tree.onExpand(this);

            if (false === ret) {
                this.logger.log("Expand was stopped by the abstract onExpand");
                return;
            }
            
            ret = this.tree.fireEvent("expand", this);
        }

        if (false === ret) {
            this.logger.log("Expand was stopped by the custom event handler");
            return;
        }

        if (!this.getEl()) {
            this.expanded = true;
            return;
        }

        if (!this.childrenRendered) {
            this.logger.log("children not rendered yet");
            this.getChildrenEl().innerHTML = this.renderChildren();
        } else {
            this.logger.log("children already rendered");
        }

        this.expanded = true;

        this.updateIcon();

        // this.getSpacer().title = this.getStateText();

        // We do an extra check for children here because the lazy
        // load feature can expose nodes that have no children.

        // if (!this.hasChildren()) {
        if (this.isLoading) {
            this.expanded = false;
            return;
        }

        if (! this.multiExpand) {
            var sibs = this.getSiblings();
            for (var i=0; sibs && i<sibs.length; ++i) {
                if (sibs[i] != this && sibs[i].expanded) { 
                    sibs[i].collapse(); 
                }
            }
        }

        this.showChildren();

        ret = this.tree.fireEvent("expandComplete", this);
    }
847632
function render(that, dom, options) {
  if (!dom) {
    if (that._root && that._root.children) {
      dom = that._root.children;
    } else {
      return '';
    }
  } else if (typeof dom === 'string') {
    dom = select(dom, that._root, options);
  }

  return serialize(dom, options);
}
799006
function jxh(obj, indentStr = '  ', indentLevel = 0) {
    let html = '';
    switch (getType(obj)) {
        case 'array':
            for (let item of obj) {
                html += jxh(item, indentStr, indentLevel);
            }
            break;
        case 'object':
            for (let tag in obj) {
                let content = obj[tag];
                html += routeTags(tag, content, indentStr, indentLevel);
            }
            break;
        default:
            objTypeError(obj);
            break;
    }
    return html;
}
1042313
function getjSXElement(babelTypes, name, attributes, children) { // {{{
  return babelTypes.jSXElement(
    babelTypes.JSXOpeningElement(
      babelTypes.jSXIdentifier(name),
      attributes,
      true
    ),
    null,
    children,
    true
  );
}
91836
function wrapComponent(component, elementName) {
  let bindableProps = [];
  if (component.propTypes) {
    bindableProps = Object.keys(component.propTypes).map(prop => bindable({
      name: prop,
      attribute: camelToKebab(prop),
      changeHandler: 'updateProps',
      defaultBindingMode: 1
    }));
  }
  return decorators(
    noView(),
    customElement(elementName),
    bindable({name: 'props', attribute: 'props', changeHandler: 'updateProps', defaultBindingMode: 1}),
    ...bindableProps
  ).on(createWrapperClass(component));
}
234285
private Object wrap(final Context context, final Scriptable scope, final String key, final Object value) {

		if (value instanceof Iterable) {
			return new StructrArray(scope, key, wrapIterable(context, scope, key, (Iterable)value));
		}

		if (value instanceof Object[]) {
			return new StructrArray(scope, key, (Object[])value);
		}

		if (value instanceof GraphObjectMap) {
			return new GraphObjectMapWrapper(context, scope, (GraphObjectMap)value);
		}

		if (value instanceof GraphObject) {
			return new GraphObjectWrapper(context, scope, (GraphObject)value);
		}

		if (value instanceof HttpServletRequest) {
			return new HttpServletRequestWrapper((HttpServletRequest)value);
		}

		if (value != null && value.getClass().isEnum()) {

			return ((Enum)value).name();
		}

		if (value instanceof NativeObject) {

			return (NativeObject)value;
		}

		if (value instanceof Map && !(value instanceof PropertyMap)) {

			return new MapWrapper(context, scope, (Map)value);
		}

		if (value instanceof Date) {

			return context.newObject(scope, "Date", new Object[] {((Date)value).getTime()});
		}

		if (value instanceof NativeJavaObject) {

			return wrap(context, scope, key, ((NativeJavaObject)value).unwrap());
		}

		return value;
	}
818185
function wrapNode (node, opts) {
            var wrapper = document.createElement(opts.tag);

            /* Assign the element a class of "blast". */
            wrapper.className = NAME;

            /* If a custom class was provided, assign that too. */
            if (opts.customClass) {
                wrapper.className += " " + opts.customClass;

                /* If an opts.customClass is provided, generate an ID consisting of customClass and a number indicating the match's iteration. */
                if (opts.generateIndexID) {
                    wrapper.id = opts.customClass + "-" + Element.blastedIndex;
                }
            }

            /* For the "all" delimiter, prevent space characters from collapsing. */
            if (opts.delimiter === "all" && /\s/.test(node.data)) {
                wrapper.style.whiteSpace = "pre-line";
            }

            /* Assign the element a class equal to its escaped inner text. Only applicable to the character and word delimiters (since they do not contain spaces). */
            if (opts.generateValueClass === true && !opts.search && (opts.delimiter === "character" || opts.delimiter === "word")) {
                var valueClass,
                    text = node.data;

                /* For the word delimiter, remove adjoined punctuation, which is unlikely to be desired as part of the match -- unless the text
                   consists solely of punctuation (e.g. "!!!"), in which case we leave the text as-is. */
                if (opts.delimiter === "word" && Reg.onlyContainsPunctuation.test(text)) {
                    /* E: Remove punctuation that's adjoined to either side of the word match. */
                    text = text.replace(Reg.adjoinedPunctuation, "");
                }

                valueClass = NAME + "-" + opts.delimiter.toLowerCase() + "-" + text.toLowerCase();

                wrapper.className += " " + valueClass;
            }

            /* Hide the wrapper elements from screenreaders now that we've set the target's aria-label attribute. */
            if (opts.aria) {
                wrapper.setAttribute("aria-hidden", "true");
            }

            wrapper.appendChild(node.cloneNode(false));

            return wrapper;
        }
196533
function(widget_config, raw_element) {

		if (raw_element.content.length != 1) Lava.t("Malformed binding in widget definition: " + raw_element.attributes.name);

		var binding = {
			property_name: raw_element.attributes.name,
			path_config: Lava.ExpressionParser.parseScopeEval(raw_element.content[0])
		};
		if ('from_widget' in raw_element.attributes) {
			if (Lava.schema.DEBUG && ['', '1', 'true'].indexOf(raw_element.attributes['from_widget']) == -1) Lava.t('binding: invalid from_widget attribute');
			binding.from_widget = true;
		}
		Lava.store(widget_config, 'bindings', raw_element.attributes.name, binding);

	}
606760
function renderHtmlAst(node, { components }) {
  if (node.type === 'root') {
    // NOTE: wrap children with React.Fragment, to avoid div wrapper from `hast-to-hyperscript`
    node = {
      type: 'element',
      tagName: Fragment,
      properties: {},
      children: node.children,
    };
  }

  function h(name, props, children) {
    return React.createElement(
      getReactElement(name, components),
      props,
      getReactChildren(name, children),
    );
  }

  return toH(h, node);
}
750439
function createWrapper(element) {
    var node,
        nodes = element.attributes,
        index = nodes.length,
        wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName);

    // copy element attributes to the wrapper
    while (index--) {
      node = nodes[index];
      node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue);
    }
    // copy element styles to the wrapper
    wrapper.style.cssText = element.style.cssText;
    return wrapper;
  }
1065991
function (name) {
		var wrapper,
			attribs;

		// set the class name
		if (name) {
			attribs = { 'className': PREFIX + name, 'class': PREFIX + name };
		}

		// the div to hold HTML and clipping
		wrapper = this.createElement(DIV).attr(attribs);

		return wrapper;
	}
1324195
function (wrapper) {
            var textNode = wrapper.element,
              renderer = this,
              forExport = renderer.forExport,
              textStr = pick(wrapper.textStr, '').toString(),
              hasMarkup = textStr.indexOf('<') !== -1,
              lines,
              childNodes = textNode.childNodes,
              styleRegex,
              hrefRegex,
              parentX = attr(textNode, 'x'),
              textStyles = wrapper.styles,
              width = wrapper.textWidth,
              textLineHeight = textStyles && textStyles.lineHeight,
              textStroke = textStyles && textStyles.HcTextStroke,
              i = childNodes.length,
              getLineHeight = function (tspan) {
                  return textLineHeight ?
                    pInt(textLineHeight) :
                    renderer.fontMetrics(
                      /(px|em)$/.test(tspan && tspan.style.fontSize) ?
                        tspan.style.fontSize :
                        ((textStyles && textStyles.fontSize) || renderer.style.fontSize || 12),
                      tspan
                    ).h;
              };

            /// remove old text
            while (i--) {
                textNode.removeChild(childNodes[i]);
            }

            // Skip tspans, add text directly to text node. The forceTSpan is a hook
            // used in text outline hack.
            if (!hasMarkup && !textStroke && textStr.indexOf(' ') === -1) {
                textNode.appendChild(doc.createTextNode(textStr));
                return;

                // Complex strings, add more logic
            } else {

                styleRegex = /<.*style="([^"]+)".*>/;
                hrefRegex = /<.*href="(http[^"]+)".*>/;

                if (width && !wrapper.added) {
                    this.box.appendChild(textNode); // attach it to the DOM to read offset width
                }

                if (hasMarkup) {
                    lines = textStr
                      .replace(/<(b|strong)>/g, '<span style="font-weight:bold">')
                      .replace(/<(i|em)>/g, '<span style="font-style:italic">')
                      .replace(/<a/g, '<span')
                      .replace(/<\/(b|strong|i|em|a)>/g, '</span>')
                      .split(/<br.*?>/g);

                } else {
                    lines = [textStr];
                }


                // remove empty line at end
                if (lines[lines.length - 1] === '') {
                    lines.pop();
                }


                // build the lines
                each(lines, function (line, lineNo) {
                    var spans, spanNo = 0;

                    line = line.replace(/<span/g, '|||<span').replace(/<\/span>/g, '</span>|||');
                    spans = line.split('|||');

                    each(spans, function (span) {
                        if (span !== '' || spans.length === 1) {
                            var attributes = {},
                              tspan = doc.createElementNS(SVG_NS, 'tspan'),
                              spanStyle; // #390
                            if (styleRegex.test(span)) {
                                spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2');
                                attr(tspan, 'style', spanStyle);
                            }
                            if (hrefRegex.test(span) && !forExport) { // Not for export - #1529
                                attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"');
                                css(tspan, { cursor: 'pointer' });
                            }

                            span = (span.replace(/<(.|\n)*?>/g, '') || ' ')
                              .replace(/&lt;/g, '<')
                              .replace(/&gt;/g, '>');

                            // Nested tags aren't supported, and cause crash in Safari (#1596)
                            if (span !== ' ') {

                                // add the text node
                                tspan.appendChild(doc.createTextNode(span));

                                if (!spanNo) { // first span in a line, align it to the left
                                    if (lineNo && parentX !== null) {
                                        attributes.x = parentX;
                                    }
                                } else {
                                    attributes.dx = 0; // #16
                                }

                                // add attributes
                                attr(tspan, attributes);

                                // Append it
                                textNode.appendChild(tspan);

                                // first span on subsequent line, add the line height
                                if (!spanNo && lineNo) {

                                    // allow getting the right offset height in exporting in IE
                                    if (!hasSVG && forExport) {
                                        css(tspan, { display: 'block' });
                                    }

                                    // Set the line height based on the font size of either
                                    // the text element or the tspan element
                                    attr(
                                      tspan,
                                      'dy',
                                      getLineHeight(tspan)
                                    );
                                }

                                // check width and apply soft breaks
                                if (width) {
                                    var words = span.replace(/([^\^])-/g, '$1- ').split(' '), // #1273
                                      hasWhiteSpace = spans.length > 1 || (words.length > 1 && textStyles.whiteSpace !== 'nowrap'),
                                      tooLong,
                                      actualWidth,
                                      hcHeight = textStyles.HcHeight,
                                      rest = [],
                                      dy = getLineHeight(tspan),
                                      softLineNo = 1,
                                      bBox;

                                    while (hasWhiteSpace && (words.length || rest.length)) {
                                        delete wrapper.bBox; // delete cache
                                        bBox = wrapper.getBBox();
                                        actualWidth = bBox.width;

                                        // Old IE cannot measure the actualWidth for SVG elements (#2314)
                                        if (!hasSVG && renderer.forExport) {
                                            actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles);
                                        }

                                        tooLong = actualWidth > width;
                                        if (!tooLong || words.length === 1) { // new line needed
                                            words = rest;
                                            rest = [];
                                            if (words.length) {
                                                softLineNo++;
                                                if (hcHeight && softLineNo * dy > hcHeight) {
                                                    words = ['...'];
                                                    wrapper.attr('title', wrapper.textStr);
                                                } else {

                                                    tspan = doc.createElementNS(SVG_NS, 'tspan');
                                                    attr(tspan, {
                                                        dy: dy,
                                                        x: parentX
                                                    });
                                                    if (spanStyle) { // #390
                                                        attr(tspan, 'style', spanStyle);
                                                    }
                                                    textNode.appendChild(tspan);
                                                }
                                            }
                                            if (actualWidth > width) { // a single word is pressing it out
                                                width = actualWidth;
                                            }
                                        } else { // append to existing line tspan
                                            tspan.removeChild(tspan.firstChild);
                                            rest.unshift(words.pop());
                                        }
                                        if (words.length) {
                                            tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-')));
                                        }
                                    }
                                }

                                spanNo++;
                            }
                        }
                    });
                });
            }
        }