diff --git a/component/packages/wu-code-monaco-editor/src/index.tsx b/component/packages/wu-code-monaco-editor/src/index.tsx
index a0ae4903..d9347c97 100644
--- a/component/packages/wu-code-monaco-editor/src/index.tsx
+++ b/component/packages/wu-code-monaco-editor/src/index.tsx
@@ -55,14 +55,12 @@ export class WuCodeMonacoEditor extends WuComponent implements OnConnected {
const file = new File([ u8arr ], `initialSrcTs.tsx`, {
type: "text/plain"
});
- console.log(file);
const reader = new FileReader();
reader.onload = ()=> {
// 语句是为了显示内容换行
// @ts-ignore
/*const str = reader.result?.replace(/\n/g,"
");
console.log(str);*/
- console.log(reader.result);
resolve(reader.result as string);
};
reader.readAsText(file,'utf-8');
diff --git a/component/packages/wu-monaco-editor/.editorconfig b/component/packages/wu-code-playground/.editorconfig
similarity index 100%
rename from component/packages/wu-monaco-editor/.editorconfig
rename to component/packages/wu-code-playground/.editorconfig
diff --git a/component/packages/wu-monaco-editor/.eslintignore b/component/packages/wu-code-playground/.eslintignore
similarity index 100%
rename from component/packages/wu-monaco-editor/.eslintignore
rename to component/packages/wu-code-playground/.eslintignore
diff --git a/component/packages/wu-monaco-editor/.eslintrc.js b/component/packages/wu-code-playground/.eslintrc.js
similarity index 100%
rename from component/packages/wu-monaco-editor/.eslintrc.js
rename to component/packages/wu-code-playground/.eslintrc.js
diff --git a/component/packages/wu-monaco-editor/.prettierrc b/component/packages/wu-code-playground/.prettierrc
similarity index 100%
rename from component/packages/wu-monaco-editor/.prettierrc
rename to component/packages/wu-code-playground/.prettierrc
diff --git a/component/packages/wu-monaco-editor/build/webpack_build.config.js b/component/packages/wu-code-playground/build/webpack_build.config.js
similarity index 100%
rename from component/packages/wu-monaco-editor/build/webpack_build.config.js
rename to component/packages/wu-code-playground/build/webpack_build.config.js
diff --git a/component/packages/wu-monaco-editor/build/webpack_common.config.js b/component/packages/wu-code-playground/build/webpack_common.config.js
similarity index 100%
rename from component/packages/wu-monaco-editor/build/webpack_common.config.js
rename to component/packages/wu-code-playground/build/webpack_common.config.js
diff --git a/component/packages/wu-monaco-editor/build/webpack_dev.config.js b/component/packages/wu-code-playground/build/webpack_dev.config.js
similarity index 100%
rename from component/packages/wu-monaco-editor/build/webpack_dev.config.js
rename to component/packages/wu-code-playground/build/webpack_dev.config.js
diff --git a/component/packages/wu-code-playground/deplpy/playground-2022-10-30.html b/component/packages/wu-code-playground/deplpy/playground-2022-10-30.html
new file mode 100644
index 00000000..177b12f7
--- /dev/null
+++ b/component/packages/wu-code-playground/deplpy/playground-2022-10-30.html
@@ -0,0 +1,20 @@
+
+
+
+
+ wu-component-playground
+
+
+
+
+
+
+
+
+
+
+
diff --git a/component/packages/wu-code-playground/deplpy/static/code_editor/index.umd.js b/component/packages/wu-code-playground/deplpy/static/code_editor/index.umd.js
new file mode 100644
index 00000000..86063957
--- /dev/null
+++ b/component/packages/wu-code-playground/deplpy/static/code_editor/index.umd.js
@@ -0,0 +1 @@
+!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@wu-component/web-core-plus")):"function"==typeof define&&define.amd?define(["exports","@wu-component/web-core-plus"],e):e((o="undefined"!=typeof globalThis?globalThis:o||self).WuCodeMonacoEditor={},o.webCorePlus)}(this,(function(o,e){"use strict";var t=function(o,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])},t(o,e)};var i=function(){return i=Object.assign||function(o){for(var e,t=1,i=arguments.length;t=0;c--)(n=o[c])&&(a=(r<3?n(a):r>3?n(e,t,a):n(e,t))||a);return r>3&&a&&Object.defineProperty(e,t,a),a}function r(o,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(o,e)}function a(o,e,t,i){return new(t||(t=Promise))((function(n,r){function a(o){try{d(i.next(o))}catch(o){r(o)}}function c(o){try{d(i.throw(o))}catch(o){r(o)}}function d(o){var e;o.done?n(o.value):(e=o.value,e instanceof t?e:new t((function(o){o(e)}))).then(a,c)}d((i=i.apply(o,e||[])).next())}))}function c(o,e){var t,i,n,r,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]=0||(n[t]=o[t]);return n}(o,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(o,t)&&(n[t]=o[t])}return n}function h(o,e){(null==e||e>o.length)&&(e=o.length);for(var t=0,i=new Array(e);t=o.length?o.apply(this,n):function(){for(var o=arguments.length,i=new Array(o),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};z.initial(o),z.handler(e);var t={current:o},i=v(j)(t,e),n=v(D)(t),r=v(z.changes)(o),a=v(A)(t);function c(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(o){return o};return z.selector(o),o(t.current)}function d(o){x(i,n,r,a)(o)}return[c,d]}};var N,C={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},q=(N=function(o,e){throw new Error(o[e]||o.default)},function o(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=N.length?N.apply(this,i):function(){for(var t=arguments.length,n=new Array(t),r=0;r{o=t(e,n,o)||o})),o}(t,e,n,o):"function"==typeof e?function(t,e){return t.reverse().forEach((t=>{const n=t(e);n&&(e=n)})),e}(t,e):void 0},defineMetadata:function(t,e,n,o){r(t,e,n,o)},getMetadata:function(t,e,n){return i(t,e,n)},getOwnMetadata:function(t,e,n){return o(t,e,n)},hasMetadata:function(t,e,n){return!!i(t,e,n)},hasOwnMetadata:function(t,e,n){return!!o(t,e,n)},metadata:function(t,e){return function(n,o){r(t,e,n,o)}}};Object.assign(Reflect,s);var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)};var l=function(){return l=Object.assign||function(t){for(var e,n=1,o=arguments.length;n
+ * @license MIT
+ */!function(t){if(!t.WeakMap){var e=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return 1===Object.defineProperty({},"x",{value:1}).x}catch(t){}}(),o=function(t,e,o){n?Object.defineProperty(t,e,{configurable:!0,writable:!0,value:o}):t[e]=o};t.WeakMap=function(){function t(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(o(this,"_id",i("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}function n(t,n){if(!r(t)||!e.call(t,"_id"))throw new TypeError(n+" method called on incompatible receiver "+typeof t)}function i(t){return t+"_"+s()+"."+s()}function s(){return Math.random().toString().substring(2)}return o(t.prototype,"delete",(function(t){if(n(this,"delete"),!r(t))return!1;var e=t[this._id];return!(!e||e[0]!==t)&&(delete t[this._id],!0)})),o(t.prototype,"get",(function(t){if(n(this,"get"),r(t)){var e=t[this._id];return e&&e[0]===t?e[1]:void 0}})),o(t.prototype,"has",(function(t){if(n(this,"has"),!r(t))return!1;var e=t[this._id];return!(!e||e[0]!==t)})),o(t.prototype,"set",(function(t,e){if(n(this,"set"),!r(t))throw new TypeError("Invalid value used as weak map key");var i=t[this._id];return i&&i[0]===t?(i[1]=e,this):(o(t,this._id,[t,e]),this)})),o(t,"_polyfill",!0),t}()}function r(t){return Object(t)===t}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:u);var p=function(t){return t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase()};
+/**
+ * @license
+ * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+ * Code distributed by Google as part of the polymer project is also
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+ */function f(t){var e=document.createElement("style");return e.textContent=t,e}function d(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function h(t){return t.children}function v(t,e){null!=t&&("function"==typeof t?t(e):t.current=e)}function y(t){return"[object Array]"===Object.prototype.toString.call(t)}function m(t){return t.indexOf("-")>-1?t.replace(/(\-([a-z]))/g,(function(t,e,n,o,r){return n.toUpperCase()})):t}function b(t,e,n){var o=void 0;try{if(null!==t)switch(e){case String:o=t;break;case Number:o=Number(t);break;case Boolean:o=!("false"===t||"0"===t||!1===t);break;case Array:case Object:o="string"==typeof t?JSON.parse(t.replace(/'/g,'"')):"[object Array]"===Object.prototype.toString.call(t)||"[object Object]"===Object.prototype.toString.call(t)?t:JSON.parse(t.replace(/(['"])?([a-zA-Z0-9_-]+)(['"])?:([^\/])/g,'"$2":$4').replace(/'([\s\S]*?)'/g,'"$1"').replace(/,(\s*})/g,"$1"));break;default:o=t}else o=n;return o}catch(e){return console.warn("formatValue file, please input element attr",e),function(t){try{return new Function("return "+t)()}catch(t){console.warn("eval fail",t)}}(t)}}!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.hasOwnProperty("polyfillWrapFlushCallback")){var t=HTMLElement;window.HTMLElement=function(){return Reflect.construct(t,[],this.constructor)},HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}(),"function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var g={store:null,root:self||window||function(){return this}(),mapping:{},vnode:void 0},w="prevProps",S=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,M=Symbol("PROP_META_KEY"),C=Symbol("STATE_META_KEY"),N=Symbol("COMPONENT_CUSTOM_EVENT"),E=Symbol("COMPONENT_CUSTOM_METHOD"),O=Symbol("COMPONENT_CUSTOM_INJECT"),P=Symbol("COMPONENT_CUSTOM_PROVIDE"),j=Symbol("COMPONENT_WATCH");function T(t){var e=t.parentNode;e&&e.removeChild(t)}function k(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&_(t,e.nodeName):"function"==typeof e.nodeName?g.mapping[t.nodeName.toLowerCase()]===e.nodeName:n||t._componentConstructor===e.nodeName}function _(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function A(t){return this._listeners[t.type](g.event&&g.event(t)||t)}var L={};function R(t,e,n,o,r,i){if("className"===e&&(e="class"),"o"==e[0]&&"-"==e[1])L[e]&&L[e](t,o,i);else if("key"===e);else if("ref"===e)v(n,null),v(o,t);else if("class"!==e||r)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof n||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var s in n)s in o||(t.style[s]="");for(var s in o)t.style[s]="number"==typeof o[s]&&!1===S.test(s)?o[s]+"px":o[s]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1])!function(t,e,n,o){var r=e!==(e=e.replace(/Capture$/,"")),i=e.toLowerCase();e=(i in t?i:e).slice(2),n?o||t.addEventListener(e,A,r):t.removeEventListener(e,A,r),(t._listeners||(t._listeners={}))[e]=n}(t,e,o,n);else if("INPUT"===t.nodeName&&"value"===e)t[e]=null==o?"":o;else if("list"!==e&&"type"!==e&&"css"!==e&&!r&&e in t&&""!==o){try{t[e]=null==o?"":o}catch(t){}null!=o&&!1!==o||"spellcheck"==e||(t.pureRemoveAttribute?t.pureRemoveAttribute(e):t.removeAttribute(e))}else{var a=r&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?a?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.pureRemoveAttribute?t.pureRemoveAttribute(e):t.removeAttribute(e):"function"!=typeof o&&(a?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.pureSetAttribute?t.pureSetAttribute(e,o):t.setAttribute(e,o))}else t.className=o||""}t.diffLevel=0;var $=!1,I=!1;function x(e,n,o,r,i){var s;if(e||n)return t.diffLevel++||($=null!=o&&void 0!==o.ownerSVGElement,I=null!=e&&!(w in e)),n&&n.nodeName===h&&(n=n.children),y(n)?o?H(o,n,I,r,i):(s=[],n.forEach((function(t,n){var o=U(0===n?e:null,t,r,i);s.push(o)}))):(y(e)?e.forEach((function(t,e){0===e?s=U(t,n,r,i):W(t,!1)})):s=U(e,n,r,i),o&&s.parentNode!==o&&o.appendChild(s)),--t.diffLevel||(I=!1),s}function U(t,e,n,o){t&&e&&t.props&&(t.props.children=e.children);var r=t,i=$;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),W(t,!0))),r.prevProps=!0,r;var s,a,l=e.nodeName;if("function"==typeof l)for(var c in g.mapping)if(g.mapping[c]===l){l=c,e.nodeName=c;break}if($="svg"===l||"foreignObject"!==l&&$,l=String(l),(!t||!_(t,l))&&(s=l,(a=$?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=a,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),W(t,!0)}var u=r.firstChild,p=r.prevProps,f=e.children;if(null==p){p=r.prevProps={};for(var h=r.attributes,v=h.length;v--;)p[h[v].name]=h[v].value}return!I&&f&&1===f.length&&"string"==typeof f[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=f[0]&&(u.nodeValue=f[0]):(f&&f.length||null!=u)&&("CustomWebComponent"==r.constructor.is&&r.constructor.noSlot||H(r,f,I||null!=p.dangerouslySetInnerHTML,n,o)),function(t,e,n,o,r){var i,s,a=t.update;t.receiveProps&&(s=Object.assign({},n));for(i in n)e&&null!=e[i]||null==n[i]||(R(t,i,n[i],n[i]=void 0,$,o),a&&delete t.props[i]);for(i in e)if(a&&"object"==typeof e[i]&&"ref"!==i){"style"===i&&R(t,i,n[i],n[i]=e[i],$,o);var l=d(i);t.props[l]=n[l]=e[i]}else if("children"!==i&&(!(i in n)||e[i]!==("value"===i||"checked"===i?t[i]:n[i])))if(R(t,i,n[i],e[i],$,o),-1!==t.nodeName.indexOf("-")){t.props=t.props||{};l=d(i);t.props[l]=n[l]=e[i]}else n[i]=e[i];a&&!r&&t.parentNode&&!1!==t.receiveProps(t.props,s)&&t.update()}(r,e.attributes,p,n,o),r.props&&(r.props.children=e.children),$=i,r}function H(t,e,n,o,r){var i,s,a,l,c,u=t.childNodes,p=[],f={},d=0,h=0,v=(null==u?void 0:u.length)||0,y=0,m=e?e.length:0;if(0!==v)for(var b=0;b0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isProvide",{get:function(){return Object.keys(this.providesMap).length>0},enumerable:!1,configurable:!0}),e.prototype.removeAttribute=function(e){t.prototype.removeAttribute.call(this,e),this.isInstalled&&this.update()},e.prototype.setAttribute=function(e,n){var o;o=n&&"object"==typeof n?JSON.stringify(n):n,t.prototype.setAttribute.call(this,e,o),this.isInstalled&&(this[e]=n)},e.prototype.getAttribute=function(e){var n=this[e];return n||(n=t.prototype.getAttribute.call(this,e)),n},e.prototype.pureRemoveAttribute=function(e){t.prototype.removeAttribute.call(this,e)},e.prototype.pureSetAttribute=function(e,n){t.prototype.setAttribute.call(this,e,n)},e.prototype.attributeChangedCallback=function(t,e,n){this.update([],!1)},e.prototype.update=function(t,e){this.callUpdate(t,e)},e.prototype.callUpdate=function(t,e){if(this.isInstalled&&!this.willUpdate&&this.preBeforeUpdate()){this.willUpdate=!0,this.beforeUpdate(),this.beforeRender(),this.customStyleContent!=this.$options.css&&(this.customStyleContent=this.$options.css);var n=this.render(this.$reactive,this.store);this.rendered(),this.rootNode=x(this.rootNode,n,(null==this?void 0:this.shadowRoot)||this,this,e),this.willUpdate=!1,this.updated()}},e.prototype.initShadowRoot=function(){var t,e,n;if("LightDom"===this.$options.is)n=this;else{n=this.shadowRoot||(null===(t=this.attachShadow)||void 0===t?void 0:t.call(this,{mode:"open"}));for(var o=void 0;o=n.firstChild;)n.removeChild(o)}n=this.initCss(n),this.css&&n.appendChild(f("function"==typeof this.css?this.css():this.css));var r=null===(e=this.$reactive)||void 0===e?void 0:e.css;return r&&(this.customStyleElement=f(r),this.customStyleContent=r,n.appendChild(this.customStyleElement)),n},e.prototype.updateInject=function(t){var e=this;this.isInject&&Promise.resolve().then((function(){for(var n,o,r=e.parentNode;r&&!o;)(o=r.isProvide?r.providesMap:void 0)&&(n=r),r=r.parentNode||r.host;if(o)return e.injectsList.forEach((function(t){var r=o[t.key].functionName;e[t.attr]=n[r]()})),void("function"==typeof t&&t());console.warn("The provide prop was not found on the parent node or the provide type is incorrect. please check ".concat(e.tagName))}))},e.prototype.connectedCallback=function(){var t=this;this.updateInject(this.update.bind(this));var e=this.initShadowRoot();this.attrsToProps(),this.beforeInstall(),this.install(),this.afterInstall(),this.beforeRender();var n=this.render(this.$reactive,this.store);this.rootNode=x(null,n,null,this),!0===this.$options.isMountDom&&(Array.isArray(this.rootNode)?this.rootNode.forEach((function(t){return e.appendChild(t)})):this.rootNode&&e.appendChild(this.rootNode)),this.isInstalled=!0,this.rendered(),this.isInject?Promise.resolve().then((function(){return t.connected(e)})):this.connected(e)},e.prototype.disconnectedCallback=function(){this.disConnected()},e.prototype.connected=function(t){},e.prototype.disConnected=function(){},e.prototype.preBeforeUpdate=function(){return!0},e.prototype.beforeUpdate=function(){},e.prototype.updated=function(){},e.prototype.forceUpdate=function(){this.update([],!0)},e.prototype.updateProps=function(t){var e=this;Object.keys(t).forEach((function(n){e[n]=t[n],e.prevProps&&(e.prevProps[n]=t[n])})),this.forceUpdate()},e.prototype.attrsToProps=function(t){var e=this,n=this,o=function(t){for(var e={},n=0,o=t.attributes.length;n2;)D.push(arguments[i]);for(e&&null!=e.children&&(D.length||D.push(e.children),delete e.children);D.length;)if((o=D.pop())&&void 0!==o.pop)for(i=o.length;i--;)D.push(o[i]);else"boolean"==typeof o&&(o=null),(r="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(r=!1)),r&&n?s[s.length-1]+=o:0===s.length?s=[o]:s.push(o),n=r;if(t===h)return s;var a={nodeName:t,children:s,attributes:null==e?void 0:e,key:null==e?void 0:e.key};return void 0!==g.vnode&&g.vnode(a),a},t.mounts=[],t.recollectNodeTree=W,t.removeChildren=V,Object.defineProperty(t,"__esModule",{value:!0})}));
diff --git a/component/packages/wu-code-playground/deplpy/static/playground/index.umd.js b/component/packages/wu-code-playground/deplpy/static/playground/index.umd.js
new file mode 100644
index 00000000..db2e3cb1
--- /dev/null
+++ b/component/packages/wu-code-playground/deplpy/static/playground/index.umd.js
@@ -0,0 +1 @@
+!function(g,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports,require("@wu-component/web-core-plus")):"function"==typeof define&&define.amd?define(["exports","@wu-component/web-core-plus"],I):I((g="undefined"!=typeof globalThis?globalThis:g||self).WuCodePlayground={},g.webCorePlus)}(this,(function(g,I){"use strict";var C=function(g,I){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,I){g.__proto__=I}||function(g,I){for(var C in I)Object.prototype.hasOwnProperty.call(I,C)&&(g[C]=I[C])},C(g,I)};function A(g,I,C,A){var l,n=arguments.length,V=n<3?I:null===A?A=Object.getOwnPropertyDescriptor(I,C):A;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)V=Reflect.decorate(g,I,C,A);else for(var Z=g.length-1;Z>=0;Z--)(l=g[Z])&&(V=(n<3?l(V):n>3?l(I,C,V):l(I,C))||V);return n>3&&V&&Object.defineProperty(I,C,V),V}function l(g,I){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(g,I)}function n(g,I,C,A){return new(C||(C=Promise))((function(l,n){function V(g){try{c(A.next(g))}catch(g){n(g)}}function Z(g){try{c(A.throw(g))}catch(g){n(g)}}function c(g){var I;g.done?l(g.value):(I=g.value,I instanceof C?I:new C((function(g){g(I)}))).then(V,Z)}c((A=A.apply(g,I||[])).next())}))}function V(g,I){var C,A,l,n,V={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return n={next:Z(0),throw:Z(1),return:Z(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function Z(n){return function(Z){return function(n){if(C)throw new TypeError("Generator is already executing.");for(;V;)try{if(C=1,A&&(l=2&n[0]?A.return:n[0]?A.throw||((l=A.return)&&l.call(A),0):A.next)&&!(l=l.call(A,n[1])).done)return l;switch(A=0,l&&(n=[2&n[0],l.value]),n[0]){case 0:case 1:l=n;break;case 4:return V.label++,{value:n[1],done:!1};case 5:V.label++,A=n[1],n=[0];continue;case 7:n=V.ops.pop(),V.trys.pop();continue;default:if(!(l=V.trys,(l=l.length>0&&l[l.length-1])||6!==n[0]&&2!==n[0])){V=0;continue}if(3===n[0]&&(!l||n[1]>l[0]&&n[1]=0;c--)(e=g[c])&&(o=(n<3?e(o):n>3?e(I,C,o):e(I,C))||o);return n>3&&o&&Object.defineProperty(I,C,o),o}function n(g,I){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(g,I)}function o(g,I,C,A){return new(C||(C=Promise))((function(e,n){function o(g){try{t(A.next(g))}catch(g){n(g)}}function c(g){try{t(A.throw(g))}catch(g){n(g)}}function t(g){var I;g.done?e(g.value):(I=g.value,I instanceof C?I:new C((function(g){g(I)}))).then(o,c)}t((A=A.apply(g,I||[])).next())}))}function c(g,I){var C,A,e,n,o={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return n={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function c(n){return function(c){return function(n){if(C)throw new TypeError("Generator is already executing.");for(;o;)try{if(C=1,A&&(e=2&n[0]?A.return:n[0]?A.throw||((e=A.return)&&e.call(A),0):A.next)&&!(e=e.call(A,n[1])).done)return e;switch(A=0,e&&(n=[2&n[0],e.value]),n[0]){case 0:case 1:e=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,A=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(e=o.trys,(e=e.length>0&&e[e.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!e||n[1]>e[0]&&n[1]0)&&!(A=n.next()).done;)o.push(A.value)}catch(g){e={error:g}}finally{try{A&&!A.done&&(C=n.return)&&C.call(n)}finally{if(e)throw e.error}}return o}(this.pending_cmds.keys()),!1))},g.prototype.handle_repl_message=function(g){if(g.source===this.iframe.contentWindow){var I=g.data,C=I.action,A=I.args;switch(this.handlers.on_default_event(g),C){case"cmd_error":case"cmd_ok":return this.handle_command_message(g.data);case"fetch_progress":return this.handlers.on_fetch_progress(A.remaining);case"error":return this.handlers.on_error(g.data);case"unhandledrejection":return this.handlers.on_unhandled_rejection(g.data);case"console":return this.handlers.on_console(g.data);case"console_group":return this.handlers.on_console_group(g.data);case"console_group_collapsed":return this.handlers.on_console_group_collapsed(g.data);case"console_group_end":return this.handlers.on_console_group_end(g.data)}}},g.prototype.eval=function(g){return this.iframe_command("eval",{script:g})},g.prototype.handle_links=function(){return this.iframe_command("catch_clicks",{})},g.prototype.load_depend=function(g){return this.iframe_command("load_dependencies",g)},g}(),d="CODE_DEPENDENCIES",s="CODE_TYPES",b=function(){function g(g){void 0===g&&(g={dependencies:{},types:{}}),this.code=[],this.init(g)}return g.prototype.init=function(g){var I=g.dependencies,C=void 0===I?{}:I,e=g.types,n=void 0===e?{}:e,o=localStorage.getItem(d)?JSON.parse(localStorage.getItem(d)):{},c=localStorage.getItem(s)?JSON.parse(localStorage.getItem(s)):{};o=A(A({},o),C||{}),c=A(A({},c),{types:n||{}}),localStorage.setItem(d,JSON.stringify(o)),localStorage.setItem(s,JSON.stringify(c)),this.__dependencies=o,this.__types=c},g.prototype.createDependencies=function(g,I){this.__dependencies=A(A({},this.__dependencies),{name:I}),localStorage.setItem(d,JSON.stringify(this.__dependencies))},Object.defineProperty(g.prototype,"dependencies",{get:function(){return this.__dependencies},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"types",{get:function(){return this.__types},enumerable:!1,configurable:!0}),g.prototype.pushStackCode=function(g){this.code.push(g)},g}(),r=function(g){function A(){var I=g.call(this)||this;return I.container=null,I}return function(g,I){if("function"!=typeof I&&null!==I)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function A(){this.constructor=g}C(g,I),g.prototype=null===I?Object.create(I):(A.prototype=I.prototype,new A)}(A,g),A.prototype.formatFile=function(g){return new Promise((function(I){if(g.startsWith("data:")){for(var C=g.split(","),A=atob(C[1]),e=A.length,n=new Uint8Array(e);e--;)n[e]=A.charCodeAt(e);var o=new File([n],"srcdoc.html",{type:"text/html"}),c=new FileReader;c.onload=function(){I(c.result)},c.readAsText(o,"utf-8")}else I(g)}))},A.prototype.connected=function(g){return o(this,void 0,void 0,(function(){var I,C,A,e,n,o=this;return c(this,(function(c){switch(c.label){case 0:return I=this.props.initialSrcDoc,this.container=g.querySelector("#codeIframe"),C=document.createElement("div"),A={},I?(e=this,[4,this.formatFile(I)]):[3,2];case 1:e.initialSrcDoc=c.sent(),C.innerHTML=this.initialSrcDoc,n=C.querySelector("#dependenciesMap"),A=JSON.parse(n.innerHTML)?JSON.parse(n.innerHTML).imports:{},c.label=2;case 2:return this.previewStore=new b({dependencies:A}),this.proxy=new i(this.container,{on_fetch_progress:function(g){},on_error:function(g){console.log("on_error",g)},on_unhandled_rejection:function(g){console.log("on_unhandled_rejection",g)},on_console:function(g){console.log("log",g)},on_console_group:function(g){},on_console_group_end:function(g){},on_console_group_collapsed:function(g){},on_default_event:function(g){o.emitEvent(g)}}),this.container.addEventListener("load",(function(){o.proxy.handle_links().then((function(g){})),o.proxy.load_depend({dependencies:o.previewStore.dependencies}).then((function(){for(var g=0;g
+
+
+
-
-