potatejs 0.12.1 → 0.13.0

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.
package/README.md CHANGED
@@ -23,7 +23,7 @@ Potate supports all the APIs of React including the upcoming concurrent mode API
23
23
 
24
24
  ### Vite
25
25
 
26
- Create your new app with "select a framework: > Vanilla".
26
+ Create your new app with `select a framework: > Vanilla`.
27
27
 
28
28
  ``` bash
29
29
  npm create vite@latest my-app
@@ -31,7 +31,7 @@ cd my-app
31
31
  ```
32
32
 
33
33
  Add `potatejs` as a dependency.
34
- ```
34
+ ``` bash
35
35
  npm install potatejs
36
36
  ```
37
37
 
@@ -61,6 +61,9 @@ const App = props => {
61
61
  <a href="https://vite.dev" target="_blank">
62
62
  <img src={viteLogo} class="logo" alt="Vite logo" />
63
63
  </a>
64
+ <a href="https://github.com/uniho/potate" target="_blank">
65
+ <img class="logo" alt="potate" src="https://raw.githubusercontent.com/uniho/potate/main/assets/potate.svg" />
66
+ </a>
64
67
  <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
65
68
  <img src={javascriptLogo} class="logo vanilla" alt="JavaScript logo" />
66
69
  </a>
@@ -73,7 +76,7 @@ const App = props => {
73
76
  }
74
77
 
75
78
  const root = Potate.createRoot(document.querySelector('#app'))
76
- root.render(Potate.createElement(App)) // ✖ root.render(<App/>) Please avoid JSX at the root
79
+ root.render(<App/>)
77
80
 
78
81
  ```
79
82
 
@@ -91,7 +94,7 @@ Edit your `index.html`.
91
94
  ### Esbuild
92
95
 
93
96
  Add `potatejs` as a dependency. And `esbuild` as a dev dependency.
94
- ```
97
+ ``` bash
95
98
  npm install potatejs
96
99
  npm install -D esbuild
97
100
  ```
@@ -100,14 +103,14 @@ Build your app.
100
103
 
101
104
  NOTE: This CLI is build-only. For watch / dev usage, use esbuild's JS API directly.
102
105
 
103
- ```
106
+ ``` bash
104
107
  npx potatejs src/entry-point.js --outdir dist
105
108
  ```
106
109
 
107
110
 
108
111
  ## Usage
109
112
 
110
- The API is exact same as React so build how you build application with React, but instead of importing from `react` or `react-dom` import from `potate`;
113
+ The API is exact same as React so build how you build application with React, but instead of importing from `react` or `react-dom` import from `potatejs`;
111
114
 
112
115
  ```js
113
116
  import Potate from 'potatejs'
@@ -127,24 +130,50 @@ export default function App(props) {
127
130
  }
128
131
 
129
132
  const root = Potate.createRoot(document.querySelector('#app'))
130
- root.render(Potate.createElement(App)) // ✖ root.render(<App/>) Please avoid JSX at the root
133
+ root.render(<App/>)
131
134
 
132
135
  ```
133
136
 
134
137
 
135
138
  ### Using React 3rd party libraries
136
139
 
137
- Just alias react and react-dom with brahmos. And you are good to go using 3rd party react libraries.
140
+ Just alias react and react-dom with potatejs. And you are good to go using 3rd party react libraries.
138
141
 
139
142
  You need to add following aliases.
143
+
140
144
  ```js
141
- alias: {
142
- react: 'potatejs',
143
- 'react-dom': 'potatejs',
144
- 'react/jsx-runtime': 'potatejs'
145
- },
145
+ // vite.config.ts
146
+ export default defineConfig({
147
+
148
+ resolve: {
149
+ alias: {
150
+ 'react': 'potatejs',
151
+ 'react-dom': 'potatejs',
152
+ 'react/jsx-runtime': 'potatejs',
153
+ },
154
+ },
155
+
156
+ });
157
+
158
+ ```
159
+
160
+ ```json
161
+ // tsconfig.json
162
+ {
163
+ "compilerOptions": {
164
+
165
+ "paths": {
166
+ "react": ["./node_modules/potatejs"],
167
+ "react-dom": ["./node_modules/potatejs"],
168
+ "react/jsx-runtime": ["./node_modules/potatejs"],
169
+ },
170
+
171
+ }
172
+ }
173
+
146
174
  ```
147
175
 
176
+
148
177
  ## Idea
149
178
 
150
179
  It is inspired by the rendering patterns used on hyperHTML and lit-html.
@@ -254,15 +283,16 @@ For the above example, the Brahmos output is 685 bytes, compared to 824 bytes fr
254
283
  - [x] Enhanced `useTransition` hook
255
284
  - [x] Enhanced `useDeferredValue` hook
256
285
  - [x] `use(resource)` API
257
- - [x] `watch(resource)` API
258
- - [x] Provides React 19 style root management.
286
+ - [x] [watch(resource) API](docs/API.md)
287
+ - [x] React 19 style root management
288
+ - [x] Allow using class instead of className
259
289
  - [ ] `use(context)` API
