Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

effector-dom

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effector-dom - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

5

effector-dom.cjs.d.ts

@@ -101,3 +101,6 @@ import {Store, Event, Step} from 'effector'

): void
export function variant<Case extends string>(
key: Store<Case>,
cases: Partial<{[K in Case]: () => void}>,
): void
export function list<T>(

@@ -104,0 +107,0 @@ source: Store<T[]>,

2

effector-dom.cjs.js

@@ -1,2 +0,2 @@

function e(e,t){const n=Z(e);for(let e=0;e<t.length;e++){const s=Z(t[e]);s.family.type='crosslink';const r=H(s),l=J(n);r.includes(n)||r.push(n),l.includes(s)||l.push(s)}}function t(e,t){n(e,t),s(t,e)}function n(e,t){e&&e!==t&&(e.locality.sibling.right.ref=t)}function s(e,t){e&&e!==t&&(e.locality.sibling.left.ref=t)}function r(){const e={stack:null},t=B.get(),n=effector.createNode({node:[Q,ee],parent:[t&&t.signal].filter(Boolean),meta:{unit:'signal'},scope:e});return e.self=n,n}function l(e){switch(e=String(e)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return e.replace(te,'')}}function i(e){return String(e).replace(ne,'')}function o({node:e,append:t,reverse:n=0}){if(0===t.length)return;const s=ie.createDocumentFragment();if(n){for(let e=t.length-1;e>=0;e--)s.appendChild(t[e]);e.prepend(s)}else{for(let e=0;e<t.length;e++)s.appendChild(t[e]);e.appendChild(s)}}function a(e,t){t.parent=e,t.signal.seq.push(oe),t.signal.scope.stack=t,e.child.push(t)}function c(e,t){return effector.createNode({node:[ae],parent:e,meta:{op:'watch'},scope:{fn:t},family:{type:'crosslink',owners:[e]}})}function f(){ge=0,pe()}function u(e,t,n){const s=(e=>'high'===xe.get(e)?ke:we)(e);let r=s.get(e);if(r||(r=[],s.set(e,r)),t)for(let e=0;e<n.length;e++)r.push(n[e]);else r.push(n);ye()}function p(t,n,s=0,r="low"){const l=++Ee,i=effector.createEvent(),o=effector.is.store(a=t)?a.updates:a;var a;const c={type:'crosslink',owners:[o,i]};return effector.createNode({node:[Oe],parent:[o],scope:{taskID:l,flat:s},family:c}),e(t,[i]),ve.set(l,effector.createNode({node:[Ae],child:[effector.createNode({node:[_e,Re,Ie],scope:{taskID:l},family:c}),effector.createNode({node:[Ce,Re],child:[i],family:c})],scope:{fn:n},family:c})),xe.set(l,r),i}function h({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:r=0,retries:l=1/0,mark:i=e.shortName}){const o=p(e.map(e=>[{inserted:ue(),retry:0,value:e}]),(e,n)=>{let i,o=0;const a=[],c=[];for(i=0;i<e.length;i++){const l=e[i],f=ue();if(l.inserted+r>f){c.push(l);continue}if(l.inserted+s<f)continue;if(f-n>=10){o=1;break}const u=t(l.value);void 0!==u&&a.push(u)}if(o)for(let t=i;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=l||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:o,connect:t=>{effector.createNode({node:[],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function d({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:r=0,retries:l=1/0,mark:i=e.shortName,flatten:o}){const a=p(e.map(e=>{const t=[],n=ue();for(let s=0;s<e.length;s++){const r=o(e[s]);for(let e=0;e<r.length;e++)t.push({inserted:n,retry:0,value:r[e]})}return t}),(e,n)=>{let i,o=0;const a=[],c=[];for(i=0;i<e.length;i++){const l=e[i],f=ue();if(l.inserted+r>f){c.push(l);continue}if(l.inserted+s<f)continue;if(f-n>=10){o=1;break}const u=t(l.value);void 0!==u&&a.push(u)}if(o)for(let t=i;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=l||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:a,connect:t=>{effector.createNode({node:[$e],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function g(e,t,n){c(e,t.watch(n))}function m(e,t,n){effector.createNode({node:[Pe],parent:t,child:[Ve],family:{type:'crosslink',owners:e},scope:{handler:n},meta:{op:'debounceRaf'}}),effector.is.store(t)&&effector.launch(Ve,{data:t.getState(),handler:n},1)}function b(e,t,n,s){effector.is.unit(n)?(e?g:m)(t,n,s):s(n)}function y(e,t=e.child.length-1){for(let n=t;n>=0;n--){const t=e.child[n];switch(t.node.type){case'element':case'using':if(!t.visible)continue;return t}const s=y(t);if(s)return s}return null}function v(e){if(!e.parent)return null;switch(e.parent.node.type){case'element':case'using':{const t=y(e.parent,e.parent.child.indexOf(e)-1);if(t)return t;break}case'list':case'listItem':{let t=e,n=e.parent;for(;n;){const e=y(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function k(e){return''!==e&&0!==e&&(0==e||null==e)}function w(e,t,n){k(n)?delete e[t]:e[t]=`${n}`}function x(e,t,n,s){if(n.visible=s,s){if(!t.contains(e)){const s=v(n);s&&t.contains(s.targetElement)?s.targetElement.after(e):t.appendChild(e)}}else e.remove()}function E(e,t,n){if(null===n)return;const s=B.get().parent.targetElement;m(t,n,x.bind(null,e,s,B.get()))}function S(e,t,n){if(k(n)){switch(t){case'value':delete e.value;break;case'checked':e.checked=0;break;case'spellcheck':if(0==n)return void e.setAttribute('spellcheck','false')}e.removeAttribute(t)}else{switch(t){case'value':e.value=`${n}`;break;case'checked':e.checked=`${n}`}e.setAttribute(t,`${n}`)}}function N(e,t,n,s,r,l){const i=e.createSVGTransform();switch(l){case'translate':case'scale':s=(e=>effector.is.store(e)?e:effector.is.store(e.x)?effector.is.store(e.y)?effector.combine({x:e.x,y:e.y}):e.x.map(Fe.bind(null,e.y)):effector.is.store(e.y)?e.y.map(Me.bind(null,e.x)):e)(s)}b(0,t,s,r.bind(null,i)),n.appendItem(i)}function C(e,t){const n=ie.createTextNode(`${t}`),s=e.firstChild;s?s.replaceWith(n):e.appendChild(n)}function _(e){e.focus()}function R(e){e.blur()}function I(e,t){return e.bind(null,t)}function O(t,n){const s=B.get();if(Array.isArray(n)){const r=[];for(let e=0;e<n.length;e++)r[e]=t.map(I(A,n[e]));return s&&e(s.signal,r),r}if('object'==typeof n&&null!==n){const r=[],l={};for(const e in n)l[e]=t.map(I(A,n[e])),r.push(l[e]);return s&&e(s.signal,r),l}const r=t.map(I(A,n));return s&&e(s.signal,r),r}function A(e,t){return t[e]}function $(t,n){let s,l,i=0;effector.is.store(t)?(l=We,s=t):(l=I(Xe,t.key),s=t.source,i=!!t.reverse);const o=B.get(),f=r(),u={parent:o,signal:f,namespace:o.namespace,targetElement:o.targetElement,svgRoot:o.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'list',pure:0,reverse:i,key:effector.is.store(t)?{type:'index'}:{type:'key',key:t.key},store:s,cb:n},mountStatus:'initial',visible:1};a(o,u),B.replace(u);const p={parentNode:o.targetElement,cb:n,shortName:s.shortName,reverse:i,parentStack:u,getID:l,fields:t.fields?t.fields:null},h=effector.createStore(P(p,[],s.getState()));e(f,[h]),c(f,I(Ge,h)),effector.sample({source:h,clock:s,fn:I(P,p),target:h}),B.replace(o)}function P(l,i,o){const c=Array(o.length).fill(0),f=o.map(l.getID),u=[],p=[],h=[];for(let e=0;e<i.length;e++){const t=i[e],n=t.node,s=f.indexOf(n.key);-1!==s?(p.push(t),c[s]=1,n.store.getState()!==o[s]&&effector.launch(n.store,o[s],1)):h.push(t)}if(h.length>0){for(let e=0;e<h.length;e++){const r=h[e],{node:l,locality:i}=r;l.active=0,l.store=null,t(i.sibling.left.ref,i.sibling.right.ref),n(r,null),s(r,null)}effector.launch(Ye,h,1)}let d=p.length>0?p[p.length-1]:null;for(let n=0;n<o.length;n++){if(c[n])continue;const s=o[n],i=effector.createStore(s),f=r(),h=l.fields?O(i,l.fields):null;e(f,[i]);const g=l.getID(s,n),m={parent:l.parentStack,signal:f,namespace:l.parentStack.namespace,targetElement:l.parentStack.targetElement,svgRoot:l.parentStack.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'listItem',pure:0,key:g,index:g,store:i,signal:f,active:1,nodes:[],fields:h},mountStatus:'initial',visible:1};t(d,m),d=m,a(l.parentStack,m),u.push(m),p.push(m)}return u.length>0&&effector.launch(qe,{context:l,list:u},1),p}function V(t){const n=B.get();return n&&e(n.signal,[t]),t}function D(){const e=B.get();if('element'!==e.node.type&&'using'!==e.node.type)throw Error(`this extension can be used only with element nodes, got "${e.node.type}"`)}function T(e){const t=B.get();t.targetElement.__STATIC__||e(t.targetElement)}function j(e){e.attr&&F(e.attr),e.data&&M(e.data),e.transform&&z(e.transform),'text'in e&&L(e.text),'visible'in e&&q(e.visible),(e.style||e.styleVar)&&W({prop:e.style,val:e.styleVar}),e.focus&&Y(e.focus),e.handler&&X(e.handler)}function F(e){D(),B.getElementNode().attr.push(e)}function M(e){D(),B.getElementNode().data.push(e)}function z(e){D(),B.getElementNode().transform.push(e)}function L(e){D(),B.getElementNode().text.push(e)}function q(e){D(),B.getElementNode().visible.push(e)}function W({prop:e,val:t}){D(),e&&B.getElementNode().styleProp.push(e),t&&B.getElementNode().styleVar.push(t)}function X(e,t){D(),void 0===t&&(t=e,e={});const{passive:n=1,capture:s=0}=e;B.getElementNode().handler.push({options:{passive:n,capture:s},map:t})}function Y({focus:e,blur:t}){D();const n=B.getElementNode();e&&n.focus.push(e),t&&n.blur.push(t)}Object.defineProperty(exports,'__esModule',{value:1});var effector=require('effector');const G=[];let U;const B={get:()=>U,replace(e){U=e},getElementNode:()=>U.node},Z=e=>e.graphite||e,H=e=>e.family.owners,J=e=>e.family.links,K=effector.createNode({node:[effector.step.run({fn(e){effector.clearNode(e)}})]}),Q=effector.step.compute({fn(e,r){r.self.next.push(K);const{stack:l}=r,{parent:i}=l,{left:o,right:a}=l.locality.sibling;i&&(i.locality.child.last.ref===l&&(i.locality.child.last.ref=o.ref),i.locality.child.first.ref===l&&(i.locality.child.first.ref=a.ref)),o.ref&&o.ref.locality.sibling.right.ref===l&&a.ref&&a.ref.locality.sibling.left.ref===l?t(o.ref,a.ref):o.ref&&o.ref.locality.sibling.right.ref===l?n(o.ref,null):a.ref&&a.ref.locality.sibling.left.ref===l&&s(a.ref,null)}}),ee=effector.step.compute({fn:(e,{self:t})=>t}),te=/[^a-zA-Z0-9\-]/g,ne=/[\\<>"]/g;class se{constructor(){this.properties=Object.create(null)}setProperty(e,t){this.properties[l(e)]=i(t)}removeProperty(e){delete this.properties[l(e)]}}class re{constructor(){this.items=[]}appendItem(e){this.items.push(e)}}class le{constructor(){this.value=''}setTranslate(e,t){this.value=`translate(${e} ${t})`}setScale(e,t){this.value=`scale(${e} ${t})`}setRotate(e,t,n){this.value=0!==t||0!==n?`rotate(${e} ${t} ${n})`:`rotate(${e})`}setSkewX(e){this.value=`skewX(${e})`}setSkewY(e){this.value=`skewY(${e})`}}(new class{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new se,this.firstChild=null,this.transform={baseVal:new re},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}appendChild(e){if(e.parent&&e.remove(),e.isFragment&&null===e.textContent){let t,n=e.firstChild;for(;n;)t=n.sibling.right,this.appendChild(n),n=t}else this.child.last?(this.child.last.sibling.right=e,e.sibling.left=this.child.last):(this.child.first=e,this.firstChild=e),this.child.last=e,e.parent=this}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,e.sibling.right=this.child.first):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}contains(e){let t=e;for(;t;){if(t===this)return 1;t=t.parent}return 0}remove(){if(!this.parent)return;const{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,this.sibling.left.sibling.right=null):(this.sibling.right.sibling.left=this.sibling.left,this.sibling.left.sibling.right=this.sibling.right),this.sibling.left=null,this.sibling.right=null,this.parent=null}addEventListener(e,t,n){}removeEventListener(e,t,n){}setAttribute(e,t){this.attributes[l(e)]=i(t)}removeAttribute(e){delete this.attributes[l(e)]}replaceWith(e){if(!this.parent)return;const{parent:t}=this;e.parent&&e.remove(),t.child.first===this&&t.child.last===this?(t.firstChild=e,t.child.first=e,t.child.last=e):t.child.first===this?(t.child.first=e,t.firstChild=e,this.sibling.right.sibling.left=e):t.child.last===this?(t.child.last=e,this.sibling.left.sibling.right=e):(this.sibling.right.sibling.left=e,this.sibling.left.sibling.right=e),e.sibling.left=this.sibling.left,e.sibling.right=this.sibling.right,e.parent=t,this.sibling.left=null,this.sibling.right=null,this.parent=null}focus(){}blur(){}createSVGTransform(){return new le}}).isBody=1;let ie='undefined'!=typeof document?document:null;const oe=effector.step.compute({fn(e,t){if(!t.stack)return e;const{stack:n}=t;t.stack=null;const s=n.parent.child.indexOf(n);return-1!==s&&n.parent.child.splice(s,1),n.parent=null,e}}),ae=effector.step.run({fn(e,{fn:t}){t(e)}});let ce,fe,ue;ce=()=>{},fe=()=>{},ue='undefined'!=typeof performance&&performance.now?()=>performance.now():'undefined'!=typeof process&&process.hrtime?()=>{const e=process.hrtime();return(1e9*e[0]+e[1])/1e6}:()=>Date.now();const pe=effector.createEvent();let he,de=0,ge=0;const me='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),be='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,ye=()=>{ge||(ge=1,he=me(f))},ve=new Map,ke=new Map,we=new Map,xe=new Map;let Ee=0,Se=0;const Ne=effector.createNode({node:[effector.step.run({fn:()=>{}}),effector.step.filter({fn:()=>0===ke.size&&0===we.size?0:ue()-Se>=10?0:(be(he),de=1,ge=0,1)})],child:[pe]});pe.watch(()=>{if(ge)return;if(0===ke.size&&0===we.size)return void(de=0);let e=0;de||(Se=ue()),de=0;for(const[t,n]of ke){if(ue()-Se>=10){ye(),e=1;break}ke.delete(t),effector.launch({target:ve.get(t),params:n,defer:1})}if(!e)for(const[t,n]of we){if(ue()-Se>=10){ye(),e=1;break}we.delete(t),effector.launch({target:ve.get(t),params:n,defer:1})}effector.launch({target:Ne,params:null,defer:1})});const Ce=effector.step.compute({fn:({done:e})=>e}),_e=effector.step.compute({fn:({fail:e})=>e}),Re=effector.step.filter({fn:e=>e.length>0}),Ie=effector.step.compute({fn(e,{taskID:t}){u(t,1,e)}}),Oe=effector.step.compute({fn(e,{taskID:t,flat:n}){u(t,n,e)}}),Ae=effector.step.run({fn:(e,{fn:t})=>t(e,Se)}),$e=effector.step.compute({fn:e=>[e]}),Pe=effector.step.run({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:Ve}=h({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),De=(e,{map:t,options:n})=>{for(const s in t)e.removeEventListener(s,t[s],n)},Te=(e,t,n)=>{k(n)?delete e[t]:e[t]=n},je=(e,t,n)=>{k(n)?e.removeProperty(t):e.setProperty(t,n)},Fe=(e,t)=>({x:t,y:e}),Me=(e,t)=>({x:e,y:t}),ze={translate(e,{x:t=0,y:n=0}){e.setTranslate(t,n)},scale(e,{x:t=0,y:n=0}){e.setScale(t,n)},rotate(e,t){'number'==typeof t?e.setRotate(t,0,0):e.setRotate(t.angle||0,t.x||0,t.y||0)},skewX(e,t){e.setSkewX(t)},skewY(e,t){e.setSkewY(t)}},{trigger:Le}=h({mark:'append DOM nodes',fn:e=>{for(let t=0;t<e.append.length;t++){const n=e.append[t];if(0==n.listItem.active)continue;if(0===n.appended.length)continue;const s=ie.createDocumentFragment();if(e.reverse)for(let e=n.appended.length-1;e>=0;e--)s.appendChild(n.appended[e]);else for(let e=0;e<n.appended.length;e++)s.appendChild(n.appended[e]);const r=v(n.listItemStack);r&&e.node.contains(r.targetElement)?e.reverse?r.targetElement.before(s):r.targetElement.after(s):e.node.appendChild(s)}}}),{trigger:qe}=h({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:s,cb:r,reverse:l}=e,i=B.get();B.replace(n);const o=[],a=[];G.push({node:s,append:a,reverse:l});for(let e=0;e<t.length;e++){const n=t[e],s=n.node;if(s.active){B.replace(n),effector.withRegion(n.signal,I(r,s));for(let e=0;e<a.length;e++)s.nodes.push(a[e]);o.push({listItemStack:n,appended:a.slice(),listItem:s}),a.length=0}}G.pop(),o.length>0&&effector.launch({target:Le,params:{node:s,append:o,reverse:l},defer:1}),B.replace(i)}}),We=(e,t)=>t,Xe=(e,t)=>t[e],Ye=effector.createEvent();d({trigger:Ye,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&effector.launch(e,null,0)}}),d({trigger:Ye,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const Ge=e=>{const t=e.getState();for(let e=0;e<t.length;e++){const n=t[e].node;n.active=0,n.store=null}effector.launch(Ye,t,1)};exports.attr=F,exports.combine=({source:e,fn:t})=>(console.error('separate combine method is deprecated, use common combine method as usual'),V(effector.combine(e,t))),exports.data=M,exports.explicitUnmount=e=>{const t=B.get();t&&effector.createNode({node:[],parent:e,child:t.signal,family:{type:'crosslink',owners:[t.signal,e]}})},exports.focus=Y,exports.h=(e,t,n)=>{'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:s=0}=t,l=B.get(),i=l?l.namespace:'html';let f=i,u='html';'type'in t?(u=t.type,f=t.type):f=u='svg'===i?'svg':'html','svg'===e&&(u='svg',f='svg');const p='svg'===u?ie.createElementNS('http://www.w3.org/2000/svg',e):ie.createElement(e);'foreignObject'===i?(p.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),f='html'):'svg'===e?(p.setAttribute('xmlns','http://www.w3.org/2000/svg'),f='svg'):'foreignObject'===e&&(f='foreignObject');const h=r(),d={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},g={parent:null,signal:h,namespace:f,targetElement:p,svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:d,mountStatus:'initial',visible:1};l&&a(l,g),'svg'===e?g.svgRoot=p:l&&(g.svgRoot=l.svgRoot),B.replace(g),n?((e,t,n,s)=>{let r=0;G.push({node:t,append:[],reverse:0});try{effector.withRegion(e,s),r=1}finally{o(G.pop()),r||B.replace(n)}})(h,p,l,n):(d.pure=1,j(t));const y=(()=>{const e=(()=>{const e=B.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:e.handler,transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.attr.length;n++){const s=e.attr[n];for(const e in s)t.attr[e]=s[e]}for(let n=0;n<e.data.length;n++){const s=e.data[n];for(const e in s)t.data[e]=s[e]}e.visible.length>0&&(t.visible=e.visible[e.visible.length-1]),e.text.length>0&&(t.text=e.text[e.text.length-1]);for(let n=0;n<e.styleVar.length;n++){const s=e.styleVar[n];for(const e in s)t.styleVar[e]=s[e]}for(let n=0;n<e.styleProp.length;n++){const s=e.styleProp[n];for(const e in s)t.styleProp[e]=s[e]}return t})(),t=B.get(),n=t.targetElement,s=t.signal;return((e,t,n)=>{for(const s in n)b('value'!==s&&'checked'!==s&&'min'!==s&&'max'!==s,t,n[s],S.bind(null,e,s))})(n,s,e.attr),((e,t,n)=>{for(const s in n)b(0,t,n[s],w.bind(null,e.dataset,s))})(n,s,e.data),((e,t,n)=>{for(let s=0;s<n.length;s++){const{options:r,map:l}=n[s];for(const t in l)e.addEventListener(t,l[t],r);c(t,De.bind(null,e,n[s]))}})(n,s,e.handler),((e,t,n)=>{const s=e.style;for(const e in n)b(0,t,n[e],Te.bind(null,s,e))})(n,s,e.styleProp),((e,t,n)=>{const s=e.style;for(const e in n)b(0,t,n[e],je.bind(null,s,`--${e}`))})(n,s,e.styleVar),((e,t,n)=>{const s=B.get();if('svg'!==s.namespace)return;if(0===n.length)return;const r=e.transform.baseVal,l=s.svgRoot;for(let e=0;e<n.length;e++){const s=n[e];for(const e in s)N(l,t,r,s[e],ze[e],e)}})(n,s,e.transform),((e,t,n)=>{null!==n&&(effector.is.unit(n)?m(t,n,C.bind(null,e)):C(e,n))})(n,s,e.text),E(n,s,e.visible),((e,t,n)=>{for(let s=0;s<n.length;s++)b(1,t,n[s],_.bind(null,e))})(n,s,e.focus),((e,t,n)=>{for(let s=0;s<n.length;s++)b(1,t,n[s],R.bind(null,e))})(n,s,e.blur),e})();B.replace(l),g.visible=!y.visible||y.visible.getState(),s||G.length>0&&g.visible&&G[G.length-1].append.push(p)},exports.handler=X,exports.list=$,exports.map=(e,{fn:t})=>(console.error('separate map method is deprecated, use store.map as usual'),V(e.map(t))),exports.node=T,exports.nodeMethod=e=>{let t;return T(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}},exports.remap=O,exports.signalOwn=V,exports.spec=j,exports.storeField=(t,n)=>{const s=t.map(I(A,n)),r=B.get();return r&&e(r.signal,[s]),s},exports.style=W,exports.text=L,exports.transform=z,exports.tree=function e({key:t,child:n,source:s},r){$({source:s,key:t},({store:s,key:l,signal:i})=>{const o=O(s,n);r({store:s,key:l,signal:i},()=>{e({key:t,child:n,source:o},r)})})},exports.using=(e,t)=>{const n=e.namespaceURI,s=e.tagName.toLowerCase(),l='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===s?'foreignObject':'html',i=B.get(),a={parent:i,signal:i&&i.signal?i.signal:r(),namespace:l,targetElement:e,svgRoot:'svg'===s?e:i?i.svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'using',pure:0,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},mountStatus:'initial',visible:1};B.replace(a),G.push({node:e,append:[],reverse:0});try{effector.withRegion(a.signal,t)}finally{o(G.pop()),B.replace(i)}},exports.visible=q;
function e(e,t){const n=H(e);for(let e=0;e<t.length;e++){const s=H(t[e]);s.family.type='crosslink';const l=J(s),i=K(n);l.includes(n)||l.push(n),i.includes(s)||i.push(s)}}function t(e,t){n(e,t),s(t,e)}function n(e,t){e&&e!==t&&(e.locality.sibling.right.ref=t)}function s(e,t){e&&e!==t&&(e.locality.sibling.left.ref=t)}function l(){const e={stack:null},t=Z.get(),n=effector.createNode({node:[ee,te],parent:[t&&t.signal].filter(Boolean),meta:{unit:'signal'},scope:e});return e.self=n,n}function i(e){switch(e=String(e)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return e.replace(ne,'')}}function r(e){return String(e).replace(se,'')}function o({node:e,append:t,reverse:n=0}){if(0===t.length)return;const s=oe.createDocumentFragment();if(n){for(let e=t.length-1;e>=0;e--)s.appendChild(t[e]);e.prepend(s)}else{for(let e=0;e<t.length;e++)s.appendChild(t[e]);e.appendChild(s)}}function a(e,t){t.parent=e,t.signal.seq.push(ae),t.signal.scope.stack=t,e.child.push(t)}function c(e,t){return effector.createNode({node:[ce],parent:e,meta:{op:'watch'},scope:{fn:t},family:{type:'crosslink',owners:[e]}})}function f(){me=0,he()}function p(e,t,n){const s=(e=>'high'===Ee.get(e)?we:xe)(e);let l=s.get(e);if(l||(l=[],s.set(e,l)),t)for(let e=0;e<n.length;e++)l.push(n[e]);else l.push(n);ve()}function u(t,n,s=0,l="low"){const i=++Se,r=effector.createEvent(),o=effector.is.store(a=t)?a.updates:a;var a;const c={type:'crosslink',owners:[o,r]};return effector.createNode({node:[$e],parent:[o],scope:{taskID:i,flat:s},family:c}),e(t,[r]),ke.set(i,effector.createNode({node:[Ae],child:[effector.createNode({node:[Re,_e,Oe],scope:{taskID:i},family:c}),effector.createNode({node:[Ie,_e],child:[r],family:c})],scope:{fn:n},family:c})),Ee.set(i,l),r}function h({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:l=0,retries:i=1/0,mark:r=e.shortName}){const o=u(e.map(e=>[{inserted:ue(),retry:0,value:e}]),(e,n)=>{let r,o=0;const a=[],c=[];for(r=0;r<e.length;r++){const i=e[r],f=ue();if(i.inserted+l>f){c.push(i);continue}if(i.inserted+s<f)continue;if(f-n>=10){o=1;break}const p=t(i.value);void 0!==p&&a.push(p)}if(o)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=i||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:o,connect:t=>{effector.createNode({node:[],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function d({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:l=0,retries:i=1/0,mark:r=e.shortName,flatten:o}){const a=u(e.map(e=>{const t=[],n=ue();for(let s=0;s<e.length;s++){const l=o(e[s]);for(let e=0;e<l.length;e++)t.push({inserted:n,retry:0,value:l[e]})}return t}),(e,n)=>{let r,o=0;const a=[],c=[];for(r=0;r<e.length;r++){const i=e[r],f=ue();if(i.inserted+l>f){c.push(i);continue}if(i.inserted+s<f)continue;if(f-n>=10){o=1;break}const p=t(i.value);void 0!==p&&a.push(p)}if(o)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=i||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:a,connect:t=>{effector.createNode({node:[Pe],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function g(e,t,n){c(e,t.watch(n))}function m(e,t,n){effector.createNode({node:[Ve],parent:t,child:[De],family:{type:'crosslink',owners:e},scope:{handler:n},meta:{op:'debounceRaf'}}),effector.is.store(t)&&effector.launch(De,{data:t.getState(),handler:n},1)}function b(e,t,n,s){effector.is.unit(n)?(e?g:m)(t,n,s):s(n)}function y(e,t=e.child.length-1){for(let n=t;n>=0;n--){const t=e.child[n];switch(t.node.type){case'element':case'using':if(!t.visible)continue;return t}const s=y(t);if(s)return s}return null}function v(e){if(!e.parent)return null;switch(e.parent.node.type){case'element':case'using':{const t=y(e.parent,e.parent.child.indexOf(e)-1);if(t)return t;break}case'list':case'listItem':{let t=e,n=e.parent;for(;n;){const e=y(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function k(e){return''!==e&&0!==e&&(0==e||null==e)}function w(e,t,n){k(n)?delete e[t]:e[t]=`${n}`}function x(e,t,n,s){if(n.visible=s,s){if(!t.contains(e)){const s=v(n);s&&t.contains(s.targetElement)?s.targetElement.after(e):t.appendChild(e)}}else e.remove()}function E(e,t,n){if(null===n)return;const s=Z.get().parent.targetElement;m(t,n,x.bind(null,e,s,Z.get()))}function S(e,t,n){if(k(n)){switch(t){case'value':delete e.value;break;case'checked':e.checked=0;break;case'spellcheck':if(0==n)return void e.setAttribute('spellcheck','false')}e.removeAttribute(t)}else{switch(t){case'value':e.value=`${n}`;break;case'checked':e.checked=`${n}`}e.setAttribute(t,`${n}`)}}function N(e,t,n,s,l,i){const r=e.createSVGTransform();switch(i){case'translate':case'scale':s=(e=>effector.is.store(e)?e:effector.is.store(e.x)?effector.is.store(e.y)?effector.combine({x:e.x,y:e.y}):e.x.map(Me.bind(null,e.y)):effector.is.store(e.y)?e.y.map(ze.bind(null,e.x)):e)(s)}b(0,t,s,l.bind(null,r)),n.appendItem(r)}function C(e,t){const n=oe.createTextNode(`${t}`),s=e.firstChild;s?s.replaceWith(n):e.appendChild(n)}function I(e){e.focus()}function R(e){e.blur()}function _(e,t){return e.bind(null,t)}function O(t,n){const s=Z.get();if(Array.isArray(n)){const l=[];for(let e=0;e<n.length;e++)l[e]=t.map(_($,n[e]));return s&&e(s.signal,l),l}if('object'==typeof n&&null!==n){const l=[],i={};for(const e in n)i[e]=t.map(_($,n[e])),l.push(i[e]);return s&&e(s.signal,l),i}const l=t.map(_($,n));return s&&e(s.signal,l),l}function $(e,t){return t[e]}function A(t,n){let s,i,r=0;effector.is.store(t)?(i=Xe,s=t):(i=_(Ye,t.key),s=t.source,r=!!t.reverse);const o=Z.get(),f=l(),p={parent:o,signal:f,namespace:o.namespace,targetElement:o.targetElement,svgRoot:o.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'list',pure:0,reverse:r,key:effector.is.store(t)?{type:'index'}:{type:'key',key:t.key},store:s,cb:n},mountStatus:'initial',visible:1};a(o,p),Z.replace(p);const u={parentNode:o.targetElement,cb:n,shortName:s.shortName,reverse:r,parentStack:p,getID:i,fields:t.fields?t.fields:null},h=effector.createStore(P(u,[],s.getState()));e(f,[h]),c(f,_(Ue,h)),effector.sample({source:h,clock:s,fn:_(P,u),target:h}),Z.replace(o)}function P(i,r,o){const c=Array(o.length).fill(0),f=o.map(i.getID),p=[],u=[],h=[];for(let e=0;e<r.length;e++){const t=r[e],n=t.node,s=f.indexOf(n.key);-1!==s?(u.push(t),c[s]=1,n.store.getState()!==o[s]&&effector.launch(n.store,o[s],1)):h.push(t)}if(h.length>0){for(let e=0;e<h.length;e++){const l=h[e],{node:i,locality:r}=l;i.active=0,i.store=null,t(r.sibling.left.ref,r.sibling.right.ref),n(l,null),s(l,null)}effector.launch(Ge,h,1)}let d=u.length>0?u[u.length-1]:null;for(let n=0;n<o.length;n++){if(c[n])continue;const s=o[n],r=effector.createStore(s),f=l(),h=i.fields?O(r,i.fields):null;e(f,[r]);const g=i.getID(s,n),m={parent:i.parentStack,signal:f,namespace:i.parentStack.namespace,targetElement:i.parentStack.targetElement,svgRoot:i.parentStack.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'listItem',pure:0,key:g,index:g,store:r,signal:f,active:1,nodes:[],fields:h,visible:[]},mountStatus:'initial',visible:1};t(d,m),d=m,a(i.parentStack,m),p.push(m),u.push(m)}return p.length>0&&effector.launch(We,{context:i,list:p},1),u}function V(e,t,n,s){const l=v(e);l&&s.contains(l.targetElement)?n?l.targetElement.before(t):l.targetElement.after(t):s.appendChild(t)}function D(t){const n=Z.get();return n&&e(n.signal,[t]),t}function j(e){const t=Z.get();if('element'!==t.node.type&&'using'!==t.node.type)throw Error(`"${e}" extension can be used only with element nodes, got "${t.node.type}"`)}function T(e){const t=Z.get();t.targetElement.__STATIC__||e(t.targetElement)}function F(e){e.attr&&M(e.attr),e.data&&z(e.data),e.transform&&L(e.transform),'text'in e&&q(e.text),'visible'in e&&W(e.visible),(e.style||e.styleVar)&&X({prop:e.style,val:e.styleVar}),e.focus&&G(e.focus),e.handler&&Y(e.handler)}function M(e){j('attr'),Z.getElementNode().attr.push(e)}function z(e){j('data'),Z.getElementNode().data.push(e)}function L(e){j('transform'),Z.getElementNode().transform.push(e)}function q(e){j('text'),Z.getElementNode().text.push(e)}function W(e){const t=Z.get();if('element'!==t.node.type&&'using'!==t.node.type&&'listItem'!==t.node.type)throw Error(`"visible" extension can be used only with element or listItem nodes, got "${t.node.type}"`);Z.getElementNode().visible.push(e)}function X({prop:e,val:t}){j('style'),e&&Z.getElementNode().styleProp.push(e),t&&Z.getElementNode().styleVar.push(t)}function Y(e,t){j('handler'),void 0===t&&(t=e,e={});const{passive:n=1,capture:s=0}=e;Z.getElementNode().handler.push({options:{passive:n,capture:s},map:t})}function G({focus:e,blur:t}){j('focus');const n=Z.getElementNode();e&&n.focus.push(e),t&&n.blur.push(t)}Object.defineProperty(exports,'__esModule',{value:1});var effector=require('effector');const U=[];let B;const Z={get:()=>B,replace(e){B=e},getElementNode:()=>B.node},H=e=>e.graphite||e,J=e=>e.family.owners,K=e=>e.family.links,Q=effector.createNode({node:[effector.step.run({fn(e){effector.clearNode(e)}})]}),ee=effector.step.compute({fn(e,l){l.self.next.push(Q);const{stack:i}=l,{parent:r}=i,{left:o,right:a}=i.locality.sibling;r&&(r.locality.child.last.ref===i&&(r.locality.child.last.ref=o.ref),r.locality.child.first.ref===i&&(r.locality.child.first.ref=a.ref)),o.ref&&o.ref.locality.sibling.right.ref===i&&a.ref&&a.ref.locality.sibling.left.ref===i?t(o.ref,a.ref):o.ref&&o.ref.locality.sibling.right.ref===i?n(o.ref,null):a.ref&&a.ref.locality.sibling.left.ref===i&&s(a.ref,null)}}),te=effector.step.compute({fn:(e,{self:t})=>t}),ne=/[^a-zA-Z0-9\-]/g,se=/[\\<>"]/g;class le{constructor(){this.properties=Object.create(null)}setProperty(e,t){this.properties[i(e)]=r(t)}removeProperty(e){delete this.properties[i(e)]}}class ie{constructor(){this.items=[]}appendItem(e){this.items.push(e)}}class re{constructor(){this.value=''}setTranslate(e,t){this.value=`translate(${e} ${t})`}setScale(e,t){this.value=`scale(${e} ${t})`}setRotate(e,t,n){this.value=0!==t||0!==n?`rotate(${e} ${t} ${n})`:`rotate(${e})`}setSkewX(e){this.value=`skewX(${e})`}setSkewY(e){this.value=`skewY(${e})`}}(new class{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new le,this.firstChild=null,this.transform={baseVal:new ie},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}appendChild(e){if(e.parent&&e.remove(),e.isFragment&&null===e.textContent){let t,n=e.firstChild;for(;n;)t=n.sibling.right,this.appendChild(n),n=t}else this.child.last?(this.child.last.sibling.right=e,e.sibling.left=this.child.last):(this.child.first=e,this.firstChild=e),this.child.last=e,e.parent=this}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,e.sibling.right=this.child.first):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}contains(e){let t=e;for(;t;){if(t===this)return 1;t=t.parent}return 0}remove(){if(!this.parent)return;const{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,this.sibling.left.sibling.right=null):(this.sibling.right.sibling.left=this.sibling.left,this.sibling.left.sibling.right=this.sibling.right),this.sibling.left=null,this.sibling.right=null,this.parent=null}addEventListener(e,t,n){}removeEventListener(e,t,n){}setAttribute(e,t){this.attributes[i(e)]=r(t)}removeAttribute(e){delete this.attributes[i(e)]}replaceWith(e){if(!this.parent)return;const{parent:t}=this;e.parent&&e.remove(),t.child.first===this&&t.child.last===this?(t.firstChild=e,t.child.first=e,t.child.last=e):t.child.first===this?(t.child.first=e,t.firstChild=e,this.sibling.right.sibling.left=e):t.child.last===this?(t.child.last=e,this.sibling.left.sibling.right=e):(this.sibling.right.sibling.left=e,this.sibling.left.sibling.right=e),e.sibling.left=this.sibling.left,e.sibling.right=this.sibling.right,e.parent=t,this.sibling.left=null,this.sibling.right=null,this.parent=null}focus(){}blur(){}createSVGTransform(){return new re}}).isBody=1;let oe='undefined'!=typeof document?document:null;const ae=effector.step.compute({fn(e,t){if(!t.stack)return e;const{stack:n}=t;t.stack=null;const s=n.parent.child.indexOf(n);return-1!==s&&n.parent.child.splice(s,1),n.parent=null,e}}),ce=effector.step.run({fn(e,{fn:t}){t(e)}});let fe,pe,ue;fe=()=>{},pe=()=>{},ue='undefined'!=typeof performance&&performance.now?()=>performance.now():'undefined'!=typeof process&&process.hrtime?()=>{const e=process.hrtime();return(1e9*e[0]+e[1])/1e6}:()=>Date.now();const he=effector.createEvent();let de,ge=0,me=0;const be='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),ye='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,ve=()=>{me||(me=1,de=be(f))},ke=new Map,we=new Map,xe=new Map,Ee=new Map;let Se=0,Ne=0;const Ce=effector.createNode({node:[effector.step.run({fn:()=>{}}),effector.step.filter({fn:()=>0===we.size&&0===xe.size?0:ue()-Ne>=10?0:(ye(de),ge=1,me=0,1)})],child:[he]});he.watch(()=>{if(me)return;if(0===we.size&&0===xe.size)return void(ge=0);let e=0;ge||(Ne=ue()),ge=0;for(const[t,n]of we){if(ue()-Ne>=10){ve(),e=1;break}we.delete(t),effector.launch({target:ke.get(t),params:n,defer:1})}if(!e)for(const[t,n]of xe){if(ue()-Ne>=10){ve(),e=1;break}xe.delete(t),effector.launch({target:ke.get(t),params:n,defer:1})}effector.launch({target:Ce,params:null,defer:1})});const Ie=effector.step.compute({fn:({done:e})=>e}),Re=effector.step.compute({fn:({fail:e})=>e}),_e=effector.step.filter({fn:e=>e.length>0}),Oe=effector.step.compute({fn(e,{taskID:t}){p(t,1,e)}}),$e=effector.step.compute({fn(e,{taskID:t,flat:n}){p(t,n,e)}}),Ae=effector.step.run({fn:(e,{fn:t})=>t(e,Ne)}),Pe=effector.step.compute({fn:e=>[e]}),Ve=effector.step.run({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:De}=h({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),je=(e,{map:t,options:n})=>{for(const s in t)e.removeEventListener(s,t[s],n)},Te=(e,t,n)=>{k(n)?delete e[t]:e[t]=n},Fe=(e,t,n)=>{k(n)?e.removeProperty(t):e.setProperty(t,n)},Me=(e,t)=>({x:t,y:e}),ze=(e,t)=>({x:e,y:t}),Le={translate(e,{x:t=0,y:n=0}){e.setTranslate(t,n)},scale(e,{x:t=0,y:n=0}){e.setScale(t,n)},rotate(e,t){'number'==typeof t?e.setRotate(t,0,0):e.setRotate(t.angle||0,t.x||0,t.y||0)},skewX(e,t){e.setSkewX(t)},skewY(e,t){e.setSkewY(t)}},{trigger:qe}=h({mark:'append DOM nodes',fn:e=>{for(let t=0;t<e.append.length;t++){const n=e.append[t];if(0==n.listItem.active)continue;if(0===n.appended.length)continue;const s=oe.createDocumentFragment();if(e.reverse)for(let e=n.appended.length-1;e>=0;e--)s.appendChild(n.appended[e]);else for(let e=0;e<n.appended.length;e++)s.appendChild(n.appended[e]);V(n.listItemStack,s,e.reverse,e.node)}}}),{trigger:We}=h({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:s,cb:l,reverse:i}=e,r=Z.get();Z.replace(n);const o=[],a=[];U.push({node:s,append:a,reverse:i});for(let e=0;e<t.length;e++){const n=t[e],r=n.node;if(r.active){Z.replace(n),effector.withRegion(n.signal,_(l,r));for(let e=0;e<a.length;e++)r.nodes.push(a[e]);r.visible.length>0?effector.withRegion(n.signal,()=>{const e=r.visible[r.visible.length-1];e.updates.watch(e=>{if(0!=r.active)if(e){const e=oe.createDocumentFragment();if(i)for(let t=r.nodes.length-1;t>=0;t--)e.appendChild(r.nodes[t]);else for(let t=0;t<r.nodes.length;t++)e.appendChild(r.nodes[t]);V(n,e,i,s)}else for(let e=0;e<r.nodes.length;e++)r.nodes[e].remove()}),e.getState()&&o.push({listItemStack:n,appended:a.slice(),listItem:r})}):o.push({listItemStack:n,appended:a.slice(),listItem:r}),a.length=0}}U.pop(),o.length>0&&effector.launch({target:qe,params:{node:s,append:o,reverse:i},defer:1}),Z.replace(r)}}),Xe=(e,t)=>t,Ye=(e,t)=>t[e],Ge=effector.createEvent();d({trigger:Ge,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&effector.launch(e,null,0)}}),d({trigger:Ge,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const Ue=e=>{const t=e.getState();for(let e=0;e<t.length;e++){const n=t[e].node;n.active=0,n.store=null}effector.launch(Ge,t,1)};exports.attr=M,exports.combine=({source:e,fn:t})=>(console.error('separate combine method is deprecated, use common combine method as usual'),D(effector.combine(e,t))),exports.data=z,exports.explicitUnmount=e=>{const t=Z.get();t&&effector.createNode({node:[],parent:e,child:t.signal,family:{type:'crosslink',owners:[t.signal,e]}})},exports.focus=G,exports.h=(e,t,n)=>{'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:s=0}=t,i=Z.get(),r=i?i.namespace:'html';let f=r,p='html';'type'in t?(p=t.type,f=t.type):f=p='svg'===r?'svg':'html','svg'===e&&(p='svg',f='svg');const u='svg'===p?oe.createElementNS('http://www.w3.org/2000/svg',e):oe.createElement(e);'foreignObject'===r?(u.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),f='html'):'svg'===e?(u.setAttribute('xmlns','http://www.w3.org/2000/svg'),f='svg'):'foreignObject'===e&&(f='foreignObject');const h=l(),d={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},g={parent:null,signal:h,namespace:f,targetElement:u,svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:d,mountStatus:'initial',visible:1};i&&a(i,g),'svg'===e?g.svgRoot=u:i&&(g.svgRoot=i.svgRoot),Z.replace(g),n?((e,t,n,s)=>{let l=0;U.push({node:t,append:[],reverse:0});try{effector.withRegion(e,s),l=1}finally{o(U.pop()),l||Z.replace(n)}})(h,u,i,n):(d.pure=1,F(t));const y=(()=>{const e=(()=>{const e=Z.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:e.handler,transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.attr.length;n++){const s=e.attr[n];for(const e in s)t.attr[e]=s[e]}for(let n=0;n<e.data.length;n++){const s=e.data[n];for(const e in s)t.data[e]=s[e]}e.visible.length>0&&(t.visible=e.visible[e.visible.length-1]),e.text.length>0&&(t.text=e.text[e.text.length-1]);for(let n=0;n<e.styleVar.length;n++){const s=e.styleVar[n];for(const e in s)t.styleVar[e]=s[e]}for(let n=0;n<e.styleProp.length;n++){const s=e.styleProp[n];for(const e in s)t.styleProp[e]=s[e]}return t})(),t=Z.get(),n=t.targetElement,s=t.signal;return((e,t,n)=>{for(const s in n)b('value'!==s&&'checked'!==s&&'min'!==s&&'max'!==s,t,n[s],S.bind(null,e,s))})(n,s,e.attr),((e,t,n)=>{for(const s in n)b(0,t,n[s],w.bind(null,e.dataset,s))})(n,s,e.data),((e,t,n)=>{for(let s=0;s<n.length;s++){const{options:l,map:i}=n[s];for(const t in i)e.addEventListener(t,i[t],l);c(t,je.bind(null,e,n[s]))}})(n,s,e.handler),((e,t,n)=>{const s=e.style;for(const e in n)b(0,t,n[e],Te.bind(null,s,e))})(n,s,e.styleProp),((e,t,n)=>{const s=e.style;for(const e in n)b(0,t,n[e],Fe.bind(null,s,`--${e}`))})(n,s,e.styleVar),((e,t,n)=>{const s=Z.get();if('svg'!==s.namespace)return;if(0===n.length)return;const l=e.transform.baseVal,i=s.svgRoot;for(let e=0;e<n.length;e++){const s=n[e];for(const e in s)N(i,t,l,s[e],Le[e],e)}})(n,s,e.transform),((e,t,n)=>{null!==n&&(effector.is.unit(n)?m(t,n,C.bind(null,e)):C(e,n))})(n,s,e.text),E(n,s,e.visible),((e,t,n)=>{for(let s=0;s<n.length;s++)b(1,t,n[s],I.bind(null,e))})(n,s,e.focus),((e,t,n)=>{for(let s=0;s<n.length;s++)b(1,t,n[s],R.bind(null,e))})(n,s,e.blur),e})();Z.replace(i),g.visible=!y.visible||y.visible.getState(),s||U.length>0&&g.visible&&U[U.length-1].append.push(u)},exports.handler=Y,exports.list=A,exports.map=(e,{fn:t})=>(console.error('separate map method is deprecated, use store.map as usual'),D(e.map(t))),exports.node=T,exports.nodeMethod=e=>{let t;return T(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}},exports.remap=O,exports.signalOwn=D,exports.spec=F,exports.storeField=(t,n)=>{const s=t.map(_($,n)),l=Z.get();return l&&e(l.signal,[s]),s},exports.style=X,exports.text=q,exports.transform=L,exports.tree=function e({key:t,child:n,source:s},l){A({source:s,key:t},({store:s,key:i,signal:r})=>{const o=O(s,n);l({store:s,key:i,signal:r},()=>{e({key:t,child:n,source:o},l)})})},exports.using=(e,t)=>{const n=e.namespaceURI,s=e.tagName.toLowerCase(),i='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===s?'foreignObject':'html',r=Z.get(),a={parent:r,signal:r&&r.signal?r.signal:l(),namespace:i,targetElement:e,svgRoot:'svg'===s?e:r?r.svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'using',pure:0,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},mountStatus:'initial',visible:1};Z.replace(a),U.push({node:e,append:[],reverse:0});try{effector.withRegion(a.signal,t)}finally{o(U.pop()),Z.replace(r)}},exports.variant=(e,t)=>{A({source:effector.createStore(Object.entries(t).map(([e,t])=>({key:e,val:t}))),key:'key',fields:['key','val']},({fields:[t,n]})=>{F({visible:effector.combine(t,e,(e,t)=>e===t)}),n.getState()()})},exports.visible=W;
//# sourceMappingURL=effector-dom.cjs.js.map

@@ -101,3 +101,6 @@ import {Store, Event, Step} from 'effector'

): void
export function variant<Case extends string>(
key: Store<Case>,
cases: Partial<{[K in Case]: () => void}>,
): void
export function list<T>(

@@ -104,0 +107,0 @@ source: Store<T[]>,

@@ -1,2 +0,2 @@

function e(e,t){const n=pe(e);for(let e=0;e<t.length;e++){const l=pe(t[e]);l.family.type='crosslink';const i=de(l),s=ge(n);i.includes(n)||i.push(n),s.includes(l)||s.push(l)}}function t(e,t){n(e,t),l(t,e)}function n(e,t){e&&e!==t&&(e.locality.sibling.right.ref=t)}function l(e,t){e&&e!==t&&(e.locality.sibling.left.ref=t)}function i(){const e={stack:null},t=he.get(),n=ee({node:[be,ye],parent:[t&&t.signal].filter(Boolean),meta:{unit:'signal'},scope:e});return e.self=n,n}function s(e){switch(e=String(e)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return e.replace(ve,'')}}function r(e){return String(e).replace(ke,'')}function o(e,t){const n=e.namespaceURI,l=e.tagName.toLowerCase(),s='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===l?'foreignObject':'html',r=he.get(),o={parent:r,signal:r&&r.signal?r.signal:i(),namespace:s,targetElement:e,svgRoot:'svg'===l?e:r?r.svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'using',pure:0,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},mountStatus:'initial',visible:1};he.replace(o),fe.push({node:e,append:[],reverse:0});try{le(o.signal,t)}finally{a(fe.pop()),he.replace(r)}}function a({node:e,append:t,reverse:n=0}){if(0===t.length)return;const l=Se.createDocumentFragment();if(n){for(let e=t.length-1;e>=0;e--)l.appendChild(t[e]);e.prepend(l)}else{for(let e=0;e<t.length;e++)l.appendChild(t[e]);e.appendChild(l)}}function c(e,t){t.parent=e,t.signal.seq.push(Ce),t.signal.scope.stack=t,e.child.push(t)}function f(e,t){return ee({node:[Ne],parent:e,meta:{op:'watch'},scope:{fn:t},family:{type:'crosslink',owners:[e]}})}function u(){Ve=0,Re()}function h(e,t,n){const l=(e=>'high'===ze.get(e)?Fe:Me)(e);let i=l.get(e);if(i||(i=[],l.set(e,i)),t)for(let e=0;e<n.length;e++)i.push(n[e]);else i.push(n);Te()}function p(t,n,l=0,i="low"){const s=++Le,r=ie(),o=re.store(a=t)?a.updates:a;var a;const c={type:'crosslink',owners:[o,r]};return ee({node:[Ue],parent:[o],scope:{taskID:s,flat:l},family:c}),e(t,[r]),je.set(s,ee({node:[Ze],child:[ee({node:[qe,Ge,Be],scope:{taskID:s},family:c}),ee({node:[Ye,Ge],child:[r],family:c})],scope:{fn:n},family:c})),ze.set(s,i),r}function d({trigger:e=ie(),fn:t,priority:n="low",timeout:l=1/0,batchWindow:i=0,retries:s=1/0,mark:r=e.shortName}){const o=p(e.map(e=>[{inserted:Ae(),retry:0,value:e}]),(e,n)=>{let r,o=0;const a=[],c=[];for(r=0;r<e.length;r++){const s=e[r],f=Ae();if(s.inserted+i>f){c.push(s);continue}if(s.inserted+l<f)continue;if(f-n>=10){o=1;break}const u=t(s.value);void 0!==u&&a.push(u)}if(o)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=s||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:o,connect:t=>{ee({node:[],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function g({trigger:e=ie(),fn:t,priority:n="low",timeout:l=1/0,batchWindow:i=0,retries:s=1/0,mark:r=e.shortName,flatten:o}){const a=p(e.map(e=>{const t=[],n=Ae();for(let l=0;l<e.length;l++){const i=o(e[l]);for(let e=0;e<i.length;e++)t.push({inserted:n,retry:0,value:i[e]})}return t}),(e,n)=>{let r,o=0;const a=[],c=[];for(r=0;r<e.length;r++){const s=e[r],f=Ae();if(s.inserted+i>f){c.push(s);continue}if(s.inserted+l<f)continue;if(f-n>=10){o=1;break}const u=t(s.value);void 0!==u&&a.push(u)}if(o)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=s||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:a,connect:t=>{ee({node:[He],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function m(e,t,n){f(e,t.watch(n))}function b(e,t,n){ee({node:[Je],parent:t,child:[Ke],family:{type:'crosslink',owners:e},scope:{handler:n},meta:{op:'debounceRaf'}}),re.store(t)&&se(Ke,{data:t.getState(),handler:n},1)}function y(e,t,n,l){re.unit(n)?(e?m:b)(t,n,l):l(n)}function v(e,t=e.child.length-1){for(let n=t;n>=0;n--){const t=e.child[n];switch(t.node.type){case'element':case'using':if(!t.visible)continue;return t}const l=v(t);if(l)return l}return null}function k(e){if(!e.parent)return null;switch(e.parent.node.type){case'element':case'using':{const t=v(e.parent,e.parent.child.indexOf(e)-1);if(t)return t;break}case'list':case'listItem':{let t=e,n=e.parent;for(;n;){const e=v(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function w(e){return''!==e&&0!==e&&(0==e||null==e)}function x(e,t,n){w(n)?delete e[t]:e[t]=`${n}`}function E(e,t,n,l){if(n.visible=l,l){if(!t.contains(e)){const l=k(n);l&&t.contains(l.targetElement)?l.targetElement.after(e):t.appendChild(e)}}else e.remove()}function S(e,t,n){if(null===n)return;const l=he.get().parent.targetElement;b(t,n,E.bind(null,e,l,he.get()))}function C(e,t,n){if(w(n)){switch(t){case'value':delete e.value;break;case'checked':e.checked=0;break;case'spellcheck':if(0==n)return void e.setAttribute('spellcheck','false')}e.removeAttribute(t)}else{switch(t){case'value':e.value=`${n}`;break;case'checked':e.checked=`${n}`}e.setAttribute(t,`${n}`)}}function N(e,t,n,l,i,s){const r=e.createSVGTransform();switch(s){case'translate':case'scale':l=(e=>re.store(e)?e:re.store(e.x)?re.store(e.y)?oe({x:e.x,y:e.y}):e.x.map(nt.bind(null,e.y)):re.store(e.y)?e.y.map(lt.bind(null,e.x)):e)(l)}y(0,t,l,i.bind(null,r)),n.appendItem(r)}function _(e,t){const n=Se.createTextNode(`${t}`),l=e.firstChild;l?l.replaceWith(n):e.appendChild(n)}function I(e){e.focus()}function A(e){e.blur()}function R(e,t,n){'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:l=0}=t,s=he.get(),r=s?s.namespace:'html';let o=r,u='html';'type'in t?(u=t.type,o=t.type):o=u='svg'===r?'svg':'html','svg'===e&&(u='svg',o='svg');const h='svg'===u?Se.createElementNS('http://www.w3.org/2000/svg',e):Se.createElement(e);'foreignObject'===r?(h.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),o='html'):'svg'===e?(h.setAttribute('xmlns','http://www.w3.org/2000/svg'),o='svg'):'foreignObject'===e&&(o='foreignObject');const p=i(),d={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},g={parent:null,signal:p,namespace:o,targetElement:h,svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:d,mountStatus:'initial',visible:1};s&&c(s,g),'svg'===e?g.svgRoot=h:s&&(g.svgRoot=s.svgRoot),he.replace(g),n?((e,t,n,l)=>{let i=0;fe.push({node:t,append:[],reverse:0});try{le(e,l),i=1}finally{a(fe.pop()),i||he.replace(n)}})(p,h,s,n):(d.pure=1,X(t));const m=(()=>{const e=(()=>{const e=he.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:e.handler,transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.attr.length;n++){const l=e.attr[n];for(const e in l)t.attr[e]=l[e]}for(let n=0;n<e.data.length;n++){const l=e.data[n];for(const e in l)t.data[e]=l[e]}e.visible.length>0&&(t.visible=e.visible[e.visible.length-1]),e.text.length>0&&(t.text=e.text[e.text.length-1]);for(let n=0;n<e.styleVar.length;n++){const l=e.styleVar[n];for(const e in l)t.styleVar[e]=l[e]}for(let n=0;n<e.styleProp.length;n++){const l=e.styleProp[n];for(const e in l)t.styleProp[e]=l[e]}return t})(),t=he.get(),n=t.targetElement,l=t.signal;return((e,t,n)=>{for(const l in n)y('value'!==l&&'checked'!==l&&'min'!==l&&'max'!==l,t,n[l],C.bind(null,e,l))})(n,l,e.attr),((e,t,n)=>{for(const l in n)y(0,t,n[l],x.bind(null,e.dataset,l))})(n,l,e.data),((e,t,n)=>{for(let l=0;l<n.length;l++){const{options:i,map:s}=n[l];for(const t in s)e.addEventListener(t,s[t],i);f(t,Qe.bind(null,e,n[l]))}})(n,l,e.handler),((e,t,n)=>{const l=e.style;for(const e in n)y(0,t,n[e],et.bind(null,l,e))})(n,l,e.styleProp),((e,t,n)=>{const l=e.style;for(const e in n)y(0,t,n[e],tt.bind(null,l,`--${e}`))})(n,l,e.styleVar),((e,t,n)=>{const l=he.get();if('svg'!==l.namespace)return;if(0===n.length)return;const i=e.transform.baseVal,s=l.svgRoot;for(let e=0;e<n.length;e++){const l=n[e];for(const e in l)N(s,t,i,l[e],st[e],e)}})(n,l,e.transform),((e,t,n)=>{null!==n&&(re.unit(n)?b(t,n,_.bind(null,e)):_(e,n))})(n,l,e.text),S(n,l,e.visible),((e,t,n)=>{for(let l=0;l<n.length;l++)y(1,t,n[l],I.bind(null,e))})(n,l,e.focus),((e,t,n)=>{for(let l=0;l<n.length;l++)y(1,t,n[l],A.bind(null,e))})(n,l,e.blur),e})();he.replace(s),g.visible=!m.visible||m.visible.getState(),l||fe.length>0&&g.visible&&fe[fe.length-1].append.push(h)}function O(e,t){return e.bind(null,t)}function $(t,n){const l=he.get();if(Array.isArray(n)){const i=[];for(let e=0;e<n.length;e++)i[e]=t.map(O(P,n[e]));return l&&e(l.signal,i),i}if('object'==typeof n&&null!==n){const i=[],s={};for(const e in n)s[e]=t.map(O(P,n[e])),i.push(s[e]);return l&&e(l.signal,i),s}const i=t.map(O(P,n));return l&&e(l.signal,i),i}function V(t,n){const l=t.map(O(P,n)),i=he.get();return i&&e(i.signal,[l]),l}function P(e,t){return t[e]}function D({key:e,child:t,source:n},l){T({source:n,key:e},({store:n,key:i,signal:s})=>{const r=$(n,t);l({store:n,key:i,signal:s},()=>{D({key:e,child:t,source:r},l)})})}function T(t,n){let l,s,r=0;re.store(t)?(s=at,l=t):(s=O(ct,t.key),l=t.source,r=!!t.reverse);const o=he.get(),a=i(),u={parent:o,signal:a,namespace:o.namespace,targetElement:o.targetElement,svgRoot:o.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'list',pure:0,reverse:r,key:re.store(t)?{type:'index'}:{type:'key',key:t.key},store:l,cb:n},mountStatus:'initial',visible:1};c(o,u),he.replace(u);const h={parentNode:o.targetElement,cb:n,shortName:l.shortName,reverse:r,parentStack:u,getID:s,fields:t.fields?t.fields:null},p=ae(j(h,[],l.getState()));e(a,[p]),f(a,O(ut,p)),ce({source:p,clock:l,fn:O(j,h),target:p}),he.replace(o)}function j(s,r,o){const a=Array(o.length).fill(0),f=o.map(s.getID),u=[],h=[],p=[];for(let e=0;e<r.length;e++){const t=r[e],n=t.node,l=f.indexOf(n.key);-1!==l?(h.push(t),a[l]=1,n.store.getState()!==o[l]&&se(n.store,o[l],1)):p.push(t)}if(p.length>0){for(let e=0;e<p.length;e++){const i=p[e],{node:s,locality:r}=i;s.active=0,s.store=null,t(r.sibling.left.ref,r.sibling.right.ref),n(i,null),l(i,null)}se(ft,p,1)}let d=h.length>0?h[h.length-1]:null;for(let n=0;n<o.length;n++){if(a[n])continue;const l=o[n],r=ae(l),f=i(),p=s.fields?$(r,s.fields):null;e(f,[r]);const g=s.getID(l,n),m={parent:s.parentStack,signal:f,namespace:s.parentStack.namespace,targetElement:s.parentStack.targetElement,svgRoot:s.parentStack.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'listItem',pure:0,key:g,index:g,store:r,signal:f,active:1,nodes:[],fields:p},mountStatus:'initial',visible:1};t(d,m),d=m,c(s.parentStack,m),u.push(m),h.push(m)}return u.length>0&&se(ot,{context:s,list:u},1),h}function F(e){const t=he.get();t&&ee({node:[],parent:e,child:t.signal,family:{type:'crosslink',owners:[t.signal,e]}})}function M(t){const n=he.get();return n&&e(n.signal,[t]),t}function z(){const e=he.get();if('element'!==e.node.type&&'using'!==e.node.type)throw Error(`this extension can be used only with element nodes, got "${e.node.type}"`)}function L(e){let t;return W(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}}function W(e){const t=he.get();t.targetElement.__STATIC__||e(t.targetElement)}function X(e){e.attr&&Y(e.attr),e.data&&q(e.data),e.transform&&G(e.transform),'text'in e&&B(e.text),'visible'in e&&U(e.visible),(e.style||e.styleVar)&&Z({prop:e.style,val:e.styleVar}),e.focus&&J(e.focus),e.handler&&H(e.handler)}function Y(e){z(),he.getElementNode().attr.push(e)}function q(e){z(),he.getElementNode().data.push(e)}function G(e){z(),he.getElementNode().transform.push(e)}function B(e){z(),he.getElementNode().text.push(e)}function U(e){z(),he.getElementNode().visible.push(e)}function Z({prop:e,val:t}){z(),e&&he.getElementNode().styleProp.push(e),t&&he.getElementNode().styleVar.push(t)}function H(e,t){z(),void 0===t&&(t=e,e={});const{passive:n=1,capture:l=0}=e;he.getElementNode().handler.push({options:{passive:n,capture:l},map:t})}function J({focus:e,blur:t}){z();const n=he.getElementNode();e&&n.focus.push(e),t&&n.blur.push(t)}function K(e,{fn:t}){return console.error('separate map method is deprecated, use store.map as usual'),M(e.map(t))}function Q({source:e,fn:t}){return console.error('separate combine method is deprecated, use common combine method as usual'),M(oe(e,t))}import{createNode as ee,step as te,clearNode as ne,withRegion as le,createEvent as ie,launch as se,is as re,combine as oe,createStore as ae,sample as ce}from'effector';const fe=[];let ue;const he={get:()=>ue,replace(e){ue=e},getElementNode:()=>ue.node},pe=e=>e.graphite||e,de=e=>e.family.owners,ge=e=>e.family.links,me=ee({node:[te.run({fn(e){ne(e)}})]}),be=te.compute({fn(e,i){i.self.next.push(me);const{stack:s}=i,{parent:r}=s,{left:o,right:a}=s.locality.sibling;r&&(r.locality.child.last.ref===s&&(r.locality.child.last.ref=o.ref),r.locality.child.first.ref===s&&(r.locality.child.first.ref=a.ref)),o.ref&&o.ref.locality.sibling.right.ref===s&&a.ref&&a.ref.locality.sibling.left.ref===s?t(o.ref,a.ref):o.ref&&o.ref.locality.sibling.right.ref===s?n(o.ref,null):a.ref&&a.ref.locality.sibling.left.ref===s&&l(a.ref,null)}}),ye=te.compute({fn:(e,{self:t})=>t}),ve=/[^a-zA-Z0-9\-]/g,ke=/[\\<>"]/g;class we{constructor(){this.properties=Object.create(null)}setProperty(e,t){this.properties[s(e)]=r(t)}removeProperty(e){delete this.properties[s(e)]}}class xe{constructor(){this.items=[]}appendItem(e){this.items.push(e)}}class Ee{constructor(){this.value=''}setTranslate(e,t){this.value=`translate(${e} ${t})`}setScale(e,t){this.value=`scale(${e} ${t})`}setRotate(e,t,n){this.value=0!==t||0!==n?`rotate(${e} ${t} ${n})`:`rotate(${e})`}setSkewX(e){this.value=`skewX(${e})`}setSkewY(e){this.value=`skewY(${e})`}}(new class{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new we,this.firstChild=null,this.transform={baseVal:new xe},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}appendChild(e){if(e.parent&&e.remove(),e.isFragment&&null===e.textContent){let t,n=e.firstChild;for(;n;)t=n.sibling.right,this.appendChild(n),n=t}else this.child.last?(this.child.last.sibling.right=e,e.sibling.left=this.child.last):(this.child.first=e,this.firstChild=e),this.child.last=e,e.parent=this}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,e.sibling.right=this.child.first):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}contains(e){let t=e;for(;t;){if(t===this)return 1;t=t.parent}return 0}remove(){if(!this.parent)return;const{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,this.sibling.left.sibling.right=null):(this.sibling.right.sibling.left=this.sibling.left,this.sibling.left.sibling.right=this.sibling.right),this.sibling.left=null,this.sibling.right=null,this.parent=null}addEventListener(e,t,n){}removeEventListener(e,t,n){}setAttribute(e,t){this.attributes[s(e)]=r(t)}removeAttribute(e){delete this.attributes[s(e)]}replaceWith(e){if(!this.parent)return;const{parent:t}=this;e.parent&&e.remove(),t.child.first===this&&t.child.last===this?(t.firstChild=e,t.child.first=e,t.child.last=e):t.child.first===this?(t.child.first=e,t.firstChild=e,this.sibling.right.sibling.left=e):t.child.last===this?(t.child.last=e,this.sibling.left.sibling.right=e):(this.sibling.right.sibling.left=e,this.sibling.left.sibling.right=e),e.sibling.left=this.sibling.left,e.sibling.right=this.sibling.right,e.parent=t,this.sibling.left=null,this.sibling.right=null,this.parent=null}focus(){}blur(){}createSVGTransform(){return new Ee}}).isBody=1;let Se='undefined'!=typeof document?document:null;const Ce=te.compute({fn(e,t){if(!t.stack)return e;const{stack:n}=t;t.stack=null;const l=n.parent.child.indexOf(n);return-1!==l&&n.parent.child.splice(l,1),n.parent=null,e}}),Ne=te.run({fn(e,{fn:t}){t(e)}});let _e,Ie,Ae;_e=()=>{},Ie=()=>{},Ae='undefined'!=typeof performance&&performance.now?()=>performance.now():'undefined'!=typeof process&&process.hrtime?()=>{const e=process.hrtime();return(1e9*e[0]+e[1])/1e6}:()=>Date.now();const Re=ie();let Oe,$e=0,Ve=0;const Pe='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),De='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,Te=()=>{Ve||(Ve=1,Oe=Pe(u))},je=new Map,Fe=new Map,Me=new Map,ze=new Map;let Le=0,We=0;const Xe=ee({node:[te.run({fn:()=>{}}),te.filter({fn:()=>0===Fe.size&&0===Me.size?0:Ae()-We>=10?0:(De(Oe),$e=1,Ve=0,1)})],child:[Re]});Re.watch(()=>{if(Ve)return;if(0===Fe.size&&0===Me.size)return void($e=0);let e=0;$e||(We=Ae()),$e=0;for(const[t,n]of Fe){if(Ae()-We>=10){Te(),e=1;break}Fe.delete(t),se({target:je.get(t),params:n,defer:1})}if(!e)for(const[t,n]of Me){if(Ae()-We>=10){Te(),e=1;break}Me.delete(t),se({target:je.get(t),params:n,defer:1})}se({target:Xe,params:null,defer:1})});const Ye=te.compute({fn:({done:e})=>e}),qe=te.compute({fn:({fail:e})=>e}),Ge=te.filter({fn:e=>e.length>0}),Be=te.compute({fn(e,{taskID:t}){h(t,1,e)}}),Ue=te.compute({fn(e,{taskID:t,flat:n}){h(t,n,e)}}),Ze=te.run({fn:(e,{fn:t})=>t(e,We)}),He=te.compute({fn:e=>[e]}),Je=te.run({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:Ke}=d({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),Qe=(e,{map:t,options:n})=>{for(const l in t)e.removeEventListener(l,t[l],n)},et=(e,t,n)=>{w(n)?delete e[t]:e[t]=n},tt=(e,t,n)=>{w(n)?e.removeProperty(t):e.setProperty(t,n)},nt=(e,t)=>({x:t,y:e}),lt=(e,t)=>({x:e,y:t}),st={translate(e,{x:t=0,y:n=0}){e.setTranslate(t,n)},scale(e,{x:t=0,y:n=0}){e.setScale(t,n)},rotate(e,t){'number'==typeof t?e.setRotate(t,0,0):e.setRotate(t.angle||0,t.x||0,t.y||0)},skewX(e,t){e.setSkewX(t)},skewY(e,t){e.setSkewY(t)}},{trigger:rt}=d({mark:'append DOM nodes',fn:e=>{for(let t=0;t<e.append.length;t++){const n=e.append[t];if(0==n.listItem.active)continue;if(0===n.appended.length)continue;const l=Se.createDocumentFragment();if(e.reverse)for(let e=n.appended.length-1;e>=0;e--)l.appendChild(n.appended[e]);else for(let e=0;e<n.appended.length;e++)l.appendChild(n.appended[e]);const i=k(n.listItemStack);i&&e.node.contains(i.targetElement)?e.reverse?i.targetElement.before(l):i.targetElement.after(l):e.node.appendChild(l)}}}),{trigger:ot}=d({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:l,cb:i,reverse:s}=e,r=he.get();he.replace(n);const o=[],a=[];fe.push({node:l,append:a,reverse:s});for(let e=0;e<t.length;e++){const n=t[e],l=n.node;if(l.active){he.replace(n),le(n.signal,O(i,l));for(let e=0;e<a.length;e++)l.nodes.push(a[e]);o.push({listItemStack:n,appended:a.slice(),listItem:l}),a.length=0}}fe.pop(),o.length>0&&se({target:rt,params:{node:l,append:o,reverse:s},defer:1}),he.replace(r)}}),at=(e,t)=>t,ct=(e,t)=>t[e],ft=ie();g({trigger:ft,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&se(e,null,0)}}),g({trigger:ft,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const ut=e=>{const t=e.getState();for(let e=0;e<t.length;e++){const n=t[e].node;n.active=0,n.store=null}se(ft,t,1)};export{Y as attr,Q as combine,q as data,F as explicitUnmount,J as focus,R as h,H as handler,T as list,K as map,W as node,L as nodeMethod,$ as remap,M as signalOwn,X as spec,V as storeField,Z as style,B as text,G as transform,D as tree,o as using,U as visible};
function e(e,t){const n=ge(e);for(let e=0;e<t.length;e++){const l=ge(t[e]);l.family.type='crosslink';const i=me(l),s=be(n);i.includes(n)||i.push(n),s.includes(l)||s.push(l)}}function t(e,t){n(e,t),l(t,e)}function n(e,t){e&&e!==t&&(e.locality.sibling.right.ref=t)}function l(e,t){e&&e!==t&&(e.locality.sibling.left.ref=t)}function i(){const e={stack:null},t=de.get(),n=ne({node:[ve,ke],parent:[t&&t.signal].filter(Boolean),meta:{unit:'signal'},scope:e});return e.self=n,n}function s(e){switch(e=String(e)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return e.replace(we,'')}}function r(e){return String(e).replace(xe,'')}function o(e,t){const n=e.namespaceURI,l=e.tagName.toLowerCase(),s='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===l?'foreignObject':'html',r=de.get(),o={parent:r,signal:r&&r.signal?r.signal:i(),namespace:s,targetElement:e,svgRoot:'svg'===l?e:r?r.svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'using',pure:0,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},mountStatus:'initial',visible:1};de.replace(o),he.push({node:e,append:[],reverse:0});try{se(o.signal,t)}finally{a(he.pop()),de.replace(r)}}function a({node:e,append:t,reverse:n=0}){if(0===t.length)return;const l=Ie.createDocumentFragment();if(n){for(let e=t.length-1;e>=0;e--)l.appendChild(t[e]);e.prepend(l)}else{for(let e=0;e<t.length;e++)l.appendChild(t[e]);e.appendChild(l)}}function c(e,t){t.parent=e,t.signal.seq.push(Ne),t.signal.scope.stack=t,e.child.push(t)}function f(e,t){return ne({node:[_e],parent:e,meta:{op:'watch'},scope:{fn:t},family:{type:'crosslink',owners:[e]}})}function u(){Pe=0,Re()}function h(e,t,n){const l=(e=>'high'===We.get(e)?ze:Le)(e);let i=l.get(e);if(i||(i=[],l.set(e,i)),t)for(let e=0;e<n.length;e++)i.push(n[e]);else i.push(n);Fe()}function p(t,n,l=0,i="low"){const s=++Xe,r=re(),o=ae.store(a=t)?a.updates:a;var a;const c={type:'crosslink',owners:[o,r]};return ne({node:[He],parent:[o],scope:{taskID:s,flat:l},family:c}),e(t,[r]),Me.set(s,ne({node:[Je],child:[ne({node:[Be,Ue,Ze],scope:{taskID:s},family:c}),ne({node:[Ge,Ue],child:[r],family:c})],scope:{fn:n},family:c})),We.set(s,i),r}function d({trigger:e=re(),fn:t,priority:n="low",timeout:l=1/0,batchWindow:i=0,retries:s=1/0,mark:r=e.shortName}){const o=p(e.map(e=>[{inserted:Oe(),retry:0,value:e}]),(e,n)=>{let r,o=0;const a=[],c=[];for(r=0;r<e.length;r++){const s=e[r],f=Oe();if(s.inserted+i>f){c.push(s);continue}if(s.inserted+l<f)continue;if(f-n>=10){o=1;break}const u=t(s.value);void 0!==u&&a.push(u)}if(o)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=s||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:o,connect:t=>{ne({node:[],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function g({trigger:e=re(),fn:t,priority:n="low",timeout:l=1/0,batchWindow:i=0,retries:s=1/0,mark:r=e.shortName,flatten:o}){const a=p(e.map(e=>{const t=[],n=Oe();for(let l=0;l<e.length;l++){const i=o(e[l]);for(let e=0;e<i.length;e++)t.push({inserted:n,retry:0,value:i[e]})}return t}),(e,n)=>{let r,o=0;const a=[],c=[];for(r=0;r<e.length;r++){const s=e[r],f=Oe();if(s.inserted+i>f){c.push(s);continue}if(s.inserted+l<f)continue;if(f-n>=10){o=1;break}const u=t(s.value);void 0!==u&&a.push(u)}if(o)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=s||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:a,connect:t=>{ne({node:[Ke],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function m(e,t,n){f(e,t.watch(n))}function b(e,t,n){ne({node:[Qe],parent:t,child:[et],family:{type:'crosslink',owners:e},scope:{handler:n},meta:{op:'debounceRaf'}}),ae.store(t)&&oe(et,{data:t.getState(),handler:n},1)}function y(e,t,n,l){ae.unit(n)?(e?m:b)(t,n,l):l(n)}function v(e,t=e.child.length-1){for(let n=t;n>=0;n--){const t=e.child[n];switch(t.node.type){case'element':case'using':if(!t.visible)continue;return t}const l=v(t);if(l)return l}return null}function k(e){if(!e.parent)return null;switch(e.parent.node.type){case'element':case'using':{const t=v(e.parent,e.parent.child.indexOf(e)-1);if(t)return t;break}case'list':case'listItem':{let t=e,n=e.parent;for(;n;){const e=v(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function w(e){return''!==e&&0!==e&&(0==e||null==e)}function x(e,t,n){w(n)?delete e[t]:e[t]=`${n}`}function S(e,t,n,l){if(n.visible=l,l){if(!t.contains(e)){const l=k(n);l&&t.contains(l.targetElement)?l.targetElement.after(e):t.appendChild(e)}}else e.remove()}function E(e,t,n){if(null===n)return;const l=de.get().parent.targetElement;b(t,n,S.bind(null,e,l,de.get()))}function C(e,t,n){if(w(n)){switch(t){case'value':delete e.value;break;case'checked':e.checked=0;break;case'spellcheck':if(0==n)return void e.setAttribute('spellcheck','false')}e.removeAttribute(t)}else{switch(t){case'value':e.value=`${n}`;break;case'checked':e.checked=`${n}`}e.setAttribute(t,`${n}`)}}function I(e,t,n,l,i,s){const r=e.createSVGTransform();switch(s){case'translate':case'scale':l=(e=>ae.store(e)?e:ae.store(e.x)?ae.store(e.y)?ce({x:e.x,y:e.y}):e.x.map(st.bind(null,e.y)):ae.store(e.y)?e.y.map(rt.bind(null,e.x)):e)(l)}y(0,t,l,i.bind(null,r)),n.appendItem(r)}function N(e,t){const n=Ie.createTextNode(`${t}`),l=e.firstChild;l?l.replaceWith(n):e.appendChild(n)}function _(e){e.focus()}function $(e){e.blur()}function A(e,t,n){'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:l=0}=t,s=de.get(),r=s?s.namespace:'html';let o=r,u='html';'type'in t?(u=t.type,o=t.type):o=u='svg'===r?'svg':'html','svg'===e&&(u='svg',o='svg');const h='svg'===u?Ie.createElementNS('http://www.w3.org/2000/svg',e):Ie.createElement(e);'foreignObject'===r?(h.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),o='html'):'svg'===e?(h.setAttribute('xmlns','http://www.w3.org/2000/svg'),o='svg'):'foreignObject'===e&&(o='foreignObject');const p=i(),d={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},g={parent:null,signal:p,namespace:o,targetElement:h,svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:d,mountStatus:'initial',visible:1};s&&c(s,g),'svg'===e?g.svgRoot=h:s&&(g.svgRoot=s.svgRoot),de.replace(g),n?((e,t,n,l)=>{let i=0;he.push({node:t,append:[],reverse:0});try{se(e,l),i=1}finally{a(he.pop()),i||de.replace(n)}})(p,h,s,n):(d.pure=1,Y(t));const m=(()=>{const e=(()=>{const e=de.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:e.handler,transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.attr.length;n++){const l=e.attr[n];for(const e in l)t.attr[e]=l[e]}for(let n=0;n<e.data.length;n++){const l=e.data[n];for(const e in l)t.data[e]=l[e]}e.visible.length>0&&(t.visible=e.visible[e.visible.length-1]),e.text.length>0&&(t.text=e.text[e.text.length-1]);for(let n=0;n<e.styleVar.length;n++){const l=e.styleVar[n];for(const e in l)t.styleVar[e]=l[e]}for(let n=0;n<e.styleProp.length;n++){const l=e.styleProp[n];for(const e in l)t.styleProp[e]=l[e]}return t})(),t=de.get(),n=t.targetElement,l=t.signal;return((e,t,n)=>{for(const l in n)y('value'!==l&&'checked'!==l&&'min'!==l&&'max'!==l,t,n[l],C.bind(null,e,l))})(n,l,e.attr),((e,t,n)=>{for(const l in n)y(0,t,n[l],x.bind(null,e.dataset,l))})(n,l,e.data),((e,t,n)=>{for(let l=0;l<n.length;l++){const{options:i,map:s}=n[l];for(const t in s)e.addEventListener(t,s[t],i);f(t,tt.bind(null,e,n[l]))}})(n,l,e.handler),((e,t,n)=>{const l=e.style;for(const e in n)y(0,t,n[e],nt.bind(null,l,e))})(n,l,e.styleProp),((e,t,n)=>{const l=e.style;for(const e in n)y(0,t,n[e],lt.bind(null,l,`--${e}`))})(n,l,e.styleVar),((e,t,n)=>{const l=de.get();if('svg'!==l.namespace)return;if(0===n.length)return;const i=e.transform.baseVal,s=l.svgRoot;for(let e=0;e<n.length;e++){const l=n[e];for(const e in l)I(s,t,i,l[e],ot[e],e)}})(n,l,e.transform),((e,t,n)=>{null!==n&&(ae.unit(n)?b(t,n,N.bind(null,e)):N(e,n))})(n,l,e.text),E(n,l,e.visible),((e,t,n)=>{for(let l=0;l<n.length;l++)y(1,t,n[l],_.bind(null,e))})(n,l,e.focus),((e,t,n)=>{for(let l=0;l<n.length;l++)y(1,t,n[l],$.bind(null,e))})(n,l,e.blur),e})();de.replace(s),g.visible=!m.visible||m.visible.getState(),l||he.length>0&&g.visible&&he[he.length-1].append.push(h)}function O(e,t){return e.bind(null,t)}function R(t,n){const l=de.get();if(Array.isArray(n)){const i=[];for(let e=0;e<n.length;e++)i[e]=t.map(O(D,n[e]));return l&&e(l.signal,i),i}if('object'==typeof n&&null!==n){const i=[],s={};for(const e in n)s[e]=t.map(O(D,n[e])),i.push(s[e]);return l&&e(l.signal,i),s}const i=t.map(O(D,n));return l&&e(l.signal,i),i}function V(t,n){const l=t.map(O(D,n)),i=de.get();return i&&e(i.signal,[l]),l}function D(e,t){return t[e]}function P({key:e,child:t,source:n},l){T({source:n,key:e},({store:n,key:i,signal:s})=>{const r=R(n,t);l({store:n,key:i,signal:s},()=>{P({key:e,child:t,source:r},l)})})}function T(t,n){let l,s,r=0;ae.store(t)?(s=ft,l=t):(s=O(ut,t.key),l=t.source,r=!!t.reverse);const o=de.get(),a=i(),u={parent:o,signal:a,namespace:o.namespace,targetElement:o.targetElement,svgRoot:o.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'list',pure:0,reverse:r,key:ae.store(t)?{type:'index'}:{type:'key',key:t.key},store:l,cb:n},mountStatus:'initial',visible:1};c(o,u),de.replace(u);const h={parentNode:o.targetElement,cb:n,shortName:l.shortName,reverse:r,parentStack:u,getID:s,fields:t.fields?t.fields:null},p=fe(j(h,[],l.getState()));e(a,[p]),f(a,O(pt,p)),ue({source:p,clock:l,fn:O(j,h),target:p}),de.replace(o)}function j(s,r,o){const a=Array(o.length).fill(0),f=o.map(s.getID),u=[],h=[],p=[];for(let e=0;e<r.length;e++){const t=r[e],n=t.node,l=f.indexOf(n.key);-1!==l?(h.push(t),a[l]=1,n.store.getState()!==o[l]&&oe(n.store,o[l],1)):p.push(t)}if(p.length>0){for(let e=0;e<p.length;e++){const i=p[e],{node:s,locality:r}=i;s.active=0,s.store=null,t(r.sibling.left.ref,r.sibling.right.ref),n(i,null),l(i,null)}oe(ht,p,1)}let d=h.length>0?h[h.length-1]:null;for(let n=0;n<o.length;n++){if(a[n])continue;const l=o[n],r=fe(l),f=i(),p=s.fields?R(r,s.fields):null;e(f,[r]);const g=s.getID(l,n),m={parent:s.parentStack,signal:f,namespace:s.parentStack.namespace,targetElement:s.parentStack.targetElement,svgRoot:s.parentStack.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'listItem',pure:0,key:g,index:g,store:r,signal:f,active:1,nodes:[],fields:p,visible:[]},mountStatus:'initial',visible:1};t(d,m),d=m,c(s.parentStack,m),u.push(m),h.push(m)}return u.length>0&&oe(ct,{context:s,list:u},1),h}function F(e,t,n,l){const i=k(e);i&&l.contains(i.targetElement)?n?i.targetElement.before(t):i.targetElement.after(t):l.appendChild(t)}function M(e){const t=de.get();t&&ne({node:[],parent:e,child:t.signal,family:{type:'crosslink',owners:[t.signal,e]}})}function z(t){const n=de.get();return n&&e(n.signal,[t]),t}function L(e){const t=de.get();if('element'!==t.node.type&&'using'!==t.node.type)throw Error(`"${e}" extension can be used only with element nodes, got "${t.node.type}"`)}function W(e){let t;return X(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}}function X(e){const t=de.get();t.targetElement.__STATIC__||e(t.targetElement)}function Y(e){e.attr&&q(e.attr),e.data&&G(e.data),e.transform&&B(e.transform),'text'in e&&U(e.text),'visible'in e&&Z(e.visible),(e.style||e.styleVar)&&H({prop:e.style,val:e.styleVar}),e.focus&&K(e.focus),e.handler&&J(e.handler)}function q(e){L('attr'),de.getElementNode().attr.push(e)}function G(e){L('data'),de.getElementNode().data.push(e)}function B(e){L('transform'),de.getElementNode().transform.push(e)}function U(e){L('text'),de.getElementNode().text.push(e)}function Z(e){const t=de.get();if('element'!==t.node.type&&'using'!==t.node.type&&'listItem'!==t.node.type)throw Error(`"visible" extension can be used only with element or listItem nodes, got "${t.node.type}"`);de.getElementNode().visible.push(e)}function H({prop:e,val:t}){L('style'),e&&de.getElementNode().styleProp.push(e),t&&de.getElementNode().styleVar.push(t)}function J(e,t){L('handler'),void 0===t&&(t=e,e={});const{passive:n=1,capture:l=0}=e;de.getElementNode().handler.push({options:{passive:n,capture:l},map:t})}function K({focus:e,blur:t}){L('focus');const n=de.getElementNode();e&&n.focus.push(e),t&&n.blur.push(t)}function Q(e,{fn:t}){return console.error('separate map method is deprecated, use store.map as usual'),z(e.map(t))}function ee({source:e,fn:t}){return console.error('separate combine method is deprecated, use common combine method as usual'),z(ce(e,t))}function te(e,t){T({source:fe(Object.entries(t).map(([e,t])=>({key:e,val:t}))),key:'key',fields:['key','val']},({fields:[t,n]})=>{Y({visible:ce(t,e,(e,t)=>e===t)}),n.getState()()})}import{createNode as ne,step as le,clearNode as ie,withRegion as se,createEvent as re,launch as oe,is as ae,combine as ce,createStore as fe,sample as ue}from'effector';const he=[];let pe;const de={get:()=>pe,replace(e){pe=e},getElementNode:()=>pe.node},ge=e=>e.graphite||e,me=e=>e.family.owners,be=e=>e.family.links,ye=ne({node:[le.run({fn(e){ie(e)}})]}),ve=le.compute({fn(e,i){i.self.next.push(ye);const{stack:s}=i,{parent:r}=s,{left:o,right:a}=s.locality.sibling;r&&(r.locality.child.last.ref===s&&(r.locality.child.last.ref=o.ref),r.locality.child.first.ref===s&&(r.locality.child.first.ref=a.ref)),o.ref&&o.ref.locality.sibling.right.ref===s&&a.ref&&a.ref.locality.sibling.left.ref===s?t(o.ref,a.ref):o.ref&&o.ref.locality.sibling.right.ref===s?n(o.ref,null):a.ref&&a.ref.locality.sibling.left.ref===s&&l(a.ref,null)}}),ke=le.compute({fn:(e,{self:t})=>t}),we=/[^a-zA-Z0-9\-]/g,xe=/[\\<>"]/g;class Se{constructor(){this.properties=Object.create(null)}setProperty(e,t){this.properties[s(e)]=r(t)}removeProperty(e){delete this.properties[s(e)]}}class Ee{constructor(){this.items=[]}appendItem(e){this.items.push(e)}}class Ce{constructor(){this.value=''}setTranslate(e,t){this.value=`translate(${e} ${t})`}setScale(e,t){this.value=`scale(${e} ${t})`}setRotate(e,t,n){this.value=0!==t||0!==n?`rotate(${e} ${t} ${n})`:`rotate(${e})`}setSkewX(e){this.value=`skewX(${e})`}setSkewY(e){this.value=`skewY(${e})`}}(new class{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new Se,this.firstChild=null,this.transform={baseVal:new Ee},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}appendChild(e){if(e.parent&&e.remove(),e.isFragment&&null===e.textContent){let t,n=e.firstChild;for(;n;)t=n.sibling.right,this.appendChild(n),n=t}else this.child.last?(this.child.last.sibling.right=e,e.sibling.left=this.child.last):(this.child.first=e,this.firstChild=e),this.child.last=e,e.parent=this}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,e.sibling.right=this.child.first):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}contains(e){let t=e;for(;t;){if(t===this)return 1;t=t.parent}return 0}remove(){if(!this.parent)return;const{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,this.sibling.left.sibling.right=null):(this.sibling.right.sibling.left=this.sibling.left,this.sibling.left.sibling.right=this.sibling.right),this.sibling.left=null,this.sibling.right=null,this.parent=null}addEventListener(e,t,n){}removeEventListener(e,t,n){}setAttribute(e,t){this.attributes[s(e)]=r(t)}removeAttribute(e){delete this.attributes[s(e)]}replaceWith(e){if(!this.parent)return;const{parent:t}=this;e.parent&&e.remove(),t.child.first===this&&t.child.last===this?(t.firstChild=e,t.child.first=e,t.child.last=e):t.child.first===this?(t.child.first=e,t.firstChild=e,this.sibling.right.sibling.left=e):t.child.last===this?(t.child.last=e,this.sibling.left.sibling.right=e):(this.sibling.right.sibling.left=e,this.sibling.left.sibling.right=e),e.sibling.left=this.sibling.left,e.sibling.right=this.sibling.right,e.parent=t,this.sibling.left=null,this.sibling.right=null,this.parent=null}focus(){}blur(){}createSVGTransform(){return new Ce}}).isBody=1;let Ie='undefined'!=typeof document?document:null;const Ne=le.compute({fn(e,t){if(!t.stack)return e;const{stack:n}=t;t.stack=null;const l=n.parent.child.indexOf(n);return-1!==l&&n.parent.child.splice(l,1),n.parent=null,e}}),_e=le.run({fn(e,{fn:t}){t(e)}});let $e,Ae,Oe;$e=()=>{},Ae=()=>{},Oe='undefined'!=typeof performance&&performance.now?()=>performance.now():'undefined'!=typeof process&&process.hrtime?()=>{const e=process.hrtime();return(1e9*e[0]+e[1])/1e6}:()=>Date.now();const Re=re();let Ve,De=0,Pe=0;const Te='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),je='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,Fe=()=>{Pe||(Pe=1,Ve=Te(u))},Me=new Map,ze=new Map,Le=new Map,We=new Map;let Xe=0,Ye=0;const qe=ne({node:[le.run({fn:()=>{}}),le.filter({fn:()=>0===ze.size&&0===Le.size?0:Oe()-Ye>=10?0:(je(Ve),De=1,Pe=0,1)})],child:[Re]});Re.watch(()=>{if(Pe)return;if(0===ze.size&&0===Le.size)return void(De=0);let e=0;De||(Ye=Oe()),De=0;for(const[t,n]of ze){if(Oe()-Ye>=10){Fe(),e=1;break}ze.delete(t),oe({target:Me.get(t),params:n,defer:1})}if(!e)for(const[t,n]of Le){if(Oe()-Ye>=10){Fe(),e=1;break}Le.delete(t),oe({target:Me.get(t),params:n,defer:1})}oe({target:qe,params:null,defer:1})});const Ge=le.compute({fn:({done:e})=>e}),Be=le.compute({fn:({fail:e})=>e}),Ue=le.filter({fn:e=>e.length>0}),Ze=le.compute({fn(e,{taskID:t}){h(t,1,e)}}),He=le.compute({fn(e,{taskID:t,flat:n}){h(t,n,e)}}),Je=le.run({fn:(e,{fn:t})=>t(e,Ye)}),Ke=le.compute({fn:e=>[e]}),Qe=le.run({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:et}=d({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),tt=(e,{map:t,options:n})=>{for(const l in t)e.removeEventListener(l,t[l],n)},nt=(e,t,n)=>{w(n)?delete e[t]:e[t]=n},lt=(e,t,n)=>{w(n)?e.removeProperty(t):e.setProperty(t,n)},st=(e,t)=>({x:t,y:e}),rt=(e,t)=>({x:e,y:t}),ot={translate(e,{x:t=0,y:n=0}){e.setTranslate(t,n)},scale(e,{x:t=0,y:n=0}){e.setScale(t,n)},rotate(e,t){'number'==typeof t?e.setRotate(t,0,0):e.setRotate(t.angle||0,t.x||0,t.y||0)},skewX(e,t){e.setSkewX(t)},skewY(e,t){e.setSkewY(t)}},{trigger:at}=d({mark:'append DOM nodes',fn:e=>{for(let t=0;t<e.append.length;t++){const n=e.append[t];if(0==n.listItem.active)continue;if(0===n.appended.length)continue;const l=Ie.createDocumentFragment();if(e.reverse)for(let e=n.appended.length-1;e>=0;e--)l.appendChild(n.appended[e]);else for(let e=0;e<n.appended.length;e++)l.appendChild(n.appended[e]);F(n.listItemStack,l,e.reverse,e.node)}}}),{trigger:ct}=d({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:l,cb:i,reverse:s}=e,r=de.get();de.replace(n);const o=[],a=[];he.push({node:l,append:a,reverse:s});for(let e=0;e<t.length;e++){const n=t[e],r=n.node;if(r.active){de.replace(n),se(n.signal,O(i,r));for(let e=0;e<a.length;e++)r.nodes.push(a[e]);r.visible.length>0?se(n.signal,()=>{const e=r.visible[r.visible.length-1];e.updates.watch(e=>{if(0!=r.active)if(e){const e=Ie.createDocumentFragment();if(s)for(let t=r.nodes.length-1;t>=0;t--)e.appendChild(r.nodes[t]);else for(let t=0;t<r.nodes.length;t++)e.appendChild(r.nodes[t]);F(n,e,s,l)}else for(let e=0;e<r.nodes.length;e++)r.nodes[e].remove()}),e.getState()&&o.push({listItemStack:n,appended:a.slice(),listItem:r})}):o.push({listItemStack:n,appended:a.slice(),listItem:r}),a.length=0}}he.pop(),o.length>0&&oe({target:at,params:{node:l,append:o,reverse:s},defer:1}),de.replace(r)}}),ft=(e,t)=>t,ut=(e,t)=>t[e],ht=re();g({trigger:ht,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&oe(e,null,0)}}),g({trigger:ht,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const pt=e=>{const t=e.getState();for(let e=0;e<t.length;e++){const n=t[e].node;n.active=0,n.store=null}oe(ht,t,1)};export{q as attr,ee as combine,G as data,M as explicitUnmount,K as focus,A as h,J as handler,T as list,Q as map,X as node,W as nodeMethod,R as remap,z as signalOwn,Y as spec,V as storeField,H as style,U as text,B as transform,P as tree,o as using,te as variant,Z as visible};
//# sourceMappingURL=effector-dom.es.js.map

@@ -101,3 +101,6 @@ import {Store, Event, Step} from 'effector'

): void
export function variant<Case extends string>(
key: Store<Case>,
cases: Partial<{[K in Case]: () => void}>,
): void
export function list<T>(

@@ -104,0 +107,0 @@ source: Store<T[]>,

@@ -1,2 +0,2 @@

((e,t)=>{'object'==typeof exports&&'undefined'!=typeof module?t(exports):'function'==typeof define&&define.amd?define(['exports'],t):t((e=e||self)['effector-dom']={})})(this,(function(e){function t({node:e=[],from:t,source:n,parent:r=t||n,to:s,target:l,child:i=s||l,scope:o={},meta:a={},family:c={type:'regular'}}){const f=je(r),u=je(c.links),p=je(c.owners),d=[],h={};for(let t=0;t<e.length;t++){const n=e[t];n&&(d.push(n),$e(n,h))}const g={seq:d,next:je(i),meta:a,scope:o,family:{type:c.type||'crosslink',links:u,owners:p},reg:h};for(let e=0;e<u.length;e++)Se(u[e]).push(g);for(let e=0;e<p.length;e++)Ee(p[e]).push(g);for(let e=0;e<f.length;e++)f[e].next.push(g);return g}function n(e,t="combine"){let n=t+'(',r='',s=0;for(const t in e){const l=e[t];if(null!=l&&(n+=r,n+=re(l)?l.compositeName.fullName:l.toString()),s+=1,25===s)break;r=', '}return n+=')',n}function r(e,t){st={parent:st,value:e};try{return t()}finally{st=st.parent}}function s(e,n){const r=(e,...t)=>r.create(e,t,t);return r.graphite=t({meta:at('event',r,n,e)}),r.create=e=>(Xe(r,e),e),r.watch=oe(lt,r),r.map=e=>{let t,n;'object'==typeof e&&(t=e,n=e.name,e=e.fn);const l=s(Ze(r,n),t);return ct(r,l,'map',e),l},r.filter=e=>'function'==typeof e?(console.error('.filter(fn) is deprecated, use .filterMap instead'),l(r,e)):ft(r,'filter',e.fn,[ve({fn:Ie})]),r.filterMap=oe(l,r),r.prepend=e=>{const t=s('* → '+r.shortName,{parent:r.parent});return ct(t,r,'prepend',e),(({parent:e},t)=>{e&&e.hooks.event(t)})(r,t),t},r.subscribe=e=>lt(r,t=>e.next(t)),r[ne]=()=>r,rt(r)}function l(e,t){return ft(e,'filterMap',t,[ye({fn:Ie}),me()])}function i(e,n){const r=Ce(e),l=Ce(e),c=s({named:'updates'}),f={subscribers:new Map,updates:c,defaultState:e,stateRef:r,getState:oe(Oe,r),setState(e){Xe({target:f,params:e,defer:1})}};if(f.graphite=t({scope:{state:r},node:[me(),we({store:r}),be({store:l}),we({store:l})],child:c,meta:at('store',f,n)}),ot&&void 0===e)throw Error("current state can't be undefined, use null instead");return f.watch=f.subscribe=oe(a,f),f.reset=(...e)=>{for(const t of e)f.on(t,()=>f.defaultState);return f},f.on=(e,t)=>(f.off(e),f.subscribers.set(e,tt(ut(e,f,'on',1,t))),f),f.off=oe(o,f),f.map=(e,t)=>{let n,r,s;'object'==typeof e&&(n=e,r=e.name,t=e.firstState,e=e.fn);const l=f.getState();void 0!==l&&(s=e(l,t));const o=i(s,{name:Ze(f,r),config:n,strict:0});return ut(f,o,'map',0,e),o},f[ne]=()=>({subscribe(e){if(e!==Object(e))throw Error('expect observer to be an object');return a(f,t=>{e.next&&e.next(t)})},[ne](){return this}}),Ae(f,[c]),rt(f)}function o(e,t){const n=e.subscribers.get(t);return void 0!==n&&(n(),e.subscribers.delete(t)),e}function a(e,t,n){if(!n||!re(t)){if('function'!=typeof t)throw Error('watch requires function handler');return t(e.getState()),lt(e,t)}if('function'!=typeof n)throw Error('second argument should be a function');return t.watch(t=>n(e.getState(),t))}function c(...e){if(0===e.length)throw Error('at least one argument required');let t,n,r,s,l;'ɔ'in e[0]&&(r=e[0].config,e=e[0].ɔ);{const r=e[e.length-1];'function'==typeof r?(n=e.slice(0,-1),t=r):n=e}if(1===n.length){const e=n[0];le(e)||(s=e,l=1)}return l||(s=n,t&&(t=dt(t))),Array.isArray(s)?ht(s,e=>e.slice(),[],r,t):ht(s,e=>Object.assign({},e),{},r,t)}function f(e,t){const n=vt(e);for(let e=0;e<t.length;e++){const r=vt(t[e]);r.family.type='crosslink';const s=kt(r),l=wt(n);s.includes(n)||s.push(n),l.includes(r)||l.push(r)}}function u(e,t){p(e,t),d(t,e)}function p(e,t){e&&e!==t&&(e.locality.sibling.right.ref=t)}function d(e,t){e&&e!==t&&(e.locality.sibling.left.ref=t)}function h(){const e={stack:null},n=yt.get(),r=t({node:[St,Et],parent:[n&&n.signal].filter(Boolean),meta:{unit:'signal'},scope:e});return e.self=r,r}function g(e){switch(e=String(e)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return e.replace(Nt,'')}}function m(e){return String(e).replace(At,'')}function b({node:e,append:t,reverse:n=0}){if(0===t.length)return;const r=_t.createDocumentFragment();if(n){for(let e=t.length-1;e>=0;e--)r.appendChild(t[e]);e.prepend(r)}else{for(let e=0;e<t.length;e++)r.appendChild(t[e]);e.appendChild(r)}}function y(e,t){t.parent=e,t.signal.seq.push(It),t.signal.scope.stack=t,e.child.push(t)}function v(e,n){return t({node:[jt],parent:e,meta:{op:'watch'},scope:{fn:n},family:{type:'crosslink',owners:[e]}})}function k(){Tt=0,Vt()}function w(e,t,n){const r=(e=>'high'===Gt.get(e)?Xt:Yt)(e);let s=r.get(e);if(s||(s=[],r.set(e,s)),t)for(let e=0;e<n.length;e++)s.push(n[e]);else s.push(n);Lt()}function x(e,n,r=0,l="low"){const i=++Ut,o=s(),a=le(c=e)?c.updates:c;var c;const u={type:'crosslink',owners:[a,o]};return t({node:[en],parent:[a],scope:{taskID:i,flat:r},family:u}),f(e,[o]),Wt.set(i,t({node:[tn],child:[t({node:[Jt,Kt,Qt],scope:{taskID:i},family:u}),t({node:[Ht,Kt],child:[o],family:u})],scope:{fn:n},family:u})),Gt.set(i,l),o}function S({trigger:e=s(),fn:n,priority:r="low",timeout:l=1/0,batchWindow:i=0,retries:o=1/0,mark:a=e.shortName}){const c=x(e.map(e=>[{inserted:Pt(),retry:0,value:e}]),(e,t)=>{let r,s=0;const a=[],c=[];for(r=0;r<e.length;r++){const o=e[r],f=Pt();if(o.inserted+i>f){c.push(o);continue}if(o.inserted+l<f)continue;if(f-t>=10){s=1;break}const u=n(o.value);void 0!==u&&a.push(u)}if(s)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=o||c.push(n)}return{done:a,fail:c}},1,r);return{trigger:e,processed:c,connect:n=>{t({node:[],parent:n,child:e,family:{type:'crosslink',owners:[n,e]}})}}}function E({trigger:e=s(),fn:n,priority:r="low",timeout:l=1/0,batchWindow:i=0,retries:o=1/0,mark:a=e.shortName,flatten:c}){const f=x(e.map(e=>{const t=[],n=Pt();for(let r=0;r<e.length;r++){const s=c(e[r]);for(let e=0;e<s.length;e++)t.push({inserted:n,retry:0,value:s[e]})}return t}),(e,t)=>{let r,s=0;const a=[],c=[];for(r=0;r<e.length;r++){const o=e[r],f=Pt();if(o.inserted+i>f){c.push(o);continue}if(o.inserted+l<f)continue;if(f-t>=10){s=1;break}const u=n(o.value);void 0!==u&&a.push(u)}if(s)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=o||c.push(n)}return{done:a,fail:c}},1,r);return{trigger:e,processed:f,connect:n=>{t({node:[nn],parent:n,child:e,family:{type:'crosslink',owners:[n,e]}})}}}function N(e,t,n){v(e,t.watch(n))}function A(e,n,r){t({node:[rn],parent:n,child:[sn],family:{type:'crosslink',owners:e},scope:{handler:r},meta:{op:'debounceRaf'}}),le(n)&&Xe(sn,{data:n.getState(),handler:r},1)}function C(e,t,n,r){re(n)?(e?N:A)(t,n,r):r(n)}function O(e,t=e.child.length-1){for(let n=t;n>=0;n--){const t=e.child[n];switch(t.node.type){case'element':case'using':if(!t.visible)continue;return t}const r=O(t);if(r)return r}return null}function R(e){if(!e.parent)return null;switch(e.parent.node.type){case'element':case'using':{const t=O(e.parent,e.parent.child.indexOf(e)-1);if(t)return t;break}case'list':case'listItem':{let t=e,n=e.parent;for(;n;){const e=O(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function _(e){return''!==e&&0!==e&&(0==e||null==e)}function I(e,t,n){_(n)?delete e[t]:e[t]=`${n}`}function j(e,t,n,r){if(n.visible=r,r){if(!t.contains(e)){const r=R(n);r&&t.contains(r.targetElement)?r.targetElement.after(e):t.appendChild(e)}}else e.remove()}function $(e,t,n){if(null===n)return;const r=yt.get().parent.targetElement;A(t,n,j.bind(null,e,r,yt.get()))}function D(e,t,n){if(_(n)){switch(t){case'value':delete e.value;break;case'checked':e.checked=0;break;case'spellcheck':if(0==n)return void e.setAttribute('spellcheck','false')}e.removeAttribute(t)}else{switch(t){case'value':e.value=`${n}`;break;case'checked':e.checked=`${n}`}e.setAttribute(t,`${n}`)}}function P(e,t,n,r,s,l){const i=e.createSVGTransform();switch(l){case'translate':case'scale':r=(e=>le(e)?e:le(e.x)?le(e.y)?c({x:e.x,y:e.y}):e.x.map(cn.bind(null,e.y)):le(e.y)?e.y.map(fn.bind(null,e.x)):e)(r)}C(0,t,r,s.bind(null,i)),n.appendItem(i)}function V(e,t){const n=_t.createTextNode(`${t}`),r=e.firstChild;r?r.replaceWith(n):e.appendChild(n)}function z(e){e.focus()}function M(e){e.blur()}function T(e,t){return e.bind(null,t)}function F(e,t){const n=yt.get();if(Array.isArray(t)){const r=[];for(let n=0;n<t.length;n++)r[n]=e.map(T(q,t[n]));return n&&f(n.signal,r),r}if('object'==typeof t&&null!==t){const r=[],s={};for(const n in t)s[n]=e.map(T(q,t[n])),r.push(s[n]);return n&&f(n.signal,r),s}const r=e.map(T(q,t));return n&&f(n.signal,r),r}function q(e,t){return t[e]}function L(e,n){let r,l,o=0;le(e)?(l=hn,r=e):(l=T(gn,e.key),r=e.source,o=!!e.reverse);const a=yt.get(),c=h(),u={parent:a,signal:c,namespace:a.namespace,targetElement:a.targetElement,svgRoot:a.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'list',pure:0,reverse:o,key:le(e)?{type:'index'}:{type:'key',key:e.key},store:r,cb:n},mountStatus:'initial',visible:1};y(a,u),yt.replace(u);const p={parentNode:a.targetElement,cb:n,shortName:r.shortName,reverse:o,parentStack:u,getID:l,fields:e.fields?e.fields:null},d=i(W(p,[],r.getState()));f(c,[d]),v(c,T(bn,d)),((...e)=>{let n,r,l;'ɔ'in e[0]&&(l=e[0].config,e=e[0].ɔ);let[o,a,c,f=0]=e;if(void 0===a&&'source'in o){if('clock'in o&&null==o.clock)throw Error('config.clock should be defined');a=o.clock,c=o.fn,f=o.greedy,n=o.target,r=o.name,o=o.source}if(void 0===a&&(a=o),r=l||r||o.shortName,o=gt(o),a=gt(a),'boolean'==typeof c&&(f=c,c=null),n||(n=le(o)&&le(a)?i(c?c(Oe(Ne(o)),Oe(Ne(a))):Oe(Ne(o)),{name:r}):s(r)),le(o))Ae(o,[rt(nt(a,n,{scope:{fn:c},node:[!f&&he({priority:'sampler'}),ge({store:Ne(o),to:c?'a':'stack'}),c&&ye({fn:_e})],meta:{op:'sample',sample:'store'}}))]);else{const e=Ce(0),r=Ce(),s=Ce();rt(t({parent:o,node:[we({store:r}),ge({from:'value',store:1,target:e})],family:{owners:[o,n,a],links:n},meta:{op:'sample',sample:'source'}})),Ae(o,[rt(nt(a,n,{scope:{fn:c},node:[we({store:s}),ge({store:e}),ve({fn:e=>e}),!f&&he({priority:'sampler'}),ge({store:r}),ge({store:s,to:'a'}),c&&ye({fn:Re})],meta:{op:'sample',sample:'clock'}}))])}})({source:d,clock:r,fn:T(W,p),target:d}),yt.replace(a)}function W(e,t,n){const r=Array(n.length).fill(0),s=n.map(e.getID),l=[],o=[],a=[];for(let e=0;e<t.length;e++){const l=t[e],i=l.node,c=s.indexOf(i.key);-1!==c?(o.push(l),r[c]=1,i.store.getState()!==n[c]&&Xe(i.store,n[c],1)):a.push(l)}if(a.length>0){for(let e=0;e<a.length;e++){const t=a[e],{node:n,locality:r}=t;n.active=0,n.store=null,u(r.sibling.left.ref,r.sibling.right.ref),p(t,null),d(t,null)}Xe(mn,a,1)}let c=o.length>0?o[o.length-1]:null;for(let t=0;t<n.length;t++){if(r[t])continue;const s=n[t],a=i(s),p=h(),d=e.fields?F(a,e.fields):null;f(p,[a]);const g=e.getID(s,t),m={parent:e.parentStack,signal:p,namespace:e.parentStack.namespace,targetElement:e.parentStack.targetElement,svgRoot:e.parentStack.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'listItem',pure:0,key:g,index:g,store:a,signal:p,active:1,nodes:[],fields:d},mountStatus:'initial',visible:1};u(c,m),c=m,y(e.parentStack,m),l.push(m),o.push(m)}return l.length>0&&Xe(dn,{context:e,list:l},1),o}function X(e){const t=yt.get();return t&&f(t.signal,[e]),e}function Y(){const e=yt.get();if('element'!==e.node.type&&'using'!==e.node.type)throw Error(`this extension can be used only with element nodes, got "${e.node.type}"`)}function G(e){const t=yt.get();t.targetElement.__STATIC__||e(t.targetElement)}function U(e){e.attr&&B(e.attr),e.data&&Z(e.data),e.transform&&H(e.transform),'text'in e&&J(e.text),'visible'in e&&K(e.visible),(e.style||e.styleVar)&&Q({prop:e.style,val:e.styleVar}),e.focus&&te(e.focus),e.handler&&ee(e.handler)}function B(e){Y(),yt.getElementNode().attr.push(e)}function Z(e){Y(),yt.getElementNode().data.push(e)}function H(e){Y(),yt.getElementNode().transform.push(e)}function J(e){Y(),yt.getElementNode().text.push(e)}function K(e){Y(),yt.getElementNode().visible.push(e)}function Q({prop:e,val:t}){Y(),e&&yt.getElementNode().styleProp.push(e),t&&yt.getElementNode().styleVar.push(t)}function ee(e,t){Y(),void 0===t&&(t=e,e={});const{passive:n=1,capture:r=0}=e;yt.getElementNode().handler.push({options:{passive:n,capture:r},map:t})}function te({focus:e,blur:t}){Y();const n=yt.getElementNode();e&&n.focus.push(e),t&&n.blur.push(t)}var ne=(()=>{var e,t=('undefined'!=typeof self?self:'undefined'!=typeof window?window:'undefined'!=typeof global?global:'undefined'!=typeof module?module:Function("","return this")()).Symbol;return'function'==typeof t?t.observable?e=t.observable:(e=t('observable'),t.observable=e):e='@@observable',e})();const re=e=>('function'==typeof e||'object'==typeof e&&null!==e)&&'kind'in e,se=e=>t=>re(t)&&t.kind===e,le=se('store'),ie=se('domain'),oe=(e,t)=>e.bind(null,t),ae=(e,t,n)=>e.bind(null,t,n),ce=()=>{let e=0;return()=>(++e).toString(36)},fe=ce(),ue=ce(),pe=(e,t,n)=>({id:ue(),type:e,data:n,hasRef:t});let de=0;const he=({priority:e="barrier"})=>pe('barrier',0,{barrierID:++de,priority:e}),ge=({from:e="store",store:t,target:n,to:r=(n?'store':'stack')})=>pe('mov','store'===e,{from:e,store:t,to:r,target:n}),me=()=>pe('check',0,{type:'defined'}),be=({store:e})=>pe('check',1,{type:'changed',store:e}),ye=ae(pe,'compute',0),ve=ae(pe,'filter',0),ke=ae(pe,'run',0),we=({store:e})=>ge({from:'stack',target:e}),xe=e=>e.graphite||e,Se=e=>e.family.owners,Ee=e=>e.family.links,Ne=e=>e.stateRef,Ae=(e,t)=>{const n=xe(e);for(let e=0;e<t.length;e++){const r=xe(t[e]);'domain'!==n.family.type&&(r.family.type='crosslink'),Se(r).push(n),Ee(n).push(r)}},Ce=e=>({id:ue(),current:e}),Oe=({current:e})=>e,Re=(e,{fn:t},{a:n})=>t(e,n),_e=(e,{fn:t},{a:n})=>t(n,e),Ie=(e,{fn:t})=>t(e),je=(e=[])=>{const t=[];if(Array.isArray(e))for(let n=0;n<e.length;n++)Array.isArray(e[n])?t.push(...e[n]):t.push(e[n]);else t.push(e);return t.map(xe)},$e=({hasRef:e,type:t,data:n},r)=>{let s;e&&(s=n.store,r[s.id]=s),'mov'===t&&'store'===n.to&&(s=n.target,r[s.id]=s)};let De=null;const Pe=(e,t)=>{if(!e)return t;if(!t)return e;let n;const r=e.v.type===t.v.type;return(r&&e.v.id>t.v.id||!r&&'sampler'===e.v.type)&&(n=e,e=t,t=n),n=Pe(e.r,t),e.r=e.l,e.l=n,e},Ve=[];let ze=0;for(;ze<5;)Ve.push({first:null,last:null,size:0}),ze+=1;const Me=()=>{for(let e=0;e<5;e++){const t=Ve[e];if(t.size>0){if(2===e||3===e){t.size-=1;const e=De.v;return De=Pe(De.l,De.r),e}1===t.size&&(t.last=null);const n=t.first;return t.first=n.right,t.size-=1,n.value}}},Te=(e,t,n,r)=>Fe(0,{a:null,b:null,node:t,parent:n,value:r},e),Fe=(e,t,n,r=0)=>{const s=qe(n),l=Ve[s],i={idx:e,stack:t,type:n,id:r};if(2===s||3===s)De=Pe(De,{v:i,l:0,r:0});else{const e={right:null,value:i};0===l.size?l.first=e:l.last.right=e,l.last=e}l.size+=1},qe=e=>{switch(e){case'child':return 0;case'pure':return 1;case'barrier':return 2;case'sampler':return 3;case'effect':return 4;default:return-1}},Le=new Set;let We=0;const Xe=(e,t,n)=>{if(e.target&&(t=e.params,n=e.defer,e=e.target),Array.isArray(e))for(let n=0;n<e.length;n++)Te('pure',xe(e[n]),null,t[n]);else Te('pure',xe(e),null,t);n&&We||(()=>{const e=We;We=1;const t={stop:0};let n,r;e:for(;r=Me();){const{idx:e,stack:s,type:l}=r;n=s.node;const i={skip:0,fail:0,ref:'',scope:n.scope};for(let r=e;r<n.seq.length&&!t.stop;r++){const o=n.seq[r],a=o.data;switch(o.type){case'barrier':{const t=a.barrierID,n=a.priority;if(r!==e||l!==n){Le.has(t)||(Le.add(t),Fe(r,s,n,t));continue e}Le.delete(t);break}case'mov':{let e;switch(a.from){case'stack':e=s.value;break;case'a':e=s.a;break;case'b':e=s.b;break;case'value':e=a.store;break;case'store':e=Oe(n.reg[a.store.id])}switch(a.to){case'stack':s.value=e;break;case'a':s.a=e;break;case'b':s.b=e;break;case'store':n.reg[a.target.id].current=e}break}case'check':switch(a.type){case'defined':i.skip=void 0===s.value;break;case'changed':i.skip=s.value===Oe(n.reg[a.store.id])}break;case'filter':i.skip=!Ye(i,a,s);break;case'run':if(r!==e||'effect'!==l){Fe(r,s,'effect');continue e}case'compute':s.value=Ye(i,a,s)}t.stop=i.fail||i.skip}if(!t.stop)for(let e=0;e<n.next.length;e++)Te('child',n.next[e],s,s.value);t.stop=0}We=e})()},Ye=(e,{fn:t},n)=>{try{return t(n.value,e.scope,n)}catch(t){console.error(t),e.fail=1}},Ge=(e,t={})=>(Object(e)===e&&(Ge(e.config,t),null!=e.name&&('object'==typeof e.name?Ge(e.name,t):t.name=e.name),e.loc&&(t.loc=e.loc),e.sid&&(t.sid=e.sid),e.handler&&(t.handler=e.handler),e.parent&&(t.parent=e.parent),'strict'in e&&(t.strict=e.strict),e.named&&(t.named=e.named),Ge(e.ɔ,t)),t),Ue=Ge,Be=(e,t)=>''+e.shortName+t,Ze=(e,t)=>null==t?Be(e,' → *'):t,He=(e,t)=>{const n=e.indexOf(t);-1!==n&&e.splice(n,1)},Je=(e,t)=>{He(e.next,t),He(Se(e),t),He(Ee(e),t)},Ke=(e,t,n)=>{let r;e.next.length=0,e.seq.length=0,e.scope=null;let s=Ee(e);for(;r=s.pop();)Je(r,e),(t||n&&!e.meta.sample||'crosslink'===r.family.type)&&Ke(r,t,n);for(s=Se(e);r=s.pop();)Je(r,e),n&&'crosslink'===r.family.type&&Ke(r,t,n)},Qe=e=>e.clear(),et=(e,{deep:t}={})=>{let n=0;if(le(e))Qe(e.subscribers);else if(ie(e)){n=1;const t=e.history;Qe(t.events),Qe(t.effects),Qe(t.stores),Qe(t.domains)}Ke(xe(e),!!t,n)},tt=e=>{const t=ae(et,e,void 0);return t.unsubscribe=t,t},nt=(e,n,{node:r,scope:s,meta:l})=>t({node:r,parent:e,child:n,scope:s,meta:l,family:{owners:[e,n],links:n}}),rt=e=>(st&&Ae(st.value,[e]),e);let st=null;const lt=(e,n)=>tt(rt(t({scope:{fn:n},node:[ke({fn:Ie})],parent:e,meta:{op:'watch'},family:{owners:e}})));let ot;const at=(e,t,n,r)=>{const s=Ue({name:r,config:n}),l=fe(),{parent:i=null,sid:o=null,strict:a=1,named:c=null}=s,f=c||s.name||('domain'===e?'':l),u=((e,t)=>{let n,r,s;const l=e;return t?(s=t.compositeName,0===e.length?(n=s.path,r=s.fullName):(n=s.path.concat([e]),r=0===s.fullName.length?e:s.fullName+'/'+e)):(n=0===e.length?[]:[e],r=e),{shortName:l,fullName:r,path:n}})(f,i);return t.kind=e,t.id=l,t.sid=o,t.shortName=f,t.parent=i,t.compositeName=u,t.defaultConfig=s,t.thru=oe(pt,t),t.getType=()=>u.fullName,ot=a,{unit:e,name:f,sid:o,named:c}},ct=(e,t,n,r)=>nt(e,t,{scope:{fn:r},node:[ye({fn:Ie})],meta:{op:n}}),ft=(e,t,n,r)=>{const l=s(Be(e,' →? *'));return nt(e,l,{scope:{fn:n},node:r,meta:{op:t}}),l},ut=(e,{graphite:t,stateRef:n},r,s,l)=>nt(e,t,{scope:{fn:l},node:[ge({store:n,to:'a'}),ye({fn:s?_e:Re}),me(),be({store:n}),we({store:n})],meta:{op:r}}),pt=(e,t)=>t(e),dt=e=>t=>e(...t),ht=(e,t,r,s,l)=>{const o=t(r),a=i(o,{name:s||n(e)}),c=Ce(o),f=Ce(1),u=[me(),ge({store:c,to:'a'}),ve({fn:(e,{key:t},{a:n})=>e!==n[t]}),ge({store:f,to:'b'}),ye({fn(e,{clone:t,key:n},r){r.b&&(r.a=t(r.a)),r.a[n]=e}}),ge({from:'a',target:c}),ge({from:'value',store:0,target:f}),he({priority:'barrier'}),ge({from:'value',store:1,target:f}),ge({store:c}),l&&ye({fn:l}),be({store:Ne(a)})];for(const n in e){const s=e[n];le(s)?(r[n]=s.defaultState,o[n]=s.getState(),nt(s,a,{scope:{key:n,clone:t},node:u,meta:{op:'combine'}})):o[n]=r[n]=s}return a.defaultShape=e,a.defaultState=l?Ne(a).current=l(o):r,a},gt=e=>re(e)?e:c(e),mt=(t({node:[ke({fn({fn:e,value:t}){e(t)}})],meta:{op:'fx',fx:'sidechain'}}),ve({fn:(e,{state:t})=>void 0!==e&&e!==Oe(t)}),ye({fn:e=>e}),[]);let bt;const yt={get:()=>bt,replace(e){bt=e},getElementNode:()=>bt.node},vt=e=>e.graphite||e,kt=e=>e.family.owners,wt=e=>e.family.links,xt=t({node:[ke({fn(e){et(e)}})]}),St=ye({fn(e,t){t.self.next.push(xt);const{stack:n}=t,{parent:r}=n,{left:s,right:l}=n.locality.sibling;r&&(r.locality.child.last.ref===n&&(r.locality.child.last.ref=s.ref),r.locality.child.first.ref===n&&(r.locality.child.first.ref=l.ref)),s.ref&&s.ref.locality.sibling.right.ref===n&&l.ref&&l.ref.locality.sibling.left.ref===n?u(s.ref,l.ref):s.ref&&s.ref.locality.sibling.right.ref===n?p(s.ref,null):l.ref&&l.ref.locality.sibling.left.ref===n&&d(l.ref,null)}}),Et=ye({fn:(e,{self:t})=>t}),Nt=/[^a-zA-Z0-9\-]/g,At=/[\\<>"]/g;class Ct{constructor(){this.properties=Object.create(null)}setProperty(e,t){this.properties[g(e)]=m(t)}removeProperty(e){delete this.properties[g(e)]}}class Ot{constructor(){this.items=[]}appendItem(e){this.items.push(e)}}class Rt{constructor(){this.value=''}setTranslate(e,t){this.value=`translate(${e} ${t})`}setScale(e,t){this.value=`scale(${e} ${t})`}setRotate(e,t,n){this.value=0!==t||0!==n?`rotate(${e} ${t} ${n})`:`rotate(${e})`}setSkewX(e){this.value=`skewX(${e})`}setSkewY(e){this.value=`skewY(${e})`}}(new class{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new Ct,this.firstChild=null,this.transform={baseVal:new Ot},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}appendChild(e){if(e.parent&&e.remove(),e.isFragment&&null===e.textContent){let t,n=e.firstChild;for(;n;)t=n.sibling.right,this.appendChild(n),n=t}else this.child.last?(this.child.last.sibling.right=e,e.sibling.left=this.child.last):(this.child.first=e,this.firstChild=e),this.child.last=e,e.parent=this}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,e.sibling.right=this.child.first):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}contains(e){let t=e;for(;t;){if(t===this)return 1;t=t.parent}return 0}remove(){if(!this.parent)return;const{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,this.sibling.left.sibling.right=null):(this.sibling.right.sibling.left=this.sibling.left,this.sibling.left.sibling.right=this.sibling.right),this.sibling.left=null,this.sibling.right=null,this.parent=null}addEventListener(e,t,n){}removeEventListener(e,t,n){}setAttribute(e,t){this.attributes[g(e)]=m(t)}removeAttribute(e){delete this.attributes[g(e)]}replaceWith(e){if(!this.parent)return;const{parent:t}=this;e.parent&&e.remove(),t.child.first===this&&t.child.last===this?(t.firstChild=e,t.child.first=e,t.child.last=e):t.child.first===this?(t.child.first=e,t.firstChild=e,this.sibling.right.sibling.left=e):t.child.last===this?(t.child.last=e,this.sibling.left.sibling.right=e):(this.sibling.right.sibling.left=e,this.sibling.left.sibling.right=e),e.sibling.left=this.sibling.left,e.sibling.right=this.sibling.right,e.parent=t,this.sibling.left=null,this.sibling.right=null,this.parent=null}focus(){}blur(){}createSVGTransform(){return new Rt}}).isBody=1;let _t='undefined'!=typeof document?document:null;const It=ye({fn(e,t){if(!t.stack)return e;const{stack:n}=t;t.stack=null;const r=n.parent.child.indexOf(n);return-1!==r&&n.parent.child.splice(r,1),n.parent=null,e}}),jt=ke({fn(e,{fn:t}){t(e)}});let $t,Dt,Pt;$t=()=>{},Dt=()=>{},Pt='undefined'!=typeof performance&&performance.now?()=>performance.now():'undefined'!=typeof process&&process.hrtime?()=>{const e=process.hrtime();return(1e9*e[0]+e[1])/1e6}:()=>Date.now();const Vt=s();let zt,Mt=0,Tt=0;const Ft='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),qt='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,Lt=()=>{Tt||(Tt=1,zt=Ft(k))},Wt=new Map,Xt=new Map,Yt=new Map,Gt=new Map;let Ut=0,Bt=0;const Zt=t({node:[ke({fn:()=>{}}),ve({fn:()=>0===Xt.size&&0===Yt.size?0:Pt()-Bt>=10?0:(qt(zt),Mt=1,Tt=0,1)})],child:[Vt]});Vt.watch(()=>{if(Tt)return;if(0===Xt.size&&0===Yt.size)return void(Mt=0);let e=0;Mt||(Bt=Pt()),Mt=0;for(const[t,n]of Xt){if(Pt()-Bt>=10){Lt(),e=1;break}Xt.delete(t),Xe({target:Wt.get(t),params:n,defer:1})}if(!e)for(const[t,n]of Yt){if(Pt()-Bt>=10){Lt(),e=1;break}Yt.delete(t),Xe({target:Wt.get(t),params:n,defer:1})}Xe({target:Zt,params:null,defer:1})});const Ht=ye({fn:({done:e})=>e}),Jt=ye({fn:({fail:e})=>e}),Kt=ve({fn:e=>e.length>0}),Qt=ye({fn(e,{taskID:t}){w(t,1,e)}}),en=ye({fn(e,{taskID:t,flat:n}){w(t,n,e)}}),tn=ke({fn:(e,{fn:t})=>t(e,Bt)}),nn=ye({fn:e=>[e]}),rn=ke({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:sn}=S({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),ln=(e,{map:t,options:n})=>{for(const r in t)e.removeEventListener(r,t[r],n)},on=(e,t,n)=>{_(n)?delete e[t]:e[t]=n},an=(e,t,n)=>{_(n)?e.removeProperty(t):e.setProperty(t,n)},cn=(e,t)=>({x:t,y:e}),fn=(e,t)=>({x:e,y:t}),un={translate(e,{x:t=0,y:n=0}){e.setTranslate(t,n)},scale(e,{x:t=0,y:n=0}){e.setScale(t,n)},rotate(e,t){'number'==typeof t?e.setRotate(t,0,0):e.setRotate(t.angle||0,t.x||0,t.y||0)},skewX(e,t){e.setSkewX(t)},skewY(e,t){e.setSkewY(t)}},{trigger:pn}=S({mark:'append DOM nodes',fn:e=>{for(let t=0;t<e.append.length;t++){const n=e.append[t];if(0==n.listItem.active)continue;if(0===n.appended.length)continue;const r=_t.createDocumentFragment();if(e.reverse)for(let e=n.appended.length-1;e>=0;e--)r.appendChild(n.appended[e]);else for(let e=0;e<n.appended.length;e++)r.appendChild(n.appended[e]);const s=R(n.listItemStack);s&&e.node.contains(s.targetElement)?e.reverse?s.targetElement.before(r):s.targetElement.after(r):e.node.appendChild(r)}}}),{trigger:dn}=S({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:s,cb:l,reverse:i}=e,o=yt.get();yt.replace(n);const a=[],c=[];mt.push({node:s,append:c,reverse:i});for(let e=0;e<t.length;e++){const n=t[e],s=n.node;if(s.active){yt.replace(n),r(n.signal,T(l,s));for(let e=0;e<c.length;e++)s.nodes.push(c[e]);a.push({listItemStack:n,appended:c.slice(),listItem:s}),c.length=0}}mt.pop(),a.length>0&&Xe({target:pn,params:{node:s,append:a,reverse:i},defer:1}),yt.replace(o)}}),hn=(e,t)=>t,gn=(e,t)=>t[e],mn=s();E({trigger:mn,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&Xe(e,null,0)}}),E({trigger:mn,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const bn=e=>{const t=e.getState();for(let e=0;e<t.length;e++){const n=t[e].node;n.active=0,n.store=null}Xe(mn,t,1)};e.attr=B,e.combine=({source:e,fn:t})=>(console.error('separate combine method is deprecated, use common combine method as usual'),X(c(e,t))),e.data=Z,e.explicitUnmount=e=>{const n=yt.get();n&&t({node:[],parent:e,child:n.signal,family:{type:'crosslink',owners:[n.signal,e]}})},e.focus=te,e.h=(e,t,n)=>{'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:s=0}=t,l=yt.get(),i=l?l.namespace:'html';let o=i,a='html';'type'in t?(a=t.type,o=t.type):o=a='svg'===i?'svg':'html','svg'===e&&(a='svg',o='svg');const c='svg'===a?_t.createElementNS('http://www.w3.org/2000/svg',e):_t.createElement(e);'foreignObject'===i?(c.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),o='html'):'svg'===e?(c.setAttribute('xmlns','http://www.w3.org/2000/svg'),o='svg'):'foreignObject'===e&&(o='foreignObject');const f=h(),u={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},p={parent:null,signal:f,namespace:o,targetElement:c,svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:u,mountStatus:'initial',visible:1};l&&y(l,p),'svg'===e?p.svgRoot=c:l&&(p.svgRoot=l.svgRoot),yt.replace(p),n?((e,t,n,s)=>{let l=0;mt.push({node:t,append:[],reverse:0});try{r(e,s),l=1}finally{b(mt.pop()),l||yt.replace(n)}})(f,c,l,n):(u.pure=1,U(t));const d=(()=>{const e=(()=>{const e=yt.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:e.handler,transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.attr.length;n++){const r=e.attr[n];for(const e in r)t.attr[e]=r[e]}for(let n=0;n<e.data.length;n++){const r=e.data[n];for(const e in r)t.data[e]=r[e]}e.visible.length>0&&(t.visible=e.visible[e.visible.length-1]),e.text.length>0&&(t.text=e.text[e.text.length-1]);for(let n=0;n<e.styleVar.length;n++){const r=e.styleVar[n];for(const e in r)t.styleVar[e]=r[e]}for(let n=0;n<e.styleProp.length;n++){const r=e.styleProp[n];for(const e in r)t.styleProp[e]=r[e]}return t})(),t=yt.get(),n=t.targetElement,r=t.signal;return((e,t,n)=>{for(const r in n)C('value'!==r&&'checked'!==r&&'min'!==r&&'max'!==r,t,n[r],D.bind(null,e,r))})(n,r,e.attr),((e,t,n)=>{for(const r in n)C(0,t,n[r],I.bind(null,e.dataset,r))})(n,r,e.data),((e,t,n)=>{for(let r=0;r<n.length;r++){const{options:s,map:l}=n[r];for(const t in l)e.addEventListener(t,l[t],s);v(t,ln.bind(null,e,n[r]))}})(n,r,e.handler),((e,t,n)=>{const r=e.style;for(const e in n)C(0,t,n[e],on.bind(null,r,e))})(n,r,e.styleProp),((e,t,n)=>{const r=e.style;for(const e in n)C(0,t,n[e],an.bind(null,r,`--${e}`))})(n,r,e.styleVar),((e,t,n)=>{const r=yt.get();if('svg'!==r.namespace)return;if(0===n.length)return;const s=e.transform.baseVal,l=r.svgRoot;for(let e=0;e<n.length;e++){const r=n[e];for(const e in r)P(l,t,s,r[e],un[e],e)}})(n,r,e.transform),((e,t,n)=>{null!==n&&(re(n)?A(t,n,V.bind(null,e)):V(e,n))})(n,r,e.text),$(n,r,e.visible),((e,t,n)=>{for(let r=0;r<n.length;r++)C(1,t,n[r],z.bind(null,e))})(n,r,e.focus),((e,t,n)=>{for(let r=0;r<n.length;r++)C(1,t,n[r],M.bind(null,e))})(n,r,e.blur),e})();yt.replace(l),p.visible=!d.visible||d.visible.getState(),s||mt.length>0&&p.visible&&mt[mt.length-1].append.push(c)},e.handler=ee,e.list=L,e.map=(e,{fn:t})=>(console.error('separate map method is deprecated, use store.map as usual'),X(e.map(t))),e.node=G,e.nodeMethod=e=>{let t;return G(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}},e.remap=F,e.signalOwn=X,e.spec=U,e.storeField=(e,t)=>{const n=e.map(T(q,t)),r=yt.get();return r&&f(r.signal,[n]),n},e.style=Q,e.text=J,e.transform=H,e.tree=function e({key:t,child:n,source:r},s){L({source:r,key:t},({store:r,key:l,signal:i})=>{const o=F(r,n);s({store:r,key:l,signal:i},()=>{e({key:t,child:n,source:o},s)})})},e.using=(e,t)=>{const n=e.namespaceURI,s=e.tagName.toLowerCase(),l='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===s?'foreignObject':'html',i=yt.get(),o={parent:i,signal:i&&i.signal?i.signal:h(),namespace:l,targetElement:e,svgRoot:'svg'===s?e:i?i.svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'using',pure:0,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},mountStatus:'initial',visible:1};yt.replace(o),mt.push({node:e,append:[],reverse:0});try{r(o.signal,t)}finally{b(mt.pop()),yt.replace(i)}},e.visible=K,Object.defineProperty(e,'__esModule',{value:1})}));
((e,t)=>{'object'==typeof exports&&'undefined'!=typeof module?t(exports):'function'==typeof define&&define.amd?define(['exports'],t):t((e=e||self)['effector-dom']={})})(this,(function(e){function t({node:e=[],from:t,source:n,parent:r=t||n,to:s,target:l,child:i=s||l,scope:o={},meta:a={},family:c={type:'regular'}}){const f=$e(r),u=$e(c.links),p=$e(c.owners),d=[],h={};for(let t=0;t<e.length;t++){const n=e[t];n&&(d.push(n),De(n,h))}const g={seq:d,next:$e(i),meta:a,scope:o,family:{type:c.type||'crosslink',links:u,owners:p},reg:h};for(let e=0;e<u.length;e++)Ee(u[e]).push(g);for(let e=0;e<p.length;e++)Ne(p[e]).push(g);for(let e=0;e<f.length;e++)f[e].next.push(g);return g}function n(e,t="combine"){let n=t+'(',r='',s=0;for(const t in e){const l=e[t];if(null!=l&&(n+=r,n+=se(l)?l.compositeName.fullName:l.toString()),s+=1,25===s)break;r=', '}return n+=')',n}function r(e,t){lt={parent:lt,value:e};try{return t()}finally{lt=lt.parent}}function s(e,n){const r=(e,...t)=>r.create(e,t,t);return r.graphite=t({meta:ct('event',r,n,e)}),r.create=e=>(Ye(r,e),e),r.watch=ae(ot,r),r.map=e=>{let t,n;'object'==typeof e&&(t=e,n=e.name,e=e.fn);const l=s(He(r,n),t);return ft(r,l,'map',e),l},r.filter=e=>'function'==typeof e?(console.error('.filter(fn) is deprecated, use .filterMap instead'),l(r,e)):ut(r,'filter',e.fn,[ke({fn:je})]),r.filterMap=ae(l,r),r.prepend=e=>{const t=s('* → '+r.shortName,{parent:r.parent});return ft(t,r,'prepend',e),(({parent:e},t)=>{e&&e.hooks.event(t)})(r,t),t},r.subscribe=e=>ot(r,t=>e.next(t)),r[re]=()=>r,st(r)}function l(e,t){return ut(e,'filterMap',t,[ve({fn:je}),be()])}function i(e,n){const r=Ie(e),l=Ie(e),c=s({named:'updates'}),f={subscribers:new Map,updates:c,defaultState:e,stateRef:r,getState:ae(Oe,r),setState(e){Ye({target:f,params:e,defer:1})}};if(f.graphite=t({scope:{state:r},node:[be(),xe({store:r}),ye({store:l}),xe({store:l})],child:c,meta:ct('store',f,n)}),at&&void 0===e)throw Error("current state can't be undefined, use null instead");return f.watch=f.subscribe=ae(a,f),f.reset=(...e)=>{for(const t of e)f.on(t,()=>f.defaultState);return f},f.on=(e,t)=>(f.off(e),f.subscribers.set(e,nt(pt(e,f,'on',1,t))),f),f.off=ae(o,f),f.map=(e,t)=>{let n,r,s;'object'==typeof e&&(n=e,r=e.name,t=e.firstState,e=e.fn);const l=f.getState();void 0!==l&&(s=e(l,t));const o=i(s,{name:He(f,r),config:n,strict:0});return pt(f,o,'map',0,e),o},f[re]=()=>({subscribe(e){if(e!==Object(e))throw Error('expect observer to be an object');return a(f,t=>{e.next&&e.next(t)})},[re](){return this}}),Ae(f,[c]),st(f)}function o(e,t){const n=e.subscribers.get(t);return void 0!==n&&(n(),e.subscribers.delete(t)),e}function a(e,t,n){if(!n||!se(t)){if('function'!=typeof t)throw Error('watch requires function handler');return t(e.getState()),ot(e,t)}if('function'!=typeof n)throw Error('second argument should be a function');return t.watch(t=>n(e.getState(),t))}function c(...e){if(0===e.length)throw Error('at least one argument required');let t,n,r,s,l;'ɔ'in e[0]&&(r=e[0].config,e=e[0].ɔ);{const r=e[e.length-1];'function'==typeof r?(n=e.slice(0,-1),t=r):n=e}if(1===n.length){const e=n[0];ie(e)||(s=e,l=1)}return l||(s=n,t&&(t=ht(t))),Array.isArray(s)?gt(s,e=>e.slice(),[],r,t):gt(s,e=>Object.assign({},e),{},r,t)}function f(e,t){const n=kt(e);for(let e=0;e<t.length;e++){const r=kt(t[e]);r.family.type='crosslink';const s=wt(r),l=xt(n);s.includes(n)||s.push(n),l.includes(r)||l.push(r)}}function u(e,t){p(e,t),d(t,e)}function p(e,t){e&&e!==t&&(e.locality.sibling.right.ref=t)}function d(e,t){e&&e!==t&&(e.locality.sibling.left.ref=t)}function h(){const e={stack:null},n=vt.get(),r=t({node:[Et,Nt],parent:[n&&n.signal].filter(Boolean),meta:{unit:'signal'},scope:e});return e.self=r,r}function g(e){switch(e=String(e)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return e.replace(Ct,'')}}function m(e){return String(e).replace(At,'')}function b({node:e,append:t,reverse:n=0}){if(0===t.length)return;const r=_t.createDocumentFragment();if(n){for(let e=t.length-1;e>=0;e--)r.appendChild(t[e]);e.prepend(r)}else{for(let e=0;e<t.length;e++)r.appendChild(t[e]);e.appendChild(r)}}function y(e,t){t.parent=e,t.signal.seq.push(jt),t.signal.scope.stack=t,e.child.push(t)}function v(e,n){return t({node:[$t],parent:e,meta:{op:'watch'},scope:{fn:n},family:{type:'crosslink',owners:[e]}})}function k(){Ft=0,zt()}function w(e,t,n){const r=(e=>'high'===Ut.get(e)?Yt:Gt)(e);let s=r.get(e);if(s||(s=[],r.set(e,s)),t)for(let e=0;e<n.length;e++)s.push(n[e]);else s.push(n);Wt()}function x(e,n,r=0,l="low"){const i=++Bt,o=s(),a=ie(c=e)?c.updates:c;var c;const u={type:'crosslink',owners:[a,o]};return t({node:[tn],parent:[a],scope:{taskID:i,flat:r},family:u}),f(e,[o]),Xt.set(i,t({node:[nn],child:[t({node:[Kt,Qt,en],scope:{taskID:i},family:u}),t({node:[Jt,Qt],child:[o],family:u})],scope:{fn:n},family:u})),Ut.set(i,l),o}function S({trigger:e=s(),fn:n,priority:r="low",timeout:l=1/0,batchWindow:i=0,retries:o=1/0,mark:a=e.shortName}){const c=x(e.map(e=>[{inserted:Vt(),retry:0,value:e}]),(e,t)=>{let r,s=0;const a=[],c=[];for(r=0;r<e.length;r++){const o=e[r],f=Vt();if(o.inserted+i>f){c.push(o);continue}if(o.inserted+l<f)continue;if(f-t>=10){s=1;break}const u=n(o.value);void 0!==u&&a.push(u)}if(s)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=o||c.push(n)}return{done:a,fail:c}},1,r);return{trigger:e,processed:c,connect:n=>{t({node:[],parent:n,child:e,family:{type:'crosslink',owners:[n,e]}})}}}function E({trigger:e=s(),fn:n,priority:r="low",timeout:l=1/0,batchWindow:i=0,retries:o=1/0,mark:a=e.shortName,flatten:c}){const f=x(e.map(e=>{const t=[],n=Vt();for(let r=0;r<e.length;r++){const s=c(e[r]);for(let e=0;e<s.length;e++)t.push({inserted:n,retry:0,value:s[e]})}return t}),(e,t)=>{let r,s=0;const a=[],c=[];for(r=0;r<e.length;r++){const o=e[r],f=Vt();if(o.inserted+i>f){c.push(o);continue}if(o.inserted+l<f)continue;if(f-t>=10){s=1;break}const u=n(o.value);void 0!==u&&a.push(u)}if(s)for(let t=r;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=o||c.push(n)}return{done:a,fail:c}},1,r);return{trigger:e,processed:f,connect:n=>{t({node:[rn],parent:n,child:e,family:{type:'crosslink',owners:[n,e]}})}}}function N(e,t,n){v(e,t.watch(n))}function C(e,n,r){t({node:[sn],parent:n,child:[ln],family:{type:'crosslink',owners:e},scope:{handler:r},meta:{op:'debounceRaf'}}),ie(n)&&Ye(ln,{data:n.getState(),handler:r},1)}function A(e,t,n,r){se(n)?(e?N:C)(t,n,r):r(n)}function I(e,t=e.child.length-1){for(let n=t;n>=0;n--){const t=e.child[n];switch(t.node.type){case'element':case'using':if(!t.visible)continue;return t}const r=I(t);if(r)return r}return null}function O(e){if(!e.parent)return null;switch(e.parent.node.type){case'element':case'using':{const t=I(e.parent,e.parent.child.indexOf(e)-1);if(t)return t;break}case'list':case'listItem':{let t=e,n=e.parent;for(;n;){const e=I(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function R(e){return''!==e&&0!==e&&(0==e||null==e)}function _(e,t,n){R(n)?delete e[t]:e[t]=`${n}`}function j(e,t,n,r){if(n.visible=r,r){if(!t.contains(e)){const r=O(n);r&&t.contains(r.targetElement)?r.targetElement.after(e):t.appendChild(e)}}else e.remove()}function $(e,t,n){if(null===n)return;const r=vt.get().parent.targetElement;C(t,n,j.bind(null,e,r,vt.get()))}function D(e,t,n){if(R(n)){switch(t){case'value':delete e.value;break;case'checked':e.checked=0;break;case'spellcheck':if(0==n)return void e.setAttribute('spellcheck','false')}e.removeAttribute(t)}else{switch(t){case'value':e.value=`${n}`;break;case'checked':e.checked=`${n}`}e.setAttribute(t,`${n}`)}}function P(e,t,n,r,s,l){const i=e.createSVGTransform();switch(l){case'translate':case'scale':r=(e=>ie(e)?e:ie(e.x)?ie(e.y)?c({x:e.x,y:e.y}):e.x.map(fn.bind(null,e.y)):ie(e.y)?e.y.map(un.bind(null,e.x)):e)(r)}A(0,t,r,s.bind(null,i)),n.appendItem(i)}function V(e,t){const n=_t.createTextNode(`${t}`),r=e.firstChild;r?r.replaceWith(n):e.appendChild(n)}function z(e){e.focus()}function M(e){e.blur()}function T(e,t){return e.bind(null,t)}function F(e,t){const n=vt.get();if(Array.isArray(t)){const r=[];for(let n=0;n<t.length;n++)r[n]=e.map(T(q,t[n]));return n&&f(n.signal,r),r}if('object'==typeof t&&null!==t){const r=[],s={};for(const n in t)s[n]=e.map(T(q,t[n])),r.push(s[n]);return n&&f(n.signal,r),s}const r=e.map(T(q,t));return n&&f(n.signal,r),r}function q(e,t){return t[e]}function L(e,n){let r,l,o=0;ie(e)?(l=gn,r=e):(l=T(mn,e.key),r=e.source,o=!!e.reverse);const a=vt.get(),c=h(),u={parent:a,signal:c,namespace:a.namespace,targetElement:a.targetElement,svgRoot:a.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'list',pure:0,reverse:o,key:ie(e)?{type:'index'}:{type:'key',key:e.key},store:r,cb:n},mountStatus:'initial',visible:1};y(a,u),vt.replace(u);const p={parentNode:a.targetElement,cb:n,shortName:r.shortName,reverse:o,parentStack:u,getID:l,fields:e.fields?e.fields:null},d=i(W(p,[],r.getState()));f(c,[d]),v(c,T(yn,d)),((...e)=>{let n,r,l;'ɔ'in e[0]&&(l=e[0].config,e=e[0].ɔ);let[o,a,c,f=0]=e;if(void 0===a&&'source'in o){if('clock'in o&&null==o.clock)throw Error('config.clock should be defined');a=o.clock,c=o.fn,f=o.greedy,n=o.target,r=o.name,o=o.source}if(void 0===a&&(a=o),r=l||r||o.shortName,o=mt(o),a=mt(a),'boolean'==typeof c&&(f=c,c=null),n||(n=ie(o)&&ie(a)?i(c?c(Oe(Ce(o)),Oe(Ce(a))):Oe(Ce(o)),{name:r}):s(r)),ie(o))Ae(o,[st(rt(a,n,{scope:{fn:c},node:[!f&&ge({priority:'sampler'}),me({store:Ce(o),to:c?'a':'stack'}),c&&ve({fn:_e})],meta:{op:'sample',sample:'store'}}))]);else{const e=Ie(0),r=Ie(),s=Ie();st(t({parent:o,node:[xe({store:r}),me({from:'value',store:1,target:e})],family:{owners:[o,n,a],links:n},meta:{op:'sample',sample:'source'}})),Ae(o,[st(rt(a,n,{scope:{fn:c},node:[xe({store:s}),me({store:e}),ke({fn:e=>e}),!f&&ge({priority:'sampler'}),me({store:r}),me({store:s,to:'a'}),c&&ve({fn:Re})],meta:{op:'sample',sample:'clock'}}))])}})({source:d,clock:r,fn:T(W,p),target:d}),vt.replace(a)}function W(e,t,n){const r=Array(n.length).fill(0),s=n.map(e.getID),l=[],o=[],a=[];for(let e=0;e<t.length;e++){const l=t[e],i=l.node,c=s.indexOf(i.key);-1!==c?(o.push(l),r[c]=1,i.store.getState()!==n[c]&&Ye(i.store,n[c],1)):a.push(l)}if(a.length>0){for(let e=0;e<a.length;e++){const t=a[e],{node:n,locality:r}=t;n.active=0,n.store=null,u(r.sibling.left.ref,r.sibling.right.ref),p(t,null),d(t,null)}Ye(bn,a,1)}let c=o.length>0?o[o.length-1]:null;for(let t=0;t<n.length;t++){if(r[t])continue;const s=n[t],a=i(s),p=h(),d=e.fields?F(a,e.fields):null;f(p,[a]);const g=e.getID(s,t),m={parent:e.parentStack,signal:p,namespace:e.parentStack.namespace,targetElement:e.parentStack.targetElement,svgRoot:e.parentStack.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'listItem',pure:0,key:g,index:g,store:a,signal:p,active:1,nodes:[],fields:d,visible:[]},mountStatus:'initial',visible:1};u(c,m),c=m,y(e.parentStack,m),l.push(m),o.push(m)}return l.length>0&&Ye(hn,{context:e,list:l},1),o}function X(e,t,n,r){const s=O(e);s&&r.contains(s.targetElement)?n?s.targetElement.before(t):s.targetElement.after(t):r.appendChild(t)}function Y(e){const t=vt.get();return t&&f(t.signal,[e]),e}function G(e){const t=vt.get();if('element'!==t.node.type&&'using'!==t.node.type)throw Error(`"${e}" extension can be used only with element nodes, got "${t.node.type}"`)}function U(e){const t=vt.get();t.targetElement.__STATIC__||e(t.targetElement)}function B(e){e.attr&&Z(e.attr),e.data&&H(e.data),e.transform&&J(e.transform),'text'in e&&K(e.text),'visible'in e&&Q(e.visible),(e.style||e.styleVar)&&ee({prop:e.style,val:e.styleVar}),e.focus&&ne(e.focus),e.handler&&te(e.handler)}function Z(e){G('attr'),vt.getElementNode().attr.push(e)}function H(e){G('data'),vt.getElementNode().data.push(e)}function J(e){G('transform'),vt.getElementNode().transform.push(e)}function K(e){G('text'),vt.getElementNode().text.push(e)}function Q(e){const t=vt.get();if('element'!==t.node.type&&'using'!==t.node.type&&'listItem'!==t.node.type)throw Error(`"visible" extension can be used only with element or listItem nodes, got "${t.node.type}"`);vt.getElementNode().visible.push(e)}function ee({prop:e,val:t}){G('style'),e&&vt.getElementNode().styleProp.push(e),t&&vt.getElementNode().styleVar.push(t)}function te(e,t){G('handler'),void 0===t&&(t=e,e={});const{passive:n=1,capture:r=0}=e;vt.getElementNode().handler.push({options:{passive:n,capture:r},map:t})}function ne({focus:e,blur:t}){G('focus');const n=vt.getElementNode();e&&n.focus.push(e),t&&n.blur.push(t)}var re=(()=>{var e,t=('undefined'!=typeof self?self:'undefined'!=typeof window?window:'undefined'!=typeof global?global:'undefined'!=typeof module?module:Function("","return this")()).Symbol;return'function'==typeof t?t.observable?e=t.observable:(e=t('observable'),t.observable=e):e='@@observable',e})();const se=e=>('function'==typeof e||'object'==typeof e&&null!==e)&&'kind'in e,le=e=>t=>se(t)&&t.kind===e,ie=le('store'),oe=le('domain'),ae=(e,t)=>e.bind(null,t),ce=(e,t,n)=>e.bind(null,t,n),fe=()=>{let e=0;return()=>(++e).toString(36)},ue=fe(),pe=fe(),de=(e,t,n)=>({id:pe(),type:e,data:n,hasRef:t});let he=0;const ge=({priority:e="barrier"})=>de('barrier',0,{barrierID:++he,priority:e}),me=({from:e="store",store:t,target:n,to:r=(n?'store':'stack')})=>de('mov','store'===e,{from:e,store:t,to:r,target:n}),be=()=>de('check',0,{type:'defined'}),ye=({store:e})=>de('check',1,{type:'changed',store:e}),ve=ce(de,'compute',0),ke=ce(de,'filter',0),we=ce(de,'run',0),xe=({store:e})=>me({from:'stack',target:e}),Se=e=>e.graphite||e,Ee=e=>e.family.owners,Ne=e=>e.family.links,Ce=e=>e.stateRef,Ae=(e,t)=>{const n=Se(e);for(let e=0;e<t.length;e++){const r=Se(t[e]);'domain'!==n.family.type&&(r.family.type='crosslink'),Ee(r).push(n),Ne(n).push(r)}},Ie=e=>({id:pe(),current:e}),Oe=({current:e})=>e,Re=(e,{fn:t},{a:n})=>t(e,n),_e=(e,{fn:t},{a:n})=>t(n,e),je=(e,{fn:t})=>t(e),$e=(e=[])=>{const t=[];if(Array.isArray(e))for(let n=0;n<e.length;n++)Array.isArray(e[n])?t.push(...e[n]):t.push(e[n]);else t.push(e);return t.map(Se)},De=({hasRef:e,type:t,data:n},r)=>{let s;e&&(s=n.store,r[s.id]=s),'mov'===t&&'store'===n.to&&(s=n.target,r[s.id]=s)};let Pe=null;const Ve=(e,t)=>{if(!e)return t;if(!t)return e;let n;const r=e.v.type===t.v.type;return(r&&e.v.id>t.v.id||!r&&'sampler'===e.v.type)&&(n=e,e=t,t=n),n=Ve(e.r,t),e.r=e.l,e.l=n,e},ze=[];let Me=0;for(;Me<5;)ze.push({first:null,last:null,size:0}),Me+=1;const Te=()=>{for(let e=0;e<5;e++){const t=ze[e];if(t.size>0){if(2===e||3===e){t.size-=1;const e=Pe.v;return Pe=Ve(Pe.l,Pe.r),e}1===t.size&&(t.last=null);const n=t.first;return t.first=n.right,t.size-=1,n.value}}},Fe=(e,t,n,r)=>qe(0,{a:null,b:null,node:t,parent:n,value:r},e),qe=(e,t,n,r=0)=>{const s=Le(n),l=ze[s],i={idx:e,stack:t,type:n,id:r};if(2===s||3===s)Pe=Ve(Pe,{v:i,l:0,r:0});else{const e={right:null,value:i};0===l.size?l.first=e:l.last.right=e,l.last=e}l.size+=1},Le=e=>{switch(e){case'child':return 0;case'pure':return 1;case'barrier':return 2;case'sampler':return 3;case'effect':return 4;default:return-1}},We=new Set;let Xe=0;const Ye=(e,t,n)=>{if(e.target&&(t=e.params,n=e.defer,e=e.target),Array.isArray(e))for(let n=0;n<e.length;n++)Fe('pure',Se(e[n]),null,t[n]);else Fe('pure',Se(e),null,t);n&&Xe||(()=>{const e=Xe;Xe=1;const t={stop:0};let n,r;e:for(;r=Te();){const{idx:e,stack:s,type:l}=r;n=s.node;const i={skip:0,fail:0,ref:'',scope:n.scope};for(let r=e;r<n.seq.length&&!t.stop;r++){const o=n.seq[r],a=o.data;switch(o.type){case'barrier':{const t=a.barrierID,n=a.priority;if(r!==e||l!==n){We.has(t)||(We.add(t),qe(r,s,n,t));continue e}We.delete(t);break}case'mov':{let e;switch(a.from){case'stack':e=s.value;break;case'a':e=s.a;break;case'b':e=s.b;break;case'value':e=a.store;break;case'store':e=Oe(n.reg[a.store.id])}switch(a.to){case'stack':s.value=e;break;case'a':s.a=e;break;case'b':s.b=e;break;case'store':n.reg[a.target.id].current=e}break}case'check':switch(a.type){case'defined':i.skip=void 0===s.value;break;case'changed':i.skip=s.value===Oe(n.reg[a.store.id])}break;case'filter':i.skip=!Ge(i,a,s);break;case'run':if(r!==e||'effect'!==l){qe(r,s,'effect');continue e}case'compute':s.value=Ge(i,a,s)}t.stop=i.fail||i.skip}if(!t.stop)for(let e=0;e<n.next.length;e++)Fe('child',n.next[e],s,s.value);t.stop=0}Xe=e})()},Ge=(e,{fn:t},n)=>{try{return t(n.value,e.scope,n)}catch(t){console.error(t),e.fail=1}},Ue=(e,t={})=>(Object(e)===e&&(Ue(e.config,t),null!=e.name&&('object'==typeof e.name?Ue(e.name,t):t.name=e.name),e.loc&&(t.loc=e.loc),e.sid&&(t.sid=e.sid),e.handler&&(t.handler=e.handler),e.parent&&(t.parent=e.parent),'strict'in e&&(t.strict=e.strict),e.named&&(t.named=e.named),Ue(e.ɔ,t)),t),Be=Ue,Ze=(e,t)=>''+e.shortName+t,He=(e,t)=>null==t?Ze(e,' → *'):t,Je=(e,t)=>{const n=e.indexOf(t);-1!==n&&e.splice(n,1)},Ke=(e,t)=>{Je(e.next,t),Je(Ee(e),t),Je(Ne(e),t)},Qe=(e,t,n)=>{let r;e.next.length=0,e.seq.length=0,e.scope=null;let s=Ne(e);for(;r=s.pop();)Ke(r,e),(t||n&&!e.meta.sample||'crosslink'===r.family.type)&&Qe(r,t,n);for(s=Ee(e);r=s.pop();)Ke(r,e),n&&'crosslink'===r.family.type&&Qe(r,t,n)},et=e=>e.clear(),tt=(e,{deep:t}={})=>{let n=0;if(ie(e))et(e.subscribers);else if(oe(e)){n=1;const t=e.history;et(t.events),et(t.effects),et(t.stores),et(t.domains)}Qe(Se(e),!!t,n)},nt=e=>{const t=ce(tt,e,void 0);return t.unsubscribe=t,t},rt=(e,n,{node:r,scope:s,meta:l})=>t({node:r,parent:e,child:n,scope:s,meta:l,family:{owners:[e,n],links:n}}),st=e=>(lt&&Ae(lt.value,[e]),e);let lt=null;const ot=(e,n)=>nt(st(t({scope:{fn:n},node:[we({fn:je})],parent:e,meta:{op:'watch'},family:{owners:e}})));let at;const ct=(e,t,n,r)=>{const s=Be({name:r,config:n}),l=ue(),{parent:i=null,sid:o=null,strict:a=1,named:c=null}=s,f=c||s.name||('domain'===e?'':l),u=((e,t)=>{let n,r,s;const l=e;return t?(s=t.compositeName,0===e.length?(n=s.path,r=s.fullName):(n=s.path.concat([e]),r=0===s.fullName.length?e:s.fullName+'/'+e)):(n=0===e.length?[]:[e],r=e),{shortName:l,fullName:r,path:n}})(f,i);return t.kind=e,t.id=l,t.sid=o,t.shortName=f,t.parent=i,t.compositeName=u,t.defaultConfig=s,t.thru=ae(dt,t),t.getType=()=>u.fullName,at=a,{unit:e,name:f,sid:o,named:c}},ft=(e,t,n,r)=>rt(e,t,{scope:{fn:r},node:[ve({fn:je})],meta:{op:n}}),ut=(e,t,n,r)=>{const l=s(Ze(e,' →? *'));return rt(e,l,{scope:{fn:n},node:r,meta:{op:t}}),l},pt=(e,{graphite:t,stateRef:n},r,s,l)=>rt(e,t,{scope:{fn:l},node:[me({store:n,to:'a'}),ve({fn:s?_e:Re}),be(),ye({store:n}),xe({store:n})],meta:{op:r}}),dt=(e,t)=>t(e),ht=e=>t=>e(...t),gt=(e,t,r,s,l)=>{const o=t(r),a=i(o,{name:s||n(e)}),c=Ie(o),f=Ie(1),u=[be(),me({store:c,to:'a'}),ke({fn:(e,{key:t},{a:n})=>e!==n[t]}),me({store:f,to:'b'}),ve({fn(e,{clone:t,key:n},r){r.b&&(r.a=t(r.a)),r.a[n]=e}}),me({from:'a',target:c}),me({from:'value',store:0,target:f}),ge({priority:'barrier'}),me({from:'value',store:1,target:f}),me({store:c}),l&&ve({fn:l}),ye({store:Ce(a)})];for(const n in e){const s=e[n];ie(s)?(r[n]=s.defaultState,o[n]=s.getState(),rt(s,a,{scope:{key:n,clone:t},node:u,meta:{op:'combine'}})):o[n]=r[n]=s}return a.defaultShape=e,a.defaultState=l?Ce(a).current=l(o):r,a},mt=e=>se(e)?e:c(e),bt=(t({node:[we({fn({fn:e,value:t}){e(t)}})],meta:{op:'fx',fx:'sidechain'}}),ke({fn:(e,{state:t})=>void 0!==e&&e!==Oe(t)}),ve({fn:e=>e}),[]);let yt;const vt={get:()=>yt,replace(e){yt=e},getElementNode:()=>yt.node},kt=e=>e.graphite||e,wt=e=>e.family.owners,xt=e=>e.family.links,St=t({node:[we({fn(e){tt(e)}})]}),Et=ve({fn(e,t){t.self.next.push(St);const{stack:n}=t,{parent:r}=n,{left:s,right:l}=n.locality.sibling;r&&(r.locality.child.last.ref===n&&(r.locality.child.last.ref=s.ref),r.locality.child.first.ref===n&&(r.locality.child.first.ref=l.ref)),s.ref&&s.ref.locality.sibling.right.ref===n&&l.ref&&l.ref.locality.sibling.left.ref===n?u(s.ref,l.ref):s.ref&&s.ref.locality.sibling.right.ref===n?p(s.ref,null):l.ref&&l.ref.locality.sibling.left.ref===n&&d(l.ref,null)}}),Nt=ve({fn:(e,{self:t})=>t}),Ct=/[^a-zA-Z0-9\-]/g,At=/[\\<>"]/g;class It{constructor(){this.properties=Object.create(null)}setProperty(e,t){this.properties[g(e)]=m(t)}removeProperty(e){delete this.properties[g(e)]}}class Ot{constructor(){this.items=[]}appendItem(e){this.items.push(e)}}class Rt{constructor(){this.value=''}setTranslate(e,t){this.value=`translate(${e} ${t})`}setScale(e,t){this.value=`scale(${e} ${t})`}setRotate(e,t,n){this.value=0!==t||0!==n?`rotate(${e} ${t} ${n})`:`rotate(${e})`}setSkewX(e){this.value=`skewX(${e})`}setSkewY(e){this.value=`skewY(${e})`}}(new class{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new It,this.firstChild=null,this.transform={baseVal:new Ot},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}appendChild(e){if(e.parent&&e.remove(),e.isFragment&&null===e.textContent){let t,n=e.firstChild;for(;n;)t=n.sibling.right,this.appendChild(n),n=t}else this.child.last?(this.child.last.sibling.right=e,e.sibling.left=this.child.last):(this.child.first=e,this.firstChild=e),this.child.last=e,e.parent=this}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,e.sibling.right=this.child.first):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}contains(e){let t=e;for(;t;){if(t===this)return 1;t=t.parent}return 0}remove(){if(!this.parent)return;const{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,this.sibling.left.sibling.right=null):(this.sibling.right.sibling.left=this.sibling.left,this.sibling.left.sibling.right=this.sibling.right),this.sibling.left=null,this.sibling.right=null,this.parent=null}addEventListener(e,t,n){}removeEventListener(e,t,n){}setAttribute(e,t){this.attributes[g(e)]=m(t)}removeAttribute(e){delete this.attributes[g(e)]}replaceWith(e){if(!this.parent)return;const{parent:t}=this;e.parent&&e.remove(),t.child.first===this&&t.child.last===this?(t.firstChild=e,t.child.first=e,t.child.last=e):t.child.first===this?(t.child.first=e,t.firstChild=e,this.sibling.right.sibling.left=e):t.child.last===this?(t.child.last=e,this.sibling.left.sibling.right=e):(this.sibling.right.sibling.left=e,this.sibling.left.sibling.right=e),e.sibling.left=this.sibling.left,e.sibling.right=this.sibling.right,e.parent=t,this.sibling.left=null,this.sibling.right=null,this.parent=null}focus(){}blur(){}createSVGTransform(){return new Rt}}).isBody=1;let _t='undefined'!=typeof document?document:null;const jt=ve({fn(e,t){if(!t.stack)return e;const{stack:n}=t;t.stack=null;const r=n.parent.child.indexOf(n);return-1!==r&&n.parent.child.splice(r,1),n.parent=null,e}}),$t=we({fn(e,{fn:t}){t(e)}});let Dt,Pt,Vt;Dt=()=>{},Pt=()=>{},Vt='undefined'!=typeof performance&&performance.now?()=>performance.now():'undefined'!=typeof process&&process.hrtime?()=>{const e=process.hrtime();return(1e9*e[0]+e[1])/1e6}:()=>Date.now();const zt=s();let Mt,Tt=0,Ft=0;const qt='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),Lt='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,Wt=()=>{Ft||(Ft=1,Mt=qt(k))},Xt=new Map,Yt=new Map,Gt=new Map,Ut=new Map;let Bt=0,Zt=0;const Ht=t({node:[we({fn:()=>{}}),ke({fn:()=>0===Yt.size&&0===Gt.size?0:Vt()-Zt>=10?0:(Lt(Mt),Tt=1,Ft=0,1)})],child:[zt]});zt.watch(()=>{if(Ft)return;if(0===Yt.size&&0===Gt.size)return void(Tt=0);let e=0;Tt||(Zt=Vt()),Tt=0;for(const[t,n]of Yt){if(Vt()-Zt>=10){Wt(),e=1;break}Yt.delete(t),Ye({target:Xt.get(t),params:n,defer:1})}if(!e)for(const[t,n]of Gt){if(Vt()-Zt>=10){Wt(),e=1;break}Gt.delete(t),Ye({target:Xt.get(t),params:n,defer:1})}Ye({target:Ht,params:null,defer:1})});const Jt=ve({fn:({done:e})=>e}),Kt=ve({fn:({fail:e})=>e}),Qt=ke({fn:e=>e.length>0}),en=ve({fn(e,{taskID:t}){w(t,1,e)}}),tn=ve({fn(e,{taskID:t,flat:n}){w(t,n,e)}}),nn=we({fn:(e,{fn:t})=>t(e,Zt)}),rn=ve({fn:e=>[e]}),sn=we({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:ln}=S({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),on=(e,{map:t,options:n})=>{for(const r in t)e.removeEventListener(r,t[r],n)},an=(e,t,n)=>{R(n)?delete e[t]:e[t]=n},cn=(e,t,n)=>{R(n)?e.removeProperty(t):e.setProperty(t,n)},fn=(e,t)=>({x:t,y:e}),un=(e,t)=>({x:e,y:t}),pn={translate(e,{x:t=0,y:n=0}){e.setTranslate(t,n)},scale(e,{x:t=0,y:n=0}){e.setScale(t,n)},rotate(e,t){'number'==typeof t?e.setRotate(t,0,0):e.setRotate(t.angle||0,t.x||0,t.y||0)},skewX(e,t){e.setSkewX(t)},skewY(e,t){e.setSkewY(t)}},{trigger:dn}=S({mark:'append DOM nodes',fn:e=>{for(let t=0;t<e.append.length;t++){const n=e.append[t];if(0==n.listItem.active)continue;if(0===n.appended.length)continue;const r=_t.createDocumentFragment();if(e.reverse)for(let e=n.appended.length-1;e>=0;e--)r.appendChild(n.appended[e]);else for(let e=0;e<n.appended.length;e++)r.appendChild(n.appended[e]);X(n.listItemStack,r,e.reverse,e.node)}}}),{trigger:hn}=S({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:s,cb:l,reverse:i}=e,o=vt.get();vt.replace(n);const a=[],c=[];bt.push({node:s,append:c,reverse:i});for(let e=0;e<t.length;e++){const n=t[e],o=n.node;if(o.active){vt.replace(n),r(n.signal,T(l,o));for(let e=0;e<c.length;e++)o.nodes.push(c[e]);o.visible.length>0?r(n.signal,()=>{const e=o.visible[o.visible.length-1];e.updates.watch(e=>{if(0!=o.active)if(e){const e=_t.createDocumentFragment();if(i)for(let t=o.nodes.length-1;t>=0;t--)e.appendChild(o.nodes[t]);else for(let t=0;t<o.nodes.length;t++)e.appendChild(o.nodes[t]);X(n,e,i,s)}else for(let e=0;e<o.nodes.length;e++)o.nodes[e].remove()}),e.getState()&&a.push({listItemStack:n,appended:c.slice(),listItem:o})}):a.push({listItemStack:n,appended:c.slice(),listItem:o}),c.length=0}}bt.pop(),a.length>0&&Ye({target:dn,params:{node:s,append:a,reverse:i},defer:1}),vt.replace(o)}}),gn=(e,t)=>t,mn=(e,t)=>t[e],bn=s();E({trigger:bn,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&Ye(e,null,0)}}),E({trigger:bn,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const yn=e=>{const t=e.getState();for(let e=0;e<t.length;e++){const n=t[e].node;n.active=0,n.store=null}Ye(bn,t,1)};e.attr=Z,e.combine=({source:e,fn:t})=>(console.error('separate combine method is deprecated, use common combine method as usual'),Y(c(e,t))),e.data=H,e.explicitUnmount=e=>{const n=vt.get();n&&t({node:[],parent:e,child:n.signal,family:{type:'crosslink',owners:[n.signal,e]}})},e.focus=ne,e.h=(e,t,n)=>{'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:s=0}=t,l=vt.get(),i=l?l.namespace:'html';let o=i,a='html';'type'in t?(a=t.type,o=t.type):o=a='svg'===i?'svg':'html','svg'===e&&(a='svg',o='svg');const c='svg'===a?_t.createElementNS('http://www.w3.org/2000/svg',e):_t.createElement(e);'foreignObject'===i?(c.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),o='html'):'svg'===e?(c.setAttribute('xmlns','http://www.w3.org/2000/svg'),o='svg'):'foreignObject'===e&&(o='foreignObject');const f=h(),u={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},p={parent:null,signal:f,namespace:o,targetElement:c,svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:u,mountStatus:'initial',visible:1};l&&y(l,p),'svg'===e?p.svgRoot=c:l&&(p.svgRoot=l.svgRoot),vt.replace(p),n?((e,t,n,s)=>{let l=0;bt.push({node:t,append:[],reverse:0});try{r(e,s),l=1}finally{b(bt.pop()),l||vt.replace(n)}})(f,c,l,n):(u.pure=1,B(t));const d=(()=>{const e=(()=>{const e=vt.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:e.handler,transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.attr.length;n++){const r=e.attr[n];for(const e in r)t.attr[e]=r[e]}for(let n=0;n<e.data.length;n++){const r=e.data[n];for(const e in r)t.data[e]=r[e]}e.visible.length>0&&(t.visible=e.visible[e.visible.length-1]),e.text.length>0&&(t.text=e.text[e.text.length-1]);for(let n=0;n<e.styleVar.length;n++){const r=e.styleVar[n];for(const e in r)t.styleVar[e]=r[e]}for(let n=0;n<e.styleProp.length;n++){const r=e.styleProp[n];for(const e in r)t.styleProp[e]=r[e]}return t})(),t=vt.get(),n=t.targetElement,r=t.signal;return((e,t,n)=>{for(const r in n)A('value'!==r&&'checked'!==r&&'min'!==r&&'max'!==r,t,n[r],D.bind(null,e,r))})(n,r,e.attr),((e,t,n)=>{for(const r in n)A(0,t,n[r],_.bind(null,e.dataset,r))})(n,r,e.data),((e,t,n)=>{for(let r=0;r<n.length;r++){const{options:s,map:l}=n[r];for(const t in l)e.addEventListener(t,l[t],s);v(t,on.bind(null,e,n[r]))}})(n,r,e.handler),((e,t,n)=>{const r=e.style;for(const e in n)A(0,t,n[e],an.bind(null,r,e))})(n,r,e.styleProp),((e,t,n)=>{const r=e.style;for(const e in n)A(0,t,n[e],cn.bind(null,r,`--${e}`))})(n,r,e.styleVar),((e,t,n)=>{const r=vt.get();if('svg'!==r.namespace)return;if(0===n.length)return;const s=e.transform.baseVal,l=r.svgRoot;for(let e=0;e<n.length;e++){const r=n[e];for(const e in r)P(l,t,s,r[e],pn[e],e)}})(n,r,e.transform),((e,t,n)=>{null!==n&&(se(n)?C(t,n,V.bind(null,e)):V(e,n))})(n,r,e.text),$(n,r,e.visible),((e,t,n)=>{for(let r=0;r<n.length;r++)A(1,t,n[r],z.bind(null,e))})(n,r,e.focus),((e,t,n)=>{for(let r=0;r<n.length;r++)A(1,t,n[r],M.bind(null,e))})(n,r,e.blur),e})();vt.replace(l),p.visible=!d.visible||d.visible.getState(),s||bt.length>0&&p.visible&&bt[bt.length-1].append.push(c)},e.handler=te,e.list=L,e.map=(e,{fn:t})=>(console.error('separate map method is deprecated, use store.map as usual'),Y(e.map(t))),e.node=U,e.nodeMethod=e=>{let t;return U(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}},e.remap=F,e.signalOwn=Y,e.spec=B,e.storeField=(e,t)=>{const n=e.map(T(q,t)),r=vt.get();return r&&f(r.signal,[n]),n},e.style=ee,e.text=K,e.transform=J,e.tree=function e({key:t,child:n,source:r},s){L({source:r,key:t},({store:r,key:l,signal:i})=>{const o=F(r,n);s({store:r,key:l,signal:i},()=>{e({key:t,child:n,source:o},s)})})},e.using=(e,t)=>{const n=e.namespaceURI,s=e.tagName.toLowerCase(),l='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===s?'foreignObject':'html',i=vt.get(),o={parent:i,signal:i&&i.signal?i.signal:h(),namespace:l,targetElement:e,svgRoot:'svg'===s?e:i?i.svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'using',pure:0,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},mountStatus:'initial',visible:1};vt.replace(o),bt.push({node:e,append:[],reverse:0});try{r(o.signal,t)}finally{b(bt.pop()),vt.replace(i)}},e.variant=(e,t)=>{L({source:i(Object.entries(t).map(([e,t])=>({key:e,val:t}))),key:'key',fields:['key','val']},({fields:[t,n]})=>{B({visible:c(t,e,(e,t)=>e===t)}),n.getState()()})},e.visible=Q,Object.defineProperty(e,'__esModule',{value:1})}));
//# sourceMappingURL=effector-dom.umd.js.map

@@ -101,3 +101,6 @@ import {Store, Event, Step} from 'effector'

): void
export function variant<Case extends string>(
key: Store<Case>,
cases: Partial<{[K in Case]: () => void}>,
): void
export function list<T>(

@@ -104,0 +107,0 @@ source: Store<T[]>,

{
"name": "effector-dom",
"version": "0.0.8",
"version": "0.0.9",
"description": "Effector package for working with dom",

@@ -5,0 +5,0 @@ "main": "effector-dom.cjs.js",

@@ -1,2 +0,2 @@

function e(e){return`-${e.toLowerCase()}`}function t(e){switch(e){case'&':return'&amp;';case'<':return'&lt;';case'>':return'&gt;';case'"':return'&quot;';case"'":return'&#39;';default:return e}}function n(e){switch(e=String(e)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return e.replace(J,'')}}function s(e){return String(e).replace(K,'')}function r(){return new te}function i(t){const r=[];(function t(r,i){if(null!==r.textContent&&i.push(r.textContent),r.isFragment){let e=r.firstChild;for(;e;)t(e,i),e=e.sibling.right;return}i.push('<',r.tagName);for(const e in r.attributes)i.push(' ',e,'=','"',s(r.attributes[e]),'"');for(const t in r.dataset)i.push(' ','data-',n(t).replace(Q,e),'=','"',s(r.dataset[t]),'"');const l=[];for(const e in r.style.properties)if(e.startsWith('--'))l.push(`${e}: ${r.style.properties[e]}`);else{const t=e.replace(/[A-Z]/,e=>`-${e.toLowerCase()}`);l.push(`${t}: ${r.style.properties[e]}`)}if(l.length>0&&i.push(' ','style','=','"',l.join(';'),'"'),r.transform.baseVal.items.length>0){i.push(' ','transform','=','"');const e=r.transform.baseVal.items.map(({value:e})=>e);i.push(e.join(' '),'"')}if(!r.firstChild)return void i.push('meta'===r.tagName||'link'===r.tagName?'>':'/>');i.push('>');let o=r.firstChild;for(;o;)t(o,i),o=o.sibling.right;i.push('</',r.tagName,'>')})(t,r);const i=r.join('');return function e(t){if('html'===t.tagName)return 1;if(t.isFragment&&null===t.textContent){const n=t.firstChild;if(n&&t.child.last===n)return e(n)}return 0}(t)?`<!DOCTYPE html>${i}`:i}function l(e,t){const n=fe(e);for(let e=0;e<t.length;e++){const s=fe(t[e]);s.family.type='crosslink';const r=pe(s),i=he(n);r.includes(n)||r.push(n),i.includes(s)||i.push(s)}}function o(e,t){a(e,t),c(t,e)}function a(e,t){e&&e!==t&&(e.locality.sibling.right.ref=t)}function c(e,t){e&&e!==t&&(e.locality.sibling.left.ref=t)}function u(){const e={stack:null},t=ue.get(),n=effector.createNode({node:[ge,me],parent:[t&&t.signal].filter(Boolean),meta:{unit:'signal'},scope:e});return e.self=n,n}function f(e,t){const n=e.namespaceURI,s=e.tagName.toLowerCase(),r='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===s?'foreignObject':'html',i=ue.get(),l={parent:i,signal:i&&i.signal?i.signal:u(),namespace:r,targetElement:e,svgRoot:'svg'===s?e:i?i.svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'using',pure:0,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},mountStatus:'initial',visible:1};ue.replace(l),ae.push({node:e,append:[],reverse:0});try{effector.withRegion(l.signal,t)}finally{p(ae.pop()),ue.replace(i)}}function p({node:e,append:t,reverse:n=0}){if(0===t.length)return;const s=oe.createDocumentFragment();if(n){for(let e=t.length-1;e>=0;e--)s.appendChild(t[e]);e.prepend(s)}else{for(let e=0;e<t.length;e++)s.appendChild(t[e]);e.appendChild(s)}}function h(e,t){t.parent=e,t.signal.seq.push(be),t.signal.scope.stack=t,e.child.push(t)}function d(e,t){return effector.createNode({node:[ye],parent:e,meta:{op:'watch'},scope:{fn:t},family:{type:'crosslink',owners:[e]}})}function g(){Se=0,xe()}function m(e,t,n){const s=(e=>'high'===Oe.get(e)?Ae:Ie)(e);let r=s.get(e);if(r||(r=[],s.set(e,r)),t)for(let e=0;e<n.length;e++)r.push(n[e]);else r.push(n);$e()}function b(e,t,n=0,s="low"){const r=++Pe,i=effector.createEvent(),o=effector.is.store(a=e)?a.updates:a;var a;const c={type:'crosslink',owners:[o,i]};return effector.createNode({node:[Le],parent:[o],scope:{taskID:r,flat:n},family:c}),l(e,[i]),Re.set(r,effector.createNode({node:[qe],child:[effector.createNode({node:[Te,je,Me],scope:{taskID:r},family:c}),effector.createNode({node:[Fe,je],child:[i],family:c})],scope:{fn:t},family:c})),Oe.set(r,s),i}function y({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:r=0,retries:i=1/0,mark:l=e.shortName}){const o=b(e.map(e=>[{inserted:ke(),retry:0,value:e}]),(e,n)=>{let l,o=0;const a=[],c=[];for(l=0;l<e.length;l++){const i=e[l],u=ke();if(i.inserted+r>u){c.push(i);continue}if(i.inserted+s<u)continue;if(u-n>=10){o=1;break}const f=t(i.value);void 0!==f&&a.push(f)}if(o)for(let t=l;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=i||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:o,connect:t=>{effector.createNode({node:[],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function v({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:r=0,retries:i=1/0,mark:l=e.shortName,flatten:o}){const a=b(e.map(e=>{const t=[],n=ke();for(let s=0;s<e.length;s++){const r=o(e[s]);for(let e=0;e<r.length;e++)t.push({inserted:n,retry:0,value:r[e]})}return t}),(e,n)=>{let l,o=0;const a=[],c=[];for(l=0;l<e.length;l++){const i=e[l],u=ke();if(i.inserted+r>u){c.push(i);continue}if(i.inserted+s<u)continue;if(u-n>=10){o=1;break}const f=t(i.value);void 0!==f&&a.push(f)}if(o)for(let t=l;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=i||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:a,connect:t=>{effector.createNode({node:[ze],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function w(e,t,n){d(e,t.watch(n))}function k(e,t,n){effector.createNode({node:[We],parent:t,child:[Ye],family:{type:'crosslink',owners:e},scope:{handler:n},meta:{op:'debounceRaf'}}),effector.is.store(t)&&effector.launch(Ye,{data:t.getState(),handler:n},1)}function x(e,t,n,s){effector.is.unit(n)?(e?w:k)(t,n,s):s(n)}function N(e,t=e.child.length-1){for(let n=t;n>=0;n--){const t=e.child[n];switch(t.node.type){case'element':case'using':if(!t.visible)continue;return t}const s=N(t);if(s)return s}return null}function E(e){if(!e.parent)return null;switch(e.parent.node.type){case'element':case'using':{const t=N(e.parent,e.parent.child.indexOf(e)-1);if(t)return t;break}case'list':case'listItem':{let t=e,n=e.parent;for(;n;){const e=N(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function S(e){return''!==e&&0!==e&&(0==e||null==e)}function C(e,t,n){S(n)?delete e[t]:e[t]=`${n}`}function _(e,t,n,s){if(n.visible=s,s){if(!t.contains(e)){const s=E(n);s&&t.contains(s.targetElement)?s.targetElement.after(e):t.appendChild(e)}}else e.remove()}function $(e,t,n){if(null===n)return;const s=ue.get().parent.targetElement;k(t,n,_.bind(null,e,s,ue.get()))}function R(e,t,n){if(S(n)){switch(t){case'value':delete e.value;break;case'checked':e.checked=0;break;case'spellcheck':if(0==n)return void e.setAttribute('spellcheck','false')}e.removeAttribute(t)}else{switch(t){case'value':e.value=`${n}`;break;case'checked':e.checked=`${n}`}e.setAttribute(t,`${n}`)}}function A(e,t,n,s,r,i){const l=e.createSVGTransform();switch(i){case'translate':case'scale':s=(e=>effector.is.store(e)?e:effector.is.store(e.x)?effector.is.store(e.y)?effector.combine({x:e.x,y:e.y}):e.x.map(Ze.bind(null,e.y)):effector.is.store(e.y)?e.y.map(Be.bind(null,e.x)):e)(s)}x(0,t,s,r.bind(null,l)),n.appendItem(l)}function I(e,t){const n=oe.createTextNode(`${t}`),s=e.firstChild;s?s.replaceWith(n):e.appendChild(n)}function O(e){e.focus()}function P(e){e.blur()}function V(e,t){return e.bind(null,t)}function D(e,t){const n=ue.get();if(Array.isArray(t)){const s=[];for(let n=0;n<t.length;n++)s[n]=e.map(V(F,t[n]));return n&&l(n.signal,s),s}if('object'==typeof t&&null!==t){const s=[],r={};for(const n in t)r[n]=e.map(V(F,t[n])),s.push(r[n]);return n&&l(n.signal,s),r}const s=e.map(V(F,t));return n&&l(n.signal,s),s}function F(e,t){return t[e]}function T(e,t){let n,s,r=0;effector.is.store(e)?(s=Qe,n=e):(s=V(et,e.key),n=e.source,r=!!e.reverse);const i=ue.get(),o=u(),a={parent:i,signal:o,namespace:i.namespace,targetElement:i.targetElement,svgRoot:i.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'list',pure:0,reverse:r,key:effector.is.store(e)?{type:'index'}:{type:'key',key:e.key},store:n,cb:t},mountStatus:'initial',visible:1};h(i,a),ue.replace(a);const c={parentNode:i.targetElement,cb:t,shortName:n.shortName,reverse:r,parentStack:a,getID:s,fields:e.fields?e.fields:null},f=effector.createStore(j(c,[],n.getState()));l(o,[f]),d(o,V(nt,f)),effector.sample({source:f,clock:n,fn:V(j,c),target:f}),ue.replace(i)}function j(e,t,n){const s=Array(n.length).fill(0),r=n.map(e.getID),i=[],f=[],p=[];for(let e=0;e<t.length;e++){const i=t[e],l=i.node,o=r.indexOf(l.key);-1!==o?(f.push(i),s[o]=1,l.store.getState()!==n[o]&&effector.launch(l.store,n[o],1)):p.push(i)}if(p.length>0){for(let e=0;e<p.length;e++){const t=p[e],{node:n,locality:s}=t;n.active=0,n.store=null,o(s.sibling.left.ref,s.sibling.right.ref),a(t,null),c(t,null)}effector.launch(tt,p,1)}let d=f.length>0?f[f.length-1]:null;for(let t=0;t<n.length;t++){if(s[t])continue;const r=n[t],a=effector.createStore(r),c=u(),p=e.fields?D(a,e.fields):null;l(c,[a]);const g=e.getID(r,t),m={parent:e.parentStack,signal:c,namespace:e.parentStack.namespace,targetElement:e.parentStack.targetElement,svgRoot:e.parentStack.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'listItem',pure:0,key:g,index:g,store:a,signal:c,active:1,nodes:[],fields:p},mountStatus:'initial',visible:1};o(d,m),d=m,h(e.parentStack,m),i.push(m),f.push(m)}return i.length>0&&effector.launch(Ke,{context:e,list:i},1),f}function M(e){const t=ue.get();return t&&l(t.signal,[e]),e}function L(){const e=ue.get();if('element'!==e.node.type&&'using'!==e.node.type)throw Error(`this extension can be used only with element nodes, got "${e.node.type}"`)}function q(e){const t=ue.get();t.targetElement.__STATIC__||e(t.targetElement)}function z(e){e.attr&&W(e.attr),e.data&&Y(e.data),e.transform&&U(e.transform),'text'in e&&X(e.text),'visible'in e&&G(e.visible),(e.style||e.styleVar)&&Z({prop:e.style,val:e.styleVar}),e.focus&&H(e.focus),e.handler&&B(e.handler)}function W(e){L(),ue.getElementNode().attr.push(e)}function Y(e){L(),ue.getElementNode().data.push(e)}function U(e){L(),ue.getElementNode().transform.push(e)}function X(e){L(),ue.getElementNode().text.push(e)}function G(e){L(),ue.getElementNode().visible.push(e)}function Z({prop:e,val:t}){L(),e&&ue.getElementNode().styleProp.push(e),t&&ue.getElementNode().styleVar.push(t)}function B(e,t){L(),void 0===t&&(t=e,e={});const{passive:n=1,capture:s=0}=e;ue.getElementNode().handler.push({options:{passive:n,capture:s},map:t})}function H({focus:e,blur:t}){L();const n=ue.getElementNode();e&&n.focus.push(e),t&&n.blur.push(t)}Object.defineProperty(exports,'__esModule',{value:1});var effector=require('effector');const J=/[^a-zA-Z0-9\-]/g,K=/[\\<>"]/g,Q=/[A-Z]/g,ee=/[&<>'"]/g;class te{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new ne,this.firstChild=null,this.transform={baseVal:new se},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}appendChild(e){if(e.parent&&e.remove(),e.isFragment&&null===e.textContent){let t,n=e.firstChild;for(;n;)t=n.sibling.right,this.appendChild(n),n=t}else this.child.last?(this.child.last.sibling.right=e,e.sibling.left=this.child.last):(this.child.first=e,this.firstChild=e),this.child.last=e,e.parent=this}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,e.sibling.right=this.child.first):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}contains(e){let t=e;for(;t;){if(t===this)return 1;t=t.parent}return 0}remove(){if(!this.parent)return;const{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,this.sibling.left.sibling.right=null):(this.sibling.right.sibling.left=this.sibling.left,this.sibling.left.sibling.right=this.sibling.right),this.sibling.left=null,this.sibling.right=null,this.parent=null}addEventListener(e,t,n){}removeEventListener(e,t,n){}setAttribute(e,t){this.attributes[n(e)]=s(t)}removeAttribute(e){delete this.attributes[n(e)]}replaceWith(e){if(!this.parent)return;const{parent:t}=this;e.parent&&e.remove(),t.child.first===this&&t.child.last===this?(t.firstChild=e,t.child.first=e,t.child.last=e):t.child.first===this?(t.child.first=e,t.firstChild=e,this.sibling.right.sibling.left=e):t.child.last===this?(t.child.last=e,this.sibling.left.sibling.right=e):(this.sibling.right.sibling.left=e,this.sibling.left.sibling.right=e),e.sibling.left=this.sibling.left,e.sibling.right=this.sibling.right,e.parent=t,this.sibling.left=null,this.sibling.right=null,this.parent=null}focus(){}blur(){}createSVGTransform(){return new re}}class ne{constructor(){this.properties=Object.create(null)}setProperty(e,t){this.properties[n(e)]=s(t)}removeProperty(e){delete this.properties[n(e)]}}class se{constructor(){this.items=[]}appendItem(e){this.items.push(e)}}class re{constructor(){this.value=''}setTranslate(e,t){this.value=`translate(${e} ${t})`}setScale(e,t){this.value=`scale(${e} ${t})`}setRotate(e,t,n){this.value=0!==t||0!==n?`rotate(${e} ${t} ${n})`:`rotate(${e})`}setSkewX(e){this.value=`skewX(${e})`}setSkewY(e){this.value=`skewY(${e})`}}const ie=new te;ie.isBody=1;var le={__proto__:null,body:ie,createTextNode:e=>{const n=new te;return n.textContent=String(e).replace(ee,t),n},createElement:e=>{const t=new te;return t.tagName=n(e),t.isFragment=0,t},createElementNS:(e,t)=>{switch(e){case'http://www.w3.org/1999/xhtml':case'http://www.w3.org/2000/svg':break;default:e='http://www.w3.org/1999/xhtml'}const s=new te;return s.tagName=n(t),s.namespaceURI=e,s.isFragment=0,s},createDocumentFragment:r,render:i};let oe='undefined'!=typeof document?document:null;const ae=[];let ce;const ue={get:()=>ce,replace(e){ce=e},getElementNode:()=>ce.node},fe=e=>e.graphite||e,pe=e=>e.family.owners,he=e=>e.family.links,de=effector.createNode({node:[effector.step.run({fn(e){effector.clearNode(e)}})]}),ge=effector.step.compute({fn(e,t){t.self.next.push(de);const{stack:n}=t,{parent:s}=n,{left:r,right:i}=n.locality.sibling;s&&(s.locality.child.last.ref===n&&(s.locality.child.last.ref=r.ref),s.locality.child.first.ref===n&&(s.locality.child.first.ref=i.ref)),r.ref&&r.ref.locality.sibling.right.ref===n&&i.ref&&i.ref.locality.sibling.left.ref===n?o(r.ref,i.ref):r.ref&&r.ref.locality.sibling.right.ref===n?a(r.ref,null):i.ref&&i.ref.locality.sibling.left.ref===n&&c(i.ref,null)}}),me=effector.step.compute({fn:(e,{self:t})=>t}),be=effector.step.compute({fn(e,t){if(!t.stack)return e;const{stack:n}=t;t.stack=null;const s=n.parent.child.indexOf(n);return-1!==s&&n.parent.child.splice(s,1),n.parent=null,e}}),ye=effector.step.run({fn(e,{fn:t}){t(e)}});let ve,we,ke;ve=()=>{},we=()=>{},ke='undefined'!=typeof performance&&performance.now?()=>performance.now():'undefined'!=typeof process&&process.hrtime?()=>{const e=process.hrtime();return(1e9*e[0]+e[1])/1e6}:()=>Date.now();const xe=effector.createEvent();let Ne,Ee=0,Se=0;const Ce='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),_e='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,$e=()=>{Se||(Se=1,Ne=Ce(g))},Re=new Map,Ae=new Map,Ie=new Map,Oe=new Map;let Pe=0,Ve=0;const De=effector.createNode({node:[effector.step.run({fn:()=>{}}),effector.step.filter({fn:()=>0===Ae.size&&0===Ie.size?0:ke()-Ve>=10?0:(_e(Ne),Ee=1,Se=0,1)})],child:[xe]});xe.watch(()=>{if(Se)return;if(0===Ae.size&&0===Ie.size)return void(Ee=0);let e=0;Ee||(Ve=ke()),Ee=0;for(const[t,n]of Ae){if(ke()-Ve>=10){$e(),e=1;break}Ae.delete(t),effector.launch({target:Re.get(t),params:n,defer:1})}if(!e)for(const[t,n]of Ie){if(ke()-Ve>=10){$e(),e=1;break}Ie.delete(t),effector.launch({target:Re.get(t),params:n,defer:1})}effector.launch({target:De,params:null,defer:1})});const Fe=effector.step.compute({fn:({done:e})=>e}),Te=effector.step.compute({fn:({fail:e})=>e}),je=effector.step.filter({fn:e=>e.length>0}),Me=effector.step.compute({fn(e,{taskID:t}){m(t,1,e)}}),Le=effector.step.compute({fn(e,{taskID:t,flat:n}){m(t,n,e)}}),qe=effector.step.run({fn:(e,{fn:t})=>t(e,Ve)}),ze=effector.step.compute({fn:e=>[e]}),We=effector.step.run({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:Ye}=y({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),Ue=(e,{map:t,options:n})=>{for(const s in t)e.removeEventListener(s,t[s],n)},Xe=(e,t,n)=>{S(n)?delete e[t]:e[t]=n},Ge=(e,t,n)=>{S(n)?e.removeProperty(t):e.setProperty(t,n)},Ze=(e,t)=>({x:t,y:e}),Be=(e,t)=>({x:e,y:t}),He={translate(e,{x:t=0,y:n=0}){e.setTranslate(t,n)},scale(e,{x:t=0,y:n=0}){e.setScale(t,n)},rotate(e,t){'number'==typeof t?e.setRotate(t,0,0):e.setRotate(t.angle||0,t.x||0,t.y||0)},skewX(e,t){e.setSkewX(t)},skewY(e,t){e.setSkewY(t)}},{trigger:Je}=y({mark:'append DOM nodes',fn:e=>{for(let t=0;t<e.append.length;t++){const n=e.append[t];if(0==n.listItem.active)continue;if(0===n.appended.length)continue;const s=oe.createDocumentFragment();if(e.reverse)for(let e=n.appended.length-1;e>=0;e--)s.appendChild(n.appended[e]);else for(let e=0;e<n.appended.length;e++)s.appendChild(n.appended[e]);const r=E(n.listItemStack);r&&e.node.contains(r.targetElement)?e.reverse?r.targetElement.before(s):r.targetElement.after(s):e.node.appendChild(s)}}}),{trigger:Ke}=y({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:s,cb:r,reverse:i}=e,l=ue.get();ue.replace(n);const o=[],a=[];ae.push({node:s,append:a,reverse:i});for(let e=0;e<t.length;e++){const n=t[e],s=n.node;if(s.active){ue.replace(n),effector.withRegion(n.signal,V(r,s));for(let e=0;e<a.length;e++)s.nodes.push(a[e]);o.push({listItemStack:n,appended:a.slice(),listItem:s}),a.length=0}}ae.pop(),o.length>0&&effector.launch({target:Je,params:{node:s,append:o,reverse:i},defer:1}),ue.replace(l)}}),Qe=(e,t)=>t,et=(e,t)=>t[e],tt=effector.createEvent();v({trigger:tt,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&effector.launch(e,null,0)}}),v({trigger:tt,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const nt=e=>{const t=e.getState();for(let e=0;e<t.length;e++){const n=t[e].node;n.active=0,n.store=null}effector.launch(tt,t,1)};oe=le,exports.attr=W,exports.body=ie,exports.combine=({source:e,fn:t})=>(console.error('separate combine method is deprecated, use common combine method as usual'),M(effector.combine(e,t))),exports.createDocumentFragment=r,exports.data=Y,exports.explicitUnmount=e=>{const t=ue.get();t&&effector.createNode({node:[],parent:e,child:t.signal,family:{type:'crosslink',owners:[t.signal,e]}})},exports.focus=H,exports.h=(e,t,n)=>{'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:s=0}=t,r=ue.get(),i=r?r.namespace:'html';let l=i,o='html';'type'in t?(o=t.type,l=t.type):l=o='svg'===i?'svg':'html','svg'===e&&(o='svg',l='svg');const a='svg'===o?oe.createElementNS('http://www.w3.org/2000/svg',e):oe.createElement(e);'foreignObject'===i?(a.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),l='html'):'svg'===e?(a.setAttribute('xmlns','http://www.w3.org/2000/svg'),l='svg'):'foreignObject'===e&&(l='foreignObject');const c=u(),f={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},g={parent:null,signal:c,namespace:l,targetElement:a,svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:f,mountStatus:'initial',visible:1};r&&h(r,g),'svg'===e?g.svgRoot=a:r&&(g.svgRoot=r.svgRoot),ue.replace(g),n?((e,t,n,s)=>{let r=0;ae.push({node:t,append:[],reverse:0});try{effector.withRegion(e,s),r=1}finally{p(ae.pop()),r||ue.replace(n)}})(c,a,r,n):(f.pure=1,z(t));const m=(()=>{const e=(()=>{const e=ue.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:e.handler,transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.attr.length;n++){const s=e.attr[n];for(const e in s)t.attr[e]=s[e]}for(let n=0;n<e.data.length;n++){const s=e.data[n];for(const e in s)t.data[e]=s[e]}e.visible.length>0&&(t.visible=e.visible[e.visible.length-1]),e.text.length>0&&(t.text=e.text[e.text.length-1]);for(let n=0;n<e.styleVar.length;n++){const s=e.styleVar[n];for(const e in s)t.styleVar[e]=s[e]}for(let n=0;n<e.styleProp.length;n++){const s=e.styleProp[n];for(const e in s)t.styleProp[e]=s[e]}return t})(),t=ue.get(),n=t.targetElement,s=t.signal;return((e,t,n)=>{for(const s in n)x('value'!==s&&'checked'!==s&&'min'!==s&&'max'!==s,t,n[s],R.bind(null,e,s))})(n,s,e.attr),((e,t,n)=>{for(const s in n)x(0,t,n[s],C.bind(null,e.dataset,s))})(n,s,e.data),((e,t,n)=>{for(let s=0;s<n.length;s++){const{options:r,map:i}=n[s];for(const t in i)e.addEventListener(t,i[t],r);d(t,Ue.bind(null,e,n[s]))}})(n,s,e.handler),((e,t,n)=>{const s=e.style;for(const e in n)x(0,t,n[e],Xe.bind(null,s,e))})(n,s,e.styleProp),((e,t,n)=>{const s=e.style;for(const e in n)x(0,t,n[e],Ge.bind(null,s,`--${e}`))})(n,s,e.styleVar),((e,t,n)=>{const s=ue.get();if('svg'!==s.namespace)return;if(0===n.length)return;const r=e.transform.baseVal,i=s.svgRoot;for(let e=0;e<n.length;e++){const s=n[e];for(const e in s)A(i,t,r,s[e],He[e],e)}})(n,s,e.transform),((e,t,n)=>{null!==n&&(effector.is.unit(n)?k(t,n,I.bind(null,e)):I(e,n))})(n,s,e.text),$(n,s,e.visible),((e,t,n)=>{for(let s=0;s<n.length;s++)x(1,t,n[s],O.bind(null,e))})(n,s,e.focus),((e,t,n)=>{for(let s=0;s<n.length;s++)x(1,t,n[s],P.bind(null,e))})(n,s,e.blur),e})();ue.replace(r),g.visible=!m.visible||m.visible.getState(),s||ae.length>0&&g.visible&&ae[ae.length-1].append.push(a)},exports.handler=B,exports.list=T,exports.map=(e,{fn:t})=>(console.error('separate map method is deprecated, use store.map as usual'),M(e.map(t))),exports.node=q,exports.nodeMethod=e=>{let t;return q(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}},exports.remap=D,exports.render=i,exports.renderStatic=e=>{const t=r();return f(t,e),new Promise(e=>setTimeout(e,800)).then(()=>i(t))},exports.signalOwn=M,exports.spec=z,exports.storeField=(e,t)=>{const n=e.map(V(F,t)),s=ue.get();return s&&l(s.signal,[n]),n},exports.style=Z,exports.text=X,exports.transform=U,exports.tree=function e({key:t,child:n,source:s},r){T({source:s,key:t},({store:s,key:i,signal:l})=>{const o=D(s,n);r({store:s,key:i,signal:l},()=>{e({key:t,child:n,source:o},r)})})},exports.using=f,exports.visible=G;
function e(e){return`-${e.toLowerCase()}`}function t(e){switch(e){case'&':return'&amp;';case'<':return'&lt;';case'>':return'&gt;';case'"':return'&quot;';case"'":return'&#39;';default:return e}}function n(e){switch(e=String(e)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return e.replace(K,'')}}function s(e){return String(e).replace(Q,'')}function r(){return new ne}function i(t){const r=[];(function t(r,i){if(null!==r.textContent&&i.push(r.textContent),r.isFragment){let e=r.firstChild;for(;e;)t(e,i),e=e.sibling.right;return}i.push('<',r.tagName);for(const e in r.attributes)i.push(' ',e,'=','"',s(r.attributes[e]),'"');for(const t in r.dataset)i.push(' ','data-',n(t).replace(ee,e),'=','"',s(r.dataset[t]),'"');const l=[];for(const e in r.style.properties)if(e.startsWith('--'))l.push(`${e}: ${r.style.properties[e]}`);else{const t=e.replace(/[A-Z]/,e=>`-${e.toLowerCase()}`);l.push(`${t}: ${r.style.properties[e]}`)}if(l.length>0&&i.push(' ','style','=','"',l.join(';'),'"'),r.transform.baseVal.items.length>0){i.push(' ','transform','=','"');const e=r.transform.baseVal.items.map(({value:e})=>e);i.push(e.join(' '),'"')}if(!r.firstChild)return void i.push('meta'===r.tagName||'link'===r.tagName?'>':'/>');i.push('>');let o=r.firstChild;for(;o;)t(o,i),o=o.sibling.right;i.push('</',r.tagName,'>')})(t,r);const i=r.join('');return function e(t){if('html'===t.tagName)return 1;if(t.isFragment&&null===t.textContent){const n=t.firstChild;if(n&&t.child.last===n)return e(n)}return 0}(t)?`<!DOCTYPE html>${i}`:i}function l(e,t){const n=pe(e);for(let e=0;e<t.length;e++){const s=pe(t[e]);s.family.type='crosslink';const r=he(s),i=de(n);r.includes(n)||r.push(n),i.includes(s)||i.push(s)}}function o(e,t){a(e,t),c(t,e)}function a(e,t){e&&e!==t&&(e.locality.sibling.right.ref=t)}function c(e,t){e&&e!==t&&(e.locality.sibling.left.ref=t)}function u(){const e={stack:null},t=fe.get(),n=effector.createNode({node:[me,be],parent:[t&&t.signal].filter(Boolean),meta:{unit:'signal'},scope:e});return e.self=n,n}function f(e,t){const n=e.namespaceURI,s=e.tagName.toLowerCase(),r='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===s?'foreignObject':'html',i=fe.get(),l={parent:i,signal:i&&i.signal?i.signal:u(),namespace:r,targetElement:e,svgRoot:'svg'===s?e:i?i.svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'using',pure:0,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},mountStatus:'initial',visible:1};fe.replace(l),ce.push({node:e,append:[],reverse:0});try{effector.withRegion(l.signal,t)}finally{p(ce.pop()),fe.replace(i)}}function p({node:e,append:t,reverse:n=0}){if(0===t.length)return;const s=ae.createDocumentFragment();if(n){for(let e=t.length-1;e>=0;e--)s.appendChild(t[e]);e.prepend(s)}else{for(let e=0;e<t.length;e++)s.appendChild(t[e]);e.appendChild(s)}}function h(e,t){t.parent=e,t.signal.seq.push(ye),t.signal.scope.stack=t,e.child.push(t)}function d(e,t){return effector.createNode({node:[ve],parent:e,meta:{op:'watch'},scope:{fn:t},family:{type:'crosslink',owners:[e]}})}function g(){Ce=0,Ee()}function m(e,t,n){const s=(e=>'high'===De.get(e)?Ae:Oe)(e);let r=s.get(e);if(r||(r=[],s.set(e,r)),t)for(let e=0;e<n.length;e++)r.push(n[e]);else r.push(n);Ie()}function b(e,t,n=0,s="low"){const r=++Fe,i=effector.createEvent(),o=effector.is.store(a=e)?a.updates:a;var a;const c={type:'crosslink',owners:[o,i]};return effector.createNode({node:[qe],parent:[o],scope:{taskID:r,flat:n},family:c}),l(e,[i]),Re.set(r,effector.createNode({node:[ze],child:[effector.createNode({node:[je,Me,Le],scope:{taskID:r},family:c}),effector.createNode({node:[Te,Me],child:[i],family:c})],scope:{fn:t},family:c})),De.set(r,s),i}function y({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:r=0,retries:i=1/0,mark:l=e.shortName}){const o=b(e.map(e=>[{inserted:ke(),retry:0,value:e}]),(e,n)=>{let l,o=0;const a=[],c=[];for(l=0;l<e.length;l++){const i=e[l],u=ke();if(i.inserted+r>u){c.push(i);continue}if(i.inserted+s<u)continue;if(u-n>=10){o=1;break}const f=t(i.value);void 0!==f&&a.push(f)}if(o)for(let t=l;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=i||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:o,connect:t=>{effector.createNode({node:[],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function v({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:r=0,retries:i=1/0,mark:l=e.shortName,flatten:o}){const a=b(e.map(e=>{const t=[],n=ke();for(let s=0;s<e.length;s++){const r=o(e[s]);for(let e=0;e<r.length;e++)t.push({inserted:n,retry:0,value:r[e]})}return t}),(e,n)=>{let l,o=0;const a=[],c=[];for(l=0;l<e.length;l++){const i=e[l],u=ke();if(i.inserted+r>u){c.push(i);continue}if(i.inserted+s<u)continue;if(u-n>=10){o=1;break}const f=t(i.value);void 0!==f&&a.push(f)}if(o)for(let t=l;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=i||c.push(n)}return{done:a,fail:c}},1,n);return{trigger:e,processed:a,connect:t=>{effector.createNode({node:[We],parent:t,child:e,family:{type:'crosslink',owners:[t,e]}})}}}function w(e,t,n){d(e,t.watch(n))}function x(e,t,n){effector.createNode({node:[Ye],parent:t,child:[Ue],family:{type:'crosslink',owners:e},scope:{handler:n},meta:{op:'debounceRaf'}}),effector.is.store(t)&&effector.launch(Ue,{data:t.getState(),handler:n},1)}function k(e,t,n,s){effector.is.unit(n)?(e?w:x)(t,n,s):s(n)}function E(e,t=e.child.length-1){for(let n=t;n>=0;n--){const t=e.child[n];switch(t.node.type){case'element':case'using':if(!t.visible)continue;return t}const s=E(t);if(s)return s}return null}function N(e){if(!e.parent)return null;switch(e.parent.node.type){case'element':case'using':{const t=E(e.parent,e.parent.child.indexOf(e)-1);if(t)return t;break}case'list':case'listItem':{let t=e,n=e.parent;for(;n;){const e=E(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function S(e){return''!==e&&0!==e&&(0==e||null==e)}function C(e,t,n){S(n)?delete e[t]:e[t]=`${n}`}function $(e,t,n,s){if(n.visible=s,s){if(!t.contains(e)){const s=N(n);s&&t.contains(s.targetElement)?s.targetElement.after(e):t.appendChild(e)}}else e.remove()}function _(e,t,n){if(null===n)return;const s=fe.get().parent.targetElement;x(t,n,$.bind(null,e,s,fe.get()))}function I(e,t,n){if(S(n)){switch(t){case'value':delete e.value;break;case'checked':e.checked=0;break;case'spellcheck':if(0==n)return void e.setAttribute('spellcheck','false')}e.removeAttribute(t)}else{switch(t){case'value':e.value=`${n}`;break;case'checked':e.checked=`${n}`}e.setAttribute(t,`${n}`)}}function R(e,t,n,s,r,i){const l=e.createSVGTransform();switch(i){case'translate':case'scale':s=(e=>effector.is.store(e)?e:effector.is.store(e.x)?effector.is.store(e.y)?effector.combine({x:e.x,y:e.y}):e.x.map(Be.bind(null,e.y)):effector.is.store(e.y)?e.y.map(He.bind(null,e.x)):e)(s)}k(0,t,s,r.bind(null,l)),n.appendItem(l)}function A(e,t){const n=ae.createTextNode(`${t}`),s=e.firstChild;s?s.replaceWith(n):e.appendChild(n)}function O(e){e.focus()}function D(e){e.blur()}function F(e,t){return e.bind(null,t)}function P(e,t){const n=fe.get();if(Array.isArray(t)){const s=[];for(let n=0;n<t.length;n++)s[n]=e.map(F(V,t[n]));return n&&l(n.signal,s),s}if('object'==typeof t&&null!==t){const s=[],r={};for(const n in t)r[n]=e.map(F(V,t[n])),s.push(r[n]);return n&&l(n.signal,s),r}const s=e.map(F(V,t));return n&&l(n.signal,s),s}function V(e,t){return t[e]}function T(e,t){let n,s,r=0;effector.is.store(e)?(s=et,n=e):(s=F(tt,e.key),n=e.source,r=!!e.reverse);const i=fe.get(),o=u(),a={parent:i,signal:o,namespace:i.namespace,targetElement:i.targetElement,svgRoot:i.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'list',pure:0,reverse:r,key:effector.is.store(e)?{type:'index'}:{type:'key',key:e.key},store:n,cb:t},mountStatus:'initial',visible:1};h(i,a),fe.replace(a);const c={parentNode:i.targetElement,cb:t,shortName:n.shortName,reverse:r,parentStack:a,getID:s,fields:e.fields?e.fields:null},f=effector.createStore(j(c,[],n.getState()));l(o,[f]),d(o,F(st,f)),effector.sample({source:f,clock:n,fn:F(j,c),target:f}),fe.replace(i)}function j(e,t,n){const s=Array(n.length).fill(0),r=n.map(e.getID),i=[],f=[],p=[];for(let e=0;e<t.length;e++){const i=t[e],l=i.node,o=r.indexOf(l.key);-1!==o?(f.push(i),s[o]=1,l.store.getState()!==n[o]&&effector.launch(l.store,n[o],1)):p.push(i)}if(p.length>0){for(let e=0;e<p.length;e++){const t=p[e],{node:n,locality:s}=t;n.active=0,n.store=null,o(s.sibling.left.ref,s.sibling.right.ref),a(t,null),c(t,null)}effector.launch(nt,p,1)}let d=f.length>0?f[f.length-1]:null;for(let t=0;t<n.length;t++){if(s[t])continue;const r=n[t],a=effector.createStore(r),c=u(),p=e.fields?P(a,e.fields):null;l(c,[a]);const g=e.getID(r,t),m={parent:e.parentStack,signal:c,namespace:e.parentStack.namespace,targetElement:e.parentStack.targetElement,svgRoot:e.parentStack.svgRoot,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:{type:'listItem',pure:0,key:g,index:g,store:a,signal:c,active:1,nodes:[],fields:p,visible:[]},mountStatus:'initial',visible:1};o(d,m),d=m,h(e.parentStack,m),i.push(m),f.push(m)}return i.length>0&&effector.launch(Qe,{context:e,list:i},1),f}function M(e,t,n,s){const r=N(e);r&&s.contains(r.targetElement)?n?r.targetElement.before(t):r.targetElement.after(t):s.appendChild(t)}function L(e){const t=fe.get();return t&&l(t.signal,[e]),e}function q(e){const t=fe.get();if('element'!==t.node.type&&'using'!==t.node.type)throw Error(`"${e}" extension can be used only with element nodes, got "${t.node.type}"`)}function z(e){const t=fe.get();t.targetElement.__STATIC__||e(t.targetElement)}function W(e){e.attr&&Y(e.attr),e.data&&U(e.data),e.transform&&X(e.transform),'text'in e&&G(e.text),'visible'in e&&Z(e.visible),(e.style||e.styleVar)&&B({prop:e.style,val:e.styleVar}),e.focus&&J(e.focus),e.handler&&H(e.handler)}function Y(e){q('attr'),fe.getElementNode().attr.push(e)}function U(e){q('data'),fe.getElementNode().data.push(e)}function X(e){q('transform'),fe.getElementNode().transform.push(e)}function G(e){q('text'),fe.getElementNode().text.push(e)}function Z(e){const t=fe.get();if('element'!==t.node.type&&'using'!==t.node.type&&'listItem'!==t.node.type)throw Error(`"visible" extension can be used only with element or listItem nodes, got "${t.node.type}"`);fe.getElementNode().visible.push(e)}function B({prop:e,val:t}){q('style'),e&&fe.getElementNode().styleProp.push(e),t&&fe.getElementNode().styleVar.push(t)}function H(e,t){q('handler'),void 0===t&&(t=e,e={});const{passive:n=1,capture:s=0}=e;fe.getElementNode().handler.push({options:{passive:n,capture:s},map:t})}function J({focus:e,blur:t}){q('focus');const n=fe.getElementNode();e&&n.focus.push(e),t&&n.blur.push(t)}Object.defineProperty(exports,'__esModule',{value:1});var effector=require('effector');const K=/[^a-zA-Z0-9\-]/g,Q=/[\\<>"]/g,ee=/[A-Z]/g,te=/[&<>'"]/g;class ne{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new se,this.firstChild=null,this.transform={baseVal:new re},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}appendChild(e){if(e.parent&&e.remove(),e.isFragment&&null===e.textContent){let t,n=e.firstChild;for(;n;)t=n.sibling.right,this.appendChild(n),n=t}else this.child.last?(this.child.last.sibling.right=e,e.sibling.left=this.child.last):(this.child.first=e,this.firstChild=e),this.child.last=e,e.parent=this}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,e.sibling.right=this.child.first):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}contains(e){let t=e;for(;t;){if(t===this)return 1;t=t.parent}return 0}remove(){if(!this.parent)return;const{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,this.sibling.left.sibling.right=null):(this.sibling.right.sibling.left=this.sibling.left,this.sibling.left.sibling.right=this.sibling.right),this.sibling.left=null,this.sibling.right=null,this.parent=null}addEventListener(e,t,n){}removeEventListener(e,t,n){}setAttribute(e,t){this.attributes[n(e)]=s(t)}removeAttribute(e){delete this.attributes[n(e)]}replaceWith(e){if(!this.parent)return;const{parent:t}=this;e.parent&&e.remove(),t.child.first===this&&t.child.last===this?(t.firstChild=e,t.child.first=e,t.child.last=e):t.child.first===this?(t.child.first=e,t.firstChild=e,this.sibling.right.sibling.left=e):t.child.last===this?(t.child.last=e,this.sibling.left.sibling.right=e):(this.sibling.right.sibling.left=e,this.sibling.left.sibling.right=e),e.sibling.left=this.sibling.left,e.sibling.right=this.sibling.right,e.parent=t,this.sibling.left=null,this.sibling.right=null,this.parent=null}focus(){}blur(){}createSVGTransform(){return new ie}}class se{constructor(){this.properties=Object.create(null)}setProperty(e,t){this.properties[n(e)]=s(t)}removeProperty(e){delete this.properties[n(e)]}}class re{constructor(){this.items=[]}appendItem(e){this.items.push(e)}}class ie{constructor(){this.value=''}setTranslate(e,t){this.value=`translate(${e} ${t})`}setScale(e,t){this.value=`scale(${e} ${t})`}setRotate(e,t,n){this.value=0!==t||0!==n?`rotate(${e} ${t} ${n})`:`rotate(${e})`}setSkewX(e){this.value=`skewX(${e})`}setSkewY(e){this.value=`skewY(${e})`}}const le=new ne;le.isBody=1;var oe={__proto__:null,body:le,createTextNode:e=>{const n=new ne;return n.textContent=String(e).replace(te,t),n},createElement:e=>{const t=new ne;return t.tagName=n(e),t.isFragment=0,t},createElementNS:(e,t)=>{switch(e){case'http://www.w3.org/1999/xhtml':case'http://www.w3.org/2000/svg':break;default:e='http://www.w3.org/1999/xhtml'}const s=new ne;return s.tagName=n(t),s.namespaceURI=e,s.isFragment=0,s},createDocumentFragment:r,render:i};let ae='undefined'!=typeof document?document:null;const ce=[];let ue;const fe={get:()=>ue,replace(e){ue=e},getElementNode:()=>ue.node},pe=e=>e.graphite||e,he=e=>e.family.owners,de=e=>e.family.links,ge=effector.createNode({node:[effector.step.run({fn(e){effector.clearNode(e)}})]}),me=effector.step.compute({fn(e,t){t.self.next.push(ge);const{stack:n}=t,{parent:s}=n,{left:r,right:i}=n.locality.sibling;s&&(s.locality.child.last.ref===n&&(s.locality.child.last.ref=r.ref),s.locality.child.first.ref===n&&(s.locality.child.first.ref=i.ref)),r.ref&&r.ref.locality.sibling.right.ref===n&&i.ref&&i.ref.locality.sibling.left.ref===n?o(r.ref,i.ref):r.ref&&r.ref.locality.sibling.right.ref===n?a(r.ref,null):i.ref&&i.ref.locality.sibling.left.ref===n&&c(i.ref,null)}}),be=effector.step.compute({fn:(e,{self:t})=>t}),ye=effector.step.compute({fn(e,t){if(!t.stack)return e;const{stack:n}=t;t.stack=null;const s=n.parent.child.indexOf(n);return-1!==s&&n.parent.child.splice(s,1),n.parent=null,e}}),ve=effector.step.run({fn(e,{fn:t}){t(e)}});let we,xe,ke;we=()=>{},xe=()=>{},ke='undefined'!=typeof performance&&performance.now?()=>performance.now():'undefined'!=typeof process&&process.hrtime?()=>{const e=process.hrtime();return(1e9*e[0]+e[1])/1e6}:()=>Date.now();const Ee=effector.createEvent();let Ne,Se=0,Ce=0;const $e='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),_e='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,Ie=()=>{Ce||(Ce=1,Ne=$e(g))},Re=new Map,Ae=new Map,Oe=new Map,De=new Map;let Fe=0,Pe=0;const Ve=effector.createNode({node:[effector.step.run({fn:()=>{}}),effector.step.filter({fn:()=>0===Ae.size&&0===Oe.size?0:ke()-Pe>=10?0:(_e(Ne),Se=1,Ce=0,1)})],child:[Ee]});Ee.watch(()=>{if(Ce)return;if(0===Ae.size&&0===Oe.size)return void(Se=0);let e=0;Se||(Pe=ke()),Se=0;for(const[t,n]of Ae){if(ke()-Pe>=10){Ie(),e=1;break}Ae.delete(t),effector.launch({target:Re.get(t),params:n,defer:1})}if(!e)for(const[t,n]of Oe){if(ke()-Pe>=10){Ie(),e=1;break}Oe.delete(t),effector.launch({target:Re.get(t),params:n,defer:1})}effector.launch({target:Ve,params:null,defer:1})});const Te=effector.step.compute({fn:({done:e})=>e}),je=effector.step.compute({fn:({fail:e})=>e}),Me=effector.step.filter({fn:e=>e.length>0}),Le=effector.step.compute({fn(e,{taskID:t}){m(t,1,e)}}),qe=effector.step.compute({fn(e,{taskID:t,flat:n}){m(t,n,e)}}),ze=effector.step.run({fn:(e,{fn:t})=>t(e,Pe)}),We=effector.step.compute({fn:e=>[e]}),Ye=effector.step.run({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:Ue}=y({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),Xe=(e,{map:t,options:n})=>{for(const s in t)e.removeEventListener(s,t[s],n)},Ge=(e,t,n)=>{S(n)?delete e[t]:e[t]=n},Ze=(e,t,n)=>{S(n)?e.removeProperty(t):e.setProperty(t,n)},Be=(e,t)=>({x:t,y:e}),He=(e,t)=>({x:e,y:t}),Je={translate(e,{x:t=0,y:n=0}){e.setTranslate(t,n)},scale(e,{x:t=0,y:n=0}){e.setScale(t,n)},rotate(e,t){'number'==typeof t?e.setRotate(t,0,0):e.setRotate(t.angle||0,t.x||0,t.y||0)},skewX(e,t){e.setSkewX(t)},skewY(e,t){e.setSkewY(t)}},{trigger:Ke}=y({mark:'append DOM nodes',fn:e=>{for(let t=0;t<e.append.length;t++){const n=e.append[t];if(0==n.listItem.active)continue;if(0===n.appended.length)continue;const s=ae.createDocumentFragment();if(e.reverse)for(let e=n.appended.length-1;e>=0;e--)s.appendChild(n.appended[e]);else for(let e=0;e<n.appended.length;e++)s.appendChild(n.appended[e]);M(n.listItemStack,s,e.reverse,e.node)}}}),{trigger:Qe}=y({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:s,cb:r,reverse:i}=e,l=fe.get();fe.replace(n);const o=[],a=[];ce.push({node:s,append:a,reverse:i});for(let e=0;e<t.length;e++){const n=t[e],l=n.node;if(l.active){fe.replace(n),effector.withRegion(n.signal,F(r,l));for(let e=0;e<a.length;e++)l.nodes.push(a[e]);l.visible.length>0?effector.withRegion(n.signal,()=>{const e=l.visible[l.visible.length-1];e.updates.watch(e=>{if(0!=l.active)if(e){const e=ae.createDocumentFragment();if(i)for(let t=l.nodes.length-1;t>=0;t--)e.appendChild(l.nodes[t]);else for(let t=0;t<l.nodes.length;t++)e.appendChild(l.nodes[t]);M(n,e,i,s)}else for(let e=0;e<l.nodes.length;e++)l.nodes[e].remove()}),e.getState()&&o.push({listItemStack:n,appended:a.slice(),listItem:l})}):o.push({listItemStack:n,appended:a.slice(),listItem:l}),a.length=0}}ce.pop(),o.length>0&&effector.launch({target:Ke,params:{node:s,append:o,reverse:i},defer:1}),fe.replace(l)}}),et=(e,t)=>t,tt=(e,t)=>t[e],nt=effector.createEvent();v({trigger:nt,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&effector.launch(e,null,0)}}),v({trigger:nt,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const st=e=>{const t=e.getState();for(let e=0;e<t.length;e++){const n=t[e].node;n.active=0,n.store=null}effector.launch(nt,t,1)};ae=oe,exports.attr=Y,exports.body=le,exports.combine=({source:e,fn:t})=>(console.error('separate combine method is deprecated, use common combine method as usual'),L(effector.combine(e,t))),exports.createDocumentFragment=r,exports.data=U,exports.explicitUnmount=e=>{const t=fe.get();t&&effector.createNode({node:[],parent:e,child:t.signal,family:{type:'crosslink',owners:[t.signal,e]}})},exports.focus=J,exports.h=(e,t,n)=>{'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:s=0}=t,r=fe.get(),i=r?r.namespace:'html';let l=i,o='html';'type'in t?(o=t.type,l=t.type):l=o='svg'===i?'svg':'html','svg'===e&&(o='svg',l='svg');const a='svg'===o?ae.createElementNS('http://www.w3.org/2000/svg',e):ae.createElement(e);'foreignObject'===i?(a.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),l='html'):'svg'===e?(a.setAttribute('xmlns','http://www.w3.org/2000/svg'),l='svg'):'foreignObject'===e&&(l='foreignObject');const c=u(),f={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},g={parent:null,signal:c,namespace:l,targetElement:a,svgRoot:null,child:[],locality:{sibling:{left:{ref:null},right:{ref:null}},child:{first:{ref:null},last:{ref:null}}},node:f,mountStatus:'initial',visible:1};r&&h(r,g),'svg'===e?g.svgRoot=a:r&&(g.svgRoot=r.svgRoot),fe.replace(g),n?((e,t,n,s)=>{let r=0;ce.push({node:t,append:[],reverse:0});try{effector.withRegion(e,s),r=1}finally{p(ce.pop()),r||fe.replace(n)}})(c,a,r,n):(f.pure=1,W(t));const m=(()=>{const e=(()=>{const e=fe.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:e.handler,transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.attr.length;n++){const s=e.attr[n];for(const e in s)t.attr[e]=s[e]}for(let n=0;n<e.data.length;n++){const s=e.data[n];for(const e in s)t.data[e]=s[e]}e.visible.length>0&&(t.visible=e.visible[e.visible.length-1]),e.text.length>0&&(t.text=e.text[e.text.length-1]);for(let n=0;n<e.styleVar.length;n++){const s=e.styleVar[n];for(const e in s)t.styleVar[e]=s[e]}for(let n=0;n<e.styleProp.length;n++){const s=e.styleProp[n];for(const e in s)t.styleProp[e]=s[e]}return t})(),t=fe.get(),n=t.targetElement,s=t.signal;return((e,t,n)=>{for(const s in n)k('value'!==s&&'checked'!==s&&'min'!==s&&'max'!==s,t,n[s],I.bind(null,e,s))})(n,s,e.attr),((e,t,n)=>{for(const s in n)k(0,t,n[s],C.bind(null,e.dataset,s))})(n,s,e.data),((e,t,n)=>{for(let s=0;s<n.length;s++){const{options:r,map:i}=n[s];for(const t in i)e.addEventListener(t,i[t],r);d(t,Xe.bind(null,e,n[s]))}})(n,s,e.handler),((e,t,n)=>{const s=e.style;for(const e in n)k(0,t,n[e],Ge.bind(null,s,e))})(n,s,e.styleProp),((e,t,n)=>{const s=e.style;for(const e in n)k(0,t,n[e],Ze.bind(null,s,`--${e}`))})(n,s,e.styleVar),((e,t,n)=>{const s=fe.get();if('svg'!==s.namespace)return;if(0===n.length)return;const r=e.transform.baseVal,i=s.svgRoot;for(let e=0;e<n.length;e++){const s=n[e];for(const e in s)R(i,t,r,s[e],Je[e],e)}})(n,s,e.transform),((e,t,n)=>{null!==n&&(effector.is.unit(n)?x(t,n,A.bind(null,e)):A(e,n))})(n,s,e.text),_(n,s,e.visible),((e,t,n)=>{for(let s=0;s<n.length;s++)k(1,t,n[s],O.bind(null,e))})(n,s,e.focus),((e,t,n)=>{for(let s=0;s<n.length;s++)k(1,t,n[s],D.bind(null,e))})(n,s,e.blur),e})();fe.replace(r),g.visible=!m.visible||m.visible.getState(),s||ce.length>0&&g.visible&&ce[ce.length-1].append.push(a)},exports.handler=H,exports.list=T,exports.map=(e,{fn:t})=>(console.error('separate map method is deprecated, use store.map as usual'),L(e.map(t))),exports.node=z,exports.nodeMethod=e=>{let t;return z(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}},exports.remap=P,exports.render=i,exports.renderStatic=e=>{const t=r();return f(t,e),new Promise(e=>setTimeout(e,800)).then(()=>i(t))},exports.signalOwn=L,exports.spec=W,exports.storeField=(e,t)=>{const n=e.map(F(V,t)),s=fe.get();return s&&l(s.signal,[n]),n},exports.style=B,exports.text=G,exports.transform=X,exports.tree=function e({key:t,child:n,source:s},r){T({source:s,key:t},({store:s,key:i,signal:l})=>{const o=P(s,n);r({store:s,key:i,signal:l},()=>{e({key:t,child:n,source:o},r)})})},exports.using=f,exports.visible=Z;
//# sourceMappingURL=server.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc