Create a wrapper class for the component
@param {Object} component
@returns {WrapperClass}
18155
function createWrapperClass(component) {
  return class WrapperClass {
    static inject = [Element];

    /**
     * @param {Element} element
     */
    constructor(element) {
      this.element = element;
    }

    /**
     * Re-render the Preact component when values changed
     */
    attached() {
      if (!this.component) {
        this.render();
      } else if (typeof this.component.componentDidMount === 'function') {
        this.component.componentDidMount();
      }
    }

    /**
     * Triggers un-mound function to release events
     */
    detached() {
      if (this.component && typeof this.component.componentWillUnmount === 'function') {
        this.component.componentWillUnmount();
      }
    }

    /**
     * Un-render the component
     */
    unbind() {
      this.component = null;
      this.element.component = null;
      render('', this.element, this.component);
    }

    /**
     * Determine props passed to create react elements
     * @returns {Object}
     */
    getProps() {
      const props = this.props || {};
      // Copy bound properties because Object.assign doesn't work deep
      for (const prop in this) {
        if (this[prop] !== undefined && typeof this[prop] !== 'function') {
          props[prop] = this[prop] === '' ? true : this[prop];
        }
      }
      delete props.element;

      return Object.assign({}, component.defaultProps, props);
    }

    /**
     * Will be called when bindable updated
     */
    updateProps() {
      if (this.component && typeof this.component.componentWillReceiveProps === 'function') {
        const props = this.getProps();
        this.component.componentWillReceiveProps(props);
        this.component.props = props;
      }
    }

    /**
     * Render Preact component
     */
    render() {
      // Create container in active dom to apply styles already
      const container = document.createElement('div');
      this.element.appendChild(container);

      // Render react component with a slot as children into a container to possibly replace the slot with real children
      const reactElement = createElement(component, this.getProps(), createElement('slot'));
      this.component = render(reactElement, container);
      this.element.component = this.component;

      const slot = container.querySelector('slot');
      // If no slot is rendered the component doesn't accept children
      if (slot) {
        const content = this.element.querySelector('au-content');
        if (!content) {
          return;
        }
        // Move original children to slot position
        for (let i = 0; i < content.children.length; i++) {
          slot.parentNode.insertBefore(content.children[i], slot);
        }
        slot.parentNode.removeChild(slot);
        this.insertContainerContent(container, content);
      } else {
        this.insertContainerContent(container);
      }
    }

    /**
     * Moves content of the container into the correct place within this element
     * @param {HTMLElement} container
     * @param {HTMLElement} replacement
     */
    insertContainerContent(container, replacement) {
      // Append child to fragment to get rid of container element which can break element flow
      const fragment = document.createDocumentFragment();
      for (let i = 0; i < container.children.length; i++) {
        fragment.appendChild(container.children[i]);
      }
      // Either replace au-content or just append if no children are passed
      if (replacement) {
        this.element.replaceChild(fragment, replacement);
      } else {
        this.element.appendChild(fragment);
      }
      // Container is now obsolete as the children are laying directly under the parent
      this.element.removeChild(container);
    }
  };
}
285204
function createFunctionalComponent(ctor, displayName, opts, ReactComponent) {
  var cdu = createComponentDidUpdate(displayName, opts);

  // We call the original function in the render() method,
  // and implement `componentDidUpdate` for `why-did-you-update`
  var WDYUFunctionalComponent = function (_ReactComponent) {
    _inherits(WDYUFunctionalComponent, _ReactComponent);

    function WDYUFunctionalComponent() {
      _classCallCheck(this, WDYUFunctionalComponent);

      return _possibleConstructorReturn(this, _ReactComponent.apply(this, arguments));
    }

    WDYUFunctionalComponent.prototype.render = function render() {
      return ctor(this.props, this.context);
    };

    WDYUFunctionalComponent.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState, snapshot) {
      cdu.call(this, prevProps, prevState, snapshot);
    };

    return WDYUFunctionalComponent;
  }(ReactComponent);

  // copy all statics from the functional component to the class
  // to support proptypes and context apis
  Object.assign(WDYUFunctionalComponent, ctor, {
    // our wrapper component needs an explicit display name
    // based on the original constructor.
    displayName: displayName
  });

  return WDYUFunctionalComponent;
}
1079298
function component(container, data, context) {
    const selection = container.nodeName ? select(container) : container;
    const instances = selection
      .selectAll(mine)
      .data(dataArray(data, context), key);
    instances
      .exit()
      .each(destroyInstance);
    return instances
      .enter().append(tagName)
      .attr('class', className)
      .each(createInstance)
      .merge(instances)
      .each(renderInstance);
  }