260
- - [ ] `use(store)` API
261
- - [ ] Support for `ref` as a prop
262
- - [ ] Cleanup functions for refs
263
- - [ ] `<Context>` as a provider
264
- - [ ] `startTransition(action)` for POST request.
265
- - [ ] `useEffectEvent` hook
290
+ - [ ] [use(store) API](https://react.dev/blog/2025/04/23/react-labs-view-transitions-activity-and-more#concurrent-stores)
291
+ - [ ] [ref as a prop](https://react.dev/blog/2024/12/05/react-19#ref-as-a-prop)
292
+ - [ ] [Cleanup functions for refs](https://react.dev/blog/2024/12/05/react-19#cleanup-functions-for-refs)
293
+ - [ ] [`<Context>` as a provider](https://react.dev/blog/2024/12/05/react-19#context-as-a-provider)
294
+ - [ ] [startTransition(action) for POST request](https://react.dev/blog/2024/12/05/react-19#actions)
295
+ - [ ] [useEffectEvent hook](https://react.dev/reference/react/useEffectEvent)
266
296
  - [ ] `useImperativeHandle` hook
267
297
  - [ ] `useInsertionEffect` hook
268
298
  - [ ] Clean up
@@ -54,6 +54,11 @@ try {
54
54
  jsx: 'preserve',
55
55
  sourcemap: sourcemap,
56
56
  minify: minify,
57
+ alias: {
58
+ 'react': 'potatejs',
59
+ 'react-dom': 'potatejs',
60
+ 'react/jsx-runtime': 'potatejs',
61
+ },
57
62
  });
58
63
 
59
64
  console.log('✅ Build complete!');
@@ -13394,6 +13394,54 @@ function getLiteralParts(rootPath) {
13394
13394
  stringPart.push(`</${tagName}>`);
13395
13395
  }
13396
13396
  return;
13397
+ } else {
13398
+ const propsProperties = [];
13399
+ openingElement.attributes.forEach((attr) => {
13400
+ if (t.isJSXAttribute(attr)) {
13401
+ let attrName = attr.name.name;
13402
+ const value = attr.value;
13403
+ let valNode;
13404
+ attrName = PROPERTY_ATTRIBUTE_MAP[attrName] || attrName;
13405
+ if (!value) {
13406
+ valNode = { type: "Literal", value: true };
13407
+ } else if (t.isJSXExpressionContainer(value)) {
13408
+ valNode = value.expression;
13409
+ } else {
13410
+ valNode = { type: "Literal", value: value.value };
13411
+ }
13412
+ propsProperties.push({
13413
+ type: "Property",
13414
+ key: { type: "Identifier", name: attrName },
13415
+ value: valNode,
13416
+ kind: "init"
13417
+ });
13418
+ } else if (t.isJSXSpreadAttribute(attr)) {
13419
+ propsProperties.push({
13420
+ type: "SpreadElement",
13421
+ argument: attr.argument
13422
+ });
13423
+ }
13424
+ });
13425
+ let extractedText = "";
13426
+ const children2 = path.get("children");
13427
+ if (Array.isArray(children2)) {
13428
+ children2.forEach((cp) => {
13429
+ if (t.isJSXText(cp.node)) {
13430
+ extractedText += cleanStringForHtml(cp.node.value);
13431
+ }
13432
+ });
13433
+ }
13434
+ const callExpr = {
13435
+ type: "CallExpression",
13436
+ callee: { type: "Identifier", name: "jsx" },
13437
+ arguments: [
13438
+ { type: "Identifier", name: tagName },
13439
+ { type: "ObjectExpression", properties: propsProperties },
13440
+ { type: "Literal", value: extractedText }
13441
+ ]
13442
+ };
13443
+ pushToExpressions(callExpr, path, false);
13444
+ return;
13397
13445
  }
13398
13446
  }
13399
13447
  const children = path.get("children");
@@ -13424,7 +13472,10 @@ function getTaggedTemplate(node) {
13424
13472
  return {
13425
13473
  type: "TaggedTemplateExpression",
13426
13474
  tag: "html",
13427
- template: { strings, expressions },
13475
+ template: {
13476
+ strings,
13477
+ expressions
13478
+ },
13428
13479
  meta: metaStr
13429
13480
  };
13430
13481
  }
@@ -13391,6 +13391,54 @@ function getLiteralParts(rootPath) {
13391
13391
  stringPart.push(`</${tagName}>`);
13392
13392
  }
13393
13393
  return;
13394
+ } else {
13395
+ const propsProperties = [];
13396
+ openingElement.attributes.forEach((attr) => {
13397
+ if (t.isJSXAttribute(attr)) {
13398
+ let attrName = attr.name.name;
13399
+ const value = attr.value;
13400
+ let valNode;
13401
+ attrName = PROPERTY_ATTRIBUTE_MAP[attrName] || attrName;
13402
+ if (!value) {
13403
+ valNode = { type: "Literal", value: true };
13404
+ } else if (t.isJSXExpressionContainer(value)) {
13405
+ valNode = value.expression;
13406
+ } else {
13407
+ valNode = { type: "Literal", value: value.value };
13408
+ }
13409
+ propsProperties.push({
13410
+ type: "Property",
13411
+ key: { type: "Identifier", name: attrName },
13412
+ value: valNode,
13413
+ kind: "init"
13414
+ });
13415
+ } else if (t.isJSXSpreadAttribute(attr)) {
13416
+ propsProperties.push({
13417
+ type: "SpreadElement",
13418
+ argument: attr.argument
13419
+ });
13420
+ }
13421
+ });
13422
+ let extractedText = "";
13423
+ const children2 = path.get("children");
13424
+ if (Array.isArray(children2)) {
13425
+ children2.forEach((cp) => {
13426
+ if (t.isJSXText(cp.node)) {
13427
+ extractedText += cleanStringForHtml(cp.node.value);
13428
+ }
13429
+ });
13430
+ }
13431
+ const callExpr = {
13432
+ type: "CallExpression",
13433
+ callee: { type: "Identifier", name: "jsx" },
13434
+ arguments: [
13435
+ { type: "Identifier", name: tagName },
13436
+ { type: "ObjectExpression", properties: propsProperties },
13437
+ { type: "Literal", value: extractedText }
13438
+ ]
13439
+ };
13440
+ pushToExpressions(callExpr, path, false);
13441
+ return;
13394
13442
  }
13395
13443
  }
13396
13444
  const children = path.get("children");
@@ -13421,7 +13469,10 @@ function getTaggedTemplate(node) {
13421
13469
  return {
13422
13470
  type: "TaggedTemplateExpression",
13423
13471
  tag: "html",
13424
- template: { strings, expressions },
13472
+ template: {
13473
+ strings,
13474
+ expressions
13475
+ },
13425
13476
  meta: metaStr
13426
13477
  };
13427
13478
  }
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- var Po=Object.defineProperty;var Oo=(e,t)=>{for(var n in t)Po(e,n,{get:t[n],enumerable:!0})};var Jt={};Oo(Jt,{Children:()=>_o,Component:()=>R,Fragment:()=>Mr,PureComponent:()=>se,StrictMode:()=>vr,Suspense:()=>be,SuspenseList:()=>V,cloneElement:()=>Xt,createContext:()=>At,createElement:()=>uo,createPortal:()=>yo,createRef:()=>Zn,createRoot:()=>xo,forwardRef:()=>st,html:()=>Eo,initWatch:()=>Ro,isValidElement:()=>Ao,jsx:()=>Lr,jsxDev:()=>Hr,jsxs:()=>kr,lazy:()=>To,memo:()=>qt,render:()=>Wt,startTransition:()=>nt,unmountComponentAtNode:()=>go,unstable_batchedUpdates:()=>wr,unstable_deferredUpdates:()=>Ze,unstable_syncUpdates:()=>fe,use:()=>Fo,useCallback:()=>kn,useContext:()=>Yn,useDebugValue:()=>Bn,useDeferredValue:()=>Kn,useEffect:()=>bt,useLayoutEffect:()=>It,useMemo:()=>Rt,useReducer:()=>Ln,useRef:()=>wn,useState:()=>Ft,useTransition:()=>Dt,watch:()=>Zt});var ve=Symbol.for("react.element"),sn=Symbol.for("react.forward_ref"),an="{{brahmos}}",cn={key:1,ref:1},ln={className:"class",htmlFor:"for",acceptCharset:"accept-charset",httpEquiv:"http-equiv",tabIndex:"tabindex"},ut={doubleclick:"dblclick"},pn=typeof Symbol!="undefined"?/fil|che|rad/i:/fil|che|ra/i,un=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,dn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,dt="http://www.w3.org/1999/xlink",fn=100,d="__brahmosData",Me="__brahmosLastArrayDom",we="__rootFiber",S="sync",y="deferred",he="js",U="immediate_action",C="transition",Le=0,ft=1,x=2,mn="initial",ie="start",ae="suspended",Ee="resolved",mt="completed",K="timedOut";function Tn(e){return e[0]==="o"&&e[1]==="n"}function ke(e){let t=un.test(e)?e.replace(/[A-Z0-9]/,"-$&").toLowerCase():e;return ln[e]||t}function Tt(e){return e.nodeName.toLowerCase()}function hn(e,t){return t&&(e=e.replace(/Capture$/,"")),e.replace("on","").toLowerCase()}function X(e){return e==null}var Uo=0;function j(){return Uo++}function En(){return Date.now()}function He(e){e.__brahmosData={events:{}}}function ce(e,t){if(!("key"in e||"ref"in e&&!t))return e;let n={},o;for(o in e)o!=="key"&&(o!=="ref"||t)&&(n[o]=e[o]);return n}function ye(e,t){let n=Object.keys(e);for(let o=0,r=n.length;o<r;o++){let s=n[o],a=e[s];t(s,a)}}function ge(e){Array.isArray(e)||(e=[e]);for(let t=e.length-1;t>=0;t--)e[t].remove()}function $(e,t){return t=t||0,Array.prototype.slice.call(e,t)}function vo(e){let t=e instanceof NodeList;if(e instanceof Node)return e;if(Array.isArray(e)||t){let n=document.createDocumentFragment(),o=0;for(;e[o];)n.appendChild(e[o]),t||(o+=1);return n}return document.createTextNode(e)}function Be(e,t,n){let o=vo(n),r;return Array.isArray(n)?r=n:o instanceof DocumentFragment?r=$(o.childNodes):r=n,e.insertBefore(o,t),r}function le(e,t){return t?t.nextSibling:e.firstChild}function w(e,t,n){if(e[t])return e[t].apply(e,n)}function yn(e,t){let n=t===0?e.firstChild:e.childNodes[t],o=document.createTextNode("");return e.insertBefore(o,n),o}var Ye=Promise.resolve();function Ce(e){return Ye.then(e)}function Ke(){return j()+"-"+Math.random()*1e6}function gn(e){let t="pending",n,o=e.then(r=>{t="success",n=r},r=>{t="error",n=r});return{read(){if(t==="pending")throw o;if(t==="error")throw n;if(t==="success")return n}}}function je(e){return e[d].mounted}function ht(e){return e.displayName||e.name}function pe({children:e}){return e}var $e={transitionId:"",tryCount:0,transitionState:K},b={transitionId:Ke(),tryCount:0,transitionState:K};function Mo(e){let{transitionState:t}=e;return t===ie||t===Ee||t===K}function Se(e){let{transitionState:t}=e;return t===mt||t===K}function Cn(e){let{transitionState:t}=e;t!==K&&t!==ae&&(e.isPending?(e.clearTimeout(),e.updatePendingState(!1,C)):e.transitionState=mt)}function q(e,t){return t=t||$e,e.root.currentTransition||t}function Et(e){let{pendingTransitions:t}=e;return t.find(Mo)}var yt=Symbol.for("tag"),Q=Symbol.for("tag-element"),P=Symbol.for("class-component"),gt=Symbol.for("functional-component"),z=Symbol.for("attribute");function G({nodeType:e}){return e===Q}function Z({nodeType:e}){return e===yt}function B(e){return G(e)||Z(e)}function A({nodeType:e}){return e===P||e===gt}function Y(e){return typeof e=="string"||typeof e=="number"}function ze(e){return!(X(e)||typeof e=="boolean")}function Ct(e,t){let n=e&&e.key;return n===void 0?t:n}function Ge(e,t,n){return{$$typeof:ve,nodeType:null,key:n,ref:null,portalContainer:null,type:null,props:e,values:t,template:null}}var Nn;function St(e){Nn=e}function N(){return Nn}function Ne(e){return e===y?"lastDeferredCompleteTime":"lastCompleteTime"}function J(e){return e===y?"deferredUpdateTime":"updateTime"}function L(e,t){let n=J(t),o=j();for(;e;)e[n]=o,e=e.parent}function _n(e,t,n){t===n?n.child=e:t.sibling=e,e.parent=n}function F(e,t){e.hasUncommittedEffect=t,e.root.hasUncommittedEffect=!0}function Ve(e,t,n,o){let{root:r,node:s,part:a,nodeInstance:i,child:c}=e,l=J(r.updateType);return t?(t.node=s,t.part=a,t.createdAt=j()):(t=ue(r,s,a),wo(e,t)),e.shouldTearDown=!1,t.nodeInstance=i,t.child=c,t[l]=o[l],_n(t,n,o),t}function An(e,t){return e===t?e.child:e.sibling}function ee(e){let{child:t,root:n}=e;if(n.updateType===S)return;let o;for(;t;){let{alternate:r}=t;o=Ve(t,r,o||e,e),t=t.sibling}}function We(e){let t=[];return{updateType:y,updateSource:he,cancelSchedule:null,domNode:e,forcedUpdateWith:null,current:null,wip:null,child:null,retryFiber:null,currentTransition:null,hasUncommittedEffect:!1,pendingTransitions:[],tearDownFibers:[],postCommitEffects:[],batchUpdates:{},lastDeferredCompleteTime:0,lastCompleteTime:0,deferredUpdateTime:0,updateTime:0,afterRender(n){t.includes(n)||t.push(n)},callRenderCallbacks(){for(let n=0,o=t.length;n<o;n++)t[n]()},resetRenderCallbacks(){t=[]}}}function ue(e,t,n){return t&&t.portalContainer&&(n.parentNode=t.portalContainer),{node:t,nodeInstance:null,root:e,parent:null,child:null,sibling:null,part:n,alternate:null,context:null,childFiberError:null,isSvgPart:!1,deferredUpdateTime:0,updateTime:0,processedTime:0,createdAt:j(),shouldTearDown:!1,hasUncommittedEffect:Le}}function wo(e,t){e&&(e.alternate=t),t.alternate=e}function te(e,t,n,o,r){let{root:s}=o,a=J(s.updateType),i;return n&&!X(n.node)&&!X(e)&&Lo(e,n.node)?(i=Ve(n,n.alternate,o,r),i.node=e,i.part=t):(i=ue(s,e,t),n&&ne(n)),_n(i,o,r),i.processedTime=0,i[a]=r[a],i.context=r.context,i.isSvgPart=r.isSvgPart,i}function Lo(e,t){return Y(e)&&Y(t)||e.nodeType===z||Array.isArray(e)&&Array.isArray(t)||(A(e)||G(e))&&e.type===t.type||Z(e)&&e.template===t.template}function ko(e,t,n){return e&&e[n]>=t}function Sn(e,t,n){if(e){for(;e&&!ko(e,t,n);)e=e.sibling;return e}}function xn(e,t,n,o){let r=Sn(e.child,n,o);if(r)return r;let s;for(;!(s=Sn(e.sibling,n,o));)if(e=e.parent,e===t)return e;return s}function v(e){return e[d].fiber}function Fn(e){let{root:t,child:n}=e;n&&n.createdAt>t.lastCompleteTime&&(e.child=n.alternate)}function ne(e){e.shouldTearDown=!0,e.root.tearDownFibers.push(e)}var qe=he,Xe=$e;function oe(){return qe}function Nt(){return Xe}function I(e,t){qe=e,t(),qe=he}function re(e,t){let n=Xe;Xe=e,I(C,t),Xe=n}function Rn(e){return e.updateSource===U}function Ho(){return qe===C}function _e(){return Ho()?y:S}function Qe(e){return e===y?"pendingDeferredUpdates":"pendingSyncUpdates"}function de(e){let{root:{updateType:t},nodeInstance:n}=e,o=n[d],r=Qe(t);if(t===S)return o[r];let s=q(e,null).transitionId;return o[r].filter(a=>a.transitionId===s)}function Ze(e){re(b,e)}function fe(e){I(U,e)}function Bo(e,t){let{root:n}=e;for(;e.nodeInstance!==t;)if(e=e.parent,e===n)return null;return e}function Je(e,t){let n,o,r=!0,s=e[d],a=N();if(a){let{renderCount:l}=s;if(l>50)throw new Error("Too many rerender. Check your setState call, this may cause an infinite loop.");let{root:p}=a;p.retryFiber=Bo(a,e),n=p.updateType,o=p.currentTransition||$e,r=!1}else s.renderCount=0,n=_e(),o=Nt();let i=Qe(n),c=t(o.transitionId);return s[i].push(c),r}var Yo=1;function _t(e){return function(t){let n=v(e),{updateType:o}=n.root;e.context!==t&&(e[d].isDirty=!0,L(n,o))}}function At(e){let t=`cC${Yo++}`;class n extends R{constructor(a){super(a),this.subs=[]}shouldComponentUpdate(a){let{value:i}=this.props;return i!==a.value&&this.subs.forEach(c=>c(a.value)),!0}sub(a){let{subs:i}=this,c=_t(a);i.push(c);let{componentWillUnmount:l}=a;a.componentWillUnmount=()=>{i.splice(i.indexOf(c),1),l&&l()}}render(){return this.props.children}}n.__ccId=t;class o extends R{render(){return this.props.children(this.context)}}let r={id:t,defaultValue:e,Provider:n,Consumer:o};return o.contextType=r,r}function In(){return N().nodeInstance}function Dn(e){let{renderCount:t}=e[d];e.deferredHooks=e.syncHooks.map((n,o)=>Array.isArray(n)?[...n]:n.transitionId?n:n.hasOwnProperty("current")&&t>1?e.deferredHooks[o]||n:{...n})}function Pn(e,t){let{syncHooks:n,deferredHooks:o}=t;return e===S?n:o}function et(e){let{nodeInstance:t,root:{updateType:n}}=e;return Pn(n,t)}function bn(e,t,n){return e===y&&!n.deferredHooks.length&&Dn(n),Pn(e,n)[t]}function On(e,t){if(!e||!t||e.length!==t.length)return!0;for(let n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!0;return!1}function Ko(e,t,n){(oe()===U||!Object.is(t,n))&&M(e)}function xt(e){return!1}function Un(e){return e}function tt(e,t,n){let o=N(),{nodeInstance:r}=o,{pointer:s}=r,a=et(o),i=a[s];return(!i||t(i))&&(i=e(),a[s]=i),r.pointer+=1,n(i)}function vn(){let e=N(),{nodeInstance:t,root:{updateType:n}}=e;t.pointer=0,n===y&&Dn(t),de(e).forEach(r=>r.updater())}function Mn(e,t){let n=In(),{pointer:o}=n;return tt(()=>(typeof e=="function"&&(e=e()),[e,s=>{let a=_e(),i=bn(S,o,n),c=i[0],l=t(s,c);Je(n,f=>({transitionId:f,updater(){let m=bn(a,o,n);m[0]=t(s,i[0])}}))&&Ko(n,l,c)}]),xt,Un)}function Ft(e){return Mn(e,(t,n)=>(typeof t=="function"&&(t=t(n)),t))}function wn(e){return tt(()=>({current:e}),xt,Un)}function Ln(e,t,n){return Mn(n?()=>n(t):t,(r,s)=>e(s,r))}function Rt(e,t){return tt(()=>({value:e(),dependencies:t}),s=>On(t,s.dependencies),s=>s.value)}function kn(e,t){return Rt(()=>e,t)}function Hn(e,t){let n=N(),{nodeInstance:o}=n,{pointer:r}=o,s=et(n),a=s[r]||{animationFrame:null,cleanEffect:null},i={...a,isDependenciesChanged:On(t,a.dependencies),dependencies:t,effect(){i.isDependenciesChanged&&e(i)}};s[r]=i,o.pointer+=1}function bt(e,t){Hn(n=>{cancelAnimationFrame(n.animationFrame),n.animationFrame=requestAnimationFrame(()=>{setTimeout(()=>{n.cleanEffect=e()})})},t)}function It(e,t){Hn(n=>{n.cleanEffect=e()},t)}function Bn(){}function Yn(e){let{nodeInstance:t,context:n}=N(),{id:o,defaultValue:r}=e,s=n[o],a=s?s.props.value:r;return It(()=>{if(s){let{subs:i}=s,c=_t(t);return i.push(c),()=>{i.splice(i.indexOf(c),1)}}},[]),t.context=a,a}function nt(e){re(b,e)}function Dt(){let e=In();return tt(()=>{let t={transitionId:Ke(),tryCount:0,isPending:!1,transitionTimeout:null,pendingSuspense:[],transitionState:mn,clearTimeout(){clearTimeout(t.transitionTimeout)},updatePendingState(n,o){t.isPending=n,e[d].isDirty=!0;let r=()=>{M(e)};o===C?re(t,r):I(o,r)},startTransition(n){let o=oe(),{root:r}=v(e);t.transitionState=ie,t.pendingSuspense=[],t.clearTimeout(),re(t,n),r.lastDeferredCompleteTime<r.deferredUpdateTime&&t.updatePendingState(!0,o)}};return t},xt,({startTransition:t,isPending:n})=>[n,t])}function Kn(e,t){let[n,o]=Ft(t!==void 0?t:e),[,r]=Dt();return bt(()=>{r(()=>{o(e)})},[e,r]),n}function jn(e){let t=et(e);for(let n=0,o=t.length;n<o;n++){let r=t[n];r.effect&&r.effect()}}function ot(e,t){let n=et(e);for(let o=0,r=n.length;o<r;o++){let s=n[o];s.cleanEffect&&(s.isDependenciesChanged||t)&&s.cleanEffect(),s.clearTimeout&&t&&s.clearTimeout()}}function Pt(e){return{syncHooks:[],deferredHooks:[],context:void 0,pointer:0,__render(t){vn();let n=e(t);return this[d].nodes=n,n},[d]:{pendingSyncUpdates:[],pendingDeferredUpdates:[],fiber:null,nodes:null,isDirty:!1,mounted:!1,renderCount:0}}}function jo(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(!hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Ot=jo;function $o(e){let{root:t}=e;for(;(e=e.parent)&&!(e.nodeInstance instanceof R&&(e.nodeInstance.componentDidCatch||e.node.type.getDerivedStateFromError));)if(e===t)return null;return e}function zo(e){let t="";for(;e;){let{node:n}=e;n&&A(n)&&n.type!==pe&&(t+=` at ${ht(n.type)}
2
- `),e=e.parent}return{componentStack:t}}function Go(e){let{node:{type:t},nodeInstance:n,parent:o}=e,{__ccId:r}=t,s=o.context||{};if(!r)return s;let a=Object.create(s);return a[r]=n,a}function Vo(e,t){return t.reduce((n,{state:o})=>(typeof o=="function"&&(o=o(n)),{...n,...o}),e)}function $n(e){let{root:t,nodeInstance:n}=e;n[d].isDirty=!0,t.retryFiber=e}function Ut(e){let{node:t,part:n,root:o,childFiberError:r}=e,{type:s,nodeType:a,props:i={}}=t,{currentTransition:c}=o,l=o.updateType===y,p=!0,f=!1,m=a===P;Fn(e);let{nodeInstance:u}=e,T=!1;u||(u=m?new s(i):Pt(s),e.nodeInstance=u,T=!0);let _=u[d],E=Go(e);if(e.context=E,m){let h=u,g=_,{committedValues:k,memoizedValues:O}=g;T&&(k.state=h.state);let{props:W,state:Te}=k;O&&c&&c.transitionId===O.transitionId&&({props:W,state:Te}=O,f=!0),h.props=W,h.state=Te;let{shouldComponentUpdate:en}=h,H=Te,lt=de(e);lt.length&&(H=Vo(Te,lt));let tn=!T&&o.forcedUpdateWith!==u,nn=w(s,"getDerivedStateFromProps",[i,H]),on=r?w(s,"getDerivedStateFromError",[r.error]):void 0;(nn||on)&&(H={...H,...nn,...on}),h.isPureReactComponent&&tn&&(p=!Ot(H,Te)||!Ot(i,W)),en&&p&&tn&&(p=en.call(h,i,H));let{contextType:rn}=s;if(rn){let{id:Oe,defaultValue:pt}=rn,Ue=E[Oe],Do=Ue?Ue.props.value:pt;Ue&&T&&Ue.sub(h),h.context=Do}h.state=H,h.props=i,lt.forEach(({callback:Oe})=>{if(Oe){let{updateSource:pt}=o;Ce(()=>{I(pt,()=>Oe(H))})}}),c&&(g.memoizedValues={state:H,props:i,transitionId:c.transitionId})}if(p){St(e),_.renderCount+=1;let h=r&&!s.getDerivedStateFromError;try{h?_.nodes=null:u.__render(i)}catch(g){let k=$o(e);if(typeof g.then=="function"){let O=rt(e);if(!O)throw new Error("Rendering which got suspended can't be used outside of suspense.");O.nodeInstance.handleSuspender(g,O);let W=zn(O);$n(W)}else if(k&&!k.childFiberError){let O=zo(e);console.error(g);let W=`The above error occurred in the <${ht(t.type)}> component:
3
- ${O.componentStack}`;console.error(W),k.childFiberError={error:g,errorInfo:O},$n(k)}else throw g;return}finally{St(null);let g=u[d];if(m&&l){let{committedValues:k}=g;Object.assign(u,k)}}}if(f||p){let{child:h}=e,{nodes:g}=_;!h||h.node!==g?(te(g,n,h,e,e),F(e,x)):f||ee(e)}else ee(e)}function Gn(e){let{node:t,alternate:n}=e,o=n&&n.node;t!==o&&F(e,x)}function vt(e,t){let{type:n}=e,o=t?document.createElementNS("http://www.w3.org/2000/svg",n):document.createElement(n);return He(o),{fragment:[o],domNodes:[o],parts:[{previousSibling:null,parentNode:o,isNode:!0}]}}function Wo(e){return!!e&&e.nodeType===8&&e.textContent===an}var Ae=class{constructor(t,n){this.templateResult=t,t.create(n),this.fragment=this.createNode(n),this.parts=this.getParts(),this.domNodes=$(this.fragment.childNodes),this.patched=!1}createNode(t){let{template:n,svgTemplate:o}=this.templateResult,r=t?o:n;return document.importNode(r.content,!0)}getParts(){let{fragment:t,templateResult:n}=this,{partsMeta:o}=n,r=[],s=t.querySelectorAll("*");for(let a=0,i=o.length;a<i;a++){let c=o[a],{isAttribute:l,attrIndex:p,refNodeIndex:f,prevChildIndex:m,hasExpressionSibling:u}=c,T=s[f];if(l)c.tagAttrs||(c.tagAttrs=$(T.attributes)),r.push({isAttribute:!0,tagAttrs:c.tagAttrs,domNode:T,attrIndex:p}),He(T);else{T=T||t;let _=m!==-1,E,h=T.childNodes[m+1];_&&Wo(h)&&ge(h),_?u?E=yn(T,m):E=T.childNodes[m]:E=null,r.push({isNode:!0,parentNode:T,previousSibling:E})}}return r}patchParts(t){let{parts:n}=this,{parentNode:o,previousSibling:r}=t;if(!this.patched){for(let s=0,a=n.length;s<a;s++){let i=n[s];i.isNode&&i.parentNode instanceof DocumentFragment&&(i.parentNode=o,i.previousSibling=i.previousSibling||r)}this.patched=!0}}};function Xo(e,t,n){let o=e.lastIndexOf(t);return n<=o}function qo(e,t){return{nodeType:z,props:e,ref:t}}function Qo(e,t,n){let o=n,r=n.child;for(let s=0,a=e.length;s<a;s++){let i=e[s],c=t[s],l;if(i.isAttribute){let{domNode:p}=i,f={},m;for(;i&&p===i.domNode;)ye(t[s],(u,T)=>{let _=i,E=ke(u);!Xo(_.tagAttrs,E,_.attrIndex)&&!cn[u]?f[u]=T:u==="ref"&&(m=T)}),i=e[++s];s--,i=e[s],l=qo(f,m)}else i.isNode&&(l=c);o=te(l,i,r,o,n),r=r&&r.sibling}}function Mt(e){let{node:t}=e,{part:n,alternate:o,parent:{context:r}}=e,s=o&&o.node,{values:a,nodeType:i}=t,c=i===Q,l=e.isSvgPart||t.type==="svg";e.isSvgPart=l;let{nodeInstance:p}=e;p||(p=c?vt(t,l):new Ae(t.template,l),e.nodeInstance=p),c||p.patchParts(n),t!==s?c?te(t.props.children,p.parts[0],e.child,e,e):Qo(p.parts,a,e):ee(e),F(e,x),e.context=r}function Vn(e,t){let{type:n}=t,o=Tt(t);return ut[e]?ut[e]:/^change(textarea|input)/i.test(e+o)&&!pn.test(n)?"input":e}function wt(e){let{type:t}=e,n=Tt(e);if(n==="input"&&(t==="radio"||t==="checkbox"))return"checked";if(n==="input"||n==="select"||n==="textarea")return"value"}function Wn(e){let t=wt(e);if(!t)return;let n=e[`${t}Prop`],o=e[t];n!==void 0&&n!==o&&(e[t]=n)}function Xn(e,t,n,o){e==="checked"?n==="checked"?(t.checked=o,t.checkedProp=o):n==="defaultChecked"&&t.checkedProp===void 0?t.checked=o:t[n]=o:e==="value"&&(n==="value"?(t.value=o,t.valueProp=o):n==="defaultValue"&&t.valueProp===void 0?t.value=o:t[n]=o)}function qn(e,t,n){let o=e.__brahmosData.events,r=o[t];return r?(r.handler=n,r.patched):(r=o[t]={handler:n,patched:null},r.patched=function(s){r.handler&&fe(()=>{r.handler.call(this,s)})},r.patched)}function Qn(e,t,n,o){t=t||{},ye(e,(r,s)=>{let a=t[r];s!==a&&o(r,s,a)}),ye(t,(r,s)=>{e[r]===void 0&&s!==void 0&&o(r,n,s)})}function Zo(e,t,n,o,r){if(t==="children")return;if(Tn(t)){let a=t.substr(-7)==="Capture"&&t.substr(-14,7)==="Pointer",i=hn(t,a);i=Vn(i,e);let c=qn(e,t,n);o&&!n?e.removeEventListener(i,c,a):!o&&n&&e.addEventListener(i,c,a)}else if(t==="style"){let{style:a}=e;Qn(n||{},o,"",(i,c)=>{i[0]==="-"?a.setProperty(i,c):a[i]=typeof c=="number"&&dn.test(i)===!1?c+"px":c})}else if(t==="dangerouslySetInnerHTML"){let a=o&&o.__html,i=n&&n.__html;i!==a&&(e.innerHTML=i==null?"":i)}else if(t in e&&!r){let a=wt(e);a?Xn(a,e,t,n):e[t]=n==null?"":n}else{t=ke(t);let a=t.replace(/^xlink:?/,""),i=n==null||n===!1;t!==a?(a=a.toLowerCase(),i?e.removeAttributeNS(dt,a):e.setAttributeNS(dt,a,n)):i?e.removeAttribute(t):e.setAttribute(t,n)}}function Lt(e,t,n,o){Qn(t,n,null,(r,s,a)=>{Zo(e,r,s,a,o)}),Wn(e)}function st(e){function t(n){return e(ce(n,!1),n.ref)}return t.__isForwardRef=!0,t.$$typeof=sn,t}function Zn(){return{current:null}}function xe(e,t){typeof e=="function"?e(t):typeof e=="object"&&(e.current=t)}function Jo(e){let{node:t,alternate:n}=e,o=e.part,{parentNode:r,previousSibling:s}=o,a=le(r,s);n&&a?a.nodeValue=t:Be(r,a,t)}function er(e){for(;e.child&&e.node&&!B(e.node);)e=e.child;return e}function Jn(e,t){let{domNodes:n}=t;e[Me]=n[n.length-1]}function eo(e,t){if(e.isArrayNode&&e.nodeIndex===0)for(;e=e.parentArrayPart;)e.firstDOMNode=t}function to(e){let{previousSibling:t}=e;if(e.isArrayNode){let{firstDOMNode:n,nodeIndex:o}=e;o>0?t=e.parentNode[Me]:e.parentArrayPart&&(t=n?n.previousSibling:e.parentNode[Me])}return t}function no(e,t){let{part:n}=e;if(!n.isArrayNode)return;let{nodeIndex:o,parentNode:r}=n,s=t.part.nodeIndex,a=er(e),{nodeInstance:i}=a,c=a!==e&&a.hasUncommittedEffect;if(!(!i||c)){if(o!==s){let{domNodes:l}=i,p=to(n),f=le(r,p),m=l[0];m&&m.previousSibling!==p&&m!==f&&Be(r,f,l),eo(n,m)}Jn(r,i)}}function tr(e){let{nodeInstance:t,alternate:n,node:o}=e,r=e.part,{parentNode:s}=r,a=G(o);if(a&&oo(e,t.domNodes[0]),n)no(e,n);else{let i=to(r),c=le(s,i),l=Be(s,c,t.fragment);a||(t.domNodes=l),eo(r,l[0]),Jn(s,t)}}function nr(e){let{node:t,nodeInstance:n,root:o}=e,{updateType:r}=o,{nodeType:s}=t,a=n[d],i=r===y;if(s===P){i&&Object.assign(n,a.memoizedValues);let{props:p,state:f}=a.committedValues;a.lastSnapshot=w(n,"getSnapshotBeforeUpdate",[p,f])}else ot(e,!1);let{transitionId:c}=q(e,null),l=Qe(r);a[l]=i?a[l].filter(p=>p.transitionId!==c):[],a.isDirty=!1,a.renderCount=0,o.postCommitEffects.push(e)}function or(e){let{node:t,nodeInstance:n,root:o,childFiberError:r}=e,{updateType:s}=o,{nodeType:a,ref:i}=t,c=n[d];if(a===P){let{props:l,state:p}=n,{committedValues:f,lastSnapshot:m}=c,{props:u,state:T}=f;u?w(n,"componentDidUpdate",[u,T,m]):w(n,"componentDidMount"),r&&(w(n,"componentDidCatch",[r.error,r.errorInfo]),e.childFiberError=null),i&&xe(i,n),f.props=l,f.state=p,c.memoizedValues=null}else if(jn(e),s===y){let{syncHooks:l,deferredHooks:p}=n;n.deferredHooks=l,n.syncHooks=p}c.mounted=!0,c.fiber=e}function oo(e,t){let{node:n,alternate:o,isSvgPart:r}=e,{props:s,ref:a}=n,i=o&&o.node.props;Lt(t,s,i,r),a&&xe(a,t)}function it(e){e.tearDownFibers=[],e.postCommitEffects=[],e.hasUncommittedEffect=!1,e.retryFiber=null,e.resetRenderCallbacks()}function rr(e){e.node=null,e.nodeInstance=null,e.child=null,e.sibling=null}function kt(e){let{currentTransition:t,pendingTransitions:n}=e,o=n.indexOf(t);o!==-1&&n.splice(o,1)}function sr(e){let{node:t,alternate:n}=e,o=t&&A(t);o&&n&&no(e,n),e.hasUncommittedEffect===x&&(Y(t)?Jo(e):B(t)?tr(e):o?nr(e):t.nodeType===z&&oo(e,e.part.domNode),e.hasUncommittedEffect=Le),n&&rr(n)}function ro(e){let{updateType:t,wip:n,current:o}=e,r=J(t),s=e[Ne(t)],a=[],i=t===S?o:n;for(;i;){let{createdAt:c,node:l,child:p,hasUncommittedEffect:f}=i,m=i[r],u=c>s,T=f||m>s;if(f&&a.push(i),u&&(p&&p.parent!==i&&(p.parent=i),l&&A(l)&&(i.nodeInstance[d].fiber=i)),p&&T)i=p;else{for(;i!==e&&!i.sibling;)i=i.parent;i=i.sibling}}return a}function Ht(e,t){for(let o=0,r=t.length;o<r;o++)sr(t[o]);let{postCommitEffects:n}=e;for(let o=n.length-1;o>=0;o--)or(n[o]);kt(e),it(e),e.forcedUpdateWith=null}function Bt(e){let{node:t,part:n}=e,o=e,{parentNode:r,previousSibling:s,firstDOMNode:a}=n,i=new Map,c=0,l=e;for(;l=An(l,e);){let p=Ct(l.node,c);i.set(p,l),c++}e.child=null,t.forEach((p,f)=>{let m=Ct(p,f),u=i.get(m);u&&i.delete(m);let T=o;o=te(p,{parentNode:r,previousSibling:s,a:void 0,firstDOMNode:a,isArrayNode:!0,nodeIndex:f,parentArrayPart:n.isArrayNode?n:null},u,T,e),o.sibling=null,u&&u.part.nodeIndex!==f&&(F(o,ft),f!==0&&F(T,ft))}),i.forEach(p=>{ne(p)}),F(e,x)}function so(e,t,n,o){let r=e.part.parentNode!==t.parentNode&&n?!1:o,{node:s}=e;s&&s.portalContainer&&(r=!0),io(e,r)}function io(e,t){let{node:n,part:o,nodeInstance:r}=e;if(e.shouldTearDown=!1,!ze(n))return;let s=B(n),{child:a}=e;if(a)for(so(a,o,s,t);a.sibling;)a=a.sibling,so(a,o,s,t);if(Y(n)&&t){let c=le(o.parentNode,o.previousSibling);c&&ge(c);return}let{ref:i}=n;if(i&&xe(i,null),!!r)if(s){let{domNodes:c}=r;t&&ge(c)}else A(n)&&je(r)&&(r.__unmount&&(r.__unmount.forEach(c=>c()),r.__unmount.clear()),n.nodeType===P?w(r,"componentWillUnmount"):ot(e,!0))}function me(e){let{tearDownFibers:t}=e;t.forEach(n=>{n.shouldTearDown&&io(n,!0)}),e.tearDownFibers=[]}var ao=5,ir=30,Yt=16,ar=300,cr=600,lo;requestAnimationFrame(e=>{lo=e});var Kt=()=>performance.now(),co=()=>!0,po=(e,t)=>(t=t||Yt,t-(e-lo)%t),jt,Fe;if(typeof MessageChannel!="undefined"){Fe=[];let e=new MessageChannel;e.port1.onmessage=function(){Fe.forEach(t=>t())},jt=e.port2}function lr(e){if(!jt||po(Kt())<1){let t=()=>{r(),e()},n=setTimeout(t,1),o=requestIdleCallback(t),r=()=>{clearTimeout(n),cancelIdleCallback(o)};return r}return Fe.push(e),jt.postMessage(null),()=>{let t=Fe.indexOf(e);t!==-1&&Fe.splice(t,1)}}function $t(e,t,n){let{cancelSchedule:o}=e;if(o&&(o(),e.cancelSchedule=null),t){e.cancelSchedule=lr(()=>{let{currentTransition:r}=e,s=r?r.tryCount:0,a=r===b?ar:cr,i=Kt(),c=Math.min(ir,ao+s),l=Math.floor(c/Yt)*Yt,p=()=>{let u=Kt(),T=po(u,l),_=i+Math.min(ao,T);return u<_},m=s>a?co:p;n(m)});return}n(co)}function pr(e){let{node:t,nodeInstance:n}=e;return A(t)&&n?!!de(e).length||n[d].isDirty:!1}function ur(e){let{node:t,alternate:n}=e;if(!ze(t)){n&&ne(n);return}let o=pr(e);if(e.processedTime&&!o){ee(e);return}Y(t)?Gn(e):Array.isArray(t)?Bt(e):B(t)?Mt(e):A(t)?Ut(e):t.nodeType===z&&F(e,x),e.processedTime=j()}function dr(e){return e.updateType===S?!0:e.currentTransition?e.lastCompleteTime>=e.updateTime&&e.hasUncommittedEffect&&Se(e.currentTransition):!1}var fr={fn:e=>{let{updateType:t,current:n}=e,o=Ne(t);me(e);let r=ro(e);e[o]=e.lastCompleteTime=j(),t===y&&(e.current=e.wip,e.wip=n),I(U,()=>Ht(e,r))}};function at(e,t){let{root:n}=e,{updateType:o,currentTransition:r}=n,s=Ne(o),a=J(o),i=n[s],c=!Rn(n);$t(n,c,l=>{for(;e!==t;)if(l()){ur(e);let{retryFiber:f}=n;f?(e=f,t=n,n.retryFiber=null):e=xn(e,t,i,a)}else{at(e,t);return}if(n.callRenderCallbacks(),r){let f=e===t&&!n.retryFiber,m=r.transitionState!==ae;f&&m&&(Cn(r),r.tryCount=0),!n.hasUncommittedEffect&&Se(r)&&kt(n)}dr(n)&&fr.fn(n),Et(n)&&I(C,()=>{n.updateSource=C,Re(n)})})}function Re(e){let t=Et(e);t&&(e.updateType=y,it(e),e.currentTransition=t,t.tryCount+=1,e.wip=Ve(e.current,e.wip,e,e),at(e.wip,e))}function ct(e){let{root:t,parent:n}=e;t.updateType=S,t.currentTransition=null,it(t),at(e,n)}function M(e){let t=v(e),{root:n}=t,{pendingTransitions:o,batchUpdates:r}=n,s=oe(),a=Nt(),i=_e();if(L(t,i),s===C&&!o.includes(a)&&(a===b?o.unshift(a):o.push(a)),r[s]){r[s]+=1;return}r[s]=1,Ce(()=>{let c=r[s];r[s]=0;let l=s===C;if(!(l&&n.lastCompleteTime<n.updateTime))if(n.updateSource=s,l)Re(n);else{let p=n.updateType===S&&n.cancelSchedule;ct(s===U&&!p&&c===1?t:n.current)}})}var R=class{constructor(t){this.props=t,this.state=void 0,this.context=void 0,this[d]={lastSnapshot:null,pendingSyncUpdates:[],pendingDeferredUpdates:[],fiber:null,nodes:null,mounted:!1,committedValues:{},memoizedValues:null,isDirty:!1,renderCount:0}}setState(t,n){Je(this,r=>({state:t,transitionId:r,callback:n}))&&M(this)}forceUpdate(t){let n=this[d],{fiber:o}=n;o&&(o.root.forcedUpdateWith=this,this[d].isDirty=!0,M(this),t&&t(this.state))}render(){}__render(){let t=this.render();return this[d].nodes=t,t}};R.prototype.isReactComponent=!0;var se=class extends R{};se.prototype.isPureReactComponent=!0;function D(e,t,n){let{ref:o}=t;n===void 0&&(n=t.key),t=ce(t,e.__isForwardRef);let r=Ge(t,null,n);if(r.type=e,typeof e=="string")return r.nodeType=Q,r.ref=o,r;let s=e.prototype&&e.prototype.isReactComponent;r.nodeType=s?P:gt,r.ref=s?o:null,e.__loadLazyComponent&&e.__loadLazyComponent();let a=typeof e=="function"&&e.defaultProps;if(a)for(n in a)t[n]===void 0&&(t[n]=a[n]);return r}function uo(e,t,n){t=t||{};let r=arguments.length>3?$(arguments,2):n;return r&&(t.children=r),D(e,t,t.key)}function rt(e,t){let{root:n}=e,{nodeInstance:o}=e;for(;!(o instanceof be||t&&o instanceof V);){if(e=e.parent,e===n)return null;o=e.nodeInstance}return e}function zn(e){let t=rt(e.parent,!0);if(!(t&&t.nodeInstance instanceof V))return e;let{nodeInstance:o}=t,{childManagers:r}=o.suspenseManagers[q(e,null).transitionId],{revealOrder:s}=o.props;return s==="backwards"||s==="together"?(r.forEach(a=>{a.component[d].isDirty=!0}),r[0].fiber):e}function zt(e){let{parentSuspenseManager:t}=e;return t&&t.isSuspenseList?t:null}function Gt(e,t){let{nodeInstance:n}=e,{suspenseManagers:o}=n,{transitionId:r}=t,s=o[r];return s||(s=o[r]=new Vt(e,t)),t.transitionState===ie&&(s.suspender=null),s}function mo(e){e[d].isDirty=!0}function mr(e){let t=v(e.component);e.isUnresolved()&&t&&(mo(e.component),L(t,y))}var Vt=class{constructor(t,n){let{nodeInstance:o}=t;this.fiber=t,this.component=o,this.transition=n,this.childManagers=[],this.suspender=null,this.isSuspenseList=o instanceof V;let r=rt(t.parent,!0);this.parentSuspenseManager=r&&Gt(r,n),this.recordChildSuspense(),this.handleSuspense=this.handleSuspense.bind(this)}recordChildSuspense(){let{parentSuspenseManager:t}=this;t?(t.childManagers.push(this),this.rootSuspenseManager=t.rootSuspenseManager):this.rootSuspenseManager=this}addRootToProcess(){let{rootSuspenseManager:t}=this,{root:n}=N();n.afterRender(t.handleSuspense)}suspend(t){this.suspender=t,this.addRootToProcess()}handleSuspense(){let{component:t,suspender:n}=this;return t instanceof V?this.handleSuspenseList():Promise.resolve(n).then(this.resolve.bind(this,n))}isUnresolved(){return this.isSuspenseList?this.childManagers.some(t=>t.isUnresolved()):this.suspender}shouldShowFallback(){let t=zt(this);if(!t)return!0;let{component:n,childManagers:o}=t,{tail:r}=n.props;if(zt(t)&&!t.shouldShowFallback())return!1;if(r==="collapsed")for(let a=0,i=o.length;a<i;a++){let c=o[a];if(r==="collapsed"&&c.isUnresolved())return c===this}return r!=="hidden"}shouldRenderChildren(){let t=zt(this),{suspender:n}=this;if(!t)return!n;if(je(this.component)&&!n)return!0;let{component:{props:{revealOrder:o}},childManagers:r}=t,s=r.indexOf(this);return!r.some((i,c)=>{let{suspender:l}=i;return l?o==="together"||o==="forwards"&&c<=s||o==="backwards"&&c>=s:!1})}resolve(t){let{component:n,transition:o,suspender:r,childManagers:s}=this,a=o.pendingSuspense||[];if(t!==r)return;if(!r){s.forEach(p=>{p.handleSuspense()});return}this.suspender=null,mo(this.component);let i=o.transitionState===K,c=a.filter(p=>p.suspenseManagers[o.transitionId].suspender).length;!i&&!c&&(o.transitionState=Ee);let l=()=>{let p=n;v(n)||(p=this.fiber.root.wip.nodeInstance),M(p)};setTimeout(()=>{i||!a.includes(n)?Ze(l):re(o,l)},En()%fn)}getChildrenSuspenders(){let t=[];return this.childManagers.forEach(n=>{n.isSuspenseList?t=t.concat(n.getChildrenSuspenders()):n.suspender&&t.push(n.suspender)}),t}handleSuspenseList(){let{component:t,childManagers:n}=this,{revealOrder:o="together",tail:r}=t.props,s=(i,c)=>i.then(()=>(o==="forwards"&&r==="collapsed"&&mr(c),c.handleSuspense())),a=Promise.all(this.getChildrenSuspenders());if(o==="together")a.then(()=>{n.forEach(i=>i.handleSuspense())});else if(o==="forwards"){let i=Ye;for(let c=0,l=n.length;c<l;c++)i=s(i,n[c])}else if(o==="backwards"){let i=Ye;for(let c=n.length-1;c>=0;c--)i=s(i,n[c])}return a}};function fo(e){let t=N(),n=q(t,b);return n.transitionState===Ee&&!n.pendingSuspense.includes(e)&&(n=b),n}var V=class extends R{constructor(t){super(t),this.suspenseManagers={}}render(){return this.props.children}},be=class extends R{constructor(t){super(t),this.suspenseManagers={}}handleSuspender(t,n){let o=fo(this),r=Gt(n,o);Se(o)||(o.pendingSuspense.includes(this)||o.pendingSuspense.push(this),o.transitionState=ae),r.suspend(t)}render(){let{fallback:t,children:n}=this.props,o=fo(this),r=N(),s=Gt(r,o);return s.shouldRenderChildren()?n:s.shouldShowFallback()?t:null}},To=e=>{let t,n=st((o,r)=>{let s=t.read();return D(s.default,{...o,ref:r})});return n.__loadLazyComponent=()=>{t||(t=gn(e()))},n};function Tr(e){return e.split(",").map(n=>{let[o,r,s]=n.split("|"),a=o==="0",i=o==="2";return{isAttribute:a,refNodeIndex:r?Number(r):-1,attrIndex:a?Number(s):-1,prevChildIndex:!a&&s?Number(s):-1,hasExpressionSibling:i,tagAttrs:void 0}})}var Ie=class{constructor(t,n){this.strings=t,this.template=null,this.svgTemplate=null,this.partsMeta=[],this.partMetaCode=n}create(t){t&&this.svgTemplate||this.template||(this.partsMeta.length||(this.partsMeta=Tr(this.partMetaCode)),this.createTemplate(t))}createTemplate(t){let{strings:n}=this,o=document.createElement("template"),r=n.join("");if(o.innerHTML=t?`<svg>${r}</svg>`:r,t){let{content:a}=o,i=a.firstChild;for(;i.firstChild;)a.insertBefore(i.firstChild,i);a.removeChild(i)}let s=t?"svgTemplate":"template";this[s]=o}};var ho=new WeakMap;function hr(e,t){let n=Ge(null,t,void 0);return n.nodeType=yt,n.template=e,n}function Eo(e,...t){return n=>{let o=ho.get(e);return o||(o=new Ie(e,n),ho.set(e,o)),hr(o,t)}}function Wt(e,t){let{__rootFiber:n}=t,o;if(n)o=n.current,o.node.props.children=e,o.processedTime=0,L(o,S);else{let r=D(pe,{children:e}),s={parentNode:t,previousSibling:null,isNode:!0};n=We(t),o=ue(n,r,s),o.parent=n,n.current=o,t.__rootFiber=n}return fe(()=>{n.updateSource=oe(),ct(o)}),e&&e.nodeType===P?o.child.nodeInstance:null}function Er(e,t){return e&&(e.portalContainer=t),e}var yo=Er;function yr(e){let{__rootFiber:t}=e;return t?(ne(t.current),me(t),e.__rootFiber=void 0,!0):!1}var go=yr;var gr=/<([^\s"'=<>/]+)/g,Co=/\s*([^\s"'=<>/]*)/g,Cr=/[^"]*/g,Sr=/[^"]*/g,Nr=/<\/([^\s"'=<>]+)>/g,_r=/[^<]*/g,Ar=/<!--.*?-->/g,xr=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"];function Fr(e){let t=[],n=!1,o,r={},s=(l,p)=>{l.children?Array.isArray(l.children)?l.children.push(p):l.children=[l.children,p]:l.children=p},a=l=>{let p=t[t.length-1];s(p?p.props:r,l)},i=()=>{n=!1,a(o),xr.includes(o.type)||t.push(o)},c=l=>{let p={$$BrahmosDynamicPart:l};o?n?o.props[`$$BrahmosDynamicPart${l}`]=p:s(o.props,p):s(r,p)};return e.forEach((l,p)=>{let f=l.length,m,u=0,T=E=>{E.lastIndex=u;let h=E.exec(l);return h&&(u=E.lastIndex),h},_=E=>{E.lastIndex=u+2;let h=E.exec(l);return u=E.lastIndex+1,h[0]};for(;u<f;){if(l[u]==="<"&&l[u+1]==="/"){t.pop(),T(Nr);continue}else if(l[u]==="<"&&l[u+1]==="!"){T(Ar);continue}else if(l[u]==="<"){m=T(gr)[1],o={$$typeof:ve,type:m,nodeType:Q,props:{}},n=!0;continue}else if(l[u]===" "&&n){Co.lastIndex=u;let E=T(Co),h,g;if(E){h=E[1],l[u]!=="="?g=!0:l[u+1]==='"'?g=_(Cr):l[u+1]==="'"&&(g=_(Sr)),h&&(o.props[h]=g);continue}}else if(l[u]===">"&&n)i();else if(!n){let E=T(_r);a(E[0]);continue}u++}c(p)}),r.children}var{hasOwnProperty:Rr}=Object.prototype;function So(e,t){if(e==null||typeof e!="object")return e;let n=new e.constructor;for(var o in e)if(Rr.call(e,o)){let r=e[o],s=r&&r.$$BrahmosDynamicPart;if(s!==void 0){let a=t[s];o[0]==="$"?n=Object.assign(n,a):n[o]=a}else n[o]=So(e[o],t)}return n}function De(e){let{values:t,template:n}=e,{strings:o}=n;return n.staticTree||(n.staticTree=Fr(o)),So(n.staticTree,t)}function br(e){return B(e)&&!e.template.strings.some(Boolean)}function No(e){let t=[];return e.forEach(n=>{Array.isArray(n)?t=t.concat(No(n)):n&&Z(n)?t.push(De(n)):t.push(n)}),t}function Pe(e){if(X(e))return;if(typeof e=="boolean")return[];if(e[d])return e[d];let t=e;return br(t)&&(t=t.values),Z(t)&&(t=De(t)),Array.isArray(t)||(t=[t]),t=No(t),e[d]=t,t}function Ir(e,t){let n=Pe(e);return n?n.map(t):e}function Dr(e){return(Pe(e)||[]).map((n,o)=>(n&&n.key===void 0&&(n.key=o),n))}function Pr(e,t){(Pe(e)||[]).forEach(t)}function Or(e){return Pe(e)&&e.length===1}function Ur(e){let t=Pe(e);return t?t.length:0}var _o={map:Ir,toArray:Dr,forEach:Pr,only:Or,count:Ur};function Ao(e){return e&&(A(e)||G(e))}function Xt(e,t){t=t||{};let n=arguments.length;if(n>2){let o=n>3?$(arguments,2):arguments[2];t.children=o}if(e){if(Z(e)){let o=De(e);return Xt(o,t)}else if(A(e)||G(e))return{...e,props:{...e.props,...ce(t,!1)},ref:t.ref}}return e}function qt(e,t){class n extends se{render(){return D(e,this.props)}}return n.displayName=`Memo(${e.displayName||e.name})`,n}function xo(e){let t=e[we];return t||(t=We(e),e[we]=t),{render(n){let o=t.current;if(o)o.node.props.children=n,o.processedTime=0,L(o,y);else{let s=D(pe,{children:n});o=ue(t,s,{parentNode:e,previousSibling:null,isNode:!0}),o.parent=t,t.current=o}let r=b;t.pendingTransitions.includes(r)||t.pendingTransitions.push(r),I(C,()=>{t.updateSource=C,Re(t)})},unmount(){t.cancelSchedule&&(t.cancelSchedule(),t.cancelSchedule=null);let n=t.current;n&&(n.shouldTearDown=!0,t.tearDownFibers.push(n),me(t),t.current=null),delete e[we]}}}function Qt(e){if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status==="pending"||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})),e)}function Fo(e){if(!N())throw new Error("use() must be called during render.");if(e&&typeof e.then=="function")return Qt(e);throw new Error("Unsupported type passed to use()")}function Ro(e){let t=Promise.resolve(),n=new Set,o=e(r=>{n.forEach(s=>s(r))});return t._finalize=r=>{r&&n.delete(r),n.size===0&&o&&o()},t._subscribe=r=>(n.add(r),()=>t._finalize(r)),t}function Zt(e){bo(e)}Zt.sync=e=>{bo(e,{sync:!0})};function bo(e,t={}){nt(()=>{var r;let n=N(),o=n?n.nodeInstance:null;if(!o)throw new Error("watch() must be called during render.");if(e._subscribe&&!((r=o.__unmount)!=null&&r.has(e))){let s=()=>{let i=v(o);if(i){let c=t.sync?U:C;I(c,()=>{o[d].isDirty=!0,F(i,x),M(o)})}},a=e._subscribe(s);o.__unmount||(o.__unmount=new Map),o.__unmount.set(e,a)}Qt(e)})}var Io=e=>e.children,vr=Io,Mr=Io;function wr(e){e()}var Lr=D,kr=D,Hr=D;var Ec=Jt;export{_o as Children,R as Component,Mr as Fragment,se as PureComponent,vr as StrictMode,be as Suspense,V as SuspenseList,Xt as cloneElement,At as createContext,uo as createElement,yo as createPortal,Zn as createRef,xo as createRoot,Ec as default,st as forwardRef,Eo as html,Ro as initWatch,Ao as isValidElement,Lr as jsx,Hr as jsxDev,kr as jsxs,To as lazy,qt as memo,Wt as render,nt as startTransition,go as unmountComponentAtNode,wr as unstable_batchedUpdates,Ze as unstable_deferredUpdates,fe as unstable_syncUpdates,Fo as use,kn as useCallback,Yn as useContext,Bn as useDebugValue,Kn as useDeferredValue,bt as useEffect,It as useLayoutEffect,Rt as useMemo,Ln as useReducer,wn as useRef,Ft as useState,Dt as useTransition,Zt as watch};
1
+ var Po=Object.defineProperty;var Oo=(e,t)=>{for(var n in t)Po(e,n,{get:t[n],enumerable:!0})};var Zt={};Oo(Zt,{Children:()=>Ao,Component:()=>R,Fragment:()=>Mr,PureComponent:()=>ie,StrictMode:()=>vr,Suspense:()=>De,SuspenseList:()=>V,cloneElement:()=>Wt,createContext:()=>_t,createElement:()=>uo,createPortal:()=>yo,createRef:()=>Zn,createRoot:()=>xo,forwardRef:()=>st,html:()=>Eo,initWatch:()=>Ro,isValidElement:()=>_o,jsx:()=>Lr,jsxDev:()=>Hr,jsxs:()=>kr,lazy:()=>To,memo:()=>Xt,render:()=>Vt,startTransition:()=>xe,unmountComponentAtNode:()=>go,unstable_batchedUpdates:()=>wr,unstable_deferredUpdates:()=>Je,unstable_syncUpdates:()=>fe,use:()=>Fo,useCallback:()=>Ln,useContext:()=>Bn,useDebugValue:()=>Hn,useDeferredValue:()=>Kn,useEffect:()=>bt,useLayoutEffect:()=>It,useMemo:()=>Rt,useReducer:()=>wn,useRef:()=>Mn,useState:()=>Ft,useTransition:()=>Yn,watch:()=>Qt});var we=Symbol.for("react.element"),rn=Symbol.for("react.forward_ref"),sn="{{brahmos}}",an={key:1,ref:1},cn={className:"class",htmlFor:"for",acceptCharset:"accept-charset",httpEquiv:"http-equiv",tabIndex:"tabindex"},ut={doubleclick:"dblclick"},ln=typeof Symbol!="undefined"?/fil|che|rad/i:/fil|che|ra/i,pn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,un=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,dt="http://www.w3.org/1999/xlink",dn=100,d="__brahmosData",Le="__brahmosLastArrayDom",ke="__rootFiber",S="sync",y="deferred",he="js",O="immediate_action",C="transition",He=0,ft=1,x=2,fn="initial",X="start",ae="suspended",Ee="resolved",mt="completed",K="timedOut";function mn(e){return e[0]==="o"&&e[1]==="n"}function Be(e){let t=pn.test(e)?e.replace(/[A-Z0-9]/,"-$&").toLowerCase():e;return cn[e]||t}function Tt(e){return e.nodeName.toLowerCase()}function Tn(e,t){return t&&(e=e.replace(/Capture$/,"")),e.replace("on","").toLowerCase()}function q(e){return e==null}var Uo=0;function j(){return Uo++}function hn(){return Date.now()}function Ye(e){e.__brahmosData={events:{}}}function ce(e,t){if(!("key"in e||"ref"in e&&!t))return e;let n={},o;for(o in e)o!=="key"&&(o!=="ref"||t)&&(n[o]=e[o]);return n}function ye(e,t){let n=Object.keys(e);for(let o=0,r=n.length;o<r;o++){let s=n[o],a=e[s];t(s,a)}}function ge(e){Array.isArray(e)||(e=[e]);for(let t=e.length-1;t>=0;t--)e[t].remove()}function $(e,t){return t=t||0,Array.prototype.slice.call(e,t)}function vo(e){let t=e instanceof NodeList;if(e instanceof Node)return e;if(Array.isArray(e)||t){let n=document.createDocumentFragment(),o=0;for(;e[o];)n.appendChild(e[o]),t||(o+=1);return n}return document.createTextNode(e)}function Ke(e,t,n){let o=vo(n),r;return Array.isArray(n)?r=n:o instanceof DocumentFragment?r=$(o.childNodes):r=n,e.insertBefore(o,t),r}function le(e,t){return t?t.nextSibling:e.firstChild}function w(e,t,n){if(e[t])return e[t].apply(e,n)}function En(e,t){let n=t===0?e.firstChild:e.childNodes[t],o=document.createTextNode("");return e.insertBefore(o,n),o}var je=Promise.resolve();function Ce(e){return je.then(e)}function Se(){return j()+"-"+Math.random()*1e6}function yn(e){let t="pending",n,o=e.then(r=>{t="success",n=r},r=>{t="error",n=r});return{read(){if(t==="pending")throw o;if(t==="error")throw n;if(t==="success")return n}}}function $e(e){return e[d].mounted}function ht(e){return e.displayName||e.name}function pe({children:e}){return e}var ze={transitionId:"",tryCount:0,transitionState:K},U={transitionId:Se(),tryCount:0,transitionState:K};function Mo(e){let{transitionState:t}=e;return t===X||t===Ee||t===K}function Ne(e){let{transitionState:t}=e;return t===mt||t===K}function gn(e){let{transitionState:t}=e;t!==K&&t!==ae&&(e.isPending?(e.clearTimeout(),e.updatePendingState(!1,C)):e.transitionState=mt)}function Q(e,t){return t=t||ze,e.root.currentTransition||t}function Et(e){let{pendingTransitions:t}=e;return t.find(Mo)}var yt=Symbol.for("tag"),Z=Symbol.for("tag-element"),D=Symbol.for("class-component"),gt=Symbol.for("functional-component"),z=Symbol.for("attribute");function G({nodeType:e}){return e===Z}function J({nodeType:e}){return e===yt}function B(e){return G(e)||J(e)}function _({nodeType:e}){return e===D||e===gt}function Y(e){return typeof e=="string"||typeof e=="number"}function Ge(e){return!(q(e)||typeof e=="boolean")}function Ct(e,t){let n=e&&e.key;return n===void 0?t:n}function Ve(e,t,n){return{$$typeof:we,nodeType:null,key:n,ref:null,portalContainer:null,type:null,props:e,values:t,template:null}}var Sn;function St(e){Sn=e}function N(){return Sn}function Ae(e){return e===y?"lastDeferredCompleteTime":"lastCompleteTime"}function ee(e){return e===y?"deferredUpdateTime":"updateTime"}function L(e,t){let n=ee(t),o=j();for(;e;)e[n]=o,e=e.parent}function Nn(e,t,n){t===n?n.child=e:t.sibling=e,e.parent=n}function F(e,t){e.hasUncommittedEffect=t,e.root.hasUncommittedEffect=!0}function We(e,t,n,o){let{root:r,node:s,part:a,nodeInstance:i,child:c}=e,l=ee(r.updateType);return t?(t.node=s,t.part=a,t.createdAt=j()):(t=ue(r,s,a),wo(e,t)),e.shouldTearDown=!1,t.nodeInstance=i,t.child=c,t[l]=o[l],Nn(t,n,o),t}function An(e,t){return e===t?e.child:e.sibling}function te(e){let{child:t,root:n}=e;if(n.updateType===S)return;let o;for(;t;){let{alternate:r}=t;o=We(t,r,o||e,e),t=t.sibling}}function Xe(e){let t=[];return{updateType:y,updateSource:he,cancelSchedule:null,domNode:e,forcedUpdateWith:null,current:null,wip:null,child:null,retryFiber:null,currentTransition:null,hasUncommittedEffect:!1,pendingTransitions:[],tearDownFibers:[],postCommitEffects:[],batchUpdates:{},lastDeferredCompleteTime:0,lastCompleteTime:0,deferredUpdateTime:0,updateTime:0,afterRender(n){t.includes(n)||t.push(n)},callRenderCallbacks(){for(let n=0,o=t.length;n<o;n++)t[n]()},resetRenderCallbacks(){t=[]}}}function ue(e,t,n){return t&&t.portalContainer&&(n.parentNode=t.portalContainer),{node:t,nodeInstance:null,root:e,parent:null,child:null,sibling:null,part:n,alternate:null,context:null,childFiberError:null,isSvgPart:!1,deferredUpdateTime:0,updateTime:0,processedTime:0,createdAt:j(),shouldTearDown:!1,hasUncommittedEffect:He}}function wo(e,t){e&&(e.alternate=t),t.alternate=e}function ne(e,t,n,o,r){let{root:s}=o,a=ee(s.updateType),i;return n&&!q(n.node)&&!q(e)&&Lo(e,n.node)?(i=We(n,n.alternate,o,r),i.node=e,i.part=t):(i=ue(s,e,t),n&&oe(n)),Nn(i,o,r),i.processedTime=0,i[a]=r[a],i.context=r.context,i.isSvgPart=r.isSvgPart,i}function Lo(e,t){return Y(e)&&Y(t)||e.nodeType===z||Array.isArray(e)&&Array.isArray(t)||(_(e)||G(e))&&e.type===t.type||J(e)&&e.template===t.template}function ko(e,t,n){return e&&e[n]>=t}function Cn(e,t,n){if(e){for(;e&&!ko(e,t,n);)e=e.sibling;return e}}function _n(e,t,n,o){let r=Cn(e.child,n,o);if(r)return r;let s;for(;!(s=Cn(e.sibling,n,o));)if(e=e.parent,e===t)return e;return s}function v(e){return e[d].fiber}function xn(e){let{root:t,child:n}=e;n&&n.createdAt>t.lastCompleteTime&&(e.child=n.alternate)}function oe(e){e.shouldTearDown=!0,e.root.tearDownFibers.push(e)}var Qe=he,qe=ze;function re(){return Qe}function Nt(){return qe}function b(e,t){Qe=e,t(),Qe=he}function se(e,t){let n=qe;qe=e,b(C,t),qe=n}function Fn(e){return e.updateSource===O}function Ho(){return Qe===C}function _e(){return Ho()?y:S}function Ze(e){return e===y?"pendingDeferredUpdates":"pendingSyncUpdates"}function de(e){let{root:{updateType:t},nodeInstance:n}=e,o=n[d],r=Ze(t);if(t===S)return o[r];let s=Q(e,null).transitionId;return o[r].filter(a=>a.transitionId===s)}function Je(e){se(U,e)}function fe(e){b(O,e)}function Bo(e,t){let{root:n}=e;for(;e.nodeInstance!==t;)if(e=e.parent,e===n)return null;return e}function et(e,t){let n,o,r=!0,s=e[d],a=N();if(a){let{renderCount:l}=s;if(l>50)throw new Error("Too many rerender. Check your setState call, this may cause an infinite loop.");let{root:p}=a;p.retryFiber=Bo(a,e),n=p.updateType,o=p.currentTransition||ze,r=!1}else s.renderCount=0,n=_e(),o=Nt();let i=Ze(n),c=t(o.transitionId);return s[i].push(c),r}var Yo=1;function At(e){return function(t){let n=v(e),{updateType:o}=n.root;e.context!==t&&(e[d].isDirty=!0,L(n,o))}}function _t(e){let t=`cC${Yo++}`;class n extends R{constructor(a){super(a),this.subs=[]}shouldComponentUpdate(a){let{value:i}=this.props;return i!==a.value&&this.subs.forEach(c=>c(a.value)),!0}sub(a){let{subs:i}=this,c=At(a);i.push(c);let{componentWillUnmount:l}=a;a.componentWillUnmount=()=>{i.splice(i.indexOf(c),1),l&&l()}}render(){return this.props.children}}n.__ccId=t;class o extends R{render(){return this.props.children(this.context)}}let r={id:t,defaultValue:e,Provider:n,Consumer:o};return o.contextType=r,r}function bn(){return N().nodeInstance}function In(e){let{renderCount:t}=e[d];e.deferredHooks=e.syncHooks.map((n,o)=>Array.isArray(n)?[...n]:n.transitionId?n:n.hasOwnProperty("current")&&t>1?e.deferredHooks[o]||n:{...n})}function Dn(e,t){let{syncHooks:n,deferredHooks:o}=t;return e===S?n:o}function tt(e){let{nodeInstance:t,root:{updateType:n}}=e;return Dn(n,t)}function Rn(e,t,n){return e===y&&!n.deferredHooks.length&&In(n),Dn(e,n)[t]}function Pn(e,t){if(!e||!t||e.length!==t.length)return!0;for(let n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!0;return!1}function Ko(e,t,n){(re()===O||!Object.is(t,n))&&M(e)}function xt(e){return!1}function On(e){return e}function nt(e,t,n){let o=N(),{nodeInstance:r}=o,{pointer:s}=r,a=tt(o),i=a[s];return(!i||t(i))&&(i=e(),a[s]=i),r.pointer+=1,n(i)}function Un(){let e=N(),{nodeInstance:t,root:{updateType:n}}=e;t.pointer=0,n===y&&In(t),de(e).forEach(r=>r.updater())}function vn(e,t){let n=bn(),{pointer:o}=n;return nt(()=>(typeof e=="function"&&(e=e()),[e,s=>{let a=_e(),i=Rn(S,o,n),c=i[0],l=t(s,c);et(n,f=>({transitionId:f,updater(){let m=Rn(a,o,n);m[0]=t(s,i[0])}}))&&Ko(n,l,c)}]),xt,On)}function Ft(e){return vn(e,(t,n)=>(typeof t=="function"&&(t=t(n)),t))}function Mn(e){return nt(()=>({current:e}),xt,On)}function wn(e,t,n){return vn(n?()=>n(t):t,(r,s)=>e(s,r))}function Rt(e,t){return nt(()=>({value:e(),dependencies:t}),s=>Pn(t,s.dependencies),s=>s.value)}function Ln(e,t){return Rt(()=>e,t)}function kn(e,t){let n=N(),{nodeInstance:o}=n,{pointer:r}=o,s=tt(n),a=s[r]||{animationFrame:null,cleanEffect:null},i={...a,isDependenciesChanged:Pn(t,a.dependencies),dependencies:t,effect(){i.isDependenciesChanged&&e(i)}};s[r]=i,o.pointer+=1}function bt(e,t){kn(n=>{cancelAnimationFrame(n.animationFrame),n.animationFrame=requestAnimationFrame(()=>{setTimeout(()=>{n.cleanEffect=e()})})},t)}function It(e,t){kn(n=>{n.cleanEffect=e()},t)}function Hn(){}function Bn(e){let{nodeInstance:t,context:n}=N(),{id:o,defaultValue:r}=e,s=n[o],a=s?s.props.value:r;return It(()=>{if(s){let{subs:i}=s,c=At(t);return i.push(c),()=>{i.splice(i.indexOf(c),1)}}},[]),t.context=a,a}function xe(e){let t={transitionId:Se(),transitionState:X,pendingSuspense:[],tryCount:0};se(t,e)}function Yn(){let e=bn();return nt(()=>{let t={transitionId:Se(),tryCount:0,isPending:!1,transitionTimeout:null,pendingSuspense:[],transitionState:fn,clearTimeout(){clearTimeout(t.transitionTimeout)},updatePendingState(n,o){t.isPending=n,e[d].isDirty=!0;let r=()=>{M(e)};o===C?se(t,r):b(o,r)},startTransition(n){let o=re(),{root:r}=v(e);t.transitionState=X,t.pendingSuspense=[],t.clearTimeout(),se(t,n),r.lastDeferredCompleteTime<r.deferredUpdateTime&&t.updatePendingState(!0,o)}};return t},xt,({startTransition:t,isPending:n})=>[n,t])}function Kn(e,t){let[n,o]=Ft(t!==void 0?t:e);return bt(()=>{xe(()=>{o(e)})},[e]),n}function jn(e){let t=tt(e);for(let n=0,o=t.length;n<o;n++){let r=t[n];r.effect&&r.effect()}}function ot(e,t){let n=tt(e);for(let o=0,r=n.length;o<r;o++){let s=n[o];s.cleanEffect&&(s.isDependenciesChanged||t)&&s.cleanEffect(),s.clearTimeout&&t&&s.clearTimeout()}}function Dt(e){return{syncHooks:[],deferredHooks:[],context:void 0,pointer:0,__render(t){Un();let n=e(t);return this[d].nodes=n,n},__unmount:new Map,[d]:{pendingSyncUpdates:[],pendingDeferredUpdates:[],fiber:null,nodes:null,isDirty:!1,mounted:!1,renderCount:0}}}function jo(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(!hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Pt=jo;function $o(e){let{root:t}=e;for(;(e=e.parent)&&!(e.nodeInstance instanceof R&&(e.nodeInstance.componentDidCatch||e.node.type.getDerivedStateFromError));)if(e===t)return null;return e}function zo(e){let t="";for(;e;){let{node:n}=e;n&&_(n)&&n.type!==pe&&(t+=` at ${ht(n.type)}
2
+ `),e=e.parent}return{componentStack:t}}function Go(e){let{node:{type:t},nodeInstance:n,parent:o}=e,{__ccId:r}=t,s=o.context||{};if(!r)return s;let a=Object.create(s);return a[r]=n,a}function Vo(e,t){return t.reduce((n,{state:o})=>(typeof o=="function"&&(o=o(n)),{...n,...o}),e)}function $n(e){let{root:t,nodeInstance:n}=e;n[d].isDirty=!0,t.retryFiber=e}function Ot(e){let{node:t,part:n,root:o,childFiberError:r}=e,{type:s,nodeType:a,props:i={}}=t,{currentTransition:c}=o,l=o.updateType===y,p=!0,f=!1,m=a===D;xn(e);let{nodeInstance:u}=e,T=!1;u||(u=m?new s(i):Dt(s),e.nodeInstance=u,T=!0);let A=u[d],E=Go(e);if(e.context=E,m){let h=u,g=A,{committedValues:k,memoizedValues:P}=g;T&&(k.state=h.state);let{props:W,state:Te}=k;P&&c&&c.transitionId===P.transitionId&&({props:W,state:Te}=P,f=!0),h.props=W,h.state=Te;let{shouldComponentUpdate:Jt}=h,H=Te,lt=de(e);lt.length&&(H=Vo(Te,lt));let en=!T&&o.forcedUpdateWith!==u,tn=w(s,"getDerivedStateFromProps",[i,H]),nn=r?w(s,"getDerivedStateFromError",[r.error]):void 0;(tn||nn)&&(H={...H,...tn,...nn}),h.isPureReactComponent&&en&&(p=!Pt(H,Te)||!Pt(i,W)),Jt&&p&&en&&(p=Jt.call(h,i,H));let{contextType:on}=s;if(on){let{id:ve,defaultValue:pt}=on,Me=E[ve],Do=Me?Me.props.value:pt;Me&&T&&Me.sub(h),h.context=Do}h.state=H,h.props=i,lt.forEach(({callback:ve})=>{if(ve){let{updateSource:pt}=o;Ce(()=>{b(pt,()=>ve(H))})}}),c&&(g.memoizedValues={state:H,props:i,transitionId:c.transitionId})}if(p){St(e),A.renderCount+=1;let h=r&&!s.getDerivedStateFromError;try{h?A.nodes=null:u.__render(i)}catch(g){let k=$o(e);if(typeof g.then=="function"){let P=rt(e);if(!P)throw new Error("Rendering which got suspended can't be used outside of suspense.");P.nodeInstance.handleSuspender(g,P);let W=zn(P);$n(W)}else if(k&&!k.childFiberError){let P=zo(e);console.error(g);let W=`The above error occurred in the <${ht(t.type)}> component:
3
+ ${P.componentStack}`;console.error(W),k.childFiberError={error:g,errorInfo:P},$n(k)}else throw g;return}finally{St(null);let g=u[d];if(m&&l){let{committedValues:k}=g;Object.assign(u,k)}}}if(f||p){let{child:h}=e,{nodes:g}=A;!h||h.node!==g?(ne(g,n,h,e,e),F(e,x)):f||te(e)}else te(e)}function Gn(e){let{node:t,alternate:n}=e,o=n&&n.node;t!==o&&F(e,x)}function Ut(e,t){let{type:n}=e,o=t?document.createElementNS("http://www.w3.org/2000/svg",n):document.createElement(n);return Ye(o),{fragment:[o],domNodes:[o],parts:[{previousSibling:null,parentNode:o,isNode:!0}]}}function Wo(e){return!!e&&e.nodeType===8&&e.textContent===sn}var Fe=class{constructor(t,n){this.templateResult=t,t.create(n),this.fragment=this.createNode(n),this.parts=this.getParts(),this.domNodes=$(this.fragment.childNodes),this.patched=!1}createNode(t){let{template:n,svgTemplate:o}=this.templateResult,r=t?o:n;return document.importNode(r.content,!0)}getParts(){let{fragment:t,templateResult:n}=this,{partsMeta:o}=n,r=[],s=t.querySelectorAll("*");for(let a=0,i=o.length;a<i;a++){let c=o[a],{isAttribute:l,attrIndex:p,refNodeIndex:f,prevChildIndex:m,hasExpressionSibling:u}=c,T=s[f];if(l)c.tagAttrs||(c.tagAttrs=$(T.attributes)),r.push({isAttribute:!0,tagAttrs:c.tagAttrs,domNode:T,attrIndex:p}),Ye(T);else{T=T||t;let A=m!==-1,E,h=T.childNodes[m+1];A&&Wo(h)&&ge(h),A?u?E=En(T,m):E=T.childNodes[m]:E=null,r.push({isNode:!0,parentNode:T,previousSibling:E})}}return r}patchParts(t){let{parts:n}=this,{parentNode:o,previousSibling:r}=t;if(!this.patched){for(let s=0,a=n.length;s<a;s++){let i=n[s];i.isNode&&i.parentNode instanceof DocumentFragment&&(i.parentNode=o,i.previousSibling=i.previousSibling||r)}this.patched=!0}}};function Xo(e,t,n){let o=e.lastIndexOf(t);return n<=o}function qo(e,t){return{nodeType:z,props:e,ref:t}}function Qo(e,t,n){let o=n,r=n.child;for(let s=0,a=e.length;s<a;s++){let i=e[s],c=t[s],l;if(i.isAttribute){let{domNode:p}=i,f={},m;for(;i&&p===i.domNode;)ye(t[s],(u,T)=>{let A=i,E=Be(u);!Xo(A.tagAttrs,E,A.attrIndex)&&!an[u]?f[u]=T:u==="ref"&&(m=T)}),i=e[++s];s--,i=e[s],l=qo(f,m)}else i.isNode&&(l=c);o=ne(l,i,r,o,n),r=r&&r.sibling}}function vt(e){let{node:t}=e,{part:n,alternate:o,parent:{context:r}}=e,s=o&&o.node,{values:a,nodeType:i}=t,c=i===Z,l=e.isSvgPart||t.type==="svg";e.isSvgPart=l;let{nodeInstance:p}=e;p||(p=c?Ut(t,l):new Fe(t.template,l),e.nodeInstance=p),c||p.patchParts(n),t!==s?c?ne(t.props.children,p.parts[0],e.child,e,e):Qo(p.parts,a,e):te(e),F(e,x),e.context=r}function Vn(e,t){let{type:n}=t,o=Tt(t);return ut[e]?ut[e]:/^change(textarea|input)/i.test(e+o)&&!ln.test(n)?"input":e}function Mt(e){let{type:t}=e,n=Tt(e);if(n==="input"&&(t==="radio"||t==="checkbox"))return"checked";if(n==="input"||n==="select"||n==="textarea")return"value"}function Wn(e){let t=Mt(e);if(!t)return;let n=e[`${t}Prop`],o=e[t];n!==void 0&&n!==o&&(e[t]=n)}function Xn(e,t,n,o){e==="checked"?n==="checked"?(t.checked=o,t.checkedProp=o):n==="defaultChecked"&&t.checkedProp===void 0?t.checked=o:t[n]=o:e==="value"&&(n==="value"?(t.value=o,t.valueProp=o):n==="defaultValue"&&t.valueProp===void 0?t.value=o:t[n]=o)}function qn(e,t,n){let o=e.__brahmosData.events,r=o[t];return r?(r.handler=n,r.patched):(r=o[t]={handler:n,patched:null},r.patched=function(s){r.handler&&fe(()=>{r.handler.call(this,s)})},r.patched)}function Qn(e,t,n,o){t=t||{},ye(e,(r,s)=>{let a=t[r];s!==a&&o(r,s,a)}),ye(t,(r,s)=>{e[r]===void 0&&s!==void 0&&o(r,n,s)})}function Zo(e,t,n,o,r){if(t==="children")return;if(mn(t)){let a=t.substr(-7)==="Capture"&&t.substr(-14,7)==="Pointer",i=Tn(t,a);i=Vn(i,e);let c=qn(e,t,n);o&&!n?e.removeEventListener(i,c,a):!o&&n&&e.addEventListener(i,c,a)}else if(t==="style"){let{style:a}=e;Qn(n||{},o,"",(i,c)=>{i[0]==="-"?a.setProperty(i,c):a[i]=typeof c=="number"&&un.test(i)===!1?c+"px":c})}else if(t==="dangerouslySetInnerHTML"){let a=o&&o.__html,i=n&&n.__html;i!==a&&(e.innerHTML=i==null?"":i)}else if(t in e&&!r){let a=Mt(e);a?Xn(a,e,t,n):e[t]=n==null?"":n}else{t=Be(t);let a=t.replace(/^xlink:?/,""),i=n==null||n===!1;t!==a?(a=a.toLowerCase(),i?e.removeAttributeNS(dt,a):e.setAttributeNS(dt,a,n)):i?e.removeAttribute(t):e.setAttribute(t,n)}}function wt(e,t,n,o){Qn(t,n,null,(r,s,a)=>{Zo(e,r,s,a,o)}),Wn(e)}function st(e){function t(n){return e(ce(n,!1),n.ref)}return t.__isForwardRef=!0,t.$$typeof=rn,t}function Zn(){return{current:null}}function Re(e,t){typeof e=="function"?e(t):typeof e=="object"&&(e.current=t)}function Jo(e){let{node:t,alternate:n}=e,o=e.part,{parentNode:r,previousSibling:s}=o,a=le(r,s);n&&a?a.nodeValue=t:Ke(r,a,t)}function er(e){for(;e.child&&e.node&&!B(e.node);)e=e.child;return e}function Jn(e,t){let{domNodes:n}=t;e[Le]=n[n.length-1]}function eo(e,t){if(e.isArrayNode&&e.nodeIndex===0)for(;e=e.parentArrayPart;)e.firstDOMNode=t}function to(e){let{previousSibling:t}=e;if(e.isArrayNode){let{firstDOMNode:n,nodeIndex:o}=e;o>0?t=e.parentNode[Le]:e.parentArrayPart&&(t=n?n.previousSibling:e.parentNode[Le])}return t}function no(e,t){let{part:n}=e;if(!n.isArrayNode)return;let{nodeIndex:o,parentNode:r}=n,s=t.part.nodeIndex,a=er(e),{nodeInstance:i}=a,c=a!==e&&a.hasUncommittedEffect;if(!(!i||c)){if(o!==s){let{domNodes:l}=i,p=to(n),f=le(r,p),m=l[0];m&&m.previousSibling!==p&&m!==f&&Ke(r,f,l),eo(n,m)}Jn(r,i)}}function tr(e){let{nodeInstance:t,alternate:n,node:o}=e,r=e.part,{parentNode:s}=r,a=G(o);if(a&&oo(e,t.domNodes[0]),n)no(e,n);else{let i=to(r),c=le(s,i),l=Ke(s,c,t.fragment);a||(t.domNodes=l),eo(r,l[0]),Jn(s,t)}}function nr(e){let{node:t,nodeInstance:n,root:o}=e,{updateType:r}=o,{nodeType:s}=t,a=n[d],i=r===y;if(s===D){i&&Object.assign(n,a.memoizedValues);let{props:p,state:f}=a.committedValues;a.lastSnapshot=w(n,"getSnapshotBeforeUpdate",[p,f])}else ot(e,!1);let{transitionId:c}=Q(e,null),l=Ze(r);a[l]=i?a[l].filter(p=>p.transitionId!==c):[],a.isDirty=!1,a.renderCount=0,o.postCommitEffects.push(e)}function or(e){let{node:t,nodeInstance:n,root:o,childFiberError:r}=e,{updateType:s}=o,{nodeType:a,ref:i}=t,c=n[d];if(a===D){let{props:l,state:p}=n,{committedValues:f,lastSnapshot:m}=c,{props:u,state:T}=f;u?w(n,"componentDidUpdate",[u,T,m]):w(n,"componentDidMount"),r&&(w(n,"componentDidCatch",[r.error,r.errorInfo]),e.childFiberError=null),i&&Re(i,n),f.props=l,f.state=p,c.memoizedValues=null}else if(jn(e),s===y){let{syncHooks:l,deferredHooks:p}=n;n.deferredHooks=l,n.syncHooks=p}c.mounted=!0,c.fiber=e}function oo(e,t){let{node:n,alternate:o,isSvgPart:r}=e,{props:s,ref:a}=n,i=o&&o.node.props;wt(t,s,i,r),a&&Re(a,t)}function it(e){e.tearDownFibers=[],e.postCommitEffects=[],e.hasUncommittedEffect=!1,e.retryFiber=null,e.resetRenderCallbacks()}function rr(e){e.node=null,e.nodeInstance=null,e.child=null,e.sibling=null}function Lt(e){let{currentTransition:t,pendingTransitions:n}=e,o=n.indexOf(t);o!==-1&&n.splice(o,1)}function sr(e){let{node:t,alternate:n}=e,o=t&&_(t);o&&n&&no(e,n),e.hasUncommittedEffect===x&&(Y(t)?Jo(e):B(t)?tr(e):o?nr(e):t.nodeType===z&&oo(e,e.part.domNode),e.hasUncommittedEffect=He),n&&rr(n)}function ro(e){let{updateType:t,wip:n,current:o}=e,r=ee(t),s=e[Ae(t)],a=[],i=t===S?o:n;for(;i;){let{createdAt:c,node:l,child:p,hasUncommittedEffect:f}=i,m=i[r],u=c>s,T=f||m>s;if(f&&a.push(i),u&&(p&&p.parent!==i&&(p.parent=i),l&&_(l)&&(i.nodeInstance[d].fiber=i)),p&&T)i=p;else{for(;i!==e&&!i.sibling;)i=i.parent;i=i.sibling}}return a}function kt(e,t){for(let o=0,r=t.length;o<r;o++)sr(t[o]);let{postCommitEffects:n}=e;for(let o=n.length-1;o>=0;o--)or(n[o]);Lt(e),it(e),e.forcedUpdateWith=null}function Ht(e){let{node:t,part:n}=e,o=e,{parentNode:r,previousSibling:s,firstDOMNode:a}=n,i=new Map,c=0,l=e;for(;l=An(l,e);){let p=Ct(l.node,c);i.set(p,l),c++}e.child=null,t.forEach((p,f)=>{let m=Ct(p,f),u=i.get(m);u&&i.delete(m);let T=o;o=ne(p,{parentNode:r,previousSibling:s,a:void 0,firstDOMNode:a,isArrayNode:!0,nodeIndex:f,parentArrayPart:n.isArrayNode?n:null},u,T,e),o.sibling=null,u&&u.part.nodeIndex!==f&&(F(o,ft),f!==0&&F(T,ft))}),i.forEach(p=>{oe(p)}),F(e,x)}function so(e,t,n,o){let r=e.part.parentNode!==t.parentNode&&n?!1:o,{node:s}=e;s&&s.portalContainer&&(r=!0),io(e,r)}function io(e,t){let{node:n,part:o,nodeInstance:r}=e;if(e.shouldTearDown=!1,!Ge(n))return;let s=B(n),{child:a}=e;if(a)for(so(a,o,s,t);a.sibling;)a=a.sibling,so(a,o,s,t);if(Y(n)&&t){let c=le(o.parentNode,o.previousSibling);c&&ge(c);return}let{ref:i}=n;if(i&&Re(i,null),!!r)if(s){let{domNodes:c}=r;t&&ge(c)}else _(n)&&$e(r)&&(r.__unmount.forEach(c=>c()),r.__unmount.clear(),n.nodeType===D?w(r,"componentWillUnmount"):ot(e,!0))}function me(e){let{tearDownFibers:t}=e;t.forEach(n=>{n.shouldTearDown&&io(n,!0)}),e.tearDownFibers=[]}var ao=5,ir=30,Bt=16,ar=300,cr=600,lo;requestAnimationFrame(e=>{lo=e});var Yt=()=>performance.now(),co=()=>!0,po=(e,t)=>(t=t||Bt,t-(e-lo)%t),Kt,be;if(typeof MessageChannel!="undefined"){be=[];let e=new MessageChannel;e.port1.onmessage=function(){be.forEach(t=>t())},Kt=e.port2}function lr(e){if(!Kt||po(Yt())<1){let t=()=>{r(),e()},n=setTimeout(t,1),o=requestIdleCallback(t),r=()=>{clearTimeout(n),cancelIdleCallback(o)};return r}return be.push(e),Kt.postMessage(null),()=>{let t=be.indexOf(e);t!==-1&&be.splice(t,1)}}function jt(e,t,n){let{cancelSchedule:o}=e;if(o&&(o(),e.cancelSchedule=null),t){e.cancelSchedule=lr(()=>{let{currentTransition:r}=e,s=r?r.tryCount:0,a=r===U?ar:cr,i=Yt(),c=Math.min(ir,ao+s),l=Math.floor(c/Bt)*Bt,p=()=>{let u=Yt(),T=po(u,l),A=i+Math.min(ao,T);return u<A},m=s>a?co:p;n(m)});return}n(co)}function pr(e){let{node:t,nodeInstance:n}=e;return _(t)&&n?!!de(e).length||n[d].isDirty:!1}function ur(e){let{node:t,alternate:n}=e;if(!Ge(t)){n&&oe(n);return}let o=pr(e);if(e.processedTime&&!o){te(e);return}Y(t)?Gn(e):Array.isArray(t)?Ht(e):B(t)?vt(e):_(t)?Ot(e):t.nodeType===z&&F(e,x),e.processedTime=j()}function dr(e){return e.updateType===S?!0:e.currentTransition?e.lastCompleteTime>=e.updateTime&&e.hasUncommittedEffect&&Ne(e.currentTransition):!1}var fr={fn:e=>{let{updateType:t,current:n}=e,o=Ae(t);me(e);let r=ro(e);e[o]=e.lastCompleteTime=j(),t===y&&(e.current=e.wip,e.wip=n),b(O,()=>kt(e,r))}};function at(e,t){let{root:n}=e,{updateType:o,currentTransition:r}=n,s=Ae(o),a=ee(o),i=n[s],c=!Fn(n);jt(n,c,l=>{for(;e!==t;)if(l()){ur(e);let{retryFiber:f}=n;f?(e=f,t=n,n.retryFiber=null):e=_n(e,t,i,a)}else{at(e,t);return}if(n.callRenderCallbacks(),r){let f=e===t&&!n.retryFiber,m=r.transitionState!==ae;f&&m&&(gn(r),r.tryCount=0),!n.hasUncommittedEffect&&Ne(r)&&Lt(n)}dr(n)&&fr.fn(n),Et(n)&&b(C,()=>{n.updateSource=C,Ie(n)})})}function Ie(e){let t=Et(e);t&&(e.updateType=y,it(e),e.currentTransition=t,t.tryCount+=1,e.wip=We(e.current,e.wip,e,e),at(e.wip,e))}function ct(e){let{root:t,parent:n}=e;t.updateType=S,t.currentTransition=null,it(t),at(e,n)}function M(e){let t=v(e),{root:n}=t,{pendingTransitions:o,batchUpdates:r}=n,s=re(),a=Nt(),i=_e();if(L(t,i),s===C&&!o.includes(a)&&(a===U?o.unshift(a):o.push(a)),r[s]){r[s]+=1;return}r[s]=1,Ce(()=>{let c=r[s];r[s]=0;let l=s===C;if(!(l&&n.lastCompleteTime<n.updateTime))if(n.updateSource=s,l)Ie(n);else{let p=n.updateType===S&&n.cancelSchedule;ct(s===O&&!p&&c===1?t:n.current)}})}var R=class{constructor(t){this.props=t,this.state=void 0,this.context=void 0,this[d]={lastSnapshot:null,pendingSyncUpdates:[],pendingDeferredUpdates:[],fiber:null,nodes:null,mounted:!1,committedValues:{},memoizedValues:null,isDirty:!1,renderCount:0}}setState(t,n){et(this,r=>({state:t,transitionId:r,callback:n}))&&M(this)}forceUpdate(t){let n=this[d],{fiber:o}=n;o&&(o.root.forcedUpdateWith=this,this[d].isDirty=!0,M(this),t&&t(this.state))}render(){}__render(){let t=this.render();return this[d].nodes=t,t}};R.prototype.isReactComponent=!0;var ie=class extends R{};ie.prototype.isPureReactComponent=!0;function I(e,t,n){let{ref:o}=t;n===void 0&&(n=t.key),t=ce(t,e.__isForwardRef);let r=Ve(t,null,n);if(r.type=e,typeof e=="string")return r.nodeType=Z,r.ref=o,r;let s=e.prototype&&e.prototype.isReactComponent;r.nodeType=s?D:gt,r.ref=s?o:null,e.__loadLazyComponent&&e.__loadLazyComponent();let a=typeof e=="function"&&e.defaultProps;if(a)for(n in a)t[n]===void 0&&(t[n]=a[n]);return r}function uo(e,t,n){t=t||{};let r=arguments.length>3?$(arguments,2):n;return r&&(t.children=r),I(e,t,t.key)}function rt(e,t){let{root:n}=e,{nodeInstance:o}=e;for(;!(o instanceof De||t&&o instanceof V);){if(e=e.parent,e===n)return null;o=e.nodeInstance}return e}function zn(e){let t=rt(e.parent,!0);if(!(t&&t.nodeInstance instanceof V))return e;let{nodeInstance:o}=t,{childManagers:r}=o.suspenseManagers[Q(e,null).transitionId],{revealOrder:s}=o.props;return s==="backwards"||s==="together"?(r.forEach(a=>{a.component[d].isDirty=!0}),r[0].fiber):e}function $t(e){let{parentSuspenseManager:t}=e;return t&&t.isSuspenseList?t:null}function zt(e,t){let{nodeInstance:n}=e,{suspenseManagers:o}=n,{transitionId:r}=t,s=o[r];return s||(s=o[r]=new Gt(e,t)),t.transitionState===X&&(s.suspender=null),s}function mo(e){e[d].isDirty=!0}function mr(e){let t=v(e.component);e.isUnresolved()&&t&&(mo(e.component),L(t,y))}var Gt=class{constructor(t,n){let{nodeInstance:o}=t;this.fiber=t,this.component=o,this.transition=n,this.childManagers=[],this.suspender=null,this.isSuspenseList=o instanceof V;let r=rt(t.parent,!0);this.parentSuspenseManager=r&&zt(r,n),this.recordChildSuspense(),this.handleSuspense=this.handleSuspense.bind(this)}recordChildSuspense(){let{parentSuspenseManager:t}=this;t?(t.childManagers.push(this),this.rootSuspenseManager=t.rootSuspenseManager):this.rootSuspenseManager=this}addRootToProcess(){let{rootSuspenseManager:t}=this,{root:n}=N();n.afterRender(t.handleSuspense)}suspend(t){this.suspender=t,this.addRootToProcess()}handleSuspense(){let{component:t,suspender:n}=this;return t instanceof V?this.handleSuspenseList():Promise.resolve(n).then(this.resolve.bind(this,n))}isUnresolved(){return this.isSuspenseList?this.childManagers.some(t=>t.isUnresolved()):this.suspender}shouldShowFallback(){let t=$t(this);if(!t)return!0;let{component:n,childManagers:o}=t,{tail:r}=n.props;if($t(t)&&!t.shouldShowFallback())return!1;if(r==="collapsed")for(let a=0,i=o.length;a<i;a++){let c=o[a];if(r==="collapsed"&&c.isUnresolved())return c===this}return r!=="hidden"}shouldRenderChildren(){let t=$t(this),{suspender:n}=this;if(!t)return!n;if($e(this.component)&&!n)return!0;let{component:{props:{revealOrder:o}},childManagers:r}=t,s=r.indexOf(this);return!r.some((i,c)=>{let{suspender:l}=i;return l?o==="together"||o==="forwards"&&c<=s||o==="backwards"&&c>=s:!1})}resolve(t){let{component:n,transition:o,suspender:r,childManagers:s}=this,a=o.pendingSuspense||[];if(t!==r)return;if(!r){s.forEach(p=>{p.handleSuspense()});return}this.suspender=null,mo(this.component);let i=o.transitionState===K,c=a.filter(p=>p.suspenseManagers[o.transitionId].suspender).length;!i&&!c&&(o.transitionState=Ee);let l=()=>{let p=n;v(n)||(p=this.fiber.root.wip.nodeInstance),M(p)};setTimeout(()=>{i||!a.includes(n)?Je(l):se(o,l)},hn()%dn)}getChildrenSuspenders(){let t=[];return this.childManagers.forEach(n=>{n.isSuspenseList?t=t.concat(n.getChildrenSuspenders()):n.suspender&&t.push(n.suspender)}),t}handleSuspenseList(){let{component:t,childManagers:n}=this,{revealOrder:o="together",tail:r}=t.props,s=(i,c)=>i.then(()=>(o==="forwards"&&r==="collapsed"&&mr(c),c.handleSuspense())),a=Promise.all(this.getChildrenSuspenders());if(o==="together")a.then(()=>{n.forEach(i=>i.handleSuspense())});else if(o==="forwards"){let i=je;for(let c=0,l=n.length;c<l;c++)i=s(i,n[c])}else if(o==="backwards"){let i=je;for(let c=n.length-1;c>=0;c--)i=s(i,n[c])}return a}};function fo(e){let t=N(),n=Q(t,U);return n.transitionState===Ee&&!n.pendingSuspense.includes(e)&&(n=U),n}var V=class extends R{constructor(t){super(t),this.suspenseManagers={}}render(){return this.props.children}},De=class extends R{constructor(t){super(t),this.suspenseManagers={}}handleSuspender(t,n){let o=fo(this),r=zt(n,o);Ne(o)||(o.pendingSuspense.includes(this)||o.pendingSuspense.push(this),o.transitionState=ae),r.suspend(t)}render(){let{fallback:t,children:n}=this.props,o=fo(this),r=N(),s=zt(r,o);return s.shouldRenderChildren()?n:s.shouldShowFallback()?t:null}},To=e=>{let t,n=st((o,r)=>{let s=t.read();return I(s.default,{...o,ref:r})});return n.__loadLazyComponent=()=>{t||(t=yn(e()))},n};function Tr(e){return e.split(",").map(n=>{let[o,r,s]=n.split("|"),a=o==="0",i=o==="2";return{isAttribute:a,refNodeIndex:r?Number(r):-1,attrIndex:a?Number(s):-1,prevChildIndex:!a&&s?Number(s):-1,hasExpressionSibling:i,tagAttrs:void 0}})}var Pe=class{constructor(t,n){this.strings=t,this.template=null,this.svgTemplate=null,this.partsMeta=[],this.partMetaCode=n}create(t){t&&this.svgTemplate||this.template||(this.partsMeta.length||(this.partsMeta=Tr(this.partMetaCode)),this.createTemplate(t))}createTemplate(t){let{strings:n}=this,o=document.createElement("template"),r=n.join("");if(o.innerHTML=t?`<svg>${r}</svg>`:r,t){let{content:a}=o,i=a.firstChild;for(;i.firstChild;)a.insertBefore(i.firstChild,i);a.removeChild(i)}let s=t?"svgTemplate":"template";this[s]=o}};var ho=new WeakMap;function hr(e,t){let n=Ve(null,t,void 0);return n.nodeType=yt,n.template=e,n}function Eo(e,...t){return n=>{let o=ho.get(e);return o||(o=new Pe(e,n),ho.set(e,o)),hr(o,t)}}function Vt(e,t){let{__rootFiber:n}=t,o;if(n)o=n.current,o.node.props.children=e,o.processedTime=0,L(o,S);else{let r=I(pe,{children:e}),s={parentNode:t,previousSibling:null,isNode:!0};n=Xe(t),o=ue(n,r,s),o.parent=n,n.current=o,t.__rootFiber=n}return fe(()=>{n.updateSource=re(),ct(o)}),e&&e.nodeType===D?o.child.nodeInstance:null}function Er(e,t){return e&&(e.portalContainer=t),e}var yo=Er;function yr(e){let{__rootFiber:t}=e;return t?(oe(t.current),me(t),e.__rootFiber=void 0,!0):!1}var go=yr;var gr=/<([^\s"'=<>/]+)/g,Co=/\s*([^\s"'=<>/]*)/g,Cr=/[^"]*/g,Sr=/[^"]*/g,Nr=/<\/([^\s"'=<>]+)>/g,Ar=/[^<]*/g,_r=/<!--.*?-->/g,xr=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"];function Fr(e){let t=[],n=!1,o,r={},s=(l,p)=>{l.children?Array.isArray(l.children)?l.children.push(p):l.children=[l.children,p]:l.children=p},a=l=>{let p=t[t.length-1];s(p?p.props:r,l)},i=()=>{n=!1,a(o),xr.includes(o.type)||t.push(o)},c=l=>{let p={$$BrahmosDynamicPart:l};o?n?o.props[`$$BrahmosDynamicPart${l}`]=p:s(o.props,p):s(r,p)};return e.forEach((l,p)=>{let f=l.length,m,u=0,T=E=>{E.lastIndex=u;let h=E.exec(l);return h&&(u=E.lastIndex),h},A=E=>{E.lastIndex=u+2;let h=E.exec(l);return u=E.lastIndex+1,h[0]};for(;u<f;){if(l[u]==="<"&&l[u+1]==="/"){t.pop(),T(Nr);continue}else if(l[u]==="<"&&l[u+1]==="!"){T(_r);continue}else if(l[u]==="<"){m=T(gr)[1],o={$$typeof:we,type:m,nodeType:Z,props:{}},n=!0;continue}else if(l[u]===" "&&n){Co.lastIndex=u;let E=T(Co),h,g;if(E){h=E[1],l[u]!=="="?g=!0:l[u+1]==='"'?g=A(Cr):l[u+1]==="'"&&(g=A(Sr)),h&&(o.props[h]=g);continue}}else if(l[u]===">"&&n)i();else if(!n){let E=T(Ar);a(E[0]);continue}u++}c(p)}),r.children}var{hasOwnProperty:Rr}=Object.prototype;function So(e,t){if(e==null||typeof e!="object")return e;let n=new e.constructor;for(var o in e)if(Rr.call(e,o)){let r=e[o],s=r&&r.$$BrahmosDynamicPart;if(s!==void 0){let a=t[s];o[0]==="$"?n=Object.assign(n,a):n[o]=a}else n[o]=So(e[o],t)}return n}function Oe(e){let{values:t,template:n}=e,{strings:o}=n;return n.staticTree||(n.staticTree=Fr(o)),So(n.staticTree,t)}function br(e){return B(e)&&!e.template.strings.some(Boolean)}function No(e){let t=[];return e.forEach(n=>{Array.isArray(n)?t=t.concat(No(n)):n&&J(n)?t.push(Oe(n)):t.push(n)}),t}function Ue(e){if(q(e))return;if(typeof e=="boolean")return[];if(e[d])return e[d];let t=e;return br(t)&&(t=t.values),J(t)&&(t=Oe(t)),Array.isArray(t)||(t=[t]),t=No(t),e[d]=t,t}function Ir(e,t){let n=Ue(e);return n?n.map(t):e}function Dr(e){return(Ue(e)||[]).map((n,o)=>(n&&n.key===void 0&&(n.key=o),n))}function Pr(e,t){(Ue(e)||[]).forEach(t)}function Or(e){return Ue(e)&&e.length===1}function Ur(e){let t=Ue(e);return t?t.length:0}var Ao={map:Ir,toArray:Dr,forEach:Pr,only:Or,count:Ur};function _o(e){return e&&(_(e)||G(e))}function Wt(e,t){t=t||{};let n=arguments.length;if(n>2){let o=n>3?$(arguments,2):arguments[2];t.children=o}if(e){if(J(e)){let o=Oe(e);return Wt(o,t)}else if(_(e)||G(e))return{...e,props:{...e.props,...ce(t,!1)},ref:t.ref}}return e}function Xt(e,t){class n extends ie{render(){return I(e,this.props)}}return n.displayName=`Memo(${e.displayName||e.name})`,n}function xo(e){let t=e[ke];return t||(t=Xe(e),e[ke]=t),{render(n){let o=t.current;if(o)o.node.props.children=n,o.processedTime=0,L(o,y);else{let s=I(pe,{children:n});o=ue(t,s,{parentNode:e,previousSibling:null,isNode:!0}),o.parent=t,t.current=o}let r=U;t.pendingTransitions.includes(r)||t.pendingTransitions.push(r),b(C,()=>{t.updateSource=C,Ie(t)})},unmount(){t.cancelSchedule&&(t.cancelSchedule(),t.cancelSchedule=null);let n=t.current;n&&(n.shouldTearDown=!0,t.tearDownFibers.push(n),me(t),t.current=null),delete e[ke]}}}function qt(e){if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status==="pending"||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})),e)}function Fo(e){if(!N())throw new Error("use() must be called during render.");if(e&&typeof e.then=="function")return qt(e);throw new Error("Unsupported type passed to use()")}function Ro(e){let t=Promise.resolve(),n=new Set,o=e(r=>{n.forEach(s=>s(r))});return t._watch={unsubscribe:r=>{r&&n.delete(r),n.size===0&&o&&o()},subscribe:r=>n.add(r)},t}function Qt(e){bo(e)}Qt.sync=e=>{bo(e,{sync:!0})};function bo(e,t={}){xe(()=>{var r;let n=N(),o=n?n.nodeInstance:null;if(!o)throw new Error("watch() must be called during render.");if(e._watch&&!((r=o.__unmount)!=null&&r.has(e))){let s=()=>{let a=v(o);if(a){let i=t.sync?O:C;b(i,()=>{o[d].isDirty=!0,F(a,x),M(o)})}};e._watch.subscribe(s),o.__unmount.set(e,()=>e._watch.unsubscribe(s))}qt(e)})}var Io=e=>e.children,vr=Io,Mr=Io;function wr(e){e()}var Lr=I,kr=I,Hr=I;var hc=Zt;export{Ao as Children,R as Component,Mr as Fragment,ie as PureComponent,vr as StrictMode,De as Suspense,V as SuspenseList,Wt as cloneElement,_t as createContext,uo as createElement,yo as createPortal,Zn as createRef,xo as createRoot,hc as default,st as forwardRef,Eo as html,Ro as initWatch,_o as isValidElement,Lr as jsx,Hr as jsxDev,kr as jsxs,To as lazy,Xt as memo,Vt as render,xe as startTransition,go as unmountComponentAtNode,wr as unstable_batchedUpdates,Je as unstable_deferredUpdates,fe as unstable_syncUpdates,Fo as use,Ln as useCallback,Bn as useContext,Hn as useDebugValue,Kn as useDeferredValue,bt as useEffect,It as useLayoutEffect,Rt as useMemo,wn as useReducer,Mn as useRef,Ft as useState,Yn as useTransition,Qt as watch};
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "potatejs",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "Super charged UI library with modern React API and native templates.",
5
5
  "author": "uniho",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
+ "keywords": [
9
+ "react",
10
+ "potate"
11
+ ],
8
12
  "files": [
9
13
  "dist/",
10
14
  "bin/",