ryugi-artifacts 1.40.0 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{o as t}from"./useSystemTheme-BVZLLsnc.js";import{n,t as r}from"./jsx-runtime-CldxteV5.js";var i=e(n(),1),a=r(),o=class extends i.Component{state={error:null,resetKey:this.props.resetKey};static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return e.resetKey===t.resetKey?null:{error:null,resetKey:e.resetKey}}render(){return this.state.error?(0,a.jsx)(`div`,{className:`x10l6tqk x10a8y8t x78zum5 x6s0dn4 xl56j7k xggk2y7 x1bo0w0s xif65rj x2b8uid`,children:t(`chrome.canvasFailed`,{message:this.state.error.message})}):this.props.children}},s=[.125,.25,.5,1,2],c=240,l=(e,t)=>s.find(n=>n>=e*t)??s[s.length-1],u=(e,t)=>{let n=t.x+e.x*t.k,r=t.y+e.y*t.k;return{left:n,top:r,right:n+e.w*t.k,bottom:r+e.h*t.k}};function d({boards:e,view:t,viewport:n,pinned:r,snapshots:i}){let a=e.map(e=>{let{left:r,top:i,right:a,bottom:o}=u(e,t),s=Math.max(0,Math.min(a,n.width)-Math.max(r,0))*Math.max(0,Math.min(o,n.height)-Math.max(i,0)),c=Math.hypot(Math.max(0,-a,r-n.width),Math.max(0,-o,i-n.height));return{id:e.id,area:s,distance:c}}),o=t.k>=.4?new Set(a.filter(e=>e.area>0).sort((e,t)=>t.area-e.area).slice(0,4).map(e=>e.id)):new Set;return new Map(a.map(({id:e,distance:t})=>r.has(e)||o.has(e)?[e,`live`]:t>n.width?[e,`empty`]:[e,i.has(e)?`snapshot`:`placeholder`]))}function f({boards:e,view:t,viewport:n}){return new Map(e.map(e=>{let{left:r,top:i,right:a,bottom:o}=u(e,t),s=a>=-240&&o>=-240&&r<=n.width+c&&i<=n.height+c;return[e.id,{tier:s?`live`:`empty`,mounted:s,image:null,overlay:!1,hidden:!1}]}))}var p=.02,m=.9,h=e=>Math.min(4,Math.max(p,e)),g=e=>({minX:e.x,minY:e.y,maxX:e.x+e.w,maxY:e.y+e.h});function _(e,t,n){let r=Math.max(1,t.width-n.left-n.right),i=Math.max(1,t.height-n.top-n.bottom),a=Math.max(1,e.maxX-e.minX),o=Math.max(1,e.maxY-e.minY),s=h(Math.min(1,Math.min(r/a,i/o)*m));return{k:s,x:n.left+(r-a*s)/2-e.minX*s,y:n.top+(i-o*s)/2-e.minY*s}}function v(e,t,n,r){let i=h(e.k*t),a=i/e.k;return{k:i,x:n-(n-e.x)*a,y:r-(r-e.y)*a}}function y(e,t,n){let r=([e,t])=>Math.max(1,Math.hypot(t.x-e.x,t.y-e.y)),i=([e,t])=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),a=h(e.k*(r(n)/r(t))),o=a/e.k,s=i(t),c=i(n);return{k:a,x:c.x-(s.x-e.x)*o,y:c.y-(s.y-e.y)*o}}function b(e,t,n,r){return v(e,t/e.k,n,r)}function x(e,t,n){let r=e.boards[n];if(r)return{page:r.page,bounds:g({...r,y:r.y-48,h:r.h+48})};for(let[e,r]of Object.entries(t.pages)){let t=r.groups[n]??r.notes[n];if(t)return{page:e,bounds:g(t)}}return null}function S(e,t){let n=e.w*t.k;return n<48?null:{left:t.x+e.x*t.k,top:t.y+e.y*t.k,width:n}}var C={base:27,follow:.7,min:4,hideBelow:.05,cap:!0},w={base:23,follow:.85,min:0,hideBelow:.11,cap:!0},T={follow:1,min:24,hideBelow:0,cap:!1};function E(e,t){if(t<e.hideBelow)return null;let n=e.base*t**e.follow;return Math.max(e.cap?Math.min(n,e.base):n,e.min)}var D=(e,t)=>E({...T,base:e},t)/(e*t);function O(e,t,n,r){let i=(e,t,n)=>3*t*e*(1-e)**2+3*n*e**2*(1-e)+e**3,a=(e,t,n)=>3*t*(1-e)**2+6*(n-t)*e*(1-e)+3*(1-n)*e**2;return o=>{if(o<=0||o>=1)return Math.min(1,Math.max(0,o));let s=o;for(let t=0;t<8;t++){let t=a(s,e,n);if(Math.abs(t)<1e-6)break;s=Math.min(1,Math.max(0,s-(i(s,e,n)-o)/t))}return i(s,t,r)}}var k=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n,k:e.k+(t.k-e.k)*n});export{S as a,x as c,v as d,b as f,o as g,f as h,_ as i,D as l,l as m,C as n,E as o,d as p,O as r,y as s,w as t,k as u};