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.12 to 0.0.13

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),i=J(n);r.includes(n)||r.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 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 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(te,'')}}function l(e){return String(e).replace(ne,'')}function o({node:e,append:t,reverse:n=0}){if(0===t.length)return;const s=le.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,ue()}function p(t,n,s){const r=++Ee,i=effector.createEvent(),l=effector.is.store(t)?t.updates:t,o={type:'crosslink',owners:[l,i]};return effector.createNode({node:[_e],parent:[l],scope:{taskID:r},family:o}),e(t,[i]),ye.set(r,effector.createNode({node:[Oe],child:[effector.createNode({node:[Ie,Re,_e],scope:{taskID:r},family:o}),effector.createNode({node:[Ce,Re],child:[i],family:o})],scope:{fn:n},family:o})),xe.set(r,s),i}function u({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=e.map(e=>[{inserted:pe(),retry:0,value:e}]);return{trigger:e,processed:p(o,(e,n)=>{let l,o=0;const a=[],c=[];for(l=0;l<e.length;l++){const i=e[l],f=pe();if(i.inserted+r>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=l;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=i||c.push(n)}return{done:a,fail:c}},n)}}function h({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=e.map(e=>{const t=[],n=pe();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});return{trigger:e,processed:p(a,(e,n)=>{let l,o=0;const a=[],c=[];for(l=0;l<e.length;l++){const i=e[l],f=pe();if(i.inserted+r>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=l;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=i||c.push(n)}return{done:a,fail:c}},n)}}function d(e,t,n){c(e,t.watch(n))}function g(e,t,n){effector.createNode({node:[$e],parent:t,child:[Ae],family:{type:'crosslink',owners:e},scope:{handler:n},meta:{op:'debounceRaf'}}),effector.is.store(t)&&effector.launch(Ae,{data:t.getState(),handler:n},1)}function m(e,t,n,s){effector.is.unit(n)?(e?d:g)(t,n,s):s(n)}function b(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=b(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=b(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=b(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function y(e){return''!==e&&0!==e&&(0==e||null==e)}function k(e,t,n){y(n)?delete e[t]:e[t]=`${n}`}function w(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 x(e,t,n){if(null===n)return;const s=B.get().parent.targetElement;g(t,n,w.bind(null,e,s,B.get()))}function E(e,t,n){if(y(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 S(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(je.bind(null,e.y)):effector.is.store(e.y)?e.y.map(Te.bind(null,e.x)):e)(s)}m(0,t,s,r.bind(null,l)),n.appendItem(l)}function N(e,t){const n=le.createTextNode(`${t}`),s=e.firstChild;s?s.replaceWith(n):e.appendChild(n)}function C(e){e.focus()}function I(e){e.blur()}function R(e,t){return e.bind(null,t)}function _(t,n){const s=B.get();if(Array.isArray(n)){const r=[];for(let e=0;e<n.length;e++)r[e]=t.map(R(O,n[e]));return s&&e(s.signal,r),r}if('object'==typeof n&&null!==n){const r=[],i={};for(const e in n)i[e]=t.map(R(O,n[e])),r.push(i[e]);return s&&e(s.signal,r),i}const r=t.map(R(O,n));return s&&e(s.signal,r),r}function O(e,t){return t[e]}function $(t,n=(()=>{})){let s;n=t.fn?t.fn:n;let i,l=0;effector.is.store(t)?(i=Le,s=t):(i=R(qe,t.key),s=t.source,l=!!t.reverse);const o=B.get(),f=r(),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:l,key:effector.is.store(t)?{type:'index'}:{type:'key',key:t.key},store:s,cb:n},mountStatus:'initial',visible:1};a(o,p),B.replace(p);const u={parentNode:o.targetElement,cb:n,shortName:s.shortName,reverse:l,parentStack:p,getID:i,fields:t.fields?t.fields:null,visible:t.visible?t.visible:null},h=effector.createStore(A(u,[],s.getState()));e(f,[h]),c(f,R(Xe,h)),effector.sample({source:h,clock:s,fn:R(A,u),target:h}),B.replace(o)}function A(i,l,o){const c=Array(o.length).fill(0),f=o.map(i.getID),p=[],u=[],h=[];for(let e=0;e<l.length;e++){const t=l[e],n=t.node,s=f.indexOf(n.key);-1!==s?(u.push(t),c[s]=1,n.store.getState()!==o[s]&&effector.launch({target:n.store,params:o[s],defer:1})):h.push(t)}if(h.length>0){for(let e=0;e<h.length;e++){const r=h[e],{node:i,locality:l}=r;i.active=0,i.store=null,t(l.sibling.left.ref,l.sibling.right.ref),n(r,null),s(r,null)}effector.launch({target:We,params:h,defer: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],l=effector.createStore(s),f=r(),h=i.fields?_(l,i.fields):null;e(f,[l]);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:l,signal:f,active:1,nodes:[],fields:h,visible:i.visible?[l.map(i.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({target:ze,params:{context:i,list:p},defer:1}),u}function P(e,t,n,s){const r=v(e);r&&s.contains(r.targetElement)?n?r.targetElement.before(t):r.targetElement.after(t):s.appendChild(t)}function V(t){const n=B.get();return n&&e(n.signal,[t]),t}function D(e){const t=B.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 j(e){const t=B.get();t.targetElement.__STATIC__||e(t.targetElement)}function T(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('attr'),B.getElementNode().attr.push(e)}function M(e){D('data'),B.getElementNode().data.push(e)}function z(e){D('transform'),B.getElementNode().transform.push(e)}function L(e){D('text'),B.getElementNode().text.push(e)}function q(e){const t=B.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}"`);B.getElementNode().visible.push(e)}function W({prop:e,val:t}){D('style'),e&&B.getElementNode().styleProp.push(e),t&&B.getElementNode().styleVar.push(t)}function X(e,t){D('handler'),void 0===t&&(t=e,e={});const{passive:n=1,capture:s=0,prevent:r=0,stop:i=0}=e;B.getElementNode().handler.push({options:{passive:n,capture:s,prevent:r,stop:i},map:t})}function Y({focus:e,blur:t}){D('focus');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:i}=r,{parent:l}=i,{left:o,right:a}=i.locality.sibling;l&&(l.locality.child.last.ref===i&&(l.locality.child.last.ref=o.ref),l.locality.child.first.ref===i&&(l.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)}}),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[i(e)]=l(t)}removeProperty(e){delete this.properties[i(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})`}}(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[i(e)]=l(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 ie}}).isBody=1;let le='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,pe;ce=()=>{},fe=()=>{},pe='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 ue=effector.createEvent();let he,de=0,ge=0;const me='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),be='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,ve=()=>{ge||(ge=1,he=me(f))},ye=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:pe()-Se>=10?0:(be(he),de=1,ge=0,1)})],child:[ue]});ue.watch(()=>{if(ge)return;if(0===ke.size&&0===we.size)return void(de=0);let e=0;de||(Se=pe()),de=0;for(const[t,n]of ke){if(pe()-Se>=10){ve(),e=1;break}ke.delete(t),effector.launch({target:ye.get(t),params:n,defer:1})}if(!e)for(const[t,n]of we){if(pe()-Se>=10){ve(),e=1;break}we.delete(t),effector.launch({target:ye.get(t),params:n,defer:1})}effector.launch({target:Ne,params:null,defer:1})});const Ce=effector.step.compute({fn:({done:e})=>e}),Ie=effector.step.compute({fn:({fail:e})=>e}),Re=effector.step.filter({fn:e=>e.length>0}),_e=effector.step.compute({fn(e,{taskID:t}){const n='high'===xe.get(t)?ke:we;let s=n.get(t);s||(s=[],n.set(t,s));for(let t=0;t<e.length;t++)s.push(e[t]);ve()}}),Oe=effector.step.run({fn:(e,{fn:t})=>t(e,Se)}),$e=effector.step.run({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:Ae}=u({priority:'high',mark:'domOperation',fn({handler:e,data:t}){e(t)}}),Pe=(e,{map:t,options:n})=>{for(const s in t)e.removeEventListener(s,t[s],n)},Ve=(e,t,n)=>{y(n)?delete e[t]:e[t]=n},De=(e,t,n)=>{y(n)?e.removeProperty(t):e.setProperty(t,n)},je=(e,t)=>({x:t,y:e}),Te=(e,t)=>({x:e,y:t}),Fe={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:Me}=u({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=le.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]);P(n.listItemStack,s,e.reverse,e.node)}}}),{trigger:ze}=u({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:s,cb:r,reverse:i}=e,l=B.get();B.replace(n);const o=[],a=[];G.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){B.replace(n),effector.withRegion(n.signal,R(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=le.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]);P(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}}G.pop(),o.length>0&&effector.launch({target:Me,params:{node:s,append:o,reverse:i},defer:1}),B.replace(l)}}),Le=(e,t)=>t,qe=(e,t)=>t[e],We=effector.createEvent();h({trigger:We,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&effector.launch({target:e,params:null,defer:0})}}),h({trigger:We,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const Xe=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({target:We,params:t,defer: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,i=B.get(),l=i?i.namespace:'html';let f=l,p='html';'type'in t?(p=t.type,f=t.type):f=p='svg'===l?'svg':'html','svg'===e&&(p='svg',f='svg');const u='svg'===p?le.createElementNS('http://www.w3.org/2000/svg',e):le.createElement(e);'foreignObject'===l?(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=r(),d={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},b={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,b),'svg'===e?b.svgRoot=u:i&&(b.svgRoot=i.svgRoot),B.replace(b),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,u,i,n):(d.pure=1,T(t));const v=(()=>{const e=(()=>{const e=B.getElementNode(),t={attr:{},data:{},visible:null,text:null,styleVar:{},styleProp:{},handler:[],transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.handler.length;n++){const{options:s,map:r}=e.handler[n];s.passive=s.prevent?0:s.passive;for(const e in r){const t=r[e];r[e]=e=>{s.prevent&&e.preventDefault(),s.stop&&e.stopPropagation(),t(e)}}t.handler.push({options:s,map:r})}for(let n=0;n<e.attr.length;n++){const s=e.attr[n];for(const e in s)'xlink:href'===e?t.attr.href=s[e]: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)m('value'!==s&&'checked'!==s&&'min'!==s&&'max'!==s,t,n[s],E.bind(null,e,s))})(n,s,e.attr),((e,t,n)=>{for(const s in n)m(0,t,n[s],k.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);c(t,Pe.bind(null,e,n[s]))}})(n,s,e.handler),((e,t,n)=>{const s=e.style;for(const e in n)m(0,t,n[e],Ve.bind(null,s,e))})(n,s,e.styleProp),((e,t,n)=>{const s=e.style;for(const e in n)m(0,t,n[e],De.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,i=s.svgRoot;for(let e=0;e<n.length;e++){const s=n[e];for(const e in s)S(i,t,r,s[e],Fe[e],e)}})(n,s,e.transform),((e,t,n)=>{null!==n&&(effector.is.unit(n)?g(t,n,N.bind(null,e)):N(e,n))})(n,s,e.text),x(n,s,e.visible),((e,t,n)=>{for(let s=0;s<n.length;s++)m(1,t,n[s],C.bind(null,e))})(n,s,e.focus),((e,t,n)=>{for(let s=0;s<n.length;s++)m(1,t,n[s],I.bind(null,e))})(n,s,e.blur),e})();B.replace(i),b.visible=!v.visible||v.visible.getState(),s||G.length>0&&b.visible&&G[G.length-1].append.push(u)},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=j,exports.nodeMethod=e=>{let t;return j(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}},exports.remap=_,exports.signalOwn=V,exports.spec=T,exports.storeField=(t,n)=>{const s=t.map(R(O,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:i,signal:l})=>{const o=_(s,n);r({store:s,key:i,signal:l},()=>{e({key:t,child:n,source:o},r)})})},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',l=B.get(),a={parent:l,signal:l&&l.signal?l.signal:r(),namespace:i,targetElement:e,svgRoot:'svg'===s?e:l?l.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(l)}},exports.variant=(e,t)=>{const n=effector.createStore(Object.entries(t).map(([e,t])=>({key:e,val:t}))),s=effector.combine(n,e,(e,t)=>e.map(e=>({key:e.key,val:e.val,visible:e.key===t})));$({source:s,key:'key',visible:({visible:e})=>e,fn({store:e}){e.getState().val()}})},exports.visible=q;
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 i=H(s),r=J(n);i.includes(n)||i.push(n),r.includes(s)||r.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 i(){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 r(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 l(e){return String(e).replace(ne,'')}function o({node:e,append:t,reverse:n=0}){if(0===t.length)return;const s=le.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,he()}function p(t,n,s){const i=++Se,r=effector.createEvent(),l=effector.is.store(t)?t.updates:t,o={type:'crosslink',owners:[l,r]};return effector.createNode({node:[_e],parent:[l],scope:{taskID:i},family:o}),e(t,[r]),ye.set(i,effector.createNode({node:[$e],child:[effector.createNode({node:[Ie,Re,_e],scope:{taskID:i},family:o}),effector.createNode({node:[Ce,Re],child:[r],family:o})],scope:{fn:n},family:o})),we.set(i,s),r}function h({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:i=0,retries:r=1/0,mark:l=e.shortName}){const o=e.map(e=>[{inserted:pe(),retry:0,value:e}]);return{trigger:e,processed:p(o,(e,n)=>{let l,o=0;const a=[],c=[];for(l=0;l<e.length;l++){const r=e[l],f=pe();if(r.inserted+i>f){c.push(r);continue}if(r.inserted+s<f)continue;if(f-n>=10){o=1;break}const p=t(r.value);void 0!==p&&a.push(p)}if(o)for(let t=l;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=r||c.push(n)}return{done:a,fail:c}},n)}}function u({trigger:e=effector.createEvent(),fn:t,priority:n="low",timeout:s=1/0,batchWindow:i=0,retries:r=1/0,mark:l=e.shortName,flatten:o}){const a=e.map(e=>{const t=[],n=pe();for(let s=0;s<e.length;s++){const i=o(e[s]);for(let e=0;e<i.length;e++)t.push({inserted:n,retry:0,value:i[e]})}return t});return{trigger:e,processed:p(a,(e,n)=>{let l,o=0;const a=[],c=[];for(l=0;l<e.length;l++){const r=e[l],f=pe();if(r.inserted+i>f){c.push(r);continue}if(r.inserted+s<f)continue;if(f-n>=10){o=1;break}const p=t(r.value);void 0!==p&&a.push(p)}if(o)for(let t=l;t<e.length;t++){const n=e[t];n.retry+=1,n.retry>=r||c.push(n)}return{done:a,fail:c}},n)}}function d(e,t,n){c(e,t.watch(n))}function g(e,t,n){effector.createNode({node:[Oe],parent:t,child:[Ae],family:{type:'crosslink',owners:e},scope:{handler:n},meta:{op:'debounceRaf'}}),effector.is.store(t)&&effector.launch(Ae,{data:t.getState(),handler:n},1)}function m(e,t,n,s){effector.is.unit(n)?(e?d:g)(t,n,s):s(n)}function b(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=b(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=b(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=b(n,n.child.indexOf(t)-1);if(e)return e;t=n,n=n.parent}break}}return null}function y(e){return''!==e&&0!==e&&(0==e||null==e)}function k(e,t,n){y(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 w(e,t,n){if(null===n)return;const s=B.get().parent.targetElement;g(t,n,x.bind(null,e,s,B.get()))}function S(e,t,n){if(y(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 E(e,t,n,s,i,r){const l=e.createSVGTransform();switch(r){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(je.bind(null,e.y)):effector.is.store(e.y)?e.y.map(Te.bind(null,e.x)):e)(s)}m(0,t,s,i.bind(null,l)),n.appendItem(l)}function N(e,t){e.replaceData(0,(e.textContent||'').length,String(t))}function C(e){e.focus()}function I(e){e.blur()}function R(e,t){return e.bind(null,t)}function _(t,n){const s=B.get();if(Array.isArray(n)){const i=[];for(let e=0;e<n.length;e++)i[e]=t.map(R($,n[e]));return s&&e(s.signal,i),i}if('object'==typeof n&&null!==n){const i=[],r={};for(const e in n)r[e]=t.map(R($,n[e])),i.push(r[e]);return s&&e(s.signal,i),r}const i=t.map(R($,n));return s&&e(s.signal,i),i}function $(e,t){return t[e]}function O(t,n=(()=>{})){let s;n=t.fn?t.fn:n;let r,l=0;effector.is.store(t)?(r=Le,s=t):(r=R(qe,t.key),s=t.source,l=!!t.reverse);const o=B.get(),f=i(),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:l,key:effector.is.store(t)?{type:'index'}:{type:'key',key:t.key},store:s,cb:n},mountStatus:'initial',visible:1};a(o,p),B.replace(p);const h={parentNode:o.targetElement,cb:n,shortName:s.shortName,reverse:l,parentStack:p,getID:r,fields:t.fields?t.fields:null,visible:t.visible?t.visible:null},u=effector.createStore(A(h,[],s.getState()));e(f,[u]),c(f,R(Ye,u)),effector.sample({source:u,clock:s,fn:R(A,h),target:u}),B.replace(o)}function A(r,l,o){const c=Array(o.length).fill(0),f=o.map(r.getID),p=[],h=[],u=[];for(let e=0;e<l.length;e++){const t=l[e],n=t.node,s=f.indexOf(n.key);-1!==s?(h.push(t),c[s]=1,n.store.getState()!==o[s]&&effector.launch({target:n.store,params:o[s],defer:1})):u.push(t)}if(u.length>0){for(let e=0;e<u.length;e++){const i=u[e],{node:r,locality:l}=i;r.active=0,r.store=null,t(l.sibling.left.ref,l.sibling.right.ref),n(i,null),s(i,null)}effector.launch({target:Xe,params:u,defer:1})}let d=h.length>0?h[h.length-1]:null;for(let n=0;n<o.length;n++){if(c[n])continue;const s=o[n],l=effector.createStore(s),f=i(),u=r.fields?_(l,r.fields):null;e(f,[l]);const g=r.getID(s,n),m={parent:r.parentStack,signal:f,namespace:r.parentStack.namespace,targetElement:r.parentStack.targetElement,svgRoot:r.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:l,signal:f,active:1,nodes:[],fields:u,visible:r.visible?[l.map(r.visible)]:[]},mountStatus:'initial',visible:1};t(d,m),d=m,a(r.parentStack,m),p.push(m),h.push(m)}return p.length>0&&effector.launch({target:ze,params:{context:r,list:p},defer:1}),h}function D(e,t,n,s){const i=v(e);i&&s.contains(i.targetElement)?n?i.targetElement.before(t):i.targetElement.after(t):s.appendChild(t)}function P(t){const n=B.get();return n&&e(n.signal,[t]),t}function V(e){const t=B.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 j(e){const t=B.get();t.targetElement.__STATIC__||e(t.targetElement)}function T(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)&&X({prop:e.style,val:e.styleVar}),e.focus&&G(e.focus),e.handler&&Y(e.handler)}function F(e){V('attr'),B.getElementNode().attr.push(e)}function M(e){V('data'),B.getElementNode().data.push(e)}function z(e){V('transform'),B.getElementNode().transform.push(e)}function L(e){V('text'),B.getElementNode().text.push(e)}function q(e){const t=B.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}"`);B.getElementNode().visible.push(e)}function X({prop:e,val:t}){V('style'),e&&B.getElementNode().styleProp.push(e),t&&B.getElementNode().styleVar.push(t)}function Y(e,t){V('handler'),void 0===t&&(t=e,e={});const{passive:n=1,capture:s=0,prevent:i=0,stop:r=0}=e;B.getElementNode().handler.push({options:{passive:n,capture:s,prevent:i,stop:r},map:t})}function G({focus:e,blur:t}){V('focus');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 U=[];let W;const B={get:()=>W,replace(e){W=e},getElementNode:()=>W.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,i){i.self.next.push(K);const{stack:r}=i,{parent:l}=r,{left:o,right:a}=r.locality.sibling;l&&(l.locality.child.last.ref===r&&(l.locality.child.last.ref=o.ref),l.locality.child.first.ref===r&&(l.locality.child.first.ref=a.ref)),o.ref&&o.ref.locality.sibling.right.ref===r&&a.ref&&a.ref.locality.sibling.left.ref===r?t(o.ref,a.ref):o.ref&&o.ref.locality.sibling.right.ref===r?n(o.ref,null):a.ref&&a.ref.locality.sibling.left.ref===r&&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[r(e)]=l(t)}removeProperty(e){delete this.properties[r(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 se,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[r(e)]=l(t)}removeAttribute(e){delete this.attributes[r(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}replaceData(e,t,n){'string'==typeof this.textContent&&(this.textContent=`${this.textContent.slice(0,e)}${n}${this.textContent.slice(e+t)}`)}}).isBody=1;let le='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,pe;ce=()=>{},fe=()=>{},pe='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 ue,de=0,ge=0;const me='undefined'!=typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,0),be='undefined'!=typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout,ve=()=>{ge||(ge=1,ue=me(f))},ye=new Map,ke=new Map,xe=new Map,we=new Map;let Se=0,Ee=0;const Ne=effector.createNode({node:[effector.step.run({fn:()=>{}}),effector.step.filter({fn:()=>0===ke.size&&0===xe.size?0:pe()-Ee>=10?0:(be(ue),de=1,ge=0,1)})],child:[he]});he.watch(()=>{if(ge)return;if(0===ke.size&&0===xe.size)return void(de=0);let e=0;de||(Ee=pe()),de=0;for(const[t,n]of ke){if(pe()-Ee>=10){ve(),e=1;break}ke.delete(t),effector.launch({target:ye.get(t),params:n,defer:1})}if(!e)for(const[t,n]of xe){if(pe()-Ee>=10){ve(),e=1;break}xe.delete(t),effector.launch({target:ye.get(t),params:n,defer:1})}effector.launch({target:Ne,params:null,defer:1})});const Ce=effector.step.compute({fn:({done:e})=>e}),Ie=effector.step.compute({fn:({fail:e})=>e}),Re=effector.step.filter({fn:e=>e.length>0}),_e=effector.step.compute({fn(e,{taskID:t}){const n='high'===we.get(t)?ke:xe;let s=n.get(t);s||(s=[],n.set(t,s));for(let t=0;t<e.length;t++)s.push(e[t]);ve()}}),$e=effector.step.run({fn:(e,{fn:t})=>t(e,Ee)}),Oe=effector.step.run({fn:(e,{handler:t})=>({data:e,handler:t})}),{trigger:Ae}=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)},Pe=(e,t,n)=>{y(n)?delete e[t]:e[t]=n},Ve=(e,t,n)=>{y(n)?e.removeProperty(t):e.setProperty(t,n)},je=(e,t)=>({x:t,y:e}),Te=(e,t)=>({x:e,y:t}),Fe={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:Me}=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=le.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]);D(n.listItemStack,s,e.reverse,e.node)}}}),{trigger:ze}=h({mark:'addRecords',fn:({context:e,list:t})=>{const{parentStack:n,parentNode:s,cb:i,reverse:r}=e,l=B.get();B.replace(n);const o=[],a=[];U.push({node:s,append:a,reverse:r});for(let e=0;e<t.length;e++){const n=t[e],l=n.node;if(l.active){B.replace(n),effector.withRegion(n.signal,R(i,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=le.createDocumentFragment();if(r)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]);D(n,e,r,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}}U.pop(),o.length>0&&effector.launch({target:Me,params:{node:s,append:o,reverse:r},defer:1}),B.replace(l)}}),Le=(e,t)=>t,qe=(e,t)=>t[e],Xe=effector.createEvent();u({trigger:Xe,priority:'high',mark:'runSignals',flatten:({signal:e})=>[e],fn:e=>{e.scope&&effector.launch({target:e,params:null,defer:0})}}),u({trigger:Xe,priority:'high',mark:'remove DOM nodes',flatten({node:e}){const{nodes:t}=e;return t},fn:e=>(e.remove(),e)});const Ye=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({target:Xe,params:t,defer:1})};exports.attr=F,exports.combine=({source:e,fn:t})=>(console.error('separate combine method is deprecated, use common combine method as usual'),P(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=G,exports.h=(e,t,n)=>{'function'==typeof t&&(n=t,t={}),void 0===t&&(t={});const{noAppend:s=0}=t,r=B.get(),l=r?r.namespace:'html';let f=l,p='html';'type'in t?(p=t.type,f=t.type):f=p='svg'===l?'svg':'html','svg'===e&&(p='svg',f='svg');const h='svg'===p?le.createElementNS('http://www.w3.org/2000/svg',e):le.createElement(e);'foreignObject'===l?(h.setAttribute('xmlns','http://www.w3.org/1999/xhtml'),f='html'):'svg'===e?(h.setAttribute('xmlns','http://www.w3.org/2000/svg'),f='svg'):'foreignObject'===e&&(f='foreignObject');const u=i(),d={type:'element',pure:0,tag:e,attr:[],data:[],visible:[],text:[],styleVar:[],styleProp:[],handler:[],transform:[],focus:[],blur:[]},b={parent:null,signal:u,namespace:f,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};r&&a(r,b),'svg'===e?b.svgRoot=h:r&&(b.svgRoot=r.svgRoot),B.replace(b),n?((e,t,n,s)=>{let i=0;U.push({node:t,append:[],reverse:0});try{effector.withRegion(e,s),i=1}finally{o(U.pop()),i||B.replace(n)}})(u,h,r,n):(d.pure=1,T(t));const v=(()=>{const e=(()=>{const e=B.getElementNode(),t={attr:{},data:{},visible:null,text:[],styleVar:{},styleProp:{},handler:[],transform:e.transform,focus:e.focus,blur:e.blur};for(let n=0;n<e.handler.length;n++){const{options:s,map:i}=e.handler[n];s.passive=s.prevent?0:s.passive;for(const e in i){const t=i[e];i[e]=e=>{s.prevent&&e.preventDefault(),s.stop&&e.stopPropagation(),t(e)}}t.handler.push({options:s,map:i})}for(let n=0;n<e.attr.length;n++){const s=e.attr[n];for(const e in s)'xlink:href'===e?t.attr.href=s[e]: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]),t.text=e.text;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)m('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)m(0,t,n[s],k.bind(null,e.dataset,s))})(n,s,e.data),((e,t,n)=>{for(let s=0;s<n.length;s++){const{options:i,map:r}=n[s];for(const t in r)e.addEventListener(t,r[t],i);c(t,De.bind(null,e,n[s]))}})(n,s,e.handler),((e,t,n)=>{const s=e.style;for(const e in n)m(0,t,n[e],Pe.bind(null,s,e))})(n,s,e.styleProp),((e,t,n)=>{const s=e.style;for(const e in n)m(0,t,n[e],Ve.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 i=e.transform.baseVal,r=s.svgRoot;for(let e=0;e<n.length;e++){const s=n[e];for(const e in s)E(r,t,i,s[e],Fe[e],e)}})(n,s,e.transform),((e,t,n)=>{for(let s=0;s<n.length;s++){const i=n[s];if(null===i)continue;const r=le.createTextNode('');e.appendChild(r),effector.is.unit(i)?g(t,i,N.bind(null,r)):N(r,i)}})(n,s,e.text),w(n,s,e.visible),((e,t,n)=>{for(let s=0;s<n.length;s++)m(1,t,n[s],C.bind(null,e))})(n,s,e.focus),((e,t,n)=>{for(let s=0;s<n.length;s++)m(1,t,n[s],I.bind(null,e))})(n,s,e.blur),e})();B.replace(r),b.visible=!v.visible||v.visible.getState(),s||U.length>0&&b.visible&&U[U.length-1].append.push(h)},exports.handler=Y,exports.list=O,exports.map=(e,{fn:t})=>(console.error('separate map method is deprecated, use store.map as usual'),P(e.map(t))),exports.node=j,exports.nodeMethod=e=>{let t;return j(e=>{t=e}),(...n)=>{if(t)return t[e](...n)}},exports.remap=_,exports.signalOwn=P,exports.spec=T,exports.storeField=(t,n)=>{const s=t.map(R($,n)),i=B.get();return i&&e(i.signal,[s]),s},exports.style=X,exports.text=L,exports.transform=z,exports.tree=function e({key:t,child:n,source:s},i){O({source:s,key:t},({store:s,key:r,signal:l})=>{const o=_(s,n);i({store:s,key:r,signal:l},()=>{e({key:t,child:n,source:o},i)})})},exports.using=(e,t)=>{const n=e.namespaceURI,s=e.tagName.toLowerCase(),r='http://www.w3.org/2000/svg'===n?'svg':'foreignObject'===s?'foreignObject':'html',l=B.get(),a={parent:l,signal:l&&l.signal?l.signal:i(),namespace:r,targetElement:e,svgRoot:'svg'===s?e:l?l.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),U.push({node:e,append:[],reverse:0});try{effector.withRegion(a.signal,t)}finally{o(U.pop()),B.replace(l)}},exports.variant=(e,t)=>{const n=effector.createStore(Object.entries(t).map(([e,t])=>({key:e,val:t}))),s=effector.combine(n,e,(e,t)=>e.map(e=>({key:e.key,val:e.val,visible:e.key===t})));O({source:s,key:'key',visible:({visible:e})=>e,fn({store:e}){e.getState().val()}})},exports.visible=q;
//# sourceMappingURL=effector-dom.cjs.js.map

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

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

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