whose-turn 1.0.0-alpha.5 → 1.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- import{w as C,K as Q,L as Y,M as S,N as we,O as He,P as xe,j as _e,n as ke,Q as ne,R as Se,S as Ne,T as Le,v as We,U as Ce,C as $e,H as Pe,c as H,u as Ie,r as pe}from"./_plugin-vue_export-helper-CeaKqebY.js";function F(e,t){return Le()?(Ce(e,t),!0):!1}const Z=new WeakMap,ze=(...e)=>{var t;const a=e[0],n=(t=ne())===null||t===void 0?void 0:t.proxy,i=n??Le();if(i==null&&!Se())throw new Error("injectLocal must be called in setup");return i&&Z.has(i)&&a in Z.get(i)?Z.get(i)[a]:Ne(...e)},q=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Fe=e=>e!=null,Be=Object.prototype.toString,qe=e=>Be.call(e)==="[object Object]",M=()=>{};function ie(...e){if(e.length!==1)return He(...e);const t=e[0];return typeof t=="function"?xe(we(()=>({get:t,set:M}))):_e(t)}function oe(e,t){function a(...n){return new Promise((i,o)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(i).catch(o)})}return"cancel"in e&&Object.assign(a,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),a}const Ee=e=>e();function Ve(e,t={}){let a,n,i=M,o=M;const s=S(!1),r=c=>{clearTimeout(c),i(),i=M};let d;return Object.assign(c=>{const u=Y(e),l=Y(t.maxWait);return a&&r(a),u<=0||l!==void 0&&l<=0?(n&&(r(n),n=void 0),s.value=!1,Promise.resolve(c())):(s.value=!0,new Promise((h,p)=>{i=t.rejectOnCancel?p:h,o=h,d=c,l&&!n&&(n=setTimeout(()=>{a&&r(a),n=void 0,s.value=!1,h(d())},l)),a=setTimeout(()=>{n&&r(n),n=void 0,s.value=!1,h(c())},u)}))},{cancel:()=>{a&&(r(a),a=void 0),n&&(r(n),n=void 0),s.value=!1,o=M},flush:()=>{if(s.value){a&&(clearTimeout(a),a=void 0),n&&(clearTimeout(n),n=void 0),s.value=!1;const c=o;i=M,o=M,c(d())}},isPending:Q(s)})}function Ke(...e){let t=0,a,n=!0,i=M,o,s,r,d,g;!$e(e[0])&&typeof e[0]=="object"?{delay:s,trailing:r=!0,leading:d=!0,rejectOnCancel:g=!1}=e[0]:[s,r=!0,d=!0,g=!1]=e;const c=()=>{a&&(clearTimeout(a),a=void 0,i(),i=M)};return l=>{const h=Y(s),p=Date.now()-t,f=()=>o=l();return c(),h<=0?(t=Date.now(),f()):(p>h?(t=Date.now(),(d||!n)&&f()):r&&(o=new Promise((v,R)=>{i=g?R:v,a=setTimeout(()=>{t=Date.now(),n=!0,v(f()),c()},Math.max(0,h-p))})),!d&&!a&&(a=setTimeout(()=>n=!0,h)),n=!1,o)}}function Je(e=Ee,t={}){const{initialState:a="active"}=t,n=ie(a==="active");function i(){n.value=!1}function o(){n.value=!0}const s=(...r)=>{n.value&&e(...r)};return{isActive:Q(n),pause:i,resume:o,eventFilter:s}}function be(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function V(e){return Array.isArray(e)?e:[e]}function Ue(e){return ne()}function ea(e,t=1e4){return we((a,n)=>{let i=Y(e),o;const s=()=>setTimeout(()=>{i=Y(e),n()},Y(t));return F(()=>{clearTimeout(o)}),{get(){return a(),i},set(r){i=r,n(),clearTimeout(o),o=s()}}})}function Ge(e,t=200,a={}){return oe(Ve(t,a),e)}function Qe(e,t=200,a=!0,n=!0,i=!1){return oe(Ke(t,a,n,i),e)}function Ze(e,t,a={}){const{eventFilter:n=Ee,...i}=a;return C(e,oe(n,t),i)}function et(e,t,a={}){const{eventFilter:n,initialState:i="active",...o}=a,{eventFilter:s,pause:r,resume:d,isActive:g}=Je(n,{initialState:i});return{stop:Ze(e,t,{...o,eventFilter:s}),pause:r,resume:d,isActive:g}}function se(e,t=!0,a){Ue()?We(e,a):t?e():ke(e)}function ta(e,t=1e3,a={}){const{immediate:n=!0,immediateCallback:i=!1}=a;let o=null;const s=S(!1);function r(){o&&(clearInterval(o),o=null)}function d(){s.value=!1,r()}function g(){const c=Y(t);c<=0||(s.value=!0,i&&e(),r(),s.value&&(o=setInterval(e,c)))}return n&&q&&g(),($e(t)||typeof t=="function")&&F(C(t,()=>{s.value&&q&&g()})),F(d),{isActive:Q(s),pause:d,resume:g}}function tt(e,t,a){return C(e,t,{...a,immediate:!0})}const $=q?window:void 0,at=q?window.document:void 0;function N(e){var t;const a=Y(e);return(t=a==null?void 0:a.$el)!==null&&t!==void 0?t:a}function B(...e){const t=(n,i,o,s)=>(n.addEventListener(i,o,s),()=>n.removeEventListener(i,o,s)),a=H(()=>{const n=V(Y(e[0])).filter(i=>i!=null);return n.every(i=>typeof i!="string")?n:void 0});return tt(()=>{var n,i;return[(n=(i=a.value)===null||i===void 0?void 0:i.map(o=>N(o)))!==null&&n!==void 0?n:[$].filter(o=>o!=null),V(Y(a.value?e[1]:e[0])),V(Ie(a.value?e[2]:e[1])),Y(a.value?e[3]:e[2])]},([n,i,o,s],r,d)=>{if(!(n!=null&&n.length)||!(i!=null&&i.length)||!(o!=null&&o.length))return;const g=qe(s)?{...s}:s,c=n.flatMap(u=>i.flatMap(l=>o.map(h=>t(u,l,h,g))));d(()=>{c.forEach(u=>u())})},{flush:"post"})}function nt(){const e=S(!1),t=ne();return t&&We(()=>{e.value=!0},t),e}function re(e){const t=nt();return H(()=>(t.value,!!e()))}function it(e,t,a={}){const{window:n=$,...i}=a;let o;const s=re(()=>n&&"MutationObserver"in n),r=()=>{o&&(o.disconnect(),o=void 0)},d=H(()=>{const l=Y(e),h=V(l).map(N).filter(Fe);return new Set(h)}),g=C(d,l=>{r(),s.value&&l.size&&(o=new MutationObserver(t),l.forEach(h=>o.observe(h,i)))},{immediate:!0,flush:"post"}),c=()=>o==null?void 0:o.takeRecords(),u=()=>{g(),r()};return F(u),{isSupported:s,stop:u,takeRecords:c}}function ot(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function aa(...e){let t,a,n={};e.length===3?(t=e[0],a=e[1],n=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,a=e[0],n=e[1]):(t=e[0],a=e[1]):(t=!0,a=e[0]);const{target:i=$,eventName:o="keydown",passive:s=!1,dedupe:r=!1}=n,d=ot(t);return B(i,o,c=>{c.repeat&&Y(r)||d(c)&&a(c)},s)}function st(e,t={}){const{immediate:a=!0,fpsLimit:n=null,window:i=$,once:o=!1}=t,s=S(!1),r=H(()=>{const h=Y(n);return h?1e3/h:null});let d=0,g=null;function c(h){if(!s.value||!i)return;d||(d=h);const p=h-d;if(r.value&&p<r.value){g=i.requestAnimationFrame(c);return}if(d=h,e({delta:p,timestamp:h}),o){s.value=!1,g=null;return}g=i.requestAnimationFrame(c)}function u(){!s.value&&i&&(s.value=!0,d=0,g=i.requestAnimationFrame(c))}function l(){s.value=!1,g!=null&&i&&(i.cancelAnimationFrame(g),g=null)}return a&&u(),F(l),{isActive:Q(s),pause:l,resume:u}}const rt=Symbol("vueuse-ssr-width");function lt(){const e=Se()?ze(rt,null):null;return typeof e=="number"?e:void 0}function dt(e,t={}){const{window:a=$,ssrWidth:n=lt()}=t,i=re(()=>a&&"matchMedia"in a&&typeof a.matchMedia=="function"),o=S(typeof n=="number"),s=S(),r=S(!1),d=g=>{r.value=g.matches};return Pe(()=>{if(o.value){o.value=!i.value;const g=Y(e).split(",");r.value=g.some(c=>{const u=c.includes("not all"),l=c.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=c.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(l||h);return l&&p&&(p=n>=be(l[1])),h&&p&&(p=n<=be(h[1])),u?!p:p});return}i.value&&(s.value=a.matchMedia(Y(e)),r.value=s.value.matches)}),B(s,"change",d,{passive:!0}),H(()=>r.value)}const K=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},J="__vueuse_ssr_handlers__",ut=ct();function ct(){return J in K||(K[J]=K[J]||{}),K[J]}function ht(e,t){return ut[e]||t}function gt(e){return dt("(prefers-color-scheme: dark)",e)}function pt(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const bt={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},fe="vueuse-storage";function je(e,t,a,n={}){var i;const{flush:o="pre",deep:s=!0,listenToStorageChanges:r=!0,writeDefaults:d=!0,mergeDefaults:g=!1,shallow:c,window:u=$,eventFilter:l,onError:h=b=>{console.error(b)},initOnMounted:p}=n,f=(c?S:_e)(typeof t=="function"?t():t),v=H(()=>Y(e));if(!a)try{a=ht("getDefaultStorage",()=>$==null?void 0:$.localStorage)()}catch(b){h(b)}if(!a)return f;const R=Y(t),w=pt(R),X=(i=n.serializer)!==null&&i!==void 0?i:bt[w],{pause:_,resume:x}=et(f,b=>O(b),{flush:o,deep:s,eventFilter:l});C(v,()=>D(),{flush:o});let W=!1;const E=b=>{p&&!W||D(b)},j=b=>{p&&!W||P(b)};u&&r&&(a instanceof Storage?B(u,"storage",E,{passive:!0}):B(u,fe,j)),p?se(()=>{W=!0,D()}):D();function y(b,m){if(u){const k={key:v.value,oldValue:b,newValue:m,storageArea:a};u.dispatchEvent(a instanceof Storage?new StorageEvent("storage",k):new CustomEvent(fe,{detail:k}))}}function O(b){try{const m=a.getItem(v.value);if(b==null)y(m,null),a.removeItem(v.value);else{const k=X.write(b);m!==k&&(a.setItem(v.value,k),y(m,k))}}catch(m){h(m)}}function L(b){const m=b?b.newValue:a.getItem(v.value);if(m==null)return d&&R!=null&&a.setItem(v.value,X.write(R)),R;if(!b&&g){const k=X.read(m);return typeof g=="function"?g(k,R):w==="object"&&!Array.isArray(k)?{...R,...k}:k}else return typeof m!="string"?m:X.read(m)}function D(b){if(!(b&&b.storageArea!==a)){if(b&&b.key==null){f.value=R;return}if(!(b&&b.key!==v.value)){_();try{const m=X.write(f.value);(b===void 0||(b==null?void 0:b.newValue)!==m)&&(f.value=L(b))}catch(m){h(m)}finally{b?ke(x):x()}}}}function P(b){D(b.detail)}return f}function ft(e,t,a={}){const{window:n=$,...i}=a;let o;const s=re(()=>n&&"ResizeObserver"in n),r=()=>{o&&(o.disconnect(),o=void 0)},d=H(()=>{const u=Y(e);return Array.isArray(u)?u.map(l=>N(l)):[N(u)]}),g=C(d,u=>{if(r(),s.value&&n){o=new ResizeObserver(t);for(const l of u)l instanceof Element&&o.observe(l,i)}},{immediate:!0,flush:"post"}),c=()=>{r(),g()};return F(c),{isSupported:s,stop:c}}function na(e,t={width:0,height:0},a={}){const{window:n=$,box:i="content-box"}=a,o=H(()=>{var u;return(u=N(e))===null||u===void 0||(u=u.namespaceURI)===null||u===void 0?void 0:u.includes("svg")}),s=S(t.width),r=S(t.height),{stop:d}=ft(e,([u])=>{const l=i==="border-box"?u.borderBoxSize:i==="content-box"?u.contentBoxSize:u.devicePixelContentBoxSize;if(n&&o.value){const h=N(e);if(h){const p=h.getBoundingClientRect();s.value=p.width,r.value=p.height}}else if(l){const h=V(l);s.value=h.reduce((p,{inlineSize:f})=>p+f,0),r.value=h.reduce((p,{blockSize:f})=>p+f,0)}else s.value=u.contentRect.width,r.value=u.contentRect.height},a);se(()=>{const u=N(e);if(u&&"offsetWidth"in u)if(i==="content-box"&&n){const l=n.getComputedStyle(u),h=Number.parseFloat(l.paddingLeft)+Number.parseFloat(l.paddingRight),p=Number.parseFloat(l.paddingTop)+Number.parseFloat(l.paddingBottom),f=Number.parseFloat(l.borderLeftWidth)+Number.parseFloat(l.borderRightWidth),v=Number.parseFloat(l.borderTopWidth)+Number.parseFloat(l.borderBottomWidth);s.value=u.offsetWidth-h-f,r.value=u.offsetHeight-p-v}else s.value=u.offsetWidth,r.value=u.offsetHeight;else u&&(s.value=t.width,r.value=t.height)});const g=C(()=>N(e),u=>{s.value=u?t.width:0,r.value=u?t.height:0});function c(){d(),g()}return{width:s,height:r,stop:c}}function yt(e){return e===!0?{}:e}const mt="message";function ia(e,t=[],a={}){const n=S(null),i=S(null),o=S("CONNECTING"),s=S(null),r=S(null),d=ie(e),g=S(null);let c=!1,u=0;const{withCredentials:l=!1,immediate:h=!0,autoConnect:p=!0,autoReconnect:f,serializer:v={read:_=>_}}=a,R=()=>{q&&s.value&&(s.value.close(),s.value=null,o.value="CLOSED",c=!0)},w=()=>{if(c||typeof d.value>"u")return;const _=new EventSource(d.value,{withCredentials:l});o.value="CONNECTING",s.value=_,_.onopen=()=>{o.value="OPEN",r.value=null},_.onerror=x=>{if(o.value="CLOSED",r.value=x,_.readyState===2&&!c&&f){_.close();const{retries:W=-1,delay:E=1e3,onFailed:j}=yt(f);u+=1,typeof W=="number"&&(W<0||u<W)||typeof W=="function"&&W()?setTimeout(w,E):j==null||j()}},t=t.length>0?t:[mt];for(const x of t)B(_,x,W=>{var E,j;n.value=x,i.value=(E=v.read(W.data))!==null&&E!==void 0?E:null,g.value=(j=W.lastEventId)!==null&&j!==void 0?j:null},{passive:!0})},X=()=>{q&&(R(),c=!1,u=0,w())};return h&&X(),p&&C(d,X),F(R),{eventSource:s,event:n,data:i,status:o,error:r,open:X,close:R,lastEventId:g}}function oa(e=null,t={}){const{baseUrl:a="",rel:n="icon",document:i=at}=t,o=ie(e),s=r=>{const d=i==null?void 0:i.head.querySelectorAll(`link[rel*="${n}"]`);if(!d||d.length===0){const g=i==null?void 0:i.createElement("link");g&&(g.rel=n,g.href=`${a}${r}`,g.type=`image/${r.split(".").pop()}`,i==null||i.head.append(g));return}d==null||d.forEach(g=>g.href=`${a}${r}`)};return C(o,(r,d)=>{typeof r=="string"&&r!==d&&s(r)},{immediate:!0}),o}const ye=1;function sa(e,t={}){const{throttle:a=0,idle:n=200,onStop:i=M,onScroll:o=M,offset:s={left:0,right:0,top:0,bottom:0},observe:r={mutation:!1},eventListenerOptions:d={capture:!1,passive:!0},behavior:g="auto",window:c=$,onError:u=y=>{console.error(y)}}=t,l=typeof r=="boolean"?{mutation:r}:r,h=S(0),p=S(0),f=H({get(){return h.value},set(y){R(y,void 0)}}),v=H({get(){return p.value},set(y){R(void 0,y)}});function R(y,O){var L,D,P,b;if(!c)return;const m=Y(e);if(!m)return;(L=m instanceof Document?c.document.body:m)===null||L===void 0||L.scrollTo({top:(D=Y(O))!==null&&D!==void 0?D:v.value,left:(P=Y(y))!==null&&P!==void 0?P:f.value,behavior:Y(g)});const k=(m==null||(b=m.document)===null||b===void 0?void 0:b.documentElement)||(m==null?void 0:m.documentElement)||m;f!=null&&(h.value=k.scrollLeft),v!=null&&(p.value=k.scrollTop)}const w=S(!1),X=pe({left:!0,right:!1,top:!0,bottom:!1}),_=pe({left:!1,right:!1,top:!1,bottom:!1}),x=y=>{w.value&&(w.value=!1,_.left=!1,_.right=!1,_.top=!1,_.bottom=!1,i(y))},W=Ge(x,a+n),E=y=>{var O;if(!c)return;const L=(y==null||(O=y.document)===null||O===void 0?void 0:O.documentElement)||(y==null?void 0:y.documentElement)||N(y),{display:D,flexDirection:P,direction:b}=c.getComputedStyle(L),m=b==="rtl"?-1:1,k=L.scrollLeft;_.left=k<h.value,_.right=k>h.value;const ue=Math.abs(k*m)<=(s.left||0),ce=Math.abs(k*m)+L.clientWidth>=L.scrollWidth-(s.right||0)-ye;D==="flex"&&P==="row-reverse"?(X.left=ce,X.right=ue):(X.left=ue,X.right=ce),h.value=k;let z=L.scrollTop;y===c.document&&!z&&(z=c.document.body.scrollTop),_.top=z<p.value,_.bottom=z>p.value;const he=Math.abs(z)<=(s.top||0),ge=Math.abs(z)+L.clientHeight>=L.scrollHeight-(s.bottom||0)-ye;D==="flex"&&P==="column-reverse"?(X.top=ge,X.bottom=he):(X.top=he,X.bottom=ge),p.value=z},j=y=>{var O;if(!c)return;const L=(O=y.target.documentElement)!==null&&O!==void 0?O:y.target;E(L),w.value=!0,W(y),o(y)};return B(e,"scroll",a?Qe(j,a,!0,!1):j,d),se(()=>{try{const y=Y(e);if(!y)return;E(y)}catch(y){u(y)}}),l!=null&&l.mutation&&e!=null&&e!==c&&e!==document&&it(e,()=>{const y=Y(e);y&&E(y)},{attributes:!0,childList:!0,subtree:!0}),B(e,"scrollend",x,d),{x:f,y:v,isScrolling:w,arrivedState:X,directions:_,measure(){const y=Y(e);c&&y&&E(y)}}}function ra(e,t,a={}){const{window:n=$}=a;return je(e,t,n==null?void 0:n.localStorage,a)}function la(e={}){const{controls:t=!1,scheduler:a=st}=e,n=S(new Date),o=a(()=>n.value=new Date);return t?{now:n,...o}:n}function da(e,t,a={}){const{window:n=$}=a;return je(e,t,n==null?void 0:n.sessionStorage,a)}const vt=e=>{let t=e>>>0;return()=>{t=t+1831565813>>>0;let a=t;return a=Math.imul(a^a>>>15,a|1),a^=a+Math.imul(a^a>>>7,a|61),((a^a>>>14)>>>0)/4294967296}},ua=e=>{const t=vt(e),a=(n,i)=>n+(i-n)*t();return{next:t,range:a,int:(n,i)=>Math.floor(a(n,i+1)),chance:n=>t()<n,vary:(n,i=.12)=>n*a(1-i,1+i)}},De=(e,t=0,a=1)=>Math.min(a,Math.max(t,e)),Oe=(e,t,a)=>e+(t-e)*a,U=/\s*(?:(\d+\.?\d*(?:e[+-]?\d+)?|\.\d+)|([A-Za-z_]\w*)|(<=|>=|==|!=|[-+*/%<>(),[\]]))/iy,Yt=e=>{const t=e.trim(),a=[];for(U.lastIndex=0;U.lastIndex<t.length;){const n=U.exec(t);if(!n)throw new Error(`cannot read "${t.slice(U.lastIndex).trim()}" in expression "${t}"`);a.push(n[1]!==void 0?{number:Number(n[1])}:n[2]!==void 0?{name:n[2]}:{op:n[3]})}return a},ee={"<":[1,(e,t)=>e<t],">":[1,(e,t)=>e>t],"<=":[1,(e,t)=>e<=t],">=":[1,(e,t)=>e>=t],"==":[1,(e,t)=>e===t],"!=":[1,(e,t)=>e!==t],"+":[2,(e,t)=>e+t],"-":[2,(e,t)=>e-t],"*":[3,(e,t)=>e*t],"/":[3,(e,t)=>e/t],"%":[3,(e,t)=>e%t]},Rt={range:(e,t,a)=>e.random.range(t,a),int:(e,t,a)=>e.random.int(t,a),chance:(e,t)=>e.random.chance(t),vary:(e,t,a)=>e.random.vary(t,a),cos:(e,t)=>Math.cos(t),sin:(e,t)=>Math.sin(t),sqrt:(e,t)=>Math.sqrt(t),abs:(e,t)=>Math.abs(t),hypot:(e,...t)=>Math.hypot(...t),min:(e,...t)=>Math.min(...t),max:(e,...t)=>Math.max(...t),lerp:(e,t,a,n)=>Oe(t,a,n),clamp:(e,t,a,n)=>De(t,a,n),len:(e,t)=>t.length},me=new Map,Xt=e=>{const t=me.get(e);if(t)return t;const a=Yt(e);let n=0;const i=()=>a[n],o=()=>a[n++],s=l=>{const h=o();if(!h||h.op!==l)throw new Error(`expected "${l}" in expression "${e}"`)},r=()=>{const l=[];if(i()&&i().op===")")return o(),l;do l.push(c(0));while(i()&&i().op===","&&o());return s(")"),l},d=()=>{const l=o();if(!l)throw new Error(`expression "${e}" ends early`);const h=l.number;if(h!==void 0)return()=>h;if(l.op==="-"){const p=g();return(f,v)=>-p(f,v)}if(l.op==="("){const p=c(0);return s(")"),p}if(l.name!==void 0){const p=l.name;if(i()&&i().op==="("){o();const f=r();if(p==="if")return(R,w)=>f[0](R,w)?f[1](R,w):f[2](R,w);const v=Rt[p];if(!v)throw new Error(`unknown function "${p}" in expression "${e}"`);return(R,w)=>v(w,...f.map(X=>X(R,w)))}return p==="PI"?()=>Math.PI:f=>{if(!(p in f))throw new Error(`unknown name "${p}" in expression "${e}"`);return f[p]}}throw new Error(`unexpected "${l.op}" in expression "${e}"`)},g=()=>{let l=d();for(;i()&&i().op==="[";){o();const h=c(0);s("]");const p=l;l=(f,v)=>p(f,v)[h(f,v)]}return l},c=l=>{let h=g();for(;i()&&ee[i().op??""]&&ee[i().op??""][0]>=l;){const[p,f]=ee[o().op??""],v=c(p+1),R=h;h=(w,X)=>f(R(w,X),v(w,X))}return h},u=c(0);if(n<a.length)throw new Error(`unexpected "${JSON.stringify(a[n])}" in expression "${e}"`);return me.set(e,u),u},te=e=>Object.create(e),I=(e,t,a)=>{const n=Object.keys(e).filter(i=>!t.includes(i));if(n.length)throw new Error(`${a} has unknown key "${n[0]}"`)},T=(e,t,a)=>{if(typeof e=="number")return e;if(typeof e=="string")return Xt(e)(t,a);if(Array.isArray(e))return e.map(n=>T(n,t,a));if(e&&typeof e=="object"&&"if"in e)return I(e,["if","then","else"],"value {if}"),T(T(e.if,t,a)?e.then:e.else,t,a);if(e&&typeof e=="object"&&e.map){const n=e.map;return I(n,["count","values","as","let","value"],"value {map}"),Ae(n,t,a).map(i=>(le(n.let,i,a),T(n.value,i,a)))}throw new Error(`cannot evaluate ${JSON.stringify(e)}`)},le=(e,t,a)=>{Object.entries(e||{}).forEach(([n,i])=>{t[n]=T(i,t,a)})},Ae=(e,t,a)=>(e.values!==void 0?T(e.values,t,a):Array.from({length:T(e.count,t,a)},(i,o)=>o)).map((i,o)=>{const s=te(t);return s.index=o,e.as&&(s[e.as]=i),s}),ve={ellipse:e=>{const[t,a,n,i,o=0]=e;return{kind:"ellipse",x:t,y:a,radiusX:n,radiusY:i,angle:o}},circle:e=>{const[t,a,n]=e;return{kind:"ellipse",x:t,y:a,radiusX:n,radiusY:n,angle:0}},polygon:e=>({kind:"polygon",points:e}),blob:e=>({kind:"blob",points:e}),tube:(e,t,a,n)=>({kind:"tube",points:e,radii:[].concat(T(t.radii,a,n))})},G=(e,t,a,n)=>{e.forEach(i=>{const o=Object.keys(ve).find(s=>s in i);if(o){I(i,[o,"radii","cut","part"],`shape {${o}}`);const s=ve[o](T(i[o],t,a),i,t,a);n.push(i.cut?Object.assign({},s,{cut:!0}):s)}else if("let"in i)I(i,["let","part"],"statement {let}"),le(i.let,t,a);else if("repeat"in i){I(i,["repeat","part"],"statement {repeat}");const s=i.repeat;I(s,["count","values","as","body"],"repeat"),Ae(s,t,a).forEach(r=>G(s.body||[],r,a,n))}else if("if"in i)I(i,["if","then","else","part"],"statement {if}"),G((T(i.if,t,a)?i.then:i.else)||[],te(t),a,n);else if("use"in i){I(i,["use","with","part"],"statement {use}");const s=a.defs[i.use];if(!s)throw new Error(`unknown def "${i.use}"`);const r=te(t);Object.entries(i.with||{}).forEach(([d,g])=>{r[d]=T(g,t,a)}),G(s,r,a,n)}else throw new Error(`unknown statement ${JSON.stringify(i)}`)})},wt=(e,t)=>{const a={...e};return Object.entries(t||{}).forEach(([n,i])=>{const o=a[n]||{};a[n]={...o,...i,params:{...o.params,...i.params},drop:[...o.drop||[],...i.drop||[]],body:[...o.body||[],...i.body||[]]}}),a},Ye=new WeakMap,de=(e,t,a=[])=>{const n=Ye.get(e)||new Map;Ye.set(e,n);const i=n.get(t);if(i)return i;const o=e[t];if(!o)throw new Error(`unknown species "${t}"`);if(a.includes(t))throw new Error(`species "${t}" extends itself through ${a.join(" > ")}`);const s=o.extends?de(e,o.extends,[...a,t]):{params:{},defs:{},body:[],poses:{}},r={name:t,params:{...s.params,...o.params},defs:{...s.defs,...o.defs},body:[...s.body.filter(d=>!(o.drop||[]).includes(d.part??"")),...o.body||[]],poses:wt(s.poses,o.poses)};return n.set(t,r),r},Me=e=>Object.entries(e.poses).map(([t,a])=>[t,a.weight===void 0?1:a.weight]).filter(([,t])=>t>0),_t=(e,t)=>{if(e.length<2)return e.length?e[0][0]:"";let a=t.next()*e.reduce((i,[,o])=>i+o,0);return(e.find(([,i])=>(a-=i,a<0))||e[e.length-1])[0]},ca=(e,t,a,n={})=>{const i=de(e,t),o=Me(i),s=n.pose&&o.some(([l])=>l===n.pose)?n.pose:_t(o,a),r=i.poses[s]||{},d=new Set(r.drop||[]),g={random:a,defs:i.defs},c={},u=[];try{le({...i.params,...r.params},c,g),G([...i.body.filter(l=>!d.has(l.part??"")),...r.body||[]],c,g,u)}catch(l){throw new Error(`species "${t}"${s?` (pose ${s})`:""}: ${l.message}`,{cause:l})}return{shapes:u,pose:s}},ha=e=>Object.keys(e).filter(t=>!e[t].abstract),ga=(e,t)=>{const a=Me(de(e,t)).map(([n])=>n);return a.length?a:[""]},A=256,ae=2.6,Re=A/ae,kt=(e,t,a,n,i)=>{const o=i*i,s=o*i,r=d=>.5*(2*t[d]+(-e[d]+a[d])*i+(2*e[d]-5*t[d]+4*a[d]-n[d])*o+(-e[d]+3*t[d]-3*a[d]+n[d])*s);return[r(0),r(1)]},Xe=(e,t,a)=>{const n=e.length,i=r=>t?e[(r+n)%n]:e[De(r,0,n-1)],o=t?n:n-1,s=[];for(let r=0;r<o;r+=1)for(let d=0;d<a;d+=1)s.push(kt(i(r-1),i(r),i(r+1),i(r+2),d/a));return t||s.push(e[n-1]),s},St=(e,t)=>{if(e.length===1)return e[0];const a=t*(e.length-1),n=Math.min(e.length-2,Math.floor(a));return Oe(e[n],e[n+1],a-n)},Te=(e,t)=>{if(e.globalCompositeOperation=t.cut?"destination-out":"source-over",e.beginPath(),t.kind==="ellipse")e.ellipse(t.x,t.y,t.radiusX,t.radiusY,t.angle,0,Math.PI*2),e.fill();else if(t.kind==="polygon"||t.kind==="blob")(t.kind==="blob"?Xe(t.points,!0,12):t.points).forEach(([n,i],o)=>o===0?e.moveTo(n,i):e.lineTo(n,i)),e.closePath(),e.fill();else if(t.kind==="tube"){const a=Xe(t.points,!1,24);a.forEach(([n,i],o)=>{const s=St(t.radii,o/Math.max(1,a.length-1));e.moveTo(n+s,i),e.arc(n,i,s,0,Math.PI*2)}),e.fill()}},pa=(e,t)=>{const a=document.createElement("canvas");a.width=A,a.height=A;const n=a.getContext("2d",{willReadFrequently:!0});if(!n)return new Uint8Array(A*A);n.translate(A/2,A/2),n.scale(Re*t.facing*t.stretchX,Re*t.stretchY),n.rotate(t.tilt),n.fillStyle="#000",e.forEach(s=>Te(n,s));const i=n.getImageData(0,0,A,A).data,o=new Uint8Array(A*A);for(let s=0;s<o.length;s+=1)o[s]=i[s*4+3]>127?1:0;return o},ba=(e,t,a)=>{const n=e.getContext("2d");n&&(n.clearRect(0,0,e.width,e.height),n.save(),n.translate(e.width/2,e.height/2),n.scale(e.width/ae,e.width/ae),n.fillStyle=a,t.forEach(i=>Te(n,i)),n.restore())},Lt=!0,Wt={groundY:.8,bodyRadiusX:"range(0.4, 0.46)",bodyRadiusY:"range(0.27, 0.32)",bodyAngle:-.45,legLength:"range(0.28, 0.34)",bodyY:"groundY - legLength - bodyRadiusY",headRadius:"range(0.15, 0.18)",headX:"bodyRadiusX * 0.55",headY:"bodyY - bodyRadiusY * 0.95 - headRadius * 0.4",neckWidth:"headRadius * 0.85",beakLength:"range(0.17, 0.23)",beakHeight:.09,tailLength:"range(0.3, 0.4)",tailSpread:.14,tailDrop:.18,legWidth:.022,wingWidth:.12},$t=[{ellipse:[0,"bodyY","bodyRadiusX","bodyRadiusY","bodyAngle"],part:"body"},{tube:[["bodyRadiusX * 0.25","bodyY - bodyRadiusY * 0.4"],["headX","headY + headRadius * 0.4"]],radii:["bodyRadiusY * 0.7","neckWidth"],part:"neck"},{circle:["headX","headY","headRadius"],part:"head"},{polygon:[["headX + headRadius * 0.7","headY - beakHeight * 0.6"],["headX + headRadius + beakLength","headY + beakHeight * 0.3"],["headX + headRadius * 0.7","headY + beakHeight * 0.7"]],part:"head"},{circle:["headX + headRadius * 0.3","headY - headRadius * 0.15",.025],cut:!0,part:"eye"},{polygon:[["-bodyRadiusX * 0.6","bodyY - tailSpread * 0.4"],["-bodyRadiusX * 0.6 - tailLength","bodyY + tailDrop - tailSpread"],["-bodyRadiusX * 0.6 - tailLength * 0.95","bodyY + tailDrop + tailSpread * 0.4"],["-bodyRadiusX * 0.3","bodyY + tailSpread * 0.6"]],part:"tail"},{tube:[["-bodyRadiusX * 0.55","bodyY - bodyRadiusY * 0.15"],["-bodyRadiusX * 0.1","bodyY + bodyRadiusY * 0.3"],["bodyRadiusX * 0.35","bodyY - bodyRadiusY * 0.05"]],radii:.012,cut:!0,part:"wing"},{repeat:{values:[-.08,.1],as:"legShift",body:[{tube:[["legShift","bodyY + bodyRadiusY * 0.6"],["legShift","groundY"]],radii:"legWidth"},{ellipse:["legShift + 0.05","groundY",.07,.02]}]},part:"legs"}],Et={perched:{weight:3},sleeping:{weight:1,params:{headX:"bodyRadiusX * 0.35",headY:"bodyY - bodyRadiusY * 0.55",beakLength:.1,bodyAngle:-.2},drop:["neck","eye","wing"],body:[{tube:[["headX + headRadius * 0.4","headY - headRadius * 0.1"],["headX + headRadius * 0.65","headY - headRadius * 0.05"]],radii:.012,cut:!0}]},front:{weight:1,params:{headX:0,headY:"bodyY - bodyRadiusX * 0.8 - headRadius * 0.2"},drop:["body","neck","head","eye","tail","wing","legs"],body:[{ellipse:[0,"bodyY - 0.02","bodyRadiusY * 1.25","bodyRadiusX * 0.95"]},{circle:["headX","headY","headRadius * 1.1"]},{polygon:[["headX - beakHeight","headY + headRadius * 0.15"],["headX + beakHeight","headY + headRadius * 0.15"],["headX","headY + headRadius * 0.15 + beakLength * 0.6"]]},{repeat:{values:[-1,1],as:"side",body:[{circle:["headX + side * headRadius * 0.45","headY - headRadius * 0.2",.027],cut:!0},{ellipse:["side * bodyRadiusY * 1.15","bodyY + 0.02","wingWidth * 0.9","bodyRadiusX * 0.6","side * -0.15"]},{tube:[["side * 0.1","groundY - legLength"],["side * 0.1","groundY"]],radii:"legWidth"},{ellipse:["side * 0.12","groundY",.07,.02]}]}}]}},jt={abstract:Lt,params:Wt,body:$t,poses:Et},Dt=!0,Ot={groundY:.7,bodyRadiusX:"range(0.5, 0.56)",bodyRadiusY:"range(0.26, 0.31)",legLength:"range(0.4, 0.5)",legWidth:.07,stride:0,bodyY:"groundY - bodyRadiusY - legLength",headRadiusX:"range(0.19, 0.22)",headRadiusY:"range(0.16, 0.18)",headX:"bodyRadiusX * 0.95",headY:"bodyY - bodyRadiusY * 0.8",neckWidth:"headRadiusY * 0.9",snoutLength:.16,snoutRadius:.08,earHeight:"range(0.16, 0.22)",earWidth:.09,earSpread:"range(0.1, 0.3)",eyeSize:.028,tailLength:"range(0.35, 0.45)",tailLift:"range(0.05, 0.2)",tailWidth:.06},At={ears:[{repeat:{values:[-.5,.3],as:"shift",body:[{polygon:[["headX + headRadiusX * shift - earWidth","headY - headRadiusY * 0.5"],["headX + headRadiusX * shift - earWidth * 0.2","headY - headRadiusY * 0.75 - earHeight"],["headX + headRadiusX * shift + earWidth","headY - headRadiusY * 0.7"]]}]}}]},Mt=[{ellipse:[0,"bodyY","bodyRadiusX","bodyRadiusY"],part:"body"},{tube:[["bodyRadiusX * 0.5","bodyY - bodyRadiusY * 0.2"],["headX - headRadiusX * 0.3","headY + headRadiusY * 0.2"]],radii:["bodyRadiusY * 0.8","neckWidth"],part:"neck"},{ellipse:["headX","headY","headRadiusX","headRadiusY"],part:"head"},{ellipse:["headX + headRadiusX * 0.75","headY + headRadiusY * 0.35","snoutLength","snoutRadius"],part:"head"},{use:"ears",part:"head"},{circle:["headX + headRadiusX * 0.4","headY - headRadiusY * 0.15","eyeSize"],cut:!0,part:"eye"},{tube:[["-bodyRadiusX * 0.85","bodyY - bodyRadiusY * 0.2"],["-bodyRadiusX * 0.85 - tailLength * 0.5","bodyY - bodyRadiusY * 0.2 - tailLift * 0.5"],["-bodyRadiusX * 0.85 - tailLength","bodyY - bodyRadiusY * 0.2 - tailLift"]],radii:["tailWidth","tailWidth * 0.9","tailWidth * 0.6"],part:"tail"},{repeat:{values:[-.72,-.5,.4,.68],as:"along",body:[{let:{swing:"if(index % 2 == 0, stride, -stride)",legX:"along * bodyRadiusX",hipY:"bodyY + bodyRadiusY * 0.5"}},{tube:[["legX","hipY"],["legX + swing","(hipY + groundY) / 2"],["legX + swing * 1.2","groundY"]],radii:["legWidth * 1.25","legWidth * 0.9","legWidth * 0.8"]}]},part:"legs"}],Tt={standing:{weight:3},walking:{weight:2,params:{stride:"range(0.06, 0.14)"}},sleeping:{weight:1,params:{legLength:.02,headX:"bodyRadiusX * 0.8",headY:"groundY - headRadiusY",tailLift:.02},drop:["legs","eye","neck"],body:[{ellipse:["bodyRadiusX * 0.55","groundY - 0.05","bodyRadiusX * 0.28",.06]},{tube:[["headX + headRadiusX * 0.2","headY - headRadiusY * 0.1"],["headX + headRadiusX * 0.4","headY"],["headX + headRadiusX * 0.6","headY - headRadiusY * 0.1"]],radii:.012,cut:!0}]},sitting:{weight:1,params:{headX:"bodyRadiusY * 0.5",headY:"groundY - bodyRadiusX * 1.55 - headRadiusY * 0.4"},drop:["body","neck","legs","tail"],body:[{ellipse:["bodyRadiusY * 0.2","groundY - bodyRadiusX * 0.85","bodyRadiusY * 1.05","bodyRadiusX * 0.9",.12]},{ellipse:["-bodyRadiusY * 0.55","groundY - bodyRadiusY * 0.55","bodyRadiusY * 1.2","bodyRadiusY * 0.62"]},{tube:[["bodyRadiusY * 0.75","groundY - bodyRadiusX * 1.0"],["bodyRadiusY * 0.8","groundY"]],radii:"legWidth * 1.1"},{tube:[["-bodyRadiusY * 1.2","groundY - 0.05"],["-bodyRadiusY * 1.2 - tailLength","groundY - 0.03"]],radii:["tailWidth","tailWidth * 0.6"]}]},front:{weight:1,params:{headX:0,headY:"groundY - bodyRadiusX * 1.1 - headRadiusY * 0.9"},drop:["body","neck","head","eye","legs","tail"],body:[{ellipse:[0,"groundY - bodyRadiusX * 0.7","bodyRadiusY * 1.25","bodyRadiusX * 0.75"]},{ellipse:["headX","headY","headRadiusX * 1.15","headRadiusY * 1.1"]},{ellipse:["headX","headY + headRadiusY * 0.45","snoutRadius * 1.5","snoutRadius"]},{repeat:{values:[-1,1],as:"side",body:[{polygon:[["headX + side * headRadiusX * 1.05","headY - headRadiusY * 0.3"],["headX + side * headRadiusX * (0.75 + earSpread)","headY - headRadiusY * 0.8 - earHeight"],["headX + side * headRadiusX * 0.3","headY - headRadiusY * 1.0"]]},{circle:["headX + side * headRadiusX * 0.5","headY - headRadiusY * 0.15","eyeSize * 1.2"],cut:!0},{tube:[["side * bodyRadiusY * 0.55","groundY - bodyRadiusX * 0.4"],["side * bodyRadiusY * 0.55","groundY"]],radii:"legWidth * 1.3"}]}},{circle:["headX","headY + headRadiusY * 0.3","snoutRadius * 0.35"],cut:!0}]}},Ht={abstract:Dt,params:Ot,defs:At,body:Mt,poses:Tt},xt=!0,Nt={length:"range(0.85, 0.95)",height:"range(0.36, 0.42)",arch:0,dorsalHeight:"range(0.2, 0.28)",finLength:.22,flukeSpan:.32,eyeX:.58,eyeSize:.035},Ct=[{blob:[["length","arch * 0.6"],["length * 0.55","-height * 0.8 - arch * 0.2"],["-length * 0.2","-height * 0.7 - arch * 0.2"],["-length * 0.75","-height * 0.12 + arch * 0.6"],["-length * 0.75","height * 0.12 + arch * 0.6"],["-length * 0.2","height * 0.8 - arch * 0.4"],["length * 0.5","height * 0.75 - arch * 0.2"]]},{polygon:[["-length * 0.7","arch * 0.6"],["-length - flukeSpan * 0.55","arch * 0.6 - flukeSpan"],["-length - flukeSpan * 0.3","arch * 0.6"],["-length - flukeSpan * 0.55","arch * 0.6 + flukeSpan"]],part:"fluke"},{polygon:[["length * 0.3","-height * 0.75 - arch * 0.2"],["-length * 0.2","-height * 0.7 - arch * 0.2 - dorsalHeight"],["-length * 0.35","-height * 0.65 - arch * 0.2"]]},{ellipse:["length * 0.2","height * 0.6 - arch * 0.3","finLength",.06,.6]},{circle:["length * eyeX","-height * 0.1 + arch * 0.4","eyeSize"],cut:!0}],Pt={cruising:{weight:3},leaping:{weight:0,params:{arch:.38}}},It={abstract:xt,params:Nt,body:Ct,poses:Pt},zt=[{let:{humpHeight:"range(0.18, 0.3)",headDrop:"range(-0.08, 0.12)",legLength:"range(0.68, 0.8)"}},{ellipse:[-.1,0,"vary(0.62, 0.06)","vary(0.38, 0.06)"]},{ellipse:[.2,-.12,.32,"humpHeight + 0.1"]},{ellipse:[.62,"-0.02 + headDrop",.27,.23,.15]},{ellipse:[.82,"0.08 + headDrop",.12,.09,.5]},{circle:[.5,"-0.24 + headDrop",.1]},{circle:[.68,"-0.26 + headDrop",.09]},{circle:[-.72,-.08,.07]},{circle:[.7,"-0.04 + headDrop",.03],cut:!0},{repeat:{values:[-.55,-.3,.15,.36],as:"legX",body:[{tube:[["legX",.15],["legX + range(-0.04, 0.04)","legLength"]],radii:[.14,.12]},{ellipse:["legX + 0.06","legLength + 0.03",.14,.06]}]}}],Ft={body:zt},Bt={sitting:{weight:.55,body:[{let:{headX:"range(0.12, 0.28)",headY:"range(-0.58, -0.45)",earHeight:"range(0.26, 0.4)",earTilt:"range(-0.08, 0.08)",curlsForward:"chance(0.5)",tailPoints:{if:"curlsForward",then:[[-.5,.78],[-.2,.92],[.25,.9],["range(0.45, 0.6)","range(0.7, 0.85)"]],else:[[-.55,.7],[-.88,.62],["-range(0.9, 1.05)",.3],["-range(0.75, 0.95)","range(-0.05, 0.15)"]]}}},{ellipse:[-.15,.45,"vary(0.48)","vary(0.4)"]},{ellipse:[.1,.05,"vary(0.3)",.5,-.15]},{ellipse:["headX","headY","vary(0.27, 0.08)","vary(0.23, 0.08)"]},{polygon:[["headX - 0.25","headY - 0.04"],["headX - 0.2 + earTilt","headY - 0.12 - earHeight"],["headX - 0.02","headY - 0.18"]]},{polygon:[["headX + 0.04","headY - 0.18"],["headX + 0.22 + earTilt","headY - 0.12 - earHeight"],["headX + 0.27","headY - 0.03"]]},{tube:[[.14,.3],[.16,.86]],radii:.07},{tube:[[.3,.3],[.33,.86]],radii:.065},{tube:"tailPoints",radii:[.075,.07,.065,.055]},{ellipse:["headX - 0.1","headY - 0.01",.045,.03],cut:!0},{ellipse:["headX + 0.1","headY - 0.01",.045,.03],cut:!0}]},walking:{weight:.45,body:[{let:{tailHeight:"range(0.6, 0.95)",tailHook:"range(-0.25, 0.15)",stride:"range(0.05, 0.16)",headY:"range(-0.32, -0.18)"}},{ellipse:[-.05,.05,"vary(0.58, 0.08)","vary(0.22)"]},{ellipse:[.62,"headY",.21,.19]},{polygon:[[.45,"headY - 0.08"],[.47,"headY - 0.38"],[.6,"headY - 0.17"]]},{polygon:[[.64,"headY - 0.17"],[.76,"headY - 0.38"],[.8,"headY - 0.06"]]},{tube:[[-.45,.1],["-0.45 - stride",.42],["-0.42 - stride",.68]],radii:[.08,.055,.05]},{tube:[[-.25,.12],["-0.22 + stride",.45],["-0.2 + stride",.68]],radii:[.07,.05,.05]},{tube:[[.3,.12],["0.3 + stride",.45],["0.32 + stride",.68]],radii:[.07,.05,.05]},{tube:[[.42,.12],["0.42 - stride",.45],["0.43 - stride",.68]],radii:[.07,.05,.05]},{tube:[[-.58,-.02],[-.85,-.25],[-.85,"-tailHeight + 0.2"],["-0.7 + tailHook","-tailHeight"]],radii:[.06,.055,.05,.045]},{ellipse:[.68,"headY - 0.02",.035,.022],cut:!0}]}},qt={poses:Bt},Vt={antler:[{let:{height:"range(0.42, 0.6)"}},{let:{beam:[["rootX","rootY"],["rootX - 0.1 * spread","rootY - height * 0.4"],["rootX - 0.06 * spread","rootY - height * 0.8"],["rootX + 0.08 * spread","rootY - height"]]}},{tube:"beam",radii:[.04,.036,.032,.026]},{repeat:{count:"int(2, 4)",body:[{let:{anchor:"beam[min(3, index + 1)]",length:"range(0.12, 0.2)"}},{tube:["anchor",["anchor[0] + length * 0.7 * spread","anchor[1] - length"]],radii:[.03,.024]}]}}]},Kt=[{let:{neckLean:"range(0.4, 0.55)",headY:"range(-0.55, -0.42)",legLength:"range(0.85, 0.95)",headX:"neckLean + 0.08"}},{ellipse:[-.1,.05,"vary(0.48, 0.06)","vary(0.21, 0.08)"]},{tube:[[.25,0],["neckLean - 0.05",-.25],["neckLean","headY + 0.05"]],radii:[.13,.09,.075]},{ellipse:["headX","headY",.14,.09,.4]},{ellipse:["headX + 0.13","headY + 0.07",.09,.06,.4]},{ellipse:["headX - 0.13","headY - 0.06",.1,.035,-.5]},{ellipse:[-.58,-.04,.07,.04,-.5]},{tube:[[-.45,.12],[-.5,.5],[-.42,"legLength"]],radii:[.055,.035,.03]},{tube:[[-.32,.14],[-.34,.5],[-.3,"legLength"]],radii:[.05,.035,.03]},{tube:[[.2,.15],[.22,.55],[.2,"legLength"]],radii:[.045,.035,.03]},{tube:[[.32,.12],[.36,.52],[.33,"legLength"]],radii:[.045,.035,.03]},{circle:["headX + 0.02","headY - 0.02",.025],cut:!0},{use:"antler",with:{rootX:"headX - 0.06",rootY:"headY - 0.06",spread:-.8}},{use:"antler",with:{rootX:"headX + 0.04",rootY:"headY - 0.06",spread:1.3}}],Jt={defs:Vt,body:Kt},Ut={length:"range(0.8, 0.88)",height:"range(0.2, 0.25)",dorsalHeight:.2,flukeSpan:.36,finLength:.2,eyeX:.62,eyeSize:.025},Gt=["fluke"],Qt=[{ellipse:["-length * 0.85","arch * 0.6 - flukeSpan * 0.45","flukeSpan * 0.55",.07,-.95],part:"fluke"},{ellipse:["-length * 0.85","arch * 0.6 + flukeSpan * 0.45","flukeSpan * 0.55",.07,.95],part:"fluke"},{ellipse:["length + 0.03","height * 0.35 + arch * 0.6",.15,.06,.12]}],Zt={leaping:{weight:1}},e0={extends:"swimmer",params:Ut,drop:Gt,body:Qt,poses:Zt},t0={bodyRadiusX:"range(0.5, 0.56)",bodyRadiusY:"range(0.27, 0.3)",bodyAngle:-.1,legLength:.16,headRadius:.15,headX:"bodyRadiusX * 0.7",headY:"bodyY - bodyRadiusY - 0.12",neckWidth:.1,beakLength:.17,beakHeight:.07,tailLength:.2,tailSpread:.1,tailDrop:-.12,wingWidth:.15},a0={extends:"bird",params:t0},n0=[{let:{earSize:"range(0.9, 1.15)",trunkCurl:"range(-0.1, 0.25)",headY:"range(-0.32, -0.2)",legLength:"range(0.76, 0.86)"}},{ellipse:[-.15,0,"vary(0.6, 0.06)","vary(0.4, 0.06)"]},{ellipse:[.45,"headY",.3,.3]},{tube:[[-.73,-.1],[-.8,.15],[-.8,.38]],radii:[.025,.02,.035]},{repeat:{values:[-.6,-.36,.05,.26],as:"legX",body:[{tube:[["legX",.2],["legX","legLength"]],radii:.12}]}},{tube:[[.6,"headY + 0.28"],[.78,"headY + 0.38"],[.92,"headY + 0.3"]],radii:.035,cut:!0},{tube:[[.68,"headY - 0.02"],[.84,"headY + 0.25"],[.86,"headY + 0.6"],["0.9 + trunkCurl","headY + 0.92"],["1.02 + trunkCurl","headY + 0.85"]],radii:[.12,.1,.075,.055,.045]},{let:{earPoints:{map:{values:[[.12,-.52],[.38,-.6],[.48,-.22],[.38,.16],[.14,.1],[.02,-.2]],as:"point",value:["0.27 + (point[0] - 0.27) * earSize","headY + 0.05 + (point[1] + 0.2) * earSize"]}}}},{blob:"earPoints"},{tube:["earPoints[1]","earPoints[2]","earPoints[3]"],radii:.022,cut:!0},{circle:[.58,"headY - 0.04",.035],cut:!0}],i0={body:n0},o0={height:"range(0.4, 0.48)",dorsalHeight:.22,eyeX:.62,eyeSize:.05},s0={extends:"swimmer",params:o0},r0=["neck"],l0={bodyRadiusX:"range(0.3, 0.34)",bodyRadiusY:.2,bodyAngle:-.12,legLength:"range(0.75, 0.85)",headRadius:.07,headX:"range(0.38, 0.48)",headY:"bodyY - bodyRadiusY - range(0.7, 0.8)",beakLength:.12,beakHeight:.05,tailLength:.12,tailSpread:.06,tailDrop:.02,legWidth:.026,wingWidth:.08},d0=[{tube:[["bodyRadiusX * 0.55","bodyY - bodyRadiusY * 0.4"],["bodyRadiusX * 0.9","bodyY - bodyRadiusY - 0.28"],["headX - 0.14","headY + 0.3"],["headX - 0.02","headY + 0.08"]],radii:[.075,.04,.035,.03],part:"neck"}],u0={sleeping:{weight:0},front:{weight:0}},c0={extends:"bird",drop:r0,params:l0,body:d0,poses:u0},h0=[{let:{earHeight:"range(0.28, 0.4)",snout:"range(0.95, 1.1)",tailDroop:"range(-0.15, 0.25)",tailBush:"range(0.13, 0.19)",legLength:"range(0.6, 0.72)"}},{ellipse:[-.05,.05,"vary(0.48, 0.08)","vary(0.19)"]},{ellipse:[.35,0,.18,.22]},{blob:[[.28,-.12],[.52,-.32],[.72,-.28],["snout",-.12],[.75,-.04],[.48,.14]]},{polygon:[[.48,-.26],[.5,"-0.28 - earHeight"],[.63,-.31]]},{polygon:[[.6,-.3],[.7,"-0.28 - earHeight * 0.95"],[.75,-.25]]},{tube:[[-.45,.02],[-.75,"0.12 + tailDroop * 0.5"],[-1,"0.08 + tailDroop"],[-1.15,"-0.06 + tailDroop"]],radii:[.06,"tailBush","tailBush * 0.85",.025]},{ellipse:[.7,-.17,.035,.022,-.3],cut:!0},{repeat:{values:[-.4,-.25,.28,.4],as:"legX",body:[{let:{step:"if(index % 2 == 0, range(-0.08, 0.08), 0)"}},{tube:[["legX",.12],["legX + step","legLength"]],radii:[.05,.035]}]}}],g0={body:h0},p0=[{let:{bodyY:"range(0.05, 0.15)",bodyRadiusX:"range(0.6, 0.72)",bodyRadiusY:"range(0.3, 0.38)",spikeCount:"int(11, 17)",spikeLength:"range(0.3, 0.45)",sweep:"range(0.2, 0.55)",frontAngle:"PI * range(1.62, 1.75)"}},{ellipse:[0,"bodyY","bodyRadiusX","bodyRadiusY"]},{repeat:{count:"spikeCount",body:[{let:{angle:"lerp(PI * 0.88, frontAngle, index / (spikeCount - 1)) + range(-0.04, 0.04)",baseX:"cos(angle) * bodyRadiusX * 0.9",baseY:"bodyY + sin(angle) * bodyRadiusY * 0.9",directionX:"cos(angle) - sweep",directionY:"sin(angle) * 1.2",directionLength:"hypot(directionX, directionY)",length:"spikeLength * range(0.7, 1.25)",halfWidth:"range(0.07, 0.1)",tangentX:"-directionY / directionLength",tangentY:"directionX / directionLength"}},{polygon:[["baseX - tangentX * halfWidth","baseY - tangentY * halfWidth"],["baseX + directionX / directionLength * (length + 0.08)","baseY + directionY / directionLength * (length + 0.08)"],["baseX + tangentX * halfWidth","baseY + tangentY * halfWidth"]]}]}},{let:{snoutX:"bodyRadiusX * 0.85",snoutReach:"range(0.28, 0.42)"}},{ellipse:["snoutX - 0.05","bodyY + 0.12",.3,.2,.3]},{polygon:[["snoutX - 0.05","bodyY - 0.02"],["snoutX + snoutReach","bodyY + 0.25"],["snoutX - 0.1","bodyY + 0.3"]]},{circle:["snoutX + snoutReach - 0.02","bodyY + 0.25",.055]},{repeat:{values:[-.42,-.15,.22,.45],as:"legX",body:[{tube:[["legX","bodyY + bodyRadiusY * 0.7"],["legX + 0.04","bodyY + bodyRadiusY + range(0.08, 0.14)"]],radii:.06}]}},{circle:["snoutX + 0.04","bodyY + 0.08",.04],cut:!0}],b0={body:p0},f0=["neck"],y0={bodyRadiusX:"range(0.6, 0.68)",bodyRadiusY:"range(0.3, 0.34)",legLength:"range(0.6, 0.7)",legWidth:.055,headRadiusX:.17,headRadiusY:.14,headX:"bodyRadiusX * 0.95 + 0.22",headY:"bodyY - bodyRadiusY - 0.32",neckWidth:.1,snoutLength:.24,snoutRadius:.09,earHeight:.1,earWidth:.05,tailLength:.3,tailLift:"range(-0.6, -0.4)",tailWidth:.07},m0=[{tube:[["bodyRadiusX * 0.55","bodyY - bodyRadiusY * 0.9"],["bodyRadiusX * 0.7","bodyY - bodyRadiusY - 0.2"],["headX - 0.06","headY - headRadiusY * 0.8"]],radii:[.1,.075,.045],part:"neck"}],v0={sitting:{weight:0},front:{weight:0}},Y0={extends:"quadruped",drop:f0,params:y0,body:m0,poses:v0},R0=[{let:{mantleRadius:"range(0.38, 0.46)",mantleLift:"range(0.35, 0.5)",armCount:"int(7, 8)",sway:"range(0.2, 0.5)"}},{ellipse:[0,"-mantleLift","mantleRadius","mantleRadius * 1.25"]},{ellipse:[0,.05,"mantleRadius * 1.1",.3]},{repeat:{count:"armCount",body:[{let:{spread:"lerp(-0.65, 0.65, index / (armCount - 1))",wave:"if(index % 2 == 0, sway, -sway) * range(0.6, 1.2)",reach:"range(0.5, 0.7)"}},{tube:[["spread * 0.45",.1],["spread * 0.9 + wave * 0.3","reach * 0.5"],["spread * 1.2 + wave","reach"],["spread * 1.1 + wave * 1.4","reach + 0.18"]],radii:[.1,.075,.05,.02]}]}},{circle:["-mantleRadius * 0.4","-mantleLift + 0.15",.07],cut:!0},{circle:["mantleRadius * 0.4","-mantleLift + 0.15",.07],cut:!0}],X0={body:R0},w0={bodyRadiusX:"range(0.56, 0.62)",bodyRadiusY:"range(0.2, 0.24)",legLength:"range(0.16, 0.22)",legWidth:.075,headRadiusX:.17,headRadiusY:.15,headX:"bodyRadiusX + 0.02",headY:"bodyY - bodyRadiusY * 0.7",neckWidth:"bodyRadiusY * 0.8",snoutLength:.11,snoutRadius:.07,earHeight:.04,earWidth:.05,tailLength:"range(0.5, 0.62)",tailLift:"range(-0.1, 0.05)",tailWidth:.11},_0={extends:"quadruped",params:w0},k0=[{let:{tuftHeight:"range(0.3, 0.5)",eyeSize:"range(0.13, 0.17)",lookX:"range(-0.04, 0.04)"}},{ellipse:[0,.15,"vary(0.46, 0.08)","vary(0.6, 0.06)"]},{ellipse:[0,-.4,.44,.33]},{polygon:[[-.42,-.5],[-.5,"-0.5 - tuftHeight"],[-.16,-.66]]},{polygon:[[.42,-.5],[.5,"-0.5 - tuftHeight"],[.16,-.66]]},{ellipse:[-.42,.2,.15,.42,.18]},{ellipse:[.42,.2,.15,.42,-.18]},{tube:[[-1.15,.82],[0,.8],[1.15,"range(0.78, 0.88)"]],radii:.05},{tube:[[-.14,.7],[-.16,.82]],radii:.045},{tube:[[.14,.7],[.16,.82]],radii:.045},{circle:[-.2,-.4,"eyeSize"],cut:!0},{circle:[.2,-.4,"eyeSize"],cut:!0},{circle:["-0.2 + lookX",-.4,"eyeSize * 0.42"]},{circle:["0.2 + lookX",-.4,"eyeSize * 0.42"]},{polygon:[[-.05,-.27],[.05,-.27],[0,-.14]],cut:!0},{repeat:{count:3,as:"row",body:[{repeat:{values:[-1,0,1],as:"column",body:[{let:{featherX:"column * 0.16 + (row % 2) * 0.08 - 0.04",featherY:"0.05 + row * 0.15"}},{tube:[["featherX - 0.05","featherY"],["featherX","featherY + 0.04"],["featherX + 0.05","featherY"]],radii:.014,cut:!0}]}}]}}],S0={body:k0},L0=["wing"],W0={bodyRadiusX:"range(0.55, 0.62)",bodyRadiusY:"range(0.3, 0.34)",bodyAngle:"-PI / 2",legLength:.06,headRadius:.17,headX:.04,headY:"bodyY - bodyRadiusX * 0.85",neckWidth:.15,beakLength:.15,beakHeight:.06,tailLength:.12,tailSpread:.08,tailDrop:.1,wingWidth:.07},$0=[{ellipse:["-bodyRadiusY * 0.95","bodyY + 0.02",.08,"bodyRadiusX * 0.6",.15],part:"flipper"},{ellipse:["bodyRadiusY * 0.95","bodyY + 0.02",.08,"bodyRadiusX * 0.6",-.15],part:"flipper"}],E0={sleeping:{weight:0}},j0={extends:"bird",drop:L0,params:W0,body:$0,poses:E0},D0={bodyRadiusX:"range(0.56, 0.62)",bodyRadiusY:"range(0.36, 0.4)",legLength:"range(0.2, 0.26)",legWidth:.08,headRadiusX:.25,headRadiusY:.23,headX:"bodyRadiusX * 0.95",headY:"bodyY + 0.02",neckWidth:.22,snoutLength:.12,snoutRadius:.12,earHeight:.1,earWidth:.1,earSpread:.1,tailLength:.14,tailLift:"range(0.15, 0.25)",tailWidth:.035},O0={sitting:{weight:0}},A0={extends:"quadruped",params:D0,poses:O0},M0={ear:[{ellipse:["baseX + sin(angle) * length","baseY - cos(angle) * length",.085,"length","angle"]}]},T0=[{let:{earLength:"range(0.38, 0.52)",earLean:"range(-0.5, 0.05)",floppy:"chance(0.3)",headX:"range(0.36, 0.46)",headY:"range(-0.18, -0.05)"}},{ellipse:[-.2,.35,"vary(0.46, 0.08)","vary(0.38, 0.08)"]},{ellipse:[.08,.22,.38,.33]},{ellipse:["headX","headY",.24,.2,.2]},{use:"ear",with:{baseX:"headX - 0.06",baseY:"headY - 0.12",angle:"earLean",length:"earLength"}},{use:"ear",with:{baseX:"headX + 0.04",baseY:"headY - 0.1",angle:"earLean + if(floppy, 1.2, 0.25)",length:"earLength * if(floppy, 0.85, 0.95)"}},{circle:[-.68,.2,"range(0.11, 0.15)"]},{ellipse:[-.08,.72,.3,.07]},{tube:[[.3,.35],[.36,.72]],radii:.06},{circle:["headX + 0.06","headY - 0.04",.035],cut:!0}],H0={defs:M0,body:T0},x0=[{let:{hornLength:"range(0.62, 0.85)",hornLean:"range(-0.12, 0.02)",headDrop:"range(0, 0.12)",legLength:"range(0.68, 0.82)"}},{ellipse:[-.15,.05,"vary(0.62, 0.06)","vary(0.36, 0.08)"]},{ellipse:[.15,-.1,.34,.3]},{blob:[[.3,-.2],[.68,"-0.02 + headDrop"],[1.02,"0.24 + headDrop"],[.98,"0.42 + headDrop"],[.62,"0.42 + headDrop"],[.36,.3]]},{polygon:[[.8,"0.24 + headDrop"],[.84,"0.1 + headDrop"],["0.96 + hornLean","0.24 + headDrop - hornLength"],[1.05,"0.3 + headDrop"]]},{polygon:[[.66,"0.1 + headDrop"],["0.74 + hornLean","0.08 + headDrop - hornLength * 0.45"],[.82,"0.16 + headDrop"]]},{polygon:[[.34,-.14],["range(0.28, 0.34)",-.46],[.48,-.12]]},{tube:[[-.74,-.02],[-.84,.12],[-.83,.28]],radii:.025},{circle:[.6,"0.18 + headDrop",.03],cut:!0},{repeat:{values:[-.56,-.32,.08,.3],as:"legX",body:[{tube:[["legX",.2],["legX + range(-0.03, 0.03)","legLength"]],radii:.12}]}}],N0={body:x0},C0={length:"range(0.85, 0.92)",height:"range(0.2, 0.24)",dorsalHeight:"range(0.35, 0.42)",finLength:.3,flukeSpan:.4,eyeX:.68,eyeSize:.022},P0={extends:"swimmer",params:C0},I0=[{let:{shellRadius:"range(0.48, 0.6)",shellX:"range(-0.25, -0.1)",shellY:"0.55 - shellRadius - range(0.02, 0.08)",turns:"range(2.6, 3.4)",stalk:"range(0.3, 0.42)"}},{let:{spiral:{map:{count:49,as:"step",let:{angle:"step / 48 * turns * PI * 2",radius:"shellRadius * 0.86 * (step / 48)"},value:["shellX + cos(angle) * radius","shellY + sin(angle) * radius"]}}}},{blob:[[-.95,.66],[-.5,.56],[.4,.56],[.68,.38],[.82,.08],[.95,.02],[1.02,.18],[.96,.5],[.8,.7],[-.88,.76]]},{circle:["shellX","shellY","shellRadius"]},{tube:"spiral",radii:.026,cut:!0},{tube:[[.88,.08],["0.95 + range(0, 0.08)","0.08 - stalk"]],radii:.024},{circle:["0.95 + 0.04","0.08 - stalk - 0.02",.05]},{tube:[[.82,.1],[.78,"0.1 - stalk * 0.8"]],radii:.022},{circle:[.78,"0.1 - stalk * 0.8 - 0.02",.045]}],z0={body:I0},F0=[{let:{shellHeight:"range(0.45, 0.6)",shellWidth:"range(0.66, 0.76)",neckReach:"range(0.85, 1.0)",dome:{map:{count:25,as:"step",let:{angle:"PI + (step / 24) * PI"},value:["cos(angle) * shellWidth","0.25 + sin(angle) * shellHeight"]}},scuteY:"0.25 - shellHeight * 0.45"}},{polygon:"dome"},{ellipse:[0,.27,"shellWidth + 0.07",.08]},{tube:[["shellWidth - 0.1",.24],["neckReach - 0.15",.1]],radii:.09},{ellipse:["neckReach",.08,.17,.12,-.1]},{ellipse:["-shellWidth * 0.62",.42,.12,.16,.3]},{ellipse:["shellWidth * 0.6",.42,.12,.16,-.3]},{polygon:[["-shellWidth - 0.02",.22],["-shellWidth - 0.2",.3],["-shellWidth - 0.02",.3]]},{tube:[["-shellWidth * 0.95",.2],["-shellWidth * 0.5","scuteY"],["shellWidth * 0.5","scuteY"],["shellWidth * 0.95",.2]],radii:.015,cut:!0},{tube:[["-shellWidth * 0.25","scuteY"],["-shellWidth * 0.3",.2]],radii:.015,cut:!0},{tube:[["shellWidth * 0.25","scuteY"],["shellWidth * 0.3",.2]],radii:.015,cut:!0},{tube:[["-shellWidth * 0.2","scuteY"],[0,"0.25 - shellHeight * 0.95"]],radii:.014,cut:!0},{tube:[["shellWidth * 0.2","scuteY"],[0,"0.25 - shellHeight * 0.95"]],radii:.014,cut:!0},{circle:["neckReach + 0.06",.04,.028],cut:!0}],B0={body:F0},q0=[{let:{belly:"range(0.24, 0.34)",back:"range(-0.42, -0.32)",tailLift:"range(-0.35, 0.05)",spout:"chance(0.75)"}},{blob:[[.9,-.02],[.72,"back + 0.1"],[.3,"back"],[-.2,"back + 0.12"],[-.6,"-0.08 + tailLift * 0.4"],[-.88,"tailLift * 0.8"],[-.62,"0.12 + tailLift * 0.3"],[-.1,"belly"],[.5,"belly + 0.02"],[.84,.18]]},{ellipse:[-1,"tailLift - 0.16","vary(0.28)",.075,-.85]},{ellipse:[-1,"tailLift + 0.13","vary(0.28)",.075,.85]},{ellipse:[.22,"belly + 0.08","vary(0.24)",.065,.55]},{tube:[[.88,.1],[.6,.16],[.32,.12]],radii:.018,cut:!0},{circle:[.42,.04,.035],cut:!0},{if:"spout",then:[{tube:[[.55,"back - 0.06"],[.56,"back - 0.3"],[.44,"back - 0.5"]],radii:[.035,.03,.02]},{tube:[[.56,"back - 0.3"],[.7,"back - 0.48"]],radii:[.03,.02]},{circle:[.38,"back - 0.48",.03]},{circle:[.76,"back - 0.42",.025]},{circle:[.6,"back - 0.6",.025]}]}],V0={body:q0},K0={bodyRadiusX:"range(0.58, 0.66)",bodyRadiusY:"range(0.26, 0.3)",legLength:"range(0.52, 0.62)",legWidth:.06,headRadiusX:.2,headRadiusY:.16,snoutLength:.24,snoutRadius:.07,earHeight:"range(0.2, 0.26)",tailLength:"range(0.4, 0.5)",tailLift:"range(-0.25, -0.05)",tailWidth:.09},J0={extends:"quadruped",params:K0},U0=Object.assign({"./base/bird.json":jt,"./base/quadruped.json":Ht,"./base/swimmer.json":It,"./bear.json":Ft,"./cat.json":qt,"./deer.json":Jt,"./dolphin.json":e0,"./duck.json":a0,"./elephant.json":i0,"./fish.json":s0,"./flamingo.json":c0,"./fox.json":g0,"./hedgehog.json":b0,"./horse.json":Y0,"./octopus.json":X0,"./otter.json":_0,"./owl.json":S0,"./penguin.json":j0,"./pig.json":A0,"./rabbit.json":H0,"./rhino.json":N0,"./shark.json":P0,"./snail.json":z0,"./turtle.json":B0,"./whale.json":V0,"./wolf.json":J0}),fa=Object.fromEntries(Object.entries(U0).map(([e,t])=>[e.replace(/^.*\//,"").replace(/\.json$/,""),t])),G0=gt(),Q0=()=>G0.value,ya=H(Q0);export{ba as A,ga as B,A as M,Ge as a,ca as b,ua as c,Re as d,De as e,ae as f,ya as g,ra as h,Q0 as i,da as j,ea as k,Oe as l,vt as m,ia as n,la as o,pa as p,ta as q,fa as r,ha as s,aa as t,B as u,it as v,ft as w,sa as x,na as y,oa as z};
@@ -1 +0,0 @@
1
- import{d as M,H as I,o as t,a as l,h as i,g as a,j as c,c as k,_ as N,v as T,w as U,k as d,D as h,J as w,u as $,F as g,b as f,G as C,i as A,m as D,x as F,I as P}from"./_plugin-vue_export-helper-CeaKqebY.js";import{A as E,b as L,r as y,c as j,s as q,B as z,g as G}from"./scheme-CRAXq4Co.js";const H={class:"species-cell"},J={key:0,class:"species-cell__error"},O={class:"species-cell__seed"},R=M({__name:"SpeciesCell",props:{name:{},pose:{},seed:{},ink:{}},setup(m){const o=m,n=c(null),r=k(()=>{try{return{shapes:L(y,o.name,j(o.seed),{pose:o.pose}).shapes,error:""}}catch(u){return{shapes:[],error:u.message}}});return I(()=>{n.value&&!r.value.error&&o.ink&&E(n.value,r.value.shapes,o.ink)}),(u,_)=>(t(),l("figure",H,[r.value.error?(t(),l("p",J,i(r.value.error),1)):(t(),l("canvas",{key:1,ref_key:"canvas",ref:n,class:"species-cell__canvas",width:"260",height:"260"},null,512)),a("figcaption",O,i(m.seed),1)]))}}),K=N(R,[["__scopeId","data-v-220e2a5a"]]),Q={class:"sheet-page__head"},W={class:"sheet-page__field"},X={value:""},Y=["value"],Z={class:"sheet-page__field"},ee={class:"sheet-page__field"},se={class:"sheet-page__label"},ae={key:0,class:"sheet-page__pose"},te=M({__name:"SheetPage",setup(m){const o=new URLSearchParams(location.search),n=c(Math.min(12,Math.max(1,Number(o.get("seeds"))||6))),r=c(Number(o.get("from"))||1),u=c(o.get("species")||""),_=q(y),V=k(()=>Array.from({length:n.value},(p,e)=>r.value+e)),B=k(()=>_.filter(p=>!u.value||p===u.value).flatMap(p=>z(y,p).map(e=>({name:p,pose:e,key:`${p}:${e}`})))),v=c(null),b=c(""),S=()=>{v.value&&(b.value=getComputedStyle(v.value).color)};return T(S),U(G,S),(p,e)=>(t(),l("main",{ref_key:"page",ref:v,class:"app sheet-page"},[a("header",Q,[e[6]||(e[6]=a("h1",{class:"sheet-page__title"},"Species sheet",-1)),a("label",W,[e[3]||(e[3]=d("Species ",-1)),h(a("select",{"onUpdate:modelValue":e[0]||(e[0]=s=>u.value=s)},[a("option",X,"all ("+i($(_).length)+")",1),(t(!0),l(g,null,f($(_),s=>(t(),l("option",{key:s,value:s},i(s),9,Y))),128))],512),[[w,u.value]])]),a("label",Z,[e[4]||(e[4]=d("Seeds ",-1)),h(a("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>n.value=s),class:"sheet-page__number",type:"number",min:"1",max:"12"},null,512),[[C,n.value,void 0,{number:!0}]])]),a("label",ee,[e[5]||(e[5]=d("From seed ",-1)),h(a("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>r.value=s),class:"sheet-page__number",type:"number",min:"0"},null,512),[[C,r.value,void 0,{number:!0}]])])]),(t(!0),l(g,null,f(B.value,s=>(t(),l("section",{key:s.key,class:"sheet-page__row"},[a("h2",se,[d(i(s.name),1),s.pose?(t(),l("small",ae,i(s.pose),1)):A("",!0)]),a("div",{class:"sheet-page__cells",style:F({gridTemplateColumns:`repeat(${n.value}, minmax(0, 1fr))`})},[(t(!0),l(g,null,f(V.value,x=>(t(),D(K,{key:x,name:s.name,pose:s.pose,seed:x,ink:b.value},null,8,["name","pose","seed","ink"]))),128))],4)]))),128))],512))}}),le=N(te,[["__scopeId","data-v-b4daa75a"]]);P(le).mount("#app");