maze-blockly-wrapper 0.2.6 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/blockly-CB1haBOu.cjs +329 -0
  2. package/dist/blockly-CB1haBOu.cjs.map +1 -0
  3. package/dist/blockly-D9trJ_x0.js +329 -0
  4. package/dist/blockly-D9trJ_x0.js.map +1 -0
  5. package/dist/blockly_compressed-Bdba50O4.js +21043 -0
  6. package/dist/{blockly_compressed-BMyLVN-Q.js.map → blockly_compressed-Bdba50O4.js.map} +1 -1
  7. package/dist/blockly_compressed-DKwMdvF1.cjs +21042 -0
  8. package/dist/{blockly_compressed-BSXJbxOI.cjs.map → blockly_compressed-DKwMdvF1.cjs.map} +1 -1
  9. package/dist/blocks-B05dnyOn.js +1707 -0
  10. package/dist/{blocks-B72zId9w.js.map → blocks-B05dnyOn.js.map} +1 -1
  11. package/dist/blocks-BabbRNKU.cjs +1707 -0
  12. package/dist/{blocks-GkRPBplU.cjs.map → blocks-BabbRNKU.cjs.map} +1 -1
  13. package/dist/components/BlocklyDebugTest.d.ts +30 -0
  14. package/dist/components/maze/MazeGame.d.ts +1 -0
  15. package/dist/index-C2TQzLih.js +5038 -0
  16. package/dist/index-C2TQzLih.js.map +1 -0
  17. package/dist/index-CeTmKa8Y.cjs +5053 -0
  18. package/dist/index-CeTmKa8Y.cjs.map +1 -0
  19. package/dist/index.cjs.js +34 -1
  20. package/dist/index.cjs.js.map +1 -1
  21. package/dist/index.esm.js +32 -31
  22. package/dist/javascript-B767_urL.js +969 -0
  23. package/dist/{javascript-CBgY3c4m.js.map → javascript-B767_urL.js.map} +1 -1
  24. package/dist/javascript-Diow8phl.cjs +969 -0
  25. package/dist/{javascript-DCJc0bzp.cjs.map → javascript-Diow8phl.cjs.map} +1 -1
  26. package/dist/utils/blocklySetup.d.ts +4 -0
  27. package/package.json +1 -1
  28. package/dist/blockly-B8_W0qMx.js +0 -328
  29. package/dist/blockly-B8_W0qMx.js.map +0 -1
  30. package/dist/blockly-D-XLGkbZ.cjs +0 -2
  31. package/dist/blockly-D-XLGkbZ.cjs.map +0 -1
  32. package/dist/blockly_compressed-BMyLVN-Q.js +0 -15717
  33. package/dist/blockly_compressed-BSXJbxOI.cjs +0 -792
  34. package/dist/blocks-B72zId9w.js +0 -1316
  35. package/dist/blocks-GkRPBplU.cjs +0 -4
  36. package/dist/index-D10FGDwl.js +0 -3666
  37. package/dist/index-D10FGDwl.js.map +0 -1
  38. package/dist/index-I2TnBYCs.cjs +0 -74
  39. package/dist/index-I2TnBYCs.cjs.map +0 -1
  40. package/dist/javascript-CBgY3c4m.js +0 -819
  41. package/dist/javascript-DCJc0bzp.cjs +0 -219