302039
function Component_construct() {
        try {
            this.dependency = JSON.parse(di.readFileSync(__dirname + '/component.json'));
        } catch (e) {
            throw new error.Exception('Component.construct: problem with loading dependency file', e);
        }
    }
1306192
private final UIComponent createComponent(FacesContext facesContext, 
            final String componentType) throws FacesException
    {
        checkNull(componentType, "componentType");
        checkEmpty(componentType, "componentType");

        final Class<? extends UIComponent> componentClass =
                getObjectFromClassMap(componentType, _componentClassMap);
        if (componentClass == null)
        {
            log.log(Level.SEVERE, "Undefined component type " + componentType);
            throw new FacesException("Undefined component type " + componentType);
        }

        try
        {
            UIComponent component = componentClass.newInstance();
            _handleAnnotations(facesContext, component, component);
            return component;
        }
        catch (Exception e)
        {
            log.log(Level.SEVERE, "Could not instantiate component componentType = " + componentType, e);
            throw new FacesException("Could not instantiate component componentType = " + componentType, e);
        }
    }
643389
function decorate (Comp) {
  var component

  // instantiate classes
  if (typeof Comp === 'function') {
    component = new Comp()
  } else {
    // make sure we don't change the id on a cached component
    component = Object.create(Comp)
  }

  // components get a new id on render,
  // so we can clear the previous component cache.
  component._durrutiId = String(componentIndex++)

  // cache component
  componentCache.push({
    id: component._durrutiId,
    component: component
  })

  return component
}
1073508
function JQueryWrapper() {
// public
    /**
     * The wrapper is an object, so it can't act like a function. We supply
     * an explicit init() method to be used where jQuery() previously applied.
     */
    this.init = function(selector, context) {
        return new this.jQuery.fn.init(selector, context);
    };

    this.clean = function(elems, context, fragment) {
        return this.jQuery.clean(elems, context, fragment);
    };
}
915239
function createInternalComponent(element) {
	  !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
	  return new genericComponentClass(element);
	}
378975
function createInternalComponent(element) {
  ("production" !== "development" ? invariant(
    genericComponentClass,
    'There is no registered component for the tag %s',
    element.type
  ) : invariant(genericComponentClass));
  return new genericComponentClass(element.type, element.props);
}
182378
function Component(classDef, el, options) {
    _classCallCheck(this, Component);

    // Display error if el is valid HTML Element
    if (!(el instanceof Element)) {
      console.error(Error(el + ' is not an HTML Element'));
    }

    // If exists, destroy and reinitialize in child
    var ins = classDef.getInstance(el);
    if (!!ins) {
      ins.destroy();
    }

    this.el = el;
    this.$el = cash(el);
  }
