webpackHotUpdate(0,{

/***/ 245:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n\n\nconst Error = ({ error }) => {\n  const title = error.message;\n  const stack = error.stack.split('\\n').slice(1).join('\\n');\n\n  return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n    'div',\n    { className: 'error-container' },\n    __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n      'div',\n      { className: 'error' },\n      __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n        'h2',\n        null,\n        title\n      ),\n      __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n        'pre',\n        { className: 'stack' },\n        stack\n      )\n    )\n  );\n};\n\n/* unused harmony default export */ var _unused_webpack_default_export = (Error);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL2Jyb3dzZXItdGVzdGVyL3NyYy9jb21wb25lbnRzL0Vycm9yVUkvaW5kZXguanM/MjdlYSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5jb25zdCBFcnJvciA9ICh7IGVycm9yIH0pID0+IHtcbiAgY29uc3QgdGl0bGUgPSBlcnJvci5tZXNzYWdlO1xuICBjb25zdCBzdGFjayA9IGVycm9yLnN0YWNrLnNwbGl0KCdcXG4nKS5zbGljZSgxKS5qb2luKCdcXG4nKTtcblxuICByZXR1cm4gKFxuICAgIDxkaXYgY2xhc3NOYW1lPVwiZXJyb3ItY29udGFpbmVyXCI+XG4gICAgICA8ZGl2IGNsYXNzTmFtZT1cImVycm9yXCI+XG4gICAgICAgIDxoMj57dGl0bGV9PC9oMj5cbiAgICAgICAgPHByZSBjbGFzc05hbWU9XCJzdGFja1wiPntzdGFja308L3ByZT5cbiAgICAgIDwvZGl2PlxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgRXJyb3I7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gYnJvd3Nlci10ZXN0ZXIvc3JjL2NvbXBvbmVudHMvRXJyb3JVSS9pbmRleC5qcyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQUE7QUFBQTtBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBRkE7QUFEQTtBQU9BO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///245\n");

/***/ }),

/***/ 89:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tiny_conf__ = __webpack_require__(13);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tiny_conf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_tiny_conf__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_kevoree_kevscript__ = __webpack_require__(90);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_kevoree_kevscript___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_kevoree_kevscript__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_kevoree_core__ = __webpack_require__(225);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_kevoree_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_kevoree_core__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_kevoree_library__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_kevoree_library___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_kevoree_library__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__lib_logger_factory__ = __webpack_require__(71);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__lib_Resolver__ = __webpack_require__(227);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__lib_InstanceLoader__ = __webpack_require__(229);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Viewer__ = __webpack_require__(230);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__Settings__ = __webpack_require__(235);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ErrorUI__ = __webpack_require__(245);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__app_css__ = __webpack_require__(243);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__app_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11__app_css__);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst INSTANCE_NAME = 'comp';\n\nclass App extends __WEBPACK_IMPORTED_MODULE_0_react__[\"Component\"] {\n\n  constructor(props) {\n    super(props);\n    __WEBPACK_IMPORTED_MODULE_1_tiny_conf___default.a.set('registry', {\n      host: 'registry.kevoree.org',\n      port: 443,\n      ssl: true\n    });\n    this.logger = __WEBPACK_IMPORTED_MODULE_5__lib_logger_factory__[\"a\" /* default */].create('Kevoree Browser Tester');\n    this.resolver = new __WEBPACK_IMPORTED_MODULE_6__lib_Resolver__[\"a\" /* default */](this.props.model.packages[0].deployUnits[0].hashcode);\n    this.kevs = new __WEBPACK_IMPORTED_MODULE_2_kevoree_kevscript___default.a(__WEBPACK_IMPORTED_MODULE_5__lib_logger_factory__[\"a\" /* default */].create('KevScript'));\n    this.core = new __WEBPACK_IMPORTED_MODULE_3_kevoree_core___default.a(this.resolver, this.kevs, __WEBPACK_IMPORTED_MODULE_5__lib_logger_factory__[\"a\" /* default */]);\n    this.factory = new __WEBPACK_IMPORTED_MODULE_4_kevoree_library___default.a.factory.DefaultKevoreeFactory();\n\n    this.state = {\n      instance: null\n    };\n  }\n\n  componentDidMount() {\n    const loader = this.factory.createJSONLoader();\n    const kevlib = loader.loadModelFromString(JSON.stringify(this.props.model)).get(0);\n\n    this.core.start('node0');\n    this.kevs.parse(this.props.script, kevlib).then(({ model }) => {\n      return this.core.deploy(model);\n    }).catch(err => {\n      this.setState({ error: this.processError(err) });\n    });\n\n    this.core.on('deployed', () => {\n      const currentKeys = Object.keys(this.core.nodeInstance.adaptationEngine.modelObjMapper.map);\n      const registeredKeys = Object.keys(__WEBPACK_IMPORTED_MODULE_7__lib_InstanceLoader__[\"a\" /* default */].getInstances());\n\n      currentKeys.forEach(key => {\n        const instance = this.core.nodeInstance.adaptationEngine.modelObjMapper.map[key];\n        if (instance && typeof instance.uiFactory === 'function') {\n          if (!__WEBPACK_IMPORTED_MODULE_7__lib_InstanceLoader__[\"a\" /* default */].has(key)) {\n            __WEBPACK_IMPORTED_MODULE_7__lib_InstanceLoader__[\"a\" /* default */].register(key, instance);\n            if (instance.name === INSTANCE_NAME) {\n              this.setState({ instance });\n              document.title = `${instance.getModelEntity().typeDefinition.name} - Kevoree Browser Tester`;\n            }\n          }\n        }\n      });\n\n      for (let i = 0; i < registeredKeys.length; i++) {\n        const hasKey = currentKeys.find(key => registeredKeys[i] === key);\n        if (!hasKey) {\n          // clean removed instance\n          __WEBPACK_IMPORTED_MODULE_7__lib_InstanceLoader__[\"a\" /* default */].remove(registeredKeys[i]);\n        }\n      }\n    });\n\n    this.core.on('error', err => {\n      this.setState({ error: this.processError(err) });\n    });\n  }\n\n  processError(err) {\n    return { title: err.message, stack: err.stack.split('\\n').slice(1).join('\\n') };\n  }\n\n  render() {\n    return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n      'div',\n      { className: 'container' },\n      __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n        'div',\n        { className: 'header' },\n        __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n          'h2',\n          null,\n          'Kevoree Browser Tester'\n        )\n      ),\n      this.state.error ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n        'div',\n        { className: 'error-container' },\n        __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n          'div',\n          { className: 'error' },\n          __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n            'h2',\n            null,\n            this.state.error.title\n          ),\n          __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n            'pre',\n            { className: 'stack' },\n            this.state.error.stack\n          )\n        )\n      ) : this.state.instance ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n        'div',\n        { className: 'content' },\n        __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n          'div',\n          { className: 'left' },\n          __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__Settings__[\"a\" /* default */], { instance: this.state.instance })\n        ),\n        __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n          'div',\n          { className: 'right' },\n          __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__Viewer__[\"a\" /* default */], { instance: this.state.instance })\n        )\n      ) : __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n        'div',\n        { className: 'loading' },\n        __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n          'strong',\n          null,\n          'Loading...'\n        )\n      )\n    );\n  }\n}\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = App;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///89\n");

/***/ })

})