Files
mixly3/boards/default/python_pyodide/main.bundle.js
2024-11-29 14:18:30 +08:00

31 lines
684 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(()=>{var __webpack_modules__={936:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(t,e){return e.definitions_.import_cv2="import cv2",["cv2.imread("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cv_show_image=function(t,e){return e.definitions_.import_cv2="import cv2","cv2.imshow("+e.valueToCode(this,"data",e.ORDER_ATOMIC)+","+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},cv_write_image=function(t,e){return e.definitions_.import_cv2="import cv2","cv2.imwrite("+e.valueToCode(this,"data",e.ORDER_ATOMIC)+","+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},cv_waitkey=function(t,e){return e.definitions_.import_cv2="import cv2","cv2.waitKey("+e.valueToCode(this,"data",e.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(t,e){e.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(t,e){return e.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cv_face_detect=function(t,e){e.definitions_.import_cv2="import cv2";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return[e.valueToCode(this,"FACE",e.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+e.valueToCode(this,"SCALE",e.ORDER_ATOMIC)+",minNeighbors="+e.valueToCode(this,"NEIGHBOR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},cv_face_detect_all=function(t,e){e.definitions_.import_cv2="import cv2";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return[e.valueToCode(this,"FACE",e.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+e.valueToCode(this,"SCALE",e.ORDER_ATOMIC)+",minNeighbors="+e.valueToCode(this,"NEIGHBOR",e.ORDER_ATOMIC)+",minSize=("+e.valueToCode(this,"x1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"y1",e.ORDER_ATOMIC)+"),maxSize=("+e.valueToCode(this,"x2",e.ORDER_ATOMIC)+","+e.valueToCode(this,"y2",e.ORDER_ATOMIC)+"))",e.ORDER_ATOMIC]}},153:(t,e,n)=>{"use strict";const{SymbolDispose:i}=n(4184),{AbortError:s,codes:o}=n(6605),{isNodeStream:r,isWebStream:a,kControllerErrorFunction:l}=n(6569),u=n(9700),{ERR_INVALID_ARG_TYPE:p}=o;let _;t.exports.addAbortSignal=function(e,n){if(((t,e)=>{if("object"!=typeof t||!("aborted"in t))throw new p(e,"AbortSignal",t)})(e,"signal"),!r(n)&&!a(n))throw new p("stream",["ReadableStream","WritableStream","Stream"],n);return t.exports.addAbortSignalNoValidate(e,n)},t.exports.addAbortSignalNoValidate=function(t,e){if("object"!=typeof t||!("aborted"in t))return e;const o=r(e)?()=>{e.destroy(new s(void 0,{cause:t.reason}))}:()=>{e[l](new s(void 0,{cause:t.reason}))};if(t.aborted)o();else{_=_||n(798).addAbortListener;const s=_(t,o);u(e,s[i])}return e}},1515:(t,e,n)=>{"use strict";const{StringPrototypeSlice:i,SymbolIterator:s,TypedArrayPrototypeSet:o,Uint8Array:r}=n(4184),{Buffer:a}=n(8287),{inspect:l}=n(798);t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}unshift(t){const e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}shift(){if(0===this.length)return;const t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(0===this.length)return"";let e=this.head,n=""+e.data;for(;null!==(e=e.next);)n+=t+e.data;return n}concat(t){if(0===this.length)return a.alloc(0);const e=a.allocUnsafe(t>>>0);let n=this.head,i=0;for(;n;)o(e,n.data,i),i+=n.data.length,n=n.next;return e}consume(t,e){const n=this.head.data;if(t<n.length){const e=n.slice(0,t);return this.head.data=n.slice(t),e}return t===n.length?this.shift():e?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[s](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let e="",n=this.head,s=0;do{const o=n.data;if(!(t>o.length)){t===o.length?(e+=o,++s,n.next?this.head=n.next:this.head=this.tail=null):(e+=i(o,0,t),this.head=n,n.data=i(o,t));break}e+=o,t-=o.length,++s}while(null!==(n=n.next));return this.length-=s,e}_getBuffer(t){const e=a.allocUnsafe(t),n=t;let i=this.head,s=0;do{const a=i.data;if(!(t>a.length)){t===a.length?(o(e,a,n-t),++s,i.next?this.head=i.next:this.head=this.tail=null):(o(e,new r(a.buffer,a.byteOffset,t),n-t),this.head=i,i.data=a.slice(t));break}o(e,a,n-t),t-=a.length,++s}while(null!==(i=i.next));return this.length-=s,e}[Symbol.for("nodejs.util.inspect.custom")](t,e){return l(this,{...e,depth:0,customInspect:!1})}}},6864:(t,e,n)=>{"use strict";const{pipeline:i}=n(872),s=n(4992),{destroyer:o}=n(2430),{isNodeStream:r,isReadable:a,isWritable:l,isWebStream:u,isTransformStream:p,isWritableStream:_,isReadableStream:d}=n(6569),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:c,ERR_MISSING_ARGS:T}}=n(6605),I=n(9700);t.exports=function(...t){if(0===t.length)throw new T("streams");if(1===t.length)return s.from(t[0]);const e=[...t];if("function"==typeof t[0]&&(t[0]=s.from(t[0])),"function"==typeof t[t.length-1]){const e=t.length-1;t[e]=s.from(t[e])}for(let n=0;n<t.length;++n)if(r(t[n])||u(t[n])){if(n<t.length-1&&!(a(t[n])||d(t[n])||p(t[n])))throw new c(`streams[${n}]`,e[n],"must be readable");if(n>0&&!(l(t[n])||_(t[n])||p(t[n])))throw new c(`streams[${n}]`,e[n],"must be writable")}let n,m,E,f,g;const O=t[0],M=i(t,(function(t){const e=f;f=null,e?e(t):t?g.destroy(t):A||R||g.destroy()})),R=!!(l(O)||_(O)||p(O)),A=!!(a(M)||d(M)||p(M));if(g=new s({writableObjectMode:!(null==O||!O.writableObjectMode),readableObjectMode:!(null==M||!M.readableObjectMode),writable:R,readable:A}),R){if(r(O))g._write=function(t,e,i){O.write(t,e)?i():n=i},g._final=function(t){O.end(),m=t},O.on("drain",(function(){if(n){const t=n;n=null,t()}}));else if(u(O)){const t=(p(O)?O.writable:O).getWriter();g._write=async function(e,n,i){try{await t.ready,t.write(e).catch((()=>{})),i()}catch(t){i(t)}},g._final=async function(e){try{await t.ready,t.close().catch((()=>{})),m=e}catch(t){e(t)}}}const t=p(M)?M.readable:M;I(t,(()=>{if(m){const t=m;m=null,t()}}))}if(A)if(r(M))M.on("readable",(function(){if(E){const t=E;E=null,t()}})),M.on("end",(function(){g.push(null)})),g._read=function(){for(;;){const t=M.read();if(null===t)return void(E=g._read);if(!g.push(t))return}};else if(u(M)){const t=(p(M)?M.readable:M).getReader();g._read=async function(){for(;;)try{const{value:e,done:n}=await t.read();if(!g.push(e))return;if(n)return void g.push(null)}catch{return}}}return g._destroy=function(t,e){t||null===f||(t=new h),E=null,n=null,m=null,null===f?e(t):(f=e,r(M)&&o(M,t))},g}},2430:(t,e,n)=>{"use strict";const i=n(5606),{aggregateTwoErrors:s,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:r}=n(6605),{Symbol:a}=n(4184),{kIsDestroyed:l,isDestroyed:u,isFinished:p,isServerRequest:_}=n(6569),d=a("kDestroy"),h=a("kConstruct");function c(t,e,n){t&&(t.stack,e&&!e.errored&&(e.errored=t),n&&!n.errored&&(n.errored=t))}function T(t,e,n){let s=!1;function o(e){if(s)return;s=!0;const o=t._readableState,r=t._writableState;c(e,r,o),r&&(r.closed=!0),o&&(o.closed=!0),"function"==typeof n&&n(e),e?i.nextTick(I,t,e):i.nextTick(m,t)}try{t._destroy(e||null,o)}catch(e){o(e)}}function I(t,e){E(t,e),m(t)}function m(t){const e=t._readableState,n=t._writableState;n&&(n.closeEmitted=!0),e&&(e.closeEmitted=!0),(null!=n&&n.emitClose||null!=e&&e.emitClose)&&t.emit("close")}function E(t,e){const n=t._readableState,i=t._writableState;null!=i&&i.errorEmitted||null!=n&&n.errorEmitted||(i&&(i.errorEmitted=!0),n&&(n.errorEmitted=!0),t.emit("error",e))}function f(t,e,n){const s=t._readableState,o=t._writableState;if(null!=o&&o.destroyed||null!=s&&s.destroyed)return this;null!=s&&s.autoDestroy||null!=o&&o.autoDestroy?t.destroy(e):e&&(e.stack,o&&!o.errored&&(o.errored=e),s&&!s.errored&&(s.errored=e),n?i.nextTick(E,t,e):E(t,e))}function g(t){let e=!1;function n(n){if(e)return void f(t,null!=n?n:new o);e=!0;const s=t._readableState,r=t._writableState,a=r||s;s&&(s.constructed=!0),r&&(r.constructed=!0),a.destroyed?t.emit(d,n):n?f(t,n,!0):i.nextTick(O,t)}try{t._construct((t=>{i.nextTick(n,t)}))}catch(t){i.nextTick(n,t)}}function O(t){t.emit(h)}function M(t){return(null==t?void 0:t.setHeader)&&"function"==typeof t.abort}function R(t){t.emit("close")}function A(t,e){t.emit("error",e),i.nextTick(R,t)}t.exports={construct:function(t,e){if("function"!=typeof t._construct)return;const n=t._readableState,s=t._writableState;n&&(n.constructed=!1),s&&(s.constructed=!1),t.once(h,e),t.listenerCount(h)>1||i.nextTick(g,t)},destroyer:function(t,e){t&&!u(t)&&(e||p(t)||(e=new r),_(t)?(t.socket=null,t.destroy(e)):M(t)?t.abort():M(t.req)?t.req.abort():"function"==typeof t.destroy?t.destroy(e):"function"==typeof t.close?t.close():e?i.nextTick(A,t,e):i.nextTick(R,t),t.destroyed||(t[l]=!0))},destroy:function(t,e){const n=this._readableState,i=this._writableState,o=i||n;return null!=i&&i.destroyed||null!=n&&n.destroyed?("function"==typeof e&&e(),this):(c(t,i,n),i&&(i.destroyed=!0),n&&(n.destroyed=!0),o.constructed?T(this,t,e):this.once(d,(function(n){T(this,s(n,t),e)})),this)},undestroy:function(){const t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=!1===t.readable,t.endEmitted=!1===t.readable),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=!1===e.writable,e.ending=!1===e.writable,e.finished=!1===e.writable)},errorOrDestroy:f}},4992:(t,e,n)=>{"use strict";const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:s,ObjectKeys:o,ObjectSetPrototypeOf:r}=n(4184);t.exports=u;const a=n(6566),l=n(394);r(u.prototype,a.prototype),r(u,a);{const t=o(l.prototype);for(let e=0;e<t.length;e++){const n=t[e];u.prototype[n]||(u.prototype[n]=l.prototype[n])}}function u(t){if(!(this instanceof u))return new u(t);a.call(this,t),l.call(this,t),t?(this.allowHalfOpen=!1!==t.allowHalfOpen,!1===t.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===t.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let p,_;function d(){return void 0===p&&(p={}),p}i(u.prototype,{writable:{__proto__:null,...s(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...s(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...s(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...s(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...s(l.prototype,"writableLength")},writableFinished:{__proto__:null,...s(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...s(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...s(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...s(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}}),u.fromWeb=function(t,e){return d().newStreamDuplexFromReadableWritablePair(t,e)},u.toWeb=function(t){return d().newReadableWritablePairFromDuplex(t)},u.from=function(t){return _||(_=n(4512)),_(t,"body")}},4512:(t,e,n)=>{const i=n(5606),s=n(8287),{isReadable:o,isWritable:r,isIterable:a,isNodeStream:l,isReadableNodeStream:u,isWritableNodeStream:p,isDuplexNodeStream:_,isReadableStream:d,isWritableStream:h}=n(6569),c=n(9700),{AbortError:T,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:m}}=n(6605),{destroyer:E}=n(2430),f=n(4992),g=n(6566),O=n(394),{createDeferredPromise:M}=n(798),R=n(3182),A=globalThis.Blob||s.Blob,S=void 0!==A?function(t){return t instanceof A}:function(t){return!1},C=globalThis.AbortController||n(5568).AbortController,{FunctionPrototypeCall:L}=n(4184);class y extends f{constructor(t){super(t),!1===(null==t?void 0:t.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==t?void 0:t.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function D(t){const e=t.readable&&"function"!=typeof t.readable.read?g.wrap(t.readable):t.readable,n=t.writable;let i,s,a,l,u,p=!!o(e),_=!!r(n);function d(t){const e=l;l=null,e?e(t):t&&u.destroy(t)}return u=new y({readableObjectMode:!(null==e||!e.readableObjectMode),writableObjectMode:!(null==n||!n.writableObjectMode),readable:p,writable:_}),_&&(c(n,(t=>{_=!1,t&&E(e,t),d(t)})),u._write=function(t,e,s){n.write(t,e)?s():i=s},u._final=function(t){n.end(),s=t},n.on("drain",(function(){if(i){const t=i;i=null,t()}})),n.on("finish",(function(){if(s){const t=s;s=null,t()}}))),p&&(c(e,(t=>{p=!1,t&&E(e,t),d(t)})),e.on("readable",(function(){if(a){const t=a;a=null,t()}})),e.on("end",(function(){u.push(null)})),u._read=function(){for(;;){const t=e.read();if(null===t)return void(a=u._read);if(!u.push(t))return}}),u._destroy=function(t,o){t||null===l||(t=new T),a=null,i=null,s=null,null===l?o(t):(l=o,E(n,t),E(e,t))},u}t.exports=function t(e,n){if(_(e))return e;if(u(e))return D({readable:e});if(p(e))return D({writable:e});if(l(e))return D({writable:!1,readable:!1});if(d(e))return D({readable:g.fromWeb(e)});if(h(e))return D({writable:O.fromWeb(e)});if("function"==typeof e){const{value:t,write:s,final:o,destroy:r}=function(t){let{promise:e,resolve:n}=M();const s=new C,o=s.signal,r=t(async function*(){for(;;){const t=e;e=null;const{chunk:s,done:r,cb:a}=await t;if(i.nextTick(a),r)return;if(o.aborted)throw new T(void 0,{cause:o.reason});({promise:e,resolve:n}=M()),yield s}}(),{signal:o});return{value:r,write(t,e,i){const s=n;n=null,s({chunk:t,done:!1,cb:i})},final(t){const e=n;n=null,e({done:!0,cb:t})},destroy(t,e){s.abort(),e(t)}}}(e);if(a(t))return R(y,t,{objectMode:!0,write:s,final:o,destroy:r});const l=null==t?void 0:t.then;if("function"==typeof l){let e;const n=L(l,t,(t=>{if(null!=t)throw new m("nully","body",t)}),(t=>{E(e,t)}));return e=new y({objectMode:!0,readable:!1,write:s,final(t){o((async()=>{try{await n,i.nextTick(t,null)}catch(e){i.nextTick(t,e)}}))},destroy:r})}throw new m("Iterable, AsyncIterable or AsyncFunction",n,t)}if(S(e))return t(e.arrayBuffer());if(a(e))return R(y,e,{objectMode:!0,writable:!1});if(d(null==e?void 0:e.readable)&&h(null==e?void 0:e.writable))return y.fromWeb(e);if("object"==typeof(null==e?void 0:e.writable)||"object"==typeof(null==e?void 0:e.readable)){return D({readable:null!=e&&e.readable?u(null==e?void 0:e.readable)?null==e?void 0:e.readable:t(e.readable):void 0,writable:null!=e&&e.writable?p(null==e?void 0:e.writable)?null==e?void 0:e.writable:t(e.writable):void 0})}const s=null==e?void 0:e.then;if("function"==typeof s){let t;return L(s,e,(e=>{null!=e&&t.push(e),t.push(null)}),(e=>{E(t,e)})),t=new y({objectMode:!0,writable:!1,read(){}})}throw new I(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)}},9700:(t,e,n)=>{const i=n(5606),{AbortError:s,codes:o}=n(6605),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:u}=n(798),{validateAbortSignal:p,validateFunction:_,validateObject:d,validateBoolean:h}=n(6283),{Promise:c,PromisePrototypeThen:T,SymbolDispose:I}=n(4184),{isClosed:m,isReadable:E,isReadableNodeStream:f,isReadableStream:g,isReadableFinished:O,isReadableErrored:M,isWritable:R,isWritableNodeStream:A,isWritableStream:S,isWritableFinished:C,isWritableErrored:L,isNodeStream:y,willEmitClose:D,kIsClosedPromise:N}=n(6569);let b;const v=()=>{};function w(t,e,o){var h,c;if(2===arguments.length?(o=e,e=l):null==e?e=l:d(e,"options"),_(o,"callback"),p(e.signal,"options.signal"),o=u(o),g(t)||S(t))return function(t,e,o){let r=!1,a=v;if(e.signal)if(a=()=>{r=!0,o.call(t,new s(void 0,{cause:e.signal.reason}))},e.signal.aborted)i.nextTick(a);else{b=b||n(798).addAbortListener;const i=b(e.signal,a),s=o;o=u(((...e)=>{i[I](),s.apply(t,e)}))}const l=(...e)=>{r||i.nextTick((()=>o.apply(t,e)))};return T(t[N].promise,l,l),v}(t,e,o);if(!y(t))throw new r("stream",["ReadableStream","WritableStream","Stream"],t);const w=null!==(h=e.readable)&&void 0!==h?h:f(t),F=null!==(c=e.writable)&&void 0!==c?c:A(t),P=t._writableState,k=t._readableState,V=()=>{t.writable||U()};let Y=D(t)&&f(t)===w&&A(t)===F,x=C(t,!1);const U=()=>{x=!0,t.destroyed&&(Y=!1),(!Y||t.readable&&!w)&&(w&&!B||o.call(t))};let B=O(t,!1);const X=()=>{B=!0,t.destroyed&&(Y=!1),(!Y||t.writable&&!F)&&(F&&!x||o.call(t))},G=e=>{o.call(t,e)};let H=m(t);const W=()=>{H=!0;const e=L(t)||M(t);return e&&"boolean"!=typeof e?o.call(t,e):w&&!B&&f(t,!0)&&!O(t,!1)?o.call(t,new a):!F||x||C(t,!1)?void o.call(t):o.call(t,new a)},K=()=>{H=!0;const e=L(t)||M(t);if(e&&"boolean"!=typeof e)return o.call(t,e);o.call(t)},j=()=>{t.req.on("finish",U)};!function(t){return t.setHeader&&"function"==typeof t.abort}(t)?F&&!P&&(t.on("end",V),t.on("close",V)):(t.on("complete",U),Y||t.on("abort",W),t.req?j():t.on("request",j)),Y||"boolean"!=typeof t.aborted||t.on("aborted",W),t.on("end",X),t.on("finish",U),!1!==e.error&&t.on("error",G),t.on("close",W),H?i.nextTick(W):null!=P&&P.errorEmitted||null!=k&&k.errorEmitted?Y||i.nextTick(K):(w||Y&&!E(t)||!x&&!1!==R(t))&&(F||Y&&!R(t)||!B&&!1!==E(t))?k&&t.req&&t.aborted&&i.nextTick(K):i.nextTick(K);const q=()=>{o=v,t.removeListener("aborted",W),t.removeListener("complete",U),t.removeListener("abort",W),t.removeListener("request",j),t.req&&t.req.removeListener("finish",U),t.removeListener("end",V),t.removeListener("close",V),t.removeListener("finish",U),t.removeListener("end",X),t.removeListener("error",G),t.removeListener("close",W)};if(e.signal&&!H){const r=()=>{const n=o;q(),n.call(t,new s(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)i.nextTick(r);else{b=b||n(798).addAbortListener;const i=b(e.signal,r),s=o;o=u(((...e)=>{i[I](),s.apply(t,e)}))}}return q}t.exports=w,t.exports.finished=function(t,e){var n;let i=!1;return null===e&&(e=l),null!==(n=e)&&void 0!==n&&n.cleanup&&(h(e.cleanup,"cleanup"),i=e.cleanup),new c(((n,s)=>{const o=w(t,e,(t=>{i&&o(),t?s(t):n()}))}))}},3182:(t,e,n)=>{"use strict";const i=n(5606),{PromisePrototypeThen:s,SymbolAsyncIterator:o,SymbolIterator:r}=n(4184),{Buffer:a}=n(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:u}=n(6605).codes;t.exports=function(t,e,n){let p,_;if("string"==typeof e||e instanceof a)return new t({objectMode:!0,...n,read(){this.push(e),this.push(null)}});if(e&&e[o])_=!0,p=e[o]();else{if(!e||!e[r])throw new l("iterable",["Iterable"],e);_=!1,p=e[r]()}const d=new t({objectMode:!0,highWaterMark:1,...n});let h=!1;return d._read=function(){h||(h=!0,async function(){for(;;){try{const{value:t,done:e}=_?await p.next():p.next();if(e)d.push(null);else{const e=t&&"function"==typeof t.then?await t:t;if(null===e)throw h=!1,new u;if(d.push(e))continue;h=!1}}catch(t){d.destroy(t)}break}}())},d._destroy=function(t,e){s(async function(t){const e=null!=t,n="function"==typeof p.throw;if(e&&n){const{value:e,done:n}=await p.throw(t);if(await e,n)return}if("function"==typeof p.return){const{value:t}=await p.return();await t}}(t),(()=>i.nextTick(e,t)),(n=>i.nextTick(e,n||t)))},d}},2913:(t,e,n)=>{"use strict";const{ArrayIsArray:i,ObjectSetPrototypeOf:s}=n(4184),{EventEmitter:o}=n(7007);function r(t){o.call(this,t)}function a(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?i(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}s(r.prototype,o.prototype),s(r,o),r.prototype.pipe=function(t,e){const n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function s(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",s),t._isStdio||e&&!1===e.end||(n.on("end",l),n.on("close",u));let r=!1;function l(){r||(r=!0,t.end())}function u(){r||(r=!0,"function"==typeof t.destroy&&t.destroy())}function p(t){_(),0===o.listenerCount(this,"error")&&this.emit("error",t)}function _(){n.removeListener("data",i),t.removeListener("drain",s),n.removeListener("end",l),n.removeListener("close",u),n.removeListener("error",p),t.removeListener("error",p),n.removeListener("end",_),n.removeListener("close",_),t.removeListener("close",_)}return a(n,"error",p),a(t,"error",p),n.on("end",_),n.on("close",_),t.on("close",_),t.emit("pipe",n),t},t.exports={Stream:r,prependListener:a}},5589:(t,e,n)=>{"use strict";const i=globalThis.AbortController||n(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:s,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:a},AbortError:l}=n(6605),{validateAbortSignal:u,validateInteger:p,validateObject:_}=n(6283),d=n(4184).Symbol("kWeak"),h=n(4184).Symbol("kResistStopPropagation"),{finished:c}=n(9700),T=n(6864),{addAbortSignalNoValidate:I}=n(153),{isWritable:m,isNodeStream:E}=n(6569),{deprecate:f}=n(798),{ArrayPrototypePush:g,Boolean:O,MathFloor:M,Number:R,NumberIsNaN:A,Promise:S,PromiseReject:C,PromiseResolve:L,PromisePrototypeThen:y,Symbol:D}=n(4184),N=D("kEmpty"),b=D("kEof");function v(t,e){if("function"!=typeof t)throw new o("fn",["Function","AsyncFunction"],t);null!=e&&_(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal");let i=1;null!=(null==e?void 0:e.concurrency)&&(i=M(e.concurrency));let s=i-1;return null!=(null==e?void 0:e.highWaterMark)&&(s=M(e.highWaterMark)),p(i,"options.concurrency",1),p(s,"options.highWaterMark",0),s+=i,async function*(){const o=n(798).AbortSignalAny([null==e?void 0:e.signal].filter(O)),r=this,a=[],u={signal:o};let p,_,d=!1,h=0;function c(){d=!0,T()}function T(){h-=1,I()}function I(){_&&!d&&h<i&&a.length<s&&(_(),_=null)}!async function(){try{for await(let e of r){if(d)return;if(o.aborted)throw new l;try{if(e=t(e,u),e===N)continue;e=L(e)}catch(t){e=C(t)}h+=1,y(e,T,c),a.push(e),p&&(p(),p=null),!d&&(a.length>=s||h>=i)&&await new S((t=>{_=t}))}a.push(b)}catch(t){const e=C(t);y(e,T,c),a.push(e)}finally{d=!0,p&&(p(),p=null)}}();try{for(;;){for(;a.length>0;){const t=await a[0];if(t===b)return;if(o.aborted)throw new l;t!==N&&(yield t),a.shift(),I()}await new S((t=>{p=t}))}}finally{d=!0,_&&(_(),_=null)}}.call(this)}async function w(t,e=void 0){for await(const n of F.call(this,t,e))return!0;return!1}function F(t,e){if("function"!=typeof t)throw new o("fn",["Function","AsyncFunction"],t);return v.call(this,(async function(e,n){return await t(e,n)?e:N}),e)}class P extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function k(t){if(t=R(t),A(t))return 0;if(t<0)throw new a("number",">= 0",t);return t}t.exports.streamReturningOperators={asIndexedPairs:f((function(t=void 0){return null!=t&&_(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),async function*(){let e=0;for await(const i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l({cause:t.signal.reason});yield[e++,i]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(t,e=void 0){return null!=e&&_(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),t=k(t),async function*(){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var i;if(null!=e&&null!==(i=e.signal)&&void 0!==i&&i.aborted)throw new l;t--<=0&&(yield n)}}.call(this)},filter:F,flatMap:function(t,e){const n=v.call(this,t,e);return async function*(){for await(const t of n)yield*t}.call(this)},map:v,take:function(t,e=void 0){return null!=e&&_(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),t=k(t),async function*(){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var i;if(null!=e&&null!==(i=e.signal)&&void 0!==i&&i.aborted)throw new l;if(t-- >0&&(yield n),t<=0)return}}.call(this)},compose:function(t,e){if(null!=e&&_(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),E(t)&&!m(t))throw new s("stream",t,"must be writable");const n=T(this,t);return null!=e&&e.signal&&I(e.signal,n),n}},t.exports.promiseReturningOperators={every:async function(t,e=void 0){if("function"!=typeof t)throw new o("fn",["Function","AsyncFunction"],t);return!await w.call(this,(async(...e)=>!await t(...e)),e)},forEach:async function(t,e){if("function"!=typeof t)throw new o("fn",["Function","AsyncFunction"],t);for await(const n of v.call(this,(async function(e,n){return await t(e,n),N}),e));},reduce:async function(t,e,n){var s;if("function"!=typeof t)throw new o("reducer",["Function","AsyncFunction"],t);null!=n&&_(n,"options"),null!=(null==n?void 0:n.signal)&&u(n.signal,"options.signal");let r=arguments.length>1;if(null!=n&&null!==(s=n.signal)&&void 0!==s&&s.aborted){const t=new l(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await c(this.destroy(t)),t}const a=new i,p=a.signal;if(null!=n&&n.signal){const t={once:!0,[d]:this,[h]:!0};n.signal.addEventListener("abort",(()=>a.abort()),t)}let T=!1;try{for await(const i of this){var I;if(T=!0,null!=n&&null!==(I=n.signal)&&void 0!==I&&I.aborted)throw new l;r?e=await t(e,i,{signal:p}):(e=i,r=!0)}if(!T&&!r)throw new P}finally{a.abort()}return e},toArray:async function(t){null!=t&&_(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal");const e=[];for await(const i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:t.signal.reason});g(e,i)}return e},some:w,find:async function(t,e){for await(const n of F.call(this,t,e))return n}}},6898:(t,e,n)=>{"use strict";const{ObjectSetPrototypeOf:i}=n(4184);t.exports=o;const s=n(208);function o(t){if(!(this instanceof o))return new o(t);s.call(this,t)}i(o.prototype,s.prototype),i(o,s),o.prototype._transform=function(t,e,n){n(null,t)}},872:(t,e,n)=>{const i=n(5606),{ArrayIsArray:s,Promise:o,SymbolAsyncIterator:r,SymbolDispose:a}=n(4184),l=n(9700),{once:u}=n(798),p=n(2430),_=n(4992),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:c,ERR_MISSING_ARGS:T,ERR_STREAM_DESTROYED:I,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:E}=n(6605),{validateFunction:f,validateAbortSignal:g}=n(6283),{isIterable:O,isReadable:M,isReadableNodeStream:R,isNodeStream:A,isTransformStream:S,isWebStream:C,isReadableStream:L,isReadableFinished:y}=n(6569),D=globalThis.AbortController||n(5568).AbortController;let N,b,v;function w(t,e,n){let i=!1;t.on("close",(()=>{i=!0}));return{destroy:e=>{i||(i=!0,p.destroyer(t,e||new I("pipe")))},cleanup:l(t,{readable:e,writable:n},(t=>{i=!t}))}}function F(t){if(O(t))return t;if(R(t))return async function*(t){b||(b=n(6566));yield*b.prototype[r].call(t)}(t);throw new h("val",["Readable","Iterable","AsyncIterable"],t)}async function P(t,e,n,{end:i}){let s,r=null;const a=t=>{if(t&&(s=t),r){const t=r;r=null,t()}},u=()=>new o(((t,e)=>{s?e(s):r=()=>{s?e(s):t()}}));e.on("drain",a);const p=l(e,{readable:!1},a);try{e.writableNeedDrain&&await u();for await(const n of t)e.write(n)||await u();i&&(e.end(),await u()),n()}catch(t){n(s!==t?d(s,t):t)}finally{p(),e.off("drain",a)}}async function k(t,e,n,{end:i}){S(e)&&(e=e.writable);const s=e.getWriter();try{for await(const e of t)await s.ready,s.write(e).catch((()=>{}));await s.ready,i&&await s.close(),n()}catch(t){try{await s.abort(t),n(t)}catch(t){n(t)}}}function V(t,e,o){if(1===t.length&&s(t[0])&&(t=t[0]),t.length<2)throw new T("streams");const r=new D,l=r.signal,u=null==o?void 0:o.signal,p=[];function d(){U(new E)}let I,m,f;g(u,"options.signal"),v=v||n(798).addAbortListener,u&&(I=v(u,d));const y=[];let b,V=0;function x(t){U(t,0==--V)}function U(t,n){var s;if(!t||m&&"ERR_STREAM_PREMATURE_CLOSE"!==m.code||(m=t),m||n){for(;y.length;)y.shift()(m);null===(s=I)||void 0===s||s[a](),r.abort(),n&&(m||p.forEach((t=>t())),i.nextTick(e,m,f))}}for(let H=0;H<t.length;H++){const W=t[H],K=H<t.length-1,j=H>0,q=K||!1!==(null==o?void 0:o.end),$=H===t.length-1;if(A(W)){if(q){const{destroy:z,cleanup:Q}=w(W,K,j);y.push(z),M(W)&&$&&p.push(Q)}function B(t){t&&"AbortError"!==t.name&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code&&x(t)}W.on("error",B),M(W)&&$&&p.push((()=>{W.removeListener("error",B)}))}if(0===H)if("function"==typeof W){if(b=W({signal:l}),!O(b))throw new c("Iterable, AsyncIterable or Stream","source",b)}else b=O(W)||R(W)||S(W)?W:_.from(W);else if("function"==typeof W){var X;if(S(b))b=F(null===(X=b)||void 0===X?void 0:X.readable);else b=F(b);if(b=W(b,{signal:l}),K){if(!O(b,!0))throw new c("AsyncIterable",`transform[${H-1}]`,b)}else{var G;N||(N=n(6898));const J=new N({objectMode:!0}),Z=null===(G=b)||void 0===G?void 0:G.then;if("function"==typeof Z)V++,Z.call(b,(t=>{f=t,null!=t&&J.write(t),q&&J.end(),i.nextTick(x)}),(t=>{J.destroy(t),i.nextTick(x,t)}));else if(O(b,!0))V++,P(b,J,x,{end:q});else{if(!L(b)&&!S(b))throw new c("AsyncIterable or Promise","destination",b);{const nt=b.readable||b;V++,P(nt,J,x,{end:q})}}b=J;const{destroy:tt,cleanup:et}=w(b,!1,!0);y.push(tt),$&&p.push(et)}}else if(A(W)){if(R(b)){V+=2;const it=Y(b,W,x,{end:q});M(W)&&$&&p.push(it)}else if(S(b)||L(b)){const st=b.readable||b;V++,P(st,W,x,{end:q})}else{if(!O(b))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);V++,P(b,W,x,{end:q})}b=W}else if(C(W)){if(R(b))V++,k(F(b),W,x,{end:q});else if(L(b)||O(b))V++,k(b,W,x,{end:q});else{if(!S(b))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);V++,k(b.readable,W,x,{end:q})}b=W}else b=_.from(W)}return(null!=l&&l.aborted||null!=u&&u.aborted)&&i.nextTick(d),b}function Y(t,e,n,{end:s}){let o=!1;if(e.on("close",(()=>{o||n(new m)})),t.pipe(e,{end:!1}),s){function r(){o=!0,e.end()}y(t)?i.nextTick(r):t.once("end",r)}else n();return l(t,{readable:!0,writable:!1},(e=>{const i=t._readableState;e&&"ERR_STREAM_PREMATURE_CLOSE"===e.code&&i&&i.ended&&!i.errored&&!i.errorEmitted?t.once("end",n).once("error",n):n(e)})),l(e,{readable:!1,writable:!0},n)}t.exports={pipelineImpl:V,pipeline:function(...t){return V(t,u(function(t){return f(t[t.length-1],"streams[stream.length - 1]"),t.pop()}(t)))}}},6566:(t,e,n)=>{const i=n(5606),{ArrayPrototypeIndexOf:s,NumberIsInteger:o,NumberIsNaN:r,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:u,ObjectSetPrototypeOf:p,Promise:_,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:c,Symbol:T}=n(4184);t.exports=$,$.ReadableState=q;const{EventEmitter:I}=n(7007),{Stream:m,prependListener:E}=n(2913),{Buffer:f}=n(8287),{addAbortSignal:g}=n(153),O=n(9700);let M=n(798).debuglog("stream",(t=>{M=t}));const R=n(1515),A=n(2430),{getHighWaterMark:S,getDefaultHighWaterMark:C}=n(9153),{aggregateTwoErrors:L,codes:{ERR_INVALID_ARG_TYPE:y,ERR_METHOD_NOT_IMPLEMENTED:D,ERR_OUT_OF_RANGE:N,ERR_STREAM_PUSH_AFTER_EOF:b,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:v},AbortError:w}=n(6605),{validateObject:F}=n(6283),P=T("kPaused"),{StringDecoder:k}=n(8707),V=n(3182);p($.prototype,m.prototype),p($,m);const Y=()=>{},{errorOrDestroy:x}=A,U=1,B=16,X=32,G=64,H=2048,W=4096,K=65536;function j(t){return{enumerable:!1,get(){return!!(this.state&t)},set(e){e?this.state|=t:this.state&=~t}}}function q(t,e,i){"boolean"!=typeof i&&(i=e instanceof n(4992)),this.state=H|W|B|X,t&&t.objectMode&&(this.state|=U),i&&t&&t.readableObjectMode&&(this.state|=U),this.highWaterMark=t?S(this,t,"readableHighWaterMark",i):C(!1),this.buffer=new R,this.length=0,this.pipes=[],this.flowing=null,this[P]=null,t&&!1===t.emitClose&&(this.state&=~H),t&&!1===t.autoDestroy&&(this.state&=~W),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new k(t.encoding),this.encoding=t.encoding)}function $(t){if(!(this instanceof $))return new $(t);const e=this instanceof n(4992);this._readableState=new q(t,this,e),t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&!e&&g(t.signal,this)),m.call(this,t),A.construct(this,(()=>{this._readableState.needReadable&&et(this,this._readableState)}))}function z(t,e,n,i){M("readableAddChunk",e);const s=t._readableState;let o;if(s.state&U||("string"==typeof e?(n=n||s.defaultEncoding,s.encoding!==n&&(i&&s.encoding?e=f.from(e,n).toString(s.encoding):(e=f.from(e,n),n=""))):e instanceof f?n="":m._isUint8Array(e)?(e=m._uint8ArrayToBuffer(e),n=""):null!=e&&(o=new y("chunk",["string","Buffer","Uint8Array"],e))),o)x(t,o);else if(null===e)s.state&=-9,function(t,e){if(M("onEofChunk"),e.ended)return;if(e.decoder){const t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?Z(t):(e.needReadable=!1,e.emittedReadable=!0,tt(t))}(t,s);else if(s.state&U||e&&e.length>0)if(i)if(4&s.state)x(t,new v);else{if(s.destroyed||s.errored)return!1;Q(t,s,e,!0)}else if(s.ended)x(t,new b);else{if(s.destroyed||s.errored)return!1;s.state&=-9,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?Q(t,s,e,!1):et(t,s)):Q(t,s,e,!1)}else i||(s.state&=-9,et(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function Q(t,e,n,i){e.flowing&&0===e.length&&!e.sync&&t.listenerCount("data")>0?(e.state&K?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.state&G&&Z(t)),et(t,e)}l(q.prototype,{objectMode:j(U),ended:j(2),endEmitted:j(4),reading:j(8),constructed:j(B),sync:j(X),needReadable:j(G),emittedReadable:j(128),readableListening:j(256),resumeScheduled:j(512),errorEmitted:j(1024),emitClose:j(H),autoDestroy:j(W),destroyed:j(8192),closed:j(16384),closeEmitted:j(32768),multiAwaitDrain:j(K),readingMore:j(1<<17),dataEmitted:j(1<<18)}),$.prototype.destroy=A.destroy,$.prototype._undestroy=A.undestroy,$.prototype._destroy=function(t,e){e(t)},$.prototype[I.captureRejectionSymbol]=function(t){this.destroy(t)},$.prototype[h]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new w,this.destroy(t)),new _(((e,n)=>O(this,(i=>i&&i!==t?n(i):e(null)))))},$.prototype.push=function(t,e){return z(this,t,e,!1)},$.prototype.unshift=function(t,e){return z(this,t,e,!0)},$.prototype.isPaused=function(){const t=this._readableState;return!0===t[P]||!1===t.flowing},$.prototype.setEncoding=function(t){const e=new k(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let i="";for(const t of n)i+=e.write(t);return n.clear(),""!==i&&n.push(i),this._readableState.length=i.length,this};function J(t,e){return t<=0||0===e.length&&e.ended?0:e.state&U?1:r(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}function Z(t){const e=t._readableState;M("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(M("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(tt,t))}function tt(t){const e=t._readableState;M("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||e.errored||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,rt(t)}function et(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,i.nextTick(nt,t,e))}function nt(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){const n=e.length;if(M("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function it(t){const e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!1===e[P]?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function st(t){M("readable nexttick read 0"),t.read(0)}function ot(t,e){M("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),rt(t),e.flowing&&!e.reading&&t.read(0)}function rt(t){const e=t._readableState;for(M("flow",e.flowing);e.flowing&&null!==t.read(););}function at(t,e){"function"!=typeof t.read&&(t=$.wrap(t,{objectMode:!0}));const n=async function*(t,e){let n,i=Y;function s(e){this===t?(i(),i=Y):i=e}t.on("readable",s);const o=O(t,{writable:!1},(t=>{n=t?L(n,t):null,i(),i=Y}));try{for(;;){const e=t.destroyed?null:t.read();if(null!==e)yield e;else{if(n)throw n;if(null===n)return;await new _(s)}}}catch(t){throw n=L(n,t),n}finally{!n&&!1===(null==e?void 0:e.destroyOnReturn)||void 0!==n&&!t._readableState.autoDestroy?(t.off("readable",s),o()):A.destroyer(t,null)}}(t,e);return n.stream=t,n}function lt(t,e){if(0===e.length)return null;let n;return e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n}function ut(t){const e=t._readableState;M("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(pt,e,t))}function pt(t,e){if(M("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&0===t.length)if(t.endEmitted=!0,e.emit("end"),e.writable&&!1===e.allowHalfOpen)i.nextTick(_t,e);else if(t.autoDestroy){const t=e._writableState;(!t||t.autoDestroy&&(t.finished||!1===t.writable))&&e.destroy()}}function _t(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}let dt;function ht(){return void 0===dt&&(dt={}),dt}$.prototype.read=function(t){M("read",t),void 0===t?t=NaN:o(t)||(t=a(t,10));const e=this._readableState,n=t;if(t>e.highWaterMark&&(e.highWaterMark=function(t){if(t>1073741824)throw new N("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,++t}(t)),0!==t&&(e.state&=-129),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return M("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?ut(this):Z(this),null;if(0===(t=J(t,e))&&e.ended)return 0===e.length&&ut(this),null;let i,s=!!(e.state&G);if(M("need readable",s),(0===e.length||e.length-t<e.highWaterMark)&&(s=!0,M("length less than watermark",s)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)s=!1,M("reading, ended or constructing",s);else if(s){M("do read"),e.state|=8|X,0===e.length&&(e.state|=G);try{this._read(e.highWaterMark)}catch(t){x(this,t)}e.state&=~X,e.reading||(t=J(n,e))}return i=t>0?lt(t,e):null,null===i?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&ut(this)),null===i||e.errorEmitted||e.closeEmitted||(e.dataEmitted=!0,this.emit("data",i)),i},$.prototype._read=function(t){throw new D("_read()")},$.prototype.pipe=function(t,e){const n=this,s=this._readableState;1===s.pipes.length&&(s.multiAwaitDrain||(s.multiAwaitDrain=!0,s.awaitDrainWriters=new d(s.awaitDrainWriters?[s.awaitDrainWriters]:[]))),s.pipes.push(t),M("pipe count=%d opts=%j",s.pipes.length,e);const o=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?a:I;function r(e,i){M("onunpipe"),e===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,function(){M("cleanup"),t.removeListener("close",c),t.removeListener("finish",T),l&&t.removeListener("drain",l);t.removeListener("error",h),t.removeListener("unpipe",r),n.removeListener("end",a),n.removeListener("end",I),n.removeListener("data",_),u=!0,l&&s.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}())}function a(){M("onend"),t.end()}let l;s.endEmitted?i.nextTick(o):n.once("end",o),t.on("unpipe",r);let u=!1;function p(){u||(1===s.pipes.length&&s.pipes[0]===t?(M("false write response, pause",0),s.awaitDrainWriters=t,s.multiAwaitDrain=!1):s.pipes.length>1&&s.pipes.includes(t)&&(M("false write response, pause",s.awaitDrainWriters.size),s.awaitDrainWriters.add(t)),n.pause()),l||(l=function(t,e){return function(){const n=t._readableState;n.awaitDrainWriters===e?(M("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(M("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!t.listenerCount("data")||t.resume()}}(n,t),t.on("drain",l))}function _(e){M("ondata");const n=t.write(e);M("dest.write",n),!1===n&&p()}function h(e){if(M("onerror",e),I(),t.removeListener("error",h),0===t.listenerCount("error")){const n=t._writableState||t._readableState;n&&!n.errorEmitted?x(t,e):t.emit("error",e)}}function c(){t.removeListener("finish",T),I()}function T(){M("onfinish"),t.removeListener("close",c),I()}function I(){M("unpipe"),n.unpipe(t)}return n.on("data",_),E(t,"error",h),t.once("close",c),t.once("finish",T),t.emit("pipe",n),!0===t.writableNeedDrain?p():s.flowing||(M("pipe resume"),n.resume()),t},$.prototype.unpipe=function(t){const e=this._readableState;if(0===e.pipes.length)return this;if(!t){const t=e.pipes;e.pipes=[],this.pause();for(let e=0;e<t.length;e++)t[e].emit("unpipe",this,{hasUnpiped:!1});return this}const n=s(e.pipes,t);return-1===n||(e.pipes.splice(n,1),0===e.pipes.length&&this.pause(),t.emit("unpipe",this,{hasUnpiped:!1})),this},$.prototype.on=function(t,e){const n=m.prototype.on.call(this,t,e),s=this._readableState;return"data"===t?(s.readableListening=this.listenerCount("readable")>0,!1!==s.flowing&&this.resume()):"readable"===t&&(s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.flowing=!1,s.emittedReadable=!1,M("on readable",s.length,s.reading),s.length?Z(this):s.reading||i.nextTick(st,this))),n},$.prototype.addListener=$.prototype.on,$.prototype.removeListener=function(t,e){const n=m.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(it,this),n},$.prototype.off=$.prototype.removeListener,$.prototype.removeAllListeners=function(t){const e=m.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(it,this),e},$.prototype.resume=function(){const t=this._readableState;return t.flowing||(M("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(ot,t,e))}(this,t)),t[P]=!1,this},$.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[P]=!0,this},$.prototype.wrap=function(t){let e=!1;t.on("data",(n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())})),t.on("end",(()=>{this.push(null)})),t.on("error",(t=>{x(this,t)})),t.on("close",(()=>{this.destroy()})),t.on("destroy",(()=>{this.destroy()})),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};const n=u(t);for(let e=1;e<n.length;e++){const i=n[e];void 0===this[i]&&"function"==typeof t[i]&&(this[i]=t[i].bind(t))}return this},$.prototype[c]=function(){return at(this)},$.prototype.iterator=function(t){return void 0!==t&&F(t,"options"),at(this,t)},l($.prototype,{readable:{__proto__:null,get(){const t=this._readableState;return!(!t||!1===t.readable||t.destroyed||t.errorEmitted||t.endEmitted)},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(q.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[P]},set(t){this[P]=!!t}}}),$._fromList=lt,$.from=function(t,e){return V($,t,e)},$.fromWeb=function(t,e){return ht().newStreamReadableFromReadableStream(t,e)},$.toWeb=function(t,e){return ht().newReadableStreamFromStreamReadable(t,e)},$.wrap=function(t,e){var n,i;return new $({objectMode:null===(n=null!==(i=t.readableObjectMode)&&void 0!==i?i:t.objectMode)||void 0===n||n,...e,destroy(e,n){A.destroyer(t,e),n(e)}}).wrap(t)}},9153:(t,e,n)=>{"use strict";const{MathFloor:i,NumberIsInteger:s}=n(4184),{validateInteger:o}=n(6283),{ERR_INVALID_ARG_VALUE:r}=n(6605).codes;let a=16384,l=16;function u(t){return t?l:a}t.exports={getHighWaterMark:function(t,e,n,o){const a=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,o,n);if(null!=a){if(!s(a)||a<0){throw new r(o?`options.${n}`:"options.highWaterMark",a)}return i(a)}return u(t.objectMode)},getDefaultHighWaterMark:u,setDefaultHighWaterMark:function(t,e){o(e,"value",0),t?l=e:a=e}}},208:(t,e,n)=>{"use strict";const{ObjectSetPrototypeOf:i,Symbol:s}=n(4184);t.exports=u;const{ERR_METHOD_NOT_IMPLEMENTED:o}=n(6605).codes,r=n(4992),{getHighWaterMark:a}=n(9153);i(u.prototype,r.prototype),i(u,r);const l=s("kCallback");function u(t){if(!(this instanceof u))return new u(t);const e=t?a(this,t,"readableHighWaterMark",!0):null;0===e&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),r.call(this,t),this._readableState.sync=!1,this[l]=null,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",_)}function p(t){"function"!=typeof this._flush||this.destroyed?(this.push(null),t&&t()):this._flush(((e,n)=>{e?t?t(e):this.destroy(e):(null!=n&&this.push(n),this.push(null),t&&t())}))}function _(){this._final!==p&&p.call(this)}u.prototype._final=p,u.prototype._transform=function(t,e,n){throw new o("_transform()")},u.prototype._write=function(t,e,n){const i=this._readableState,s=this._writableState,o=i.length;this._transform(t,e,((t,e)=>{t?n(t):(null!=e&&this.push(e),s.ended||o===i.length||i.length<i.highWaterMark?n():this[l]=n)}))},u.prototype._read=function(){if(this[l]){const t=this[l];this[l]=null,t()}}},6569:(t,e,n)=>{"use strict";const{SymbolAsyncIterator:i,SymbolIterator:s,SymbolFor:o}=n(4184),r=o("nodejs.stream.destroyed"),a=o("nodejs.stream.errored"),l=o("nodejs.stream.readable"),u=o("nodejs.stream.writable"),p=o("nodejs.stream.disturbed"),_=o("nodejs.webstream.isClosedPromise"),d=o("nodejs.webstream.controllerErrorFunction");function h(t,e=!1){var n;return!(!t||"function"!=typeof t.pipe||"function"!=typeof t.on||e&&("function"!=typeof t.pause||"function"!=typeof t.resume)||t._writableState&&!1===(null===(n=t._readableState)||void 0===n?void 0:n.readable)||t._writableState&&!t._readableState)}function c(t){var e;return!(!t||"function"!=typeof t.write||"function"!=typeof t.on||t._readableState&&!1===(null===(e=t._writableState)||void 0===e?void 0:e.writable))}function T(t){return t&&(t._readableState||t._writableState||"function"==typeof t.write&&"function"==typeof t.on||"function"==typeof t.pipe&&"function"==typeof t.on)}function I(t){return!(!t||T(t)||"function"!=typeof t.pipeThrough||"function"!=typeof t.getReader||"function"!=typeof t.cancel)}function m(t){return!(!t||T(t)||"function"!=typeof t.getWriter||"function"!=typeof t.abort)}function E(t){return!(!t||T(t)||"object"!=typeof t.readable||"object"!=typeof t.writable)}function f(t){if(!T(t))return null;const e=t._writableState,n=t._readableState,i=e||n;return!!(t.destroyed||t[r]||null!=i&&i.destroyed)}function g(t){if(!c(t))return null;if(!0===t.writableEnded)return!0;const e=t._writableState;return(null==e||!e.errored)&&("boolean"!=typeof(null==e?void 0:e.ended)?null:e.ended)}function O(t,e){if(!h(t))return null;const n=t._readableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===e&&!0===n.ended&&0===n.length))}function M(t){return t&&null!=t[l]?t[l]:"boolean"!=typeof(null==t?void 0:t.readable)?null:!f(t)&&(h(t)&&t.readable&&!O(t))}function R(t){return t&&null!=t[u]?t[u]:"boolean"!=typeof(null==t?void 0:t.writable)?null:!f(t)&&(c(t)&&t.writable&&!g(t))}function A(t){return"boolean"==typeof t._closed&&"boolean"==typeof t._defaultKeepAlive&&"boolean"==typeof t._removedConnection&&"boolean"==typeof t._removedContLen}function S(t){return"boolean"==typeof t._sent100&&A(t)}t.exports={isDestroyed:f,kIsDestroyed:r,isDisturbed:function(t){var e;return!(!t||!(null!==(e=t[p])&&void 0!==e?e:t.readableDidRead||t.readableAborted))},kIsDisturbed:p,isErrored:function(t){var e,n,i,s,o,r,l,u,p,_;return!(!t||!(null!==(e=null!==(n=null!==(i=null!==(s=null!==(o=null!==(r=t[a])&&void 0!==r?r:t.readableErrored)&&void 0!==o?o:t.writableErrored)&&void 0!==s?s:null===(l=t._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==i?i:null===(u=t._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==n?n:null===(p=t._readableState)||void 0===p?void 0:p.errored)&&void 0!==e?e:null===(_=t._writableState)||void 0===_?void 0:_.errored))},kIsErrored:a,isReadable:M,kIsReadable:l,kIsClosedPromise:_,kControllerErrorFunction:d,kIsWritable:u,isClosed:function(t){if(!T(t))return null;if("boolean"==typeof t.closed)return t.closed;const e=t._writableState,n=t._readableState;return"boolean"==typeof(null==e?void 0:e.closed)||"boolean"==typeof(null==n?void 0:n.closed)?(null==e?void 0:e.closed)||(null==n?void 0:n.closed):"boolean"==typeof t._closed&&A(t)?t._closed:null},isDuplexNodeStream:function(t){return!(!t||"function"!=typeof t.pipe||!t._readableState||"function"!=typeof t.on||"function"!=typeof t.write)},isFinished:function(t,e){return T(t)?!!f(t)||(!1===(null==e?void 0:e.readable)||!M(t))&&(!1===(null==e?void 0:e.writable)||!R(t)):null},isIterable:function(t,e){return null!=t&&(!0===e?"function"==typeof t[i]:!1===e?"function"==typeof t[s]:"function"==typeof t[i]||"function"==typeof t[s])},isReadableNodeStream:h,isReadableStream:I,isReadableEnded:function(t){if(!h(t))return null;if(!0===t.readableEnded)return!0;const e=t._readableState;return!(!e||e.errored)&&("boolean"!=typeof(null==e?void 0:e.ended)?null:e.ended)},isReadableFinished:O,isReadableErrored:function(t){var e,n;return T(t)?t.readableErrored?t.readableErrored:null!==(e=null===(n=t._readableState)||void 0===n?void 0:n.errored)&&void 0!==e?e:null:null},isNodeStream:T,isWebStream:function(t){return I(t)||m(t)||E(t)},isWritable:R,isWritableNodeStream:c,isWritableStream:m,isWritableEnded:g,isWritableFinished:function(t,e){if(!c(t))return null;if(!0===t.writableFinished)return!0;const n=t._writableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.finished)?null:!!(n.finished||!1===e&&!0===n.ended&&0===n.length))},isWritableErrored:function(t){var e,n;return T(t)?t.writableErrored?t.writableErrored:null!==(e=null===(n=t._writableState)||void 0===n?void 0:n.errored)&&void 0!==e?e:null:null},isServerRequest:function(t){var e;return"boolean"==typeof t._consuming&&"boolean"==typeof t._dumped&&void 0===(null===(e=t.req)||void 0===e?void 0:e.upgradeOrConnect)},isServerResponse:S,willEmitClose:function(t){if(!T(t))return null;const e=t._writableState,n=t._readableState,i=e||n;return!i&&S(t)||!!(i&&i.autoDestroy&&i.emitClose&&!1===i.closed)},isTransformStream:E}},394:(t,e,n)=>{const i=n(5606),{ArrayPrototypeSlice:s,Error:o,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:p,Symbol:_,SymbolHasInstance:d}=n(4184);t.exports=F,F.WritableState=v;const{EventEmitter:h}=n(7007),c=n(2913).Stream,{Buffer:T}=n(8287),I=n(2430),{addAbortSignal:m}=n(153),{getHighWaterMark:E,getDefaultHighWaterMark:f}=n(9153),{ERR_INVALID_ARG_TYPE:g,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_MULTIPLE_CALLBACK:M,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:S,ERR_STREAM_NULL_VALUES:C,ERR_STREAM_WRITE_AFTER_END:L,ERR_UNKNOWN_ENCODING:y}=n(6605).codes,{errorOrDestroy:D}=I;function N(){}u(F.prototype,c.prototype),u(F,c);const b=_("kOnFinished");function v(t,e,i){"boolean"!=typeof i&&(i=e instanceof n(4992)),this.objectMode=!(!t||!t.objectMode),i&&(this.objectMode=this.objectMode||!(!t||!t.writableObjectMode)),this.highWaterMark=t?E(this,t,"writableHighWaterMark",i):f(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const s=!(!t||!1!==t.decodeStrings);this.decodeStrings=!s,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Y.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,w(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||!1!==t.emitClose,this.autoDestroy=!t||!1!==t.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[b]=[]}function w(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}function F(t){const e=this instanceof n(4992);if(!e&&!r(F,this))return new F(t);this._writableState=new v(t,this,e),t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&m(t.signal,this)),c.call(this,t),I.construct(this,(()=>{const t=this._writableState;t.writing||X(this,t),W(this,t)}))}function P(t,e,n,s){const o=t._writableState;if("function"==typeof n)s=n,n=o.defaultEncoding;else{if(n){if("buffer"!==n&&!T.isEncoding(n))throw new y(n)}else n=o.defaultEncoding;"function"!=typeof s&&(s=N)}if(null===e)throw new C;if(!o.objectMode)if("string"==typeof e)!1!==o.decodeStrings&&(e=T.from(e,n),n="buffer");else if(e instanceof T)n="buffer";else{if(!c._isUint8Array(e))throw new g("chunk",["string","Buffer","Uint8Array"],e);e=c._uint8ArrayToBuffer(e),n="buffer"}let r;return o.ending?r=new L:o.destroyed&&(r=new A("write")),r?(i.nextTick(s,r),D(t,r,!0),r):(o.pendingcb++,function(t,e,n,i,s){const o=e.objectMode?1:n.length;e.length+=o;const r=e.length<e.highWaterMark;r||(e.needDrain=!0);e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:n,encoding:i,callback:s}),e.allBuffers&&"buffer"!==i&&(e.allBuffers=!1),e.allNoop&&s!==N&&(e.allNoop=!1)):(e.writelen=o,e.writecb=s,e.writing=!0,e.sync=!0,t._write(n,i,e.onwrite),e.sync=!1);return r&&!e.errored&&!e.destroyed}(t,o,e,n,s))}function k(t,e,n,i,s,o,r){e.writelen=i,e.writecb=r,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new A("write")):n?t._writev(s,e.onwrite):t._write(s,o,e.onwrite),e.sync=!1}function V(t,e,n,i){--e.pendingcb,i(n),B(e),D(t,n)}function Y(t,e){const n=t._writableState,s=n.sync,o=n.writecb;"function"==typeof o?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,e?(e.stack,n.errored||(n.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),s?i.nextTick(V,t,n,e,o):V(t,n,e,o)):(n.buffered.length>n.bufferedIndex&&X(t,n),s?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:t,state:n},i.nextTick(x,n.afterWriteTickInfo)):U(t,n,1,o))):D(t,new M)}function x({stream:t,state:e,count:n,cb:i}){return e.afterWriteTickInfo=null,U(t,e,n,i)}function U(t,e,n,i){for(!e.ending&&!t.destroyed&&0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));n-- >0;)e.pendingcb--,i();e.destroyed&&B(e),W(t,e)}function B(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;const{chunk:i,callback:s}=t.buffered[n],o=t.objectMode?1:i.length;t.length-=o,s(null!==(e=t.errored)&&void 0!==e?e:new A("write"))}const n=t[b].splice(0);for(let e=0;e<n.length;e++){var i;n[e](null!==(i=t.errored)&&void 0!==i?i:new A("end"))}w(t)}function X(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;const{buffered:n,bufferedIndex:i,objectMode:o}=e,r=n.length-i;if(!r)return;let a=i;if(e.bufferProcessing=!0,r>1&&t._writev){e.pendingcb-=r-1;const i=e.allNoop?N:t=>{for(let e=a;e<n.length;++e)n[e].callback(t)},o=e.allNoop&&0===a?n:s(n,a);o.allBuffers=e.allBuffers,k(t,e,!0,e.length,o,"",i),w(e)}else{do{const{chunk:i,encoding:s,callback:r}=n[a];n[a++]=null;k(t,e,!1,o?1:i.length,i,s,r)}while(a<n.length&&!e.writing);a===n.length?w(e):a>256?(n.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}function G(t){return t.ending&&!t.destroyed&&t.constructed&&0===t.length&&!t.errored&&0===t.buffered.length&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function H(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.finalCalled=!0,function(t,e){let n=!1;function s(s){if(n)D(t,null!=s?s:M());else if(n=!0,e.pendingcb--,s){const n=e[b].splice(0);for(let t=0;t<n.length;t++)n[t](s);D(t,s,e.sync)}else G(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,i.nextTick(K,t,e))}e.sync=!0,e.pendingcb++;try{t._final(s)}catch(t){s(t)}e.sync=!1}(t,e)))}function W(t,e,n){G(e)&&(H(t,e),0===e.pendingcb&&(n?(e.pendingcb++,i.nextTick(((t,e)=>{G(e)?K(t,e):e.pendingcb--}),t,e)):G(e)&&(e.pendingcb++,K(t,e))))}function K(t,e){e.pendingcb--,e.finished=!0;const n=e[b].splice(0);for(let t=0;t<n.length;t++)n[t]();if(t.emit("finish"),e.autoDestroy){const e=t._readableState;(!e||e.autoDestroy&&(e.endEmitted||!1===e.readable))&&t.destroy()}}v.prototype.getBuffer=function(){return s(this.buffered,this.bufferedIndex)},a(v.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(F,d,{__proto__:null,value:function(t){return!!r(this,t)||this===F&&(t&&t._writableState instanceof v)}}),F.prototype.pipe=function(){D(this,new R)},F.prototype.write=function(t,e,n){return!0===P(this,t,e,n)},F.prototype.cork=function(){this._writableState.corked++},F.prototype.uncork=function(){const t=this._writableState;t.corked&&(t.corked--,t.writing||X(this,t))},F.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=p(t)),!T.isEncoding(t))throw new y(t);return this._writableState.defaultEncoding=t,this},F.prototype._write=function(t,e,n){if(!this._writev)throw new O("_write()");this._writev([{chunk:t,encoding:e}],n)},F.prototype._writev=null,F.prototype.end=function(t,e,n){const s=this._writableState;let r;if("function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t){const n=P(this,t,e);n instanceof o&&(r=n)}return s.corked&&(s.corked=1,this.uncork()),r||(s.errored||s.ending?s.finished?r=new S("end"):s.destroyed&&(r=new A("end")):(s.ending=!0,W(this,s,!0),s.ended=!0)),"function"==typeof n&&(r||s.finished?i.nextTick(n,r):s[b].push(n)),this},l(F.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){const t=this._writableState;return!(!t||!1===t.writable||t.destroyed||t.errored||t.ending||t.ended)},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const t=this._writableState;return!!t&&(!t.destroyed&&!t.ending&&t.needDrain)}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const j=I.destroy;let q;function $(){return void 0===q&&(q={}),q}F.prototype.destroy=function(t,e){const n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[b].length)&&i.nextTick(B,n),j.call(this,t,e),this},F.prototype._undestroy=I.undestroy,F.prototype._destroy=function(t,e){e(t)},F.prototype[h.captureRejectionSymbol]=function(t){this.destroy(t)},F.fromWeb=function(t,e){return $().newStreamWritableFromWritableStream(t,e)},F.toWeb=function(t){return $().newWritableStreamFromStreamWritable(t)}},6283:(t,e,n)=>{"use strict";const{ArrayIsArray:i,ArrayPrototypeIncludes:s,ArrayPrototypeJoin:o,ArrayPrototypeMap:r,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:p,NumberParseInt:_,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:c,StringPrototypeToUpperCase:T,StringPrototypeTrim:I}=n(4184),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:f,ERR_INVALID_ARG_VALUE:g,ERR_OUT_OF_RANGE:O,ERR_UNKNOWN_SIGNAL:M}}=n(6605),{normalizeEncoding:R}=n(798),{isAsyncFunction:A,isArrayBufferView:S}=n(798).types,C={};const L=/^[0-7]+$/;const y=m(((t,e,n=p,i=u)=>{if("number"!=typeof t)throw new f(e,"number",t);if(!a(t))throw new O(e,"an integer",t);if(t<n||t>i)throw new O(e,`>= ${n} && <= ${i}`,t)})),D=m(((t,e,n=-2147483648,i=2147483647)=>{if("number"!=typeof t)throw new f(e,"number",t);if(!a(t))throw new O(e,"an integer",t);if(t<n||t>i)throw new O(e,`>= ${n} && <= ${i}`,t)})),N=m(((t,e,n=!1)=>{if("number"!=typeof t)throw new f(e,"number",t);if(!a(t))throw new O(e,"an integer",t);const i=n?1:0,s=4294967295;if(t<i||t>s)throw new O(e,`>= ${i} && <= ${s}`,t)}));function b(t,e){if("string"!=typeof t)throw new f(e,"string",t)}const v=m(((t,e,n)=>{if(!s(n,t)){const i=o(r(n,(t=>"string"==typeof t?`'${t}'`:c(t))),", ");throw new g(e,t,"must be one of: "+i)}}));function w(t,e){if("boolean"!=typeof t)throw new f(e,"boolean",t)}function F(t,e,n){return null!=t&&d(t,e)?t[e]:n}const P=m(((t,e,n=null)=>{const s=F(n,"allowArray",!1),o=F(n,"allowFunction",!1);if(!F(n,"nullable",!1)&&null===t||!s&&i(t)||"object"!=typeof t&&(!o||"function"!=typeof t))throw new f(e,"Object",t)})),k=m(((t,e)=>{if(null!=t&&"object"!=typeof t&&"function"!=typeof t)throw new f(e,"a dictionary",t)})),V=m(((t,e,n=0)=>{if(!i(t))throw new f(e,"Array",t);if(t.length<n){throw new g(e,t,`must be longer than ${n}`)}}));const Y=m(((t,e="buffer")=>{if(!S(t))throw new f(e,["Buffer","TypedArray","DataView"],t)}));const x=m(((t,e)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new f(e,"AbortSignal",t)})),U=m(((t,e)=>{if("function"!=typeof t)throw new f(e,"Function",t)})),B=m(((t,e)=>{if("function"!=typeof t||A(t))throw new f(e,"Function",t)})),X=m(((t,e)=>{if(void 0!==t)throw new f(e,"undefined",t)}));const G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(t,e){if(void 0===t||!h(G,t))throw new g(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(t){return t===(0|t)},isUint32:function(t){return t===t>>>0},parseFileMode:function(t,e,n){if(void 0===t&&(t=n),"string"==typeof t){if(null===h(L,t))throw new g(e,t,"must be a 32-bit unsigned integer or an octal string");t=_(t,8)}return N(t,e),t},validateArray:V,validateStringArray:function(t,e){V(t,e);for(let n=0;n<t.length;n++)b(t[n],`${e}[${n}]`)},validateBooleanArray:function(t,e){V(t,e);for(let n=0;n<t.length;n++)w(t[n],`${e}[${n}]`)},validateAbortSignalArray:function(t,e){V(t,e);for(let n=0;n<t.length;n++){const i=t[n],s=`${e}[${n}]`;if(null==i)throw new f(s,"AbortSignal",i);x(i,s)}},validateBoolean:w,validateBuffer:Y,validateDictionary:k,validateEncoding:function(t,e){const n=R(e),i=t.length;if("hex"===n&&i%2!=0)throw new g("encoding",e,`is invalid for data of length ${i}`)},validateFunction:U,validateInt32:D,validateInteger:y,validateNumber:function(t,e,n=void 0,i){if("number"!=typeof t)throw new f(e,"number",t);if(null!=n&&t<n||null!=i&&t>i||(null!=n||null!=i)&&l(t))throw new O(e,`${null!=n?`>= ${n}`:""}${null!=n&&null!=i?" && ":""}${null!=i?`<= ${i}`:""}`,t)},validateObject:P,validateOneOf:v,validatePlainFunction:B,validatePort:function(t,e="Port",n=!0){if("number"!=typeof t&&"string"!=typeof t||"string"==typeof t&&0===I(t).length||+t!=+t>>>0||t>65535||0===t&&!n)throw new E(e,t,n);return 0|t},validateSignalName:function(t,e="signal"){if(b(t,e),void 0===C[t]){if(void 0!==C[T(t)])throw new M(t+" (signals must use all capital letters)");throw new M(t)}},validateString:b,validateUint32:N,validateUndefined:X,validateUnion:function(t,e,n){if(!s(n,t))throw new f(e,`('${o(n,"|")}')`,t)},validateAbortSignal:x,validateLinkHeaderValue:function(t){if("string"==typeof t)return H(t,"hints"),t;if(i(t)){const e=t.length;let n="";if(0===e)return n;for(let i=0;i<e;i++){const s=t[i];H(s,"hints"),n+=s,i!==e-1&&(n+=", ")}return n}throw new g("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},6248:(t,e,n)=>{"use strict";const i=n(4612),s=n(105),o=i.Readable.destroy;t.exports=i.Readable,t.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,t.exports._isUint8Array=i._isUint8Array,t.exports.isDisturbed=i.isDisturbed,t.exports.isErrored=i.isErrored,t.exports.isReadable=i.isReadable,t.exports.Readable=i.Readable,t.exports.Writable=i.Writable,t.exports.Duplex=i.Duplex,t.exports.Transform=i.Transform,t.exports.PassThrough=i.PassThrough,t.exports.addAbortSignal=i.addAbortSignal,t.exports.finished=i.finished,t.exports.destroy=i.destroy,t.exports.destroy=o,t.exports.pipeline=i.pipeline,t.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get:()=>s}),t.exports.Stream=i.Stream,t.exports.default=t.exports},6605:(t,e,n)=>{"use strict";const{format:i,inspect:s,AggregateError:o}=n(798),r=globalThis.AggregateError||o,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,p={};function _(t,e){if(!t)throw new p.ERR_INTERNAL_ASSERTION(e)}function d(t){let e="",n=t.length;const i="-"===t[0]?1:0;for(;n>=i+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function h(t,e,n){n||(n=Error);class s extends n{constructor(...n){super(function(t,e,n){if("function"==typeof e)return _(e.length<=n.length,`Code: ${t}; The provided arguments length (${n.length}) does not match the required ones (${e.length}).`),e(...n);const s=(e.match(/%[dfijoOs]/g)||[]).length;return _(s===n.length,`Code: ${t}; The provided arguments length (${n.length}) does not match the required ones (${s}).`),0===n.length?e:i(e,...n)}(t,e,n))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(s.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),s.prototype.code=t,s.prototype[a]=!0,p[t]=s}function c(t){const e="__node_internal_"+t.name;return Object.defineProperty(t,"name",{value:e}),t}class T extends Error{constructor(t="The operation was aborted",e=void 0){if(void 0!==e&&"object"!=typeof e)throw new p.ERR_INVALID_ARG_TYPE("options","Object",e);super(t,e),this.code="ABORT_ERR",this.name="AbortError"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",((t,e,n)=>{_("string"==typeof t,"'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";const o=[],r=[],a=[];for(const t of e)_("string"==typeof t,"All expected entries have to be of type string"),l.includes(t)?o.push(t.toLowerCase()):u.test(t)?r.push(t):(_("object"!==t,'The value "object" should be written as "Object"'),a.push(t));if(r.length>0){const t=o.indexOf("object");-1!==t&&(o.splice(o,t,1),r.push("Object"))}if(o.length>0){switch(o.length){case 1:i+=`of type ${o[0]}`;break;case 2:i+=`one of type ${o[0]} or ${o[1]}`;break;default:{const t=o.pop();i+=`one of type ${o.join(", ")}, or ${t}`}}(r.length>0||a.length>0)&&(i+=" or ")}if(r.length>0){switch(r.length){case 1:i+=`an instance of ${r[0]}`;break;case 2:i+=`an instance of ${r[0]} or ${r[1]}`;break;default:{const t=r.pop();i+=`an instance of ${r.join(", ")}, or ${t}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{const t=a.pop();i+=`one of ${a.join(", ")}, or ${t}`}}if(null==n)i+=`. Received ${n}`;else if("function"==typeof n&&n.name)i+=`. Received function ${n.name}`;else if("object"==typeof n){var p;if(null!==(p=n.constructor)&&void 0!==p&&p.name)i+=`. Received an instance of ${n.constructor.name}`;else{i+=`. Received ${s(n,{depth:-1})}`}}else{let t=s(n,{colors:!1});t.length>25&&(t=`${t.slice(0,25)}...`),i+=`. Received type ${typeof n} (${t})`}return i}),TypeError),h("ERR_INVALID_ARG_VALUE",((t,e,n="is invalid")=>{let i=s(e);i.length>128&&(i=i.slice(0,128)+"...");return`The ${t.includes(".")?"property":"argument"} '${t}' ${n}. Received ${i}`}),TypeError),h("ERR_INVALID_RETURN_VALUE",((t,e,n)=>{var i;return`Expected ${t} to be returned from the "${e}" function but got ${null!=n&&null!==(i=n.constructor)&&void 0!==i&&i.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`}),TypeError),h("ERR_MISSING_ARGS",((...t)=>{let e;_(t.length>0,"At least one arg needs to be specified");const n=t.length;switch(t=(Array.isArray(t)?t:[t]).map((t=>`"${t}"`)).join(" or "),n){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{const n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}}return`${e} must be specified`}),TypeError),h("ERR_OUT_OF_RANGE",((t,e,n)=>{let i;return _(e,'Missing "range" argument'),Number.isInteger(n)&&Math.abs(n)>2**32?i=d(String(n)):"bigint"==typeof n?(i=String(n),(n>2n**32n||n<-(2n**32n))&&(i=d(i)),i+="n"):i=s(n),`The value of "${t}" is out of range. It must be ${e}. Received ${i}`}),RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:T,aggregateTwoErrors:c((function(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;const n=new r([e,t],e.message);return n.code=e.code,n}return t||e})),hideStackFrames:c,codes:p}},4184:t=>{"use strict";t.exports={ArrayIsArray:t=>Array.isArray(t),ArrayPrototypeIncludes:(t,e)=>t.includes(e),ArrayPrototypeIndexOf:(t,e)=>t.indexOf(e),ArrayPrototypeJoin:(t,e)=>t.join(e),ArrayPrototypeMap:(t,e)=>t.map(e),ArrayPrototypePop:(t,e)=>t.pop(e),ArrayPrototypePush:(t,e)=>t.push(e),ArrayPrototypeSlice:(t,e,n)=>t.slice(e,n),Error,FunctionPrototypeCall:(t,e,...n)=>t.call(e,...n),FunctionPrototypeSymbolHasInstance:(t,e)=>Function.prototype[Symbol.hasInstance].call(t,e),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(t,e)=>Object.defineProperties(t,e),ObjectDefineProperty:(t,e,n)=>Object.defineProperty(t,e,n),ObjectGetOwnPropertyDescriptor:(t,e)=>Object.getOwnPropertyDescriptor(t,e),ObjectKeys:t=>Object.keys(t),ObjectSetPrototypeOf:(t,e)=>Object.setPrototypeOf(t,e),Promise,PromisePrototypeCatch:(t,e)=>t.catch(e),PromisePrototypeThen:(t,e,n)=>t.then(e,n),PromiseReject:t=>Promise.reject(t),PromiseResolve:t=>Promise.resolve(t),ReflectApply:Reflect.apply,RegExpPrototypeTest:(t,e)=>t.test(e),SafeSet:Set,String,StringPrototypeSlice:(t,e,n)=>t.slice(e,n),StringPrototypeToLowerCase:t=>t.toLowerCase(),StringPrototypeToUpperCase:t=>t.toUpperCase(),StringPrototypeTrim:t=>t.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(t,e,n)=>t.set(e,n),Boolean,Uint8Array}},798:(t,e,n)=>{"use strict";const i=n(8287),{kResistStopPropagation:s,SymbolDispose:o}=n(4184),r=globalThis.AbortSignal||n(5568).AbortSignal,a=globalThis.AbortController||n(5568).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,u=globalThis.Blob||i.Blob,p=void 0!==u?function(t){return t instanceof u}:function(t){return!1},_=(t,e)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)};class d extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError("Expected input to be an Array, got "+typeof t);let e="";for(let n=0;n<t.length;n++)e+=` ${t[n].stack}\n`;super(e),this.name="AggregateError",this.errors=t}}t.exports={AggregateError:d,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...n){e||(e=!0,t.apply(this,n))}},createDeferredPromise:function(){let t,e;return{promise:new Promise(((n,i)=>{t=n,e=i})),resolve:t,reject:e}},promisify:t=>new Promise(((e,n)=>{t(((t,...i)=>t?n(t):e(...i)))})),debuglog:()=>function(){},format:(t,...e)=>t.replace(/%([sdifj])/g,(function(...[t,n]){const i=e.shift();if("f"===n)return i.toFixed(6);if("j"===n)return JSON.stringify(i);if("s"===n&&"object"==typeof i){return`${i.constructor!==Object?i.constructor.name:""} {}`.trim()}return i.toString()})),inspect(t){switch(typeof t){case"string":if(t.includes("'")){if(!t.includes('"'))return`"${t}"`;if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction:t=>t instanceof l,isArrayBufferView:t=>ArrayBuffer.isView(t)},isBlob:p,deprecate:(t,e)=>t,addAbortListener:n(7007).addAbortListener||function(t,e){if(void 0===t)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);let n;return _(t,"signal"),((t,e)=>{if("function"!=typeof t)throw new ERR_INVALID_ARG_TYPE(e,"Function",t)})(e,"listener"),t.aborted?queueMicrotask((()=>e())):(t.addEventListener("abort",e,{__proto__:null,once:!0,[s]:!0}),n=()=>{t.removeEventListener("abort",e)}),{__proto__:null,[o](){var t;null===(t=n)||void 0===t||t()}}},AbortSignalAny:r.any||function(t){if(1===t.length)return t[0];const e=new a,n=()=>e.abort();return t.forEach((t=>{_(t,"signals"),t.addEventListener("abort",n,{once:!0})})),e.signal.addEventListener("abort",(()=>{t.forEach((t=>t.removeEventListener("abort",n)))}),{once:!0}),e.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},4612:(t,e,n)=>{const{Buffer:i}=n(8287),{ObjectDefineProperty:s,ObjectKeys:o,ReflectApply:r}=n(4184),{promisify:{custom:a}}=n(798),{streamReturningOperators:l,promiseReturningOperators:u}=n(5589),{codes:{ERR_ILLEGAL_CONSTRUCTOR:p}}=n(6605),_=n(6864),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=n(9153),{pipeline:c}=n(872),{destroyer:T}=n(2430),I=n(9700),m=n(105),E=n(6569),f=t.exports=n(2913).Stream;f.isDestroyed=E.isDestroyed,f.isDisturbed=E.isDisturbed,f.isErrored=E.isErrored,f.isReadable=E.isReadable,f.isWritable=E.isWritable,f.Readable=n(6566);for(const M of o(l)){const R=l[M];function g(...t){if(new.target)throw p();return f.Readable.from(r(R,this,t))}s(g,"name",{__proto__:null,value:R.name}),s(g,"length",{__proto__:null,value:R.length}),s(f.Readable.prototype,M,{__proto__:null,value:g,enumerable:!1,configurable:!0,writable:!0})}for(const A of o(u)){const S=u[A];function g(...t){if(new.target)throw p();return r(S,this,t)}s(g,"name",{__proto__:null,value:S.name}),s(g,"length",{__proto__:null,value:S.length}),s(f.Readable.prototype,A,{__proto__:null,value:g,enumerable:!1,configurable:!0,writable:!0})}f.Writable=n(394),f.Duplex=n(4992),f.Transform=n(208),f.PassThrough=n(6898),f.pipeline=c;const{addAbortSignal:O}=n(153);f.addAbortSignal=O,f.finished=I,f.destroy=T,f.compose=_,f.setDefaultHighWaterMark=d,f.getDefaultHighWaterMark=h,s(f,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),s(c,a,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),s(I,a,{__proto__:null,enumerable:!0,get:()=>m.finished}),f.Stream=f,f._isUint8Array=function(t){return t instanceof Uint8Array},f._uint8ArrayToBuffer=function(t){return i.from(t.buffer,t.byteOffset,t.byteLength)}},105:(t,e,n)=>{"use strict";const{ArrayPrototypePop:i,Promise:s}=n(4184),{isIterable:o,isNodeStream:r,isWebStream:a}=n(6569),{pipelineImpl:l}=n(872),{finished:u}=n(9700);n(4612),t.exports={finished:u,pipeline:function(...t){return new s(((e,n)=>{let s,u;const p=t[t.length-1];if(p&&"object"==typeof p&&!r(p)&&!o(p)&&!a(p)){const e=i(t);s=e.signal,u=e.end}l(t,((t,i)=>{t?n(t):e(i)}),{signal:s,end:u})}))}}},8707:(t,e,n)=>{"use strict";var i=n(2861).Buffer,s=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===s||!s(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=p,this.end=_,e=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function r(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"<22>";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"<22>";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"<22>"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function p(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function _(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"<22>":e},o.prototype.text=function(t,e){var n=function(t,e,n){var i=e.length-1;if(i<n)return 0;var s=r(e[i]);if(s>=0)return s>0&&(t.lastNeed=s-1),s;if(--i<n||-2===s)return 0;if(s=r(e[i]),s>=0)return s>0&&(t.lastNeed=s-2),s;if(--i<n||-2===s)return 0;if(s=r(e[i]),s>=0)return s>0&&(2===s?s=0:t.lastNeed=s-3),s;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},5568:t=>{"use strict";const{AbortController:e,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;t.exports=e,t.exports.AbortSignal=n,t.exports.default=e},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),n=e[0],i=e[1];return 3*(n+i)/4-i},e.toByteArray=function(t){var e,n,o=a(t),r=o[0],l=o[1],u=new s(function(t,e,n){return 3*(e+n)/4-n}(0,r,l)),p=0,_=l>0?r-4:r;for(n=0;n<_;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[p++]=e>>16&255,u[p++]=e>>8&255,u[p++]=255&e;2===l&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[p++]=255&e);1===l&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[p++]=e>>8&255,u[p++]=255&e);return u},e.fromByteArray=function(t){for(var e,i=t.length,s=i%3,o=[],r=16383,a=0,u=i-s;a<u;a+=r)o.push(l(t,a,a+r>u?u:a+r));1===s?(e=t[i-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===s&&(e=(t[i-2]<<8)+t[i-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)n[r]=o[r],i[o.charCodeAt(r)]=r;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,i){for(var s,o,r=[],a=e;a<i;a+=3)s=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),r.push(n[(o=s)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return r.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},8287:(t,e,n)=>{"use strict";
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/const i=n(7526),s=n(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50;const r=2147483647;function a(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return _(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|T(t,e);let i=a(n);const s=i.write(t,e);s!==n&&(i=i.slice(0,s));return i}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return h(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return h(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return l.from(i,e,n);const s=function(t){if(l.isBuffer(t)){const e=0|c(t.length),n=a(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||z(t.length)?a(0):d(t);if("Buffer"===t.type&&Array.isArray(t.data))return d(t.data)}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function p(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function _(t){return p(t),a(t<0?0:0|c(t))}function d(t){const e=t.length<0?0:0|c(t.length),n=a(e);for(let i=0;i<e;i+=1)n[i]=255&t[i];return n}function h(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(i,l.prototype),i}function c(t){if(t>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function T(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;let s=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(s)return i?-1:K(t).length;e=(""+e).toLowerCase(),s=!0}}function I(t,e,n){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,n);case"utf8":case"utf-8":return C(this,e,n);case"ascii":return y(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function E(t,e,n,i,s){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=s?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:f(t,e,n,i,s);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):f(t,[e],n,i,s);throw new TypeError("val must be string, number or Buffer")}function f(t,e,n,i,s){let o,r=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;r=2,a/=2,l/=2,n/=2}function u(t,e){return 1===r?t[e]:t.readUInt16BE(e*r)}if(s){let i=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===l)return i*r}else-1!==i&&(o-=o-i),i=-1}else for(n+l>a&&(n=a-l),o=n;o>=0;o--){let n=!0;for(let i=0;i<l;i++)if(u(t,o+i)!==u(e,i)){n=!1;break}if(n)return o}return-1}function g(t,e,n,i){n=Number(n)||0;const s=t.length-n;i?(i=Number(i))>s&&(i=s):i=s;const o=e.length;let r;for(i>o/2&&(i=o/2),r=0;r<i;++r){const i=parseInt(e.substr(2*r,2),16);if(z(i))return r;t[n+r]=i}return r}function O(t,e,n,i){return q(K(e,t.length-n),t,n,i)}function M(t,e,n,i){return q(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,i)}function R(t,e,n,i){return q(j(e),t,n,i)}function A(t,e,n,i){return q(function(t,e){let n,i,s;const o=[];for(let r=0;r<t.length&&!((e-=2)<0);++r)n=t.charCodeAt(r),i=n>>8,s=n%256,o.push(s),o.push(i);return o}(e,t.length-n),t,n,i)}function S(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function C(t,e,n){n=Math.min(t.length,n);const i=[];let s=e;for(;s<n;){const e=t[s];let o=null,r=e>239?4:e>223?3:e>191?2:1;if(s+r<=n){let n,i,a,l;switch(r){case 1:e<128&&(o=e);break;case 2:n=t[s+1],128==(192&n)&&(l=(31&e)<<6|63&n,l>127&&(o=l));break;case 3:n=t[s+1],i=t[s+2],128==(192&n)&&128==(192&i)&&(l=(15&e)<<12|(63&n)<<6|63&i,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:n=t[s+1],i=t[s+2],a=t[s+3],128==(192&n)&&128==(192&i)&&128==(192&a)&&(l=(15&e)<<18|(63&n)<<12|(63&i)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,r=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),s+=r}return function(t){const e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);let n="",i=0;for(;i<e;)n+=String.fromCharCode.apply(String,t.slice(i,i+=L));return n}(i)}e.kMaxLength=r,l.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(t,e,n){return u(t,e,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(t,e,n){return function(t,e,n){return p(t),t<=0?a(t):void 0!==e?"string"==typeof n?a(t).fill(e,n):a(t).fill(e):a(t)}(t,e,n)},l.allocUnsafe=function(t){return _(t)},l.allocUnsafeSlow=function(t){return _(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if($(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),$(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,i=e.length;for(let s=0,o=Math.min(n,i);s<o;++s)if(t[s]!==e[s]){n=t[s],i=e[s];break}return n<i?-1:i<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const i=l.allocUnsafe(e);let s=0;for(n=0;n<t.length;++n){let e=t[n];if($(e,Uint8Array))s+e.length>i.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(i,s)):Uint8Array.prototype.set.call(i,e,s);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,s)}s+=e.length}return i},l.byteLength=T,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},l.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},l.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},l.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?C(this,0,t):I.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(t,e,n,i,s){if($(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(this===t)return 0;let o=(s>>>=0)-(i>>>=0),r=(n>>>=0)-(e>>>=0);const a=Math.min(o,r),u=this.slice(i,s),p=t.slice(e,n);for(let t=0;t<a;++t)if(u[t]!==p[t]){o=u[t],r=p[t];break}return o<r?-1:r<o?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return E(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return E(this,t,e,n,!1)},l.prototype.write=function(t,e,n,i){if(void 0===e)i="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)i=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}const s=this.length-e;if((void 0===n||n>s)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return g(this,t,e,n);case"utf8":case"utf-8":return O(this,t,e,n);case"ascii":case"latin1":case"binary":return M(this,t,e,n);case"base64":return R(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const L=4096;function y(t,e,n){let i="";n=Math.min(t.length,n);for(let s=e;s<n;++s)i+=String.fromCharCode(127&t[s]);return i}function D(t,e,n){let i="";n=Math.min(t.length,n);for(let s=e;s<n;++s)i+=String.fromCharCode(t[s]);return i}function N(t,e,n){const i=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>i)&&(n=i);let s="";for(let i=e;i<n;++i)s+=Q[t[i]];return s}function b(t,e,n){const i=t.slice(e,n);let s="";for(let t=0;t<i.length-1;t+=2)s+=String.fromCharCode(i[t]+256*i[t+1]);return s}function v(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function w(t,e,n,i,s,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<o)throw new RangeError('"value" argument is out of bounds');if(n+i>t.length)throw new RangeError("Index out of range")}function F(t,e,n,i,s){X(e,i,s,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let r=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=r,r>>=8,t[n++]=r,r>>=8,t[n++]=r,r>>=8,t[n++]=r,n}function P(t,e,n,i,s){X(e,i,s,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let r=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=r,r>>=8,t[n+2]=r,r>>=8,t[n+1]=r,r>>=8,t[n]=r,n+8}function k(t,e,n,i,s,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(t,e,n,i,o){return e=+e,n>>>=0,o||k(t,0,n,4),s.write(t,e,n,i,23,4),n+4}function Y(t,e,n,i,o){return e=+e,n>>>=0,o||k(t,0,n,8),s.write(t,e,n,i,52,8),n+8}l.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const i=this.subarray(t,e);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||v(t,e,this.length);let i=this[t],s=1,o=0;for(;++o<e&&(s*=256);)i+=this[t+o]*s;return i},l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||v(t,e,this.length);let i=this[t+--e],s=1;for(;e>0&&(s*=256);)i+=this[t+--e]*s;return i},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=J((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,s=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(i)+(BigInt(s)<<BigInt(32))})),l.prototype.readBigUInt64BE=J((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],s=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(i)<<BigInt(32))+BigInt(s)})),l.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||v(t,e,this.length);let i=this[t],s=1,o=0;for(;++o<e&&(s*=256);)i+=this[t+o]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||v(t,e,this.length);let i=e,s=1,o=this[t+--i];for(;i>0&&(s*=256);)o+=this[t+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=J((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),l.prototype.readBigInt64BE=J((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),l.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),s.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),s.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),s.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),s.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e>>>=0,n>>>=0,!i){w(this,t,e,n,Math.pow(2,8*n)-1,0)}let s=1,o=0;for(this[e]=255&t;++o<n&&(s*=256);)this[e+o]=t/s&255;return e+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e>>>=0,n>>>=0,!i){w(this,t,e,n,Math.pow(2,8*n)-1,0)}let s=n-1,o=1;for(this[e+s]=255&t;--s>=0&&(o*=256);)this[e+s]=t/o&255;return e+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=J((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=J((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*n-1);w(this,t,e,n,i-1,-i)}let s=0,o=1,r=0;for(this[e]=255&t;++s<n&&(o*=256);)t<0&&0===r&&0!==this[e+s-1]&&(r=1),this[e+s]=(t/o|0)-r&255;return e+n},l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*n-1);w(this,t,e,n,i-1,-i)}let s=n-1,o=1,r=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===r&&0!==this[e+s+1]&&(r=1),this[e+s]=(t/o|0)-r&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||w(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=J((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=J((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(t,e,n){return V(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return V(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return Y(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return Y(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,i){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);const s=i-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),e),s},l.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){const e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let s;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{const o=l.isBuffer(t)?t:l.from(t,i),r=o.length;if(0===r)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<n-e;++s)this[s+e]=o[s%r]}return this};const x={};function U(t,e,n){x[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function B(t){let e="",n=t.length;const i="-"===t[0]?1:0;for(;n>=i+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function X(t,e,n,i,s,o){if(t>n||t<e){const i="bigint"==typeof e?"n":"";let s;throw s=o>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(o+1)}${i}`:`>= -(2${i} ** ${8*(o+1)-1}${i}) and < 2 ** ${8*(o+1)-1}${i}`:`>= ${e}${i} and <= ${n}${i}`,new x.ERR_OUT_OF_RANGE("value",s,t)}!function(t,e,n){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||H(e,t.length-(n+1))}(i,s,o)}function G(t,e){if("number"!=typeof t)throw new x.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,n){if(Math.floor(t)!==t)throw G(t,n),new x.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new x.ERR_BUFFER_OUT_OF_BOUNDS;throw new x.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(t,e,n){let i=`The value of "${t}" is out of range.`,s=n;return Number.isInteger(n)&&Math.abs(n)>2**32?s=B(String(n)):"bigint"==typeof n&&(s=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(s=B(s)),s+="n"),i+=` It must be ${e}. Received ${s}`,i}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let n;e=e||1/0;const i=t.length;let s=null;const o=[];for(let r=0;r<i;++r){if(n=t.charCodeAt(r),n>55295&&n<57344){if(!s){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(r+1===i){(e-=3)>-1&&o.push(239,191,189);continue}s=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),s=n;continue}n=65536+(s-55296<<10|n-56320)}else s&&(e-=3)>-1&&o.push(239,191,189);if(s=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,n,i){let s;for(s=0;s<i&&!(s+n>=e.length||s>=t.length);++s)e[s+n]=t[s];return s}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function z(t){return t!=t}const Q=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const i=16*n;for(let s=0;s<16;++s)e[i+s]=t[n]+t[s]}return e}();function J(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function i(){}function s(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new s(i,o||t,r),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function r(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,s=[];if(0===this._eventsCount)return s;for(i in t=this._events)e.call(t,i)&&s.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,o=i.length,r=new Array(o);s<o;s++)r[s]=i[s].fn;return r},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,s,o,r){var a=n?n+t:t;if(!this._events[a])return!1;var l,u,p=this._events[a],_=arguments.length;if(p.fn){switch(p.once&&this.removeListener(t,p.fn,void 0,!0),_){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,e),!0;case 3:return p.fn.call(p.context,e,i),!0;case 4:return p.fn.call(p.context,e,i,s),!0;case 5:return p.fn.call(p.context,e,i,s,o),!0;case 6:return p.fn.call(p.context,e,i,s,o,r),!0}for(u=1,l=new Array(_-1);u<_;u++)l[u-1]=arguments[u];p.fn.apply(p.context,l)}else{var d,h=p.length;for(u=0;u<h;u++)switch(p[u].once&&this.removeListener(t,p[u].fn,void 0,!0),_){case 1:p[u].fn.call(p[u].context);break;case 2:p[u].fn.call(p[u].context,e);break;case 3:p[u].fn.call(p[u].context,e,i);break;case 4:p[u].fn.call(p[u].context,e,i,s);break;default:if(!l)for(d=1,l=new Array(_-1);d<_;d++)l[d-1]=arguments[d];p[u].fn.apply(p[u].context,l)}}return!0},a.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,s){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return r(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||s&&!a.once||i&&a.context!==i||r(this,o);else{for(var l=0,u=[],p=a.length;l<p;l++)(a[l].fn!==e||s&&!a[l].once||i&&a[l].context!==i)&&u.push(a[l]);u.length?this._events[o]=1===u.length?u[0]:u:r(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&r(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a},7007:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(n,i){function s(n){t.removeListener(e,o),i(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",s),n([].slice.call(arguments))}T(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&T(t,"error",e,n)}(t,s,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var r=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,n,i){var s,o,r,u;if(a(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),r=o[e]),void 0===r)r=o[e]=n,++t._eventsCount;else if("function"==typeof r?r=o[e]=i?[n,r]:[r,n]:i?r.unshift(n):r.push(n),(s=l(t))>0&&r.length>s&&!r.warned){r.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=t,p.type=e,p.count=r.length,u=p,console&&console.warn&&console.warn(u)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},s=p.bind(i);return s.listener=n,i.wrapFn=s,s}function d(t,e,n){var i=t._events;if(void 0===i)return[];var s=i[e];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(s):c(s,s.length)}function h(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function c(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function T(t,e,n,i){if("function"==typeof t.on)i.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function s(o){i.once&&t.removeEventListener(e,s),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");r=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var s="error"===t,o=this._events;if(void 0!==o)s=s&&void 0===o.error;else if(!s)return!1;if(s){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var a=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw a.context=r,a}var l=o[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,p=c(l,u);for(n=0;n<u;++n)i(p[n],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,_(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,_(this,t,e)),this},o.prototype.removeListener=function(t,e){var n,i,s,o,r;if(a(e),void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){r=n[o].listener,s=o;break}if(s<0)return this;0===s?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,s),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,r||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var s,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(s=o[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},251:(t,e)=>{
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,n,i,s){var o,r,a=8*s-i-1,l=(1<<a)-1,u=l>>1,p=-7,_=n?s-1:0,d=n?-1:1,h=t[e+_];for(_+=d,o=h&(1<<-p)-1,h>>=-p,p+=a;p>0;o=256*o+t[e+_],_+=d,p-=8);for(r=o&(1<<-p)-1,o>>=-p,p+=i;p>0;r=256*r+t[e+_],_+=d,p-=8);if(0===o)o=1-u;else{if(o===l)return r?NaN:1/0*(h?-1:1);r+=Math.pow(2,i),o-=u}return(h?-1:1)*r*Math.pow(2,o-i)},e.write=function(t,e,n,i,s,o){var r,a,l,u=8*o-s-1,p=(1<<u)-1,_=p>>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:o-1,c=i?1:-1,T=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,r=p):(r=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-r))<1&&(r--,l*=2),(e+=r+_>=1?d/l:d*Math.pow(2,1-_))*l>=2&&(r++,l/=2),r+_>=p?(a=0,r=p):r+_>=1?(a=(e*l-1)*Math.pow(2,s),r+=_):(a=e*Math.pow(2,_-1)*Math.pow(2,s),r=0));s>=8;t[n+h]=255&a,h+=c,a/=256,s-=8);for(r=r<<s|a,u+=s;u>0;t[n+h]=255&r,h+=c,r/=256,u-=8);t[n+h-c]|=128*T}},5606:t=>{var e,n,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function r(t){if(e===setTimeout)return setTimeout(t,0);if((e===s||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:s}catch(t){e=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var a,l=[],u=!1,p=-1;function _(){u&&a&&(u=!1,a.length?l=a.concat(l):p=-1,l.length&&d())}function d(){if(!u){var t=r(_);u=!0;for(var e=l.length;e;){for(a=l,l=[];++p<e;)a&&a[p].run();p=-1,e=l.length}a=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function c(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||u||r(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=c,i.addListener=c,i.once=c,i.off=c,i.removeListener=c,i.removeAllListeners=c,i.emit=c,i.prependListener=c,i.prependOnceListener=c,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},9610:(t,e,n)=>{"use strict";n.d(e,{D:()=>i});var i=function(){function t(t){var e=this;void 0===t&&(t=!1),this.ignoreMultipleSettles=t,this.isSettled=!1,this.promise=new Promise((function(t,n){e.resolveCallback=t,e.rejectCallback=n}))}return t.prototype.markAsSettled=function(){var t=this.isSettled;if(t&&!this.ignoreMultipleSettles)throw new Error("PromiseDelegate is already settled!");return this.isSettled=!0,!t},Object.defineProperty(t.prototype,"settled",{get:function(){return this.isSettled},enumerable:!1,configurable:!0}),t.prototype.resolve=function(t){this.markAsSettled()&&this.resolveCallback(t)},t.prototype.reject=function(t){this.markAsSettled()&&this.rejectCallback(t)},t}()},2861:(t,e,n)=>{
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=n(8287),s=i.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function r(t,e,n){return s(t,e,n)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=r),r.prototype=Object.create(s.prototype),o(s,r),r.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,n)},r.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=s(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},r.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},r.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},6944:t=>{"use strict";t.exports=path}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,e){if(1&e&&(t=this(t)),8&e)return t;if("object"==typeof t&&t){if(4&e&&t.__esModule)return t;if(16&e&&"function"==typeof t.then)return t}var n=Object.create(null);__webpack_require__.r(n);var i={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var s=2&e&&t;"object"==typeof s&&!~leafPrototypes.indexOf(s);s=getProto(s))Object.getOwnPropertyNames(s).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,__webpack_require__.d(n,i),n},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.f={},__webpack_require__.e=t=>Promise.all(Object.keys(__webpack_require__.f).reduce(((e,n)=>(__webpack_require__.f[n](t,e),e)),[])),__webpack_require__.u=t=>t+".bundle.js",__webpack_require__.miniCssF=t=>"styles/"+t+".45554be0.css",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(t,e,n,i)=>{if(inProgress[t])inProgress[t].push(e);else{var s,o;if(void 0!==n)for(var r=document.getElementsByTagName("script"),a=0;a<r.length;a++){var l=r[a];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==dataWebpackPrefix+n){s=l;break}}s||(o=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,__webpack_require__.nc&&s.setAttribute("nonce",__webpack_require__.nc),s.setAttribute("data-webpack",dataWebpackPrefix+n),s.src=t),inProgress[t]=[e];var u=(e,n)=>{s.onerror=s.onload=null,clearTimeout(p);var i=inProgress[t];if(delete inProgress[t],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((t=>t(n))),e)return e(n)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),o&&document.head.appendChild(s)}},__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;__webpack_require__.g.importScripts&&(t=__webpack_require__.g.location+"");var e=__webpack_require__.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=n[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=t})(),(()=>{if("undefined"!=typeof document){var t=t=>new Promise(((e,n)=>{var i=__webpack_require__.miniCssF(t),s=__webpack_require__.p+i;if(((t,e)=>{for(var n=document.getElementsByTagName("link"),i=0;i<n.length;i++){var s=(r=n[i]).getAttribute("data-href")||r.getAttribute("href");if("stylesheet"===r.rel&&(s===t||s===e))return r}var o=document.getElementsByTagName("style");for(i=0;i<o.length;i++){var r;if((s=(r=o[i]).getAttribute("data-href"))===t||s===e)return r}})(i,s))return e();((t,e,n,i,s)=>{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",__webpack_require__.nc&&(o.nonce=__webpack_require__.nc),o.onerror=o.onload=n=>{if(o.onerror=o.onload=null,"load"===n.type)i();else{var r=n&&n.type,a=n&&n.target&&n.target.href||e,l=new Error("Loading CSS chunk "+t+" failed.\n("+r+": "+a+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=r,l.request=a,o.parentNode&&o.parentNode.removeChild(o),s(l)}},o.href=e,n?n.parentNode.insertBefore(o,n.nextSibling):document.head.appendChild(o)})(t,s,null,e,n)})),e={792:0};__webpack_require__.f.miniCss=(n,i)=>{e[n]?i.push(e[n]):0!==e[n]&&{317:1}[n]&&i.push(e[n]=t(n).then((()=>{e[n]=0}),(t=>{throw delete e[n],t})))}}})(),(()=>{var t={792:0};__webpack_require__.f.j=(e,n)=>{var i=__webpack_require__.o(t,e)?t[e]:void 0;if(0!==i)if(i)n.push(i[2]);else{var s=new Promise(((n,s)=>i=t[e]=[n,s]));n.push(i[2]=s);var o=__webpack_require__.p+__webpack_require__.u(e),r=new Error;__webpack_require__.l(o,(n=>{if(__webpack_require__.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var s=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+e+" failed.\n("+s+": "+o+")",r.name="ChunkLoadError",r.type=s,r.request=o,i[1](r)}}),"chunk-"+e,e)}};var e=(e,n)=>{var i,s,[o,r,a]=n,l=0;if(o.some((e=>0!==t[e]))){for(i in r)__webpack_require__.o(r,i)&&(__webpack_require__.m[i]=r[i]);if(a)a(__webpack_require__)}for(e&&e(n);l<o.length;l++)s=o[l],__webpack_require__.o(t,s)&&t[s]&&t[s][0](),t[s]=0},n=self.webpackChunk_mixly_python_pyodide=self.webpackChunk_mixly_python_pyodide||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})();var __webpack_exports__={};(()=>{"use strict";var t={};__webpack_require__.r(t),__webpack_require__.d(t,{controls_type:()=>It,controls_typeLists:()=>mt,lists_zip:()=>Et,lists_zip_container:()=>ft,lists_zip_item:()=>gt,unpack_iterable_object:()=>Ot,variables_change:()=>ct,variables_get:()=>dt,variables_global:()=>Tt,variables_set:()=>ht});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{base_setup:()=>At,controls_delay:()=>St,controls_end_program:()=>Ct,controls_except:()=>xt,controls_finally:()=>Ut,controls_flow_statements:()=>vt,controls_for:()=>wt,controls_forEach:()=>Dt,controls_for_range:()=>Ft,controls_if:()=>Lt,controls_if_else:()=>Vt,controls_if_elseif:()=>kt,controls_if_if:()=>Pt,controls_lambda:()=>Xt,controls_main:()=>Rt,controls_pass:()=>Gt,controls_range:()=>yt,controls_repeat_ext:()=>Bt,controls_thread:()=>Ht,controls_try:()=>Yt,controls_try_finally:()=>bt,controls_whileUntil:()=>Nt,datetime_fromtimestamp:()=>zt,do_while:()=>Wt,garbage_collection:()=>Kt,get_mem_alloc:()=>jt,get_mem_free:()=>qt,get_unique_identifier:()=>$t});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{base_map:()=>me,generate_cartesian_product:()=>fe,math_arithmetic:()=>ee,math_bit:()=>ie,math_constant:()=>Zt,math_constant_mp:()=>te,math_constrain:()=>pe,math_dec:()=>oe,math_indexer_number:()=>de,math_map:()=>_e,math_max_min:()=>ae,math_number:()=>Jt,math_number_base_conversion:()=>le,math_random:()=>ue,math_random_seed:()=>he,math_round:()=>ce,math_selfcalcu:()=>ne,math_to_int:()=>re,math_trig:()=>se,text_to_number:()=>Te,text_to_number_skulpt:()=>Ie,turn_to_int:()=>Ee});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{ascii_to_char:()=>Se,char_to_ascii:()=>Ce,number_to_text:()=>Le,os_system:()=>Je,text:()=>Oe,text_capital:()=>ke,text_center:()=>Ve,text_char:()=>Re,text_char_at:()=>Ne,text_char_at2:()=>De,text_char_at3:()=>qe,text_compareTo:()=>je,text_compare_to:()=>Pe,text_create_with_container:()=>He,text_create_with_item:()=>We,text_encode:()=>ze,text_equals_starts_ends:()=>Fe,text_eval:()=>Qe,text_find:()=>Ye,text_format:()=>Ge,text_format_noreturn:()=>$e,text_join:()=>Ae,text_join_seq:()=>xe,text_length:()=>ye,text_random_char:()=>be,text_replace:()=>Ue,text_split:()=>Be,text_strip:()=>Xe,text_substring:()=>we,text_substring2:()=>ve,text_substring3:()=>Ke,text_textarea:()=>Me});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{ENUMERATE:()=>Pn,enumerate:()=>kn,list_many_input:()=>Mn,list_tolist:()=>Cn,list_tolist2:()=>Fn,list_trig:()=>fn,lists_2d_get_col_row_data:()=>sn,lists_2d_get_data_with_col_row:()=>nn,lists_append_extend:()=>pn,lists_change_to:()=>On,lists_change_to_general:()=>An,lists_clear:()=>Tn,lists_create_with:()=>on,lists_create_with2:()=>Ln,lists_create_with_container:()=>an,lists_create_with_item:()=>ln,lists_create_with_noreturn:()=>Rn,lists_create_with_text:()=>rn,lists_create_with_text2:()=>yn,lists_del_general:()=>Sn,lists_find:()=>En,lists_getIndex3:()=>Dn,lists_getSublist3:()=>Nn,lists_get_index:()=>tn,lists_get_random_item:()=>_n,lists_get_random_sublist:()=>dn,lists_get_sublist:()=>en,lists_insert_value:()=>hn,lists_insert_value2:()=>vn,lists_pop:()=>mn,lists_remove_at:()=>In,lists_remove_at2:()=>wn,lists_reverse:()=>cn,lists_setIndex3:()=>bn,lists_set_index:()=>un,lists_sort:()=>gn});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{dicts_add_change_del:()=>Jn,dicts_add_or_change:()=>Hn,dicts_clear:()=>jn,dicts_create_with:()=>Yn,dicts_create_with_container:()=>xn,dicts_create_with_item:()=>Un,dicts_create_with_noreturn:()=>ei,dicts_deldict:()=>Qn,dicts_delete:()=>Wn,dicts_get:()=>Xn,dicts_get_default:()=>Gn,dicts_items:()=>qn,dicts_keys:()=>Bn,dicts_length:()=>zn,dicts_pop:()=>Zn,dicts_setdefault:()=>ti,dicts_to_json:()=>ii,dicts_to_to:()=>oi,dicts_todict:()=>ni,dicts_update:()=>Kn,dicts_values:()=>$n,json_to_dicts:()=>si});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{logic_boolean:()=>_i,logic_compare:()=>ai,logic_compare_continous:()=>li,logic_is:()=>Ti,logic_is_in:()=>ci,logic_negate:()=>pi,logic_null:()=>di,logic_operation:()=>ui,logic_tobool:()=>Ii,logic_true_or_false:()=>hi});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{sdcard_mount:()=>xi,sdcard_use_spi_init:()=>Yi,storage_can_write_ornot:()=>Si,storage_change_dir:()=>ki,storage_close_file:()=>Li,storage_delete_file:()=>Di,storage_file_seek:()=>vi,storage_file_tell:()=>bi,storage_file_write:()=>Oi,storage_fileopen:()=>Ei,storage_fileopen_new:()=>fi,storage_fileopen_new_encoding:()=>gi,storage_get_a_line:()=>Ai,storage_get_contents:()=>Ri,storage_get_contents_without_para:()=>Mi,storage_get_current_dir:()=>wi,storage_get_file_size:()=>Ni,storage_get_filename:()=>Ci,storage_is_file:()=>Vi,storage_list_all_files:()=>yi,storage_make_dir:()=>Fi,storage_open_file_with_os:()=>mi,storage_rename:()=>Pi});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{procedures_callnoreturn:()=>Ki,procedures_callreturn:()=>ji,procedures_defnoreturn:()=>Xi,procedures_defreturn:()=>Gi,procedures_ifreturn:()=>qi,procedures_mutatorarg:()=>Wi,procedures_mutatorcontainer:()=>Hi,procedures_return:()=>$i});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{tuple_change_to:()=>as,tuple_create_with:()=>Qi,tuple_create_with_container:()=>Ji,tuple_create_with_item:()=>Zi,tuple_create_with_noreturn:()=>_s,tuple_create_with_text2:()=>ts,tuple_create_with_text_return:()=>es,tuple_del:()=>ss,tuple_find:()=>ls,tuple_getIndex:()=>ns,tuple_getSublist:()=>ps,tuple_get_random_item:()=>hs,tuple_get_sublist:()=>ds,tuple_join:()=>os,tuple_length:()=>is,tuple_max:()=>rs,tuple_totuple:()=>cs,tuple_trig:()=>us});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{set_add_discard:()=>As,set_clear:()=>Os,set_create_with:()=>Is,set_create_with_container:()=>ms,set_create_with_item:()=>Es,set_create_with_text_return:()=>Ls,set_length:()=>fs,set_operate:()=>Ms,set_operate_update:()=>Rs,set_pop:()=>gs,set_sub:()=>Ss,set_toset:()=>ys,set_update:()=>Cs});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{html_content:()=>ws,html_content_more:()=>Fs,html_document:()=>Ns,html_form:()=>ks,html_head_body:()=>vs,html_style:()=>Ps,html_style_color:()=>Ys,html_style_content:()=>Vs,html_text:()=>xs,html_title:()=>bs});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{attribute_access:()=>Zs,function_call:()=>zs,function_call_container:()=>Qs,function_call_item:()=>Js,raw_block:()=>Xs,raw_empty:()=>Hs,raw_expression:()=>Gs,raw_table:()=>Bs,text_comment:()=>Ws,text_print_multiple:()=>js,text_print_multiple_container:()=>qs,text_print_multiple_item:()=>$s,type_check:()=>Ks});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{controls_type:()=>so,controls_typeLists:()=>oo,lists_zip:()=>ro,unpack_iterable_object:()=>ao,variables_change:()=>no,variables_get:()=>to,variables_global:()=>io,variables_set:()=>eo});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{Panic_with_status_code:()=>Eo,base_setup:()=>uo,controls_delay:()=>mo,controls_flow_statements:()=>Io,controls_for:()=>ho,controls_forEach:()=>Ro,controls_for_range:()=>co,controls_if:()=>po,controls_interrupts:()=>Oo,controls_lambda:()=>So,controls_main:()=>lo,controls_millis:()=>fo,controls_nointerrupts:()=>Mo,controls_pass:()=>Lo,controls_range:()=>Ao,controls_repeat:()=>Po,controls_repeat_ext:()=>No,controls_thread:()=>yo,controls_try_finally:()=>_o,controls_whileUntil:()=>To,datetime_fromtimestamp:()=>ko,do_while:()=>Do,garbage_collection:()=>bo,get_mem_alloc:()=>vo,get_mem_free:()=>wo,get_unique_identifier:()=>Fo,reset:()=>go,time_sleep:()=>Co});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{base_map:()=>ir,generate_cartesian_product:()=>or,math_arithmetic:()=>Bo,math_bit:()=>Uo,math_constant:()=>Yo,math_constant_mp:()=>xo,math_constrain:()=>zo,math_dec:()=>Wo,math_indexer_number:()=>Zo,math_map:()=>$o,math_max_min:()=>jo,math_number:()=>Vo,math_number_base_conversion:()=>Qo,math_random:()=>qo,math_random_seed:()=>Jo,math_round:()=>tr,math_selfcalcu:()=>Xo,math_single:()=>Go,math_to_int:()=>Ko,math_trig:()=>Ho,text_to_number:()=>er,text_to_number_skulpt:()=>nr,turn_to_int:()=>sr});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{ascii_to_char:()=>pr,char_to_ascii:()=>_r,number_to_text:()=>dr,os_system:()=>Pr,text:()=>rr,text_capital:()=>Or,text_center:()=>Mr,text_char:()=>lr,text_char_at:()=>Tr,text_char_at2:()=>cr,text_char_at3:()=>vr,text_compareTo:()=>br,text_compare_to:()=>Er,text_encode:()=>wr,text_equals_starts_ends:()=>mr,text_eval:()=>Fr,text_find:()=>Rr,text_format:()=>yr,text_format_noreturn:()=>Dr,text_join:()=>ur,text_join_seq:()=>Ar,text_length:()=>hr,text_random_char:()=>Ir,text_replace:()=>Sr,text_split:()=>Cr,text_strip:()=>Lr,text_substring:()=>gr,text_substring2:()=>fr,text_substring3:()=>Nr,text_textarea:()=>ar});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{enumerate:()=>ca,list_many_input:()=>ea,list_tolist:()=>da,list_tolist2:()=>ha,list_trig:()=>Jr,lists_2d_get_col_row_data:()=>Yr,lists_2d_get_data_with_col_row:()=>Vr,lists_append_extend:()=>Gr,lists_change_to:()=>ta,lists_change_to_general:()=>ia,lists_clear:()=>qr,lists_create_with:()=>xr,lists_create_with2:()=>oa,lists_create_with_noreturn:()=>na,lists_create_with_text:()=>Ur,lists_create_with_text2:()=>ra,lists_del_general:()=>sa,lists_find:()=>$r,lists_getIndex3:()=>aa,lists_getSublist3:()=>la,lists_get_index:()=>Br,lists_get_random_item:()=>Hr,lists_get_random_sublist:()=>Wr,lists_get_sublist:()=>kr,lists_insert_value:()=>Kr,lists_insert_value2:()=>pa,lists_pop:()=>Qr,lists_remove_at:()=>zr,lists_remove_at2:()=>_a,lists_reverse:()=>jr,lists_setIndex3:()=>ua,lists_set_index:()=>Xr,lists_sort:()=>Zr});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{dicts_add_change_del:()=>La,dicts_add_or_change:()=>fa,dicts_clear:()=>Ma,dicts_create_with:()=>Ta,dicts_create_with_noreturn:()=>Na,dicts_deldict:()=>Ca,dicts_delete:()=>ga,dicts_get:()=>ma,dicts_get_default:()=>Ea,dicts_items:()=>Ra,dicts_keys:()=>Ia,dicts_length:()=>Sa,dicts_pop:()=>ya,dicts_setdefault:()=>Da,dicts_to_json:()=>va,dicts_to_to:()=>Fa,dicts_todict:()=>ba,dicts_update:()=>Oa,dicts_values:()=>Aa,json_to_dicts:()=>wa});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{logic_boolean:()=>xa,logic_compare:()=>Pa,logic_compare_continous:()=>ka,logic_is:()=>Ga,logic_is_in:()=>Xa,logic_negate:()=>Ya,logic_null:()=>Ua,logic_operation:()=>Va,logic_tobool:()=>Ha,logic_true_or_false:()=>Ba});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{sdcard_mount:()=>hl,sdcard_use_spi_init:()=>dl,storage_can_write_ornot:()=>Za,storage_change_dir:()=>al,storage_close_file:()=>el,storage_delete_file:()=>il,storage_file_seek:()=>rl,storage_file_tell:()=>ol,storage_file_write:()=>$a,storage_fileopen:()=>Ka,storage_fileopen_new:()=>ja,storage_fileopen_new_encoding:()=>qa,storage_get_a_line:()=>Ja,storage_get_contents:()=>Qa,storage_get_contents_without_para:()=>za,storage_get_current_dir:()=>ll,storage_get_file_size:()=>sl,storage_get_filename:()=>tl,storage_is_file:()=>_l,storage_list_all_files:()=>nl,storage_make_dir:()=>ul,storage_open_file_with_os:()=>Wa,storage_rename:()=>pl});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{procedures_callnoreturn:()=>ml,procedures_callreturn:()=>Il,procedures_defnoreturn:()=>Tl,procedures_defreturn:()=>cl,procedures_ifreturn:()=>El,procedures_return:()=>fl});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{tuple_change_to:()=>yl,tuple_create_with:()=>gl,tuple_create_with_noreturn:()=>vl,tuple_create_with_text2:()=>Ol,tuple_create_with_text_return:()=>Ml,tuple_del:()=>Sl,tuple_find:()=>Dl,tuple_getIndex:()=>Rl,tuple_getSublist:()=>bl,tuple_get_random_item:()=>Fl,tuple_get_sublist:()=>wl,tuple_join:()=>Cl,tuple_length:()=>Al,tuple_max:()=>Ll,tuple_totuple:()=>Pl,tuple_trig:()=>Nl});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{set_add_discard:()=>Xl,set_clear:()=>xl,set_create_with:()=>kl,set_create_with_text_return:()=>Wl,set_length:()=>Vl,set_operate:()=>Ul,set_operate_update:()=>Bl,set_pop:()=>Yl,set_sub:()=>Gl,set_toset:()=>Kl,set_update:()=>Hl});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{html_content:()=>zl,html_content_more:()=>Ql,html_document:()=>jl,html_form:()=>Zl,html_head_body:()=>$l,html_style:()=>Jl,html_style_content:()=>tu,html_text:()=>eu,html_title:()=>ql});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{attribute_access:()=>lu,function_call:()=>au,raw_block:()=>nu,raw_empty:()=>su,raw_expression:()=>iu,raw_table:()=>ou,type_check:()=>ru});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{AI_ChooseAndGet:()=>_u,AI_Face_match:()=>mu,AI_ImageClassify:()=>Tu,AI_ImageClassify_Func:()=>Iu,AI_Nlp:()=>gu,AI_Nlp_Func:()=>Mu,AI_Nlp_Func_sim:()=>Ru,AI_Nlp_Sim:()=>Ou,AI_Nlp_Topic:()=>Au,AI_Nlp_newsSummary:()=>Su,AI_Ocr:()=>Eu,AI_Ocr_Func:()=>fu,AI_Speech_asr:()=>cu,AI_Speech_synthesis:()=>hu,AI_audio:()=>Cu,AI_client:()=>du,AI_photo:()=>Lu,AI_result:()=>yu});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{algorithm_add_path:()=>Pu,algorithm_add_school:()=>bu,algorithm_all_books:()=>Qu,algorithm_all_books_sequence:()=>Ju,algorithm_book_scale:()=>pp,algorithm_check_feet:()=>Op,algorithm_chick_calculate:()=>gp,algorithm_color_seclet:()=>xp,algorithm_current_school:()=>Bu,algorithm_del_path:()=>ku,algorithm_delete_book:()=>rp,algorithm_delete_books:()=>ap,algorithm_delete_books2:()=>lp,algorithm_divide_books:()=>sp,algorithm_find_path:()=>vu,algorithm_first_book:()=>Zu,algorithm_fz_calc:()=>Sp,algorithm_fz_calc_first_min:()=>Cp,algorithm_fz_compare:()=>Lp,algorithm_fz_move:()=>Dp,algorithm_fz_set_min:()=>yp,algorithm_get_book_num:()=>cp,algorithm_get_current_location:()=>Vp,algorithm_get_half_books:()=>op,algorithm_hxdb_add:()=>Fp,algorithm_hxdb_init_soldier:()=>bp,algorithm_hxdb_last_line:()=>wp,algorithm_hxdb_result:()=>Pp,algorithm_hxdb_stand_in_line:()=>vp,algorithm_init_fzsf:()=>Ap,algorithm_init_hxdb:()=>Np,algorithm_init_jttl:()=>mp,algorithm_move_recent:()=>Wu,algorithm_new_path:()=>wu,algorithm_next_book:()=>np,algorithm_no_left:()=>Yu,algorithm_no_path:()=>Xu,algorithm_no_ring2:()=>tp,algorithm_not_home:()=>Ku,algorithm_not_school:()=>ju,algorithm_number_add:()=>dp,algorithm_number_zero:()=>_p,algorithm_prepare:()=>Nu,algorithm_prepare2:()=>Uu,algorithm_prepare_2_1:()=>Gu,algorithm_prepare_2_2:()=>Hu,algorithm_print_book2:()=>up,algorithm_print_divide:()=>Ip,algorithm_print_jttl_answer:()=>Mp,algorithm_print_number:()=>hp,algorithm_print_path:()=>xu,algorithm_print_path2:()=>qu,algorithm_print_sequence:()=>Tp,algorithm_rabbit_add:()=>Rp,algorithm_rabbit_number_in_range:()=>fp,algorithm_rabbit_zero:()=>Ep,algorithm_return_path:()=>Vu,algorithm_set_path:()=>Fu,algorithm_two_left:()=>ip,algorithm_void_path:()=>Yp,algorithm_yes_ring2:()=>ep,hanoi_init:()=>$u,hanoi_init_offline:()=>kp,hanoi_move:()=>zu});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{requests_attribute:()=>Hp,requests_get:()=>Xp,requests_get_old:()=>Bp,requests_method:()=>Wp,requests_post:()=>Gp});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{cv_destroy_all:()=>Qp,cv_face_classifier:()=>t_,cv_face_detect:()=>e_,cv_face_detect_all:()=>n_,cv_line_rect:()=>Jp,cv_read_image:()=>jp,cv_show_image:()=>qp,cv_text:()=>Zp,cv_waitkey:()=>zp,cv_write_image:()=>$p});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{array_create:()=>f_,array_toarray:()=>w_,dataframe_aggregate_func:()=>yd,dataframe_create:()=>r_,dataframe_create_from_index:()=>l_,dataframe_create_from_one_index:()=>a_,dataframe_fillna:()=>cd,dataframe_get:()=>N_,dataframe_groupby:()=>Ld,dataframe_head_tail:()=>Sd,dataframe_info:()=>Td,dataframe_median:()=>hd,dataframe_select:()=>Cd,dataframe_sort_values:()=>Ad,matrix_multiplication:()=>_d,matrix_transpose:()=>pd,numpy_argmin_template_match:()=>nd,numpy_astype:()=>Z_,numpy_c_:()=>ld,numpy_dot:()=>fd,numpy_linalg_det:()=>ud,numpy_linalg_inv:()=>dd,numpy_max:()=>md,numpy_mean:()=>id,numpy_mean_digit:()=>ed,numpy_min:()=>Id,numpy_ones:()=>ad,numpy_random_random:()=>Md,numpy_reshape:()=>J_,numpy_shape:()=>Q_,numpy_size:()=>Ed,numpy_square:()=>gd,numpy_std:()=>sd,numpy_sum:()=>Od,numpy_trig:()=>L_,pandas_drop_columns:()=>rd,pandas_dropna:()=>od,pandas_readcsv:()=>D_,pl_axes:()=>T_,pl_bar:()=>R_,pl_hist:()=>S_,pl_label:()=>E_,pl_legend:()=>I_,pl_pie:()=>A_,pl_plot:()=>h_,pl_plot_bar:()=>g_,pl_plot_easy:()=>d_,pl_plot_scatter:()=>O_,pl_plot_xy:()=>M_,pl_savefig:()=>b_,pl_show:()=>c_,pl_subplot:()=>y_,pl_text:()=>v_,pl_ticks:()=>C_,pl_title:()=>m_,plot_axes:()=>V_,plot_bar:()=>H_,plot_cla:()=>Dd,plot_hist:()=>K_,plot_label:()=>U_,plot_legend:()=>Y_,plot_pie:()=>W_,plot_plot:()=>P_,plot_plot_bar:()=>B_,plot_plot_easy:()=>F_,plot_plot_scatter:()=>X_,plot_plot_xy:()=>G_,plot_savefig:()=>$_,plot_show:()=>k_,plot_subplot:()=>q_,plot_text:()=>z_,plot_ticks:()=>j_,plot_title:()=>x_,py_sum:()=>Rd,pylab_imshow:()=>td,series_create:()=>s_,series_create_from_index:()=>o_,series_create_from_text:()=>u_,series_get_num:()=>__,series_index_value:()=>p_});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{ds_add_node_by_attr:()=>Yd,ds_add_node_by_name:()=>Vd,ds_create_linkedlist:()=>bd,ds_create_linkedlist_container:()=>vd,ds_create_linkedlist_item:()=>wd,ds_create_node:()=>Fd,ds_del_node_by_attr:()=>Ud,ds_del_node_by_name:()=>xd,ds_get_node_attr:()=>Pd,ds_reverse_linkedlist:()=>Bd,ds_set_node_attr:()=>kd});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{factory_block:()=>Jd,factory_block_return:()=>Zd,factory_block_return_with_textarea:()=>eh,factory_block_with_textarea:()=>th,factory_callMethod_noreturn:()=>zd,factory_callMethod_return:()=>Qd,factory_create_with_container:()=>Kd,factory_create_with_item:()=>jd,factory_declare:()=>$d,factory_from_import:()=>Gd,factory_function_noreturn:()=>Wd,factory_function_return:()=>qd,factory_import:()=>Hd});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{hardware_arduino_analog_read:()=>lh,hardware_arduino_analog_write:()=>ah,hardware_arduino_digital_read:()=>rh,hardware_arduino_digital_write:()=>oh,hardware_arduino_start:()=>ih,inout_highlow:()=>sh});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{inout_input:()=>uh,inout_print:()=>ph,inout_print_container:()=>Ih,inout_print_end:()=>dh,inout_print_inline:()=>_h,inout_print_item:()=>mh,inout_print_many:()=>Th,inout_type_input:()=>hh,pyinout_type_input:()=>ch});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Bh,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Uh,IOT_EMQX_PING:()=>Yh,IOT_FORMATTING:()=>kh,IOT_FORMAT_STRING:()=>Vh,IOT_MIXIO_NTP:()=>xh,IOT_MIXIO_PUBLISH:()=>yh,IOT_MIXIO_SUBSCRIBE:()=>Dh,IOT_MIXIO_UNSUBSCRIBE:()=>Nh,iot_checkonenet:()=>Qh,iot_client_onboard:()=>Hh,iot_create_with_item:()=>Ch,iot_http_client:()=>Wh,iot_http_data:()=>Kh,iot_mixio_check:()=>wh,iot_mixio_connect:()=>Lh,iot_mixio_connect_only:()=>vh,iot_mixio_disconnect:()=>bh,iot_mixio_format_msg:()=>Ph,iot_mixio_format_topic:()=>Fh,iot_mixly_key:()=>Gh,iot_mixly_key_py:()=>Xh,iot_mqtt_client:()=>jh,iot_mqtt_data:()=>qh,iot_onenet_check:()=>Oh,iot_onenet_connect:()=>fh,iot_onenet_disconnect:()=>gh,iot_onenet_publish:()=>Rh,iot_onenet_publish_dict:()=>Mh,iot_onenetconnect:()=>$h,iot_onenetdisconnect:()=>zh,iot_publish:()=>Jh,iot_publish_container:()=>Ah,iot_publish_item:()=>Sh});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{pins_analog_read:()=>ic,pins_analog_write:()=>nc,pins_digital_read:()=>ec,pins_digital_write:()=>tc});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{serial_close:()=>ac,serial_open:()=>sc,serial_read_b:()=>rc,serial_write:()=>oc});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{sklearn_DecisionTreeClassifier_Regressor:()=>Ec,sklearn_GaussianNB:()=>Oc,sklearn_KMeans:()=>Ac,sklearn_KMeans_fit:()=>Sc,sklearn_KNeighborsClassifier_Regressor:()=>gc,sklearn_LinearRegression:()=>Ic,sklearn_RandomForestClassifier_Regressor:()=>fc,sklearn_Ridge:()=>mc,sklearn_cluster_centers_labels_inertia:()=>vc,sklearn_coef_intercept:()=>bc,sklearn_data_target:()=>hc,sklearn_fit:()=>Cc,sklearn_fit_no_target:()=>Lc,sklearn_load:()=>dc,sklearn_make_blobs:()=>_c,sklearn_make_classification:()=>uc,sklearn_make_regression:()=>pc,sklearn_pca:()=>Mc,sklearn_pca_fit_transform:()=>Rc,sklearn_predict:()=>yc,sklearn_save_load_model:()=>wc,sklearn_score:()=>Dc,sklearn_score_no_target:()=>Nc,sklearn_train_test_split:()=>cc,sklearn_train_test_split_no_target:()=>Tc});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{Panic_with_status_code:()=>Yc,base_delay:()=>Pc,controls_millis:()=>kc,controls_mstimer2:()=>Uc,controls_mstimer2_start:()=>Bc,controls_mstimer2_stop:()=>Xc,reset:()=>xc,time_localtime:()=>Vc,time_sleep:()=>Gc});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{turtle_bgcolor:()=>pT,turtle_bgcolor_hex:()=>fT,turtle_bgcolor_hex_new:()=>cT,turtle_circle:()=>aT,turtle_circle_advanced:()=>lT,turtle_clear:()=>eT,turtle_clone:()=>hT,turtle_color:()=>mT,turtle_color_hex:()=>ET,turtle_color_seclet:()=>DT,turtle_create:()=>Wc,turtle_done:()=>Kc,turtle_exitonclick:()=>jc,turtle_fill:()=>iT,turtle_fillcolor:()=>dT,turtle_fillcolor_hex:()=>OT,turtle_fillcolor_hex_new:()=>IT,turtle_getscreen:()=>NT,turtle_goto:()=>Jc,turtle_listen:()=>FT,turtle_move:()=>qc,turtle_numinput:()=>AT,turtle_onclick:()=>vT,turtle_onkey:()=>bT,turtle_ontimer:()=>wT,turtle_pencolor:()=>_T,turtle_pencolor_hex:()=>gT,turtle_pencolor_hex_new:()=>TT,turtle_penup:()=>nT,turtle_pos_shape:()=>tT,turtle_rotate:()=>$c,turtle_screen_delay:()=>Qc,turtle_screen_savefig:()=>PT,turtle_setheading:()=>zc,turtle_setxy:()=>Zc,turtle_shape:()=>MT,turtle_shapesize:()=>RT,turtle_size:()=>oT,turtle_size_speed:()=>sT,turtle_speed:()=>rT,turtle_textinput:()=>ST,turtle_visible:()=>uT,turtle_write:()=>CT,turtle_write_format:()=>LT,turtle_write_format_skulpt:()=>yT});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{AI_ChooseAndGet:()=>kT,AI_Face_match:()=>BT,AI_ImageClassify:()=>UT,AI_ImageClassify_Func:()=>jT,AI_Nlp:()=>GT,AI_Nlp_Func:()=>$T,AI_Nlp_Func_sim:()=>zT,AI_Nlp_Sim:()=>HT,AI_Nlp_Topic:()=>WT,AI_Nlp_newsSummary:()=>KT,AI_Ocr:()=>XT,AI_Ocr_Func:()=>qT,AI_Speech_asr:()=>xT,AI_Speech_synthesis:()=>YT,AI_audio:()=>QT,AI_client:()=>VT,AI_photo:()=>JT,AI_result:()=>ZT});var X={};__webpack_require__.r(X),__webpack_require__.d(X,{algorithm_add_path:()=>oI,algorithm_add_school:()=>eI,algorithm_all_books:()=>MI,algorithm_all_books_sequence:()=>OI,algorithm_book_scale:()=>vI,algorithm_check_feet:()=>UI,algorithm_chick_calculate:()=>xI,algorithm_color_seclet:()=>im,algorithm_current_school:()=>_I,algorithm_del_path:()=>rI,algorithm_delete_book:()=>NI,algorithm_divide_books:()=>yI,algorithm_find_path:()=>nI,algorithm_first_book:()=>RI,algorithm_fz_calc:()=>HI,algorithm_fz_compare:()=>WI,algorithm_fz_move:()=>jI,algorithm_fz_set_min:()=>KI,algorithm_get_current_location:()=>em,algorithm_get_half_books:()=>DI,algorithm_hxdb_add:()=>JI,algorithm_hxdb_init_soldier:()=>$I,algorithm_hxdb_last_line:()=>QI,algorithm_hxdb_result:()=>ZI,algorithm_hxdb_stand_in_line:()=>zI,algorithm_init_fzsf:()=>GI,algorithm_init_hxdb:()=>qI,algorithm_init_jttl:()=>kI,algorithm_move_recent:()=>TI,algorithm_new_path:()=>iI,algorithm_next_book:()=>CI,algorithm_no_left:()=>lI,algorithm_no_path:()=>dI,algorithm_no_ring2:()=>AI,algorithm_not_home:()=>II,algorithm_not_school:()=>mI,algorithm_number_add:()=>FI,algorithm_number_zero:()=>wI,algorithm_prepare:()=>tI,algorithm_prepare2:()=>pI,algorithm_prepare_2_1:()=>hI,algorithm_prepare_2_2:()=>cI,algorithm_print_book2:()=>bI,algorithm_print_jttl_answer:()=>BI,algorithm_print_number:()=>PI,algorithm_print_path:()=>uI,algorithm_print_path2:()=>EI,algorithm_rabbit_add:()=>XI,algorithm_rabbit_number_in_range:()=>YI,algorithm_rabbit_zero:()=>VI,algorithm_return_path:()=>aI,algorithm_set_path:()=>sI,algorithm_two_left:()=>LI,algorithm_void_path:()=>nm,algorithm_yes_ring2:()=>SI,hanoi_init:()=>fI,hanoi_init_offline:()=>tm,hanoi_move:()=>gI});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{requests_attribute:()=>am,requests_get:()=>om,requests_get_old:()=>sm,requests_method:()=>lm,requests_post:()=>rm});var H={};__webpack_require__.r(H),__webpack_require__.d(H,{array_create:()=>Sm,array_toarray:()=>xm,dataframe_aggregate_func:()=>FE,dataframe_create:()=>dm,dataframe_create_from_index:()=>hm,dataframe_create_from_one_index:()=>cm,dataframe_fillna:()=>gE,dataframe_get:()=>km,dataframe_groupby:()=>wE,dataframe_head_tail:()=>bE,dataframe_info:()=>OE,dataframe_median:()=>fE,dataframe_select:()=>vE,dataframe_sort_values:()=>NE,matrix_multiplication:()=>mE,matrix_transpose:()=>IE,numpy_argmin_template_match:()=>lE,numpy_astype:()=>oE,numpy_c_:()=>cE,numpy_dot:()=>SE,numpy_linalg_det:()=>TE,numpy_linalg_inv:()=>EE,numpy_max:()=>RE,numpy_mean:()=>uE,numpy_mean_digit:()=>aE,numpy_min:()=>ME,numpy_ones:()=>hE,numpy_random_random:()=>yE,numpy_reshape:()=>sE,numpy_shape:()=>iE,numpy_size:()=>AE,numpy_square:()=>CE,numpy_std:()=>pE,numpy_sum:()=>LE,numpy_trig:()=>wm,pandas_drop_columns:()=>dE,pandas_dropna:()=>_E,pandas_readcsv:()=>Pm,pl_axes:()=>fm,pl_bar:()=>Dm,pl_hist:()=>bm,pl_label:()=>Am,pl_legend:()=>Mm,pl_pie:()=>Nm,pl_plot:()=>Om,pl_plot_bar:()=>Cm,pl_plot_easy:()=>gm,pl_plot_scatter:()=>Lm,pl_plot_xy:()=>ym,pl_savefig:()=>Vm,pl_show:()=>Em,pl_subplot:()=>Fm,pl_text:()=>Ym,pl_ticks:()=>vm,pl_title:()=>Rm,plot_axes:()=>Bm,plot_bar:()=>zm,plot_cla:()=>PE,plot_hist:()=>Jm,plot_label:()=>Km,plot_legend:()=>Hm,plot_pie:()=>Qm,plot_plot:()=>Gm,plot_plot_bar:()=>jm,plot_plot_easy:()=>Xm,plot_plot_scatter:()=>qm,plot_plot_xy:()=>$m,plot_savefig:()=>eE,plot_show:()=>Um,plot_subplot:()=>tE,plot_text:()=>nE,plot_ticks:()=>Zm,plot_title:()=>Wm,py_sum:()=>DE,pylab_imshow:()=>rE,series_create:()=>pm,series_create_from_index:()=>_m,series_create_from_text:()=>Tm,series_get_num:()=>mm,series_index_value:()=>Im});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{ds_add_node_by_attr:()=>BE,ds_add_node_by_name:()=>UE,ds_create_linkedlist:()=>kE,ds_create_node:()=>VE,ds_del_node_by_attr:()=>GE,ds_del_node_by_name:()=>XE,ds_get_node_attr:()=>YE,ds_reverse_linkedlist:()=>HE,ds_set_node_attr:()=>xE});var K={};__webpack_require__.r(K),__webpack_require__.d(K,{factory_block:()=>JE,factory_block_return:()=>ZE,factory_block_return_with_textarea:()=>ef,factory_block_with_textarea:()=>tf,factory_callMethod_noreturn:()=>zE,factory_callMethod_return:()=>QE,factory_declare:()=>$E,factory_from_import:()=>WE,factory_function_noreturn:()=>jE,factory_function_return:()=>qE,factory_import:()=>KE});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{hardware_arduino_analog_read:()=>af,hardware_arduino_analog_write:()=>lf,hardware_arduino_digital_read:()=>rf,hardware_arduino_digital_write:()=>of,hardware_arduino_start:()=>nf,inout_highlow:()=>sf});var q={};__webpack_require__.r(q),__webpack_require__.d(q,{inout_input:()=>uf,inout_print:()=>pf,inout_print_end:()=>df,inout_print_inline:()=>_f,inout_print_many:()=>Tf,inout_type_input:()=>hf,pyinout_type_input:()=>cf});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Lf,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Nf,IOT_EMQX_PING:()=>bf,IOT_FORMATTING:()=>Sf,IOT_FORMAT_STRING:()=>Cf,IOT_MIXIO_NTP:()=>vf,IOT_MIXIO_PUBLISH:()=>mf,IOT_MIXIO_SUBSCRIBE:()=>Ef,IOT_MIXIO_UNSUBSCRIBE:()=>ff,iot_mixio_check:()=>Mf,iot_mixio_connect:()=>If,iot_mixio_connect_only:()=>Of,iot_mixio_disconnect:()=>gf,iot_mixio_format_msg:()=>Af,iot_mixio_format_topic:()=>Rf,iot_mixly_key:()=>yf,iot_mixly_key_py:()=>Df});var Q={};__webpack_require__.r(Q),__webpack_require__.d(Q,{pins_analog_read:()=>Vf,pins_analog_write:()=>kf,pins_digital:()=>wf,pins_digital_read:()=>Pf,pins_digital_write:()=>Ff});var J={};__webpack_require__.r(J),__webpack_require__.d(J,{serial_close:()=>Bf,serial_open:()=>Yf,serial_read_b:()=>Uf,serial_write:()=>xf});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{sklearn_DecisionTreeClassifier_Regressor:()=>Qf,sklearn_GaussianNB:()=>tg,sklearn_KMeans:()=>ig,sklearn_KMeans_fit:()=>sg,sklearn_KNeighborsClassifier_Regressor:()=>Zf,sklearn_LinearRegression:()=>$f,sklearn_RandomForestClassifier_Regressor:()=>Jf,sklearn_Ridge:()=>zf,sklearn_cluster_centers_labels_inertia:()=>_g,sklearn_coef_intercept:()=>pg,sklearn_data_target:()=>Kf,sklearn_fit:()=>og,sklearn_fit_no_target:()=>rg,sklearn_load:()=>Wf,sklearn_make_blobs:()=>Hf,sklearn_make_classification:()=>Xf,sklearn_make_regression:()=>Gf,sklearn_pca:()=>eg,sklearn_pca_fit_transform:()=>ng,sklearn_predict:()=>ag,sklearn_save_load_model:()=>dg,sklearn_score:()=>lg,sklearn_score_no_target:()=>ug,sklearn_train_test_split:()=>jf,sklearn_train_test_split_no_target:()=>qf});var tt={};__webpack_require__.r(tt),__webpack_require__.d(tt,{controls_end_program:()=>cg,controls_millis:()=>hg,time_localtime:()=>Tg});var et={};__webpack_require__.r(et),__webpack_require__.d(et,{turtle_bgcolor:()=>Pg,turtle_bgcolor_hex:()=>xg,turtle_bgcolor_hex_new:()=>Xg,turtle_circle:()=>bg,turtle_circle_advanced:()=>wg,turtle_clear:()=>Sg,turtle_clone:()=>Yg,turtle_color:()=>Kg,turtle_color_hex:()=>Wg,turtle_color_seclet:()=>tO,turtle_create:()=>Ig,turtle_done:()=>mg,turtle_exitonclick:()=>Eg,turtle_fill:()=>Lg,turtle_fillcolor:()=>Vg,turtle_fillcolor_hex:()=>Bg,turtle_fillcolor_hex_new:()=>Hg,turtle_getscreen:()=>eO,turtle_goto:()=>Rg,turtle_listen:()=>oO,turtle_move:()=>fg,turtle_numinput:()=>zg,turtle_onclick:()=>iO,turtle_onkey:()=>nO,turtle_ontimer:()=>sO,turtle_pencolor:()=>kg,turtle_pencolor_hex:()=>Ug,turtle_pencolor_hex_new:()=>Gg,turtle_penup:()=>Cg,turtle_pos_shape:()=>Ag,turtle_rotate:()=>gg,turtle_screen_delay:()=>Mg,turtle_screen_savefig:()=>rO,turtle_setheading:()=>Og,turtle_setxy:()=>vg,turtle_shape:()=>jg,turtle_shapesize:()=>qg,turtle_size:()=>Dg,turtle_size_speed:()=>yg,turtle_speed:()=>Ng,turtle_textinput:()=>$g,turtle_visible:()=>Fg,turtle_write:()=>Qg,turtle_write_format:()=>Jg,turtle_write_format_skulpt:()=>Zg});var nt={};__webpack_require__.r(nt),__webpack_require__.d(nt,{COPYFILE_EXCL:()=>BO,COPYFILE_FICLONE:()=>XO,COPYFILE_FICLONE_FORCE:()=>GO,F_OK:()=>VO,O_APPEND:()=>QO,O_CREAT:()=>jO,O_DIRECT:()=>sM,O_DIRECTORY:()=>JO,O_DSYNC:()=>nM,O_EXCL:()=>qO,O_NOATIME:()=>ZO,O_NOCTTY:()=>$O,O_NOFOLLOW:()=>tM,O_NONBLOCK:()=>oM,O_RDONLY:()=>HO,O_RDWR:()=>KO,O_SYMLINK:()=>iM,O_SYNC:()=>eM,O_TRUNC:()=>zO,O_WRONLY:()=>WO,R_OK:()=>YO,S_IFBLK:()=>pM,S_IFCHR:()=>dM,S_IFDIR:()=>_M,S_IFIFO:()=>hM,S_IFLNK:()=>lM,S_IFMT:()=>rM,S_IFREG:()=>uM,S_IFSOCK:()=>aM,S_IRGRP:()=>MM,S_IROTH:()=>CM,S_IRUSR:()=>EM,S_IRWXG:()=>OM,S_IRWXO:()=>SM,S_IRWXU:()=>mM,S_ISGID:()=>TM,S_ISUID:()=>cM,S_ISVTX:()=>IM,S_IWGRP:()=>RM,S_IWOTH:()=>LM,S_IWUSR:()=>fM,S_IXGRP:()=>AM,S_IXOTH:()=>yM,S_IXUSR:()=>gM,UV_FS_O_FILEMAP:()=>DM,W_OK:()=>xO,X_OK:()=>UO,size_max:()=>NM});var it={};__webpack_require__.r(it),__webpack_require__.d(it,{FileHandle:()=>QA,access:()=>RS,appendFile:()=>lS,chmod:()=>mS,chown:()=>TS,constants:()=>nt,copyFile:()=>CS,cp:()=>yS,exists:()=>ZA,lchmod:()=>ES,lchown:()=>IS,link:()=>dS,lstat:()=>eS,lutimes:()=>gS,mkdir:()=>pS,mkdtemp:()=>SS,open:()=>oS,opendir:()=>LS,readFile:()=>rS,readdir:()=>_S,readlink:()=>cS,realpath:()=>OS,rename:()=>JA,rm:()=>AS,rmdir:()=>uS,stat:()=>tS,statfs:()=>DS,symlink:()=>hS,truncate:()=>nS,unlink:()=>iS,utimes:()=>fS,watch:()=>MS,writeFile:()=>aS});var st={};__webpack_require__.r(st),__webpack_require__.d(st,{BigIntStatsFs:()=>VM,Dir:()=>WA,Dirent:()=>HA,ReadStream:()=>jA,Stats:()=>FM,StatsFs:()=>kM,WriteStream:()=>qA,_synced:()=>UR,access:()=>pC,accessSync:()=>PA,appendFile:()=>US,appendFileSync:()=>_A,chmod:()=>oC,chmodSync:()=>NA,chown:()=>iC,chownSync:()=>yA,chroot:()=>WR,close:()=>XS,closeSync:()=>hA,constants:()=>nt,copyFile:()=>fC,copyFileSync:()=>YA,cp:()=>RC,cpSync:()=>XA,createReadStream:()=>TC,createWriteStream:()=>IC,exists:()=>vS,existsSync:()=>tA,fchmod:()=>$S,fchmodSync:()=>gA,fchown:()=>qS,fchownSync:()=>fA,fdatasync:()=>WS,fdatasyncSync:()=>IA,fstat:()=>BS,fstatSync:()=>dA,fsync:()=>HS,fsyncSync:()=>TA,ftruncate:()=>GS,ftruncateSync:()=>cA,futimes:()=>zS,futimesSync:()=>OA,lchmod:()=>rC,lchmodSync:()=>bA,lchown:()=>sC,lchownSync:()=>DA,link:()=>tC,linkSync:()=>SA,lopenSync:()=>aA,lstat:()=>FS,lstatSync:()=>nA,lutimes:()=>lC,lutimesSync:()=>wA,mkdir:()=>JS,mkdirSync:()=>RA,mkdtemp:()=>EC,mkdtempSync:()=>VA,mount:()=>VR,mountObject:()=>GR,mounts:()=>kR,open:()=>VS,openAsBlob:()=>SC,openSync:()=>rA,opendir:()=>MC,opendirSync:()=>BA,promises:()=>it,read:()=>jS,readFile:()=>YS,readFileSync:()=>uA,readSync:()=>EA,readdir:()=>ZS,readdirSync:()=>AA,readlink:()=>nC,readlinkSync:()=>LA,readv:()=>gC,readvSync:()=>xA,realpath:()=>uC,realpathSync:()=>FA,rename:()=>bS,renameSync:()=>ZR,rm:()=>mC,rmSync:()=>kA,rmdir:()=>QS,rmdirSync:()=>MA,stat:()=>wS,statSync:()=>eA,statfs:()=>AC,statfsSync:()=>GA,symlink:()=>eC,symlinkSync:()=>CA,truncate:()=>PS,truncateSync:()=>iA,umount:()=>YR,unlink:()=>kS,unlinkSync:()=>sA,unwatchFile:()=>hC,utimes:()=>aC,utimesSync:()=>vA,watch:()=>cC,watchFile:()=>dC,write:()=>KS,writeFile:()=>xS,writeFileSync:()=>pA,writeSync:()=>mA,writev:()=>OC,writevSync:()=>UA});const ot=Blockly;Object.assign(ot.Lang.ZhHans,{PYTHON_PYODIDE_IMAGE:"图像",PYTHON_PYODIDE_LOADING:"Python3内核载入中...",PYTHON_PYODIDE_FILE_SYSTEM:"本地文件系统",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"载入本地文件夹"}),Object.assign(ot.Lang.ZhHant,{PYTHON_PYODIDE_IMAGE:"影像",PYTHON_PYODIDE_LOADING:"Python3核心載入...",PYTHON_PYODIDE_FILE_SYSTEM:"本機檔案系統",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"載入本機資料夾"}),Object.assign(ot.Lang.En,{PYTHON_PYODIDE_IMAGE:"Image",PYTHON_PYODIDE_LOADING:"Python3 kernel loading...",PYTHON_PYODIDE_FILE_SYSTEM:"Local File System",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"Load Local Folder"}),Object.assign(ot.Lang.ZhHans.MSG,{}),Object.assign(ot.Lang.ZhHant.MSG,{}),Object.assign(ot.Lang.En.MSG,{});const rt=Mixly,at={NAME_TYPE:"VARIABLE",allVariables:function(t){var e;if(t.getDescendants)e=t.getDescendants();else{if(!t.getAllBlocks)throw"Not Block or Workspace: "+t;e=t.getAllBlocks()}for(var n=Object.create(null),i=0;i<e.length;i++)for(var s=e[i].getVars(),o=0;o<s.length;o++){var r=s[o];r&&(n[r.toLowerCase()]=r)}var a=[];for(var l in n)a.push(n[l]);return a},renameVariable:function(t,e,n){ot.Events.setGroup(!0);for(var i=n.getAllBlocks(),s=0;s<i.length;s++)i[s].renameVar(t,e);ot.Events.setGroup(!1)},flyoutCategory:function(t){var e=at.allVariables(t),n=[];((r=ot.utils.xml.createElement("block")).setAttribute("type","variables_global"),n.push(r),ot.Blocks.variables_set)&&((r=ot.utils.xml.createElement("block")).setAttribute("type","variables_set"),n.push(r));ot.Blocks.variables_change&&((r=ot.utils.xml.createElement("block")).setAttribute("type","variables_change"),n.push(r));ot.Blocks.controls_type&&((r=ot.utils.xml.createElement("block")).setAttribute("type","controls_type"),n.push(r));ot.Blocks.controls_typeLists&&((r=ot.utils.xml.createElement("block")).setAttribute("type","controls_typeLists"),n.push(r));if(ot.Blocks.lists_zip){(r=ot.utils.xml.createElement("block")).setAttribute("type","lists_zip"),r.setAttribute("inline","false");var i=ot.utils.xml.createElement("mutation");i.setAttribute("items",2),r.appendChild(i);for(let t=0;t<2;t++){let e=ot.utils.xml.createElement("value");e.setAttribute("name",`ADD${t}`),r.appendChild(e)}n.push(r)}ot.Blocks.unpack_iterable_object&&((r=ot.utils.xml.createElement("block")).setAttribute("type","unpack_iterable_object"),n.push(r));for(var s=0;s<e.length;s++){if(ot.Blocks.variables_set){(r=ot.utils.xml.createElement("block")).setAttribute("type","variables_set"),ot.Blocks.variables_get&&r.setAttribute("gap",8),(a=ot.utils.xml.createElement("field",null,e[s])).setAttribute("name","VAR");var o=ot.utils.xml.createTextNode(e[s]);a.appendChild(o),r.appendChild(a),n.push(r)}if(ot.Blocks.variables_get){var r,a;(r=ot.utils.xml.createElement("block")).setAttribute("type","variables_get"),ot.Blocks.variables_set&&r.setAttribute("gap",24),(a=ot.utils.xml.createElement("field",null,e[s])).setAttribute("name","VAR");o=ot.utils.xml.createTextNode(e[s]);a.appendChild(o),r.appendChild(a),n.push(r)}}return n},generateUniqueName:function(t){var e=at.allVariables(t),n="";if(e.length)for(var i=1,s="ijkmnopqrstuvwxyzabcdefgh",o=0,r=s.charAt(o);!n;){for(var a=!1,l=0;l<e.length;l++)if(e[l].toLowerCase()==r){a=!0;break}a?(25==++o&&(o=0,i++),r=s.charAt(o),i>1&&(r+=i)):n=r}else n="i";return n}},lt=at;
/**
* @license
* Visual Blocks Editor
*
* Copyright 2012 Google Inc.
* https://developers.google.com/blockly/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class ut{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var n=t.split(","),i=0;i<n.length;i++)this.reservedDict_[n[i]]=!0;this.reset()}static equals(t,e){return t.toLowerCase()==e.toLowerCase()}reset(){this.db_=Object.create(null),this.dbReverse_=Object.create(null),this.variableMap_=null}setVariableMap(t){this.variableMap_=t}getNameForUserVariable_(t){if(!this.variableMap_)return null;var e=this.variableMap_.getVariableById(t);return e?e.name:null}getName(t,e){if(e==lt.NAME_TYPE){var n=this.getNameForUserVariable_(t);n&&(t=n)}var i=t.toLowerCase()+"_"+e,s=e==lt.NAME_TYPE||e==ut.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"";if(i in this.db_)return s+this.db_[i];var o=this.getDistinctName(t,e);return this.db_[i]=o.substr(s.length),o}getDistinctName(t,e){for(var n=this.safeName_(t),i="";this.dbReverse_[n+i]||n+i in this.reservedDict_;)i=i?i+1:2;return n+=i,this.dbReverse_[n]=!0,(e==lt.NAME_TYPE||e==ut.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"")+n}safeName_(t){return t?(t=encodeURI(t.replace(/ /g,"_")).replace(/[^,\w]/g,"_"),-1!="0123456789".indexOf(t[0])&&(t="my_"+t)):t="unnamed",t}}ut.DEVELOPER_VARIABLE_TYPE="DEVELOPER_VARIABLE";const pt=ut,_t=330,dt={init:function(){this.setColour(_t),this.appendDummyInput().appendField(new ot.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(ot.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){pt.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},ht={init:function(){this.setColour(_t),this.appendValueInput("VALUE").appendField(new ot.FieldTextInput(""),"VAR").appendField(ot.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){pt.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},ct={init:function(){this.setColour(_t);var t=[[ot.Msg.LANG_MATH_INT,"int"],[ot.Msg.LANG_MATH_FLOAT,"float"],[ot.Msg.LANG_MATH_BOOLEAN,"bool"],[ot.Msg.LANG_MATH_STRING,"str"],[ot.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[ot.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[ot.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[ot.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[ot.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new ot.FieldDropdown(t),"OP"),this.setOutput(!0)}},Tt={init:function(){this.setColour(_t),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.TEXT_PRINT_TOOLTIP)}},It={init:function(){this.setColour(_t),this.appendValueInput("DATA").appendField(ot.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(ot.Msg.MICROBIT_PYTHON_TYPE)}},mt={init:function(){this.setColour(_t),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new ot.FieldDropdown([[ot.Msg.LANG_MATH_INT,"int"],[ot.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[ot.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[ot.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[ot.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[ot.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[ot.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[ot.Msg.LANG_MATH_BYTE,"bytes"],[ot.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return ot.Msg.MICROBIT_controls_TypeLists+{int:ot.Msg.LANG_MATH_INT,float:ot.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:ot.Msg.MIXLY_MICROBIT_TYPE_STRING,list:ot.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:ot.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:ot.Msg.MIXLY_MICROBIT_TYPE_DICT,set:ot.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:ot.Msg.MIXLY_MICROBIT_IMAGE,bytes:ot.Msg.LANG_MATH_BYTE,NoneType:ot.Msg.LOGIC_NULL}[e]}))}},Et={init:function(){this.setColour(_t),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new ot.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(ot.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_zip_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("lists_zip_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(ot.Msg.MIXLY_PYTHON_LISTS_ZIP);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.MIXLY_PYTHON_LISTS_ZIP)}}},ft={init:function(){this.setColour(_t),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_LISTS_ZIP).appendField("[]"),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_CONTAINER_TOOLTIP),this.contextMenu=!1}},gt={init:function(){this.setColour(_t),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM_TOOLTIP),this.contextMenu=!1}},Ot={init:function(){this.setColour(_t),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_VARIABLE_UNPACK).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM,"*"],[ot.Msg.MIXLY_MICROBIT_TYPE_DICT,"**"]]),"TYPE"),this.setTooltip(""),this.setOutput(!0)}},Mt=120,Rt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},At={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},St={init:function(){var t=[[ot.Msg.MIXLY_mSecond,"delay"],[ot.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour(Mt),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY).appendField(new ot.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},Ct={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},Lt={init:function(){this.setColour(Mt),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(ot.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(ot.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new ot.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?ot.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?ot.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?ot.Msg.CONTROLS_IF_TOOLTIP_4:"":ot.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ot.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(ot.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.CONTROLS_IF_MSG_ELSE);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_if_elseif");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),n.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],o=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_if_elseif":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),o=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ot.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(ot.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},yt={init:function(){this.setColour(Mt),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PYTHON_RANGE).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Dt={init:function(){this.setColour(Mt),this.appendValueInput("LIST").setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(ot.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return ot.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Nt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(ot.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new ot.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(ot.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:ot.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:ot.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},bt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.MIXLY_PYTHON_FINALLY);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_except");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),n.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],o=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,o=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_except":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),o=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},vt={init:function(){this.setColour(Mt);var t=new ot.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:ot.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:ot.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},wt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ot.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ot.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ft={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ot.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ot.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Nt.OPERATORS=[[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],vt.OPERATORS=[[ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Pt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Vt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Yt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},xt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Ut={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Bt={init:function(){this.jsonInit({message0:ot.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Mt,tooltip:ot.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:ot.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Xt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_STAT),this.setOutput(!0)}},Gt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Ht={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Wt={init:function(){this.appendDummyInput().appendField(ot.Msg.CONTROLS_REPEAT_TITLE_REPEAT+ot.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(ot.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new ot.FieldDropdown([[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Mt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},qt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},$t={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET+ot.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_GET_UNIQUE_IDEN)}},zt={init:function(){this.setColour(Mt),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(ot.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Qt=230;ot.FieldTextInput.math_number_validator=function(t){return String(t)},ot.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Jt={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(new ot.FieldTextInput("0",ot.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MATH_NUMBER_TOOLTIP)}},Zt={init:function(){this.setColour(Qt);this.appendDummyInput("").appendField(ot.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ot.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},te={init:function(){this.setColour(Qt);this.appendDummyInput("").appendField(ot.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ot.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},ee={init:function(){this.setColour(Qt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ot.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ot.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ot.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ne={init:function(){this.setColour(Qt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ot.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ot.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ot.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ie={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new ot.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},se={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:ot.Msg.MATH_TRIG_TOOLTIP_SIN,COS:ot.Msg.MATH_TRIG_TOOLTIP_COS,TAN:ot.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:ot.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:ot.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:ot.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:ot.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},oe={init:function(){var t=[[ot.Msg.MATH_BIN,"bin"],[ot.Msg.MATH_OCT,"oct"],[ot.Msg.MATH_HEX,"hex"]];this.setColour(Qt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:ot.Msg.MATH_DEC_TOOLTIP_BIN,oct:ot.Msg.MATH_DEC_TOOLTIP_OCT,hex:ot.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},re={init:function(){var t=[[ot.Msg.LANG_MATH_TO_ROUND,"round"],[ot.Msg.LANG_MATH_TO_CEIL,"ceil"],[ot.Msg.LANG_MATH_TO_FLOOR,"floor"],[ot.Msg.MATH_ABS,"fabs"],[ot.Msg.MATH_SQRT,"sqrt"]];this.setColour(Qt),this.appendValueInput("A").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:ot.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:ot.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:ot.Msg.MATH_SINGLE_TOOLTIP_SQ,round:ot.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:ot.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:ot.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},ae={init:function(){var t=[[ot.Msg.MIXLY_MAX,"max"],[ot.Msg.MIXLY_MIN,"min"]];this.setColour(Qt),this.appendValueInput("A").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:ot.Msg.MIXLY_TOOLTIP_MATH_MAX,min:ot.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},le={init:function(){var t=[[ot.Msg.MATH_TWO,"two"],[ot.Msg.MATH_EIGHT,"eight"],[ot.Msg.MATH_TEN,"ten"],[ot.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Qt),this.appendDummyInput("").appendField(ot.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new ot.FieldDropdown(t),"OP").appendField(ot.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(ot.Msg.MATH_ZHW).appendField(new ot.FieldDropdown(t),"OP2").appendField(ot.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),n={two:ot.Msg.MATH_Before_two,eight:ot.Msg.MATH_Before_eight,ten:ot.Msg.MATH_Before_ten,sixteen:ot.Msg.MATH_Before_sixteen},i=e.getFieldValue("OP2"),s={two:ot.Msg.MATH_Behind_two,eight:ot.Msg.MATH_Behind_eight,ten:ot.Msg.MATH_Behind_ten,sixteen:ot.Msg.MATH_Behind_sixteen};return n[t]+s[i]}))}},ue={init:function(){var t=[[ot.Msg.LANG_MATH_INT,"int"],[ot.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Qt),this.setOutput(!0,Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_RANDOM).appendField(new ot.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),n={int:ot.Msg.LANG_MATH_INT,float:ot.Msg.LANG_MATH_FLOAT_RANDOM};return ot.Msg.MATH_RANDOM_INT_TOOLTIP+n[t]}))}},pe={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(ot.Msg.MATH_CONSTRAIN_TOOLTIP)}},_e={init:function(){this.setColour(Qt),this.appendValueInput("NUM",Number).appendField(ot.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(ot.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(ot.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_MATH_MAP)}},de={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(new ot.FieldTextInput("0",ot.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(ot.Msg.MATH_NUMBER_TOOLTIP)}},he={init:function(){this.setColour(Qt),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},ce={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MATH_ROUND).appendField(ot.Msg.TEXT_KEEP),this.appendDummyInput().appendField(ot.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(ot.Msg.MATH_ROUND_NEW_TOOLTIP)}},Te={init:function(){var t=[[ot.Msg.MIXLY_TO_INT,"int"],[ot.Msg.MIXLY_TO_FLOAT,"float"],[ot.Msg.MIXLY_TO_BITES,"b"],[ot.Msg.LANG_MATH_BYTE+ot.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Qt),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ot.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:ot.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:ot.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Ie={init:function(){var t=[[ot.Msg.MIXLY_TO_INT,"int"],[ot.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Qt),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ot.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:ot.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},me=_e,Ee={init:function(){this.setColour(Qt),this.appendValueInput("VAR").appendField(ot.Msg.LANG_MATH_BYTE+ot.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},fe={init:function(){this.setColour(Qt),this.itemCount_=1,this.setMutator(new ot.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(ot.Msg.MIXLY_PRODUCT+ot.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(ot.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(ot.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(ot.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("lists_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput(`ADD${i}`).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput(`ADD${n}`);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else{let t=0;for(;this.getInput(`ADD${t}`);)this.removeInput(`ADD${t}`),t++}if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(ot.Msg.MIXLY_EMPTY_REMINDER);else for(let t=0;t<this.itemCount_;t++)this.appendValueInput(`ADD${t}`),this.moveInputBefore(`ADD${t}`,"REPEAT")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ge=160,Oe={init:function(){this.setColour(ge),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(ot.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new ot.FieldImage(e,12,12,'"')}},Me={init:function(){this.setColour(ge),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ot.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(ot.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new ot.FieldImage(e,12,12,'"')}};ot.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Re={init:function(){this.setColour(ge),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput("",ot.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(ot.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new ot.FieldImage(e,7,12,'"')}},Ae={init:function(){this.setColour(ge),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(ot.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Se={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ce={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Le={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ye={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},De={init:function(){this.WHERE_OPTIONS=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.TEXT_GET_INDEX_RANDOM+1+ot.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.LISTS_GET_INDEX_GET,"MODE"),ot.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(ot.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=t.getFieldValue("WHERE"),i="";switch(e+" "+n){case"GET FROM_START":case"GET FROM_END":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+ot.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",ot.Msg.ONE_BASED_INDEXING?"#1":"#0")),i}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),n={FROM_START:ot.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:ot.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:ot.Msg.TEXT_GET_INDEX_RANDOM};return ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+n[t]+"n"+ot.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==ot.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),ot.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(ot.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new ot.FieldDropdown(this.WHERE_OPTIONS,(function(e){var n="FROM_START"==e||"FROM_END"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),ot.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Ne={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LISTS_GET_INDEX_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+ot.Msg.LISTS_GET_INDEX_FROM_START+"n"+ot.Msg.TEXT_CHARAT2)}},be={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(ot.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(ot.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},ve={init:function(){this.WHERE_OPTIONS_1=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ot.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(ot.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ot.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==ot.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ot.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(ot.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var n=new ot.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},we={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(ot.Msg.LISTS_GET_INDEX_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ot.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(ot.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Fe={init:function(){var t=[[ot.Msg.MIXLY_EQUALS,"==="],[ot.Msg.MIXLY_STARTSWITH,"startswith"],[ot.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ge),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new ot.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Pe={init:function(){this.setColour(ge),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(ot.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_COMPARETO_HELP)}},ke={init:function(){var t=[[ot.Msg.TEXT_UPPER,"upper"],[ot.Msg.TEXT_TITLE,"title"],[ot.Msg.TEXT_CAPITALIZE,"capitalize"],[ot.Msg.TEXT_SWAPCASE,"swapcase"],[ot.Msg.TEXT_LOWER,"lower"]];this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ot.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:ot.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:ot.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:ot.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:ot.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:ot.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Ve={init:function(){var t=[[ot.Msg.TEXT_LJUST,"ljust"],[ot.Msg.TEXT_CENTER,"center"],[ot.Msg.TEXT_RJUST,"rjust"]];this.setColour(ge),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(ot.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(ot.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ye={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(ot.Msg.MIXLY_MID+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(ot.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},xe={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ue={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(ot.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(ot.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Be={init:function(){this.setColour(ge),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(ot.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(ot.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Xe={init:function(){var t=[[ot.Msg.TEXT_TRIM_BOTH,"strip"],[ot.Msg.TEXT_TRIM_LEFT,"lstrip"],[ot.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ge),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(ot.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:ot.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:ot.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:ot.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Ge={init:function(){this.setColour(ge),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new ot.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ot.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("text_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField();else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.PROCEDURES_BEFORE_PARAMS)}},getVars:function(){if(null!=this.getFieldValue("VAR"))return-1==this.getFieldValue("VAR").indexOf("'")&&-1==this.getFieldValue("VAR").indexOf('"')?[this.getFieldValue("VAR")]:[]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},He={init:function(){this.setColour(ge),this.appendDummyInput().appendField(ot.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},We={init:function(){this.setColour(ge),this.appendDummyInput().appendField(ot.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ke=we,je=Pe,qe=Ne,$e={init:function(){this.setColour(ge),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendValueInput("VAR").setCheck(String),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ot.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("text_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField();else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.PROCEDURES_BEFORE_PARAMS)}}},ze={init:function(){this.setColour(ge);var t=[[ot.Msg.MIXPY_TEXT_ENCODE,"encode"],[ot.Msg.MIXPY_TEXT_DECODE,"decode"]];this.appendDummyInput().appendField(new ot.FieldDropdown([["ASCII","ASCII"],["gb2312","gb2312"],["gbk","gbk"],["utf-8","utf-8"],["utf-16","utf-16"],["utf-32","utf-32"]]),"CODE").appendField(" "),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.LANG_MATH_STRING),this.setOutput(!0,String),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_TEXT_ENCODE_DECODE_TOOLTIP)}},Qe={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.MIXLY_PYTHON_TEXT_EVAL),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TEXT_EVAL_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_TEXT_EVAL_TOOLTIP)}},Je={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.MIXLY_PYTHON_OS_SYSTEM),this.setInputsInline(!0),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_OS_SYSTEM_TOOLTIP)}},Ze=260,tn={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Ze),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM)}},en={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Ze),this.appendValueInput("LIST"),this.appendDummyInput(""),this.appendValueInput("AT1").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ot.Msg.TEXT_CHARAT_TAIL+" "+ot.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.PYTHON_LISTS_GET_SUBLIST_TOOLTIP)}},nn={init:function(){this.appendValueInput("LIST").setCheck(null),this.appendValueInput("row").setCheck(null).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+ot.Msg.DATAFRAME_RAW),this.appendValueInput("col").setCheck(null).appendField(ot.Msg.DATAFRAME_COLUMN),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(Ze),this.setTooltip(""),this.setHelpUrl("")}},sn={init:function(){this.appendValueInput("LIST").setCheck(null),this.appendValueInput("row_start").setCheck(null).appendField(ot.Msg.MIXLY_GET+" "+ot.Msg.DATAFRAME_RAW+" ["),this.appendValueInput("row_end").setCheck(null).appendField(","),this.appendValueInput("col_start").setCheck(null).appendField(") "+ot.Msg.DATAFRAME_COLUMN+" ["),this.appendValueInput("col_end").setCheck(null).appendField(","),this.appendDummyInput().appendField(") "+ot.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setOutput(!0,"List"),this.setColour(Ze),this.setTooltip(""),this.setHelpUrl("")}},on={init:function(){this.setColour(Ze),this.appendDummyInput("").appendField(new ot.FieldTextInput("mylist"),"VAR").appendField("[").appendField("]"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["lists_create_with_item"],this)),this.setTooltip(ot.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("lists_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(ot.Msg.LISTS_CREATE_PYTHON_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.blockpy_LISTS_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rn={init:function(){this.setColour(Ze),this.appendDummyInput("").appendField(new ot.FieldTextInput("mylist"),"VAR").appendField(" = [").appendField(new ot.FieldTextInput("0,0,0"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_LISTS_CREATE_WITH_TEXT2)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},an={init:function(){this.setColour(Ze),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_LIST),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},ln={init:function(){this.setColour(Ze),this.appendDummyInput().appendField(ot.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},un={init:function(){this.setColour(Ze),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.MIXLY_MICROBIT_LIST_ASSIGN_AT),this.appendValueInput("TO").appendField(ot.Msg.MIXLY_MICROBIT_JS_LIST_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.LANG_LISTS_SET_INDEX_TOOLTIP)}},pn={init:function(){this.setColour(Ze),this.TYPE=[[ot.Msg.MIXLY_blockpy_set_add,"append"],[ot.Msg.MIXLY_MICROBIT_LIST_EXTEND,"extend"]],this.appendValueInput("LIST").setCheck("List"),this.appendValueInput("DATA").appendField(new ot.FieldDropdown(this.TYPE),"OP").appendField(ot.Msg.MIXLY_MICROBIT_LIST_A_ITEM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_JS_LIST_TO_END),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{append:ot.Msg.MIXLY_TOOLTIP_LIST_APPEND,extend:ot.Msg.LISTS_EXTEND_TOOLTIP}[e]}))}},_n={init:function(){this.setColour(Ze),this.appendValueInput("LIST"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+ot.Msg.LISTS_GET_INDEX_RANDOM),this.setTooltip(ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM),this.setOutput(!0)}},dn={init:function(){this.setColour(Ze),this.appendValueInput("LIST"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+ot.Msg.MIXLY_MICROBIT_RANDOM),this.appendDummyInput().appendField(ot.Msg.LANG_LISTS_GET_INDEX2+ot.Msg.LISTS_GET_RANDOM_SUBLIST),this.setTooltip(ot.Msg.LISTS_GET_RANDOM_SUBLIST_TOOLTIP),this.setOutput(!0,"List")}},hn={init:function(){this.setColour(Ze),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.MIXLY_MICROBIT_JS_LIST_INSERT_AT),this.appendValueInput("VALUE").appendField(ot.Msg.MIXLY_MICROBIT_JS_LIST_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.LANG_LISTS_SET_INDEX_TOOLTIP),this.setTooltip(ot.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT)}},cn={init:function(){this.setColour(Ze),this.appendValueInput("VAR").setCheck("List"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_JS_LIST_REVERSE),this.setTooltip(ot.Msg.LANG_LISTS_CLEAR_TOOLTIP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Tn={init:function(){this.setColour(Ze),this.appendValueInput("VAR"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_CLEAR),this.setTooltip(ot.Msg.LANG_LISTS_REVERSE_TOOLTIP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},In={init:function(){this.setColour(Ze),this.TYPE=[[ot.Msg.SERIES_INDEX,"del"],[ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE,"remove"]],this.appendValueInput("LIST").setCheck("List"),this.appendValueInput("DATA").appendField(ot.Msg.MIXLY_MIXPY_LISTS_REMOVE).appendField(new ot.FieldDropdown(this.TYPE),"OP"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{del:ot.Msg.LISTS_SET_INDEX_TOOLTIP_DELETE,remove:ot.Msg.MIXLY_TOOLTIP_LIST_REMOVE}[e]}))}},mn={init:function(){this.setColour(Ze),this.appendValueInput("LIST"),this.appendValueInput("VALUE").appendField(ot.Msg.MIXLY_MICROBIT_LIST_POP),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM)}},En={init:function(){var t=[[ot.Msg.MIXLY_LIST_INDEX,"INDEX"],[ot.Msg.MIXLY_LIST_COUNT,"COUNT"]];this.setColour(Ze),this.appendValueInput("VAR").setCheck("List"),this.appendValueInput("data").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ot.Msg.HTML_VALUE),this.appendDummyInput().appendField(ot.Msg.MIXLY_DE).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{INDEX:ot.Msg.MIXLY_TOOLTIP_LIST_FIND_INDEX,COUNT:ot.Msg.MIXLY_TOOLTIP_LIST_FIND_COUNT}[t]}))}},fn={init:function(){var t=[[ot.Msg.MIXLY_LIST_LEN,"LEN"],[ot.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[ot.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[ot.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[ot.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[ot.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[ot.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[ot.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"]];this.setColour(Ze),this.setOutput(!0,Number),this.appendValueInput("data"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{LEN:ot.Msg.LISTS_LENGTH_TOOLTIP,SUM:ot.Msg.MATH_ONLIST_TOOLTIP_SUM,MAX:ot.Msg.MATH_ONLIST_TOOLTIP_MAX,MIN:ot.Msg.MATH_ONLIST_TOOLTIP_MIN,AVERAGE:ot.Msg.MATH_ONLIST_TOOLTIP_AVERAGE,MEDIAN:ot.Msg.MATH_ONLIST_TOOLTIP_MEDIAN,MODE:ot.Msg.MATH_ONLIST_TOOLTIP_MODE,STD_DEV:ot.Msg.MATH_ONLIST_TOOLTIP_STD_DEV}[t]}))}},gn={init:function(){this.jsonInit({args0:[{type:"input_value",name:"LIST",check:"List"},{type:"field_dropdown",name:"TYPE",options:[[ot.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[ot.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[ot.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[ot.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[ot.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]}],message0:ot.Msg.LISTS_SORT_TITLE,inputsInline:!0,output:"List",colour:Ze,tooltip:ot.Msg.LISTS_SORT_TOOLTIP,helpUrl:ot.Msg.LISTS_SORT_HELPURL})}},On={init:function(){var t=[[ot.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[ot.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[ot.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD,"array"]];this.setColour(Ze),this.appendValueInput("VAR").setCheck("List"),this.appendDummyInput("").appendField(ot.Msg.A_TO_B).appendField(new ot.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{tuple:ot.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_TUPLE,set:ot.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_SET,array:ot.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_ARRAY}[t]})),this.setInputsInline(!0),this.setOutput(!0)}},Mn={init:function(){this.setColour(Ze),this.appendDummyInput("").appendField("[").appendField(new ot.FieldTextInput("0,0,0"),"CONTENT").appendField("]"),this.setInputsInline(!0),this.setOutput(!0)}},Rn={init:function(){this.setColour(Ze),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new ot.icons.MutatorIcon(["lists_create_with_item"],this)),this.setTooltip(ot.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("lists_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(ot.Msg.LISTS_CREATE_PYTHON_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.blockpy_LISTS_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},An={init:function(){var t=[[ot.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[ot.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[ot.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"]];this.setColour(Ze),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.A_TO_B).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0)}},Sn={init:function(){this.setColour(Ze),this.appendValueInput("TUP"),this.appendDummyInput("").appendField(ot.Msg.OBJECT_DELETE),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cn={init:function(){this.setColour(Ze),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOLIST),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOLIST)}},Ln=on,yn=rn,Dn=tn,Nn=en,bn=un,vn=hn,wn=In,Fn=Cn,Pn={init:function(){this.setColour(Ze),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_USE_LIST),this.appendDummyInput().appendField(ot.Msg.MIXLY_TO_INDEX_SEQUENCE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOTO_INDEX_SEQUENC_TOOLTIP)}},kn={init:function(){this.setColour(Ze),this.appendDummyInput().appendField(ot.Msg.blockpy_USE_LIST),this.appendValueInput("LIST"),this.appendValueInput("VALUE").appendField(ot.Msg.MIXLY_TO_INDEX_SEQUENCE).appendField(ot.Msg.MIXLY_INDEX+ot.Msg.MIXLY_STARTSWITH),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_TOTO_INDEX_SEQUENC_TOOLTIP)}},Vn=345,Yn={init:function(){this.setColour(Vn),this.appendDummyInput("").appendField(new ot.FieldTextInput("mydict"),"VAR").appendField(new ot.FieldLabel(ot.Msg.DICTS_CREATE_WITH_INPUT_WITH),"TIP"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("dicts_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(0==this.itemCount_)this.getField("TIP").setValue(ot.Msg.DICTS_CREATE_EMPTY_TITLE);else{this.getField("TIP").setValue(ot.Msg.DICTS_CREATE_WITH_INPUT_WITH);for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldTextInput(t.length>e?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},xn={init:function(){this.setColour(Vn),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Un={init:function(){this.setColour(Vn),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Bn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_KEYS),this.setTooltip(ot.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Xn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(ot.Msg.DICTS_GET_TOOLTIP)}},Gn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(ot.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Hn={init:function(){this.setColour(Vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(ot.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Wn={init:function(){this.setColour(Vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_DELETE_TOOLTIP)}},Kn={init:function(){this.setColour(Vn),this.appendValueInput("DICT2").setCheck("Dict").appendField(ot.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(ot.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MID),this.setTooltip(ot.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_CLEAR),this.setTooltip(ot.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_ITEMS),this.setTooltip(ot.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},$n={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_VALUES),this.setTooltip(ot.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},zn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_LENGTH),this.setTooltip(ot.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Qn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_DELDICT),this.setTooltip(ot.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jn={init:function(){this.MODE=[[ot.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[ot.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(ot.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=ot.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=ot.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==ot.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new ot.FieldDropdown(this.MODE,(function(e){var n="INSERT"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Zn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setTooltip(ot.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},ti={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_SETDEFAULT_TOOLTIP)}},ei={init:function(){this.setColour(Vn),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new ot.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("dicts_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(0==this.itemCount_)this.getField("TIP").setValue(ot.Msg.LOGIC_NULL+ot.Msg.MIXLY_MICROBIT_TYPE_DICT);else{this.getField("TIP").setValue(ot.Msg.MIXLY_MICROBIT_TYPE_DICT);for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldTextInput(t.length>e?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ni={init:function(){this.setColour(Vn),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ii={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TO_JSON),this.setTooltip(ot.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},si={init:function(){this.setColour(Vn),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(ot.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},oi={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},ri=210,ai={init:function(){var t=ot.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:ot.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:ot.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:ot.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:ot.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:ot.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:ot.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},li={init:function(){var t=ot.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=ot.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new ot.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},ui={init:function(){var t=[[ot.Msg.LOGIC_OPERATION_AND,"AND"],[ot.Msg.LOGIC_OPERATION_OR,"OR"],[ot.Msg.LOGIC_OPERATION_NOR,"NOR"],[ot.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:ot.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:ot.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:ot.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:ot.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},pi={init:function(){this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(ot.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(ot.Msg.LOGIC_NEGATE_TOOLTIP)}},_i={init:function(){var t=[[ot.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[ot.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new ot.FieldDropdown(t),"BOOL"),this.setTooltip(ot.Msg.LOGIC_BOOLEAN_TOOLTIP)}},di={init:function(){this.setColour(ri),this.setOutput(!0),this.appendDummyInput().appendField(ot.Msg.LOGIC_NULL),this.setTooltip(ot.Msg.LOGIC_NULL_TOOLTIP)}},hi={init:function(){this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").appendField(ot.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(ot.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},ci={init:function(){var t=[[ot.Msg.TEXT_APPEND_TO,"in"],[ot.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new ot.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(ot.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ot.Msg.IN)}},Ti={init:function(){var t=[[ot.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[ot.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ii={init:function(){this.setColour(ri),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},mi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(ot.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Ei={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},fi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG,r=ot.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s+r}))}},gi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.MIXPY_TEXT_ENCODE).appendField(new ot.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG,r=ot.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s+r}))}},Oi={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Mi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Ri={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+i}))}},Ai={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ot.Msg.MICROBIT_PYTHON_TYPE)}},Si={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.HTML_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Ci={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Li={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},yi={init:function(){this.setColour(0),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Di={init:function(){this.setColour(0),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Ni={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},bi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+i}))}},wi={init:function(){this.setColour(0),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Fi={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+ot.Msg.MIXLY_ESP32_SET+{mkdir:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Pi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(ot.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},ki={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.HTML_FILE,"isfile"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Yi={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SETUP+ot.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(ot.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},xi={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(ot.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Ui={};Ui.NAME_TYPE=ot.PROCEDURE_CATEGORY_NAME,Ui.allProcedures=function(t){for(var e=t.getAllBlocks(!1),n=[],i=[],s=0;s<e.length;s++)if(e[s].getProcedureDef){var o=e[s].getProcedureDef();o&&(o[2]?n.push(o):i.push(o))}return i.sort(Ui.procTupleComparator_),n.sort(Ui.procTupleComparator_),[i,n]},Ui.procTupleComparator_=function(t,e){return t[0].toLowerCase().localeCompare(e[0].toLowerCase())},Ui.findLegalName=function(t,e){if(e.isInFlyout)return t;for(t=t||ot.Msg.UNNAMED_KEY||"unnamed";!Ui.isLegalName_(t,e.workspace,e);){var n=t.match(/^(.*?)(\d+)$/);n?t=n[1]+(parseInt(n[2],10)+1):t+="2"}return t},Ui.isLegalName_=function(t,e,n){return!Ui.isNameUsed(t,e,n)},Ui.isNameUsed=function(t,e,n){for(var i=e.getAllBlocks(!1),s=0;s<i.length;s++)if(i[s]!=n&&i[s].getProcedureDef){var o=i[s].getProcedureDef();if(ot.Names.equals(o[0],t))return!0}return!1},Ui.rename=function(t){t=t.trim();var e=Ui.findLegalName(t,this.getSourceBlock()),n=this.getValue();if(n!=t&&n!=e)for(var i=this.getSourceBlock().workspace.getAllBlocks(!1),s=0;s<i.length;s++)i[s].renameProcedure&&i[s].renameProcedure(n,e);return e},Ui.flyoutCategory=function(t){var e,n,i=[];ot.Blocks.procedures_defnoreturn&&((n=ot.utils.xml.createElement("block")).setAttribute("type","procedures_defnoreturn"),n.setAttribute("gap",16),(e=ot.utils.xml.createElement("field")).setAttribute("name","NAME"),e.appendChild(ot.utils.xml.createTextNode(ot.Msg.PROCEDURES_DEFNORETURN_PROCEDURE)),n.appendChild(e),i.push(n));ot.Blocks.procedures_defreturn&&((n=ot.utils.xml.createElement("block")).setAttribute("type","procedures_defreturn"),n.setAttribute("gap",16),(e=ot.utils.xml.createElement("field")).setAttribute("name","NAME"),e.appendChild(ot.utils.xml.createTextNode(ot.Msg.PROCEDURES_DEFRETURN_PROCEDURE)),n.appendChild(e),i.push(n));ot.Blocks.procedures_return&&((n=ot.utils.xml.createElement("block")).setAttribute("type","procedures_return"),n.setAttribute("gap",16),i.push(n));ot.Blocks.procedures_ifreturn&&((n=ot.utils.xml.createElement("block")).setAttribute("type","procedures_ifreturn"),n.setAttribute("gap",16),i.push(n));function s(t,e){for(var n=0;n<t.length;n++){var s=t[n][0],o=t[n][1],r=ot.utils.xml.createElement("block");r.setAttribute("type",e),r.setAttribute("gap",16);var a=ot.utils.xml.createElement("mutation");a.setAttribute("name",s),r.appendChild(a);for(var l=0;l<o.length;l++){var u=ot.utils.xml.createElement("arg");u.setAttribute("name",o[l]),a.appendChild(u)}i.push(r)}}i.length&&i[i.length-1].setAttribute("gap",24);var o=Ui.allProcedures(t);return s(o[0],"procedures_callnoreturn"),s(o[1],"procedures_callreturn"),i},Ui.getCallers=function(t,e){for(var n=[],i=e.getAllBlocks(!1),s=0;s<i.length;s++)if(i[s].getProcedureCall){var o=i[s].getProcedureCall();o&&ot.Names.equals(o,t)&&n.push(i[s])}return n},Ui.mutateCallers=function(t){const e=ot.Events.getRecordUndo(),n=t.getProcedureDef()[0],i=t.mutationToDom(!0),s=ot.Procedures.getCallers(n,t.workspace);for(let t,n=0;t=s[n];n++){const n=t.mutationToDom(),s=n&&ot.utils.xml.domToText(n);t.domToMutation&&t.domToMutation(i);const o=t.mutationToDom(),r=o&&ot.utils.xml.domToText(o);s!==r&&(ot.Events.setRecordUndo(!1),ot.Events.fire(new(ot.Events.get(ot.Events.BLOCK_CHANGE))(t,"mutation",null,s,r)),ot.Events.setRecordUndo(e))}},Ui.getDefinition=function(t,e){for(var n=e.getTopBlocks(!1),i=0;i<n.length;i++)if(n[i].getProcedureDef){var s=n[i].getProcedureDef();if(s&&ot.Names.equals(s[0],t))return n[i]}return null};const Bi=Ui,Xi={init:function(){var t=Bi.findLegalName("",this),e=new ot.FieldTextInput(t,Bi.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new ot.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&ot.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(ot.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(ot.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(ot.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(ot.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=ot.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),ot.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{ot.Events.enable()}},mutationToDom:function(t){var e=ot.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n<this.argumentVarModels_.length;n++){var i=ot.utils.xml.createElement("arg"),s=this.argumentVarModels_[n];i.setAttribute("name",s.name),i.setAttribute("varid",s.getId()),t&&this.paramIds_&&i.setAttribute("paramId",this.paramIds_[n]),e.appendChild(i)}return this.hasStatements_||e.setAttribute("statements","false"),e},domToMutation:function(t){this.arguments_=[],this.argumentVarModels_=[];for(var e,n=0;e=t.childNodes[n];n++)if("arg"==e.nodeName.toLowerCase()){var i=e.getAttribute("name"),s=e.getAttribute("varid")||e.getAttribute("varId");this.arguments_.push(i);var o=ot.Variables.getOrCreateVariablePackage(this.workspace,s,i,"");null!=o?this.argumentVarModels_.push(o):console.log("Failed to create a variable with name "+i+", ignoring.")}this.updateParams_(),Bi.mutateCallers(this),this.setStatements_("false"!==t.getAttribute("statements"))},decompose:function(t){var e=ot.utils.xml.createElement("block");e.setAttribute("type","procedures_mutatorcontainer");var n=ot.utils.xml.createElement("statement");n.setAttribute("name","STACK"),e.appendChild(n);for(var i=n,s=0;s<this.arguments_.length;s++){var o=ot.utils.xml.createElement("block");o.setAttribute("type","procedures_mutatorarg");var r=ot.utils.xml.createElement("field");r.setAttribute("name","NAME");var a=ot.utils.xml.createTextNode(this.arguments_[s]);r.appendChild(a),o.appendChild(r);var l=ot.utils.xml.createElement("next");o.appendChild(l),i.appendChild(o),i=l}var u=ot.Xml.domToBlock(e,t);return"procedures_defreturn"==this.type?u.setFieldValue(this.hasStatements_,"STATEMENTS"):u.removeInput("STATEMENT_INPUT"),Bi.mutateCallers(this),u},compose:function(t){this.arguments_=[],this.paramIds_=[],this.argumentVarModels_=[];for(var e=t.getInputTargetBlock("STACK");e&&!e.isInsertionMarker();){var n=e.getFieldValue("NAME");this.arguments_.push(n);var i=this.workspace.getVariable(n,"");this.argumentVarModels_.push(i),this.paramIds_.push(e.id),e=e.nextConnection&&e.nextConnection.targetBlock()}this.updateParams_(),Bi.mutateCallers(this);var s=t.getFieldValue("STATEMENTS");if(null!==s&&(s="TRUE"==s,this.hasStatements_!=s))if(s)this.setStatements_(!0),this.statementConnection_&&this.statementConnection_.reconnect(this,"STACK"),this.statementConnection_=null;else{var o=this.getInput("STACK").connection;if(this.statementConnection_=o.targetConnection,this.statementConnection_){var r=o.targetBlock();r.unplug(),r.bumpNeighbours()}this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(t,e){var n=this.workspace.getVariableById(t);if(""==n.type){for(var i=n.name,s=this.workspace.getVariableById(e),o=!1,r=0;r<this.argumentVarModels_.length;r++)this.argumentVarModels_[r].getId()==t&&(this.arguments_[r]=s.name,this.argumentVarModels_[r]=s,o=!0);o&&(this.displayRenamedVar_(i,s.name),Bi.mutateCallers(this))}},updateVarName:function(t){for(var e=t.name,n=!1,i=0;i<this.argumentVarModels_.length;i++)if(this.argumentVarModels_[i].getId()==t.getId()){var s=this.arguments_[i];this.arguments_[i]=e,n=!0}n&&(this.displayRenamedVar_(s,e),Bi.mutateCallers(this))},displayRenamedVar_:function(t,e){this.updateParams_();const n=this.getIcon(ot.icons.MutatorIcon.TYPE);if(n&&n.bubbleIsVisible())for(var i,s=n.getWorkspace().getAllBlocks(!1),o=0;i=s[o];o++)"procedures_mutatorarg"==i.type&&ot.Names.equals(t,i.getFieldValue("NAME"))&&i.setFieldValue(e,"NAME")},customContextMenu:function(t){if(!this.isInFlyout){var e={enabled:!0},n=this.getFieldValue("NAME");e.text=ot.Msg.PROCEDURES_CREATE_DO.replace("%1",n);var i=ot.utils.xml.createElement("mutation");i.setAttribute("name",n);for(var s=0;s<this.arguments_.length;s++){var o=ot.utils.xml.createElement("arg");o.setAttribute("name",this.arguments_[s]),i.appendChild(o)}var r=ot.utils.xml.createElement("block");if(r.setAttribute("type",this.callType_),r.appendChild(i),e.callback=ot.ContextMenu.callbackFactory(this,r),t.push(e),!this.isCollapsed())for(s=0;s<this.argumentVarModels_.length;s++){var a={enabled:!0},l=this.argumentVarModels_[s];a.text=ot.Msg.VARIABLES_SET_CREATE_GET.replace("%1",l.name);var u=ot.Variables.generateVariableFieldDom(l),p=ot.utils.xml.createElement("block");p.setAttribute("type","variables_get"),p.appendChild(u),a.callback=ot.ContextMenu.callbackFactory(this,p),t.push(a)}}},callType_:"procedures_callnoreturn"},Gi={init:function(){var t=Bi.findLegalName("",this),e=new ot.FieldTextInput(t,Bi.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new ot.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&ot.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(ot.Msg.PROCEDURES_DEFRETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_TOOLTIP),this.setHelpUrl(ot.Msg.PROCEDURES_DEFRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:Xi.setStatements_,updateParams_:Xi.updateParams_,mutationToDom:Xi.mutationToDom,domToMutation:Xi.domToMutation,decompose:Xi.decompose,compose:Xi.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Xi.getVars,getVarModels:Xi.getVarModels,renameVarById:Xi.renameVarById,updateVarName:Xi.updateVarName,displayRenamedVar_:Xi.displayRenamedVar_,customContextMenu:Xi.customContextMenu,callType_:"procedures_callreturn"},Hi={init:function(){this.appendDummyInput().appendField(ot.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(ot.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new ot.FieldCheckbox("TRUE"),"STATEMENTS"),this.setStyle("procedure_blocks"),this.setTooltip(ot.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}},Wi={init:function(){var t=new ot.FieldTextInput(Bi.DEFAULT_ARG,this.validator_);t.oldShowEditorFn_=t.showEditor_;t.showEditor_=function(){this.createdVariables_=[],this.oldShowEditorFn_()},this.appendDummyInput().appendField(ot.Msg.PROCEDURES_BEFORE_PARAMS).appendField(t,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(ot.Msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1,t.onFinishEditing_=this.deleteIntermediateVars_,t.createdVariables_=[],t.onFinishEditing_("x")},validator_:function(t){var e=this.getSourceBlock(),n=e.workspace.getRootWorkspace();if(!(t=t.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"")))return null;for(var i=(e.workspace.targetWorkspace||e.workspace).getAllBlocks(!1),s=t.toLowerCase(),o=0;o<i.length;o++)if(i[o].id!=this.getSourceBlock().id){var r=i[o].getFieldValue("NAME");if(r&&r.toLowerCase()==s)return null}if(e.isInFlyout)return t;var a=n.getVariable(t,"");return a&&a.name!=t&&n.renameVariableById(a.getId(),t),a||(a=n.createVariable(t,""))&&this.createdVariables_&&this.createdVariables_.push(a),t},deleteIntermediateVars_:function(t){var e=this.getSourceBlock().workspace.getRootWorkspace();if(e)for(var n=0;n<this.createdVariables_.length;n++){var i=this.createdVariables_[n];i.name!=t&&e.deleteVariableById(i.getId())}}},Ki={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(ot.Msg.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(t,e){if(ot.Names.equals(t,this.getProcedureCall())){this.setFieldValue(e,"NAME");var n=this.outputConnection?ot.Msg.PROCEDURES_CALLRETURN_TOOLTIP:ot.Msg.PROCEDURES_CALLNORETURN_TOOLTIP;this.setTooltip(n.replace("%1",e))}},setProcedureParameters_:function(t,e){var n=Bi.getDefinition(this.getProcedureCall(),this.workspace);const i=n&&n.getIcon(ot.icons.MutatorIcon.TYPE),s=i&&i.bubbleIsVisible();if(s||(this.quarkConnections_={},this.quarkIds_=null),e)if(t.join("\n")!=this.arguments_.join("\n")){if(e.length!=t.length)throw Error("paramNames and paramIds must be the same length.");this.setCollapsed(!1),this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);var o=this.rendered;this.rendered=!1;for(var r=0;r<this.arguments_.length;r++){var a=this.getInput("ARG"+r);if(a){var l=a.connection.targetConnection;this.quarkConnections_[this.quarkIds_[r]]=l,s&&l&&-1==e.indexOf(this.quarkIds_[r])&&(l.disconnect(),l.getSourceBlock().bumpNeighbours())}}this.arguments_=[].concat(t),this.argumentVarModels_=[];for(r=0;r<this.arguments_.length;r++){var u=ot.Variables.getOrCreateVariablePackage(this.workspace,null,this.arguments_[r],"");this.argumentVarModels_.push(u)}if(this.updateShape_(),this.quarkIds_=e,this.quarkIds_)for(r=0;r<this.arguments_.length;r++){var p=this.quarkIds_[r];if(p in this.quarkConnections_)(l=this.quarkConnections_[p])&&!l.reconnect(this,"ARG"+r)&&delete this.quarkConnections_[p]}this.rendered=o,this.rendered&&this.render()}else this.quarkIds_=e},updateShape_:function(){for(var t=0;t<this.arguments_.length;t++){var e=this.getField("ARGNAME"+t);if(e){ot.Events.disable();try{e.setValue(this.arguments_[t])}finally{ot.Events.enable()}}else{e=new ot.FieldLabel(this.arguments_[t]),this.appendValueInput("ARG"+t).setAlign(ot.inputs.Align.RIGHT).appendField(e,"ARGNAME"+t).init()}}for(;this.getInput("ARG"+t);)this.removeInput("ARG"+t),t++;var n=this.getInput("TOPROW");n&&(this.arguments_.length?this.getField("WITH")||(n.appendField(ot.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),n.init()):this.getField("WITH")&&n.removeField("WITH"))},mutationToDom:function(){var t=ot.utils.xml.createElement("mutation");t.setAttribute("name",this.getProcedureCall());for(var e=0;e<this.arguments_.length;e++){var n=ot.utils.xml.createElement("arg");n.setAttribute("name",this.arguments_[e]),t.appendChild(n)}return t},domToMutation:function(t){var e=t.getAttribute("name");this.renameProcedure(this.getProcedureCall(),e);for(var n,i=[],s=[],o=0;n=t.childNodes[o];o++)"arg"==n.nodeName.toLowerCase()&&(i.push(n.getAttribute("name")),s.push(n.getAttribute("paramId")));this.setProcedureParameters_(i,s)},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},onchange:function(t){if(this.workspace&&!this.workspace.isFlyout&&t.recordUndo)if(t.type==ot.Events.BLOCK_CREATE&&-1!=t.ids.indexOf(this.id)){var e=this.getProcedureCall();if((h=Bi.getDefinition(e,this.workspace))&&h.type!=this.defType_&&(h=null),h){if(JSON.stringify(h.getVars())!=JSON.stringify(this.arguments_)){let t=h.arguments_,e=[];for(var n=0;n<this.arguments_.length;n++){var i=this.getInput("ARG"+n);if(i){var s=i.connection.targetConnection;s?e.push(s.sourceBlock_.id):e.push(null)}}this.setProcedureParameters_(t,e)}}else{ot.Events.setGroup(t.group);var o=ot.utils.xml.createElement("xml"),r=ot.utils.xml.createElement("block");r.setAttribute("type",this.defType_);var a=this.getRelativeToSurfaceXY(),l=a.x+ot.SNAP_RADIUS*(this.RTL?-1:1),u=a.y+2*ot.SNAP_RADIUS;r.setAttribute("x",l),r.setAttribute("y",u);var p=this.mutationToDom();r.appendChild(p);var _=ot.utils.xml.createElement("field");_.setAttribute("name","NAME");var d=this.getProcedureCall();d||(d=Bi.findLegalName("",this),this.renameProcedure("",d)),_.appendChild(ot.utils.xml.createTextNode(d)),r.appendChild(_),o.appendChild(r),ot.Xml.domToWorkspace(o,this.workspace),ot.Events.setGroup(!1)}}else if(t.type==ot.Events.BLOCK_DELETE){e=this.getProcedureCall();(h=Bi.getDefinition(e,this.workspace))||(ot.Events.setGroup(t.group),this.dispose(!0),ot.Events.setGroup(!1))}else if(t.type==ot.Events.CHANGE&&"disabled"==t.element){var h;e=this.getProcedureCall();if((h=Bi.getDefinition(e,this.workspace))&&h.id==t.blockId){var c=ot.Events.getGroup();c&&console.log("Saw an existing group while responding to a definition change"),ot.Events.setGroup(t.group),t.newValue?(this.previousEnabledState_=this.isEnabled(),this.setEnabled(!1)):this.setEnabled(this.previousEnabledState_),ot.Events.setGroup(c)}}},customContextMenu:function(t){if(this.workspace.isMovable()){var e={enabled:!0};e.text=ot.Msg.PROCEDURES_HIGHLIGHT_DEF;var n=this.getProcedureCall(),i=this.workspace;e.callback=function(){var t=Bi.getDefinition(n,i);t&&(i.centerOnBlock(t.id),t.select())},t.push(e)}},defType_:"procedures_defnoreturn"},ji={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setOutput(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(ot.Msg.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:Ki.getProcedureCall,renameProcedure:Ki.renameProcedure,setProcedureParameters_:Ki.setProcedureParameters_,updateShape_:Ki.updateShape_,mutationToDom:Ki.mutationToDom,domToMutation:Ki.domToMutation,getVars:Ki.getVars,getVarModels:Ki.getVarModels,onchange:Ki.onchange,customContextMenu:Ki.customContextMenu,defType_:"procedures_defreturn"},qi={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(ot.Msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(ot.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(ot.Msg.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){var t=ot.utils.xml.createElement("mutation");return t.setAttribute("value",Number(this.hasReturnValue_)),t},domToMutation:function(t){var e=t.getAttribute("value");this.hasReturnValue_=1==e,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){if(this.workspace.isDragging&&!this.workspace.isDragging()){var t=!1,e=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(e.type)){t=!0;break}e=e.getSurroundParent()}while(e);t?("procedures_defnoreturn"==e.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=e.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(ot.Msg.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setEnabled(!1))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]},$i={init:function(){this.setStyle("procedure_blocks"),this.appendValueInput("VALUE").appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.hasReturnValue_=!0},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("value",Number(this.hasReturnValue_)),t},domToMutation:function(t){var e=t.getAttribute("value");this.hasReturnValue_=1==e,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){var t=!1,e=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(e.type)){t=!0;break}e=e.getSurroundParent()}while(e);t?("procedures_defnoreturn"==e.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=e.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(ot.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(ot.Msg.PROCEDURES_IFRETURN_WARNING)},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn","method_procedures_defnoreturn","method_procedures_defreturn"]},zi=195,Qi={init:function(){this.setColour(zi),this.appendDummyInput("").appendField(new ot.FieldTextInput("mytup"),"VAR"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(ot.Msg.TUPLE_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("tuple_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("tuple_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(ot.Msg.TUPLE_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ji={init:function(){this.setColour(zi),this.appendDummyInput().appendField(ot.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Zi={init:function(){this.setColour(zi),this.appendDummyInput().appendField(ot.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},ts={init:function(){this.setColour(zi),this.appendDummyInput("").appendField(new ot.FieldTextInput("mytup"),"VAR").appendField(" = (").appendField(new ot.FieldTextInput("0,0,0"),"TEXT").appendField(")"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},es={init:function(){this.setColour(zi),this.appendDummyInput("").appendField("(").appendField(new ot.FieldTextInput("0,0,0"),"TEXT").appendField(")"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)}},ns={init:function(){this.setColour(zi),this.setOutput(!0),this.appendValueInput("TUP").setCheck("Tuple"),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(ot.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(ot.Msg.TUPLE_GET_INDEX_TOOLTIP)}},is={init:function(){this.setColour(zi),this.appendValueInput("TUP"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_LENGTH),this.setTooltip(ot.Msg.TUPLE_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},ss={init:function(){this.setColour(zi),this.appendValueInput("TUP").setCheck("Tuple"),this.appendDummyInput("").appendField(ot.Msg.TUPLE_DEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TUPLE_DEL_TOOLTIP)}},os={init:function(){this.setColour(zi),this.appendValueInput("TUP1").setCheck("Tuple"),this.appendDummyInput("").appendField(ot.Msg.TUPLE_JOIN),this.appendValueInput("TUP2").setCheck("Tuple"),this.setInputsInline(!0),this.setTooltip(ot.Msg.TUPLE_JOIN_TOOLTIP),this.setOutput(!0,"Tuple")}},rs={init:function(){this.appendValueInput("TUP").setCheck("Tuple");var t=[[ot.Msg.blockpy_TUPLE_MAX,"max"],[ot.Msg.blockpy_TUPLE_MIN,"min"],[ot.Msg.MATH_ONLIST_OPERATOR_SUM,"sum"]];this.setColour(zi),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{max:ot.Msg.MIXLY_TOOLTIP_TUPLE_MAX,min:ot.Msg.MIXLY_TOOLTIP_TUPLE_MIN,sum:ot.Msg.MIXLY_TOOLTIP_TUPLE_SUM}[t]}))}},as={init:function(){var t=[[ot.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[ot.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"]];this.setColour(zi),this.appendValueInput("VAR").setCheck("Tuple"),this.appendDummyInput("").appendField(ot.Msg.A_TO_B).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{list:ot.Msg.TUPLE_TO_LISTS,set:ot.Msg.TUPLE_TO_SET}[t]}))}},ls={init:function(){var t=[[ot.Msg.MIXLY_LIST_INDEX,"INDEX"],[ot.Msg.MIXLY_LIST_COUNT,"COUNT"]];this.setColour(zi),this.appendValueInput("VAR").setCheck("List"),this.appendValueInput("data").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(ot.Msg.HTML_VALUE),this.appendDummyInput().appendField(ot.Msg.MIXLY_DE).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{INDEX:ot.Msg.MIXLY_TOOLTIP_TUPLE_FIND_INDEX,COUNT:ot.Msg.MIXLY_TOOLTIP_TUPLE_FIND_COUNT}[t]}))}},us={init:function(){var t=[[ot.Msg.MIXLY_LIST_LEN,"LEN"],[ot.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[ot.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[ot.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[ot.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[ot.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[ot.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[ot.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"]];this.setColour(zi),this.setOutput(!0,Number),this.appendValueInput("data").setCheck("List"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{LEN:ot.Msg.TUPLE_LENGTH_TOOLTIP,SUM:ot.Msg.MATH_ONLIST_TOOLTIP_TUPLE_SUM,MAX:ot.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MAX,MIN:ot.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MIN,AVERAGE:ot.Msg.MATH_ONLIST_TOOLTIP_TUPLE_AVERAGE,MEDIAN:ot.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MEDIAN,MODE:ot.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MODE,STD_DEV:ot.Msg.MATH_ONLIST_TOOLTIP_TUPLE_STD_DEV}[t]}))}},ps={init:function(){this.WHERE_OPTIONS_1=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ot.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(zi),this.appendValueInput("LIST").setCheck("List"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(ot.Msg.PYTHON_TUPLE_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ot.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==ot.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ot.Msg.TEXT_CHARAT_TAIL&&this.appendDummyInput("ORDINAL"+t).appendField(ot.Msg.TEXT_CHARAT_TAIL)):this.appendDummyInput("AT"+t);var n=new ot.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},_s={init:function(){this.setColour(zi),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"Tuple"),this.setMutator(new ot.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(ot.Msg.TUPLE_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("tuple_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("tuple_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(ot.Msg.TUPLE_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ds={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(zi),this.appendValueInput("LIST"),this.appendDummyInput(""),this.appendValueInput("AT1").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ot.Msg.TEXT_CHARAT_TAIL+" "+ot.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Tuple"),this.setTooltip(ot.Msg.PYTHON_TUPLE_GET_SUBLIST_TOOLTIP)}},hs={init:function(){this.setColour(zi),this.appendValueInput("TUP"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+ot.Msg.LISTS_GET_INDEX_RANDOM),this.setTooltip(ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM),this.setOutput(!0)}},cs={init:function(){this.setColour(zi),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOTUPLE),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOTUPLE)}},Ts=100,Is={init:function(){this.setColour(Ts),this.appendDummyInput("").appendField(new ot.FieldTextInput("s1"),"VAR"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["set_create_with_item"],this)),this.setTooltip(ot.Msg.blockpy_SET_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("set_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("set_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(ot.Msg.blockpy_SET_CREATE_EMPTY_TITLE);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.blockpy_SET_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ms={init:function(){this.setColour(Ts),this.appendDummyInput().appendField(ot.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Es={init:function(){this.setColour(Ts),this.appendDummyInput().appendField(ot.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_SET_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},fs={init:function(){this.setColour(Ts),this.appendValueInput("SET"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_LENGTH),this.setInputsInline(!0),this.setTooltip(ot.Msg.SET_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},gs={init:function(){this.setColour(Ts),this.appendValueInput("SET").setCheck("Set"),this.appendDummyInput("").appendField(ot.Msg.blockpy_SET_GET_AND_REMOVE_LAST),this.setTooltip(ot.Msg.SET_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Os={init:function(){this.setColour(Ts),this.appendValueInput("SET").setCheck("Set"),this.appendDummyInput("").appendField(ot.Msg.SET_CLEAR),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ms={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[ot.Msg.blockpy_set_union,"union"],[ot.Msg.blockpy_set_intersection,"intersection"],[ot.Msg.blockpy_set_difference,"difference"]];this.setColour(Ts),this.appendDummyInput("").appendField(ot.Msg.blockpy_and_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(ot.Msg.blockpy_set_get_operate).appendField(new ot.FieldDropdown(t),"OPERATE"),this.setInputsInline(!0),this.setOutput(!0,"set");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{union:ot.Msg.MIXLY_TOOLTIP_SET_UNION,intersection:ot.Msg.MIXLY_TOOLTIP_SET_INTERSECTION,difference:ot.Msg.MIXLY_TOOLTIP_SET_DIFFERENCE}[t]}))}},Rs={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[ot.Msg.blockpy_set_union,"update"],[ot.Msg.blockpy_set_intersection,"intersection_update"],[ot.Msg.blockpy_set_difference,"difference_update"]];this.setColour(Ts),this.appendDummyInput("").appendField(ot.Msg.blockpy_and_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(ot.Msg.blockpy_set_get_operate).appendField(new ot.FieldDropdown(t),"OPERATE"),this.appendDummyInput("").appendField(ot.Msg.blockpy_set_update),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{update:ot.Msg.MIXLY_TOOLTIP_SET_UPDATE,intersection_update:ot.Msg.MIXLY_TOOLTIP_SET_INTERSECTION_UPDATE,difference_update:ot.Msg.MIXLY_TOOLTIP_SET_DIFFERENCE_UPDATE}[t]}))}},As={init:function(){this.appendValueInput("SET").setCheck("Set");var t=[[ot.Msg.MIXLY_blockpy_set_add,"add"],[ot.Msg.MIXLY_blockpy_set_discard,"discard"]];this.setColour(Ts),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"OPERATE"),this.appendValueInput("data").appendField(ot.Msg.blockpy_SET_VARIABLES_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{add:ot.Msg.SET_ADD_TOOLTIP,discard:ot.Msg.SET_DISCARD_TOOLTIP}[t]}))}},Ss={init:function(){this.appendValueInput("SET1").setCheck("Set");var t=[[ot.Msg.blockpy_set_sub,"issubset"],[ot.Msg.blockpy_set_super,"issuperset"]];this.setColour(Ts),this.appendDummyInput("").appendField(ot.Msg.blockpy_is_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(ot.Msg.blockpy_set_of).appendField(new ot.FieldDropdown(t),"OPERATE"),this.setInputsInline(!0),this.setOutput(!0,Boolean);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OPERATE");return{issubset:ot.Msg.MIXLY_TOOLTIP_SET_SUB,issuperset:ot.Msg.MIXLY_TOOLTIP_SET_SUPER}[t]}))}},Cs={init:function(){this.appendValueInput("SET").setCheck("Set"),this.setColour(Ts),this.appendValueInput("VAR").setCheck([String,"List"]).appendField(ot.Msg.blockpy_set_add_update),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.SET_UPDATE_TOOLTIP)}},Ls={init:function(){this.setColour(Ts),this.appendDummyInput("").appendField("{").appendField(new ot.FieldTextInput("0,0,0"),"TEXT").appendField("}"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_TOOLTIP_SET_CREATE_WITH_TEXT)}},ys={init:function(){this.setColour(Ts),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOSET),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOSET)}},Ds="#1ec1e4",Ns={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_DOCUMENT),this.appendStatementInput("HEAD").appendField(ot.Msg.HTML_HEAD),this.appendStatementInput("BODY").appendField(ot.Msg.HTML_BODY),this.setOutput(!0)}},bs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_LEVEL).appendField(new ot.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.HTML_HEAD,"head"],[ot.Msg.HTML_BODY,"body"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ws={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.HTML_P,"p"],[ot.Msg.HTML_SPAN,"span"],[ot.Msg.HTML_FORM,"form"],[ot.Msg.HTML_TABLE,"table"],[ot.Msg.HTML_LINE,"tr"],[ot.Msg.HTML_CELL,"td"],[ot.Msg.HTML_OL,"ol"],[ot.Msg.HTML_UL,"ul"],[ot.Msg.HTML_LI,"li"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField("<").appendField(new ot.FieldTextInput("tag"),"LEVEL").appendField(">"),this.appendValueInput("style").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ps={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ks={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_FORM_CONTENT).appendField(new ot.FieldDropdown([[ot.Msg.HTML_TEXT,"text"],[ot.Msg.HTML_EMAIL,"email"],[ot.Msg.HTML_NUMBER,"number"],[ot.Msg.HTML_PASSWORD,"password"],[ot.Msg.HTML_CHECKBOX,"checkbox"],[ot.Msg.HTML_RADIOBUTTON,"radiobutton"],[ot.Msg.HTML_BUTTON,"button"],[ot.Msg.HTML_COLOUR,"colour"],[ot.Msg.HTML_DATE,"date"],[ot.Msg.HTML_LOCALTIME,"local time"],[ot.Msg.HTML_FILE,"file"],[ot.Msg.HTML_HIDDEN,"hidden"],[ot.Msg.HTML_IMAGE,"image"],[ot.Msg.HTML_MONTH,"month"],[ot.Msg.HTML_RANGE,"range"],[ot.Msg.HTML_RESET,"reset"],[ot.Msg.HTML_SEARCH,"search"],[ot.Msg.HTML_SUBMIT,"submit"],[ot.Msg.HTML_TELEPHONENUMBER,"telephone number"],[ot.Msg.HTML_TIME,"time"],[ot.Msg.HTML_URL,"url"],[ot.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(ot.Msg.HTML_NAME).appendField(new ot.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(ot.Msg.HTML_VALUE).appendField(new ot.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(new ot.FieldTextInput("property"),"KEY").appendField(":").appendField(new ot.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ys={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(new ot.FieldTextInput("property"),"KEY").appendField(":").appendField(new ot.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_TEXT).appendField(new ot.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us=160,Bs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new ot.FieldTable(""),"TEXT")}},Xs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new ot.FieldMultilineInput(""),"TEXT")}},Gs={init:function(){this.setColour(Us),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new ot.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Hs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ws={init:function(){this.setColour(Us),this.appendDummyInput().appendTitle("Comment:").appendTitle(new ot.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ks={init:function(){this.setColour(Us),this.appendValueInput("VALUE").appendField(ot.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},js={init:function(){this.setColour(Us),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(ot.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=ot.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("text_print_multiple_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("PRINT"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("PRINT"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("PRINT"+t);)this.removeInput("PRINT"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField("print");else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("PRINT"+t);0==t&&e.appendField("print")}}},qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField("print"),this.appendStatementInput("STACK"),this.setTooltip(""),this.contextMenu=!1}},$s={init:function(){this.setColour(Us),this.appendDummyInput().appendField("item"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}},zs={init:function(){this.setColour(Us),this.itemCount_=1,this.hasReturn_=!1,this.appendDummyInput().appendField(new ot.FieldTextInput("str"),"NAME"),this.updateShape_(),this.setMutator(new ot.icons.MutatorIcon(["function_call_item"],this)),this.setTooltip("Can be used to call any function")},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t.setAttribute("hasReturn",this.hasReturn_?"TRUE":"FALSE"),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.hasReturn_="TRUE"===t.getAttribute("hasReturn"),this.updateShape_()},decompose:function(t){var e=ot.Block.obtain(t,"function_call_container");e.initSvg(),e.setFieldValue(this.hasStatements_?"TRUE":"FALSE","RETURN");for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("function_call_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},setReturn:function(t){this.unplug(!0,!0),this.setOutput(t),this.setPreviousStatement(!t),this.setNextStatement(!t),this.rendered&&this.render()},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.hasReturn_="TRUE"===t.getFieldValue("RETURN"),this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ARGUMENT"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ARGUMENT"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ARGUMENT"+t);)this.removeInput("ARGUMENT"+t),t++;for(t=0;t<this.itemCount_;t++)this.appendValueInput("ARGUMENT"+t);this.setReturn(this.hasReturn_)}},Qs={init:function(){this.setColour(Us),this.appendDummyInput().appendField("Arguments"),this.appendStatementInput("STACK"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("has return").appendField(new ot.FieldCheckbox("TRUE"),"RETURN"),this.setTooltip(""),this.contextMenu=!1}},Js={init:function(){this.setColour(Us),this.appendDummyInput().appendField("argument"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}},Zs={init:function(){this.appendValueInput("MODULE").setCheck(null),this.appendValueInput("NAME").setCheck(null).appendField("."),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(230),this.setTooltip(""),this.setHelpUrl("")}},to=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),e.ORDER_ATOMIC]},eo=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var n=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = "+n+"\n"},no=function(t,e){var n=this.getFieldValue("OP"),i=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==n)var s=n+"("+i+',"UTF-8")';else s=n+"("+i+")";return[s,e.ORDER_ATOMIC]},io=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},so=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},oo=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},ro=function(t,e){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++)n[i]=e.valueToCode(this,"ADD"+i,e.ORDER_NONE)||"[]";return[n="zip("+n.join(", ")+")",e.ORDER_ATOMIC]},ao=function(t,e){const n=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"[]";return[`${this.getFieldValue("TYPE")}(${n})`,e.ORDER_ATOMIC]},lo=function(t,e){var n=e.statementToCode(t,"DO");return"if __name__ == '__main__':\n"+(n=e.addLoopTrap(n,t.id)||e.PASS)},uo=function(t,e){var n=e.statementToCode(this,"DO");return(n=n.replace(/(^\s*)|(\s*$)/g,"").replace(/\n {4}/g,"\n")).endsWith("\n")?e.setups_.setup_setup=n:e.setups_.setup_setup=n+"\n",""},po=function(t,e){var n=0,i="";do{i+=(0==n?"if ":"elif ")+(e.valueToCode(t,"IF"+n,e.ORDER_NONE)||"False")+":\n"+(e.statementToCode(t,"DO"+n)||e.PASS),++n}while(t.getInput("IF"+n));return t.getInput("ELSE")&&(i+="else:\n"+(e.statementToCode(t,"ELSE")||e.PASS)),i},_o=function(t,e){var n=1,i=e.valueToCode(this,"IF"+n,e.ORDER_NONE)||"null",s="try:\n"+(e.statementToCode(this,"try")||" pass\n");for(n=1;n<=this.elseifCount_;n++)""!==(i=e.valueToCode(this,"IF"+n,e.ORDER_NONE)||"")&&(i=" "+i),s+="except"+i+": \n"+(e.statementToCode(this,"DO"+n)||" pass\n");return this.elseCount_&&(s+="finally:\n"+(e.statementToCode(this,"ELSE")||" pass\n")),s},ho=function(t,e){var n=e.variableDB_.getName(t.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",o=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",r=e.statementToCode(t,"DO"),a=(r=e.addLoopTrap(r,t.id)||e.PASS,""),l=function(t,e){return e.provideFunction_("upRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},u=function(t,e){return e.provideFunction_("downRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,n){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+n+") or "+u()+"("+t+", "+e+", "+n+")"},ot.isNumber(i)&&ot.isNumber(s)&&ot.isNumber(o))i=parseFloat(i),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==i%1&&0==s%1&&0==o%1?(i<=s?(s++,t=0==i&&1==o?s:i+", "+s,1!=o&&(t+=", "+o)):t=i+", "+--s+", -"+o,t="range("+t+")"):(t=i<s?l():u(),t+="("+i+", "+s+", "+o+")");else{var p=function(t,i){if(ot.isNumber(t))t=parseFloat(t);else{var s=e.variableDB_.getDistinctName(n+i,ot.Variables.NAME_TYPE);a+=s+" = "+t+"\n",t=s}return t};i=p(i,"_start"),s=p(s,"_end");p(o,"_inc"),t="number"==typeof i&&"number"==typeof s?i<s?l(0,s):u(0,s):t(i,s,o)}return a+="for "+n+" in "+t+":\n"+r},co=function(t,e){var n=e.variableDB_.getName(t.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",o=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",r=e.statementToCode(t,"DO"),a=e.addLoopTrap(r,t.id)||e.PASS;return e.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+i+", "+s+", "+o+"):\n"+a},To=function(t,e){var n="UNTIL"==t.getFieldValue("MODE"),i=e.valueToCode(t,"BOOL",e.ORDER_NONE)||"False",s=e.statementToCode(t,"DO");return n&&(i="not "+i),"while "+i+":\n"+(s=e.addLoopTrap(s,t.id)||e.PASS)},Io=function(t){switch(t.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},mo=function(t,e){return"sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},Eo=function(t,e){return"panic("+(e.valueToCode(this,"STATUS_CODE",e.ORDER_ATOMIC)||"1000")+")\n"},fo=function(t,e){e.definitions_.import_time="import time";return["time.time()",e.ORDER_ATOMIC]},go=function(t,e){return e.definitions_.import_microbit="from microbit import *","reset()\n"},Oo=function(){return"interrupts();\n"},Mo=function(){return"noInterrupts();\n"},Ro=function(t,e){var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"''",i=e.valueToCode(t,"LIST",e.ORDER_RELATIONAL)||"[]",s=e.statementToCode(t,"DO");return"for "+n+" in "+i+":\n"+(s=e.addLoopTrap(s,t.id)||e.PASS)},Ao=function(t,e){return["range("+(e.valueToCode(this,"FROM",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"TO",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"STEP",e.ORDER_NONE)||"1")+")",e.ORDER_ATOMIC]},So=function(t,e){var n="lambda "+(e.valueToCode(t,"BOOL",e.ORDER_NONE)||"None")+": "+(e.statementToCode(t,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),e.ORDER_ATOMIC]},Co=function(t,e){return e.definitions_.import_time="import time","time.sleep("+(e.valueToCode(this,"DELAY_TIME",e.ORDER_ATOMIC)||"1000")+")\n"},Lo=function(){return"pass\n"},yo=function(t,e){e.definitions_.import__thread="import _thread";var n=e.valueToCode(this,"VAR",e.ORDER_NONE)||"None";return"_thread.start_new_thread("+e.variableDB_.getName(e.valueToCode(this,"callback",e.ORDER_NONE)||"None",ot.Procedures.NAME_TYPE)+", "+n+")\n"},Do=function(t,e){var n=e.valueToCode(this,"select_data",e.ORDER_NONE)||"False",i=e.statementToCode(this,"input_data");return i="true"==this.getFieldValue("type")?i+" if ("+n+"):\n break\n":i+" if not ("+n+"):\n break\n","while True:\n"+(i=e.addLoopTrap(i,this.id)||e.PASS)},No=function(t,e){var n=e.valueToCode(this,"TIMES",e.ORDER_ATOMIC),i=e.statementToCode(t,"DO");return"for _my_variable in range("+n+"):\n"+(i=e.addLoopTrap(i,t.id)||e.PASS)},bo=function(t,e){e.definitions_.import_gc="import gc";return"gc.collect()\n"},vo=function(t,e){e.definitions_.import_gc="import gc";return["gc.mem_alloc()",e.ORDER_ATOMIC]},wo=function(t,e){e.definitions_.import_gc="import gc";return["gc.mem_free()",e.ORDER_ATOMIC]},Fo=function(t,e){e.definitions_.import_machine="import machine";return["machine.unique_id()",e.ORDER_ATOMIC]},Po=No,ko=function(t,e){return e.definitions_.import_datatime="import datatime",["datatime.datatime.fromtimestamp("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Vo=function(t,e){var n=this.getFieldValue("NUM");return[n,n<0?e.ORDER_UNARY_PREFIX:e.ORDER_ATOMIC]},Yo=function(t,e){return e.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),e.ORDER_ATOMIC]},xo=function(t,e){return e.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),e.ORDER_ATOMIC]},Uo=function(t,e){var n=this.getFieldValue("OP"),i=e.ORDER_ATOMIC;return["("+(e.valueToCode(this,"A",i)||"0")+n+(e.valueToCode(this,"B",i)||"0")+")",i]},Bo=function(t,e){var n=(i={ADD:[" + ",e.ORDER_ADDITIVE],MINUS:[" - ",e.ORDER_ADDITIVE],MULTIPLY:[" * ",e.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",e.ORDER_MULTIPLICATIVE],QUYU:[" % ",e.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",e.ORDER_MULTIPLICATIVE],POWER:[" ** ",e.ORDER_EXPONENTIATION]}[t.getFieldValue("OP")])[0],i=i[1];return[(e.valueToCode(t,"A",i)||"0")+n+(t=e.valueToCode(t,"B",i)||"0"),i]},Xo=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_RELATIONAL)||"0",i=e.valueToCode(this,"B",e.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var s="+=";break;case"MINUS":s="-=";break;case"MULTIPLY":s="*=";break;case"DIVIDE":s="/=";break;case"QUYU":s="%=";break;case"ZHENGCHU":s="//=";break;case"POWER":s="**="}return n+" "+s+" "+i+"\n"},Go=function(t,e){var n,i=t.getFieldValue("OP");if("NEG"==i)return["-"+(n=e.valueToCode(t,"NUM",e.ORDER_UNARY_SIGN)||"0"),e.ORDER_UNARY_SIGN];switch(e.definitions_.import_math="import math",t="SIN"==i||"COS"==i||"TAN"==i?e.valueToCode(t,"NUM",e.ORDER_MULTIPLICATIVE)||"0":e.valueToCode(t,"NUM",e.ORDER_NONE)||"0",i){case"ABS":n="math.fabs("+t+")";break;case"ROOT":n="math.sqrt("+t+")";break;case"LN":n="math.log("+t+")";break;case"LOG10":n="math.log10("+t+")";break;case"EXP":n="math.exp("+t+")";break;case"POW10":n="math.pow(10,"+t+")";break;case"ROUND":n="round("+t+")";break;case"ROUNDUP":n="math.ceil("+t+")";break;case"ROUNDDOWN":n="math.floor("+t+")";break;case"SIN":n="math.sin("+t+")";break;case"COS":n="math.cos("+t+")";break;case"TAN":n="math.tan("+t+")";break;case"++":n="++("+t+")";break;case"--":n="--("+t+")";break;case"-":n="-("+t+")"}if(n)return[n,e.ORDER_EXPONENTIATION];switch(i){case"ASIN":n="math.degrees(math.asin("+t+"))";break;case"ACOS":n="math.degrees(math.acos("+t+"))";break;case"ATAN":n="math.degrees(math.atan("+t+"))"}return[n,e.ORDER_MULTIPLICATIVE]},Ho=Go,Wo=function(t,e){var n=e.valueToCode(this,"NUM",e.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",e.ORDER_ATOMIC]},Ko=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_NONE)||"0",i=this.getFieldValue("OP"),s="";return"round"===i?s=i+"("+n+")":(s="math."+i+"("+n+")",e.definitions_.import_math="import math"),[s,e.ORDER_ATOMIC]},jo=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_NONE)||"0",i=e.valueToCode(this,"B",e.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+i+")",e.ORDER_ATOMIC]},qo=function(t,e){e.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),i=e.valueToCode(this,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(this,"TO",e.ORDER_NONE)||"0";if("int"==n)var o="random.randint("+i+", "+s+")";else if("float"==n)o="random.uniform("+i+", "+s+")";return[o,e.ORDER_UNARY_POSTFIX]},$o=function(t,e){var n=e.valueToCode(this,"NUM",e.ORDER_NONE),i=e.valueToCode(this,"fromLow",e.ORDER_ATOMIC),s=e.valueToCode(this,"fromHigh",e.ORDER_ATOMIC),o=e.valueToCode(this,"toLow",e.ORDER_ATOMIC),r=e.valueToCode(this,"toHigh",e.ORDER_ATOMIC);return e.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+i+", "+s+", "+o+", "+r+")",e.ORDER_NONE]},zo=function(t,e){return["min(max("+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"LOW",e.ORDER_NONE)||"0")+"), "+(e.valueToCode(this,"HIGH",e.ORDER_NONE)||"0")+")",e.ORDER_UNARY_POSTFIX]},Qo=function(t,e){var n=t.getFieldValue("OP"),i=e.valueToCode(this,"NUM",e.ORDER_NONE)||"0",s=t.getFieldValue("OP2");e.definitions_.import_math="import math";var o="",r="10";if("two"==n?r="2":"eight"==n?r="8":"ten"==n?r="10":"sixteen"==n&&(r="16"),"two"==s?o="bin":"eight"==s?o="oct":"ten"==s?o="":"sixteen"==s&&(o="hex"),""==o)var a="int(str("+i+"), "+r+")";else a=o+"(int(str("+i+"), "+r+"))";return[a,e.ORDER_ATOMIC]},Jo=function(t,e){return e.definitions_.import_random="import random","random.seed("+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+");\n"},Zo=function(t,e){var n=this.getFieldValue("NUM");return[n,n<0?e.ORDER_UNARY_PREFIX:e.ORDER_ATOMIC]},tr=function(t,e){return["round("+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"VAR",e.ORDER_NONE)||"0")+")",e.ORDER_ATOMIC]},er=function(t,e){var n=this.getFieldValue("TOWHAT"),i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return"b"==n?[i+'.encode("utf-8")',e.ORDER_ATOMIC]:"bti"==n?["int.from_bytes("+i+',"big")',e.ORDER_ATOMIC]:[n+"("+i+")",e.ORDER_ATOMIC]},nr=function(t,e){var n=this.getFieldValue("TOWHAT"),i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC);return"b"==n?[i+'.encode("utf-8")',e.ORDER_ATOMIC]:[n+"("+i+")",e.ORDER_ATOMIC]},ir=$o,sr=function(t,e){return e.definitions_.import_hexlify="from ubinascii import hexlify",["hexlify("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+").decode()",e.ORDER_ATOMIC]},or=function(t,e){e.definitions_.import_itertools="import itertools";let n=e.valueToCode(this,"REPEAT",e.ORDER_ATOMIC),i=new Array(this.itemCount_);for(let t=0;t<this.itemCount_;t++)i[t]=e.valueToCode(this,`ADD${t}`,e.ORDER_NONE)||"0";let s="";return this.itemCount_&&(s=`itertools.product(${i.join(", ")}, repeat=${n})`),[s,e.ORDER_ATOMIC]},rr=function(t,e){return[e.quote_(this.getFieldValue("TEXT")),e.ORDER_ATOMIC]},ar=function(t,e){return['"""'+this.getFieldValue("VALUE")+'"""',e.ORDER_ATOMIC]},lr=function(t,e){return["'"+this.getFieldValue("TEXT")+"'",e.ORDER_ATOMIC]},ur=function(t,e){return[e.valueToCode(this,"A",e.ORDER_ATOMIC)+" + "+e.valueToCode(this,"B",e.ORDER_ATOMIC),e.ORDER_ADDITIVE]},pr=function(t,e){return["chr("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},_r=function(t,e){return["ord("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"a")+")",e.ORDER_ATOMIC]},dr=function(t,e){return["str("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},hr=function(t,e){return["len("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},cr=function(t,e){var n=t.getFieldValue("WHERE")||"FROM_START",i=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""';switch(n){case"FROM_START":return[i+"["+(t=e.getAdjustedInt(t,"AT"))+"]",e.ORDER_ATOMIC];case"FROM_END":return[i+"["+(t=e.getAdjustedInt(t,"AT",1,!0))+"]",e.ORDER_ATOMIC];case"RANDOM":return e.definitions_.import_random="import random",["random.choice("+i+")",e.ORDER_FUNCTION_CALL]}throw"Unhandled combination (lists_getIndex)."},Tr=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"["+(e.valueToCode(this,"AT",e.ORDER_ATOMIC)||0)+"]",e.ORDER_ATOMIC]},Ir=function(t,e){var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""';return e.definitions_.import_random="import random",["random.choice("+n+")",e.ORDER_FUNCTION_CALL]},mr=function(t,e){var n=e.valueToCode(this,"STR1",e.ORDER_ATOMIC)||'""',i=e.valueToCode(this,"STR2",e.ORDER_ATOMIC)||'""',s=this.getFieldValue("DOWHAT");return"==="===s?[n+" == "+i,e.ORDER_ATOMIC]:[n+"."+s+"("+i+")",e.ORDER_ATOMIC]},Er=function(t,e){return["cmp("+(e.valueToCode(this,"STR1",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"STR2",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},fr=function(t,e){var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""',i=t.getFieldValue("WHERE1"),s=t.getFieldValue("WHERE2");switch(i){case"FROM_START":"0"==(o=e.getAdjustedInt(t,"AT1"))&&(o="");break;case"FROM_END":var o=e.getAdjustedInt(t,"AT1",0,!0);break;case"FIRST":o="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(s){case"FROM_START":var r=e.getAdjustedInt(t,"AT2");break;case"FROM_END":r=e.getAdjustedInt(t,"AT2",0,!0);ot.isNumber(String(r))?"0"==r&&(r=""):(e.definitions_.import_sys="import sys",r+=" or sys.maxsize");break;case"LAST":r="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[n+"["+o+" : "+r+"]",e.ORDER_ATOMIC]},gr=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"["+e.valueToCode(this,"AT1",e.ORDER_ATOMIC)+" : "+e.valueToCode(this,"AT2",e.ORDER_ATOMIC)+"]",e.ORDER_ATOMIC]},Or=function(t,e){var n=this.getFieldValue("CAPITAL");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},Mr=function(t,e){var n=this.getFieldValue("CENTER");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"WID",e.ORDER_ATOMIC)+","+e.valueToCode(this,"Symbol",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Rr=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".find("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ar=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".join("+(e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Sr=function(t,e){return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+".replace("+e.valueToCode(this,"STR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STR2",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Cr=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+".split("+(e.valueToCode(this,"VAL",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},Lr=function(t,e){var n=this.getFieldValue("TOWHAT");return[e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},yr=function(t,e){for(var n=this.getFieldValue("VAR"),i=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)i[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return[i=n+".format("+i.join(", ")+")",e.ORDER_ATOMIC]},Dr=function(t,e){for(var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)i[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return[i=n+".format("+i.join(", ")+")",e.ORDER_ATOMIC]},Nr=gr,br=Er,vr=Tr,wr=function(t,e){var n=this.getFieldValue("DIR"),i=this.getFieldValue("CODE");return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+"."+n+'("'+i+'")',e.ORDER_ATOMIC]},Fr=function(t,e){return["eval("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Pr=function(t,e){return e.definitions_.import_os="import os","os.system("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},kr=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+e.valueToCode(this,"AT1",e.ORDER_ADDITIVE)+" : "+e.valueToCode(this,"AT2",e.ORDER_ADDITIVE)+"]",e.ORDER_ATOMIC]},Vr=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ATOMIC)||"mylist")+"["+(e.valueToCode(this,"row",e.ORDER_ATOMIC)||0)+","+(e.valueToCode(this,"col",e.ORDER_ATOMIC)||0)+"]",e.ORDER_ATOMIC]},Yr=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ATOMIC)||"mylist")+"["+(e.valueToCode(this,"row_start",e.ORDER_ATOMIC)||0)+" : "+(e.valueToCode(this,"row_end",e.ORDER_ATOMIC)||1)+","+(e.valueToCode(this,"col_start",e.ORDER_ATOMIC)||0)+" : "+(e.valueToCode(this,"col_end",e.ORDER_ATOMIC)||1)+"]",e.ORDER_ATOMIC]},xr=function(t,e){for(var n=e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)i[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return i=n+" = ["+i.join(", ")+"]\n"},Ur=function(t,e){return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = ["+this.getFieldValue("TEXT")+"]\n"},Br=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||0)+"]",e.ORDER_ATOMIC]},Xr=function(t,e){return(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+"["+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"0")+"] = "+(e.valueToCode(this,"TO",e.ORDER_ASSIGNMENT)||"0")+"\n"},Gr=function(t,e){var n=e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"DATA",e.ORDER_ASSIGNMENT)||"0";return n+"."+this.getFieldValue("OP")+"("+i+")\n"},Hr=function(t,e){return e.definitions_.import_random="import random",["random.choice("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+")",e.ORDER_ATOMIC]},Wr=function(t,e){return e.definitions_.import_random="import random",["random.sample("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Kr=function(t,e){return(e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0")+".insert("+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"0")+", "+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")\n"},jr=function(t,e){return(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+".reverse()\n"},qr=function(t,e){return(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},$r=function(t,e){var n=this.getFieldValue("OP"),i=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0";if("INDEX"==n)var o=i+".index("+s+")";else if("COUNT"==n)o=i+".count("+s+")";return[o,e.ORDER_ATOMIC]},zr=function(t,e){var n=e.valueToCode(this,"LIST",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"DATA",e.ORDER_ASSIGNMENT)||"0";return"del"==this.getFieldValue("OP")?"del "+n+"["+i+"]\n":n+".remove("+i+")\n"},Qr=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+".pop("+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Jr=function(t,e){var n,i=t.getFieldValue("OP");switch(e.definitions_.import_math="import math",t=e.valueToCode(t,"data",e.ORDER_NONE),i){case"LEN":n="len("+t+")";break;case"SUM":n="sum("+t+")";break;case"MIN":n="min("+t+")";break;case"MAX":n="max("+t+")";break;case"AVERAGE":e.definitions_.import_mixpy_math_mean="from mixpy import math_mean",n="math_mean("+t+")";break;case"MEDIAN":e.definitions_.import_mixpy_math_median="from mixpy import math_median",n="math_median("+t+")";break;case"MODE":e.definitions_.import_mixpy_math_modes="from mixpy import math_modes",n="math_modes("+t+")";break;case"STD_DEV":e.definitions_.import_mixpy_math_standard_deviation="from mixpy import math_standard_deviation",n="math_standard_deviation("+t+")";break;default:throw"Unknown operator: "+i}if(n)return[n,e.ORDER_ATOMIC]},Zr=function(t,e){return e.definitions_.import_mixpy_lists_sort="from mixpy import lists_sort",["lists_sort("+(e.valueToCode(t,"LIST",e.ORDER_NONE)||"[]")+', "'+t.getFieldValue("TYPE")+'", '+("1"===t.getFieldValue("DIRECTION")?"False":"True")+")",e.ORDER_ATOMIC]},ta=function(t,e){var n=this.getFieldValue("OP"),i=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s="";return"array"==n?(e.definitions_.import_numpy="import numpy",s="numpy.array("+i+")"):s=n+"("+i+")",[s,e.ORDER_ATOMIC]},ea=function(t,e){return["["+this.getFieldValue("CONTENT")+"]",e.ORDER_ATOMIC]},na=function(t,e){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++)n[i]=e.valueToCode(this,"ADD"+i,e.ORDER_NONE)||"0";return[n="["+n.join(", ")+"]",e.ORDER_ATOMIC]},ia=ta,sa=function(t,e){return"del "+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+"\n"},oa=xr,ra=Ur,aa=Br,la=kr,ua=Xr,pa=Kr,_a=zr,da=function(t,e){return["list("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},ha=function(t,e){return[(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+".tolist()",e.ORDER_ATOMIC]},ca=function(t,e){return["enumerate("+(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"mylist")+",start="+(e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Ta=function(t,e){for(var n=e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=new Array(this.itemCount_),s=0;s<this.itemCount_;s++){var o=this.getFieldValue("KEY"+s);i[s]=o+":"+(e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0")}return i=n+"= {"+i.join(", ")+"}\n"},Ia=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".keys()",e.ORDER_ATOMIC]},ma=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+"["+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+"]",e.ORDER_ATOMIC]},Ea=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".get("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},fa=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+"["+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+"] = "+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+"\n"},ga=function(t,e){return"del "+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+"["+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+"]\n"},Oa=function(t,e){var n=e.valueToCode(this,"DICT2",e.ORDER_ASSIGNMENT)||"0";return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".update("+n+")\n"},Ma=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},Ra=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".items()",e.ORDER_ATOMIC]},Aa=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".values()",e.ORDER_ATOMIC]},Sa=function(t,e){return["len("+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Ca=function(t,e){return"del "+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+"\n"},La=function(t,e){var n=e.valueToCode(t,"DICT",e.ORDER_MEMBER)||"[]",i=t.getFieldValue("WHERE"),s=e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT);switch(i){case"INSERT":var o=n+"["+s+"] = "+(e.valueToCode(this,"AT2",e.ORDER_ASSIGNMENT)||"0")+"\n";break;case"DELETE":o="del "+n+"["+s+"]\n";break;default:throw"Unhandled option (lists_setIndex2)"}return o},ya=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+".pop("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+")",e.ORDER_ATOMIC]},Da=function(t,e){return(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"mydict")+".setdefault("+e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT)+","+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")\n"},Na=function(t,e){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++){var s=this.getFieldValue("KEY"+i);n[i]=s+":"+(e.valueToCode(this,"ADD"+i,e.ORDER_NONE)||"0")}if(1!=this.itemCount_)n="{"+n.join(", ")+"}";else n="{"+n.join(", ")+",}";return[n,e.ORDER_ATOMIC]},ba=function(t,e){return["dict("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},va=function(t,e){return e.definitions_.import_json="import json",["json.dumps("+(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},wa=function(t,e){return e.definitions_.import_json="import json",["json.loads("+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"null")+")",e.ORDER_ATOMIC]},Fa=function(t,e){return[(e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0")+"["+(e.valueToCode(this,"VAR1",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR2",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR3",e.ORDER_ASSIGNMENT)||"null")+"]["+(e.valueToCode(this,"VAR4",e.ORDER_ASSIGNMENT)||"null")+"]",e.ORDER_ATOMIC]},Pa=function(t,e){var n=this.getFieldValue("OP"),i=Pa.OPERATORS[n],s="=="==i||"!="==i?e.ORDER_EQUALITY:e.ORDER_RELATIONAL;return[(e.valueToCode(this,"A",s)||"0")+" "+i+" "+(e.valueToCode(this,"B",s)||"0"),s]},ka=function(t,e){var n=this.getFieldValue("OP1"),i=Pa.OPERATORS[n],s=this.getFieldValue("OP2"),o=Pa.OPERATORS[s];return[(e.valueToCode(this,"A",e.ORDER_RELATIONAL)||"0")+" "+i+" "+(e.valueToCode(this,"B",e.ORDER_RELATIONAL)||"0")+" "+o+" "+(e.valueToCode(this,"C",e.ORDER_RELATIONAL)||"0"),e.ORDER_RELATIONAL]};Pa.OPERATORS={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="};const Va=function(t,e){var n=this.getFieldValue("OP"),i="&&"==n?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",i)||"False",o=e.valueToCode(this,"B",i)||"False";if("AND"==n)var r=s+" and "+o;else if("OR"==n)r=s+" or "+o;else if("NOR"==n)r="not("+s+"^"+o+")";else r=s+"^"+o;return[r,i]},Ya=function(t,e){var n=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",n)||"False"),n]},xa=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Ua=function(t,e){return["None",e.ORDER_ATOMIC]},Ba=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+n+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Xa=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Ga=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Ha=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Wa=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Ka=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},ja=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},qa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},$a=function(t,e){var n=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+n+")\n"},za=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},Qa=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ja=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Za=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},tl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},el=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},nl=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},il=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},sl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ol=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},rl=function(t,e){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+i+")\n"},al=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ll=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ul=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},pl=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},_l=function(t,e){e.definitions_.import_os="import os";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",e.ORDER_ATOMIC]},dl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},hl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},cl=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),ot.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],r=0;r<this.arguments_.length;r++){var a=e.variableDB_.getName(this.arguments_[r],ot.Variables.NAME_TYPE);o[r]=a}var l="def "+n+"("+o.join(", ")+"):\n"+i+s+"\n";return l=e.scrub_(this,l),e.setups_[n]=l,null},Tl=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),ot.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);for(var s=[],o=0;o<this.arguments_.length;o++){var r=e.variableDB_.getName(this.arguments_[o],ot.Variables.NAME_TYPE);s[o]=r}var a="def "+n+"("+s.join(", ")+"):\n"+i+"\n";return a=e.scrub_(this,a),e.setups_[n]=a,null},Il=function(t,e){for(var n=e.variableDB_.getName(this.getFieldValue("NAME"),ot.Procedures.NAME_TYPE),i=[],s=0;s<this.arguments_.length;s++)i[s]=e.valueToCode(this,"ARG"+s,e.ORDER_NONE)||"null";return[n+"("+i.join(", ")+")",e.ORDER_UNARY_POSTFIX]},ml=function(t,e){for(var n=e.variableDB_.getName(this.getFieldValue("NAME"),ot.Procedures.NAME_TYPE),i=[],s=0;s<this.arguments_.length;s++)i[s]=e.valueToCode(this,"ARG"+s,e.ORDER_NONE)||"null";return n+"("+i.join(", ")+")\n"},El=function(t,e){var n="if ("+(e.valueToCode(this,"CONDITION",e.ORDER_NONE)||"False")+") :\n";this.hasReturnValue_?n+=" return "+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"None"):n+=" return None";return n+="\n"},fl=function(t,e){var n="";this.hasReturnValue_?n+="return "+(e.valueToCode(this,"VALUE",e.ORDER_NONE)||"None"):n+="return None";return n+="\n"},gl=function(t,e){for(var n=e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)i[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";if(1!=this.itemCount_)i=n+"= ("+i.join(", ")+")\n";else i=n+"= ("+i.join(", ")+",)\n";return i},Ol=function(t,e){return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+"= ("+this.getFieldValue("TEXT")+")\n"},Ml=function(t,e){return["("+this.getFieldValue("TEXT")+")",e.ORDER_ATOMIC]},Rl=function(t,e){var n=e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"1";return i.match(/^\d+$/)&&(i=parseInt(i,10)),[n+"["+i+"]",e.ORDER_ATOMIC]},Al=function(t,e){return["len("+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Sl=function(t,e){return"del "+(e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0")+"\n"},Cl=function(t,e){return[(e.valueToCode(this,"TUP1",e.ORDER_ASSIGNMENT)||"0")+" + "+(e.valueToCode(this,"TUP2",e.ORDER_ASSIGNMENT)||"0"),e.ORDER_ATOMIC]},Ll=function(t,e){var n=e.valueToCode(this,"TUP",e.ORDER_ASSIGNMENT)||"0";return[this.getFieldValue("DIR")+"("+n+")",e.ORDER_ATOMIC]},yl=function(t,e){return[this.getFieldValue("OP")+"("+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+")\n",e.ORDER_ATOMIC]},Dl=function(t,e){var n=this.getFieldValue("OP"),i=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0";if("INDEX"==n)var o=i+".index("+s+")";else if("COUNT"==n)o=i+".count("+s+")";return[o,e.ORDER_ATOMIC]},Nl=function(t,e){var n,i=t.getFieldValue("OP");switch(e.definitions_.import_math="import math",t=e.valueToCode(t,"data",e.ORDER_NONE),i){case"LEN":n="len("+t+")";break;case"SUM":n="sum("+t+")";break;case"MIN":n="min("+t+")";break;case"MAX":n="max("+t+")";break;case"AVERAGE":n=e.provideFunction_("math_mean",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," localList = [e for e in myList if type(e) == int or type(e) == float]"," if not localList: return"," return float(sum(localList)) / len(localList)"])+"("+t+")";break;case"MEDIAN":n=e.provideFunction_("math_median",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," localList = sorted([e for e in myList if type(e) == int or type(e) == float])"," if not localList: return"," if len(localList) % 2 == 0:"," return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0"," else:"," return localList[(len(localList) - 1) // 2]"])+"("+t+")";break;case"MODE":n=e.provideFunction_("math_modes",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(some_list):"," modes = []"," # Using a lists of [item, count] to keep count rather than dict",' # to avoid "unhashable" errors when the counted item is itself a list or dict.'," counts = []"," maxCount = 1"," for item in some_list:"," found = False"," for count in counts:"," if count[0] == item:"," count[1] += 1"," maxCount = max(maxCount, count[1])"," found = True"," if not found:"," counts.append([item, 1])"," for counted_item, item_count in counts:"," if item_count == maxCount:"," modes.append(counted_item)"," return modes"])+"("+t+")";break;case"STD_DEV":e.definitions_.import_math="import math",n=e.provideFunction_("math_standard_deviation",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(numbers):"," n = len(numbers)"," if n == 0: return"," mean = float(sum(numbers)) / n"," variance = sum((x - mean) ** 2 for x in numbers) / n"," return math.sqrt(variance)"])+"("+t+")";break;default:throw"Unknown operator: "+i}if(n)return[n,e.ORDER_FUNCTION_CALL]},bl=function(t,e){var n=e.valueToCode(t,"LIST",e.ORDER_MEMBER)||"[]",i=t.getFieldValue("WHERE1"),s=t.getFieldValue("WHERE2");switch(i){case"FROM_START":"0"==(o=e.getAdjustedInt(t,"AT1"))&&(o="");break;case"FROM_END":var o=e.getAdjustedInt(t,"AT1",1,!0);break;case"FIRST":o="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(s){case"FROM_START":var r=e.getAdjustedInt(t,"AT2",1);r-=1;break;case"FROM_END":r=e.getAdjustedInt(t,"AT2",1,!0);ot.isNumber(String(r))?"0"==r&&(r=""):(e.definitions_.import_sys="import sys",r+=" or sys.maxsize");break;case"LAST":r="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[n+"["+o+" : "+r+"]",e.ORDER_MEMBER]},vl=function(t,e){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++)n[i]=e.valueToCode(this,"ADD"+i,e.ORDER_NONE)||"0";if(1!=this.itemCount_)n="("+n.join(", ")+")";else n="("+n.join(", ")+",)";return[n,e.ORDER_ATOMIC]},wl=function(t,e){return[(e.valueToCode(this,"LIST",e.ORDER_ADDITIVE)||"0")+"["+(e.valueToCode(this,"AT1",e.ORDER_ADDITIVE)||"0")+" : "+(e.valueToCode(this,"AT2",e.ORDER_ADDITIVE)||"0")+"]",e.ORDER_ATOMIC]},Fl=function(t,e){return e.definitions_.import_random="import random",["random.choice("+(e.valueToCode(this,"TUP",e.ORDER_ADDITIVE)||"mytup")+")",e.ORDER_ATOMIC]},Pl=function(t,e){return["tuple("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},kl=function(t,e){for(var n=e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)i[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"0";return i=n+"= {"+i.join(", ")+"}\n",0==this.itemCount_&&(i=n+" = set()\n"),i},Vl=function(t,e){return["len("+(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+")",e.ORDER_ATOMIC]},Yl=function(t,e){return[(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".pop()",e.ORDER_ATOMIC]},xl=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".clear()\n"},Ul=function(t,e){var n=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return[n+"."+this.getFieldValue("OPERATE")+"("+i+")",e.ORDER_ATOMIC]},Bl=function(t,e){var n=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return n+"."+this.getFieldValue("OPERATE")+"("+i+")\n"},Xl=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("OPERATE")+"("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},Gl=function(t,e){var n=e.valueToCode(this,"SET1",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"SET2",e.ORDER_ASSIGNMENT)||"0";return[n+"."+this.getFieldValue("OPERATE")+"("+i+")",e.ORDER_ATOMIC]},Hl=function(t,e){return(e.valueToCode(this,"SET",e.ORDER_ASSIGNMENT)||"0")+".update("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Wl=function(t,e){return["{"+this.getFieldValue("TEXT")+"}",e.ORDER_ATOMIC]},Kl=function(t,e){return["set("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},jl=function(t,e){return["'''<!DOCTYPE HTML>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n"+e.statementToCode(this,"HEAD")+"</head>\n<body>\n"+e.statementToCode(this,"BODY")+"</body>\n</html>\n'''",e.ORDER_ATOMIC]},ql=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<h"+i+">\n"+n+"</h"+i+">\n"},$l=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var s="<"+i+'>\n\t<meta charset="utf-8">\n'+n+"</"+i+">\n";else s="<"+i+">\n"+n+"</"+i+">\n";return s},zl=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"</"+i+">\n"},Ql=function(t,e){var n=e.statementToCode(this,"DO"),i=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+i+" >\n"+n+"</"+s+">\n"},Jl=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Zl=function(t,e){return'<input type="'+this.getFieldValue("LEVEL")+'" name="'+this.getFieldValue("NAME")+'" value="'+this.getFieldValue("VALUE")+'" '+(e.valueToCode(this,"style")||"")+" />"},tu=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},eu=function(){return this.getFieldValue("TEXT")+"\n"},nu=function(t){return t.getFieldValue("TEXT")+"\n"},iu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},su=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},ou=function(){return""},ru=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},au=function(t,e){for(var n=t.getFieldValue("NAME"),i=t.hasReturn_,s=new Array(t.itemCount_),o=0;o<t.itemCount_;o++)s[o]=e.valueToCode(t,"ARGUMENT"+o,e.ORDER_NONE)||"___";var r=n+"("+s.join(", ")+")";return i?[r,e.ORDER_ATOMIC]:r+"\n"},lu=function(t,e){var n=e.valueToCode(t,"MODULE",e.ORDER_ATOMIC),i=e.valueToCode(t,"NAME",e.ORDER_ATOMIC);return[n+"."+(i=i.substring(1,i.length-1)),e.ORDER_NONE]},uu=new ot.Generator("Python");uu.INDENT=" ",uu.addReservedWords("False,None,True,and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,nonlocal,not,or,pass,print,raise,return,try,while,with,yield,NotImplemented,Ellipsis,__debug__,quit,exit,copyright,license,credits,ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EnvironmentError,Exception,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StandardError,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,ZeroDivisionError,_,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,all,any,apply,ascii,basestring,bin,bool,buffer,bytearray,bytes,callable,chr,classmethod,cmp,coerce,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,execfile,exit,file,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,intern,isinstance,issubclass,iter,len,license,list,locals,long,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,raw_input,reduce,reload,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,unichr,unicode,vars,xrange,zip"),uu.ORDER_ATOMIC=0,uu.ORDER_COLLECTION=1,uu.ORDER_STRING_CONVERSION=1,uu.ORDER_UNARY_POSTFIX=1,uu.ORDER_UNARY_PREFIX=2,uu.ORDER_MEMBER=2.1,uu.ORDER_FUNCTION_CALL=2.2,uu.ORDER_EXPONENTIATION=3,uu.ORDER_UNARY_SIGN=4,uu.ORDER_BITWISE_NOT=4,uu.ORDER_MULTIPLICATIVE=5,uu.ORDER_ADDITIVE=6,uu.ORDER_BITWISE_SHIFT=7,uu.ORDER_BITWISE_AND=8,uu.ORDER_BITWISE_XOR=9,uu.ORDER_BITWISE_OR=10,uu.ORDER_RELATIONAL=11,uu.ORDER_EQUALITY=11,uu.ORDER_LOGICAL_NOT=12,uu.ORDER_LOGICAL_AND=13,uu.ORDER_LOGICAL_OR=14,uu.ORDER_ASSIGNMENT=14,uu.ORDER_CONDITIONAL=15,uu.ORDER_LAMBDA=16,uu.ORDER_NONE=99,uu.ORDER_OVERRIDES=[[uu.ORDER_FUNCTION_CALL,uu.ORDER_MEMBER],[uu.ORDER_FUNCTION_CALL,uu.ORDER_FUNCTION_CALL],[uu.ORDER_MEMBER,uu.ORDER_MEMBER],[uu.ORDER_MEMBER,uu.ORDER_FUNCTION_CALL]],uu.init=function(){uu.PASS=this.INDENT+"pass\n",uu.definitions_=Object.create(null),uu.functionNames_=Object.create(null),uu.setups_=Object.create(null),uu.loops_=Object.create(null),uu.codeEnd_=Object.create(null),uu.variableDB_?uu.variableDB_.reset():uu.variableDB_=new pt(uu.RESERVED_WORDS_)},uu.finish=function(t){""!==t&&(t=(t=t.replace(/\n/g,"\n")).replace(/\n\s+$/,"\n"));var e=[];for(var n in uu.definitions_)e.push(uu.definitions_[n]);var i=[];for(var n in uu.functions_)i.push(uu.functions_[n]);var s=[];for(var n in uu.setups_)s.push(uu.setups_[n]);0!==s.length&&s.push("\n");var o=[];for(var n in uu.loops_)o.push(uu.loops_[n]);var r=[];for(var n in uu.codeEnd_)r.push(uu.codeEnd_[n]);return 0!==r.length&&r.push("\n"),o.length>0?e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+r.join("\n"):e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+r.join("\n")},uu.scrubNakedValue=function(t){return t+"\n"},uu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},uu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},uu.scrub_=function(t,e,n){var i="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=ot.utils.string.wrap(o,uu.COMMENT_WRAP-3),i+=uu.prefixLines(o+"\n","# "));for(var s=0;s<t.inputList.length;s++)if(t.inputList[s].type==ot.INPUT_VALUE){var o,r=t.inputList[s].connection.targetBlock();if(r)(o=uu.allNestedComments(r))&&(i+=uu.prefixLines(o,"# "))}}var a=t.nextConnection&&t.nextConnection.targetBlock();return i+e+(n?"":uu.blockToCode(a))},uu.getAdjustedInt=function(t,e,n,i){var s=n||0;t.workspace.options.oneBasedIndex&&s--;var o=t.workspace.options.oneBasedIndex?"1":"0",r=s?uu.ORDER_ADDITIVE:uu.ORDER_NONE,a=uu.valueToCode(t,e,r)||o;return ot.isNumber(a)?(a=parseInt(a,10)+s,i&&(a=-a)):(a=s>0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",i&&(a="-"+a)),a};const pu=205,_u={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(ot.Msg.MIXLY_CHOOSE_AND_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[ot.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[ot.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},du={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SETUP).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[ot.Msg.MIXLY_AipSpeech,"AipSpeech"],[ot.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[ot.Msg.MIXLY_AipFace,"AipFace"],[ot.Msg.MIXLY_AipOcr,"AipOcr"],[ot.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipSpeech_synthesis).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.OLED_STRING).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},cu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipSpeech_asr).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_AipSpeech_File).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Tu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipImageClassify).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(ot.Msg.MIXLY_AipImageClassify_Image).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Iu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[ot.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[ot.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[ot.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[ot.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[ot.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},mu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipFace_match).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AipImageClassify_Image+"1"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(ot.Msg.MIXLY_AipImageClassify_Image+"2"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Eu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipOcr).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(ot.Msg.MIXLY_AipImageClassify_Image).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},fu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[ot.Msg.MIXLY_AipOcr_webImage,"webImage"],[ot.Msg.MIXLY_AipOcr_idcard,"idcard"],[ot.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[ot.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[ot.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[ot.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[ot.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[ot.Msg.MIXLY_AipOcr_receipt,"receipt"],[ot.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[ot.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[ot.Msg.MIXLY_AipOcr_form,"tableRecognition"],[ot.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[ot.Msg.MIXLY_AipOcr_passport,"passport"],[ot.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},gu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.OLED_STRING).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Ou={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_Sim).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(ot.Msg.OLED_STRING+"1").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(ot.Msg.OLED_STRING+"2").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Mu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipNlp_lexer,"lexer"],[ot.Msg.MIXLY_AipNlp_depParser,"depParser"],[ot.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[ot.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[ot.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[ot.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[ot.Msg.MIXLY_AipNlp_keyword,"keyword"],[ot.Msg.MIXLY_AipNlp_topic,"topic"],[ot.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[ot.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},Ru={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[ot.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},Au={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_topic).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(ot.Msg.MIXLY_AipNlp_Topic_Title).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(ot.Msg.MIXLY_AipNlp_Topic_Content).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Su={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_summary).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.MIXLY_AipNlp_Topic_Content).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(ot.Msg.MIXLY_LIST_LEN).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Cu={init:function(){this.setColour(pu),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(ot.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},Lu={init:function(){this.setColour(pu),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(ot.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},yu={init:function(){this.setColour(pu),this.appendValueInput("AI").appendField(ot.Msg.MIXPY_AI_RESULT).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify,"Image"],[ot.Msg.MIXLY_AipSpeech_asr,"Speech"],[ot.Msg.MIXLY_AipFace_match,"Face"],[ot.Msg.MIXLY_AipOcr,"Ocr"],[ot.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[ot.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(ot.Msg.LOGIC_NEGATE_TOOLTIP)}},Du="#526FC3",Nu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},bu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},vu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},wu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},Fu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Pu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ku={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Vu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},xu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Uu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Bu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},Xu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Gu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Hu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ku={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},ju={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},qu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$u={init:function(){this.appendDummyInput().appendField("准备").appendField(new ot.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},zu={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Qu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ju={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},tp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},ep={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},np={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ip={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},sp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},op={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},rp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ap={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},lp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},up={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},pp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new ot.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},_p={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},cp={init:function(){this.setColour(Du),this.appendDummyInput().appendField("n"+ot.Msg.MIXLY_VALUE2).appendField(new ot.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Tp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ip={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},mp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Ep={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},fp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},gp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Op={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Mp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Rp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Ap={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Sp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("计算").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Cp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Lp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},yp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Dp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Np={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若3人一排列队多1人"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若5人一排列队多2人"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若7人一排列队多2人"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},bp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new ot.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},vp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("使士兵").appendField(new ot.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},wp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("剩余").appendField(new ot.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Fp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Pp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},kp={init:function(){this.appendDummyInput().appendField("准备").appendField(new ot.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},Vp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},xp={init:function(){this.setColour(Du),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Up="#3288dd",Bp={init:function(){this.setColour(Up),this.appendValueInput("DOMAIN").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_REQUESTS_GET).appendField(new ot.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Xp={init:function(){this.setColour(Up),this.appendValueInput("URL").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(ot.Msg.blockpy_REQUESTS).appendField(ot.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Gp={init:function(){this.setColour(Up),this.appendValueInput("URL").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(ot.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(ot.Msg.blockpy_REQUESTS+ot.Msg.OLED_STRING),this.appendDummyInput("").appendField(ot.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Hp={init:function(){this.appendValueInput("VAL");var t=[[ot.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[ot.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(Up),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ot.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Wp={init:function(){this.appendValueInput("VAR").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Up),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(ot.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:ot.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ot.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},Kp="f0a559",jp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},qp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$p={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},zp={init:function(){this.setColour(Kp),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(ot.Msg.MIXLY_MILLIS+ot.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},Qp={init:function(){this.setColour(Kp),this.appendDummyInput().appendField(ot.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Jp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE);var t=[[ot.Msg.MIXLY_CV_RECT,"rectangle"],[ot.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Zp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new ot.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},t_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},e_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(ot.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},n_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(ot.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(ot.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(ot.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},i_=170,s_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_series_create).appendField(new ot.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},o_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_series_create).appendField(new ot.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(ot.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},r_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},a_={init:function(){this.setColour(i_);var t=[[ot.Msg.DATAFRAME_RAW,"index"],[ot.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(ot.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},l_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(ot.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(ot.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},u_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(new ot.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new ot.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},p_={init:function(){this.setColour(i_);var t=[[ot.Msg.SERIES_INDEX,"index"],[ot.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(ot.Msg.SERIES_INDEX_VALUE).appendField(new ot.FieldDropdown(t),"INDEX_VALUE"),this.setOutput(!0,"List");var e=this;this.setTooltip((function(){var t=e.getFieldValue("INDEX_VALUE");return{index:ot.Msg.SERIES_INDEX_TOOLTIP,value:ot.Msg.HTML_VALUE_TOOLTIP}[t]}))}},__={init:function(){this.setColour(i_),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(ot.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(ot.Msg.TUPLE_GET_INDEX_TOOLTIP)}},d_={init:function(){this.setColour(i_),this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},h_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},c_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},T_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},I_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},m_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},E_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SET_LABEL).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(ot.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},f_={init:function(){this.setColour(i_),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_SPLITBYDOU).appendField(ot.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},g_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[ot.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:ot.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},O_={init:function(){this.setColour(i_);var t=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],e=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_SCATTER).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(ot.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},M_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_XY).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},R_={init:function(){this.setColour(i_);var t=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_BAR).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(ot.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new ot.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},A_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[ot.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PIE).appendField(ot.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(ot.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new ot.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new ot.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},S_={init:function(){this.setColour(i_),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_HIST).appendField(ot.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(ot.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},C_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_SETTING).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_TICKS).appendField(ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},L_={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[ot.Msg.LANG_MATH_TO_ROUND,"round"],[ot.Msg.LANG_MATH_TO_CEIL,"ceil"],[ot.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(i_),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(ot.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP"),this.setTooltip(ot.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},y_={init:function(){this.setColour(i_),this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT).appendField(ot.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},D_={init:function(){this.setColour(i_),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[ot.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},N_={init:function(){this.setColour(i_),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(ot.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new ot.FieldDropdown([[ot.Msg.DATAFRAME_COLUMN,"column"],[ot.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(ot.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},b_={init:function(){this.setColour(i_),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},v_={init:function(){this.setColour(i_);var t=[[ot.Msg.TEXT_TRIM_LEFT,"right"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[ot.Msg.mixpy_PL_TEXT_TOP,"bottom"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.MIXLY_SETTING).appendField(ot.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_HOR).appendField(new ot.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_VER).appendField(new ot.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PL_TEXT_TOOLTIP)}},w_={init:function(){this.setColour(i_),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},F_={init:function(){this.setColour(i_),this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},P_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},k_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},V_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Y_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},x_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},U_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SET_LABEL).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(ot.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},B_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[ot.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:ot.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},X_={init:function(){this.setColour(i_);var t=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],e=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_SCATTER).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(ot.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},G_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_XY).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},H_={init:function(){this.setColour(i_);var t=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_BAR).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(ot.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new ot.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},W_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[ot.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PIE).appendField(ot.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(ot.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new ot.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new ot.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},K_={init:function(){this.setColour(i_),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_HIST).appendField(ot.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(ot.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},j_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_SETTING).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_TICKS).appendField(ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},q_={init:function(){this.setColour(i_),this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT).appendField(ot.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},$_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},z_={init:function(){this.setColour(i_);var t=[[ot.Msg.TEXT_TRIM_LEFT,"right"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[ot.Msg.mixpy_PL_TEXT_TOP,"bottom"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.MIXLY_SETTING).appendField(ot.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_HOR).appendField(new ot.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_VER).appendField(new ot.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PL_TEXT_TOOLTIP)}},Q_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},J_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},Z_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new ot.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},td={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("创建二维图"),this.appendDummyInput().appendField("颜色").appendField(new ot.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},ed={init:function(){this.setColour(i_),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},nd={init:function(){this.setColour(i_),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},id={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},sd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},od={init:function(){this.setColour(i_),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},rd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列").setCheck(String),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("从数据框中删除指定的列。用逗号分隔多个列名。")}},ad={init:function(){this.setColour(i_),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},ld={init:function(){this.setColour(i_),this.appendValueInput("ARRAY1").appendField("列拼接数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},ud={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},pd={init:function(){this.setColour(i_),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},_d={init:function(){this.setColour(i_),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},dd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},hd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},cd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new ot.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},Td={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},Id={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},md={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},Ed={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},fd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},gd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},Od={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},Md={init:function(){this.setColour(i_),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},Rd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},Ad={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("排序方式").appendField(new ot.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Sd={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("获取").appendField(new ot.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(ot.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Cd={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ld={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},yd={init:function(){this.setColour(i_),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Dd={init:function(){this.setColour(i_),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nd=80,bd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new ot.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new ot.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("ds_create_linkedlist_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("ds_create_linkedlist_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldTextInput(t.length>e?t[e]:"name"),"KEY"+e).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},vd={init:function(){this.setColour(Nd),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},wd={init:function(){this.setColour(Nd),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},Fd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_NODE_USE).appendField(new ot.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_CREATE_NODE_TOOLTIP)}},Pd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_AIP_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},kd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_AIP_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},Vd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[ot.Msg.DS_ADD_NODE_BEFORE,"before"],[ot.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_ADD_NODE_TOOLTIP)}},Yd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[ot.Msg.DS_ADD_NODE_BEFORE,"before"],[ot.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AS),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_ADD_NODE_TOOLTIP)}},xd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Ud={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(ot.Msg.DS_DEL_NODE_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AS),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Bd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Xd="#777777",Gd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField("from ").appendField(new ot.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new ot.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField("import ").appendField(new ot.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;e<this.arguments_.length;e++){var n=document.createElement("arg");n.setAttribute("name",this.arguments_[e]),t.appendChild(n)}return t},domToMutation:function(t){this.arguments_=[];for(var e=0;t.childNodes[e];e++){let n=t.childNodes[e];"arg"==n.nodeName.toLowerCase()&&this.arguments_.push(n.getAttribute("name"))}this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("factory_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("factory_create_with_item");s.initSvg(),s.setFieldValue(this.arguments_[i],"NAME"),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){this.arguments_=[];for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)this.arguments_.push(e.getFieldValue("NAME")),n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;for(t=0;t<this.itemCount_;t++)this.appendValueInput("ADD"+t).setAlign(ot.inputs.Align.RIGHT).appendField(this.arguments_[t])}},Kd={init:function(){this.setColour(Xd),this.appendDummyInput().appendField(ot.Msg.MIXLY_PARAMS),this.appendStatementInput("STACK"),this.contextMenu=!1}},jd={init:function(){this.setColour(Xd),this.appendDummyInput().appendField(ot.Msg.LISTS_CREATE_WITH_ITEM_TITLE+":").appendField(new ot.FieldTextInput("x"),"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1}},qd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setOutput(!0),this.setMutator(new ot.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:Wd.mutationToDom,domToMutation:Wd.domToMutation,decompose:Wd.decompose,compose:Wd.compose,saveConnections:Wd.saveConnections,updateShape_:Wd.updateShape_},$d={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput("test"),"NAME").appendField("=").appendField(new ot.FieldTextInput("Test"),"TYPE").appendField("()"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput("test"),"NAME").appendField(".").appendField(new ot.FieldTextInput("callMethod"),"METHOD"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:Wd.mutationToDom,domToMutation:Wd.domToMutation,decompose:Wd.decompose,compose:Wd.compose,saveConnections:Wd.saveConnections,updateShape_:Wd.updateShape_},Qd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput("test"),"NAME").appendField(".").appendField(new ot.FieldTextInput("callMethod"),"METHOD"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setOutput(!0),this.setMutator(new ot.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:Wd.mutationToDom,domToMutation:Wd.domToMutation,decompose:Wd.decompose,compose:Wd.compose,saveConnections:Wd.saveConnections,updateShape_:Wd.updateShape_},Jd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput('display.scroll("Hello World!")'),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput("test"),"VALUE"),this.setOutput(!0)}},th={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldMultilineInput('display.scroll("Hello World!")\ndisplay.scroll("Hello Mixly!")'),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},eh={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldMultilineInput("Hello\nMixly"),"VALUE"),this.setOutput(!0)}},nh=40,ih={init:function(){this.setColour(nh),this.appendDummyInput("").appendField(ot.Msg.MIXLY_HARDWARE),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(ot.Msg.MIXLY_HARDWARE_START),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sh={init:function(){this.setColour(nh),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_HIGH,"HIGH"],[ot.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},oh={init:function(){this.setColour(nh),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(ot.Msg.MIXLY_Digital_PINMODEOUT).appendField(ot.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("STAT").appendField(ot.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.LANG_INOUT_DIGITAL_WRITE_TOOLTIP)}},rh={init:function(){this.setColour(nh),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(ot.Msg.MIXLY_Digital_PINMODEIN).appendField(ot.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_INOUT_DIGITAL_READ)}},ah={init:function(){this.setColour(nh),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(ot.Msg.MIXLY_Analog_PINMODEOUT).appendField(ot.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).appendField(ot.Msg.MIXLY_VALUE2).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_WRITE)}},lh={init:function(){this.setColour(nh),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(ot.Msg.MIXLY_Analog_PINMODEIN).appendField(ot.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_READ)}},uh={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(ot.Msg.INOUT_input_TOOLTIP)}},ph={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.BLOCKPY_PRINT_TOOLTIP)}},_h={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.TEXT_PRINT_TOOLTIP)}},dh={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(ot.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},hh={init:function(){var t=[[ot.Msg.LANG_MATH_STRING,"str"],[ot.Msg.LANG_MATH_INT,"int"],[ot.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(20),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(ot.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:ot.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:ot.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:ot.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},ch={init:function(){var t=[[ot.Msg.LANG_MATH_STRING,"str"],[ot.Msg.LANG_MATH_INT,"int"],[ot.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(20),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(ot.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:ot.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:ot.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:ot.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},Th={init:function(){this.setColour(20),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ot.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("inout_print_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var t=0;this.getInput("ADD"+t);)this.removeInput("ADD"+t),t++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(ot.Msg.MIXLY_MIXPY_INOUT_PRINT_EMPTY);else for(t=0;t<this.itemCount_;t++){var e=this.appendValueInput("ADD"+t);0==t&&e.appendField(ot.Msg.MIXLY_SERIAL_PRINTLN)}}},Ih={init:function(){this.setColour(20),this.appendDummyInput().appendField(ot.Msg.MIXLY_SERIAL_PRINTLN),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_CONTAINER_TOOLTIP),this.contextMenu=!1}},mh={init:function(){this.setColour(20),this.appendDummyInput().appendField(ot.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_ITEM_TOOLTIP),this.contextMenu=!1}},Eh="#526FC3",fh={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+ot.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setCheck(String).appendField(ot.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setCheck(String).appendField(ot.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setCheck(String).appendField(ot.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(ot.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setCheck(String).appendField(ot.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},gh={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},Oh={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},Mh={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(ot.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new ot.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},Rh={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(ot.inputs.Align.RIGHT),this.appendDummyInput().appendField(new ot.FieldLabel(ot.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(ot.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.Mutator(["iot_publish_item"])),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("iot_publish_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=t.newBlock("iot_create_with_item");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}return e},compose:function(t){for(var e=t.getInputTargetBlock("STACK"),n=[],i=0;e;)n[i]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=0;e;){var i=this.getInput("ADD"+n);e.valueConnection_=i&&i.connection.targetConnection,n++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var t=[],e=0;this.getInput("ADD"+e);e++)t.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(0==this.itemCount_)this.setFieldValue(ot.Msg.MIXLY_ESP32_PUBLISH_ONENET_EMPTY,"TIP");else{this.setFieldValue(ot.Msg.MIXLY_ESP32_PUBLISH_ONENET,"TIP");for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldTextInput(t.length>e?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ah={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Sh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ch={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Lh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(ot.Msg.MIXLY_WIFI_USERNAME).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(ot.Msg.MIXLY_IOT_PASSWORD).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(ot.Msg.MIXLY_EMQX_PROJECT).setAlign(ot.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(ot.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Dh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MIXLY_EMQX_SUBSCRIBE+ot.Msg.MIXLY_MICROBIT_MSG).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(ot.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Nh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MSG.stop+ot.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},bh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ot.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Ph={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},kh={init:function(){this.setColour(Eh),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Vh={init:function(){this.setColour(Eh),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Yh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},xh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO").appendField(ot.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(ot.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Uh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+ot.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xh={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Eh),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new ot.FieldImage(e,12,12,'"')}},Gh={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Eh),this.appendDummyInput("").appendField(new ot.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},Hh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO").appendField(ot.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Wh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("HTTP"+ot.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ot.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(ot.Msg.MIXLY_REQUESTS_GET).appendField(ot.Msg.MIXLY_GET_CURRENT_TIME).appendField(ot.Msg.MIXLY_OPEN_DEBUG).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Kh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("HTTP"+ot.Msg.MIXLY_Client).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ot.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ot.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},jh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MQTT"+ot.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ot.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(ot.Msg.MIXLY_INIT_SUBSCRIBE).appendField(ot.MQTT_Topic).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(ot.Msg.MIXLY_OPEN_DEBUG).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MQTT"+ot.Msg.MIXLY_Client).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ot.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ot.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},$h=fh,zh=gh,Qh=Oh,Jh=Rh,Zh=230,tc={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},ec={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},nc={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},ic={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},sc={init:function(){this.setColour(40),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.MIXPY_SERIAL_OPEN)).appendField(new ot.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(ot.Msg.MIXLY_SERIAL_BEGIN).appendField(new ot.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},oc={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},rc={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},ac={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendDummyInput().appendField(ot.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},lc=80,uc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},pc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},_c={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},dc={init:function(){var t=[[ot.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[ot.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[ot.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[ot.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[ot.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[ot.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+ot.Msg.LOAD).appendField(new ot.FieldDropdown(t),"type").appendField(new ot.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("name"))&&this.setTitleValue(e,"name")}},hc={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+ot.Msg.DATA_SET),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.EIGENVALUES,"data"],[ot.Msg.LABEL_VALUE,"target"],[ot.Msg.FEATURE,"feature_names"],[ot.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},cc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Tc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ic={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},mc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ec={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},fc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},gc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_KNN_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Oc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Mc={init:function(){this.appendDummyInput().appendField("sklearn 初始化 PCA 算法"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_components").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_PCA_N_COMPONENTS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Rc={init:function(){this.appendDummyInput().appendField("sklearn PCA 降维"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ac={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Sc={init:function(){this.appendDummyInput().appendField("sklearn K-均值聚类"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Cc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Lc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},yc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Dc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Nc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},bc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(ot.inputs.Align.RIGHT).setCheck(null).appendField(ot.Msg.MODEL_NAME),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_COEF,"coef_"],[ot.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},vc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[ot.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[ot.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},wc={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField("sklearn").appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_SAVE_MODEL,"dump"],[ot.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+ot.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Fc=120,Pc={init:function(){this.setColour(Fc),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY+"("+ot.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},kc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField(ot.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},Vc={init:function(){this.setColour(Fc),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},Yc={init:function(){this.setColour(Fc),this.appendValueInput("STATUS_CODE",Number).appendField(ot.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},xc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},Uc={init:function(){this.setColour(Fc),this.appendValueInput("TIME").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField("MsTimer2").appendField(ot.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField("MsTimer2").appendField(ot.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField("MsTimer2").appendField(ot.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gc={init:function(){this.setColour(Fc),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Hc=180,Wc={init:function(){this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.blockpy_turtle_create).appendField(new ot.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qc={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_forward,"forward"],[ot.Msg.blockpy_backward,"backward"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:ot.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ot.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},$c={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_left,"left"],[ot.Msg.blockpy_right,"right"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_rotate).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{left:ot.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:ot.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[t]}))}},zc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_setheading),this.appendDummyInput().appendField(ot.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(ot.Msg.MIXLY_MILLIS),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(ot.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zc={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},tT={init:function(){this.setColour(Hc);var t=[[ot.Msg.TURTLE_POS,"pos"],[ot.Msg.TURTLE_SHAPE,"shape"],[ot.Msg.TURTLE_HEADING,"heading"],[ot.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[ot.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[ot.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.TURTLE_POS_SHAPE).appendField(new ot.FieldDropdown(t),"DIR");var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pos:ot.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:ot.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:ot.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:ot.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:ot.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:ot.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[t]})),this.setOutput(!0),this.setInputsInline(!0)}},eT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[ot.Msg.blockpy_turtle_reset,"reset"],[ot.Msg.blockpy_turtle_home,"home"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:ot.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:ot.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:ot.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},nT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_penup,"penup"],[ot.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{penup:ot.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:ot.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[t]}))}},iT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_beginfill,"begin"],[ot.Msg.blockpy_turtle_endfill,"end"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{begin:ot.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:ot.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[t]}))}},sT={init:function(){this.appendDummyInput("").appendField(new ot.FieldTextInput("tina"),"TUR");var t=[[ot.Msg.blockpy_turtle_size,"pensize"],[ot.Msg.MIXLY_SPEED,"speed"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_set).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pensize:ot.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:ot.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[t]}))}},oT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_set_size),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_set_speed),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},aT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_circle,"circle"],[ot.Msg.blockpy_turtle_dot,"dot"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_draw).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{circle:ot.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:ot.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[t]}))}},lT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(ot.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},uT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_hide,"hideturtle"],[ot.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{hideturtle:ot.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:ot.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[t]}))}},pT={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_bgcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_T={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_pencolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_fillcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.TURTLE_CLONE),this.setTooltip(ot.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},cT={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},TT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_pencolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_fillcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ET={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR1").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fT={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},OT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},MT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_shape_arrow,"arrow"],[ot.Msg.blockpy_turtle_shape_turtle,"turtle"],[ot.Msg.blockpy_turtle_shape_circle,"circle"],[ot.Msg.blockpy_turtle_shape_square,"square"],[ot.Msg.blockpy_turtle_shape_triangle,"triangle"],[ot.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.blockpy_turtle_shape).appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_SHAPE_TOOLTIP)}},RT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},AT={init:function(){this.appendDummyInput("").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(Hc),this.appendValueInput("TITLE").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(ot.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(ot.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ot.Msg.TURTLE_NUMINPUT_TOOLTIP)}},ST={init:function(){this.appendDummyInput("").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(Hc),this.appendValueInput("TITLE").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},CT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},LT={init:function(){var t=[[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new ot.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new ot.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new ot.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},yT={init:function(){var t=[[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new ot.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new ot.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new ot.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},DT={init:function(){this.setColour(Hc),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},NT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new ot.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},vT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},wT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(ot.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},FT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendDummyInput().appendField(ot.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},PT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},kT=function(t,e){var n=this.getFieldValue("TYPE");return e.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",e.ORDER_ATOMIC]},VT=function(t,e){var n=this.getFieldValue("CTYPE");return e.definitions_.import_aip="import aip",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = aip."+n+"("+e.valueToCode(this,"API_KEY",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"SECRET_KEY",e.ORDER_ATOMIC)+")\n"},YT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".synthesis("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},xT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".asr("+(e.valueToCode(this,"FILE",e.ORDER_ATOMIC)||'""')+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},UT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},BT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".match("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"VAR2",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},XT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},GT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"STR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},HT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"STR1",e.ORDER_ATOMIC),s=e.valueToCode(this,"STR2",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+","+s+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},WT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".topic("+e.valueToCode(this,"STR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STR2",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},KT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".newsSummary("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"LEN",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},jT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},qT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},$T=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},zT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},QT=function(t,e){return e.definitions_.import_audio="import audio","audio.audio_record("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"TIME",e.ORDER_ATOMIC)||"0")+")\n"},JT=function(t,e){return e.definitions_.import_audio="import cam","cam.photo_capture("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"BUT",e.ORDER_ATOMIC)||'""')+")\n"},ZT=function(t,e){var n=e.valueToCode(this,"AI",e.ORDER_ASSIGNMENT)||"0",i=this.getFieldValue("CTYPE");if("Image"==i)var s=n+'["result"][0]["keyword"]';if("Speech"==i)s=n+'["result"][0]';if("Face"==i||"OcrSimilarity"==i)s=n+'["score"]';if("Ocr"==i)s=n+'["words_result"]';return[s,e.ORDER_ATOMIC]},tI=function(t,e){e.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},eI=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},nI=function(t,e){e.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},iI=function(t,e){return["flag == 1",e.ORDER_ATOMIC]},sI=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},oI=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},rI=function(t,e){e.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},aI=function(){var t="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return t="house[f].hide()\ndrive(path[len(path) - 1])\n"+t},lI=function(t,e){return["len(path) == 7",e.ORDER_ATOMIC]},uI=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},pI=function(t,e){e.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},_I=function(t,e){return["f == 1",e.ORDER_ATOMIC]},dI=function(){return"print('没有符合条件的路线')\n"},hI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},cI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},TI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]<tmp and i!=last:\n next=i\n tmp=g[now][i]\nstu.slideTo(position[next][0], position[next][1], 1)\ntime.sleep(0.5)\npath.append(next)\nlast=now\nnow=next\nif len(path)>6:\n print("路线错乱!程序有误!")\n exit()\n'},II=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},mI=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},EI=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},fI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高不得高于6层')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},gI=function(t,e){var n=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",i=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},OI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},MI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},RI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},AI=function(t,e){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",e.ORDER_ATOMIC]},SI=function(t,e){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",e.ORDER_ATOMIC]},CI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},LI=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},yI=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},DI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},NI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},bI=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},vI=function(t,e){var n=this.getFieldValue("NUM");return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},wI=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器0', 30, 200)\n"},FI=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},PI=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},kI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},VI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},YI=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},xI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},UI=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},BI=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量'+str(_rabbit)+'只。')\n"},XI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},GI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1',0,0,'text')\n_text_2 = sprite.Text('S2',0,30,'text2')\n_text_3 = sprite.Text('S3',0,60,'text3')\n_text_4 = sprite.Text('S4',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},HI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${n}.show()\ntime.sleep(1)\n`,s+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},WI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},KI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},jI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},qI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量0',0,0,'num')\n_last = sprite.Text('剩余0',500,0,'last')\n_line = 3\n"},$I=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},zI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},QI=function(t,e){return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,e.ORDER_ATOMIC]},JI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},ZI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},tm=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=this.getFieldValue("NUM");return e.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",e.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",e.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a<b:\n print('非法移动,不能将大盘放置在小盘上')\n exit() \n t.goto(150 * y - 150,20 * len(tower[y]) - 90)\n tower[y].append(t)\n tower_num[y].append(a)\n except IndexError:\n print('非法移动,未找到可移动的圆盘')\n exit()\n",`num = ${i}\ntower = [[], [], []]\ntower_num = [[], [], []]\nA,B,C=0,1,2\ntotal_num=[0]\ncolor= (${n})\ninit_Hanoi()\nfor i in range(0, num, 1):\n tina = turtle.Turtle()\n tina.penup()\n tina.shape('square')\n if num == 1:\n tina.shapesize(1,7,1)\n else:\n tina.shapesize(1,7 - (6 / (num - 1)) * i,1)\n tina.color("#000000",color)\n tina.speed(3)\n tina.goto(-150,20 * i - 90)\n tower[0].append(tina)\n tower_num[0].append(i)\ncount_turtle=turtle.Turtle()\ncount_turtle.hideturtle()\ncount_turtle.penup()\ncount_turtle.goto(0,150)\ncount_turtle.write('总步数0') \nbegin()\n`},em=function(){return"f = path[(len(path) - 1)]\n"},nm=function(t,e){return["len(path)==0",e.ORDER_ATOMIC]},im=function(t,e){return['"'+this.getFieldValue("COLOR")+'"',e.ORDER_ATOMIC]},sm=function(t,e){return e.definitions_.import_requests="import requests",e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+"= requests.get("+e.valueToCode(this,"DOMAIN",e.ORDER_ATOMIC)+")\n"},om=function(t,e){return e.definitions_.import_requests="import requests",["requests."+this.getFieldValue("TYPE")+"("+e.valueToCode(this,"URL",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},rm=function(t,e){return e.definitions_.import_requests="import requests",["requests."+this.getFieldValue("TYPE")+"("+e.valueToCode(this,"URL",e.ORDER_ATOMIC)+",data="+e.valueToCode(this,"data",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},am=function(t,e){return e.definitions_.import_requests="import requests",[(e.valueToCode(this,"VAL",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("ATTR"),e.ORDER_ATOMIC]},lm=function(t,e){return e.definitions_.import_requests="import requests","requests."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"};var um=__webpack_require__(936);const pm=function(t,e){e.definitions_.import_pandas="import pandas";var n=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0";return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = pandas.Series("+n+")\n"},_m=function(t,e){e.definitions_.import_pandas="import pandas";var n=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"INDEX",e.ORDER_ATOMIC)||"''";return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = pandas.Series("+n+",index="+i+")\n"},dm=function(t,e){e.definitions_.import_pandas="import pandas";var n=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0";return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = pandas.DataFrame("+n+")\n"},hm=function(t,e){e.definitions_.import_pandas="import pandas";var n=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"INDEX_COLUMN",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"INDEX_RAW",e.ORDER_ATOMIC)||"''";return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = pandas.DataFrame("+n+",columns="+i+",index="+s+")\n"},cm=function(t,e){e.definitions_.import_pandas="import pandas";var n=this.getFieldValue("COLUMN_RAW"),i=e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"INDEX",e.ORDER_ATOMIC)||"''";return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = pandas.DataFrame("+i+","+n+"="+s+")\n"},Tm=function(t,e){return e.definitions_.import_pandas="import pandas",e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = pandas.Series(["+this.getFieldValue("TEXT")+"])\n"},Im=function(t,e){return e.definitions_.import_pandas="import pandas",[(e.valueToCode(this,"SERIES",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("INDEX_VALUE"),e.ORDER_ATOMIC]},mm=function(t,e){return[(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+"["+(e.valueToCode(this,"AT",e.ORDER_ADDITIVE)||"1")+"]",e.ORDER_ATOMIC]},Em=function(t,e){e.definitions_.import_pylab="import pylab";return"pylab.show()\n"},fm=function(t,e){e.definitions_.import_pylab="import pylab";return"pylab.axes(aspect=1)\n"},gm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.plot("+(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+")\n"},Om=function(t,e){e.definitions_.import_pylab="import pylab";var n=this.getFieldValue("LINE"),i=this.getFieldValue("COLOR"),s=this.getFieldValue("DOT");return"pylab.plot("+(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+",'"+s+n+i+"')\n"},Mm=function(t,e){e.definitions_.import_pylab="import pylab",e.definitions_.import_matplotlib_font_manager="import matplotlib.font_manager";return'pylab.legend(prop=matplotlib.font_manager.FontProperties("STSong"))\n'},Rm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.title("+e.valueToCode(this,"TITLE",e.ORDER_ATOMIC)+', fontproperties = "STSong")\n'},Am=function(t,e){return e.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"label("+e.valueToCode(this,"LABEL",e.ORDER_ATOMIC)+', fontproperties = "STSong")\n'},Sm=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.arange("+(e.valueToCode(this,"FROM",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"TO",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"STEP",e.ORDER_NONE)||"1")+")",e.ORDER_ATOMIC]},Cm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+","+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+")\n"},Lm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.scatter("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+","+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+",s="+(e.valueToCode(this,"S",e.ORDER_ATOMIC)||"''")+",c='"+this.getFieldValue("COLOR")+"',marker='"+this.getFieldValue("DOT")+"',label="+(e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''")+")\n"},ym=function(t,e){e.definitions_.import_pylab="import pylab";var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=this.getFieldValue("LINE"),o=this.getFieldValue("COLOR");return"pylab.plot("+n+","+i+",'"+this.getFieldValue("DOT")+s+o+"',label="+(e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''")+")\n"},Dm=function(t,e){e.definitions_.import_pylab="import pylab";var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''",o=e.valueToCode(this,"WIDTH",e.ORDER_RELATIONAL)||"0",r=this.getFieldValue("COLOR");return"pylab.bar("+n+","+i+',align="'+this.getFieldValue("ALIGN")+'",color="'+r+'",width='+o+",label="+s+")\n"},Nm=function(t,e){e.definitions_.import_pylab="import pylab";var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"EXPLODE",e.ORDER_ATOMIC)||"''",o=this.getFieldValue("SHADOW"),r=this.getFieldValue("autopct");return"None"!=r&&(r="'"+r+"'"),"pylab.pie("+n+",explode="+s+",labels="+i+",autopct="+r+",shadow="+o+")\n"},bm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.hist("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+","+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+")\n"},vm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"ticks("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+","+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+",fontproperties = 'STSong')\n"},wm=function(t,e){e.definitions_.import_numpy="import numpy";var n=e.valueToCode(this,"NUM",e.ORDER_NONE)||"0";return["numpy."+this.getFieldValue("OP")+"("+n+")",e.ORDER_ATOMIC]},Fm=function(t,e){return e.definitions_.import_numpy="import numpy","pylab.subplot("+(e.valueToCode(this,"VET",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"HOR",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+")\n"},Pm=function(t,e){return e.definitions_.import_pandas="import pandas",["pandas.read_csv("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", header="+this.getFieldValue("MODE")+")",e.ORDER_ATOMIC]},km=function(t,e){var n=this.getFieldValue("MODE"),i=e.valueToCode(this,"DICT",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"KEY",e.ORDER_ASSIGNMENT);if("column"==n)var o=i+"["+s+"]";else if("raw"==n)o=i+".loc["+s+"]";return[o,e.ORDER_ATOMIC]},Vm=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.savefig("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ym=function(t,e){return e.definitions_.import_numpy="import numpy","pylab.text("+(e.valueToCode(this,"VET",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"HOR",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+", ha='"+this.getFieldValue("HALIGN")+"', va='"+this.getFieldValue("VALIGN")+"', fontsize="+(e.valueToCode(this,"FONTNUM",e.ORDER_ASSIGNMENT)||"0")+")\n"},xm=function(t,e){var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0";return e.definitions_.import_numpy="import numpy",["numpy.array("+n+")",e.ORDER_ATOMIC]},Um=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.show()\n"},Bm=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.axes(aspect=1)\n"},Xm=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.plot("+(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+")\n"},Gm=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var n=this.getFieldValue("LINE"),i=this.getFieldValue("COLOR"),s=this.getFieldValue("DOT");return"plt.plot("+(e.valueToCode(this,"SER",e.ORDER_ASSIGNMENT)||"0")+", '"+s+n+i+"')\n"},Hm=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt",e.definitions_.import_matplotlib_font_manager="import matplotlib.font_manager";return'plt.legend(prop=matplotlib.font_manager.FontProperties("STSong"))\n'},Wm=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.title("+e.valueToCode(this,"TITLE",e.ORDER_ATOMIC)+', fontproperties="STSong")\n'},Km=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"label("+e.valueToCode(this,"LABEL",e.ORDER_ATOMIC)+', fontproperties="STSong")\n'},jm=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+", "+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+")\n"},qm=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.scatter("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+", "+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+", s="+(e.valueToCode(this,"S",e.ORDER_ATOMIC)||"''")+", c='"+this.getFieldValue("COLOR")+"', marker='"+this.getFieldValue("DOT")+"', label="+(e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''")+")\n"},$m=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=this.getFieldValue("LINE"),o=this.getFieldValue("COLOR");return"plt.plot("+n+", "+i+", '"+this.getFieldValue("DOT")+s+o+"', label="+(e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''")+")\n"},zm=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"TAG",e.ORDER_ATOMIC)||"''",o=e.valueToCode(this,"WIDTH",e.ORDER_RELATIONAL)||"0",r=this.getFieldValue("COLOR");return"plt.bar("+n+", "+i+', align="'+this.getFieldValue("ALIGN")+'", color="'+r+'", width='+o+", label="+s+")\n"},Qm=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''",s=e.valueToCode(this,"EXPLODE",e.ORDER_ATOMIC)||"''",o=this.getFieldValue("SHADOW"),r=this.getFieldValue("autopct");return"None"!=r&&(r="'"+r+"'"),"plt.pie("+n+", explode="+s+", labels="+i+", autopct="+r+", shadow="+o+")\n"},Jm=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.hist("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+", "+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+")\n"},Zm=function(t,e){return e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"ticks("+(e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''")+", "+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''")+", fontproperties = 'STSong')\n"},tE=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.subplot("+(e.valueToCode(this,"VET",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"HOR",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+")\n"},eE=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.savefig('1.png')\n"},nE=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.text("+(e.valueToCode(this,"VET",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"HOR",e.ORDER_NONE)||"0")+", "+(e.valueToCode(this,"NUM",e.ORDER_NONE)||"0")+", ha='"+this.getFieldValue("HALIGN")+"', va='"+this.getFieldValue("VALIGN")+"', fontsize="+(e.valueToCode(this,"FONTNUM",e.ORDER_ASSIGNMENT)||"0")+")\n"},iE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.shape("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},sE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.reshape("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+", "+(e.valueToCode(t,"DIMENSIONS",e.ORDER_ATOMIC)||"(1, -1)")+")",e.ORDER_ATOMIC]},oE=function(t,e){return e.definitions_.import_numpy="import numpy",[(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+".astype("+t.getFieldValue("TYPE")+")",e.ORDER_ATOMIC]},rE=function(t,e){return e.definitions_.import_pylab="import pylab","pylab.imshow("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+', cmap="'+(t.getFieldValue("COLORMAP")||"gray")+'")\n'},aE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.mean("+(e.valueToCode(t,"X",e.ORDER_ATOMIC)||"[]")+"["+(e.valueToCode(t,"Y",e.ORDER_ATOMIC)||"[]")+" == "+(e.valueToCode(t,"DIGIT",e.ORDER_ATOMIC)||"0")+"], axis=0)",e.ORDER_ATOMIC]},lE=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_cv2="import cv2",["numpy.argmin([numpy.sum(cv2.absdiff("+(e.valueToCode(t,"IMAGE",e.ORDER_ATOMIC)||"[]")+", template)) for template in "+(e.valueToCode(t,"TEMPLATES",e.ORDER_ATOMIC)||"[]")+"])",e.ORDER_ATOMIC]},uE=function(t,e){e.definitions_.import_numpy="import numpy";var n=e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]",i=t.getFieldValue("AXIS");if("NONE"===i)var s="numpy.mean("+n+")";else s="numpy.mean("+n+", axis="+i+")";return[s,e.ORDER_ATOMIC]},pE=function(t,e){e.definitions_.import_numpy="import numpy";var n=e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]",i=t.getFieldValue("AXIS");if("NONE"===i)var s="numpy.std("+n+")";else s="numpy.std("+n+", axis="+i+")";return[s,e.ORDER_ATOMIC]},_E=function(t,e){return e.definitions_.import_pandas="import pandas",[(e.valueToCode(t,"DF",e.ORDER_ATOMIC)||"df")+".dropna()",e.ORDER_MEMBER]},dE=function(t,e){return e.definitions_.import_pandas="import pandas",[(e.valueToCode(t,"DATAFRAME",e.ORDER_ATOMIC)||"df")+".drop(columns="+(e.valueToCode(t,"COLUMNS",e.ORDER_ATOMIC)||"[]")+", axis=1)",e.ORDER_ATOMIC]},hE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.ones("+(e.valueToCode(t,"NUM",e.ORDER_ATOMIC)||"1")+")",e.ORDER_ATOMIC]},cE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.c_["+(e.valueToCode(t,"ARRAY1",e.ORDER_ATOMIC)||"[]")+", "+(e.valueToCode(t,"ARRAY2",e.ORDER_ATOMIC)||"[]")+"]",e.ORDER_ATOMIC]},TE=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_linalg="import numpy.linalg",["numpy.linalg.det("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},IE=function(t,e){return[(e.valueToCode(t,"MATRIX",e.ORDER_ATOMIC)||"[]")+".T",e.ORDER_ATOMIC]},mE=function(t,e){return[(e.valueToCode(t,"MATRIX1",e.ORDER_ATOMIC)||"[]")+" @ "+(e.valueToCode(t,"MATRIX2",e.ORDER_ATOMIC)||"[]"),e.ORDER_ATOMIC]},EE=function(t,e){return e.definitions_.import_numpy="import numpy",e.definitions_.import_linalg="import numpy.linalg",["numpy.linalg.inv("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},fE=function(t,e){return[(e.valueToCode(t,"DATAFRAME",e.ORDER_ATOMIC)||"df")+".median()",e.ORDER_ATOMIC]},gE=function(t,e){return(e.valueToCode(t,"DATAFRAME",e.ORDER_ATOMIC)||"df")+".fillna(value="+(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"0")+", inplace="+(t.getFieldValue("INPLACE")||"False")+")\n"},OE=function(t,e){return[(e.valueToCode(t,"DATAFRAME",e.ORDER_ATOMIC)||"df")+".info()",e.ORDER_ATOMIC]},ME=function(t,e){e.definitions_.import_numpy="import numpy";var n=e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]",i=t.getFieldValue("AXIS");return["None"===i?"numpy.min("+n+")":"numpy.min("+n+", axis="+i+")",e.ORDER_ATOMIC]},RE=function(t,e){e.definitions_.import_numpy="import numpy";var n=e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]",i=t.getFieldValue("AXIS");return["None"===i?"numpy.max("+n+")":"numpy.max("+n+", axis="+i+")",e.ORDER_ATOMIC]},AE=function(t,e){return e.definitions_.import_numpy="import numpy",[(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+".size",e.ORDER_ATOMIC]},SE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.dot("+(e.valueToCode(t,"ARRAY1",e.ORDER_ATOMIC)||"[]")+", "+(e.valueToCode(t,"ARRAY2",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},CE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.square("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},LE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.sum("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},yE=function(t,e){return e.definitions_.import_numpy="import numpy",["numpy.random.random("+(e.valueToCode(t,"SIZE",e.ORDER_ATOMIC)||"1")+")",e.ORDER_ATOMIC]},DE=function(t,e){return["sum("+(e.valueToCode(t,"ARRAY",e.ORDER_ATOMIC)||"[]")+")",e.ORDER_ATOMIC]},NE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.sort_values(by=${e.valueToCode(t,"KEY",e.ORDER_ATOMIC)||"'tag'"}, ascending=${t.getFieldValue("AS_CENDING")})`,e.ORDER_ATOMIC]},bE=function(t,e){const n=e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df",i=e.valueToCode(t,"LINES",e.ORDER_ATOMIC)||"1";return[`${n}.${t.getFieldValue("TYPE")}(${i})`,e.ORDER_ATOMIC]},vE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}[${e.valueToCode(t,"KEY",e.ORDER_ATOMIC)||"df['tag'] > 1"}]`,e.ORDER_ATOMIC]},wE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.groupby(by=${e.valueToCode(t,"KEY",e.ORDER_ATOMIC)||"'tag'"})`,e.ORDER_ATOMIC]},FE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.${t.getFieldValue("TYPE")}()`,e.ORDER_ATOMIC]},PE=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},kE=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE),s="class "+i+":\n";s+=" def __init__(self):\n";for(var o=new Array(this.itemCount_),r=0;r<this.itemCount_;r++){var a=this.getFieldValue("KEY"+r);o[r]=" self."+a+" = "+(e.valueToCode(this,"ADD"+r,e.ORDER_NONE)||"0")}return s+=o.join("\n")+"\n",s+=" self.next = None\n",s+=n+" = "+i+"()\n"},VE=function(t,e){return(e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0")+" = "+e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE)+"()\n"},YE=function(t,e){return[(e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0")+"."+e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE),e.ORDER_ATOMIC]},xE=function(t,e){return(e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0")+"."+e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE)+" = "+(e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0")+"\n"},UE=function(t,e){var n=e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"NODE2",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"NODE3",e.ORDER_ASSIGNMENT)||"0",o=this.getFieldValue("DIR");if("after"==o){var r="now = "+n+"\n";r+="while now != "+i+" and now != None:\n",r+=" now = now.next\n",r+="if now != None:\n",r+=" "+s+".next = now.next\n",r+=" now.next = "+s+"\n",r+=' print("插入节点成功")\n',r+="else:\n",r+=' print("插入节点失败,未找到指定名称的节点")\n'}if("before"==o){r="if "+n+" == "+i+":\n";r+=" "+s+".next = "+n+"\n",r+="else:\n",r+=" now = "+n+"\n",r+=" while now.next != "+i+" and now.next != None:\n",r+=" now = now.next\n",r+=" if now != None:\n",r+=" "+s+".next = now.next\n",r+=" now.next = "+s+"\n",r+=' print("插入节点成功")\n',r+=" else:\n",r+=' print("插入节点失败,未找到指定名称的节点")\n'}return r},BE=function(t,e){var n=e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.valueToCode(this,"NODE3",e.ORDER_ASSIGNMENT)||"0",o=e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE),r=this.getFieldValue("DIR");if("after"==r){var a="now = "+n+"\n";a+="while now."+o+" != "+i+" and now != None:\n",a+=" now = now.next\n",a+="if now != None:\n",a+=" "+s+".next = now.next\n",a+=" now.next = "+s+"\n",a+=' print("插入节点成功")\n',a+="else:\n",a+=' print("插入节点失败,未找到指定的节点")\n'}if("before"==r){a="if "+n+"."+o+" == "+i+":\n";a+=" "+s+".next = "+n+"\n",a+="else:\n",a+=" now = "+n+"\n",a+=" while now.next."+o+" != "+i+"and now.next != None:\n",a+=" now = now.next\n",a+=" if now != None:\n",a+=" "+s+".next = now.next\n",a+=" now.next = "+s+"\n",a+=' print("插入节点成功")\n',a+=" else:\n",a+=' print("插入节点失败,未找到指定的节点")\n'}return a},XE=function(t,e){var n=e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"NODE2",e.ORDER_ASSIGNMENT)||"0",s="if "+n+" == "+i+":\n";return s+=" "+n+".next = None\n",s+="else:\n",s+=" now = "+n+"\n",s+=" while now.next != "+i+" and now.next != None:\n",s+=" now = now.next\n",s+=" if now != None:\n",s+=" now.next = now.next.next\n",s+=' print("删除节点成功")\n',s+=" else:\n",s+=' print("删除节点失败,未找到指定名称的节点")\n'},GE=function(t,e){var n=e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"VAR",e.ORDER_ASSIGNMENT)||"0",s=e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE),o="if "+n+"."+s+" == "+i+":\n";return o+=" "+n+".next = None\n",o+="else:\n",o+=" now = "+n+"\n",o+=" while now.next."+s+" != "+i+" and now.next != None:\n",o+=" now = now.next\n",o+=" if now != None:\n",o+=" now.next = now.next.next\n",o+=' print("删除节点成功")\n',o+=" else:\n",o+=' print("删除节点失败,未找到指定的节点")\n'},HE=function(t,e){var n="ptr = "+(e.valueToCode(this,"NODE",e.ORDER_ASSIGNMENT)||"0")+"\n";return n+="before = None\n",n+="while ptr != None:\n",n+=" last = before\n",n+=" before = ptr\n",n+=" ptr = ptr.next\n",n+=" before.next = last\n",n+=(e.valueToCode(this,"NODE2",e.ORDER_ASSIGNMENT)||"0")+" = before\n"},WE=function(t,e){var n=this.getFieldValue("path"),i=this.getFieldValue("module");return e.definitions_["import_"+n+"_"+i]="from "+n+" import "+i,""},KE=function(t,e){var n=this.getFieldValue("module");return e.definitions_["import_"+n]="import "+n,""},jE=function(t,e){for(var n=this.getFieldValue("NAME"),i=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)i[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"";return n+"("+i.join(", ")+")\n"},qE=function(t,e){for(var n=this.getFieldValue("NAME"),i=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)i[s]=e.valueToCode(this,"ADD"+s,e.ORDER_NONE)||"";return[n+"("+i.join(", ")+")",e.ORDER_ATOMIC]},$E=function(){var t=this.getFieldValue("TYPE");return this.getFieldValue("NAME")+" = "+t+"()\n"},zE=function(t,e){for(var n=this.getFieldValue("NAME"),i=this.getFieldValue("METHOD"),s=new Array(this.itemCount_),o=0;o<this.itemCount_;o++)s[o]=e.valueToCode(this,"ADD"+o,e.ORDER_NONE)||"";return n+"."+i+"("+s.join(", ")+")\n"},QE=function(t,e){for(var n=this.getFieldValue("NAME"),i=this.getFieldValue("METHOD"),s=new Array(this.itemCount_),o=0;o<this.itemCount_;o++)s[o]=e.valueToCode(this,"ADD"+o,e.ORDER_NONE)||"";return[n+"."+i+"("+s.join(", ")+")",e.ORDER_ATOMIC]},JE=function(){return this.getFieldValue("VALUE")+"\n"},ZE=function(t,e){return[this.getFieldValue("VALUE"),e.ORDER_ATOMIC]},tf=function(){return this.getFieldValue("VALUE")+"\n"},ef=function(t,e){return[this.getFieldValue("VALUE"),e.ORDER_ATOMIC]},nf=function(t,e){return e.definitions_.import_s4alib="import s4alib",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+' = s4alib.s4a_start("'+rt.JSFuncs.getCom()+'")\n'},sf=function(t,e){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",e.ORDER_ATOMIC]},of=function(t,e){e.definitions_.import_s4alib="import s4alib";var n="";return n+=e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".digital_write("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STAT",e.ORDER_ATOMIC)+")\n"},rf=function(t,e){e.definitions_.import_s4alib="import s4alib";return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".digital_read("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},af=function(t,e){e.definitions_.import_s4alib="import s4alib";return[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".analog_read("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},lf=function(t,e){e.definitions_.import_s4alib="import s4alib";var n="";return n+=e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".analog_write("+e.valueToCode(this,"PIN",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NUM",e.ORDER_ATOMIC)+")\n"},uf=function(t,e){return["input("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")",e.ORDER_ATOMIC]},pf=function(t,e){return"print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},_f=function(t,e){return"print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+',end ="")\n'},df=function(t,e){return"print("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+",end ="+(e.valueToCode(this,"END",e.ORDER_ATOMIC)||'""')+")\n"},hf=function(t,e){var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""',i=this.getFieldValue("DIR");if("str"==i)var s="input("+n+")";else if("int"==i)s="int(input("+n+"))";else if("float"==i)s="float(input("+n+"))";return[s,e.ORDER_ATOMIC]},cf=function(t,e){var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""',i=this.getFieldValue("DIR");if(e.definitions_.import_pyinput="import pyinput","str"==i)var s="pyinput.input("+n+")";else if("int"==i)s="int(pyinput.input("+n+"))";else if("float"==i)s="float(pyinput.input("+n+"))";return[s,e.ORDER_ATOMIC]},Tf=function(t,e){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++)n[i]=e.valueToCode(this,"ADD"+i,e.ORDER_NONE)||"0";return n="print("+n.join(", ")+")\n"},If=function(t,e){e.definitions_.import_mixiot="import mixiot";var n=e.valueToCode(this,"SERVER",e.ORDER_ATOMIC),i=e.valueToCode(this,"USERNAME",e.ORDER_ATOMIC),s=e.valueToCode(this,"PASSWORD",e.ORDER_ATOMIC),o=e.valueToCode(this,"PROJECT",e.ORDER_ATOMIC),r=Math.round(new Date).toString(),a="f'python-mqtt-"+i.replace("'","").replace("'","")+r.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO("+n+", 1883 ,"+i+", "+s+", "+o+", "+a+")\n"},mf=function(t,e){var n=e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC),i=e.valueToCode(this,"MSG",e.ORDER_ATOMIC);return e.definitions_.import_mixiot="import mixiot","mqtt_client.publish("+n+", "+i+")\n"},Ef=function(t,e){var n=e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC),i=e.valueToCode(this,"METHOD",e.ORDER_ATOMIC);return e.definitions_.import_mixiot="import mixiot","mqtt_client.subscribe_and_set_callback("+n+","+i+")\n"},ff=function(t,e){var n=e.valueToCode(this,"TOPIC",e.ORDER_ATOMIC);return e.definitions_.import_mixiot="import mixiot","mqtt_client.unsubscribe("+n+")\n"},gf=function(t,e){e.definitions_.import_mixiot="import mixiot";return"mqtt_client.disconnect()\n"},Of=function(t,e){e.definitions_.import_mixiot="import mixiot";return"mqtt_client.connect()\n"},Mf=function(t,e){e.definitions_.import_mixiot="import mixiot";return"mqtt_client.check_msg()\n"},Rf=function(t,e){return['mqtt_client.decode("utf-8").split("/")[-1]',e.ORDER_ATOMIC]},Af=function(t,e){return['mqtt_client.decode("utf-8")',e.ORDER_ATOMIC]},Sf=function(t,e){return e.definitions_.import_mixpy="import mixpy",["mixpy.format_content("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+", mqtt_client.client_id)",e.ORDER_ATOMIC]},Cf=function(t,e){return e.definitions_.import_mixpy="import mixpy",["mixpy.format_str("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Lf=function(t,e){e.definitions_.import_mixiot="import mixiot";var n=e.valueToCode(this,"SERVER",e.ORDER_ATOMIC),i=e.valueToCode(this,"KEY",e.ORDER_ATOMIC),s=Math.round(new Date).toString(),o="f'python-mqtt-"+i.replace("'","").replace("'","")+s.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO.from_mixly_key("+n+", 1883 ,"+i+", "+o+")\n"},yf=function(t,e){return[this.getFieldValue("VISITOR_ID"),e.ORDER_ATOMIC]},Df=function(t,e){return["'"+this.getFieldValue("VISITOR_ID")+"'",e.ORDER_ATOMIC]},Nf=function(t,e){e.definitions_.import_mixiot="import mixiot";var n=e.valueToCode(this,"SERVER",e.ORDER_ATOMIC),i=e.valueToCode(this,"KEY",e.ORDER_ATOMIC),s=Math.round(new Date).toString(),o="f'python-mqtt-"+i.replace("'","").replace("'","")+s.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO.from_share_key("+n+", 1883 ,"+i+", "+o+")\n"},bf=function(t,e){e.definitions_.import_mixiot="import mixiot";return["mqtt_client.pingSync()",e.ORDER_ATOMIC]},vf=function(t,e){return e.definitions_.import_mixiot="import mixiot",["mixiot.ntp("+e.valueToCode(this,"addr",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},wf=function(t,e){return[this.getFieldValue("PIN"),e.ORDER_ATOMIC]},Ff=wf,Pf=wf,kf=wf,Vf=wf,Yf=function(t,e){e.definitions_.import_serial="import serial";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0",i=e.variableDB_.getName(this.getFieldValue("SER"),ot.Variables.NAME_TYPE),s=this.getFieldValue("BPS");return i+' = serial.Serial("'+rt.JSFuncs.getCom()+'", '+s+", timeout="+n+")\n"},xf=function(t,e){return e.definitions_.import_serial="import serial",(e.valueToCode(this,"SER",e.ORDER_ADDITIVE)||"ser")+".write("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+")\n"},Uf=function(t,e){return e.definitions_.import_serial="import serial",[(e.valueToCode(this,"SER",e.ORDER_ADDITIVE)||"ser")+".read("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Bf=function(t,e){return e.definitions_.import_serial="import serial",(e.valueToCode(this,"SER",e.ORDER_ADDITIVE)||"ser")+".close()\n"},Xf=function(t,e){var n=e.valueToCode(this,"n_samples",e.ORDER_ATOMIC)||"100",i=e.valueToCode(this,"n_features",e.ORDER_ATOMIC)||"20",s=e.valueToCode(this,"n_informative",e.ORDER_ATOMIC)||"2",o=e.valueToCode(this,"n_redundant",e.ORDER_ATOMIC)||"2",r=e.valueToCode(this,"n_repeated",e.ORDER_ATOMIC)||"0",a=e.valueToCode(this,"n_classes",e.ORDER_ATOMIC)||"2",l=e.valueToCode(this,"n_clusters_per_class",e.ORDER_ATOMIC)||"2",u=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_make_classification="from sklearn.datasets import make_classification",["make_classification(n_samples="+n+",n_features="+i+",n_informative="+s+",n_redundant="+o+",n_repeated="+r+",n_classes="+a+",n_clusters_per_class="+l+",random_state="+u+")",e.ORDER_ATOMIC]},Gf=function(t,e){var n=e.valueToCode(this,"n_samples",e.ORDER_ATOMIC)||"100",i=e.valueToCode(this,"n_features",e.ORDER_ATOMIC)||"100",s=e.valueToCode(this,"n_informative",e.ORDER_ATOMIC)||"10",o=e.valueToCode(this,"n_targets",e.ORDER_ATOMIC)||"1",r=e.valueToCode(this,"bias",e.ORDER_ATOMIC)||"0.0",a=e.valueToCode(this,"noise",e.ORDER_ATOMIC)||"0.0",l=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_make_regression="from sklearn.datasets import make_regression",["make_regression(n_samples="+n+",n_features="+i+",n_informative="+s+",n_targets="+o+",bias="+r+",noise="+a+",random_state="+l+")",e.ORDER_ATOMIC]},Hf=function(t,e){var n=e.valueToCode(this,"n_samples",e.ORDER_ATOMIC)||"100",i=e.valueToCode(this,"n_features",e.ORDER_ATOMIC)||"2",s=e.valueToCode(this,"centers",e.ORDER_ATOMIC)||"None",o=e.valueToCode(this,"cluster_std",e.ORDER_ATOMIC)||"1.0",r=e.valueToCode(this,"center_box",e.ORDER_ATOMIC)||"(-10.0,10.0)",a=e.valueToCode(this,"shuffle",e.ORDER_ATOMIC)||"True",l=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_make_blobs="from sklearn.datasets import make_blobs",["make_blobs(n_samples="+n+",n_features="+i+",centers="+s+",cluster_std="+o+",center_box="+r+",shuffle="+a+",random_state="+l+")",e.ORDER_ATOMIC]},Wf=function(t,e){var n=this.getFieldValue("type"),i=this.getFieldValue("name");return e.definitions_.import_sklearn_datasets="from sklearn import datasets",i+" = datasets."+n+"()\n"},Kf=function(t,e){return[(e.valueToCode(this,"name",e.ORDER_ATOMIC)||"iris")+"."+this.getFieldValue("type"),e.ORDER_ATOMIC]},jf=function(t,e){var n=e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"iris_X",i=e.valueToCode(this,"train_target",e.ORDER_ATOMIC)||"iris_y",s=e.valueToCode(this,"test_size",e.ORDER_ATOMIC)||"0.3",o=e.valueToCode(this,"rondom_state",e.ORDER_ATOMIC)||"None";if(e.definitions_.import_sklearn_train_test_split="from sklearn.model_selection import train_test_split","None"==i)var r="train_test_split("+n+",test_size = "+s+",random_state = "+o+")";else r="train_test_split("+n+","+i+",test_size = "+s+",random_state = "+o+")";return[r,e.ORDER_ATOMIC]},qf=function(t,e){var n=e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"iris_X",i=e.valueToCode(this,"test_size",e.ORDER_ATOMIC)||"0.3",s=e.valueToCode(this,"rondom_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_train_test_split="from sklearn.model_selection import train_test_split",["train_test_split("+n+",test_size = "+i+",random_state = "+s+")",e.ORDER_ATOMIC]},$f=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",i=e.valueToCode(this,"fit_intercept",e.ORDER_ATOMIC)||"True",s=e.valueToCode(this,"normalize",e.ORDER_ATOMIC)||"False",o=e.valueToCode(this,"n_jobs",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_linear_model="from sklearn.linear_model import LinearRegression",n+" = LinearRegression(fit_intercept = "+i+",normalize = "+s+",n_jobs = "+o+")\n"},zf=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",i=e.valueToCode(this,"alpha",e.ORDER_ATOMIC)||"1.0",s=e.valueToCode(this,"fit_intercept",e.ORDER_ATOMIC)||"True",o=e.valueToCode(this,"normalize",e.ORDER_ATOMIC)||"False",r=e.valueToCode(this,"max_iter",e.ORDER_ATOMIC)||"300",a=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_linear_model="from sklearn.linear_model import Ridge",n+" = Ridge(alpha = "+i+",fit_intercept = "+s+",normalize = "+o+",max_iter = "+r+",random_state = "+a+")\n"},Qf=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",i=this.getFieldValue("type"),s=e.valueToCode(this,"max_depth",e.ORDER_ATOMIC)||"None",o=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_["import_sklearn_"+i]="from sklearn.tree import "+i,n+" = "+i+"(max_depth = "+s+",random_state = "+o+")\n"},Jf=function(t,e){var n=this.getFieldValue("type"),i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"Model",s=e.valueToCode(this,"n_estimators",e.ORDER_ATOMIC)||"100",o=e.valueToCode(this,"max_depth",e.ORDER_ATOMIC)||"None",r=e.valueToCode(this,"n_jobs",e.ORDER_ATOMIC)||"None",a=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_["import_sklearn_"+n]="from sklearn.ensemble import "+n,i+" = "+n+"(n_estimators = "+s+",max_depth = "+o+",n_jobs = "+r+",random_state = "+a+")\n"},Zf=function(t,e){var n=this.getFieldValue("type"),i=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",s=e.valueToCode(this,"K",e.ORDER_ATOMIC)||"5",o=e.valueToCode(this,"n_jobs",e.ORDER_ATOMIC)||"None";return e.definitions_["import_sklearn_"+n]="from sklearn.neighbors import "+n,i+" = "+n+"(n_neighbors = "+s+",n_jobs = "+o+")\n"},tg=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model";return e.definitions_.import_sklearn_GaussianNB="from sklearn.naive_bayes import GaussianNB",n+" = GaussianNB()\n"},eg=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"pca",i=e.valueToCode(this,"n_components",e.ORDER_ATOMIC)||"2";return e.definitions_.import_sklearn_pca="from sklearn.decomposition import PCA",n+" = PCA(n_components="+i+")\n"},ng=function(t,e){return[e.valueToCode(t,"model_name",e.ORDER_ATOMIC)+".fit_transform("+e.valueToCode(t,"train_data",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ig=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",i=e.valueToCode(this,"n_clusters",e.ORDER_ATOMIC)||"8",s=e.valueToCode(this,"max_iter",e.ORDER_ATOMIC)||"300",o=e.valueToCode(this,"random_state",e.ORDER_ATOMIC)||"None";return e.definitions_.import_sklearn_KMeans="from sklearn.cluster import KMeans",n+" = KMeans(n_clusters = "+i+",max_iter = "+s+",random_state = "+o+")\n"},sg=function(t,e){return e.valueToCode(t,"model_name",e.ORDER_ATOMIC)+".fit("+e.valueToCode(t,"train_data",e.ORDER_ATOMIC)+")\n"},og=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",i=e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_train",s=e.valueToCode(this,"train_target",e.ORDER_ATOMIC)||"y_train";if("None"==s)var o=n+".fit("+i+")\n";else o=n+".fit("+i+","+s+")\n";return o},rg=function(t,e){return(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+".fit("+(e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_train")+")\n"},ag=function(t,e){return[(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+".predict("+(e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_test")+")",e.ORDER_ATOMIC]},lg=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",i=e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_train",s=e.valueToCode(this,"train_target",e.ORDER_ATOMIC)||"y_train";if("None"==s)var o=n+".score("+i+")";else o=n+".score("+i+","+s+")";return[o,e.ORDER_ATOMIC]},ug=function(t,e){return[(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+".score("+(e.valueToCode(this,"train_data",e.ORDER_ATOMIC)||"X_train")+")",e.ORDER_ATOMIC]},pg=function(t,e){return[(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+"."+this.getFieldValue("type"),e.ORDER_ATOMIC]},_g=function(t,e){return[(e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model")+"."+this.getFieldValue("type"),e.ORDER_ATOMIC]},dg=function(t,e){var n=e.valueToCode(this,"model_name",e.ORDER_ATOMIC)||"model",i=this.getFieldValue("type"),s=e.valueToCode(this,"address",e.ORDER_ATOMIC)||"D:/mixly/test.pkl";e.definitions_.import_sklearn_joblib="import joblib";return"dump"==i?"joblib.dump("+n+","+s+")\n":n+" = joblib.load("+s+")\n"},hg=function(t,e){e.definitions_.import_time="import time";return["time.time()",e.ORDER_ATOMIC]},cg=function(){return"exit()\n"},Tg=function(t,e){e.definitions_.import_time="import time";var n=this.getFieldValue("op"),i="time.localtime()["+n+"]";if("all"===n){return["time.localtime()",e.ORDER_ASSIGNMENT]}return[i,e.ORDER_ASSIGNMENT]},Ig=function(t,e){return e.definitions_.import_turtle="import turtle",e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = turtle.Turtle()\n"},mg=function(t,e){e.definitions_.import_turtle="import turtle";return"turtle.done()\n"},Eg=function(t,e){e.definitions_.import_turtle="import turtle";return"turtle.exitonclick()\n"},fg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},gg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Og=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".setheading("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},Mg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".screen.delay("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},Rg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".goto("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+","+(e.valueToCode(this,"val",e.ORDER_ASSIGNMENT)||"0")+")\n"},Ag=function(t,e){return e.definitions_.import_turtle="import turtle",[(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()",e.ORDER_ATOMIC]},Sg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},Cg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},Lg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"_fill()\n"},yg=function(t,e){return e.definitions_.import_turtle="import turtle",this.getFieldValue("TUR")+"."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Dg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".pensize("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},Ng=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".speed("+(e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0")+")\n"},bg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},vg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".set"+this.getFieldValue("DIR")+"("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},wg=function(t,e){e.definitions_.import_turtle="import turtle";var n=e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"data",e.ORDER_ASSIGNMENT)||"0";return n+".circle ("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+i+")\n"},Fg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},Pg=function(t,e){return e.definitions_.import_turtle="import turtle",'turtle.bgcolor("'+this.getFieldValue("FIELDNAME")+'")\n'},kg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+'.pencolor("'+this.getFieldValue("FIELDNAME")+'")\n'},Vg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+'.fillcolor("'+this.getFieldValue("FIELDNAME")+'")\n'},Yg=function(t,e){return e.definitions_.import_turtle="import turtle",[(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".clone()",e.ORDER_ATOMIC]},xg=function(t,e){return e.definitions_.import_turtle="import turtle","turtle.bgcolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Ug=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".pencolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Bg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".fillcolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Xg=function(t,e){return e.definitions_.import_turtle="import turtle","turtle.bgcolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Gg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".pencolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Hg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".fillcolor("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Wg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".color("+e.valueToCode(this,"VAR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"VAR2",e.ORDER_ATOMIC)+")\n"},Kg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+'.color("'+this.getFieldValue("FIELDNAME")+'","'+this.getFieldValue("FIELDNAME2")+'")\n'},jg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".shape('"+this.getFieldValue("DIR")+"')\n"},qg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".shapesize("+(e.valueToCode(this,"WID",e.ORDER_ASSIGNMENT)||"0")+","+(e.valueToCode(this,"LEN",e.ORDER_ASSIGNMENT)||"0")+","+(e.valueToCode(this,"OUTLINE",e.ORDER_ASSIGNMENT)||"0")+")\n"},$g=function(t,e){return e.definitions_.import_turtle="import turtle",["turtle.textinput("+e.valueToCode(this,"TITLE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PROMPT",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},zg=function(t,e){return e.definitions_.import_turtle="import turtle",["turtle.numinput("+e.valueToCode(this,"TITLE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PROMPT",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DEFAULT",e.ORDER_ATOMIC)+",minval = "+e.valueToCode(this,"MIN",e.ORDER_ATOMIC)+",maxval = "+e.valueToCode(this,"MAX",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Qg=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".write("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+")\n"},Jg=function(t,e){e.definitions_.import_turtle="import turtle";var n=this.getFieldValue("MOVE"),i=this.getFieldValue("ALIGN"),s=e.valueToCode(this,"FONTNAME",e.ORDER_ATOMIC),o=e.valueToCode(this,"FONTNUM",e.ORDER_ASSIGNMENT)||"0",r=this.getFieldValue("FONTTYPE");return(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".write("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+n+',align="'+i+'",font=('+s+","+o+',"'+r+'"))\n'},Zg=function(t,e){e.definitions_.import_turtle="import turtle";var n=this.getFieldValue("MOVE"),i=this.getFieldValue("ALIGN"),s=e.valueToCode(this,"FONTNAME",e.ORDER_ATOMIC),o=e.valueToCode(this,"FONTNUM",e.ORDER_ASSIGNMENT)||"0",r=this.getFieldValue("FONTTYPE");return(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".write("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+n+',align="'+i+'",font=('+s+","+o+',"'+r+'"))\n'},tO=function(t,e){return['"'+this.getFieldValue("COLOR")+'"',e.ORDER_ATOMIC]},eO=function(t,e){e.definitions_.import_turtle="import turtle";var n=e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0";return e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE)+" = "+n+".getscreen()\n"},nO=function(t,e){e.definitions_.import_turtle="import turtle";var n=e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"VAR",e.ORDER_NONE)||"None";return n+".onkey("+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+", "+i+")\n"},iO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".onclick("+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+")\n"},sO=function(t,e){e.definitions_.import_turtle="import turtle";var n=e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0",i=e.valueToCode(this,"VAR",e.ORDER_NONE)||"None";return n+".ontimer("+(e.valueToCode(this,"callback",e.ORDER_NONE)||"None")+", "+i+")\n"},oO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".listen()\n"},rO=function(t,e){return e.definitions_.import_turtle="import turtle",(e.valueToCode(this,"TUR",e.ORDER_ASSIGNMENT)||"0")+".getcanvas().postscript(file="+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"};var aO=__webpack_require__(6944);const lO=$;var uO=__webpack_require__.n(lO),pO=__webpack_require__(9610);class _O{constructor(t,e){this._pageLoad=new pO.D,this._kernelAvailable=new pO.D,this._loaderId="basthon-loader",this._doNotHideLoader=!0;const n=t.language;if(null!=e&&(this._loaderId=e),"loading"===document.readyState){const t=()=>{document.removeEventListener("DOMContentLoaded",t),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",t)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:e}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,211));this._kernel=new e(t);break;case"python3-old":case"python3.8":const{KernelPython3Old:i}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new i(t);break;case"js":case"javascript":const{KernelJavaScript:s}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new s(t);break;case"sql":const{KernelSQL:o}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new o(t);break;case"ocaml":const{KernelOCaml:r}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new r(t);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const t=await this.kernelAvailable();return await t.loaded(),t}get kernel(){return this._kernel}get kernelSafe(){var t;return(null===(t=this.kernel)||void 0===t?void 0:t.ready)?this.kernel:null}async showLoader(t,e=!1,n=!0){this.kernelAvailable().then((()=>{var t;return null===(t=this.kernel)||void 0===t?void 0:t.init()})),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const i="basthon-loader-"+(e?"full":"foot"),s=document.createElement("div");s.id=this._loaderId,s.classList.add("darklighted"),s.classList.add("basthon-loader-root"),s.classList.add(i);const o=document.createElement("div");o.classList.add("basthon-loader-container"),o.classList.add(i),s.appendChild(o);const r=document.createElement("div");r.classList.add("basthon-loader-spinner"),r.classList.add(i),r.innerHTML="<span><span></span><span></span></span>",o.appendChild(r);const a=document.createElement("div");a.classList.add("basthon-loader-break"),a.classList.add(i),o.appendChild(a);const l=document.createElement("div");l.classList.add("basthon-loader-text"),l.classList.add(i),l.innerHTML=t,o.appendChild(l),this._loaderTextElem=l;const u=document.createElement("div");u.classList.add("basthon-loader-text"),u.classList.add(i),u.style.display="none",o.appendChild(u),this._loaderTextError=u,await this.pageLoad(),document.body.appendChild(s),this._rootLoader=s;try{await this.kernelLoaded()}catch(t){const e=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!<br>Vérifiez que votre navigateur est à jour.<br>Version détectée : ${e.name} ${e.version}.`);for(const t of document.body.querySelectorAll(".basthon-loader-foot"))t.classList.remove("basthon-loader-foot"),t.classList.add("basthon-loader-full");return r.classList.remove("basthon-loader-spinner"),r.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(t){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=t)}setErrorText(t){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=t)}hideLoader(){if(this._doNotHideLoader)return;const t=this._rootLoader;null!=t&&(t.classList.add("basthon-loader-hide"),window.setTimeout((()=>{this._rootLoader=void 0,t.remove()}),1100))}browser(){var t,e=navigator.userAgent,n=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(t=/\brv[ :]+(\d+)/g.exec(e)||[])[1]||""}:"Chrome"===n[1]&&null!=(t=e.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:t[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=e.match(/version\/(\d+)/i))&&n.splice(1,1,t[1]),{name:n[0],version:n[1]})}}class dO extends rt.PageBase{static{rt.HTMLTemplate.add("html/statusbar/statusbar-image.html",new rt.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] {\r\n background-color: #ffffff;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] {\r\n background-color: #1e1e1e;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item"></div>')),this.init=function(){rt.StatusBarsManager.typesRegistry.register(["images"],dO);const t=rt.Workspace.getMain().getStatusBarsManager();return t.add("images","images",ot.Msg.PYTHON_PYODIDE_IMAGE),t.changeTo("output"),t.get("images")}}constructor(){super();const t=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(t)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(t){const e=this.getContent(),n=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let i=t.content,s=null,o=null;switch(t.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver((function(t){t.forEach((t=>t.addedNodes.forEach((t=>{const e=t;null!=e.tagName&&["canvas","video"].includes(e.tagName.toLowerCase())&&n(e)}))))})).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),e.append(i);break;case"matplotlib":s=i.querySelector("canvas"),s&&(i=s),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),e.append(i.outerHTML);break;case"sympy":e.append(t.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let t=document.createElement("script");t.type="text/javascript",t.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(t)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in t.content){let i=t.content[n];"image/png"===n&&(i='<img src="data:image/png;base64,'+i+'" style="max-width: 100%; max-height: 100%;">'),e.append(i);break}break;case"tutor":if(e.append(uO()(t.content.replace("overflow-y%3A%20hidden%3B",""))),o=this.getContent()[0].getElementsByTagName("iframe")[0],null==o)return;o.style.maxHeight=o.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const n=t[0];n&&!n.isIntersecting||(o.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(o);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const hO=layui;var cO;!function(t){t[t.EPERM=1]="EPERM",t[t.ENOENT=2]="ENOENT",t[t.EINTR=4]="EINTR",t[t.EIO=5]="EIO",t[t.ENXIO=6]="ENXIO",t[t.EBADF=9]="EBADF",t[t.EAGAIN=11]="EAGAIN",t[t.ENOMEM=12]="ENOMEM",t[t.EACCES=13]="EACCES",t[t.EFAULT=14]="EFAULT",t[t.ENOTBLK=15]="ENOTBLK",t[t.EBUSY=16]="EBUSY",t[t.EEXIST=17]="EEXIST",t[t.EXDEV=18]="EXDEV",t[t.ENODEV=19]="ENODEV",t[t.ENOTDIR=20]="ENOTDIR",t[t.EISDIR=21]="EISDIR",t[t.EINVAL=22]="EINVAL",t[t.ENFILE=23]="ENFILE",t[t.EMFILE=24]="EMFILE",t[t.ETXTBSY=26]="ETXTBSY",t[t.EFBIG=27]="EFBIG",t[t.ENOSPC=28]="ENOSPC",t[t.ESPIPE=29]="ESPIPE",t[t.EROFS=30]="EROFS",t[t.EMLINK=31]="EMLINK",t[t.EPIPE=32]="EPIPE",t[t.EDOM=33]="EDOM",t[t.ERANGE=34]="ERANGE",t[t.EDEADLK=35]="EDEADLK",t[t.ENAMETOOLONG=36]="ENAMETOOLONG",t[t.ENOLCK=37]="ENOLCK",t[t.ENOSYS=38]="ENOSYS",t[t.ENOTEMPTY=39]="ENOTEMPTY",t[t.ELOOP=40]="ELOOP",t[t.ENOMSG=42]="ENOMSG",t[t.EBADE=52]="EBADE",t[t.EBADR=53]="EBADR",t[t.EXFULL=54]="EXFULL",t[t.ENOANO=55]="ENOANO",t[t.EBADRQC=56]="EBADRQC",t[t.ENOSTR=60]="ENOSTR",t[t.ENODATA=61]="ENODATA",t[t.ETIME=62]="ETIME",t[t.ENOSR=63]="ENOSR",t[t.ENONET=64]="ENONET",t[t.EREMOTE=66]="EREMOTE",t[t.ENOLINK=67]="ENOLINK",t[t.ECOMM=70]="ECOMM",t[t.EPROTO=71]="EPROTO",t[t.EBADMSG=74]="EBADMSG",t[t.EOVERFLOW=75]="EOVERFLOW",t[t.EBADFD=77]="EBADFD",t[t.ESTRPIPE=86]="ESTRPIPE",t[t.ENOTSOCK=88]="ENOTSOCK",t[t.EDESTADDRREQ=89]="EDESTADDRREQ",t[t.EMSGSIZE=90]="EMSGSIZE",t[t.EPROTOTYPE=91]="EPROTOTYPE",t[t.ENOPROTOOPT=92]="ENOPROTOOPT",t[t.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",t[t.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",t[t.ENOTSUP=95]="ENOTSUP",t[t.ENETDOWN=100]="ENETDOWN",t[t.ENETUNREACH=101]="ENETUNREACH",t[t.ENETRESET=102]="ENETRESET",t[t.ETIMEDOUT=110]="ETIMEDOUT",t[t.ECONNREFUSED=111]="ECONNREFUSED",t[t.EHOSTDOWN=112]="EHOSTDOWN",t[t.EHOSTUNREACH=113]="EHOSTUNREACH",t[t.EALREADY=114]="EALREADY",t[t.EINPROGRESS=115]="EINPROGRESS",t[t.ESTALE=116]="ESTALE",t[t.EREMOTEIO=121]="EREMOTEIO",t[t.EDQUOT=122]="EDQUOT"}(cO||(cO={}));const TO={[cO.EPERM]:"Operation not permitted",[cO.ENOENT]:"No such file or directory",[cO.EINTR]:"Interrupted system call",[cO.EIO]:"Input/output error",[cO.ENXIO]:"No such device or address",[cO.EBADF]:"Bad file descriptor",[cO.EAGAIN]:"Resource temporarily unavailable",[cO.ENOMEM]:"Cannot allocate memory",[cO.EACCES]:"Permission denied",[cO.EFAULT]:"Bad address",[cO.ENOTBLK]:"Block device required",[cO.EBUSY]:"Resource busy or locked",[cO.EEXIST]:"File exists",[cO.EXDEV]:"Invalid cross-device link",[cO.ENODEV]:"No such device",[cO.ENOTDIR]:"File is not a directory",[cO.EISDIR]:"File is a directory",[cO.EINVAL]:"Invalid argument",[cO.ENFILE]:"Too many open files in system",[cO.EMFILE]:"Too many open files",[cO.ETXTBSY]:"Text file busy",[cO.EFBIG]:"File is too big",[cO.ENOSPC]:"No space left on disk",[cO.ESPIPE]:"Illegal seek",[cO.EROFS]:"Cannot modify a read-only file system",[cO.EMLINK]:"Too many links",[cO.EPIPE]:"Broken pipe",[cO.EDOM]:"Numerical argument out of domain",[cO.ERANGE]:"Numerical result out of range",[cO.EDEADLK]:"Resource deadlock would occur",[cO.ENAMETOOLONG]:"File name too long",[cO.ENOLCK]:"No locks available",[cO.ENOSYS]:"Function not implemented",[cO.ENOTEMPTY]:"Directory is not empty",[cO.ELOOP]:"Too many levels of symbolic links",[cO.ENOMSG]:"No message of desired type",[cO.EBADE]:"Invalid exchange",[cO.EBADR]:"Invalid request descriptor",[cO.EXFULL]:"Exchange full",[cO.ENOANO]:"No anode",[cO.EBADRQC]:"Invalid request code",[cO.ENOSTR]:"Device not a stream",[cO.ENODATA]:"No data available",[cO.ETIME]:"Timer expired",[cO.ENOSR]:"Out of streams resources",[cO.ENONET]:"Machine is not on the network",[cO.EREMOTE]:"Object is remote",[cO.ENOLINK]:"Link has been severed",[cO.ECOMM]:"Communication error on send",[cO.EPROTO]:"Protocol error",[cO.EBADMSG]:"Bad message",[cO.EOVERFLOW]:"Value too large for defined data type",[cO.EBADFD]:"File descriptor in bad state",[cO.ESTRPIPE]:"Streams pipe error",[cO.ENOTSOCK]:"Socket operation on non-socket",[cO.EDESTADDRREQ]:"Destination address required",[cO.EMSGSIZE]:"Message too long",[cO.EPROTOTYPE]:"Protocol wrong type for socket",[cO.ENOPROTOOPT]:"Protocol not available",[cO.EPROTONOSUPPORT]:"Protocol not supported",[cO.ESOCKTNOSUPPORT]:"Socket type not supported",[cO.ENOTSUP]:"Operation is not supported",[cO.ENETDOWN]:"Network is down",[cO.ENETUNREACH]:"Network is unreachable",[cO.ENETRESET]:"Network dropped connection on reset",[cO.ETIMEDOUT]:"Connection timed out",[cO.ECONNREFUSED]:"Connection refused",[cO.EHOSTDOWN]:"Host is down",[cO.EHOSTUNREACH]:"No route to host",[cO.EALREADY]:"Operation already in progress",[cO.EINPROGRESS]:"Operation now in progress",[cO.ESTALE]:"Stale file handle",[cO.EREMOTEIO]:"Remote I/O error",[cO.EDQUOT]:"Disk quota exceeded"};class IO extends Error{static fromJSON(t){const e=new IO(t.errno,t.message,t.path,t.syscall);return e.code=t.code,e.stack=t.stack,e}static With(t,e,n){return new IO(cO[t],TO[cO[t]],e,n)}constructor(t,e=TO[t],n,i=""){super(e),this.errno=t,this.path=n,this.syscall=i,this.code=cO[t],this.message=this.code+": "+e+(this.path?`, '${this.path}'`:"")}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}}let mO="/";function EO(t,e){let n="",i=0,s=-1,o=0,r="\0";for(let a=0;a<=t.length;++a){if(a<t.length)r=t[a];else{if("/"==r)break;r="/"}if("/"==r){if(s===a-1||1===o);else if(2===o){if(n.length<2||2!==i||"."!==n.at(-1)||"."!==n.at(-2)){if(n.length>2){const t=n.lastIndexOf("/");-1===t?(n="",i=0):(n=n.slice(0,t),i=n.length-1-n.lastIndexOf("/")),s=a,o=0;continue}if(0!==n.length){n="",i=0,s=a,o=0;continue}}e&&(n+=n.length>0?"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),i=a-s-1;s=a,o=0}else"."===r&&-1!==o?++o:o=-1}return n}function fO(...t){let e="";for(const n of[...t.reverse(),mO])if(n.length&&(e=`${n}/${e}`,n.startsWith("/")))break;const n=e.startsWith("/");return e=EO(e,!n),n?`/${e}`:e.length?e:"/"}function gO(...t){if(!t.length)return".";const e=t.join("/");return e?.length?function(t){if(!t.length)return".";const e=t.startsWith("/"),n=t.endsWith("/");return(t=EO(t,!e)).length?(n&&(t+="/"),e?`/${t}`:t):e?"/":n?"./":"."}(e):"."}function OO(t){if(0===t.length)return".";const e="/"===t[0];let n=-1,i=!0;for(let e=t.length-1;e>=1;--e)if("/"===t[e]){if(!i){n=e;break}}else i=!1;return-1===n?e?"/":".":e&&1===n?"//":t.slice(0,n)}function MO(t,e){let n=0,i=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,r=-1;for(let a=t.length-1;a>=0;--a)if("/"===t[a]){if(!s){n=a+1;break}}else-1===r&&(s=!1,r=a+1),o>=0&&(t[a]===e[o]?-1==--o&&(i=a):(o=-1,i=r));return n===i?i=r:-1===i&&(i=t.length),t.slice(n,i)}for(let e=t.length-1;e>=0;--e)if("/"===t[e]){if(!s){n=e+1;break}}else-1===i&&(s=!1,i=e+1);return-1===i?"":t.slice(n,i)}function RO(t){const e=t.startsWith("/"),n={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(0===t.length)return n;const i=e?1:0;let s=-1,o=0,r=-1,a=!0,l=t.length-1,u=0;for(;l>=i;--l)if("/"!==t[l])-1===r&&(a=!1,r=l+1),"."===t[l]?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!a){o=l+1;break}if(-1!==r){const i=0===o&&e?1:o;-1===s||0===u||1===u&&s===r-1&&s===o+1?n.base=n.name=t.slice(i,r):(n.name=t.slice(i,s),n.base=t.slice(i,r),n.ext=t.slice(s,r))}return o>0?n.dir=t.slice(0,o-1):e&&(n.dir="/"),n}const AO=new TextEncoder;function SO(t){if("string"!=typeof t)throw new IO(cO.EINVAL,"Can not encode a non-string");return AO.encode(t)}const CO=new TextDecoder;function LO(t){if(!(t instanceof Uint8Array))throw new IO(cO.EINVAL,"Can not decode a non-Uint8Array");return CO.decode(t)}function yO(t){return JSON.parse(LO(t),((t,e)=>""==t?e:BigInt(e)))}function DO(t){return SO(JSON.stringify(t,((t,e)=>""==t?e:e.toString())))}function NO(t,e){if("number"==typeof t)return t;if("string"==typeof t){const e=parseInt(t,8);if(!isNaN(e))return e}if("number"==typeof e)return e;throw new IO(cO.EINVAL,"Invalid mode: "+t?.toString())}function bO(t){if(t instanceof Date)return t;try{return new Date(t)}catch{throw new IO(cO.EINVAL,"Invalid time.")}}function vO(t){if((t=t.toString()).includes("\0"))throw new IO(cO.EINVAL,"Path can not contain null character");if(0==t.length)throw new IO(cO.EINVAL,"Path can not be empty");return fO(t.replaceAll(/[/\\]+/g,"/"))}function wO(t,e="utf8",n,i=0){return"object"!=typeof t||null===t?{encoding:"string"==typeof t?t:e??null,flag:n,mode:i}:{encoding:"string"==typeof t?.encoding?t.encoding:e??null,flag:"string"==typeof t?.flag?t.flag:n,mode:NO("mode"in t?t?.mode:null,i)}}function FO(){return crypto.getRandomValues(new BigUint64Array(1))[0]}const PO={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0,groups:[]};function kO(t){return{suid:t.uid,sgid:t.gid,euid:t.uid,egid:t.gid,groups:[],...t}}const VO=0,YO=4,xO=2,UO=1,BO=1,XO=2,GO=4,HO=0,WO=1,KO=2,jO=64,qO=128,$O=256,zO=512,QO=1024,JO=65536,ZO=262144,tM=131072,eM=1052672,nM=4096,iM=32768,sM=16384,oM=2048,rM=61440,aM=49152,lM=40960,uM=32768,pM=24576,_M=16384,dM=8192,hM=4096,cM=2048,TM=1024,IM=512,mM=448,EM=256,fM=128,gM=64,OM=56,MM=32,RM=16,AM=8,SM=7,CM=4,LM=2,yM=1,DM=0,NM=2**32-1,bM={checkAccess:!0,updateOnRead:!0,syncImmediately:!0,unsafeBufferReplace:!1};Promise.withResolvers??(Promise.withResolvers=function(){let t,e;const n=new Promise(((n,i)=>{t=n,e=i}));return{promise:n,resolve:t,reject:e}}),Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));class vM{_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}constructor({atimeMs:t,mtimeMs:e,ctimeMs:n,birthtimeMs:i,uid:s,gid:o,size:r,mode:a,ino:l}={}){this.dev=this._convert(0),this.ino=this._convert(0),this.rdev=this._convert(0),this.nlink=this._convert(1),this.blksize=this._convert(4096),this.uid=this._convert(0),this.gid=this._convert(0);const u=Date.now();this.atimeMs=this._convert(t??u),this.mtimeMs=this._convert(e??u),this.ctimeMs=this._convert(n??u),this.birthtimeMs=this._convert(i??u),this.uid=this._convert(s??0),this.gid=this._convert(o??0),this.size=this._convert(r??0),this.ino=this._convert(l??0),this.mode=this._convert(a??420&uM),this.mode&rM||(this.mode=this.mode|this._convert(uM))}isFile(){return(this.mode&rM)===uM}isDirectory(){return(this.mode&rM)===_M}isSymbolicLink(){return(this.mode&rM)===lM}isSocket(){return(this.mode&rM)===aM}isBlockDevice(){return(this.mode&rM)===pM}isCharacterDevice(){return(this.mode&rM)===dM}isFIFO(){return(this.mode&rM)===hM}hasAccess(t,e){const n=e?.credentials||PO;if(this.isSymbolicLink()||0===n.euid||0===n.egid)return!0;let i=0;return n.uid===this.uid&&(this.mode&EM&&(i|=YO),this.mode&fM&&(i|=xO),this.mode&gM&&(i|=UO)),(n.gid===this.gid||n.groups.includes(Number(this.gid)))&&(this.mode&MM&&(i|=YO),this.mode&RM&&(i|=xO),this.mode&AM&&(i|=UO)),this.mode&CM&&(i|=YO),this.mode&LM&&(i|=xO),this.mode&yM&&(i|=UO),(i&t)===t}chmod(t){this.mode=this._convert(this.mode&rM|t)}chown(t,e){t=Number(t),e=Number(e),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(e)&&0<=e&&e<2**32&&(this.gid=this._convert(e))}get atimeNs(){return 1000n*BigInt(this.atimeMs)}get mtimeNs(){return 1000n*BigInt(this.mtimeMs)}get ctimeNs(){return 1000n*BigInt(this.ctimeMs)}get birthtimeNs(){return 1000n*BigInt(this.birthtimeMs)}}function wM(t,e,n){!isNaN(e)&&0<=e&&e<2**32&&(t.uid=e),!isNaN(n)&&0<=n&&n<2**32&&(t.gid=n)}class FM extends vM{constructor(){super(...arguments),this._isBigint=!1}}class PM extends vM{constructor(){super(...arguments),this._isBigint=!0}}class kM{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=NM,this.ffree=NM}}class VM{constructor(){this.type=0x7a656e6673n,this.bsize=4096n,this.blocks=0n,this.bfree=0n,this.bavail=0n,this.files=BigInt(NM),this.ffree=BigInt(NM)}}const YM=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function xM(t){if("number"==typeof t)return function(t){switch(t){case HO:return"r";case HO|eM:return"rs";case KO:return"r+";case KO|eM:return"rs+";case zO|jO|WO:return"w";case zO|jO|WO|qO:return"wx";case zO|jO|KO:return"w+";case zO|jO|KO|qO:return"wx+";case QO|jO|WO:return"a";case QO|jO|WO|qO:return"ax";case QO|jO|KO:return"a+";case QO|jO|KO|qO:return"ax+";default:throw new Error("Invalid flag number: "+t)}}(t);if(!YM.includes(t))throw new Error("Invalid flag string: "+t);return t}function UM(t){let e=0;return e<<=1,e+=+BM(t),e<<=1,e+=+XM(t),e<<=1,e}function BM(t){return-1!==t.indexOf("r")||-1!==t.indexOf("+")}function XM(t){return-1!==t.indexOf("w")||-1!==t.indexOf("a")||-1!==t.indexOf("+")}function GM(t){return-1!==t.indexOf("w")}function HM(t){return-1!==t.indexOf("a")}function WM(t){return-1!==t.indexOf("x")}class KM{constructor(t,e){this.fs=t,this.path=e}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}}class jM extends KM{constructor(t,e,n,i,s=new Uint8Array(new ArrayBuffer(0,t.metadata().noResizableBuffers?{}:{maxByteLength:NM}))){if(super(t,e),this.flag=n,this.stats=i,this._buffer=s,this._position=0,this.dirty=!1,this.closed=!1,this.stats.size!=s.byteLength){if(BM(this.flag))throw new Error(`Size mismatch: buffer length ${s.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return HM(this.flag)?this.stats.size:this._position}set position(t){this._position=t}async sync(){if(this.closed)throw IO.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw IO.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(t){if(this.closed)throw IO.With("EBADF",this.path,"File.dispose");if(this.dirty&&!t)throw IO.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw IO.With("EBADF",this.path,"File.stat");return Promise.resolve(new FM(this.stats))}statSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.stat");return new FM(this.stats)}_truncate(t){if(this.closed)throw IO.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!XM(this.flag))throw new IO(cO.EPERM,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),t>this._buffer.length){const e=new Uint8Array(t-this._buffer.length);this._write(e,0,e.length,this._buffer.length)}else this.stats.size=t,this._buffer=t?this._buffer.slice(0,t):new Uint8Array}async truncate(t){this._truncate(t),bM.syncImmediately&&await this.sync()}truncateSync(t){this._truncate(t),bM.syncImmediately&&this.syncSync()}_write(t,e=0,n=this.stats.size,i=this.position){if(this.closed)throw IO.With("EBADF",this.path,"File.write");if(!XM(this.flag))throw new IO(cO.EPERM,"File not opened with a writeable mode.");this.dirty=!0;const s=i+n,o=t.slice(e,e+n);if(s>this.stats.size&&(this.stats.size=s,s>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=s)this._buffer.buffer.resize(s);else if(bM.unsafeBufferReplace)this._buffer=o;else{const t=new Uint8Array(new ArrayBuffer(s,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:NM}));t.set(this._buffer),this._buffer=t}return this._buffer.set(o,i),this.stats.mtimeMs=Date.now(),this.position=i+o.byteLength,o.byteLength}async write(t,e,n,i){const s=this._write(t,e,n,i);return bM.syncImmediately&&await this.sync(),s}writeSync(t,e=0,n=this.stats.size,i=this.position){const s=this._write(t,e,n,i);return bM.syncImmediately&&this.syncSync(),s}_read(t,e=0,n=this.stats.size,i){if(this.closed)throw IO.With("EBADF",this.path,"File.read");if(!BM(this.flag))throw new IO(cO.EPERM,"File not opened with a readable mode.");bM.updateOnRead&&(this.dirty=!0),this.stats.atimeMs=Date.now(),i??(i=this.position);let s=i+n;s>this.stats.size&&(s=i+Math.max(this.stats.size-i,0)),this._position=s;const o=s-i;return 0==o||new Uint8Array(t.buffer,e,n).set(this._buffer.slice(i,s)),o}async read(t,e,n,i){const s=this._read(t,e,n,i);return bM.syncImmediately&&await this.sync(),{bytesRead:s,buffer:t}}readSync(t,e,n,i){const s=this._read(t,e,n,i);return bM.syncImmediately&&this.syncSync(),s}async chmod(t){if(this.closed)throw IO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>rM?~rM:rM)|t,(bM.syncImmediately||t>rM)&&await this.sync()}chmodSync(t){if(this.closed)throw IO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>rM?~rM:rM)|t,(bM.syncImmediately||t>rM)&&this.syncSync()}async chown(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.chown");this.dirty=!0,wM(this.stats,t,e),bM.syncImmediately&&await this.sync()}chownSync(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.chown");this.dirty=!0,wM(this.stats,t,e),bM.syncImmediately&&this.syncSync()}async utimes(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,bM.syncImmediately&&await this.sync()}utimesSync(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,bM.syncImmediately&&this.syncSync()}}class qM{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:525687744115}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(t){return"ENOENT"!=t.code}}existsSync(t){try{return this.statSync(t),!0}catch(t){return"ENOENT"!=t.code}}}var $M=__webpack_require__(228);Symbol.toStringTag,Symbol.iterator;const zM=Intl.NumberFormat("en",{notation:"compact"});zM.format.bind(zM);function QM(t){return t.at(0).toUpperCase()+t.slice(1)}const JM=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],ZM=[...JM,...JM.map((t=>QM(t))),"char"],tR=/^(u?int|float)(8|16|32|64)$/i;function eR(t){return"char"==t?"uint8":t.toLowerCase()}function nR(t){return tR.test(t.toString())}function iR(t){return"char"==t||tR.test(t.toString().toLowerCase())}Symbol.struct_init||=Symbol("struct_init"),Symbol.struct_metadata||=Symbol("struct_metadata");Symbol.struct_init,Symbol.struct_metadata;function sR(t){const e=Symbol.metadata||Object.getOwnPropertySymbols(t).find((t=>"Symbol.metadata"==t.description));var n;if(n=t,Symbol?.metadata&&(Symbol.metadata in n||Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)})),!e)throw new ReferenceError("Could not get a reference to Symbol.metadata");return e}function oR(t){return"function"==typeof t&&sR(t)in t&&function(t){return null!=t&&"object"==typeof t&&Symbol.struct_metadata in t}(t[sR(t)])}function rR(t){return null!=t&&"object"==typeof t&&oR(t.constructor)}function aR(t){if(!rR(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct instance")}function lR(t){if(!function(t){return rR(t)||oR(t)}(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct")}function uR(t){if("string"==typeof t)return function(t){if(!iR(t))throw new TypeError("Not a valid primitive type: "+t)}(t),+eR(t).match(tR)[2]/8;lR(t);const e=oR(t)?t:t.constructor;return e[sR(e)][Symbol.struct_metadata].size}function pR(t={}){return function(e,n){n.metadata??={},n.metadata[Symbol.struct_init]||=[];let i=0;const s=new Map;for(const e of n.metadata[Symbol.struct_init]){const{name:n,type:a,length:l}=e;if(!iR(a)&&!oR(a))throw new TypeError("Not a valid type: "+a);s.set(n,{offset:i,type:iR(a)?eR(a):a,length:l}),i+=uR(a)*(l||1),o=i,r=t.align||1,i=Math.ceil(o/r)*r}var o,r;return n.metadata[Symbol.struct_metadata]={options:t,members:s,size:i},e}}function _R(t,e){return function(n,i){let s=i.name;if("symbol"==typeof s&&(console.warn("Symbol used for struct member name will be coerced to string: "+s.toString()),s=s.toString()),!s)throw new ReferenceError("Invalid name for struct member");return i.metadata??={},i.metadata[Symbol.struct_init]||=[],i.metadata[Symbol.struct_init].push({name:s,type:t,length:e}),n}}function dR(t){aR(t);const{options:e,members:n}=t.constructor[sR(t.constructor)][Symbol.struct_metadata],i=new Uint8Array(uR(t)),s=new DataView(i.buffer);for(const[o,{type:r,length:a,offset:l}]of n)for(let n=0;n<(a||1);n++){const u=l+uR(r)*n;let p=a>0?t[o][n]:t[o];if("string"==typeof p&&(p=p.charCodeAt(0)),!nR(r)){i.set(p?dR(p):new Uint8Array(uR(r)),u);continue}const _="set"+QM(r);"setInt64"!=_?"setUint64"!=_?s[_](u,Number(p),!e.bigEndian):s.setBigUint64(u,BigInt(p),!e.bigEndian):s.setBigInt64(u,BigInt(p),!e.bigEndian)}return i}function hR(t,e){aR(t);const{options:n,members:i}=t.constructor[sR(t.constructor)][Symbol.struct_metadata],s=e instanceof Uint8Array?e:new Uint8Array("buffer"in e?e.buffer:e),o=new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength));for(const[e,{type:r,offset:a,length:l}]of i)for(let i=0;i<(l||1);i++){let u=l>0?t[e]:t;const p=l>0?i:e,_=a+uR(r)*i;if("string"==typeof t[e]){t[e]=t[e].slice(0,i)+String.fromCharCode(o.getUint8(_))+t[e].slice(i+1);continue}if(!nR(r)){if(null===u[p]||void 0===u[p])continue;hR(u[p],new Uint8Array(s.slice(_,_+uR(r))));continue}l>0&&(u||=[]);const d="get"+QM(r);"getInt64"!=d?u[p]="getUint64"!=d?o[d](_,!n.bigEndian):o.getBigUint64(_,!n.bigEndian):u[p]=o.getBigInt64(_,!n.bigEndian)}}Symbol.metadata??=Symbol.for("Symbol.metadata");const cR=Object.fromEntries(ZM.map((t=>{return[t,(e=t,function(t,n){return"number"==typeof t?_R(e,t):_R(e)(t,n)})];var e})));var TR=function(t,e,n,i,s,o){function r(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=i.kind,u="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?i.static?t:t.prototype:null,_=e||(p?Object.getOwnPropertyDescriptor(p,i.name):{}),d=!1,h=n.length-1;h>=0;h--){var c={};for(var T in i)c[T]="access"===T?{}:i[T];for(var T in i.access)c.access[T]=i.access[T];c.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(r(t||null))};var I=(0,n[h])("accessor"===l?{get:_.get,set:_.set}:_[u],c);if("accessor"===l){if(void 0===I)continue;if(null===I||"object"!=typeof I)throw new TypeError("Object expected");(a=r(I.get))&&(_.get=a),(a=r(I.set))&&(_.set=a),(a=r(I.init))&&s.unshift(a)}else(a=r(I))&&("field"===l?s.unshift(a):_[u]=a)}p&&Object.defineProperty(p,i.name,_),d=!0},IR=function(t,e,n){for(var i=arguments.length>2,s=0;s<e.length;s++)n=i?e[s].call(t,n):e[s].call(t);return i?n:void 0},mR=function(t,e,n){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})};let ER=(()=>{var t,e,n,i,s,o,r,a,l,u,p;let _,d,h,c,T,I,m,E,f,g,O,M,R,A=[pR()],S=[],C=[],L=[],y=[],D=[],N=[],b=[],v=[],w=[],F=[],P=[],k=[],V=[],Y=[],x=[],U=[],B=[],X=[],G=[],H=[],W=[],K=[],j=[];var q=d=class{constructor(t){if(this.data=IR(this,C,void 0),this.size=(IR(this,L),IR(this,y,void 0)),this.mode=(IR(this,D),IR(this,N,void 0)),this.nlink=(IR(this,b),IR(this,v,void 0)),this.uid=(IR(this,w),IR(this,F,void 0)),this.gid=(IR(this,P),IR(this,k,void 0)),this.atimeMs=(IR(this,V),IR(this,Y,void 0)),this.birthtimeMs=(IR(this,x),IR(this,U,void 0)),this.mtimeMs=(IR(this,B),IR(this,X,void 0)),this.ctimeMs=(IR(this,G),IR(this,H,void 0)),this.ino=(IR(this,W),IR(this,K,void 0)),IR(this,j),t){const e=uR(q),n=e-uR("uint64");if(t.byteLength<n)throw new RangeError(`Can not create an inode from a buffer less than ${n} bytes`);if(t.byteLength<e){const n=new Uint8Array(e);n.set(new Uint8Array(ArrayBuffer.isView(t)?t.buffer:t));const i=crypto.getRandomValues(new Uint32Array(2));n.set(i,e-2),t=n}return void hR(this,t)}this.ino=FO(),this.data=FO(),this.nlink=1,this.size=4096;const e=Date.now();this.atimeMs=e,this.mtimeMs=e,this.ctimeMs=e,this.birthtimeMs=e}toStats(){return new FM(this)}update(t){let e=!1;return this.size!==t.size&&(this.size=t.size,e=!0),this.mode!==t.mode&&(this.mode=t.mode,e=!0),this.nlink!==t.nlink&&(this.nlink=t.nlink,e=!0),this.uid!==t.uid&&(this.uid=t.uid,e=!0),this.gid!==t.gid&&(this.gid=t.gid,e=!0),this.atimeMs!==t.atimeMs&&(this.atimeMs=t.atimeMs,e=!0),this.mtimeMs!==t.mtimeMs&&(this.mtimeMs=t.mtimeMs,e=!0),this.ctimeMs!==t.ctimeMs&&(this.ctimeMs=t.ctimeMs,e=!0),e}};return mR(d,"Inode"),(()=>{const $="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;h=[(t=cR).uint64.bind(t)],c=[(e=cR).uint32.bind(e)],T=[(n=cR).uint16.bind(n)],I=[(i=cR).uint32.bind(i)],m=[(s=cR).uint32.bind(s)],E=[(o=cR).uint32.bind(o)],f=[(r=cR).float64.bind(r)],g=[(a=cR).float64.bind(a)],O=[(l=cR).float64.bind(l)],M=[(u=cR).float64.bind(u)],R=[(p=cR).uint64.bind(p)],TR(null,null,h,{kind:"field",name:"data",static:!1,private:!1,access:{has:t=>"data"in t,get:t=>t.data,set:(t,e)=>{t.data=e}},metadata:$},C,L),TR(null,null,c,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:$},y,D),TR(null,null,T,{kind:"field",name:"mode",static:!1,private:!1,access:{has:t=>"mode"in t,get:t=>t.mode,set:(t,e)=>{t.mode=e}},metadata:$},N,b),TR(null,null,I,{kind:"field",name:"nlink",static:!1,private:!1,access:{has:t=>"nlink"in t,get:t=>t.nlink,set:(t,e)=>{t.nlink=e}},metadata:$},v,w),TR(null,null,m,{kind:"field",name:"uid",static:!1,private:!1,access:{has:t=>"uid"in t,get:t=>t.uid,set:(t,e)=>{t.uid=e}},metadata:$},F,P),TR(null,null,E,{kind:"field",name:"gid",static:!1,private:!1,access:{has:t=>"gid"in t,get:t=>t.gid,set:(t,e)=>{t.gid=e}},metadata:$},k,V),TR(null,null,f,{kind:"field",name:"atimeMs",static:!1,private:!1,access:{has:t=>"atimeMs"in t,get:t=>t.atimeMs,set:(t,e)=>{t.atimeMs=e}},metadata:$},Y,x),TR(null,null,g,{kind:"field",name:"birthtimeMs",static:!1,private:!1,access:{has:t=>"birthtimeMs"in t,get:t=>t.birthtimeMs,set:(t,e)=>{t.birthtimeMs=e}},metadata:$},U,B),TR(null,null,O,{kind:"field",name:"mtimeMs",static:!1,private:!1,access:{has:t=>"mtimeMs"in t,get:t=>t.mtimeMs,set:(t,e)=>{t.mtimeMs=e}},metadata:$},X,G),TR(null,null,M,{kind:"field",name:"ctimeMs",static:!1,private:!1,access:{has:t=>"ctimeMs"in t,get:t=>t.ctimeMs,set:(t,e)=>{t.ctimeMs=e}},metadata:$},H,W),TR(null,null,R,{kind:"field",name:"ino",static:!1,private:!1,access:{has:t=>"ino"in t,get:t=>t.ino,set:(t,e)=>{t.ino=e}},metadata:$},K,j),TR(null,_={value:d},A,{kind:"class",name:d.name,metadata:$},null,S),q=d=_.value,$&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$}),IR(d,S)})(),q=d})();var fR=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},gR=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class OR extends qM{async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}constructor(t){super(),this.store=t,this._initialized=!1}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=RO(t),o=RO(e),r=await this.findInode(i,s.dir,"rename"),a=yO(await this.get(i,r.data,s.dir,"rename"));if(!a[s.base])throw IO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0===(o.dir+"/").indexOf(t+"/"))throw new IO(cO.EBUSY,s.dir);const u=o.dir==s.dir,p=u?r:await this.findInode(i,o.dir,"rename"),_=u?a:yO(await this.get(i,p.data,o.dir,"rename"));if(_[o.base]){const t=new ER(await this.get(i,_[o.base],e,"rename"));if(!t.toStats().isFile())throw IO.With("EPERM",e,"rename");await i.remove(t.data),await i.remove(_[o.base])}_[o.base]=l,await i.set(r.data,DO(a)),await i.set(p.data,DO(_)),await i.commit()}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}renameSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=RO(t),o=RO(e),r=this.findInodeSync(i,s.dir,"rename"),a=yO(this.getSync(i,r.data,s.dir,"rename"));if(!a[s.base])throw IO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0==(o.dir+"/").indexOf(t+"/"))throw new IO(cO.EBUSY,s.dir);const u=o.dir===s.dir,p=u?r:this.findInodeSync(i,o.dir,"rename"),_=u?a:yO(this.getSync(i,p.data,o.dir,"rename"));if(_[o.base]){const t=new ER(this.getSync(i,_[o.base],e,"rename"));if(!t.toStats().isFile())throw IO.With("EPERM",e,"rename");i.removeSync(t.data),i.removeSync(_[o.base])}_[o.base]=l,i.setSync(r.data,DO(a)),i.setSync(p.data,DO(_)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!0);return(await this.findInode(n,t,"stat")).toStats()}catch(t){e.error=t,e.hasError=!0}finally{const t=gR(e);t&&await t}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!1);return this.findInodeSync(n,t,"stat").toStats()}catch(t){e.error=t,e.hasError=!0}finally{gR(e)}}async createFile(t,e,n){const i=await this.commitNew(t,uM,n,new Uint8Array,"createFile");return new jM(this,t,e,i.toStats(),new Uint8Array)}createFileSync(t,e,n){const i=this.commitNewSync(t,uM,n,new Uint8Array,"createFile");return new jM(this,t,e,i.toStats(),new Uint8Array)}async openFile(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=await this.findInode(i,t,"openFile"),o=await this.get(i,s.data,t,"openFile");return new jM(this,t,e,s.toStats(),o)}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}openFileSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=this.findInodeSync(i,t,"openFile"),o=this.getSync(i,s.data,t,"openFile");return new jM(this,t,e,s.toStats(),o)}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async unlink(t){return this.remove(t,!1,"unlink")}unlinkSync(t){this.removeSync(t,!1,"unlink")}async rmdir(t){if((await this.readdir(t)).length)throw IO.With("ENOTEMPTY",t,"rmdir");await this.remove(t,!0,"rmdir")}rmdirSync(t){if(this.readdirSync(t).length)throw IO.With("ENOTEMPTY",t,"rmdir");this.removeSync(t,!0,"rmdir")}async mkdir(t,e){await this.commitNew(t,_M,e,SO("{}"),"mkdir")}mkdirSync(t,e){this.commitNewSync(t,_M,e,SO("{}"),"mkdir")}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!0),i=await this.findInode(n,t,"readdir");return Object.keys(yO(await this.get(n,i.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{const t=gR(e);t&&await t}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!1),i=this.findInodeSync(n,t,"readdir");return Object.keys(yO(this.getSync(n,i.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{gR(e)}}async sync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!0),o=await this._findInode(s,t,"sync"),r=new ER(await this.get(s,o,t,"sync")),a=r.update(n);await s.set(r.data,e),a&&await s.set(o,dR(r)),await s.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=gR(i);t&&await t}}syncSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!1),o=this._findInodeSync(s,t,"sync"),r=new ER(this.getSync(s,o,t,"sync")),a=r.update(n);s.setSync(r.data,e),a&&s.setSync(o,dR(r)),s.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{gR(i)}}async link(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=OO(e),o=await this.findInode(i,s,"link"),r=yO(await this.get(i,o.data,s,"link")),a=await this._findInode(i,t,"link"),l=new ER(await this.get(i,a,t,"link"));l.nlink++,r[MO(e)]=a,i.setSync(a,dR(l)),i.setSync(o.data,DO(r)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}linkSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=OO(e),o=this.findInodeSync(i,s,"link"),r=yO(this.getSync(i,o.data,s,"link")),a=this._findInodeSync(i,t,"link"),l=new ER(this.getSync(i,a,t,"link"));l.nlink++,r[MO(e)]=a,i.setSync(a,dR(l)),i.setSync(o.data,DO(r)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async checkRoot(){const t={stack:[],error:void 0,hasError:!1};try{const e=fR(t,this.store.transaction(),!0);if(await e.get(0n))return;const n=new ER;n.ino=0n,n.mode=511|_M,await e.set(n.data,SO("{}")),await e.set(0n,dR(n)),await e.commit()}catch(e){t.error=e,t.hasError=!0}finally{const e=gR(t);e&&await e}}checkRootSync(){const t={stack:[],error:void 0,hasError:!1};try{const e=fR(t,this.store.transaction(),!1);if(e.getSync(0n))return;const n=new ER;n.ino=0n,n.mode=511|_M,e.setSync(n.data,SO("{}")),e.setSync(0n,dR(n)),e.commitSync()}catch(e){t.error=e,t.hasError=!0}finally{gR(t)}}async _findInode(t,e,n,i=new Set){if(i.has(e))throw new IO(cO.EIO,"Infinite loop detected while finding inode",e);if(i.add(e),"/"==e)return 0n;const{dir:s,base:o}=RO(e),r="/"==s?new ER(await this.get(t,0n,s,n)):await this.findInode(t,s,n,i),a=yO(await this.get(t,r.data,s,n));if(!(o in a))throw IO.With("ENOENT",fO(s,o),n);return a[o]}_findInodeSync(t,e,n,i=new Set){if(i.has(e))throw new IO(cO.EIO,"Infinite loop detected while finding inode",e);if(i.add(e),"/"==e)return 0n;const{dir:s,base:o}=RO(e),r="/"==s?new ER(this.getSync(t,0n,s,n)):this.findInodeSync(t,s,n,i),a=yO(this.getSync(t,r.data,s,n));if(!(o in a))throw IO.With("ENOENT",fO(s,o),n);return a[o]}async findInode(t,e,n,i=new Set){const s=await this._findInode(t,e,n,i);return new ER(await this.get(t,s,e,n))}findInodeSync(t,e,n,i=new Set){const s=this._findInodeSync(t,e,n,i);return new ER(this.getSync(t,s,e,n))}async get(t,e,n,i){const s=await t.get(e);if(!s)throw IO.With("ENOENT",n,i);return s}getSync(t,e,n,i){const s=t.getSync(e);if(!s)throw IO.With("ENOENT",n,i);return s}async allocNew(t,e,n){for(let e=0;e<5;e++){const e=FO();if(!await t.get(e))return e}throw new IO(cO.ENOSPC,"No IDs available",e,n)}allocNewSync(t,e,n){for(let e=0;e<5;e++){const e=FO();if(!t.getSync(e))return e}throw new IO(cO.ENOSPC,"No IDs available",e,n)}async commitNew(t,e,n,i,s){const o={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw IO.With("EEXIST",t,s);const r=fR(o,this.store.transaction(),!0),{dir:a,base:l}=RO(t),u=await this.findInode(r,a,s),p=yO(await this.get(r,u.data,a,s));if(p[l])throw IO.With("EEXIST",t,s);const _=new ER;return _.ino=await this.allocNew(r,t,s),_.data=await this.allocNew(r,t,s),_.mode=n|e,_.uid=u.mode&cM?u.uid:PO.uid,_.gid=u.mode&TM?u.gid:PO.gid,_.size=i.length,await r.set(_.ino,dR(_)),await r.set(_.data,i),p[l]=_.ino,await r.set(u.data,DO(p)),await r.commit(),_}catch(t){o.error=t,o.hasError=!0}finally{const t=gR(o);t&&await t}}commitNewSync(t,e,n,i,s){const o={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw IO.With("EEXIST",t,s);const r=fR(o,this.store.transaction(),!1),{dir:a,base:l}=RO(t),u=this.findInodeSync(r,a,s),p=yO(this.getSync(r,u.data,a,s));if(p[l])throw IO.With("EEXIST",t,s);const _=new ER;return _.ino=this.allocNewSync(r,t,s),_.data=this.allocNewSync(r,t,s),_.size=i.length,_.mode=n|e,_.uid=u.mode&cM?u.uid:PO.uid,_.gid=u.mode&TM?u.gid:PO.gid,r.setSync(_.ino,dR(_)),r.setSync(_.data,i),p[l]=_.ino,r.setSync(u.data,DO(p)),r.commitSync(),_}catch(t){o.error=t,o.hasError=!0}finally{gR(o)}}async remove(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!0),{dir:o,base:r}=RO(t),a=await this.findInode(s,o,n),l=yO(await this.get(s,a.data,o,n));if(!l[r])throw IO.With("ENOENT",t,"remove");const u=l[r],p=new ER(await this.get(s,u,t,n));if(delete l[r],!e&&p.toStats().isDirectory())throw IO.With("EISDIR",t,"remove");await s.set(a.data,DO(l)),--p.nlink<1&&(await s.remove(p.data),await s.remove(u)),await s.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=gR(i);t&&await t}}removeSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!1),{dir:o,base:r}=RO(t),a=this.findInodeSync(s,o,n),l=yO(this.getSync(s,a.data,o,n)),u=l[r];if(!u)throw IO.With("ENOENT",t,"remove");const p=new ER(this.getSync(s,u,t,n));if(delete l[r],!e&&p.toStats().isDirectory())throw IO.With("EISDIR",t,"remove");s.setSync(a.data,DO(l)),--p.nlink<1&&(s.removeSync(p.data),s.removeSync(u)),s.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{gR(i)}}}class MR{constructor(t){this.store=t,this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}}class RR extends MR{async keys(){return this.keysSync()}async get(t){return this.getSync(t)}async set(t,e){return this.setSync(t,e)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}}class AR extends RR{constructor(){super(...arguments),this.originalData=new Map,this.modifiedKeys=new Set}keysSync(){return this.store.keys()}getSync(t){const e=this.store.get(t);return this.stashOldValue(t,e),e}setSync(t,e){return this.markModified(t),this.store.set(t,e)}removeSync(t){this.markModified(t),this.store.delete(t)}commitSync(){this.done=!0}abortSync(){if(this.done){for(const t of this.modifiedKeys){const e=this.originalData.get(t);e?this.store.set(t,e):this.store.delete(t)}this.done=!0}}stashOldValue(t,e){this.originalData.has(t)||this.originalData.set(t,e)}markModified(t){this.modifiedKeys.add(t),this.originalData.has(t)||this.originalData.set(t,this.store.get(t))}}class SR extends Map{constructor(t="tmp"){super(),this.name=t}async sync(){}clearSync(){this.clear()}transaction(){return new AR(this)}}const CR={name:"InMemory",isAvailable:()=>!0,options:{name:{type:"string",required:!1}},create({name:t}){const e=new OR(new SR(t));return e.checkRootSync(),e}};"function"==typeof SuppressedError&&SuppressedError;class LR{constructor(){this.isEnabled=!1,this.sync=new Map,this.async=new Map}has(t){return this.isEnabled&&this.sync.has(t)}get(t){if(this.isEnabled)return this.sync.get(t)}set(t,e){this.isEnabled&&(this.sync.set(t,e),this.async.set(t,Promise.resolve(e)))}hasAsync(t){return this.isEnabled&&this.async.has(t)}getAsync(t){if(this.isEnabled)return this.async.get(t)}setAsync(t,e){this.isEnabled&&(this.async.set(t,e),e.then((e=>this.sync.set(t,e))))}clear(){this.isEnabled&&(this.sync.clear(),this.async.clear())}}const yR=new LR,DR=new LR;var NR=__webpack_require__(8287);function bR(t,e){return Object.fromEntries(Object.entries(t).map((([t,n])=>[t,"function"==typeof n?n.bind(e):n])))}const vR=new Map;let wR=100;function FR(t){const e=wR++;return vR.set(e,t),e}function PR(t){if(!vR.has(t))throw new IO(cO.EBADF);return vR.get(t)}const kR=new Map;function VR(t,e){if("/"!==t[0]&&(t="/"+t),t=fO(t),kR.has(t))throw new IO(cO.EINVAL,"Mount point "+t+" is already in use.");kR.set(t,e),DR.clear()}function YR(t){if("/"!==t[0]&&(t="/"+t),t=fO(t),!kR.has(t))throw new IO(cO.EINVAL,"Mount point "+t+" is already unmounted.");kR.delete(t),DR.clear()}function xR(t,e){const n=e?.root||"/";t=vO(gO(n,t));const i=[...kR].sort(((t,e)=>t[0].length>e[0].length?-1:1));for(const[e,s]of i)if(e.length<=t.length&&t.startsWith(e))return""===(t=t.slice(e.length>1?e.length:0))&&(t=n),{fs:s,path:t,mountPoint:e,root:n};throw new IO(cO.EIO,"No file system")}async function UR(){await Promise.all([...kR.values()].map((t=>t.ready())))}function BR(t,e){for(const[n,i]of Object.entries(e))t=t?.replaceAll(n,i);return t}function XR(t,e){"string"==typeof t.stack&&(t.stack=BR(t.stack,e));try{t.message=BR(t.message,e)}catch{}return t.path&&(t.path=BR(t.path,e)),t}function GR(t){"/"in t&&YR("/");for(const[e,n]of Object.entries(t))VR(e,n)}function HR(t,e){const n=t.metadata(),i=n.blockSize||4096;return{type:(e?BigInt:Number)(n.type),bsize:(e?BigInt:Number)(i),ffree:(e?BigInt:Number)(n.freeNodes||NM),files:(e?BigInt:Number)(n.totalNodes||NM),bavail:(e?BigInt:Number)(n.freeSpace/i),bfree:(e?BigInt:Number)(n.freeSpace/i),blocks:(e?BigInt:Number)(n.totalSpace/i)}}function WR(t,e){const n=this?.credentials;if(n?.uid&&n?.gid&&n?.euid&&n?.egid)throw new IO(cO.EPERM,"Can not chroot() as non-root user");return e&&this?(this.root+=t,this):function(t,e=structuredClone(PO)){const n={root:t,credentials:kO(e)},i=bR(st,n),s=bR(it,n);return{...n,...i,promises:s}}(gO(this?.root||"/",t),n)}VR("/",CR.create({name:"root"}));class KR extends $M{off(t,e,n,i){return super.off(t,e,n,i)}removeListener(t,e,n,i){return super.removeListener(t,e,n,i)}constructor(t){super(),this.path=t}setMaxListeners(){throw IO.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw IO.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw IO.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw IO.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw IO.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}}class jR extends KR{constructor(t,e){super(t),this.options=e,function(t,e){const n=vO(t);$R.has(n)||$R.set(n,new Set);$R.get(n).add(e)}(t.toString(),this)}close(){super.emit("close"),function(t,e){const n=vO(t);$R.has(n)&&($R.get(n).delete(e),0===$R.get(n).size&&$R.delete(n))}(this.path.toString(),this)}[Symbol.dispose](){this.close()}}class qR extends KR{constructor(t,e){super(t),this.options=e,this.start()}onInterval(){try{const n=eA(this.path);t=this.previous,e=n,(t.size!=e.size||+t.atime!=+e.atime||+t.mtime!=+e.mtime||+t.ctime!=+e.ctime||t.mode!=e.mode)&&(this.emit("change",n,this.previous),this.previous=n)}catch(t){this.emit("error",t)}var t,e}start(){const t=this.options.interval||5e3;try{this.previous=eA(this.path)}catch(t){return void this.emit("error",t)}this.intervalId=setInterval(this.onInterval.bind(this),t),this.options.persistent||"object"!=typeof this.intervalId||this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}}const $R=new Map;function zR(t,e){if(e=vO(e),$R.has(e))for(const n of $R.get(e))n.emit("change",t,MO(e));let n,i=e;for(;i!==n;)if(n=i,i=OO(i),$R.has(i))for(const n of $R.get(i))n.emit("change",t,e.slice(i.length+("/"==i?0:1)))}var QR=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},JR=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});function ZR(t,e){t=vO(t),e=vO(e);const n=xR(t,this),i=xR(e,this);if(bM.checkAccess&&!eA.call(this,OO(t)).hasAccess(xO,this))throw IO.With("EACCES",t,"rename");try{if(n===i)return n.fs.renameSync(n.path,i.path),zR("rename",t.toString()),void zR("change",e.toString());pA.call(this,e,uA(t)),sA.call(this,t),zR("rename",t.toString())}catch(s){throw XR(s,{[n.path]:t,[i.path]:e})}}function tA(t){t=vO(t);try{const{fs:e,path:n}=xR(FA.call(this,t),this);return e.existsSync(n)}catch(t){if(t.errno==cO.ENOENT)return!1;throw t}}function eA(t,e){t=vO(t);const{fs:n,path:i}=xR(FA.call(this,t),this);try{const t=n.statSync(i);if(bM.checkAccess&&!t.hasAccess(YO,this))throw IO.With("EACCES",i,"stat");return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}function nA(t,e){t=vO(t);const{fs:n,path:i}=xR(t,this);try{const t=n.statSync(i);return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}function iA(t,e=0){const n={stack:[],error:void 0,hasError:!1};try{const i=QR(n,oA.call(this,t,"r+"),!1);if(e||(e=0),e<0)throw new IO(cO.EINVAL);i.truncateSync(e)}catch(t){n.error=t,n.hasError=!0}finally{JR(n)}}function sA(t){t=vO(t);const{fs:e,path:n}=xR(t,this);try{if(bM.checkAccess&&!(yR.get(t)||e.statSync(n)).hasAccess(xO,this))throw IO.With("EACCES",n,"unlink");e.unlinkSync(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}function oA(t,e,n,i=!0){t=vO(t);const s=NO(n,420),o=xM(e);t=i?FA.call(this,t):t;const{fs:r,path:a}=xR(t,this);let l;try{l=r.statSync(a)}catch{}if(!l){if(!XM(o)&&!HM(o)||"r+"==o)throw IO.With("ENOENT",t,"_open");const e=r.statSync(OO(a));if(bM.checkAccess&&!e.hasAccess(xO,this))throw IO.With("EACCES",OO(t),"_open");if(!e.isDirectory())throw IO.With("ENOTDIR",OO(t),"_open");return r.createFileSync(a,o,s)}if(bM.checkAccess&&(!l.hasAccess(s,this)||!l.hasAccess(UM(o),this)))throw IO.With("EACCES",t,"_open");if(WM(o))throw IO.With("EEXIST",t,"_open");const u=r.openFileSync(a,o);return GM(o)&&u.truncateSync(0),u}function rA(t,e,n=VO){return FR(oA.call(this,t,e,n,!0))}function aA(t,e,n){return FR(oA.call(this,t,e,n,!1))}function lA(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=QR(i,oA.call(this,t,e,420,n),!1),o=s.statSync(),r=new Uint8Array(o.size);return s.readSync(r,0,o.size,0),r}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function uA(t,e={}){const n=wO(e,null,"r",420);if(!BM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed to readFile must allow for reading.");const i=NR.Buffer.from(lA.call(this,"number"==typeof t?PR(t).path:t.toString(),n.flag,!0));return n.encoding?i.toString(n.encoding):i}function pA(t,e,n={}){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","w+",420),o=xM(s.flag);if(!XM(o))throw new IO(cO.EINVAL,"Flag passed to writeFile must allow for writing.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const r="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!r)throw new IO(cO.EINVAL,"Data not specified");QR(i,oA.call(this,"number"==typeof t?PR(t).path:t.toString(),o,s.mode,!0),!1).writeSync(r,0,r.byteLength,0),zR("change",t.toString())}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function _A(t,e,n={}){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","a+",420),o=xM(s.flag);if(!HM(o))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const r="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);QR(i,oA.call(this,"number"==typeof t?PR(t).path:t.toString(),o,s.mode,!0),!1).writeSync(r,0,r.byteLength)}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function dA(t,e){const n=PR(t).statSync();return e?.bigint?new PM(n):n}function hA(t){PR(t).closeSync(),vR.delete(t)}function cA(t,e=0){if(e||(e=0),e<0)throw new IO(cO.EINVAL);PR(t).truncateSync(e)}function TA(t){PR(t).syncSync()}function IA(t){PR(t).datasyncSync()}function mA(t,e,n,i,s){let o,r,a,l;if("string"==typeof e){l="number"==typeof n?n:null;const t="string"==typeof i?i:"utf8";r=0,o=NR.Buffer.from(e,t),a=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=n,a=i,l="number"==typeof s?s:null;const u=PR(t);l??(l=u.position);const p=u.writeSync(o,r,a,l);return zR("change",u.path),p}function EA(t,e,n,i,s){const o=PR(t),r="object"==typeof n?n.offset:n;return"object"==typeof n&&(i=n.length,s=n.position),s=Number(s),isNaN(s)&&(s=o.position),o.readSync(e,r,i,s)}function fA(t,e,n){PR(t).chownSync(e,n)}function gA(t,e){const n=NO(e,-1);if(n<0)throw new IO(cO.EINVAL,"Invalid mode.");PR(t).chmodSync(n)}function OA(t,e,n){PR(t).utimesSync(bO(e),bO(n))}function MA(t){t=vO(t);const{fs:e,path:n}=xR(FA.call(this,t),this);try{const i=yR.get(t)||e.statSync(n);if(!i.isDirectory())throw IO.With("ENOTDIR",n,"rmdir");if(bM.checkAccess&&!i.hasAccess(xO,this))throw IO.With("EACCES",n,"rmdir");e.rmdirSync(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}function RA(t,e){e="object"==typeof e?e:{mode:e};const n=NO(e?.mode,511);t=FA.call(this,t);const{fs:i,path:s,root:o}=xR(t,this),r={[s]:t};try{if(!e?.recursive){if(bM.checkAccess&&!i.statSync(OO(s)).hasAccess(xO,this))throw IO.With("EACCES",OO(s),"mkdir");return i.mkdirSync(s,n)}const a=[];for(let e=s,n=t;!i.existsSync(e);e=OO(e),n=OO(n))a.unshift(e),r[e]=n;for(const t of a){if(bM.checkAccess&&!i.statSync(OO(t)).hasAccess(xO,this))throw IO.With("EACCES",OO(t),"mkdir");i.mkdirSync(t,n),zR("rename",t)}return 1==o.length?a[0]:a[0]?.slice(o.length)}catch(t){throw XR(t,r)}}function AA(t,e){e="object"==typeof e?e:{encoding:e},t=vO(t);const{fs:n,path:i}=xR(FA.call(this,t),this);let s;try{const e=yR.get(t)||n.statSync(i);if(yR.set(t,e),bM.checkAccess&&!e.hasAccess(YO,this))throw IO.With("EACCES",i,"readdir");if(!e.isDirectory())throw IO.With("ENOTDIR",i,"readdir");s=n.readdirSync(i)}catch(e){throw XR(e,{[i]:t})}const o=[];for(const r of s){const s=yR.get(gO(t,r))||n.statSync(gO(i,r));if(yR.set(gO(t,r),s),e?.withFileTypes?o.push(new HA(r,s)):"buffer"==e?.encoding?o.push(NR.Buffer.from(r)):o.push(r),s.isDirectory()&&e?.recursive)for(const n of AA.call(this,gO(t,r),{...e,_isIndirect:!0}))n instanceof HA?(n.path=gO(r,n.path),o.push(n)):NR.Buffer.isBuffer(n)?o.push(NR.Buffer.from(gO(r,LO(n)))):o.push(gO(r,n))}return e?._isIndirect||yR.clear(),o}function SA(t,e){if(t=vO(t),bM.checkAccess&&!eA(OO(t)).hasAccess(YO,this))throw IO.With("EACCES",OO(t),"link");if(e=vO(e),bM.checkAccess&&!eA(OO(e)).hasAccess(xO,this))throw IO.With("EACCES",OO(e),"link");const{fs:n,path:i}=xR(t,this),s=xR(e,this);if(n!=s.fs)throw IO.With("EXDEV",e,"link");try{if(bM.checkAccess&&!n.statSync(i).hasAccess(YO,this))throw IO.With("EACCES",i,"link");return n.linkSync(i,e)}catch(n){throw XR(n,{[i]:t,[s.path]:e})}}function CA(t,e,n="file"){if(!["file","dir","junction"].includes(n))throw new IO(cO.EINVAL,"Invalid type: "+n);if(tA.call(this,e))throw IO.With("EEXIST",e.toString(),"symlink");pA.call(this,e,t.toString());oA.call(this,e,"r+",420,!1).chmodSync(lM)}function LA(t,e){const n=NR.Buffer.from(lA.call(this,t.toString(),"r",!1)),i="object"==typeof e?e?.encoding:e;return"buffer"==i?n:n.toString(i)}function yA(t,e,n){const i=rA.call(this,t,"r+");fA(i,e,n),hA(i)}function DA(t,e,n){const i=aA.call(this,t,"r+");fA(i,e,n),hA(i)}function NA(t,e){const n=rA.call(this,t,"r+");gA(n,e),hA(n)}function bA(t,e){const n=aA.call(this,t,"r+");gA(n,e),hA(n)}function vA(t,e,n){const i=rA.call(this,t,"r+");OA(i,e,n),hA(i)}function wA(t,e,n){const i=aA.call(this,t,"r+");OA(i,e,n),hA(i)}function FA(t,e){t=vO(t);const n=(this?.root||"")+t;if(DR.has(n))return DR.get(n);const{base:i,dir:s}=RO(t),o="/"==s?"/":DR.get((this?.root||"")+s)||FA.call(this,s),r=gO(o,i),{fs:a,path:l}=xR(r,this);try{const i=yR.get(r)||a.statSync(l);if(yR.set(r,i),!i.isSymbolicLink())return DR.set(t,r),r;const s=fO(o,LA.call(this,r,e).toString()),u=DR.get((this?.root||"")+s)||FA.call(this,s);return DR.set(n,u),u}catch(e){if("ENOENT"==e.code)return t;throw XR(e,{[l]:r})}}function PA(t,e=384){if(bM.checkAccess&&!eA.call(this,t).hasAccess(e,this))throw new IO(cO.EACCES)}function kA(t,e){let n;t=vO(t);try{n=yR.get(t)||nA.bind(this)(t)}catch(t){if("ENOENT"!=t.code||!e?.force)throw t}if(n){switch(yR.set(t,n),n.mode&rM){case _M:if(e?.recursive)for(const n of AA.call(this,t,{_isIndirect:!0}))kA.call(this,gO(t,n),{...e,_isIndirect:!0});MA.call(this,t);break;case uM:case lM:case pM:case dM:sA.call(this,t);break;default:throw yR.clear(),new IO(cO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||yR.clear()}}function VA(t,e){const n="object"==typeof e?e?.encoding:e||"utf8",i="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return RA.call(this,i),"buffer"==n?NR.Buffer.from(i):i}function YA(t,e,n){if(t=vO(t),e=vO(e),n&&n&BO&&tA(e))throw new IO(cO.EEXIST,"Destination file already exists.",e,"copyFile");pA.call(this,e,uA(t)),zR("rename",e.toString())}function xA(t,e,n){const i=PR(t);let s=0;for(const t of e)s+=i.readSync(t,0,t.byteLength,n+s);return s}function UA(t,e,n){const i=PR(t);let s=0;for(const t of e)s+=i.writeSync(new Uint8Array(t.buffer),0,t.byteLength,n+s);return s}function BA(t,e){return t=vO(t),new WA(t,this)}function XA(t,e,n){t=vO(t),e=vO(e);const i=nA.call(this,t);if(n?.errorOnExist&&tA.call(this,e))throw new IO(cO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(i.mode&rM){case _M:if(!n?.recursive)throw new IO(cO.EISDIR,t+" is a directory (not copied)",t,"cp");RA.call(this,e,{recursive:!0});for(const i of AA.call(this,t,{withFileTypes:!0}))n.filter&&!n.filter(gO(t,i.name),gO(e,i.name))||XA.call(this,gO(t,i.name),gO(e,i.name),n);break;case uM:case lM:YA.call(this,t,e);break;default:throw new IO(cO.EPERM,"File type not supported",t,"rm")}n?.preserveTimestamps&&vA.call(this,e,i.atime,i.mtime)}function GA(t,e){t=vO(t);const{fs:n}=xR(t,this);return HR(n,e?.bigint)}class HA{get name(){return MO(this.path)}constructor(t,e){this.path=t,this.stats=e}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}}class WA{checkClosed(){if(this.closed)throw new IO(cO.EBADF,"Can not use closed Dir")}constructor(t,e){this.path=t,this.context=e,this.closed=!1}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??(this._entries=await _S.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then((e=>t(void 0,e)))}readSync(){return this.checkClosed(),this._entries??(this._entries=AA.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}async next(){const t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}}var KA=__webpack_require__(6248);class jA extends KA.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new IO(cO.EIO,e.toString()))}}}class qA extends KA.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new IO(cO.EIO,e.toString()))}}}var $A=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},zA=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class QA{constructor(t,e){this.context=e;const n="number"!=typeof t;this.fd=n?FR(t):t,this.file=n?t:PR(t)}async chown(t,e){await this.file.chown(t,e),zR("change",this.file.path)}async chmod(t){const e=NO(t,-1);if(e<0)throw new IO(cO.EINVAL,"Invalid mode.");await this.file.chmod(e),zR("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||(t=0),t<0)throw new IO(cO.EINVAL);await this.file.truncate(t),zR("change",this.file.path)}async utimes(t,e){await this.file.utimes(bO(t),bO(e)),zR("change",this.file.path)}async appendFile(t,e={}){const n=wO(e,"utf8","a",420);if(!HM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!n.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const i="string"==typeof t?NR.Buffer.from(t,n.encoding):t;await this.file.write(i,0,i.length),zR("change",this.file.path)}read(t,e,n,i){return isNaN(+i)&&(i=this.file.position),this.file.read(t,e,n,i)}async readFile(t){const e=wO(t,null,"r",292);if(!BM(xM(e.flag)))throw new IO(cO.EINVAL,"Flag passed must allow for reading.");const{size:n}=await this.stat(),{buffer:i}=await this.file.read(new Uint8Array(n),0,n,0),s=NR.Buffer.from(i);return e.encoding?s.toString(e.encoding):s}readableWebStream(t={}){const e=globalThis;if(!("ReadableStream"in e))throw new IO(cO.ENOSYS,"ReadableStream is missing on globalThis");return new e.ReadableStream({start:async t=>{try{const e=65536,n=1e7;let i=0,s=0,o=NaN;for(;o>0;){const r=await this.read(new Uint8Array(e),0,e,s);if(!r.bytesRead)return void t.close();if(t.enqueue(r.buffer.slice(0,r.bytesRead)),s+=r.bytesRead,++i>=n)throw new IO(cO.EFBIG,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");o=r.bytesRead}}catch(e){t.error(e)}},type:t.type})}readLines(t){throw IO.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){const e=await this.file.stat();if(bM.checkAccess&&!e.hasAccess(YO,this.context))throw IO.With("EACCES",this.file.path,"stat");return t?.bigint?new PM(e):e}async write(t,e,n,i){let s,o,r;if("string"==typeof t){i="number"==typeof e?e:null;const a="string"==typeof n?n:"utf8";o=0,s=NR.Buffer.from(t,a),r=s.length}else s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=e,r=n,i="number"==typeof i?i:null;i??(i=this.file.position);const a=await this.file.write(s,o,r,i);return zR("change",this.file.path),{buffer:s,bytesWritten:a}}async writeFile(t,e={}){const n=wO(e,"utf8","w",420);if(!XM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed must allow for writing.");if("string"!=typeof t&&!n.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const i="string"==typeof t?NR.Buffer.from(t,n.encoding):t;await this.file.write(i,0,i.length,0),zR("change",this.file.path)}async close(){await this.file.close(),vR.delete(this.fd)}async writev(t,e){let n=0;for(const i of t)n+=(await this.write(i,0,i.length,e+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,e){let n=0;for(const i of t)n+=(await this.read(i,0,i.byteLength,e+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){const e=new jA({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:async t=>{try{const n=await this.read(new Uint8Array(t),0,t,this.file.position);e.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(t){e.destroy(t)}}});return e.path=this.file.path,e}createWriteStream(t){const e=new qA({highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:async(t,e,n)=>{try{const{bytesWritten:i}=await this.write(t,null,e);n(i==t.length?null:new Error("Failed to write full chunk"))}catch(t){n(t)}}});return e.path=this.file.path,e}}async function JA(t,e){t=vO(t),e=vO(e);const n=xR(t,this),i=xR(e,this);if(bM.checkAccess&&!(await tS.call(this,OO(t))).hasAccess(xO,this))throw IO.With("EACCES",t,"rename");try{if(n.mountPoint==i.mountPoint)return await n.fs.rename(n.path,i.path),zR("rename",t.toString()),void zR("change",e.toString());await aS.call(this,e,await rS(t)),await iS.call(this,t),zR("rename",t.toString())}catch(s){throw XR(s,{[n.path]:t,[i.path]:e})}}async function ZA(t){try{const{fs:e,path:n}=xR(await OS.call(this,t),this);return await e.exists(n)}catch(t){if(t instanceof IO&&"ENOENT"==t.code)return!1;throw t}}async function tS(t,e){t=vO(t);const{fs:n,path:i}=xR(await OS.call(this,t),this);try{const t=await n.stat(i);if(bM.checkAccess&&!t.hasAccess(YO,this))throw IO.With("EACCES",i,"stat");return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}async function eS(t,e){t=vO(t);const{fs:n,path:i}=xR(t,this);try{const t=await n.stat(i);return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}async function nS(t,e=0){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await oS.call(this,t,"r+"),!0);await i.truncate(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function iS(t){t=vO(t);const{fs:e,path:n}=xR(t,this);try{if(bM.checkAccess&&!(await(yR.getAsync(t)||e.stat(n))).hasAccess(xO,this))throw IO.With("EACCES",n,"unlink");await e.unlink(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}async function sS(t,e,n=420,i){t=vO(t);const s=NO(n,420),o=xM(e);t=i?await OS.call(this,t):t;const{fs:r,path:a}=xR(t,this),l=await r.stat(a).catch((()=>null));if(!l){if(!XM(o)&&!HM(o)||"r+"==o)throw IO.With("ENOENT",t,"_open");const e=await r.stat(OO(a));if(bM.checkAccess&&!e.hasAccess(xO,this))throw IO.With("EACCES",OO(t),"_open");if(!e.isDirectory())throw IO.With("ENOTDIR",OO(t),"_open");return new QA(await r.createFile(a,o,s),this)}if(bM.checkAccess&&!l.hasAccess(UM(o),this))throw IO.With("EACCES",t,"_open");if(WM(o))throw IO.With("EEXIST",t,"_open");const u=new QA(await r.openFile(a,o),this);return GM(o)&&await u.truncate(0),u}async function oS(t,e="r",n=420){return await sS.call(this,t,e,n,!0)}async function rS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=wO(e,null,"r",420),s=$A(n,"object"==typeof t&&"fd"in t?t:await oS.call(this,t,i.flag,i.mode),!0);return await s.readFile(i)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function aS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","w+",420),o=$A(i,t instanceof QA?t:await oS.call(this,t.toString(),s.flag,s.mode),!0),r=e;if("string"!=typeof r&&!(r instanceof Uint8Array))throw new IO(cO.EINVAL,"Iterables and streams not supported",o.file.path,"writeFile");await o.writeFile(r,s)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function lS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","a",420);if(!HM(xM(s.flag)))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const o="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=$A(i,"object"==typeof t&&"fd"in t?t:await oS.call(this,t,s.flag,s.mode),!0);await r.appendFile(o,s)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function uS(t){t=await OS.call(this,t);const{fs:e,path:n}=xR(t,this);try{const i=await(yR.getAsync(t)||e.stat(n));if(!i)throw IO.With("ENOENT",t,"rmdir");if(!i.isDirectory())throw IO.With("ENOTDIR",n,"rmdir");if(bM.checkAccess&&!i.hasAccess(xO,this))throw IO.With("EACCES",n,"rmdir");await e.rmdir(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}async function pS(t,e){e="object"==typeof e?e:{mode:e};const n=NO(e?.mode,511);t=await OS.call(this,t);const{fs:i,path:s,root:o}=xR(t,this),r={[s]:t};try{if(!e?.recursive){if(bM.checkAccess&&!(await i.stat(OO(s))).hasAccess(xO,this))throw IO.With("EACCES",OO(s),"mkdir");return await i.mkdir(s,n),void zR("rename",t.toString())}const a=[];for(let e=s,n=t;!await i.exists(e);e=OO(e),n=OO(n))a.unshift(e),r[e]=n;for(const t of a){if(bM.checkAccess&&!(await i.stat(OO(t))).hasAccess(xO,this))throw IO.With("EACCES",OO(t),"mkdir");await i.mkdir(t,n),zR("rename",t)}return 1==o.length?a[0]:a[0]?.slice(o.length)}catch(t){throw XR(t,r)}}async function _S(t,e){e="object"==typeof e?e:{encoding:e},t=await OS.call(this,t);const n=e=>{throw XR(e,{[s]:t})},{fs:i,path:s}=xR(t,this),o=yR.getAsync(t)||i.stat(s).catch(n);yR.setAsync(t,o);const r=await o;if(!r)throw IO.With("ENOENT",t,"readdir");if(bM.checkAccess&&!r.hasAccess(YO,this))throw IO.With("EACCES",t,"readdir");if(!r.isDirectory())throw IO.With("ENOTDIR",t,"readdir");const a=await i.readdir(s).catch(n),l=[];return await Promise.all(a.map((async o=>{let r;if(e?.recursive||e?.withFileTypes){const e=yR.getAsync(gO(t,o))||i.stat(gO(s,o)).catch(n);yR.setAsync(gO(t,o),e),r=await e}if(e?.withFileTypes?l.push(new HA(o,r)):"buffer"==e?.encoding?l.push(NR.Buffer.from(o)):l.push(o),e?.recursive&&r?.isDirectory())for(const n of await _S.call(this,gO(t,o),{...e,_isIndirect:!0}))n instanceof HA?(n.path=gO(o,n.path),l.push(n)):NR.Buffer.isBuffer(n)?l.push(NR.Buffer.from(gO(o,LO(n)))):l.push(gO(o,n))}))),e?._isIndirect||yR.clear(),l}async function dS(t,e){t=vO(t),e=vO(e);const{fs:n,path:i}=xR(t,this),s=xR(e,this);if(n!=s.fs)throw IO.With("EXDEV",e,"link");try{if(bM.checkAccess&&!(await n.stat(OO(t))).hasAccess(YO,this))throw IO.With("EACCES",OO(i),"link");if(bM.checkAccess&&!(await tS.call(this,OO(e))).hasAccess(xO,this))throw IO.With("EACCES",OO(e),"link");if(bM.checkAccess&&!(await n.stat(i)).hasAccess(YO,this))throw IO.With("EACCES",i,"link");return await n.link(i,s.path)}catch(n){throw XR(n,{[s.path]:e,[i]:t})}}async function hS(t,e,n="file"){const i={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new IO(cO.EINVAL,"Invalid symlink type: "+n);if(await ZA.call(this,e))throw IO.With("EEXIST",e.toString(),"symlink");const s=$A(i,await sS.call(this,e,"w+",420,!1),!0);await s.writeFile(t.toString()),await s.file.chmod(lM)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function cS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await sS.call(this,vO(t),"r",420,!1),!0),s=await i.readFile(),o="object"==typeof e?e?.encoding:e;return"buffer"==o?s:s.toString(o)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function TS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await oS.call(this,t,"r+"),!0);await s.chown(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function IS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await sS.call(this,t,"r+",420,!1),!0);await s.chown(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function mS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await oS.call(this,t,"r+"),!0);await i.chmod(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function ES(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await sS.call(this,t,"r+",420,!1),!0);await i.chmod(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function fS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await oS.call(this,t,"r+"),!0);await s.utimes(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function gS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await sS.call(this,t,"r+",420,!1),!0);await s.utimes(new Date(e),new Date(n))}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function OS(t,e){t=vO(t);const n=(this?.root||"")+t;if(DR.hasAsync(n))return DR.getAsync(n);const{base:i,dir:s}=RO(t),o="/"==s?"/":await(DR.getAsync((this?.root||"")+s)||OS.call(this,s)),r=gO(o,i),{fs:a,path:l}=xR(r,this);try{const e=yR.getAsync(r)||a.stat(l);if(yR.setAsync(r,e),!(await e).isSymbolicLink())return DR.set(t,r),r;const i=fO(o,(await cS.call(this,r)).toString()),s=DR.getAsync((this?.root||"")+i)||OS.call(this,i);return DR.setAsync(n,s),await s}catch(e){if("ENOENT"==e.code)return t;throw XR(e,{[l]:r})}}function MS(t,e={}){return{[Symbol.asyncIterator](){const n=new jR(t.toString(),"string"!=typeof e?e:{encoding:e}),i=[];function s(){n.close();for(const t of i)t({value:null,done:!0});return i.length=0,Promise.resolve({value:null,done:!0})}return n.on("change",((t,e)=>{i.shift()?.({value:{eventType:t,filename:e},done:!1})})),{async next(){const{promise:t,resolve:e}=Promise.withResolvers();return i.push(e),t},return:s,throw:s}}}}async function RS(t,e=VO){if(!bM.checkAccess)return;if(!(await tS.call(this,t)).hasAccess(e,this))throw new IO(cO.EACCES)}async function AS(t,e){t=vO(t);const n=await(yR.getAsync(t)||eS.call(this,t).catch((t=>{if("ENOENT"!=t.code||!e?.force)throw t})));if(n){switch(yR.set(t,n),n.mode&rM){case _M:if(e?.recursive)for(const n of await _S.call(this,t,{_isIndirect:!0}))await AS.call(this,gO(t,n),{...e,_isIndirect:!0});await uS.call(this,t);break;case uM:case lM:case pM:case dM:await iS.call(this,t);break;default:throw yR.clear(),new IO(cO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||yR.clear()}}async function SS(t,e){const n="object"==typeof e?e?.encoding:e||"utf8",i="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await pS.call(this,i),"buffer"==n?NR.Buffer.from(i):i}async function CS(t,e,n){if(t=vO(t),e=vO(e),n&&n&BO&&await ZA.call(this,e))throw new IO(cO.EEXIST,"Destination file already exists.",e,"copyFile");await aS.call(this,e,await rS.call(this,t)),zR("rename",e.toString())}function LS(t,e){return t=vO(t),Promise.resolve(new WA(t,this))}async function yS(t,e,n){t=vO(t),e=vO(e);const i=await eS.call(this,t);if(n?.errorOnExist&&await ZA.call(this,e))throw new IO(cO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(i.mode&rM){case _M:{if(!n?.recursive)throw new IO(cO.EISDIR,t+" is a directory (not copied)",t,"cp");const[i]=await Promise.all([_S.call(this,t,{withFileTypes:!0}),pS.call(this,e,{recursive:!0})]),s=async i=>{n.filter&&!n.filter(gO(t,i.name),gO(e,i.name))||await yS.call(this,gO(t,i.name),gO(e,i.name),n)};await Promise.all(i.map(s));break}case uM:case lM:await CS.call(this,t,e);break;default:throw new IO(cO.EPERM,"File type not supported",t,"rm")}n?.preserveTimestamps&&await fS.call(this,e,i.atime,i.mtime)}async function DS(t,e){t=vO(t);const{fs:n}=xR(t,this);return Promise.resolve(HR(n,e?.bigint))}const NS=()=>{};function bS(t,e,n=NS){JA.call(this,t,e).then((()=>n())).catch(n)}function vS(t,e=NS){ZA.call(this,t).then(e).catch((()=>e(!1)))}function wS(t,e,n=NS){n="function"==typeof e?e:n,tS.call(this,t,"function"!=typeof e?e:{}).then((t=>n(void 0,t))).catch(n)}function FS(t,e,n=NS){n="function"==typeof e?e:n,eS.call(this,t,"function"!=typeof e?e:{}).then((t=>n(void 0,t))).catch(n)}function PS(t,e=0,n=NS){n="function"==typeof e?e:n;const i="number"==typeof e?e:0;nS.call(this,t,i).then((()=>n())).catch(n)}function kS(t,e=NS){iS.call(this,t).then((()=>e())).catch(e)}function VS(t,e,n,i=NS){const s=NO(n,420);i="function"==typeof n?n:i,oS.call(this,t,e,s).then((t=>i(void 0,t.fd))).catch(i)}function YS(t,e,n=NS){n="function"==typeof e?e:n,rS.call(this,t,"function"==typeof e?null:e).then((t=>n(void 0,t))).catch(n)}function xS(t,e,n,i=NS){i="function"==typeof n?n:i,aS.call(this,t,e,"function"!=typeof n?n:null).then((()=>i(void 0))).catch(i)}function US(t,e,n,i=NS){const s="function"!=typeof n?n:void 0;i="function"==typeof n?n:i,lS.call(this,t,e,s).then((()=>i())).catch(i)}function BS(t,e,n=NS){n="function"==typeof e?e:n,PR(t).stat().then((t=>n(void 0,"object"==typeof e&&e?.bigint?new PM(t):t))).catch(n)}function XS(t,e=NS){const n=PR(t).close();vR.delete(t),n.then((()=>e())).catch(e)}function GS(t,e,n=NS){const i="number"==typeof e?e:0;n="function"==typeof e?e:n;const s=PR(t);if(i<0)throw new IO(cO.EINVAL);s.truncate(i).then((()=>n())).catch(n)}function HS(t,e=NS){PR(t).sync().then((()=>e())).catch(e)}function WS(t,e=NS){PR(t).datasync().then((()=>e())).catch(e)}function KS(t,e,n,i,s,o=NS){let r,a,l,u,p;const _=new QA(t,this);if("string"==typeof e){switch(p="utf8",typeof n){case"function":o=n;break;case"number":u=n,p="string"==typeof i?i:"utf8",o="function"==typeof s?s:o;break;default:return void(o="function"==typeof i?i:"function"==typeof s?s:o)(new IO(cO.EINVAL,"Invalid arguments."))}r=NR.Buffer.from(e),a=0,l=r.length;const t=o;_.write(r,a,l,u).then((({bytesWritten:e})=>t(void 0,e,r.toString(p)))).catch(t)}else{r=NR.Buffer.from(e.buffer),a=n,l=i,u="number"==typeof s?s:null;const t="function"==typeof s?s:o;_.write(r,a,l,u).then((({bytesWritten:e})=>t(void 0,e,r))).catch(t)}}function jS(t,e,n,i,s,o=NS){new QA(t,this).read(e,n,i,s).then((({bytesRead:t,buffer:e})=>o(void 0,t,e))).catch(o)}function qS(t,e,n,i=NS){new QA(t,this).chown(e,n).then((()=>i())).catch(i)}function $S(t,e,n){new QA(t,this).chmod(e).then((()=>n())).catch(n)}function zS(t,e,n,i=NS){new QA(t,this).utimes(e,n).then((()=>i())).catch(i)}function QS(t,e=NS){uS.call(this,t).then((()=>e())).catch(e)}function JS(t,e,n=NS){pS.call(this,t,e).then((()=>n())).catch(n)}function ZS(t,e,n=NS){n="function"==typeof e?e:n;const i="function"!=typeof e?e:{};_S.call(this,t,i).then((t=>n(void 0,t))).catch(n)}function tC(t,e,n=NS){dS.call(this,t,e).then((()=>n())).catch(n)}function eC(t,e,n,i=NS){const s="string"==typeof n?n:"file";i="function"==typeof n?n:i,hS.call(this,t,e,s).then((()=>i())).catch(i)}function nC(t,e,n=NS){n="function"==typeof e?e:n,cS.call(this,t).then((t=>n(void 0,t))).catch(n)}function iC(t,e,n,i=NS){TS.call(this,t,e,n).then((()=>i())).catch(i)}function sC(t,e,n,i=NS){IS.call(this,t,e,n).then((()=>i())).catch(i)}function oC(t,e,n=NS){mS.call(this,t,e).then((()=>n())).catch(n)}function rC(t,e,n=NS){ES.call(this,t,e).then((()=>n())).catch(n)}function aC(t,e,n,i=NS){fS.call(this,t,e,n).then((()=>i())).catch(i)}function lC(t,e,n,i=NS){gS.call(this,t,e,n).then((()=>i())).catch(i)}function uC(t,e,n=NS){n="function"==typeof e?e:n,OS.call(this,t,"function"==typeof e?null:e).then((t=>n(void 0,t))).catch(n)}function pC(t,e,n=NS){const i="number"==typeof e?e:YO;n="function"==typeof e?e:n,RS.call(this,t,i).then((()=>n())).catch(n)}const _C=new Map;function dC(t,e,n){const i=vO(t.toString()),s="function"!=typeof e?e:{};if("function"==typeof e&&(n=e),!n)throw new IO(cO.EINVAL,"No listener specified",t.toString(),"watchFile");if(_C.has(i)){const t=_C.get(i);return void(t&&t.listeners.add(n))}const o=new qR(i,s);o.on("change",((t,e)=>{const n=_C.get(i);if(n)for(const i of n.listeners)i(t,e)})),_C.set(i,{watcher:o,listeners:new Set})}function hC(t,e=NS){const n=vO(t.toString()),i=_C.get(n);i&&(e&&e!==NS?i.listeners.delete(e):i.listeners.clear(),0===i.listeners.size&&(i.watcher.stop(),_C.delete(n)))}function cC(t,e,n){const i=new jR(vO(t),"object"==typeof e?e:{});return n="function"==typeof e?e:n,i.on("change",n||NS),i}function TC(t,e){const n=this;let i;const s=new jA({highWaterMark:(e="object"==typeof e?e:{encoding:e}).highWaterMark||65536,encoding:e.encoding||"utf8",async read(o){try{i||(i=await oS.call(n,t,"r",e?.mode));const r=await i.read(new Uint8Array(o),0,o,i.file.position);s.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),i.file.position+=r.bytesRead,r.bytesRead||await i.close()}catch(t){await(i?.close()),s.destroy(t)}},destroy(t,e){i?.close().then((()=>e(t))).catch(NS)}});return s.path=t.toString(),s}function IC(t,e){const n=this;let i;e="object"==typeof e?e:{encoding:e};const s=new qA({highWaterMark:e?.highWaterMark,async write(s,o,r){try{i||(i=await oS.call(n,t,"w",e?.mode||438)),await i.write(s,0,o),r(void 0)}catch(t){await(i?.close()),r(t)}},destroy(t,e){e(t),i?.close().then((()=>e(t))).catch(e)},final(t){i?.close().then((()=>t())).catch(t)}});return s.path=t.toString(),s}function mC(t,e,n=NS){n="function"==typeof e?e:n,AS.call(this,t,"function"==typeof e?void 0:e).then((()=>n(void 0))).catch(n)}function EC(t,e,n=NS){n="function"==typeof e?e:n,SS.call(this,t,"function"!=typeof e?e:null).then((t=>n(void 0,t))).catch(n)}function fC(t,e,n,i=NS){i="function"==typeof n?n:i,CS.call(this,t,e,"function"==typeof n?void 0:n).then((()=>i(void 0))).catch(i)}function gC(t,e,n,i=NS){i="function"==typeof n?n:i,new QA(t,this).readv(e,"function"==typeof n?void 0:n).then((({buffers:t,bytesRead:e})=>i(void 0,e,t))).catch(i)}function OC(t,e,n,i=NS){i="function"==typeof n?n:i,new QA(t,this).writev(e,"function"==typeof n?void 0:n).then((({buffers:t,bytesWritten:e})=>i(void 0,e,t))).catch(i)}function MC(t,e,n=NS){n="function"==typeof e?e:n,LS.call(this,t,"function"==typeof e?void 0:e).then((t=>n(void 0,t))).catch(n)}function RC(t,e,n,i=NS){i="function"==typeof n?n:i,yS.call(this,t,e,"function"==typeof n?void 0:n).then((()=>i(void 0))).catch(i)}function AC(t,e,n=NS){n="function"==typeof e?e:n,DS.call(this,t,"function"==typeof e?void 0:e).then((t=>n(void 0,t))).catch(n)}async function SC(t,e){const n=await oS.call(this,t.toString(),"r"),i=await n.readFile();return await n.close(),new Blob([i],e)}var CC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},LC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});function yC(t){return class extends t{constructor(){super(...arguments),this._queue=[],this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise((t=>{const e=()=>this._queueRunning?setTimeout(e):t();e()}))}async ready(){if(await super.ready(),await this.queueDone(),!this._isInitialized&&!this._disableSync){if(this.checkSync(),await this._sync.ready(),this._sync instanceof OR&&this instanceof OR){const t=this._sync.store.transaction(),e=this.store.transaction(),n=[];for(const i of await e.keys())n.push(e.get(i).then((e=>t.setSync(i,e))));return await Promise.all(n),void(this._isInitialized=!0)}try{await this.crossCopy("/"),this._isInitialized=!0}catch(t){throw this._isInitialized=!1,t}}}checkSync(t,e){if(this._disableSync)throw new IO(cO.ENOTSUP,"Sync caching has been disabled for this async file system",t,e);if(!this._sync)throw new IO(cO.ENOTSUP,"No sync cache is attached to this async file system",t,e)}renameSync(t,e){this.checkSync(t,"rename"),this._sync.renameSync(t,e),this.queue("rename",t,e)}statSync(t){return this.checkSync(t,"stat"),this._sync.statSync(t)}createFileSync(t,e,n){return this.checkSync(t,"createFile"),this._sync.createFileSync(t,e,n),this.queue("createFile",t,e,n),this.openFileSync(t,e)}openFileSync(t,e){this.checkSync(t,"openFile");const n=this._sync.openFileSync(t,e+"+"),i=n.statSync(),s=new Uint8Array(i.size);return n.readSync(s),new jM(this,t,e,i,s)}unlinkSync(t){this.checkSync(t,"unlinkSync"),this._sync.unlinkSync(t),this.queue("unlink",t)}rmdirSync(t){this.checkSync(t,"rmdir"),this._sync.rmdirSync(t),this.queue("rmdir",t)}mkdirSync(t,e){this.checkSync(t,"mkdir"),this._sync.mkdirSync(t,e),this.queue("mkdir",t,e)}readdirSync(t){return this.checkSync(t,"readdir"),this._sync.readdirSync(t)}linkSync(t,e){this.checkSync(t,"link"),this._sync.linkSync(t,e),this.queue("link",t,e)}syncSync(t,e,n){this.checkSync(t,"sync"),this._sync.syncSync(t,e,n),this.queue("sync",t,e,n)}existsSync(t){return this.checkSync(t,"exists"),this._sync.existsSync(t)}async crossCopy(t){this.checkSync(t,"crossCopy");const e=await this.stat(t);if(!e.isDirectory()){const n={stack:[],error:void 0,hasError:!1};try{const i=CC(n,await this.openFile(t,xM("r")),!0),s=CC(n,this._sync.createFileSync(t,xM("w"),e.mode),!1),o=new Uint8Array(e.size);return await i.read(o),void s.writeSync(o,0,e.size)}catch(t){n.error=t,n.hasError=!0}finally{const t=LC(n);t&&await t}}if("/"!==t){const e=await this.stat(t);this._sync.mkdirSync(t,e.mode)}const n=[];for(const e of await this.readdir(t))n.push(this.crossCopy(gO(t,e)));await Promise.all(n)}async _next(){if(!this._queueRunning)return;const[t,...e]=this._queue.shift();await this[t](...e),await this._next()}queue(...t){this._queue.push(t),this._next()}}}new Map;yC(qM);new Map;Map;DC=qM;var DC;var NC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},bC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class vC{get isLocked(){return this._isLocked}constructor(t){this.previous=t,this.current=Promise.withResolvers(),this._isLocked=!0}async done(){await(this.previous?.done()),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}}class wC{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){const t=new vC(this.currentLock);return this.currentLock=t,t}async lock(t,e){const n=this.currentLock,i=this.addLock(),s=(new Error).stack;return setTimeout((()=>{if(i.isLocked){const n=IO.With("EDEADLK",t,e);throw n.stack+=s?.slice(5),n}}),5e3),await(n?.done()),i}lockSync(t,e){if(this.currentLock?.isLocked)throw IO.With("EBUSY",t,e);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"rename"),!1);await this._fs.rename(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}renameSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"rename"),!1);return this._fs.renameSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"stat"),!1);return await this._fs.stat(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"stat"),!1);return this._fs.statSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async openFile(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"openFile"),!1);const i=await this._fs.openFile(t,e);return i.fs=this,i}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}openFileSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"openFile"),!1);const i=this._fs.openFileSync(t,e);return i.fs=this,i}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async createFile(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,await this.lock(t,"createFile"),!1);const s=await this._fs.createFile(t,e,n);return s.fs=this,s}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}createFileSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,this.lockSync(t,"createFile"),!1);const s=this._fs.createFileSync(t,e,n);return s.fs=this,s}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}async unlink(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"unlink"),!1);await this._fs.unlink(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}unlinkSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"unlink"),!1);return this._fs.unlinkSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async rmdir(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"rmdir"),!1);await this._fs.rmdir(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}rmdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"rmdir"),!1);return this._fs.rmdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async mkdir(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"mkdir"),!1);await this._fs.mkdir(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}mkdirSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"mkdir"),!1);return this._fs.mkdirSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"readdir"),!1);return await this._fs.readdir(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"readdir"),!1);return this._fs.readdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async exists(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"exists"),!1);return await this._fs.exists(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}existsSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"exists"),!1);return this._fs.existsSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async link(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"link"),!1);await this._fs.link(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}linkSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"link"),!1);return this._fs.linkSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async sync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,await this.lock(t,"sync"),!1);await this._fs.sync(t,e,n)}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}syncSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,this.lockSync(t,"sync"),!1);return this._fs.syncSync(t,e,n)}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}}var FC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},PC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});const kC="/.deleted";class VC extends qM{async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}constructor({writable:t,readable:e}){if(super(),this._isInitialized=!1,this._deletedFiles=new Set,this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this.writable=t,this.readable=e,this.writable.metadata().readonly)throw new IO(cO.EINVAL,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:YC.name}}async sync(t,e,n){await this.copyForWrite(t),await this.writable.exists(t)||await this.writable.createFile(t,"w",420),await this.writable.sync(t,e,n)}syncSync(t,e,n){this.copyForWriteSync(t),this.writable.syncSync(t,e,n)}async _initialize(){if(!this._isInitialized){try{const t=await this.writable.openFile(kC,xM("r")),{size:e}=await t.stat(),{buffer:n}=await t.read(new Uint8Array(e));this._deleteLog=LO(n)}catch(t){if(t.errno!==cO.ENOENT)throw t}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(t){this._deleteLog=t,this._reparseDeletionLog(),await this.updateLog("")}async rename(t,e){this.checkInitialized(),this.checkPath(t),this.checkPath(e),await this.copyForWrite(t);try{await this.writable.rename(t,e)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"rename")}}renameSync(t,e){this.checkInitialized(),this.checkPath(t),this.checkPath(e),this.copyForWriteSync(t);try{this.writable.renameSync(t,e)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"rename")}}async stat(t){this.checkInitialized();try{return await this.writable.stat(t)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"stat");const e=await this.readable.stat(t);return e.mode|=146,e}}statSync(t){this.checkInitialized();try{return this.writable.statSync(t)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"stat");const e=this.readable.statSync(t);return e.mode|=146,e}}async openFile(t,e){if(await this.writable.exists(t))return this.writable.openFile(t,e);const n=await this.readable.openFile(t,xM("r")),i=await n.stat(),{buffer:s}=await n.read(new Uint8Array(i.size));return new jM(this,t,e,i,s)}openFileSync(t,e){if(this.writable.existsSync(t))return this.writable.openFileSync(t,e);const n=this.readable.openFileSync(t,xM("r")),i=n.statSync(),s=new Uint8Array(i.size);return n.readSync(s),new jM(this,t,e,i,s)}async createFile(t,e,n){return this.checkInitialized(),await this.writable.createFile(t,e,n),this.openFile(t,e)}createFileSync(t,e,n){return this.checkInitialized(),this.writable.createFileSync(t,e,n),this.openFileSync(t,e)}async link(t,e){this.checkInitialized(),await this.copyForWrite(t),await this.writable.link(t,e)}linkSync(t,e){this.checkInitialized(),this.copyForWriteSync(t),this.writable.linkSync(t,e)}async unlink(t){if(this.checkInitialized(),this.checkPath(t),!await this.exists(t))throw IO.With("ENOENT",t,"unlink");await this.writable.exists(t)&&await this.writable.unlink(t),await this.exists(t)&&await this.deletePath(t)}unlinkSync(t){if(this.checkInitialized(),this.checkPath(t),!this.existsSync(t))throw IO.With("ENOENT",t,"unlink");this.writable.existsSync(t)&&this.writable.unlinkSync(t),this.existsSync(t)&&this.deletePath(t)}async rmdir(t){if(this.checkInitialized(),!await this.exists(t))throw IO.With("ENOENT",t,"rmdir");if(await this.writable.exists(t)&&await this.writable.rmdir(t),await this.exists(t)){if((await this.readdir(t)).length)throw IO.With("ENOTEMPTY",t,"rmdir");await this.deletePath(t)}}rmdirSync(t){if(this.checkInitialized(),!this.existsSync(t))throw IO.With("ENOENT",t,"rmdir");if(this.writable.existsSync(t)&&this.writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length)throw IO.With("ENOTEMPTY",t,"rmdir");this.deletePath(t)}}async mkdir(t,e){if(this.checkInitialized(),await this.exists(t))throw IO.With("EEXIST",t,"mkdir");await this.createParentDirectories(t),await this.writable.mkdir(t,e)}mkdirSync(t,e){if(this.checkInitialized(),this.existsSync(t))throw IO.With("EEXIST",t,"mkdir");this.createParentDirectoriesSync(t),this.writable.mkdirSync(t,e)}async readdir(t){this.checkInitialized();const e=[];try{e.push(...await this.writable.readdir(t))}catch{}try{e.push(...(await this.readable.readdir(t)).filter((e=>!this._deletedFiles.has(`${t}/${e}`))))}catch{}const n={};return e.filter((t=>{const e=!n[t];return n[t]=!0,e}))}readdirSync(t){this.checkInitialized();let e=[];try{e=e.concat(this.writable.readdirSync(t))}catch{}try{e=e.concat(this.readable.readdirSync(t).filter((e=>!this._deletedFiles.has(`${t}/${e}`))))}catch{}const n={};return e.filter((t=>{const e=!n[t];return n[t]=!0,e}))}async deletePath(t){this._deletedFiles.add(t),await this.updateLog(`d${t}\n`)}async updateLog(t){if(this._deleteLog+=t,this._deleteLogUpdatePending)return void(this._deleteLogUpdateNeeded=!0);this._deleteLogUpdatePending=!0;const e=await this.writable.openFile(kC,xM("w"));try{await e.write(SO(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(t){this._deleteLogError=t}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(const t of this._deleteLog.split("\n"))t.startsWith("d")&&this._deletedFiles.add(t.slice(1))}checkInitialized(){if(!this._isInitialized)throw new IO(cO.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;const t=this._deleteLogError;throw delete this._deleteLogError,t}checkPath(t){if(t==kC)throw IO.With("EPERM",t,"checkPath")}createParentDirectoriesSync(t){let e=OO(t);const n=[];for(;!this.writable.existsSync(e);)n.push(e),e=OO(e);for(const t of n.reverse())this.writable.mkdirSync(t,this.statSync(t).mode)}async createParentDirectories(t){let e=OO(t);const n=[];for(;!await this.writable.exists(e);)n.push(e),e=OO(e);for(const t of n.reverse()){const e=await this.stat(t);await this.writable.mkdir(t,e.mode)}}copyForWriteSync(t){if(!this.existsSync(t))throw IO.With("ENOENT",t,"copyForWrite");this.writable.existsSync(OO(t))||this.createParentDirectoriesSync(t),this.writable.existsSync(t)||this.copyToWritableSync(t)}async copyForWrite(t){if(!await this.exists(t))throw IO.With("ENOENT",t,"copyForWrite");if(await this.writable.exists(OO(t))||await this.createParentDirectories(t),!await this.writable.exists(t))return this.copyToWritable(t)}copyToWritableSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=this.statSync(t);if(n.isDirectory())return void this.writable.mkdirSync(t,n.mode);const i=new Uint8Array(n.size);FC(e,this.readable.openFileSync(t,"r"),!1).readSync(i);FC(e,this.writable.createFileSync(t,"w",146|n.mode),!1).writeSync(i)}catch(t){e.error=t,e.hasError=!0}finally{PC(e)}}async copyToWritable(t){const e={stack:[],error:void 0,hasError:!1};try{const n=await this.stat(t);if(n.isDirectory())return void await this.writable.mkdir(t,n.mode);const i=new Uint8Array(n.size),s=FC(e,await this.readable.openFile(t,"r"),!0);await s.read(i);const o=FC(e,await this.writable.createFile(t,"w",146|n.mode),!0);await o.write(i)}catch(t){e.error=t,e.hasError=!0}finally{const t=PC(e);t&&await t}}}class YC extends(function(t){return class extends wC{constructor(...e){super(),this._fs=new t(...e)}}}(VC)){}function xC(t,e,n){if(t instanceof IO)return t;const i=t instanceof DOMException?cO[function(t){switch(t.name){case"IndexSizeError":case"HierarchyRequestError":case"InvalidCharacterError":case"InvalidStateError":case"SyntaxError":case"NamespaceError":case"TypeMismatchError":case"ConstraintError":case"VersionError":case"URLMismatchError":case"InvalidNodeTypeError":return"EINVAL";case"WrongDocumentError":return"EXDEV";case"NoModificationAllowedError":case"InvalidModificationError":case"InvalidAccessError":case"SecurityError":case"NotAllowedError":return"EACCES";case"NotFoundError":return"ENOENT";case"NotSupportedError":return"ENOTSUP";case"InUseAttributeError":return"EBUSY";case"NetworkError":return"ENETDOWN";case"AbortError":return"EINTR";case"QuotaExceededError":return"ENOSPC";case"TimeoutError":return"ETIMEDOUT";case"ReadOnlyError":return"EROFS";default:return"EIO"}}(t)]:cO.EIO,s=new IO(i,t.message,e,n);return s.stack=t.stack,s.cause=t.cause,s}globalThis.__zenfs__=st;class UC extends(yC(qM)){constructor(t){super(),this._handles=new Map,this._sync=CR.create({name:"accessfs-cache"}),this._handles.set("/",t)}metadata(){return{...super.metadata(),name:"WebAccess",noResizableBuffers:!0}}async sync(t,e){await this.writeFile(t,e)}async rename(t,e){const n=await this.getHandle(t);if(n instanceof FileSystemDirectoryHandle){const n=await this.readdir(t);if(await this.mkdir(e),!n.length)return void await this.unlink(t);for(const i of n)await this.rename(gO(t,i),gO(e,i)),await this.unlink(t);return}if(!(n instanceof FileSystemFileHandle))throw new IO(cO.ENOTSUP,"Not a file or directory handle",t,"rename");const i=await n.getFile().catch((e=>{throw xC(e,t,"rename")})),s=await this.getHandle(OO(e));if(!(s instanceof FileSystemDirectoryHandle))return;const o=await s.getFileHandle(MO(e),{create:!0}).catch((t=>{throw xC(t,e,"rename")})),r=await o.createWritable();await r.write(await i.arrayBuffer()),await r.close(),await this.unlink(t)}async writeFile(t,e){if(e.buffer.resizable)throw new IO(cO.EINVAL,"Resizable buffers can not be written",t,"write");const n=await this.getHandle(OO(t));if(!(n instanceof FileSystemDirectoryHandle))return;const i=await n.getFileHandle(MO(t),{create:!0}),s=await i.createWritable();await s.write(e),await s.close()}async createFile(t,e){return await this.writeFile(t,new Uint8Array),this.openFile(t,e)}async stat(t){const e=await this.getHandle(t);if(!e)throw IO.With("ENOENT",t,"stat");if(e instanceof FileSystemDirectoryHandle)return new FM({mode:511|_M,size:4096});if(e instanceof FileSystemFileHandle){const{lastModified:t,size:n}=await e.getFile();return new FM({mode:511|uM,size:n,mtimeMs:t})}throw new IO(cO.EBADE,"Handle is not a directory or file",t,"stat")}async openFile(t,e){const n=await this.getHandle(t);if(!(n instanceof FileSystemFileHandle))throw IO.With("EISDIR",t,"openFile");const i=await n.getFile().catch((e=>{throw xC(e,t,"openFile")})),s=new Uint8Array(await i.arrayBuffer()),o=new FM({mode:511|uM,size:i.size,mtimeMs:i.lastModified});return new jM(this,t,e,o,s)}async unlink(t){const e=await this.getHandle(OO(t));if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",OO(t),"unlink");await e.removeEntry(MO(t),{recursive:!0}).catch((e=>{throw xC(e,t,"unlink")}))}async link(t){}async rmdir(t){return this.unlink(t)}async mkdir(t){if(await this.getHandle(t).catch((t=>{if("ENOENT"!=t.code)throw t})))throw IO.With("EEXIST",t,"mkdir");const e=await this.getHandle(OO(t));if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",t,"mkdir");await e.getDirectoryHandle(MO(t),{create:!0})}async readdir(t){const e=await this.getHandle(t);if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",t,"readdir");const n=[];for await(const t of e.keys())n.push(t);return n}async getHandle(t){if(this._handles.has(t))return this._handles.get(t);let e="/";for(const n of t.split("/").slice(1)){const t=this._handles.get(e);if(!(t instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",e,"getHandle");e=gO(e,n);const i=await t.getDirectoryHandle(n).catch((i=>{switch(i.name){case"TypeMismatchError":return t.getFileHandle(n).catch((t=>{}));case"TypeError":throw new IO(cO.ENOENT,i.message,e,"getHandle");default:throw xC(i,e,"getHandle")}}));i&&this._handles.set(e,i)}return this._handles.get(t)}}function BC(t){return new Promise(((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)}))}let XC;function GC(){return XC||(XC=function(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const i=BC(n);return(t,n)=>i.then((i=>n(i.transaction(e,t).objectStore(e))))}("keyval-store","keyval")),XC}class HC extends UC{constructor(t){super(t)}async readFile(t){const e=await this.getHandle(t);if(e instanceof window.FileSystemFileHandle){const t=await e.getFile();return await t.text()}return""}}class WC extends rt.FS{#t=null;constructor(){super()}async showDirectoryPicker(){const t=await window.showDirectoryPicker({mode:"readwrite"});if("granted"!==await t.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return await this.setFSCache(t),this.#t=new HC(t),t}async loadFS(){let t=await this.getFSCache();if(!t)return null;if("granted"!==await t.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return this.#t=new HC(t),t}async getFSCache(){return function(t,e=GC()){return e("readonly",(e=>BC(e.get(t))))}("mixly-pyodide-fs")}async setFSCache(t){await function(t,e,n=GC()){return n("readwrite",(n=>(n.put(e,t),BC(n.transaction))))}("mixly-pyodide-fs",t)}async createFile(t){return this.#t.createFile(t,"")}async readFile(t){return this.#t.readFile(t)}async writeFile(t,e){return this.#t.writeFile(t,e,"utf8")}async isFile(t){const e=await this.#t.stat(t);return!(!e||33279!==e.mode)}async renameFile(t,e){return await this.#t.rename(t,e)}async moveFile(t,e){return this.renameFile(t,e)}async deleteFile(t){return this.#t.unlink(t)}async createDirectory(t){return this.#t.mkdir(t,511)}async readDirectory(t){return await this.#t.readdir(t)}async isDirectory(t){const e=await this.#t.stat(t);return!(!e||16895!==e.mode)}async isDirectoryEmpty(t){const e=await this.readDirectory(t);return!e?.length}async renameDirectory(t,e){return this.#t.rename(t,e)}async moveDirectory(t,e){return this.#t.rename(t,e)}async deleteDirectory(t){return this.#t.rmdir(t)}}class KC extends rt.FileTree{constructor(){super(new WC)}async readFolder(t){let e=[];try{const n=this.getFS();if(!await n.isDirectory(t))return e;const i=await n.readDirectory(t);for(let s of i){const i=aO.join(t,s);if(await n.isDirectory(i)){const t=await n.isDirectoryEmpty(i);e.push({type:"folder",id:i,children:!t,title:`/${this.getRootFolderName()}${i}`})}else e.push({type:"file",id:i,children:!1,title:`/${this.getRootFolderName()}${i}`})}}catch(t){rt.Debug.error(t)}return e}}class jC extends rt.PageBase{static{rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem.html",new rt.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > .file-tree {\r\n width: 15%;\r\n height: 100%;\r\n border-right-width: 1px;\r\n border-right-style: solid;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] > .file-tree {\r\n border-right-color: #c9c9c9;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] > .file-tree {\r\n border-right-color: rgba(128, 128, 128, 0.35);\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > .editor {\r\n width: 85%;\r\n height: 100%;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item">\r\n <div class="file-tree"></div>\r\n <div class="editor"></div>\r\n</div>')),rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem-open-fs.html",new rt.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > button {\r\n margin: 15px;\r\n max-width: 200px;\r\n width: 100%;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n color: #fff !important;\r\n height: 25px;\r\n border-radius: 3px;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}">\r\n <button class="layui-btn layui-btn-xs m-btn self-adaption-btn">{{ d.msg.loadFS }}</button>\r\n</div>')),rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem-editor-empty.html",new rt.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > div {\r\n width: 150px;\r\n height: 150px;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] > div {\r\n background: url(\'../common/css/svg/empty/empty-light.svg\');\r\n background-size: 100% auto;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] > div {\r\n background: url(\'../common/css/svg/empty/empty-dark.svg\');\r\n background-size: 100% auto;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item">\r\n <div></div>\r\n</div>')),this.init=function(){rt.StatusBarsManager.typesRegistry.register(["file-system"],jC);const t=rt.Workspace.getMain().getStatusBarsManager();return t.add("file-system","file-system",ot.Msg.PYTHON_PYODIDE_FILE_SYSTEM),t.changeTo("output"),t.get("file-system")}}#e=null;#n=null;#i=null;#s=null;#o=null;#r=null;#a=null;#l=null;#u=!1;#p=!1;#_=!1;#d=null;constructor(){super();const t=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem.html").render());this.setContent(t),this.#a=new KC,this.#n=t.children(".file-tree"),this.#s=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem-open-fs.html").render({msg:{loadFS:ot.Msg.PYTHON_PYODIDE_LOAD_FILE_SYSTEM}})),this.#n.append(this.#s),this.#r=new rt.StatusBar,this.#i=t.children(".editor"),this.#o=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem-editor-empty.html").render()),this.#i.append(this.#o)}#h(){this.#l=new rt.DragV(this.getContent()[0],{min:"150px",startSize:"15%",full:[!1,!1]}),this.#l.bind("sizeChanged",(()=>{this.resize()})),this.#s.children("button").click((()=>{this.selectFS().catch(rt.Debug.error)})),this.#a.bind("beforeSelectLeaf",(t=>{const e=t[0].id,n=this.#r.getFileMode(aO.extname(e));return n?(this.#r.setMode(n),!0):(hO.layer.msg(rt.Msg.Lang["statusbar.ampy.cannotEdit"],{time:1e3}),!1)})),this.#a.bind("afterSelectLeaf",(async t=>{const e=t[0].id;this.#a.showProgress();const n=this.#a.getFS();try{const t=await n.readFile(e);this.showEditor(),this.#r.setValue(t),this.#r.scrollToTop(),this.#r.focus(),this.setStatus(!1)}catch(t){rt.Debug.error(t),this.hideEditor(),this.#a.deselectAll()}this.#a.hideProgress()})),this.#a.bind("afterCreateNode",(t=>{this.#a.refreshFolder(t)})),this.#a.bind("afterDeleteNode",(t=>{this.#a.refreshFolder(t)})),this.#a.bind("afterRenameNode",(t=>{this.#a.refreshFolder(t)})),this.#a.bind("afterRefreshNode",(()=>{this.#a.getSelectedNodeId()||this.hideEditor()}));const t=this.#a.getContextMenu().getItem("menu");t.add({weight:7,type:"copy_path",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["fileTree.copyPath"],""),callback:(t,{$trigger:e})=>{let n=null;n="root"===e.attr("type")?this.#a.getRootFolderTitle():e.attr("title"),navigator.clipboard.writeText(n).catch(rt.Debug.error)}}}),t.add({weight:14,type:"sep5",preconditionFn:t=>{const e=this.#a.getSelectedNodeId();let n=t.attr("type"),i=t.attr("id");return"file"!==n||e===i},data:"---------"}),t.add({weight:15,type:"refresh",preconditionFn:t=>{const e=this.#a.getSelectedNodeId();let n=t.attr("type"),i=t.attr("id");return"file"!==n||e===i},data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["statusbar.ampy.refresh"],""),callback:(t,{$trigger:e})=>{let n=e.attr("type");if("root"===n)this.#a.openRootFolder(),this.#a.refreshFolder("/");else if("folder"===n){let t=e.attr("id");this.#a.openNode(t),this.#a.refreshFolder(t)}else{const t=this.#a.getSelectedNodes();this.#a.runEvent("afterSelectLeaf",t)}}}}),t.add({weight:16,type:"sep6",preconditionFn:t=>{let e=t.attr("type");return["root"].includes(e)},data:"---------"}),t.add({weight:17,type:"exit",preconditionFn:t=>{let e=t.attr("type");return["root"].includes(e)},data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["statusbar.ampy.exit"],""),callback:()=>{this.closeFS()}}}),t.remove("copy"),t.remove("cut"),t.remove("paste"),t.remove("sep2");const e=this.#r.getContextMenu().getItem("code");e.empty(),e.add({weight:0,type:"cut",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.cut"],"Ctrl+X"),callback:()=>this.#r.cut()}}),e.add({weight:1,type:"copy",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.copy"],"Ctrl+C"),callback:()=>this.#r.copy()}}),e.add({weight:2,type:"paste",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.paste"],"Ctrl+V"),callback:()=>this.#r.paste()}}),e.add({weight:3,type:"sep1",data:"---------"}),e.add({weight:4,type:"togglecomment",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.togglecomment"],"Ctrl+/"),callback:()=>this.#r.commentLine()}}),e.add({weight:6,type:"sep2",preconditionFn:()=>this.#_,data:"---------"}),e.add({weight:7,type:"save",preconditionFn:()=>this.#_,data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["file.save"],"Ctrl+S"),callback:async()=>{await this.put()}}});const{commands:n}=this.#r.getEditor();n.addCommand({name:"save",bindKey:"Ctrl-S",exec:async()=>{this.#_&&await this.put()}})}async put(){this.#a.showProgress();const t=this.#a.getSelectedNodeId(),e=this.#a.getFS(),[n]=await e.writeFile(t,this.#r.getValue());this.#a.hideProgress(),n||this.setStatus(!1)}showFileTree(){this.#u||(this.#s.detach(),this.#n.empty(),this.#n.append(this.#a.getContent()),this.#u=!0)}hideFileTree(){this.#u&&(this.#a.getContent().detach(),this.#n.empty(),this.#n.append(this.#s),this.#u=!1)}showEditor(){this.#p||(this.#o.detach(),this.#i.empty(),this.#i.append(this.#r.getContent()),this.#p=!0)}hideEditor(){this.#p&&(this.#r.getContent().detach(),this.#i.empty(),this.#i.append(this.#o),this.#p=!1,this.setStatus(!1))}getDrag(){return this.#l}init(){super.init(),this.hideCloseBtn(),this.#r.init(),this.#h();const t=this.#r.getEditor();t.setReadOnly(!1),t.renderer.setShowGutter(!0),t.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,newLineMode:"unix"}),t.on("change",(()=>{this.setStatus(!0)})),this.loadFS().catch(rt.Debug.error)}async loadFS(){const t=this.#a.getFS(),e=await t.loadFS();await this.openFS(e)}async selectFS(){const t=this.#a.getFS(),e=await t.showDirectoryPicker();await this.openFS(e)}async openFS(t){if(!t?.name)return;const e="/"+t.name;this.#a.setFolderPath("/"),this.#a.setRootFolderTitle(e),this.#a.setRootFolderName(t.name),this.#a.openRootFolder(),this.showFileTree(),this.#d=await window.pyodide.mountNativeFS(e,t)}closeFS(){const t=this.#a.getRootFolderTitle();if(Object.keys(window.pyodide.FS.root.contents).includes(aO.basename(t))){const e=window.pyodide.FS.lookupPath(t,{follow_mount:!1});window.pyodide.FS.isMountpoint(e.node)&&window.pyodide.FS.unmount(t)}this.#a.getFS().setFSCache(null),this.#a.deselectAll(),this.hideFileTree(),this.hideEditor(),this.setStatus(!1)}onMounted(){super.onMounted(),this.#r.onMounted(),this.#a.onMounted()}onUnmounted(){super.onUnmounted(),this.#r.onUnmounted(),this.#a.onUnmounted()}resize(){super.resize(),this.#r.resize(),this.#a.resize()}setStatus(t){this.#_!==t&&(this.#_=t)}getNativeFS(){return this.#d}dispose(){this.#r.dispose(),this.#r=null,this.#a.dispose(),this.#a=null,super.dispose()}}class qC{static{rt.HTMLTemplate.add("html/statusbar/loader.html",new rt.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n align-items: center;\r\n position: absolute;\r\n background-color: transparent !important;\r\n font-size: 12px;\r\n line-height: 12px;\r\n color: #fff;\r\n bottom: 0;\r\n height: var(--footer-height);\r\n width: 100%;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > p {\r\n margin-left: 5px;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}">\r\n <div class="ui mini active inline slow loader"></div>\r\n <p>{{d.msg.loading}}</p>\r\n</div>')),this.pythonShell=null,this.kernelLoaded=!1,this.$loader=uO()(rt.HTMLTemplate.get("html/statusbar/loader.html").render({msg:{loading:ot.Msg.PYTHON_PYODIDE_LOADING}})),this.statusBarImage=null,this.statusBarFileSystem=null,this.init=async function(){rt.app.getFooterBar().getContent().after(this.$loader);const t=aO.relative(rt.Env.indexDirPath,rt.Env.boardDirPath),e=new _O({rootPath:aO.join(t,"deps"),language:"python3"}),n=await e.kernelAvailable();n&&(await n.init(),await n.loaded(),this.loader=e,this.kernel=n,this.statusBarImage=dO.init(),this.statusBarFileSystem=jC.init(),this.pythonShell=new qC,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer),this.kernelLoaded=!0,this.$loader.remove(),this.$loader=null)},this.run=async function(){if(!this.kernelLoaded)return;const t=rt.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=async function(){if(this.kernelLoaded)return this.pythonShell.stop()}}#c=null;#T=null;#I=null;#m={row:0,column:0};#E="";#f=null;#g=null;#O=!1;#M=!1;#R=null;#A=()=>this.#S();#C=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#m.row){const t=this.#c.getEndPos();let e=this.#c.getValueRange(this.#m,t);e=e.replace(this.#E,""),this.#f?.(e),this.#f=null,this.#g=null,this.#c.addValue("\n"),this.#L()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row<this.#m.row||e.column<=this.#m.column}}];constructor(){const t=rt.Workspace.getMain();this.#I=t.getStatusBarsManager(),this.#c=this.#I.getStatusBarById("output"),this.#T=this.#I.getStatusBarById("images"),this.#R=qC.kernel,this.#h()}#h(){this.#R.addEventListener("eval.finished",(()=>{this.#M=!1,this.#c.addValue(`\n==${rt.Msg.Lang["shell.finish"]}==`),this.syncfs(!1).catch(rt.Debug.error)})),this.#R.addEventListener("eval.output",(t=>{this.#c.addValue(t.content)})),this.#R.addEventListener("eval.error",(()=>{this.#M=!1,this.#c.addValue(`\n==${rt.Msg.Lang["shell.finish"]}==`)})),this.#R.addEventListener("eval.input",(t=>{const e=String(t?.content?.prompt);this.#c.addValue(e),this.#E=e,this.#f=t.resolve,this.#g=t.reject,this.#y()})),this.#R.addEventListener("eval.display",(t=>{this.#I.changeTo("images"),this.#T.display(t)}))}#S(){const t=this.#c.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.row<this.#m.row||e.column<this.#m.column)}#y(){if(!this.#M)return;this.#O=!0,this.#m=this.#c.getEndPos();const t=this.#c.getEditor();t.setReadOnly(!1),t.focus();t.getSession().selection.on("changeCursor",this.#A),t.commands.addCommands(this.#C)}#L(){this.#O=!1;const t=this.#c.getEditor();t.getSession().selection.off("changeCursor",this.#A),t.commands.removeCommands(this.#C),this.#E="",this.#f?.(""),this.cursor_={row:0,column:0},t.setReadOnly(!0)}async run(t){await this.stop(),await this.syncfs(!0),-1!==t.indexOf("import turtle")&&(t+="\nturtle.done()\n"),-1!==t.indexOf("import matplotlib.pyplot")&&(t+="\nplt.clf()\n"),this.#I.changeTo("output"),this.#I.show(),this.#c.setValue(`${rt.Msg.Lang["shell.running"]}...\n`),this.#M=!0,this.#R.dispatchEvent("eval.request",{code:t,interactive:!1})}async stop(){if(this.#O&&this.#L(),this.#M){const t=5;qC.interruptBuffer[0]=2;const e=Number(new Date);for(;Number(new Date)-e<1e3*t&&this.#M;)qC.interruptBuffer[0]=2,await this.sleep(100);this.#M=!1}}async syncfs(t=!1){return new Promise((e=>{window.pyodide.FS.syncfs(t,e)}))}sleep(t){return new Promise((e=>setTimeout(e,t)))}}const $C={init:async function(){const t=rt.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:ot.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{qC.run().catch(rt.Debug.error)},scopeType:rt.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:ot.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{qC.stop().catch(rt.Debug.error)},scopeType:rt.Nav.Scope.LEFT,weight:5}),await qC.init()}};$C.init(),Object.assign(ot.Variables,lt),Object.assign(ot.Procedures,Bi),ot.Python=uu,ot.generator=uu,rt.Profile.default={},Object.assign(ot.Blocks,t,e,n,i,s,o,r,a,l,u,p,_,d,C,L,y,D,N,b,v,w,F,P,k,V,Y,x,U),Object.assign(ot.Python.forBlock,h,c,T,I,m,E,f,g,O,M,R,A,S,B,X,G,um,H,W,K,j,q,z,Q,J,Z,tt,et)})()})();