693536
function Button(props) {
  let {
    label,
    href,
    type,
    size,
    children,
    className,
    primary,
    secondary,
    outline,
    flat,
    ...rest
  } = props
  /* Add className */
  const classes = cx(
    buttonClassName,
    {
      [`${buttonClassName}-primary`]: primary,
      [`${buttonClassName}-secondary`]: secondary,
      [`${buttonClassName}-outline`]: outline,
      [`${buttonClassName}-flat`]: flat,
      [`${buttonClassName}-${type}`]: type,
    },
    `${buttonClassName}-${size}`,
    className
  )

  const tagName = href ? 'a' : 'button'

  return React.createElement(
    tagName,
    {
      className: classes,
      href,
      ...rest,
    },
    children || label
  )
}
532729
function createClass(componentName, inputType) {
  const BaseKlass = class extends React.Component<Props> {
    static displayName = componentName;
    refMdl = React.createRef();

    componentDidMount() {
      if (this.props.theme.id === 'mdl' && this.refMdl.current) {
        window.componentHandler.upgradeElement(this.refMdl.current);
      }
    }

    // ==========================================
    render() {
      if (
        !this.props.skipTheme &&
        this.props.theme.id === 'mdl' &&
        !this.props.vertical
      ) {
        return this.renderMdl();
      }
      const {
        curValue,
        disabled,
        registerFocusableRef,
        // For ranges
        vertical,
      } = this.props;
      const otherProps = omit(this.props, FILTERED_OUT_PROPS);
      return (
        <input
          ref={registerFocusableRef}
          className={`giu-${inputType}-input`}
          type={inputType}
          value={curValue}
          {...otherProps}
          orient={vertical ? 'vertical' : undefined}
          tabIndex={disabled ? -1 : undefined}
          style={style.field(this.props)}
        />
      );
    }

    renderMdl() {
      if (inputType === 'range') return this.renderMdlSlider();
      const {
        id,
        curValue,
        disabled,
        registerFocusableRef,
        fFocused,
      } = this.props;
      const otherProps = omit(this.props, FILTERED_OUT_PROPS_MDL);
      let className = `giu-${inputType}-input mdl-textfield mdl-js-textfield mdl-textfield--floating-label`;
      if (curValue !== '' || fFocused) className += ' is-dirty';
      return (
        <div
          ref={this.refMdl}
          className={className}
          style={style.mdlField(this.props)}
        >
          <input
            ref={registerFocusableRef}
            className="mdl-textfield__input"
            type={inputType === 'password' ? 'password' : 'text'}
            value={curValue}
            id={id}
            {...otherProps}
            tabIndex={disabled ? -1 : undefined}
          />
          <label className="mdl-textfield__label" htmlFor={id}>
            {this.props.placeholder || ''}
          </label>
        </div>
      );
    }

    renderMdlSlider() {
      const { curValue, disabled, registerFocusableRef } = this.props;
      const otherProps = omit(this.props, FILTERED_OUT_PROPS);
      return (
        <input
          ref={registerFocusableRef}
          className={`giu-${inputType}-input mdl-slider mdl-js-slider`}
          type={inputType}
          value={curValue}
          {...otherProps}
          tabIndex={disabled ? -1 : undefined}
          style={style.mdlField(this.props)}
        />
      );
    }
  }
827573
function injectableWrapper(obj, provide, injects, isTransientScope) {
    // TODO(@davequick): discuss with @halfspiral whether isTransientScope might just better
    // be an array of Annotations
    var wrappedObject = function wrapOrCreateObject() {
      if(isFunction(obj) && (exists(obj.$provide) || exists(obj.$inject) || provide || injects)){
        var instance = Object.create(obj.prototype);
        return obj.apply(instance,arguments) || instance;
      }
      return obj;
    };
    return _wrapper(obj, wrappedObject, provide, injects, isTransientScope);
  }
664937
function (component, params) {

			var _params = {
					cssClass: params.cssClass,
					labelStyle: component.labelStyle,
					id: _internalLabelOverlayId,
					component: component,
					_jsPlumb: component._jsPlumb.instance  // TODO not necessary, since the instance can be accessed through the component.
				},
				mergedParams = jsPlumb.extend(_params, params);

			return new _jp.Overlays[component._jsPlumb.instance.getRenderMode()].Label(mergedParams);
		}
240911
async function component({repoDir=process.cwd(), outDir=process.cwd()}={}) {
  repoDir = path.isAbsolute(repoDir) ? repoDir : path.resolve(process.cwd(), repoDir);

  outDir = path.isAbsolute(outDir) ? outDir : path.resolve(process.cwd(), outDir);

  const dest = path.resolve(outDir, 'stats.json');

  const promisedData = files.map(filename => {
    console.log(`Reading file: ${repoDir}/${filename}`);
    return loadJsonFile(path.resolve(repoDir, filename));
  });

  promisedData.push(gitTags(repoDir));

  const [package, bower, origami, tags] = await Promise.all(promisedData);

  const statsData = {
    module_name: bower.name,
    keywords: package.keywords,
    repo_home_url: package.homepage,
    is_stable: true,
    tag_name: tags[tags.length-1].tag_name,
    datetime_created: tags[tags.length-1].datetime_created,
    versions: tags,
    has_css: bower.main.indexOf('main.scss') !== -1,
    has_js: bower.main.indexOf('main.js') !== -1,
    dependencies: bower.dependencies,
    description: package.description,
    origami_type: origami.origamiType,
    origami_category: origami.origamiCategory,
    origami_version: origami.origamiVersion,
    support: package.bugs.url,
    support_status: origami.supportStatus,
    brower_features: origami.browserFeatures,
    demos: origami.demos
  };
  console.log(`Generating ${chalk.cyan(dest)}`);
  await writeJsonFile(dest, statsData);
  return statsData;
}
160294
private Builder createComponentExposedTypeBuilder(ClassName exposedTypeClassName) {
    return TypeSpec
        .classBuilder(exposedTypeClassName)
        .addModifiers(Modifier.PUBLIC)
        .superclass(TypeName.get(component.asType()))
        .addAnnotation(AnnotationSpec
            .builder(Generated.class)
            .addMember("value", "$S", ComponentExposedTypeGenerator.class.getCanonicalName())
            .addMember("comments", "$S", "https://github.com/Axellience/vue-gwt")
            .build());
  }
866923
function withTheme(WrappedComponent) {
  const displayName =
    WrappedComponent.displayName || WrappedComponent.name || 'Component'

  return class extends React.Component {
    static displayName = `withTheme(${displayName})`

    render() {
      return (
        <ThemeConsumer>
          {theme => <WrappedComponent theme={theme} {...this.props} />}
        </ThemeConsumer>
      )
    }
  }
}