@@ -1,74 +0,0 @@
1
- "use strict";const k=require("react"),ve=require("react-dom");function br(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const T=br(k);let U,Ge,Te=!1,ue=null;function jt(){return Te?(console.log("[Blockly Setup] Already initialized, returning resolved promise"),Promise.resolve()):ue?(console.log("[Blockly Setup] Initialization already in progress, returning existing promise"),ue):(console.log("[Blockly Setup] Starting Blockly initialization..."),ue=new Promise((t,e)=>{(async()=>{try{if(console.log("[Blockly Setup] Checking Blockly core availability..."),typeof U>"u"){console.log("[Blockly Setup] Blockly not loaded, attempting dynamic import...");try{const n=await Promise.resolve().then(()=>require("./blockly-D-XLGkbZ.cjs"));await Promise.resolve().then(()=>require("./blocks-GkRPBplU.cjs"));const o=await Promise.resolve().then(()=>require("./javascript-DCJc0bzp.cjs"));U=n,Ge=o.javascriptGenerator,console.log("[Blockly Setup] Blockly modules imported successfully")}catch(n){console.error("[Blockly Setup] Failed to import Blockly modules:",n);const o=new Error("Blockly core is not available. Make sure Blockly is properly installed and imported in your project.");e(o);return}}if(console.log("[Blockly Setup] Blockly core is available"),console.log("[Blockly Setup] Setting up locale..."),typeof U.setLocale=="function")try{U.setLocale("en"),console.log("[Blockly Setup] Locale set to English")}catch(n){console.warn("[Blockly Setup] Locale setup failed, using default:",n)}if(console.log("[Blockly Setup] Initializing main workspace access..."),typeof U.getMainWorkspace=="function")try{U.getMainWorkspace(),console.log("[Blockly Setup] Main workspace access initialized")}catch(n){console.log("[Blockly Setup] Main workspace access failed (expected if no workspace exists):",n)}if(console.log("[Blockly Setup] Initializing event system..."),typeof U.Events=="object"&&U.Events.getGroup)try{U.Events.getGroup(),console.log("[Blockly Setup] Event system initialized")}catch(n){console.log("[Blockly Setup] Event system initialization failed (may already be initialized):",n)}if(console.log("[Blockly Setup] Checking JavaScript generator..."),typeof Ge>"u"){const n=new Error("Blockly JavaScript generator is not available. Make sure blockly/javascript is imported.");console.error("[Blockly Setup] Error:",n.message),e(n);return}console.log("[Blockly Setup] JavaScript generator is available"),Te=!0,console.log("[Blockly Setup] ✅ Blockly initialized successfully for package usage"),t()}catch(n){console.error("[Blockly Setup] ❌ Failed to initialize Blockly:",n),ue=null,e(n)}})()}),ue)}function Ze(){return Te&&typeof U<"u"}function Re(){if(!Ze())throw new Error("Blockly is not initialized. Call initializeBlockly() first.");return U}function Se(){if(!Ze())throw new Error("Blockly is not initialized. Call initializeBlockly() first.");return Ge}function Cr(){console.log("[Blockly Setup] Resetting initialization state"),Te=!1,ue=null}function Er(t,e){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>t(...n),e)}}function wr(t,e){let r;return(...n)=>{r||(t(...n),r=!0,setTimeout(()=>r=!1,e))}}function kr(t=8){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function Sr(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Tr(t,e={}){const r=new Date(t),n={year:"numeric",month:"long",day:"numeric",...e};return new Intl.DateTimeFormat("en-US",n).format(r)}function Rr(t){const e=new Date,r=new Date(t),n=Math.floor((e.getTime()-r.getTime())/1e3);if(n<60)return"just now";const o=Math.floor(n/60);if(o<60)return`${o} minute${o===1?"":"s"} ago`;const i=Math.floor(o/60);if(i<24)return`${i} hour${i===1?"":"s"} ago`;const a=Math.floor(i/24);if(a<7)return`${a} day${a===1?"":"s"} ago`;const l=Math.floor(a/7);if(l<4)return`${l} week${l===1?"":"s"} ago`;const u=Math.floor(a/30);if(u<12)return`${u} month${u===1?"":"s"} ago`;const f=Math.floor(a/365);return`${f} year${f===1?"":"s"} ago`}function Ot(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function _r(t){return t.toLowerCase().split(" ").map(e=>Ot(e)).join(" ")}function jr(t,e,r="..."){return t.length<=e?t:t.substring(0,e-r.length)+r}function Or(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}function Mr(t){try{return new URL(t),!0}catch{return!1}}function qe(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array)return t.map(e=>qe(e));if(typeof t=="object"){const e={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=qe(t[r]));return e}return t}function Mt(...t){return t.reduce((e,r)=>{for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(typeof r[n]=="object"&&r[n]!==null&&!Array.isArray(r[n])?e[n]=Mt(e[n]||{},r[n]):e[n]=r[n]);return e},{})}function Nr(t){const e={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r]!==void 0&&t[r]!==null&&(e[r]=t[r]);return e}function zr(t,e,r){const n=e.split(".");let o=t;for(const i of n)if(o&&typeof o=="object"&&i in o)o=o[i];else return r;return o}function Pr(t,e,r){const n=e.split("."),o={...t};let i=o;for(let a=0;a<n.length-1;a++){const l=n[a];(!(l in i)||typeof i[l]!="object")&&(i[l]={}),i=i[l]}return i[n[n.length-1]]=r,o}function Nt(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t===null||e===null)return!1;const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const o of r)if(!n.includes(o)||!Nt(t[o],e[o]))return!1;return!0}function zt(t){return new Promise(e=>setTimeout(e,t))}async function Br(t,e=3,r=1e3){let n;for(let o=0;o<=e;o++)try{return await t()}catch(i){if(n=i,o===e)throw n;const a=r*Math.pow(2,o);await zt(a)}throw n}var $r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Me(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ce={exports:{}},he={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var lt;function Ar(){if(lt)return he;lt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,o,i){var a=null;if(i!==void 0&&(a=""+i),o.key!==void 0&&(a=""+o.key),"key"in o){i={};for(var l in o)l!=="key"&&(i[l]=o[l])}else i=o;return o=i.ref,{$$typeof:t,type:n,key:a,ref:o!==void 0?o:null,props:i}}return he.Fragment=e,he.jsx=r,he.jsxs=r,he}var ye={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var ct;function Ir(){return ct||(ct=1,process.env.NODE_ENV!=="production"&&(function(){function t(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===pe?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case g:return"Fragment";case B:return"Profiler";case b:return"StrictMode";case m:return"Suspense";case W:return"SuspenseList";case de:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case $:return"Portal";case O:return(s.displayName||"Context")+".Provider";case L:return(s._context.displayName||"Context")+".Consumer";case F:var d=s.render;return s=s.displayName,s||(s=d.displayName||d.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case Y:return d=s.displayName||null,d!==null?d:t(s.type)||"Memo";case ie:d=s._payload,s=s._init;try{return t(s(d))}catch{}}return null}function e(s){return""+s}function r(s){try{e(s);var d=!1}catch{d=!0}if(d){d=console;var x=d.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return x.call(d,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(s)}}function n(s){if(s===g)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===ie)return"<...>";try{var d=t(s);return d?"<"+d+">":"<...>"}catch{return"<...>"}}function o(){var s=Q.A;return s===null?null:s.getOwner()}function i(){return Error("react-stack-top-frame")}function a(s){if(ae.call(s,"key")){var d=Object.getOwnPropertyDescriptor(s,"key").get;if(d&&d.isReactWarning)return!1}return s.key!==void 0}function l(s,d){function x(){se||(se=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",d))}x.isReactWarning=!0,Object.defineProperty(s,"key",{get:x,configurable:!0})}function u(){var s=t(this.type);return q[s]||(q[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function f(s,d,x,C,E,R,j,M){return x=R.ref,s={$$typeof:_,type:s,key:d,props:R,_owner:E},(x!==void 0?x:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:u}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:j}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function p(s,d,x,C,E,R,j,M){var w=d.children;if(w!==void 0)if(C)if(me(w)){for(C=0;C<w.length;C++)h(w[C]);Object.freeze&&Object.freeze(w)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(w);if(ae.call(d,"key")){w=t(s);var N=Object.keys(d).filter(function(G){return G!=="key"});C=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",le[w+C]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
- let props = %s;
19
- <%s {...props} />
20
- React keys must be passed directly to JSX without using spread:
21
- let props = %s;
22
- <%s key={someKey} {...props} />`,C,w,N,w),le[w+C]=!0)}if(w=null,x!==void 0&&(r(x),w=""+x),a(d)&&(r(d.key),w=""+d.key),"key"in d){x={};for(var z in d)z!=="key"&&(x[z]=d[z])}else x=d;return w&&l(x,typeof s=="function"?s.displayName||s.name||"Unknown":s),f(s,w,R,E,o(),x,j,M)}function h(s){typeof s=="object"&&s!==null&&s.$$typeof===_&&s._store&&(s._store.validated=1)}var y=k,_=Symbol.for("react.transitional.element"),$=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),O=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),pe=Symbol.for("react.client.reference"),Q=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=Object.prototype.hasOwnProperty,me=Array.isArray,V=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(s){return s()}};var se,q={},H=y.react_stack_bottom_frame.bind(y,i)(),re=V(n(i)),le={};ye.Fragment=g,ye.jsx=function(s,d,x,C,E){var R=1e4>Q.recentlyCreatedOwnerStacks++;return p(s,d,x,!1,C,E,R?Error("react-stack-top-frame"):H,R?V(n(s)):re)},ye.jsxs=function(s,d,x,C,E){var R=1e4>Q.recentlyCreatedOwnerStacks++;return p(s,d,x,!0,C,E,R?Error("react-stack-top-frame"):H,R?V(n(s)):re)}})()),ye}var ut;function Dr(){return ut||(ut=1,process.env.NODE_ENV==="production"?Ce.exports=Ar():Ce.exports=Ir()),Ce.exports}var c=Dr(),Pe={exports:{}};/*!
23
- Copyright (c) 2018 Jed Watson.
24
- Licensed under the MIT License (MIT), see
25
- http://jedwatson.github.io/classnames
26
- */var ft;function Fr(){return ft||(ft=1,(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var i="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(i=o(i,n(l)))}return i}function n(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return r.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var l in i)e.call(i,l)&&i[l]&&(a=o(a,l));return a}function o(i,a){return a?i?i+" "+a:i+a:i}t.exports?(r.default=r,t.exports=r):window.classNames=r})()})(Pe)),Pe.exports}var Lr=Fr();const P=Me(Lr);function Ye(){return Ye=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ye.apply(null,arguments)}function Pt(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function dt(t){return"default"+t.charAt(0).toUpperCase()+t.substr(1)}function Wr(t){var e=Gr(t,"string");return typeof e=="symbol"?e:String(e)}function Gr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function qr(t,e,r){var n=k.useRef(t!==void 0),o=k.useState(e),i=o[0],a=o[1],l=t!==void 0,u=n.current;return n.current=l,!l&&u&&i!==e&&a(e),[l?t:i,k.useCallback(function(f){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y<p;y++)h[y-1]=arguments[y];r&&r.apply(void 0,[f].concat(h)),a(f)},[r])]}function Yr(t,e){return Object.keys(e).reduce(function(r,n){var o,i=r,a=i[dt(n)],l=i[n],u=Pt(i,[dt(n),n].map(Wr)),f=e[n],p=qr(l,a,t[f]),h=p[0],y=p[1];return Ye({},u,(o={},o[n]=h,o[f]=y,o))},t)}function Ue(t,e){return Ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ue(t,e)}function Ur(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ue(t,e)}const Vr=["xxl","xl","lg","md","sm","xs"],Hr="xs",Ne=T.createContext({prefixes:{},breakpoints:Vr,minBreakpoint:Hr}),{Consumer:Zn,Provider:Qn}=Ne;function D(t,e){const{prefixes:r}=k.useContext(Ne);return t||r[e]||e}function Bt(){const{breakpoints:t}=k.useContext(Ne);return t}function $t(){const{minBreakpoint:t}=k.useContext(Ne);return t}function Xr(t){return t&&t.ownerDocument||document}function Jr(t){var e=Xr(t);return e&&e.defaultView||window}function Kr(t,e){return Jr(t).getComputedStyle(t,e)}var Zr=/([A-Z])/g;function Qr(t){return t.replace(Zr,"-$1").toLowerCase()}var en=/^ms-/;function Ee(t){return Qr(t).replace(en,"-ms-")}var tn=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function rn(t){return!!(t&&tn.test(t))}function At(t,e){var r="",n="";if(typeof e=="string")return t.style.getPropertyValue(Ee(e))||Kr(t).getPropertyValue(Ee(e));Object.keys(e).forEach(function(o){var i=e[o];!i&&i!==0?t.style.removeProperty(Ee(o)):rn(o)?n+=o+"("+i+") ":r+=Ee(o)+": "+i+";"}),n&&(r+="transform: "+n+";"),t.style.cssText+=";"+r}var we={exports:{}},ke={exports:{}},A={};/** @license React v16.13.1
27
- * react-is.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var pt;function nn(){if(pt)return A;pt=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,f=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,y=t?Symbol.for("react.suspense_list"):60120,_=t?Symbol.for("react.memo"):60115,$=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,b=t?Symbol.for("react.fundamental"):60117,B=t?Symbol.for("react.responder"):60118,L=t?Symbol.for("react.scope"):60119;function O(m){if(typeof m=="object"&&m!==null){var W=m.$$typeof;switch(W){case e:switch(m=m.type,m){case u:case f:case n:case i:case o:case h:return m;default:switch(m=m&&m.$$typeof,m){case l:case p:case $:case _:case a:return m;default:return W}}case r:return W}}}function F(m){return O(m)===f}return A.AsyncMode=u,A.ConcurrentMode=f,A.ContextConsumer=l,A.ContextProvider=a,A.Element=e,A.ForwardRef=p,A.Fragment=n,A.Lazy=$,A.Memo=_,A.Portal=r,A.Profiler=i,A.StrictMode=o,A.Suspense=h,A.isAsyncMode=function(m){return F(m)||O(m)===u},A.isConcurrentMode=F,A.isContextConsumer=function(m){return O(m)===l},A.isContextProvider=function(m){return O(m)===a},A.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},A.isForwardRef=function(m){return O(m)===p},A.isFragment=function(m){return O(m)===n},A.isLazy=function(m){return O(m)===$},A.isMemo=function(m){return O(m)===_},A.isPortal=function(m){return O(m)===r},A.isProfiler=function(m){return O(m)===i},A.isStrictMode=function(m){return O(m)===o},A.isSuspense=function(m){return O(m)===h},A.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===f||m===i||m===o||m===h||m===y||typeof m=="object"&&m!==null&&(m.$$typeof===$||m.$$typeof===_||m.$$typeof===a||m.$$typeof===l||m.$$typeof===p||m.$$typeof===b||m.$$typeof===B||m.$$typeof===L||m.$$typeof===g)},A.typeOf=O,A}var I={};/** @license React v16.13.1
34
- * react-is.development.js
35
- *
36
- * Copyright (c) Facebook, Inc. and its affiliates.
37
- *
38
- * This source code is licensed under the MIT license found in the
39
- * LICENSE file in the root directory of this source tree.
40
- */var mt;function on(){return mt||(mt=1,process.env.NODE_ENV!=="production"&&(function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,f=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,y=t?Symbol.for("react.suspense_list"):60120,_=t?Symbol.for("react.memo"):60115,$=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,b=t?Symbol.for("react.fundamental"):60117,B=t?Symbol.for("react.responder"):60118,L=t?Symbol.for("react.scope"):60119;function O(v){return typeof v=="string"||typeof v=="function"||v===n||v===f||v===i||v===o||v===h||v===y||typeof v=="object"&&v!==null&&(v.$$typeof===$||v.$$typeof===_||v.$$typeof===a||v.$$typeof===l||v.$$typeof===p||v.$$typeof===b||v.$$typeof===B||v.$$typeof===L||v.$$typeof===g)}function F(v){if(typeof v=="object"&&v!==null){var X=v.$$typeof;switch(X){case e:var be=v.type;switch(be){case u:case f:case n:case i:case o:case h:return be;default:var st=be&&be.$$typeof;switch(st){case l:case p:case $:case _:case a:return st;default:return X}}case r:return X}}}var m=u,W=f,Y=l,ie=a,de=e,pe=p,Q=n,ae=$,me=_,V=r,se=i,q=o,H=h,re=!1;function le(v){return re||(re=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),s(v)||F(v)===u}function s(v){return F(v)===f}function d(v){return F(v)===l}function x(v){return F(v)===a}function C(v){return typeof v=="object"&&v!==null&&v.$$typeof===e}function E(v){return F(v)===p}function R(v){return F(v)===n}function j(v){return F(v)===$}function M(v){return F(v)===_}function w(v){return F(v)===r}function N(v){return F(v)===i}function z(v){return F(v)===o}function G(v){return F(v)===h}I.AsyncMode=m,I.ConcurrentMode=W,I.ContextConsumer=Y,I.ContextProvider=ie,I.Element=de,I.ForwardRef=pe,I.Fragment=Q,I.Lazy=ae,I.Memo=me,I.Portal=V,I.Profiler=se,I.StrictMode=q,I.Suspense=H,I.isAsyncMode=le,I.isConcurrentMode=s,I.isContextConsumer=d,I.isContextProvider=x,I.isElement=C,I.isForwardRef=E,I.isFragment=R,I.isLazy=j,I.isMemo=M,I.isPortal=w,I.isProfiler=N,I.isStrictMode=z,I.isSuspense=G,I.isValidElementType=O,I.typeOf=F})()),I}var ht;function It(){return ht||(ht=1,process.env.NODE_ENV==="production"?ke.exports=nn():ke.exports=on()),ke.exports}/*
41
- object-assign
42
- (c) Sindre Sorhus
43
- @license MIT
44
- */var Be,yt;function an(){if(yt)return Be;yt=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},l=0;l<10;l++)a["_"+String.fromCharCode(l)]=l;var u=Object.getOwnPropertyNames(a).map(function(p){return a[p]});if(u.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(p){f[p]=p}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Be=o()?Object.assign:function(i,a){for(var l,u=n(i),f,p=1;p<arguments.length;p++){l=Object(arguments[p]);for(var h in l)e.call(l,h)&&(u[h]=l[h]);if(t){f=t(l);for(var y=0;y<f.length;y++)r.call(l,f[y])&&(u[f[y]]=l[f[y]])}}return u},Be}var $e,vt;function Qe(){if(vt)return $e;vt=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return $e=t,$e}var Ae,gt;function Dt(){return gt||(gt=1,Ae=Function.call.bind(Object.prototype.hasOwnProperty)),Ae}var Ie,xt;function sn(){if(xt)return Ie;xt=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Qe(),r={},n=Dt();t=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,l,u,f){if(process.env.NODE_ENV!=="production"){for(var p in i)if(n(i,p)){var h;try{if(typeof i[p]!="function"){var y=Error((u||"React class")+": "+l+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}h=i[p](a,p,u,l,null,e)}catch($){h=$}if(h&&!(h instanceof Error)&&t((u||"React class")+": type specification of "+l+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in r)){r[h.message]=!0;var _=f?f():"";t("Failed "+l+" type: "+h.message+(_??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},Ie=o,Ie}var De,bt;function ln(){if(bt)return De;bt=1;var t=It(),e=an(),r=Qe(),n=Dt(),o=sn(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return De=function(l,u){var f=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function h(s){var d=s&&(f&&s[f]||s[p]);if(typeof d=="function")return d}var y="<<anonymous>>",_={array:B("array"),bigint:B("bigint"),bool:B("boolean"),func:B("function"),number:B("number"),object:B("object"),string:B("string"),symbol:B("symbol"),any:L(),arrayOf:O,element:F(),elementType:m(),instanceOf:W,node:pe(),objectOf:ie,oneOf:Y,oneOfType:de,shape:ae,exact:me};function $(s,d){return s===d?s!==0||1/s===1/d:s!==s&&d!==d}function g(s,d){this.message=s,this.data=d&&typeof d=="object"?d:{},this.stack=""}g.prototype=Error.prototype;function b(s){if(process.env.NODE_ENV!=="production")var d={},x=0;function C(R,j,M,w,N,z,G){if(w=w||y,z=z||M,G!==r){if(u){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var X=w+":"+M;!d[X]&&x<3&&(i("You are manually calling a React.PropTypes validation function for the `"+z+"` prop on `"+w+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),d[X]=!0,x++)}}return j[M]==null?R?j[M]===null?new g("The "+N+" `"+z+"` is marked as required "+("in `"+w+"`, but its value is `null`.")):new g("The "+N+" `"+z+"` is marked as required in "+("`"+w+"`, but its value is `undefined`.")):null:s(j,M,w,N,z)}var E=C.bind(null,!1);return E.isRequired=C.bind(null,!0),E}function B(s){function d(x,C,E,R,j,M){var w=x[C],N=q(w);if(N!==s){var z=H(w);return new g("Invalid "+R+" `"+j+"` of type "+("`"+z+"` supplied to `"+E+"`, expected ")+("`"+s+"`."),{expectedType:s})}return null}return b(d)}function L(){return b(a)}function O(s){function d(x,C,E,R,j){if(typeof s!="function")return new g("Property `"+j+"` of component `"+E+"` has invalid PropType notation inside arrayOf.");var M=x[C];if(!Array.isArray(M)){var w=q(M);return new g("Invalid "+R+" `"+j+"` of type "+("`"+w+"` supplied to `"+E+"`, expected an array."))}for(var N=0;N<M.length;N++){var z=s(M,N,E,R,j+"["+N+"]",r);if(z instanceof Error)return z}return null}return b(d)}function F(){function s(d,x,C,E,R){var j=d[x];if(!l(j)){var M=q(j);return new g("Invalid "+E+" `"+R+"` of type "+("`"+M+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return b(s)}function m(){function s(d,x,C,E,R){var j=d[x];if(!t.isValidElementType(j)){var M=q(j);return new g("Invalid "+E+" `"+R+"` of type "+("`"+M+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return b(s)}function W(s){function d(x,C,E,R,j){if(!(x[C]instanceof s)){var M=s.name||y,w=le(x[C]);return new g("Invalid "+R+" `"+j+"` of type "+("`"+w+"` supplied to `"+E+"`, expected ")+("instance of `"+M+"`."))}return null}return b(d)}function Y(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function d(x,C,E,R,j){for(var M=x[C],w=0;w<s.length;w++)if($(M,s[w]))return null;var N=JSON.stringify(s,function(G,v){var X=H(v);return X==="symbol"?String(v):v});return new g("Invalid "+R+" `"+j+"` of value `"+String(M)+"` "+("supplied to `"+E+"`, expected one of "+N+"."))}return b(d)}function ie(s){function d(x,C,E,R,j){if(typeof s!="function")return new g("Property `"+j+"` of component `"+E+"` has invalid PropType notation inside objectOf.");var M=x[C],w=q(M);if(w!=="object")return new g("Invalid "+R+" `"+j+"` of type "+("`"+w+"` supplied to `"+E+"`, expected an object."));for(var N in M)if(n(M,N)){var z=s(M,N,E,R,j+"."+N,r);if(z instanceof Error)return z}return null}return b(d)}function de(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var d=0;d<s.length;d++){var x=s[d];if(typeof x!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+re(x)+" at index "+d+"."),a}function C(E,R,j,M,w){for(var N=[],z=0;z<s.length;z++){var G=s[z],v=G(E,R,j,M,w,r);if(v==null)return null;v.data&&n(v.data,"expectedType")&&N.push(v.data.expectedType)}var X=N.length>0?", expected one of type ["+N.join(", ")+"]":"";return new g("Invalid "+M+" `"+w+"` supplied to "+("`"+j+"`"+X+"."))}return b(C)}function pe(){function s(d,x,C,E,R){return V(d[x])?null:new g("Invalid "+E+" `"+R+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return b(s)}function Q(s,d,x,C,E){return new g((s||"React class")+": "+d+" type `"+x+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+E+"`.")}function ae(s){function d(x,C,E,R,j){var M=x[C],w=q(M);if(w!=="object")return new g("Invalid "+R+" `"+j+"` of type `"+w+"` "+("supplied to `"+E+"`, expected `object`."));for(var N in s){var z=s[N];if(typeof z!="function")return Q(E,R,j,N,H(z));var G=z(M,N,E,R,j+"."+N,r);if(G)return G}return null}return b(d)}function me(s){function d(x,C,E,R,j){var M=x[C],w=q(M);if(w!=="object")return new g("Invalid "+R+" `"+j+"` of type `"+w+"` "+("supplied to `"+E+"`, expected `object`."));var N=e({},x[C],s);for(var z in N){var G=s[z];if(n(s,z)&&typeof G!="function")return Q(E,R,j,z,H(G));if(!G)return new g("Invalid "+R+" `"+j+"` key `"+z+"` supplied to `"+E+"`.\nBad object: "+JSON.stringify(x[C],null," ")+`
45
- Valid keys: `+JSON.stringify(Object.keys(s),null," "));var v=G(M,z,E,R,j+"."+z,r);if(v)return v}return null}return b(d)}function V(s){switch(typeof s){case"number":case"string":case"undefined":return!0;case"boolean":return!s;case"object":if(Array.isArray(s))return s.every(V);if(s===null||l(s))return!0;var d=h(s);if(d){var x=d.call(s),C;if(d!==s.entries){for(;!(C=x.next()).done;)if(!V(C.value))return!1}else for(;!(C=x.next()).done;){var E=C.value;if(E&&!V(E[1]))return!1}}else return!1;return!0;default:return!1}}function se(s,d){return s==="symbol"?!0:d?d["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&d instanceof Symbol:!1}function q(s){var d=typeof s;return Array.isArray(s)?"array":s instanceof RegExp?"object":se(d,s)?"symbol":d}function H(s){if(typeof s>"u"||s===null)return""+s;var d=q(s);if(d==="object"){if(s instanceof Date)return"date";if(s instanceof RegExp)return"regexp"}return d}function re(s){var d=H(s);switch(d){case"array":case"object":return"an "+d;case"boolean":case"date":case"regexp":return"a "+d;default:return d}}function le(s){return!s.constructor||!s.constructor.name?y:s.constructor.name}return _.checkPropTypes=o,_.resetWarningCache=o.resetWarningCache,_.PropTypes=_,_},De}var Fe,Ct;function cn(){if(Ct)return Fe;Ct=1;var t=Qe();function e(){}function r(){}return r.resetWarningCache=e,Fe=function(){function n(a,l,u,f,p,h){if(h!==t){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}n.isRequired=n;function o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i},Fe}var Et;function un(){if(Et)return we.exports;if(Et=1,process.env.NODE_ENV!=="production"){var t=It(),e=!0;we.exports=ln()(t.isElement,e)}else we.exports=cn()();return we.exports}var fn=un();const S=Me(fn),wt={disabled:!1};var dn=process.env.NODE_ENV!=="production"?S.oneOfType([S.number,S.shape({enter:S.number,exit:S.number,appear:S.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&S.oneOfType([S.string,S.shape({enter:S.string,exit:S.string,active:S.string}),S.shape({enter:S.string,enterDone:S.string,enterActive:S.string,exit:S.string,exitDone:S.string,exitActive:S.string})]);const Ft=k.createContext(null);var pn=function(e){return e.scrollTop},ge="unmounted",ne="exited",ee="entering",oe="entered",Ve="exiting",Z=(function(t){Ur(e,t);function e(n,o){var i;i=t.call(this,n,o)||this;var a=o,l=a&&!a.isMounting?n.enter:n.appear,u;return i.appearStatus=null,n.in?l?(u=ne,i.appearStatus=ee):u=oe:n.unmountOnExit||n.mountOnEnter?u=ge:u=ne,i.state={status:u},i.nextCallback=null,i}e.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===ge?{status:ne}:null};var r=e.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==ee&&a!==oe&&(i=ee):(a===ee||a===oe)&&(i=Ve)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===ee){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:ve.findDOMNode(this);a&&pn(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ne&&this.setState({status:ge})},r.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,u=this.props.nodeRef?[l]:[ve.findDOMNode(this),l],f=u[0],p=u[1],h=this.getTimeouts(),y=l?h.appear:h.enter;if(!o&&!a||wt.disabled){this.safeSetState({status:oe},function(){i.props.onEntered(f)});return}this.props.onEnter(f,p),this.safeSetState({status:ee},function(){i.props.onEntering(f,p),i.onTransitionEnd(y,function(){i.safeSetState({status:oe},function(){i.props.onEntered(f,p)})})})},r.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:ve.findDOMNode(this);if(!i||wt.disabled){this.safeSetState({status:ne},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Ve},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:ne},function(){o.props.onExited(l)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:ve.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],f=u[0],p=u[1];this.props.addEndListener(f,p)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===ge)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=Pt(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return k.createElement(Ft.Provider,{value:null},typeof a=="function"?a(o,l):k.cloneElement(k.Children.only(a),l))},e})(k.Component);Z.contextType=Ft;Z.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:S.shape({current:typeof Element>"u"?S.any:function(t,e,r,n,o,i){var a=t[e];return S.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(t,e,r,n,o,i)}}),children:S.oneOfType([S.func.isRequired,S.element.isRequired]).isRequired,in:S.bool,mountOnEnter:S.bool,unmountOnExit:S.bool,appear:S.bool,enter:S.bool,exit:S.bool,timeout:function(e){var r=dn;e.addEndListener||(r=r.isRequired);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return r.apply(void 0,[e].concat(o))},addEndListener:S.func,onEnter:S.func,onEntering:S.func,onEntered:S.func,onExit:S.func,onExiting:S.func,onExited:S.func}:{};function ce(){}Z.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ce,onEntering:ce,onEntered:ce,onExit:ce,onExiting:ce,onExited:ce};Z.UNMOUNTED=ge;Z.EXITED=ne;Z.ENTERING=ee;Z.ENTERED=oe;Z.EXITING=Ve;function mn(){const t=T.version.split(".");return{major:+t[0],minor:+t[1],patch:+t[2]}}function hn(t){if(!t||typeof t=="function")return null;const{major:e}=mn();return e>=19?t.props.ref:t.ref}const yn=!!(typeof window<"u"&&window.document&&window.document.createElement);var He=!1,Xe=!1;try{var Le={get passive(){return He=!0},get once(){return Xe=He=!0}};yn&&(window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,!0))}catch{}function vn(t,e,r,n){if(n&&typeof n!="boolean"&&!Xe){var o=n.once,i=n.capture,a=r;!Xe&&o&&(a=r.__once||function l(u){this.removeEventListener(e,l,i),r.call(this,u)},r.__once=a),t.addEventListener(e,a,He?n:i)}t.addEventListener(e,r,n)}function gn(t,e,r,n){var o=n&&typeof n!="boolean"?n.capture:n;t.removeEventListener(e,r,o),r.__once&&t.removeEventListener(e,r.__once,o)}function Lt(t,e,r,n){return vn(t,e,r,n),function(){gn(t,e,r,n)}}function xn(t,e,r,n){if(n===void 0&&(n=!0),t){var o=document.createEvent("HTMLEvents");o.initEvent(e,r,n),t.dispatchEvent(o)}}function bn(t){var e=At(t,"transitionDuration")||"",r=e.indexOf("ms")===-1?1e3:1;return parseFloat(e)*r}function Cn(t,e,r){r===void 0&&(r=5);var n=!1,o=setTimeout(function(){n||xn(t,"transitionend",!0)},e+r),i=Lt(t,"transitionend",function(){n=!0},{once:!0});return function(){clearTimeout(o),i()}}function En(t,e,r,n){r==null&&(r=bn(t)||0);var o=Cn(t,r,n),i=Lt(t,"transitionend",e);return function(){o(),i()}}function kt(t,e){const r=At(t,e)||"",n=r.indexOf("ms")===-1?1e3:1;return parseFloat(r)*n}function wn(t,e){const r=kt(t,"transitionDuration"),n=kt(t,"transitionDelay"),o=En(t,i=>{i.target===t&&(o(),e(i))},r+n)}function kn(t){t.offsetHeight}const St=t=>!t||typeof t=="function"?t:e=>{t.current=e};function Sn(t,e){const r=St(t),n=St(e);return o=>{r&&r(o),n&&n(o)}}function Tn(t,e){return k.useMemo(()=>Sn(t,e),[t,e])}function Rn(t){return t&&"setState"in t?ve.findDOMNode(t):t??null}const Wt=k.forwardRef(({onEnter:t,onEntering:e,onEntered:r,onExit:n,onExiting:o,onExited:i,addEndListener:a,children:l,childRef:u,...f},p)=>{const h=k.useRef(null),y=Tn(h,u),_=W=>{y(Rn(W))},$=W=>Y=>{W&&h.current&&W(h.current,Y)},g=k.useCallback($(t),[t]),b=k.useCallback($(e),[e]),B=k.useCallback($(r),[r]),L=k.useCallback($(n),[n]),O=k.useCallback($(o),[o]),F=k.useCallback($(i),[i]),m=k.useCallback($(a),[a]);return c.jsx(Z,{ref:p,...f,onEnter:g,onEntered:B,onEntering:b,onExit:L,onExited:F,onExiting:O,addEndListener:m,nodeRef:h,children:typeof l=="function"?(W,Y)=>l(W,{...Y,ref:_}):k.cloneElement(l,{ref:_})})});Wt.displayName="TransitionWrapper";function _n(t){const e=k.useRef(t);return k.useEffect(()=>{e.current=t},[t]),e}function jn(t){const e=_n(t);return k.useCallback(function(...r){return e.current&&e.current(...r)},[e])}const et=(t=>T.forwardRef((e,r)=>c.jsx("div",{...e,ref:r,className:P(e.className,t)}))),Gt=et("h4");Gt.displayName="DivStyledAsH4";const qt=T.forwardRef(({className:t,bsPrefix:e,as:r=Gt,...n},o)=>(e=D(e,"alert-heading"),c.jsx(r,{ref:o,className:P(t,e),...n})));qt.displayName="AlertHeading";function On(t){const e=k.useRef(t);return k.useEffect(()=>{e.current=t},[t]),e}function Mn(t){const e=On(t);return k.useCallback(function(...r){return e.current&&e.current(...r)},[e])}const Nn=["as","disabled"];function zn(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Pn(t){return!t||t.trim()==="#"}function tt({tagName:t,disabled:e,href:r,target:n,rel:o,role:i,onClick:a,tabIndex:l=0,type:u}){t||(r!=null||n!=null||o!=null?t="a":t="button");const f={tagName:t};if(t==="button")return[{type:u||"button",disabled:e},f];const p=y=>{if((e||t==="a"&&Pn(r))&&y.preventDefault(),e){y.stopPropagation();return}a?.(y)},h=y=>{y.key===" "&&(y.preventDefault(),p(y))};return t==="a"&&(r||(r="#"),e&&(r=void 0)),[{role:i??"button",disabled:void 0,tabIndex:e?void 0:l,href:r,target:t==="a"?n:void 0,"aria-disabled":e||void 0,rel:t==="a"?o:void 0,onClick:p,onKeyDown:h},f]}const Bn=T.forwardRef((t,e)=>{let{as:r,disabled:n}=t,o=zn(t,Nn);const[i,{tagName:a}]=tt(Object.assign({tagName:r,disabled:n},o));return c.jsx(a,Object.assign({},o,i,{ref:e}))});Bn.displayName="Button";const $n=["onKeyDown"];function An(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function In(t){return!t||t.trim()==="#"}const Yt=T.forwardRef((t,e)=>{let{onKeyDown:r}=t,n=An(t,$n);const[o]=tt(Object.assign({tagName:"a"},n)),i=Mn(a=>{o.onKeyDown(a),r?.(a)});return In(n.href)||n.role==="button"?c.jsx("a",Object.assign({ref:e},n,o,{onKeyDown:i})):c.jsx("a",Object.assign({ref:e},n,{onKeyDown:r}))});Yt.displayName="Anchor";const Ut=T.forwardRef(({className:t,bsPrefix:e,as:r=Yt,...n},o)=>(e=D(e,"alert-link"),c.jsx(r,{ref:o,className:P(t,e),...n})));Ut.displayName="AlertLink";const Dn={[ee]:"show",[oe]:"show"},Je=T.forwardRef(({className:t,children:e,transitionClasses:r={},onEnter:n,...o},i)=>{const a={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...o},l=k.useCallback((u,f)=>{kn(u),n?.(u,f)},[n]);return c.jsx(Wt,{ref:i,addEndListener:wn,...a,onEnter:l,childRef:hn(e),children:(u,f)=>T.cloneElement(e,{...f,className:P("fade",t,e.props.className,Dn[u],r[u])})})});Je.displayName="Fade";const Fn={"aria-label":S.string,onClick:S.func,variant:S.oneOf(["white"])},rt=T.forwardRef(({className:t,variant:e,"aria-label":r="Close",...n},o)=>c.jsx("button",{ref:o,type:"button",className:P("btn-close",e&&`btn-close-${e}`,t),"aria-label":r,...n}));rt.displayName="CloseButton";rt.propTypes=Fn;const Vt=T.forwardRef((t,e)=>{const{bsPrefix:r,show:n=!0,closeLabel:o="Close alert",closeVariant:i,className:a,children:l,variant:u="primary",onClose:f,dismissible:p,transition:h=Je,...y}=Yr(t,{show:"onClose"}),_=D(r,"alert"),$=jn(B=>{f&&f(!1,B)}),g=h===!0?Je:h,b=c.jsxs("div",{role:"alert",...g?void 0:y,ref:e,className:P(a,_,u&&`${_}-${u}`,p&&`${_}-dismissible`),children:[p&&c.jsx(rt,{onClick:$,"aria-label":o,variant:i}),l]});return g?c.jsx(g,{unmountOnExit:!0,...y,ref:void 0,in:n,children:b}):n?b:null});Vt.displayName="Alert";const Tt=Object.assign(Vt,{Link:Ut,Heading:qt}),fe=T.forwardRef(({bsPrefix:t,bg:e="primary",pill:r=!1,text:n,className:o,as:i="span",...a},l)=>{const u=D(t,"badge");return c.jsx(i,{ref:l,...a,className:P(o,u,r&&"rounded-pill",n&&`text-${n}`,e&&`bg-${e}`)})});fe.displayName="Badge";const J=T.forwardRef(({as:t,bsPrefix:e,variant:r="primary",size:n,active:o=!1,disabled:i=!1,className:a,...l},u)=>{const f=D(e,"btn"),[p,{tagName:h}]=tt({tagName:t,disabled:i,...l}),y=h;return c.jsx(y,{...p,...l,ref:u,disabled:i,className:P(a,f,o&&"active",r&&`${f}-${r}`,n&&`${f}-${n}`,l.href&&i&&"disabled")})});J.displayName="Button";const Ke=T.forwardRef(({bsPrefix:t,size:e,vertical:r=!1,className:n,role:o="group",as:i="div",...a},l)=>{const u=D(t,"btn-group");let f=u;return r&&(f=`${u}-vertical`),c.jsx(i,{...a,ref:l,role:o,className:P(n,f,e&&`${u}-${e}`)})});Ke.displayName="ButtonGroup";const nt=T.forwardRef(({className:t,bsPrefix:e,as:r="div",...n},o)=>(e=D(e,"card-body"),c.jsx(r,{ref:o,className:P(t,e),...n})));nt.displayName="CardBody";const Ht=T.forwardRef(({className:t,bsPrefix:e,as:r="div",...n},o)=>(e=D(e,"card-footer"),c.jsx(r,{ref:o,className:P(t,e),...n})));Ht.displayName="CardFooter";const Xt=T.createContext(null);Xt.displayName="CardHeaderContext";const Jt=T.forwardRef(({bsPrefix:t,className:e,as:r="div",...n},o)=>{const i=D(t,"card-header"),a=k.useMemo(()=>({cardHeaderBsPrefix:i}),[i]);return c.jsx(Xt.Provider,{value:a,children:c.jsx(r,{ref:o,...n,className:P(e,i)})})});Jt.displayName="CardHeader";const Kt=T.forwardRef(({bsPrefix:t,className:e,variant:r,as:n="img",...o},i)=>{const a=D(t,"card-img");return c.jsx(n,{ref:i,className:P(r?`${a}-${r}`:a,e),...o})});Kt.displayName="CardImg";const Zt=T.forwardRef(({className:t,bsPrefix:e,as:r="div",...n},o)=>(e=D(e,"card-img-overlay"),c.jsx(r,{ref:o,className:P(t,e),...n})));Zt.displayName="CardImgOverlay";const Qt=T.forwardRef(({className:t,bsPrefix:e,as:r="a",...n},o)=>(e=D(e,"card-link"),c.jsx(r,{ref:o,className:P(t,e),...n})));Qt.displayName="CardLink";const Ln=et("h6"),er=T.forwardRef(({className:t,bsPrefix:e,as:r=Ln,...n},o)=>(e=D(e,"card-subtitle"),c.jsx(r,{ref:o,className:P(t,e),...n})));er.displayName="CardSubtitle";const tr=T.forwardRef(({className:t,bsPrefix:e,as:r="p",...n},o)=>(e=D(e,"card-text"),c.jsx(r,{ref:o,className:P(t,e),...n})));tr.displayName="CardText";const Wn=et("h5"),rr=T.forwardRef(({className:t,bsPrefix:e,as:r=Wn,...n},o)=>(e=D(e,"card-title"),c.jsx(r,{ref:o,className:P(t,e),...n})));rr.displayName="CardTitle";const nr=T.forwardRef(({bsPrefix:t,className:e,bg:r,text:n,border:o,body:i=!1,children:a,as:l="div",...u},f)=>{const p=D(t,"card");return c.jsx(l,{ref:f,...u,className:P(e,p,r&&`bg-${r}`,n&&`text-${n}`,o&&`border-${o}`),children:i?c.jsx(nt,{children:a}):a})});nr.displayName="Card";const xe=Object.assign(nr,{Img:Kt,Title:rr,Subtitle:er,Body:nt,Link:Qt,Text:tr,Header:Jt,Footer:Ht,ImgOverlay:Zt});function Gn(t,e){return T.Children.toArray(t).some(r=>T.isValidElement(r)&&r.type===e)}function qn({as:t,bsPrefix:e,className:r,...n}){e=D(e,"col");const o=Bt(),i=$t(),a=[],l=[];return o.forEach(u=>{const f=n[u];delete n[u];let p,h,y;typeof f=="object"&&f!=null?{span:p,offset:h,order:y}=f:p=f;const _=u!==i?`-${u}`:"";p&&a.push(p===!0?`${e}${_}`:`${e}${_}-${p}`),y!=null&&l.push(`order${_}-${y}`),h!=null&&l.push(`offset${_}-${h}`)}),[{...n,className:P(r,...a,...l)},{as:t,bsPrefix:e,spans:a}]}const te=T.forwardRef((t,e)=>{const[{className:r,...n},{as:o="div",bsPrefix:i,spans:a}]=qn(t);return c.jsx(o,{...n,ref:e,className:P(r,!a.length&&i)})});te.displayName="Col";const or=T.forwardRef(({bsPrefix:t,fluid:e=!1,as:r="div",className:n,...o},i)=>{const a=D(t,"container"),l=typeof e=="string"?`-${e}`:"-fluid";return c.jsx(r,{ref:i,...o,className:P(n,e?`${a}${l}`:a)})});or.displayName="Container";var We,Rt;function Yn(){if(Rt)return We;Rt=1;var t=process.env.NODE_ENV!=="production",e=function(){};if(t){var r=function(o,i){var a=arguments.length;i=new Array(a>1?a-1:0);for(var l=1;l<a;l++)i[l-1]=arguments[l];var u=0,f="Warning: "+o.replace(/%s/g,function(){return i[u++]});typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}};e=function(n,o,i){var a=arguments.length;i=new Array(a>2?a-2:0);for(var l=2;l<a;l++)i[l-2]=arguments[l];if(o===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");n||r.apply(null,[o].concat(i))}}return We=e,We}var Un=Yn();const ir=Me(Un),Vn={type:S.string,tooltip:S.bool,as:S.elementType},ze=T.forwardRef(({as:t="div",className:e,type:r="valid",tooltip:n=!1,...o},i)=>c.jsx(t,{...o,ref:i,className:P(e,`${r}-${n?"tooltip":"feedback"}`)}));ze.displayName="Feedback";ze.propTypes=Vn;const K=T.createContext({}),ot=T.forwardRef(({id:t,bsPrefix:e,className:r,type:n="checkbox",isValid:o=!1,isInvalid:i=!1,as:a="input",...l},u)=>{const{controlId:f}=k.useContext(K);return e=D(e,"form-check-input"),c.jsx(a,{...l,ref:u,type:n,id:t||f,className:P(r,e,o&&"is-valid",i&&"is-invalid")})});ot.displayName="FormCheckInput";const _e=T.forwardRef(({bsPrefix:t,className:e,htmlFor:r,...n},o)=>{const{controlId:i}=k.useContext(K);return t=D(t,"form-check-label"),c.jsx("label",{...n,ref:o,htmlFor:r||i,className:P(e,t)})});_e.displayName="FormCheckLabel";const ar=T.forwardRef(({id:t,bsPrefix:e,bsSwitchPrefix:r,inline:n=!1,reverse:o=!1,disabled:i=!1,isValid:a=!1,isInvalid:l=!1,feedbackTooltip:u=!1,feedback:f,feedbackType:p,className:h,style:y,title:_="",type:$="checkbox",label:g,children:b,as:B="input",...L},O)=>{e=D(e,"form-check"),r=D(r,"form-switch");const{controlId:F}=k.useContext(K),m=k.useMemo(()=>({controlId:t||F}),[F,t]),W=!b&&g!=null&&g!==!1||Gn(b,_e),Y=c.jsx(ot,{...L,type:$==="switch"?"checkbox":$,ref:O,isValid:a,isInvalid:l,disabled:i,as:B});return c.jsx(K.Provider,{value:m,children:c.jsx("div",{style:y,className:P(h,W&&e,n&&`${e}-inline`,o&&`${e}-reverse`,$==="switch"&&r),children:b||c.jsxs(c.Fragment,{children:[Y,W&&c.jsx(_e,{title:_,children:g}),f&&c.jsx(ze,{type:p,tooltip:u,children:f})]})})})});ar.displayName="FormCheck";const je=Object.assign(ar,{Input:ot,Label:_e}),sr=T.forwardRef(({bsPrefix:t,type:e,size:r,htmlSize:n,id:o,className:i,isValid:a=!1,isInvalid:l=!1,plaintext:u,readOnly:f,as:p="input",...h},y)=>{const{controlId:_}=k.useContext(K);return t=D(t,"form-control"),process.env.NODE_ENV!=="production"&&ir(_==null||!o,"`controlId` is ignored on `<FormControl>` when `id` is specified."),c.jsx(p,{...h,type:e,size:n,ref:y,readOnly:f,id:o||_,className:P(i,u?`${t}-plaintext`:t,r&&`${t}-${r}`,e==="color"&&`${t}-color`,a&&"is-valid",l&&"is-invalid")})});sr.displayName="FormControl";const Hn=Object.assign(sr,{Feedback:ze}),lr=T.forwardRef(({className:t,bsPrefix:e,as:r="div",...n},o)=>(e=D(e,"form-floating"),c.jsx(r,{ref:o,className:P(t,e),...n})));lr.displayName="FormFloating";const it=T.forwardRef(({controlId:t,as:e="div",...r},n)=>{const o=k.useMemo(()=>({controlId:t}),[t]);return c.jsx(K.Provider,{value:o,children:c.jsx(e,{...r,ref:n})})});it.displayName="FormGroup";const cr=T.forwardRef(({as:t="label",bsPrefix:e,column:r=!1,visuallyHidden:n=!1,className:o,htmlFor:i,...a},l)=>{const{controlId:u}=k.useContext(K);e=D(e,"form-label");let f="col-form-label";typeof r=="string"&&(f=`${f} ${f}-${r}`);const p=P(o,e,n&&"visually-hidden",r&&f);return process.env.NODE_ENV!=="production"&&ir(u==null||!i,"`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified."),i=i||u,r?c.jsx(te,{ref:l,as:"label",className:p,htmlFor:i,...a}):c.jsx(t,{ref:l,className:p,htmlFor:i,...a})});cr.displayName="FormLabel";const ur=T.forwardRef(({bsPrefix:t,className:e,id:r,...n},o)=>{const{controlId:i}=k.useContext(K);return t=D(t,"form-range"),c.jsx("input",{...n,type:"range",ref:o,className:P(e,t),id:r||i})});ur.displayName="FormRange";const fr=T.forwardRef(({bsPrefix:t,size:e,htmlSize:r,className:n,isValid:o=!1,isInvalid:i=!1,id:a,...l},u)=>{const{controlId:f}=k.useContext(K);return t=D(t,"form-select"),c.jsx("select",{...l,size:r,ref:u,className:P(n,t,e&&`${t}-${e}`,o&&"is-valid",i&&"is-invalid"),id:a||f})});fr.displayName="FormSelect";const dr=T.forwardRef(({bsPrefix:t,className:e,as:r="small",muted:n,...o},i)=>(t=D(t,"form-text"),c.jsx(r,{...o,ref:i,className:P(e,t,n&&"text-muted")})));dr.displayName="FormText";const pr=T.forwardRef((t,e)=>c.jsx(je,{...t,ref:e,type:"switch"}));pr.displayName="Switch";const Xn=Object.assign(pr,{Input:je.Input,Label:je.Label}),mr=T.forwardRef(({bsPrefix:t,className:e,children:r,controlId:n,label:o,...i},a)=>(t=D(t,"form-floating"),c.jsxs(it,{ref:a,className:P(e,t),controlId:n,...i,children:[r,c.jsx("label",{htmlFor:n,children:o})]})));mr.displayName="FloatingLabel";const Jn={_ref:S.any,validated:S.bool,as:S.elementType},at=T.forwardRef(({className:t,validated:e,as:r="form",...n},o)=>c.jsx(r,{...n,ref:o,className:P(t,e&&"was-validated")}));at.displayName="Form";at.propTypes=Jn;const _t=Object.assign(at,{Group:it,Control:Hn,Floating:lr,Check:je,Switch:Xn,Label:cr,Text:dr,Range:ur,Select:fr,FloatingLabel:mr}),Oe=T.forwardRef(({bsPrefix:t,className:e,as:r="div",...n},o)=>{const i=D(t,"row"),a=Bt(),l=$t(),u=`${i}-cols`,f=[];return a.forEach(p=>{const h=n[p];delete n[p];let y;h!=null&&typeof h=="object"?{cols:y}=h:y=h;const _=p!==l?`-${p}`:"";y!=null&&f.push(`${u}${_}-${y}`)}),c.jsx(r,{ref:o,...n,className:P(e,i,...f)})});Oe.displayName="Row";class hr extends k.Component{createMazeGrid(){const{width:e,height:r,walls:n,finishPosition:o}=this.props.config,i=[];for(let a=0;a<r;a++){i[a]=[];for(let l=0;l<e;l++){const u=n.some(p=>p.x===l&&p.y===a),f=o.x===l&&o.y===a;i[a][l]={isWall:u,isFinish:f,isSpider:!1,isPath:!u}}}return i}render(){const{config:e,cellSize:r}=this.props,{width:n,height:o}=e,i=this.createMazeGrid();return c.jsx("div",{style:{position:"relative",width:n*r,height:o*r,border:"2px solid #333",backgroundColor:"#f0f0f0"},children:i.map((a,l)=>a.map((u,f)=>c.jsxs("div",{style:{position:"absolute",left:f*r,top:l*r,width:r,height:r,backgroundColor:u.isWall?"#333":u.isFinish?"#90EE90":"#f0f0f0",border:"1px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"bold"},children:[u.isFinish&&c.jsx("div",{style:{width:"80%",height:"80%",backgroundColor:"#32CD32",borderRadius:"50%",border:"3px solid #228B22",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"14px",fontWeight:"bold"},children:"🎯"}),u.isWall&&c.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:"#333",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"12px"},children:"🧱"})]},`${f}-${l}`)))})}}class yr extends k.Component{render(){const{position:e,direction:r,size:n}=this.props,o=n,a={north:0,east:90,south:180,west:270}[r];return c.jsx("div",{style:{position:"absolute",left:e.x*o+o/2,top:e.y*o+o/2,width:o*.8,height:o*.8,transform:`translate(-50%, -50%) rotate(${a}deg)`,transition:"all 0.3s ease-in-out",zIndex:10},children:c.jsxs("div",{style:{width:"100%",height:"100%",backgroundColor:"#8B4513",borderRadius:"50%",border:"2px solid #654321",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[c.jsx("div",{style:{width:"30%",height:"30%",backgroundColor:"#FF0000",borderRadius:"50%",position:"absolute",left:"20%",top:"20%",boxShadow:"0 0 5px #FF0000"}}),c.jsx("div",{style:{width:"30%",height:"30%",backgroundColor:"#FF0000",borderRadius:"50%",position:"absolute",right:"20%",top:"20%",boxShadow:"0 0 5px #FF0000"}})]})})}}function vr(){const t=Re();t.Blocks.maze_move_forward={init(){this.appendDummyInput().appendField("Move Forward"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(92),this.setTooltip("Move the spider forward one step"),this.setHelpUrl("")}},t.Blocks.maze_turn_left={init(){this.appendDummyInput().appendField("🔄 Turn Left"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(92),this.setTooltip("Turn the spider 90 degrees to the left"),this.setHelpUrl("")}},t.Blocks.maze_turn_right={init(){this.appendDummyInput().appendField("🔄 Turn Right"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(92),this.setTooltip("Turn the spider 90 degrees to the right"),this.setHelpUrl("")}},t.Blocks.maze_turn_around={init(){this.appendDummyInput().appendField("🔄 Turn Around"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(92),this.setTooltip("Turn the spider 180 degrees around"),this.setHelpUrl("")}}}class gr extends k.Component{constructor(e){super(e),this.state={workspace:null,isInitialized:!1},this.onAnyChange=this.onAnyChange.bind(this)}componentDidMount(){console.log("[MazeBlocklyContainer] Component mounted, starting initialization..."),this.initializeBlockly()}componentDidUpdate(e){e.config.toolbox!==this.props.config.toolbox&&(this.disposeWorkspace(),this.initializeBlockly()),e.config.initialXml!==this.props.config.initialXml&&this.workspace&&this.loadXml(this.props.config.initialXml)}componentWillUnmount(){this.disposeWorkspace()}workspace=null;blocklyDivRef=k.createRef();async initializeBlockly(){if(!this.blocklyDivRef.current){console.error("[MazeBlocklyContainer] Blockly div ref is not available");return}try{console.log("[MazeBlocklyContainer] Starting Blockly initialization..."),console.log("[MazeBlocklyContainer] Calling initializeBlockly()..."),await jt(),console.log("[MazeBlocklyContainer] Blockly initialization completed"),console.log("[MazeBlocklyContainer] Registering maze blocks..."),vr(),console.log("[MazeBlocklyContainer] Maze blocks registered"),console.log("[MazeBlocklyContainer] Registering maze generators..."),this.registerMazeGenerators(),console.log("[MazeBlocklyContainer] Maze generators registered"),console.log("[MazeBlocklyContainer] Getting Blockly instance...");const e=Re();console.log("[MazeBlocklyContainer] Blockly instance obtained:",!!e);const r=this.props.config.toolbox;console.log("[MazeBlocklyContainer] Parsing toolbox XML...");const n=e.utils.xml.textToDom(r);console.log("[MazeBlocklyContainer] Toolbox XML parsed successfully"),console.log("[MazeBlocklyContainer] Injecting Blockly workspace..."),this.workspace=e.inject(this.blocklyDivRef.current,{toolbox:n,scrollbars:!0,trashcan:!0,grid:{spacing:20,length:3,colour:"#ccc",snap:!0},zoom:{controls:!0,wheel:!0,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2}}),console.log("[MazeBlocklyContainer] Workspace injected successfully:",!!this.workspace),console.log("[MazeBlocklyContainer] Loading initial XML..."),this.loadXml(this.props.config.initialXml),console.log("[MazeBlocklyContainer] Initial XML loaded"),console.log("[MazeBlocklyContainer] Adding change listener..."),this.workspace.addChangeListener(this.onAnyChange),console.log("[MazeBlocklyContainer] Change listener added"),this.setState({workspace:this.workspace,isInitialized:!0}),this.props.onWorkspaceChange?.(this.workspace),console.log("[MazeBlocklyContainer] Generating initial code..."),setTimeout(()=>{this.generateCode()},100),console.log("[MazeBlocklyContainer] ✅ Initialization completed successfully")}catch(e){console.error("[MazeBlocklyContainer] ❌ Failed to initialize Blockly:",e),console.error("[MazeBlocklyContainer] Error details:",e)}}registerMazeGenerators(){console.log("[MazeBlocklyContainer] Starting maze generator registration...");try{console.log("[MazeBlocklyContainer] Getting JavaScript generator...");const e=Se();console.log("[MazeBlocklyContainer] JavaScript generator obtained:",!!e),console.log("[MazeBlocklyContainer] Registering generators via direct assignment..."),e.maze_move_forward=function(){return`moveForward();
46
- `},e.maze_turn_left=function(){return`turnLeft();
47
- `},e.maze_turn_right=function(){return`turnRight();
48
- `},e.maze_turn_around=function(){return`turnAround();
49
- `},console.log("[MazeBlocklyContainer] Direct assignment completed"),console.log("[MazeBlocklyContainer] Registering generators via forBlock property...");const r=e;r.forBlock?(r.forBlock.maze_move_forward=function(){return`moveForward();
50
- `},r.forBlock.maze_turn_left=function(){return`turnLeft();
51
- `},r.forBlock.maze_turn_right=function(){return`turnRight();
52
- `},r.forBlock.maze_turn_around=function(){return`turnAround();
53
- `},console.log("[MazeBlocklyContainer] forBlock registration completed")):console.log("[MazeBlocklyContainer] forBlock property not available, skipping"),console.log("[MazeBlocklyContainer] ✅ Maze generators registered successfully")}catch(e){console.error("[MazeBlocklyContainer] ❌ Failed to register maze generators:",e),console.error("[MazeBlocklyContainer] Error details:",e)}}disposeWorkspace(){this.workspace&&(this.workspace.dispose(),this.workspace=null,this.setState({workspace:null,isInitialized:!1}))}onAnyChange(e){if(!this.workspace)return;const r=e?.type||"";(r==="block_create"||r==="block_move"||r==="block_delete"||r==="block_change")&&(this.props.onWorkspaceChange?.(this.workspace),this.generateCode())}generateCode(){if(!(!this.workspace||!this.props.onCodeChange))try{console.log("Generating code for workspace:",this.workspace),console.log("Available blocks:",this.workspace.getAllBlocks(!1));const r=Se().workspaceToCode(this.workspace);console.log("Generated code:",r),this.props.onCodeChange(r)}catch(e){console.error("Failed to generate code:",e),console.error("Error details:",e)}}loadXml(e){if(!(!this.workspace||!e))try{const r=Re(),n=r.utils.xml.textToDom(e);r.Xml.domToWorkspace(n,this.workspace)}catch(r){console.error("Failed to load XML:",r)}}executeCode(){if(!this.workspace)return[];try{console.log("Executing maze code..."),console.log("Workspace state:",this.workspace);const r=Se().workspaceToCode(this.workspace);console.log("Executing maze code:",r);const n=this.parseMovementCode(r);return console.log("Parsed movement commands:",n),this.props.onExecuteCode&&this.props.onExecuteCode(n),n}catch(e){return console.error("Failed to execute code:",e),console.error("Error details:",e),[]}}parseMovementCode(e){const r=[],n=e.split(`
54
- `);for(const o of n){const i=o.trim();i.includes("moveForward()")?r.push({type:"move_forward",direction:"north"}):i.includes("turnLeft()")?r.push({type:"turn_left",direction:"north"}):i.includes("turnRight()")?r.push({type:"turn_right",direction:"north"}):i.includes("turnAround()")&&r.push({type:"turn_around",direction:"north"})}return r}getWorkspace(){return this.workspace}clearWorkspace(){this.workspace?.clear()}render(){const{className:e="",style:r={}}=this.props,{isInitialized:n}=this.state;return c.jsxs("div",{className:`maze-blockly-container ${e}`,style:{width:"100%",height:"400px",position:"relative",...r},children:[c.jsx("div",{ref:this.blocklyDivRef,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0}}),!n&&c.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"#666",fontSize:16},children:"Loading Blockly..."})]})}}const xr=({config:t,onConfigChange:e,className:r})=>{const[n,o]=k.useState("wall"),[i,a]=k.useState(!1),l=(g,b)=>{const B={...t};switch(n){case"start":{B.spiderStart={x:g,y:b};break}case"finish":{B.finishPosition={x:g,y:b};break}case"wall":{B.walls.findIndex(O=>O.x===g&&O.y===b)===-1&&B.walls.push({x:g,y:b});break}case"empty":{B.walls=B.walls.filter(L=>!(L.x===g&&L.y===b));break}}e(B)},u=(g,b)=>{i&&n==="wall"&&l(g,b)},f=(g,b)=>t.walls.some(B=>B.x===g&&B.y===b),p=(g,b)=>t.spiderStart.x===g&&t.spiderStart.y===b,h=(g,b)=>t.finishPosition.x===g&&t.finishPosition.y===b,y=(g,b)=>p(g,b)?"start":h(g,b)?"finish":f(g,b)?"wall":"empty",_=()=>{const g={width:t.width,height:t.height,spiderStart:{x:1,y:1},finishPosition:{x:t.width-2,y:t.height-2},walls:[]},b=t.width*t.height,B=Math.floor(b*.2);for(let L=0;L<B;L++){const O=Math.floor(Math.random()*t.width),F=Math.floor(Math.random()*t.height);O===g.spiderStart.x&&F===g.spiderStart.y||O===g.finishPosition.x&&F===g.finishPosition.y||g.walls.push({x:O,y:F})}e(g)},$=()=>{const g={...t,walls:[]};e(g)};return c.jsxs(xe,{className:r,children:[c.jsx(xe.Header,{children:c.jsxs(Oe,{className:"align-items-center",children:[c.jsx(te,{children:c.jsx("h5",{className:"mb-0",children:"Maze Editor"})}),c.jsx(te,{xs:"auto",children:c.jsxs(Ke,{size:"sm",children:[c.jsx(J,{variant:n==="wall"?"primary":"outline-primary",onClick:()=>o("wall"),children:"Wall"}),c.jsx(J,{variant:n==="empty"?"primary":"outline-primary",onClick:()=>o("empty"),children:"Clear"}),c.jsx(J,{variant:n==="start"?"primary":"outline-primary",onClick:()=>o("start"),children:"Start"}),c.jsx(J,{variant:n==="finish"?"primary":"outline-primary",onClick:()=>o("finish"),children:"Finish"})]})}),c.jsx(te,{xs:"auto",children:c.jsxs(Ke,{size:"sm",children:[c.jsx(J,{variant:"outline-secondary",onClick:_,children:"Regenerate"}),c.jsx(J,{variant:"outline-secondary",onClick:$,children:"Clear All"})]})})]})}),c.jsx(xe.Body,{children:c.jsx("div",{className:"maze-grid",style:{display:"grid",gridTemplateColumns:`repeat(${t.width}, 30px)`,gap:"1px",backgroundColor:"#ccc",padding:"1px"},onMouseDown:()=>a(!0),onMouseUp:()=>a(!1),onMouseLeave:()=>a(!1),children:Array.from({length:t.height},(g,b)=>Array.from({length:t.width},(B,L)=>{const O=y(L,b);return c.jsxs("div",{className:`maze-cell ${O}`,style:{width:"30px",height:"30px",backgroundColor:O==="wall"?"#333":O==="start"?"#28a745":O==="finish"?"#dc3545":"#fff",border:"1px solid #ccc",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:O==="start"||O==="finish"?"white":"black"},onClick:()=>l(L,b),onMouseEnter:()=>u(L,b),title:`${O} at (${L}, ${b})`,children:[O==="start"&&"S",O==="finish"&&"F"]},`${L}-${b}`)}))})})]})};class Kn extends k.Component{constructor(e){super(e),e.configuration&&(this.mazeConfig={...e.configuration}),this.state={gameState:{spiderPosition:{...this.mazeConfig.spiderStart},isGameWon:!1,isGameOver:!1,moveCount:0,maxMoves:e.maxMoves||50},currentDirection:"east",isExecuting:!1,currentCommandIndex:0,generatedCode:"",minSteps:8,isGenerating:!1},e.configuration||this.generateMaze()}componentWillUnmount(){this.executionInterval&&clearInterval(this.executionInterval)}mazeConfig={width:10,height:8,spiderStart:{x:1,y:1},finishPosition:{x:8,y:6},walls:[]};blocklyConfig={allowedTypes:new Set(["maze_move_forward","maze_turn_left","maze_turn_right","maze_turn_around","controls_repeat","controls_if"]),limits:{maze_move_forward:20,maze_turn_left:10,maze_turn_right:10,maze_turn_around:5,controls_repeat:5,controls_if:3},toolbox:`
55
- <xml xmlns="https://developers.google.com/blockly/xml" id="toolbox" style="display:none">
56
- <category name="Movement" colour="#5CA65C">
57
- <block type="maze_move_forward"></block>
58
- <block type="maze_turn_left"></block>
59
- <block type="maze_turn_right"></block>
60
- <block type="maze_turn_around"></block>
61
- </category>
62
- <category name="Control" colour="#A65C81">
63
- <block type="controls_repeat">
64
- <field name="TIMES">3</field>
65
- </block>
66
- <block type="controls_if"></block>
67
- </category>
68
- </xml>
69
- `,initialXml:`
70
- <xml xmlns="https://developers.google.com/blockly/xml">
71
- <block type="maze_move_forward" x="20" y="20"></block>
72
- </xml>
73
- `};executionInterval=null;blocklyRef=k.createRef();generateMaze=()=>{this.setState({isGenerating:!0}),setTimeout(()=>{const e=this.createMazeWithMinSteps(this.state.minSteps);this.mazeConfig=e,this.setState({gameState:{spiderPosition:{...e.spiderStart},isGameWon:!1,isGameOver:!1,moveCount:0,maxMoves:Math.max(50,(e.estimatedSteps||8)+10)},currentDirection:"east",isExecuting:!1,currentCommandIndex:0,isGenerating:!1}),this.blocklyRef.current&&this.blocklyRef.current.clearWorkspace()},100)};createMazeWithMinSteps(e){for(let i=0;i<50;i++){const a=this.generateRandomMaze(10,8),l=this.estimateOptimalSteps(a);if(l>=e&&this.isMazeSolvable(a))return{...a,estimatedSteps:l}}return this.generateFallbackMaze(10,8,e)}generateRandomMaze(e,r){const n=[],o={x:1,y:1},i={x:e-2,y:r-2},a=Math.floor(e*r*(.3+Math.random()*.1));for(let l=0;l<a;l++){const u=Math.floor(Math.random()*e),f=Math.floor(Math.random()*r);u===o.x&&f===o.y||u===i.x&&f===i.y||Math.abs(u-o.x)<=1&&Math.abs(f-o.y)<=1||Math.abs(u-i.x)<=1&&Math.abs(f-i.y)<=1||n.some(p=>p.x===u&&p.y===f)||n.push({x:u,y:f})}return{width:e,height:r,spiderStart:o,finishPosition:i,walls:n}}generateFallbackMaze(e,r,n){const o=[],i={x:1,y:1},a={x:e-2,y:r-2},l=[],u={...i};for(;u.x<a.x||u.y<a.y;)u.x<a.x&&(u.x++,l.push({...u})),u.y<a.y&&(u.y++,l.push({...u}));for(let f=0;f<Math.floor(n/2);f++){const p=Math.floor(Math.random()*(e-2))+1,h=Math.floor(Math.random()*(r-2))+1;!l.some(y=>y.x===p&&y.y===h)&&!o.some(y=>y.x===p&&y.y===h)&&o.push({x:p,y:h})}return{width:e,height:r,spiderStart:i,finishPosition:a,walls:o,estimatedSteps:n}}estimateOptimalSteps(e){const r=Math.abs(e.finishPosition.x-e.spiderStart.x)+Math.abs(e.finishPosition.y-e.spiderStart.y),n=Math.min(e.walls.length*.5,10);return Math.ceil(r+n)}isMazeSolvable(e){const r=new Set,n=[e.spiderStart];for(;n.length>0;){const o=n.shift(),i=`${o.x},${o.y}`;if(r.has(i))continue;if(r.add(i),o.x===e.finishPosition.x&&o.y===e.finishPosition.y)return!0;const a=[{x:o.x+1,y:o.y},{x:o.x-1,y:o.y},{x:o.x,y:o.y+1},{x:o.x,y:o.y-1}];for(const l of a)l.x>=0&&l.x<e.width&&l.y>=0&&l.y<e.height&&!e.walls.some(u=>u.x===l.x&&u.y===l.y)&&!r.has(`${l.x},${l.y}`)&&n.push(l)}return!1}handleCodeChange=e=>{this.setState({generatedCode:e})};handleConfigChange=e=>{this.mazeConfig=e,this.setState({gameState:{...this.state.gameState,spiderPosition:{...e.spiderStart},isGameWon:!1,isGameOver:!1,moveCount:0}}),this.props.onChange&&this.props.onChange(e)};handleExecuteCode=e=>{e.length!==0&&(this.setState({isExecuting:!0,currentCommandIndex:0}),this.executeCommands(e))};executeCommands(e){let r=0;this.executionInterval=setInterval(()=>{if(r>=e.length){this.stopExecution();return}const n=e[r];this.executeCommand(n),r++,this.setState({currentCommandIndex:r})},800)}executeCommand(e){switch(e.type){case"move_forward":this.moveSpiderForward();break;case"turn_left":this.turnSpider("left");break;case"turn_right":this.turnSpider("right");break;case"turn_around":this.turnSpider("around");break}}moveSpiderForward(){const{gameState:e,currentDirection:r}=this.state,n={...e.spiderPosition};switch(r){case"north":n.y=Math.max(0,n.y-1);break;case"south":n.y=Math.min(this.mazeConfig.height-1,n.y+1);break;case"east":n.x=Math.min(this.mazeConfig.width-1,n.x+1);break;case"west":n.x=Math.max(0,n.x-1);break}if(!this.isWall(n)){const o={...e,spiderPosition:n,moveCount:e.moveCount+1};if(this.isFinish(n)&&(o.isGameWon=!0,o.isGameOver=!0),o.moveCount>=e.maxMoves&&(o.isGameOver=!0),this.setState({gameState:o}),o.isGameOver&&this.props.onRunFinish){const i={steps:o.moveCount,reachedFinish:o.isGameWon,maxMovesExceeded:o.moveCount>=e.maxMoves,finalPosition:n,path:[],executionTime:0};this.props.onRunFinish(i)}}}turnSpider(e){const n={north:{left:"west",right:"east",around:"south"},south:{left:"east",right:"west",around:"north"},east:{left:"north",right:"south",around:"west"},west:{left:"south",right:"north",around:"east"}}[this.state.currentDirection][e];this.setState({currentDirection:n})}isWall(e){return this.mazeConfig.walls.some(r=>r.x===e.x&&r.y===e.y)}isFinish(e){return e.x===this.mazeConfig.finishPosition.x&&e.y===this.mazeConfig.finishPosition.y}stopExecution(){this.executionInterval&&(clearInterval(this.executionInterval),this.executionInterval=null),this.setState({isExecuting:!1})}resetGame=()=>{this.setState({gameState:{spiderPosition:{...this.mazeConfig.spiderStart},isGameWon:!1,isGameOver:!1,moveCount:0,maxMoves:Math.max(50,(this.mazeConfig.estimatedSteps||8)+10)},currentDirection:"east",isExecuting:!1,currentCommandIndex:0}),this.blocklyRef.current&&this.blocklyRef.current.clearWorkspace()};runCode=()=>{this.blocklyRef.current&&this.blocklyRef.current.executeCode()};handleGenerateNewMaze=()=>{this.generateMaze()};render(){const{gameState:e,currentDirection:r,isExecuting:n,generatedCode:o,isGenerating:i}=this.state,a=50;return c.jsx("div",{className:`maze-game ${this.props.className||""}`,children:c.jsx(or,{fluid:!0,children:c.jsx(Oe,{children:c.jsx(te,{children:c.jsx(xe,{children:c.jsx(xe.Body,{children:c.jsxs(Oe,{children:[c.jsxs(te,{md:8,children:[c.jsxs("div",{className:"d-flex justify-content-between align-items-center mb-3",children:[c.jsxs("div",{children:[c.jsxs(fe,{bg:"primary",className:"me-2",children:["Moves: ",e.moveCount,"/",e.maxMoves]}),c.jsx(fe,{bg:r==="north"?"success":"secondary",className:"me-1",children:"↑"}),c.jsx(fe,{bg:r==="east"?"success":"secondary",className:"me-1",children:"→"}),c.jsx(fe,{bg:r==="south"?"success":"secondary",className:"me-1",children:"↓"}),c.jsx(fe,{bg:r==="west"?"success":"secondary",className:"me-1",children:"←"})]}),c.jsxs("div",{children:[c.jsx(J,{variant:"success",onClick:this.runCode,disabled:n||e.isGameOver,className:"me-2",children:n?"Running...":"▶️ Run Code"}),c.jsx(J,{variant:"outline-secondary",onClick:this.resetGame,disabled:n,className:"me-2",children:"🔄 Reset"})]})]}),this.props.isEditable&&c.jsxs("div",{className:"d-flex align-items-center mb-3 p-3 bg-light rounded",children:[c.jsxs("div",{className:"me-3",children:[c.jsx(_t.Label,{className:"mb-1 fw-bold",children:"Steps:"}),c.jsx("div",{className:"text-muted",children:this.mazeConfig.estimatedSteps||"Calculating..."})]}),c.jsxs("div",{className:"me-3",children:[c.jsx(_t.Label,{className:"mb-1 fw-bold",children:"Walls:"}),c.jsx("div",{className:"text-muted",children:this.mazeConfig.walls.length})]}),c.jsx(J,{variant:"primary",onClick:this.handleGenerateNewMaze,disabled:n||i,className:"ms-auto",children:i?"🔄 Generating...":"🎲 Generate New Maze"})]}),e.isGameWon&&c.jsx(Tt,{variant:"success",className:"mb-3",children:"🎉 Congratulations! You've reached the finish! 🎯"}),e.isGameOver&&!e.isGameWon&&c.jsx(Tt,{variant:"danger",className:"mb-3",children:"❌ Game Over! You've exceeded the maximum moves."}),this.props.isEditable&&c.jsx("div",{className:"mb-4",children:c.jsx(xr,{config:this.mazeConfig,onConfigChange:this.handleConfigChange})}),c.jsxs("div",{style:{position:"relative",marginBottom:"20px"},children:[c.jsx(hr,{config:this.mazeConfig,cellSize:a}),c.jsx(yr,{position:e.spiderPosition,direction:r,size:a})]})]}),c.jsxs(te,{md:4,children:[c.jsx("h5",{children:"Programming Blocks"}),c.jsx(gr,{ref:this.blocklyRef,config:this.blocklyConfig,onCodeChange:this.handleCodeChange,onExecuteCode:this.handleExecuteCode,style:{height:"300px"}}),c.jsxs("div",{className:"mt-3",children:[c.jsx("h6",{children:"Generated Code:"}),c.jsx("pre",{className:"bg-light p-2 rounded",style:{fontSize:"12px",maxHeight:"150px",overflow:"auto"},children:o||"// No code generated yet"})]})]})]})})})})})})})}}exports.EditableMazeGrid=xr;exports.MazeBlocklyContainer=gr;exports.MazeGame=Kn;exports.MazeGrid=hr;exports.Spider=yr;exports.capitalize=Ot;exports.commonjsGlobal=$r;exports.debounce=Er;exports.deepClone=qe;exports.formatDate=Tr;exports.formatNumber=Sr;exports.formatRelativeTime=Rr;exports.generateId=kr;exports.getBlockly=Re;exports.getDefaultExportFromCjs=Me;exports.getJavaScriptGenerator=Se;exports.getNestedValue=zr;exports.initializeBlockly=jt;exports.isBlocklyReady=Ze;exports.isDeepEqual=Nt;exports.isValidEmail=Or;exports.isValidUrl=Mr;exports.mergeObjects=Mt;exports.registerMazeBlocks=vr;exports.removeEmptyValues=Nr;exports.resetBlocklyInitialization=Cr;exports.retryWithBackoff=Br;exports.setNestedValue=Pr;exports.sleep=zt;exports.throttle=wr;exports.toTitleCase=_r;exports.truncate=jr;
74
- //# sourceMappingURL=index-I2TnBYCs.cjs.map