@oyerinde/caliper 0.2.0 → 0.2.1

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.
@@ -8,15 +8,15 @@
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */
11
- var vi=(e,t)=>e===t;var xi=Symbol("solid-track");var Et={equals:vi},Sn=Ln,Me=1,ft=2,En={owned:null,cleanups:null,context:null,owner:null};var R=null,T=null,Je=null,Z=null,le=null,fe=null,It=0;function et(e,t){let n=Z,i=R,r=e.length===0,o=t===void 0?i:t,l=r?En:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=r?e:()=>e(()=>me(()=>Xe(l)));R=l,Z=null;try{return Ce(a,!0)}finally{Z=n,R=i;}}function _(e,t){t=t?Object.assign({},Et,t):Et;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},i=r=>(typeof r=="function"&&(r=r(n.value)),Tn(n,r));return [kn.bind(n),i]}function F(e,t,n){let i=Ft(e,t,false,Me);mt(i);}function pe(e,t,n){Sn=Ni;let i=Ft(e,t,false,Me);(!n||!n.render)&&(i.user=true),fe?fe.push(i):mt(i);}function U(e,t,n){n=n?Object.assign({},Et,n):Et;let i=Ft(e,t,true,0);return i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,mt(i),kn.bind(i)}function me(e){if(Z===null)return e();let t=Z;Z=null;try{return Je?Je.untrack(e):e()}finally{Z=t;}}function Nn(e,t,n){let i=Array.isArray(e),r;return l=>{let a;if(i){a=Array(e.length);for(let u=0;u<e.length;u++)a[u]=e[u]();}else a=e();let c=me(()=>t(a,r,l));return r=a,c}}function kt(e){pe(()=>me(e));}function ye(e){return R===null||(R.cleanups===null?R.cleanups=[e]:R.cleanups.push(e)),e}function Tt(){return R}function In(e,t){let n=R,i=Z;R=e,Z=null;try{return Ce(t,!0)}catch(r){Lt(r);}finally{R=n,Z=i;}}var[sr,vn]=_(false);function kn(){let e=T;if(this.sources&&(this.state))if((this.state)===Me)mt(this);else {let t=le;le=null,Ce(()=>Nt(this),false),le=t;}if(Z){let t=this.observers?this.observers.length:0;Z.sources?(Z.sources.push(this),Z.sourceSlots.push(t)):(Z.sources=[this],Z.sourceSlots=[t]),this.observers?(this.observers.push(Z),this.observerSlots.push(Z.sources.length-1)):(this.observers=[Z],this.observerSlots=[Z.sources.length-1]);}return e&&T.sources.has(this)?this.tValue:this.value}function Tn(e,t,n){let i=e.value;if(!e.comparator||!e.comparator(i,t)){e.value=t;e.observers&&e.observers.length&&Ce(()=>{for(let r=0;r<e.observers.length;r+=1){let o=e.observers[r],l=T&&T.running;l&&T.disposed.has(o)||((l?!o.tState:!o.state)&&(o.pure?le.push(o):fe.push(o),o.observers&&Cn(o)),l?o.tState=Me:o.state=Me);}if(le.length>1e6)throw le=[],new Error},false);}return t}function mt(e){if(!e.fn)return;Xe(e);let t=It;xn(e,e.value,t);}function xn(e,t,n){let i,r=R,o=Z;Z=R=e;try{i=e.fn(t);}catch(l){return e.pure&&((e.state=Me,e.owned&&e.owned.forEach(Xe),e.owned=null)),e.updatedAt=n+1,Lt(l)}finally{Z=o,R=r;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Tn(e,i):e.value=i,e.updatedAt=n);}function Ft(e,t,n,i=Me,r){let o={fn:e,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:R,context:R?R.context:null,pure:n};if(R===null||R!==En&&(R.owned?R.owned.push(o):R.owned=[o]),Je);return o}function dt(e){let t=T;if((e.state)===0)return;if((e.state)===ft)return Nt(e);if(e.suspense&&me(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<It);){(e.state)&&n.push(e);}for(let i=n.length-1;i>=0;i--){if(e=n[i],t);if((e.state)===Me)mt(e);else if((e.state)===ft){let r=le;le=null,Ce(()=>Nt(e,n[0]),false),le=r;}}}function Ce(e,t){if(le)return e();let n=false;t||(le=[]),fe?n=true:fe=[],It++;try{let i=e();return Si(n),i}catch(i){n||(fe=null),le=null,Lt(i);}}function Si(e){if(le&&(Ln(le),le=null),e)return;let n=fe;fe=null,n.length&&Ce(()=>Sn(n),false);}function Ln(e){for(let t=0;t<e.length;t++)dt(e[t]);}function Ni(e){let t,n=0;for(t=0;t<e.length;t++){let i=e[t];i.user?e[n++]=i:dt(i);}for(t=0;t<n;t++)dt(e[t]);}function Nt(e,t){e.state=0;for(let i=0;i<e.sources.length;i+=1){let r=e.sources[i];if(r.sources){let o=r.state;o===Me?r!==t&&(!r.updatedAt||r.updatedAt<It)&&dt(r):o===ft&&Nt(r,t);}}}function Cn(e){for(let n=0;n<e.observers.length;n+=1){let i=e.observers[n];(!i.state)&&(i.state=ft,i.pure?le.push(i):fe.push(i),i.observers&&Cn(i));}}function Xe(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),i=e.sourceSlots.pop(),r=n.observers;if(r&&r.length){let o=r.pop(),l=n.observerSlots.pop();i<r.length&&(o.sourceSlots[l]=i,r[i]=o,n.observerSlots[i]=l);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Xe(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Xe(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function Ii(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Lt(e,t=R){let i=Ii(e);throw i;}var ki=Symbol("fallback");function Mn(e){for(let t=0;t<e.length;t++)e[t]();}function Ti(e,t,n={}){let i=[],r=[],o=[],l=0,a=t.length>1?[]:null;return ye(()=>Mn(o)),()=>{let c=e()||[],u=c.length,d,s;return c[xi],me(()=>{let m,y,b,x,g,h,w,p,k;if(u===0)l!==0&&(Mn(o),o=[],i=[],r=[],l=0,a&&(a=[])),n.fallback&&(i=[ki],r[0]=et(L=>(o[0]=L,n.fallback())),l=1);else if(l===0){for(r=new Array(u),s=0;s<u;s++)i[s]=c[s],r[s]=et(f);l=u;}else {for(b=new Array(u),x=new Array(u),a&&(g=new Array(u)),h=0,w=Math.min(l,u);h<w&&i[h]===c[h];h++);for(w=l-1,p=u-1;w>=h&&p>=h&&i[w]===c[p];w--,p--)b[p]=r[w],x[p]=o[w],a&&(g[p]=a[w]);for(m=new Map,y=new Array(p+1),s=p;s>=h;s--)k=c[s],d=m.get(k),y[s]=d===void 0?-1:d,m.set(k,s);for(d=h;d<=w;d++)k=i[d],s=m.get(k),s!==void 0&&s!==-1?(b[s]=r[d],x[s]=o[d],a&&(g[s]=a[d]),s=y[s],m.set(k,s)):o[d]();for(s=h;s<u;s++)s in b?(r[s]=b[s],o[s]=x[s],a&&(a[s]=g[s],a[s](s))):r[s]=et(f);r=r.slice(0,l=u),i=c.slice(0);}return r});function f(m){if(o[s]=m,a){let[y,b]=_(s);return a[s]=b,t(c[s],y)}return t(c[s])}}}function C(e,t){return me(()=>e(t||{}))}var Ci=e=>`Stale read from <${e}>.`;function Re(e){let t="fallback"in e&&{fallback:()=>e.fallback};return U(Ti(()=>e.each,e.children,t||void 0))}function Q(e){let t=e.keyed,n=U(()=>e.when,void 0,void 0),i=t?n:U(n,void 0,{equals:(r,o)=>!r==!o});return U(()=>{let r=i();if(r){let o=e.children;return typeof o=="function"&&o.length>0?me(()=>o(t?r:()=>{if(!me(i))throw Ci("Show");return n()})):o}return e.fallback},void 0,void 0)}var Se=e=>U(()=>e());function Ai(e,t,n){let i=n.length,r=t.length,o=i,l=0,a=0,c=t[r-1].nextSibling,u=null;for(;l<r||a<o;){if(t[l]===n[a]){l++,a++;continue}for(;t[r-1]===n[o-1];)r--,o--;if(r===l){let d=o<i?a?n[a-1].nextSibling:n[o-a]:c;for(;a<o;)e.insertBefore(n[a++],d);}else if(o===a)for(;l<r;)(!u||!u.has(t[l]))&&t[l].remove(),l++;else if(t[l]===n[o-1]&&n[a]===t[r-1]){let d=t[--r].nextSibling;e.insertBefore(n[a++],t[l++].nextSibling),e.insertBefore(n[--o],d),t[r]=n[o];}else {if(!u){u=new Map;let s=a;for(;s<o;)u.set(n[s],s++);}let d=u.get(t[l]);if(d!=null)if(a<d&&d<o){let s=l,f=1,m;for(;++s<r&&s<o&&!((m=u.get(t[s]))==null||m!==d+f);)f++;if(f>d-a){let y=t[l];for(;a<d;)e.insertBefore(n[a++],y);}else e.replaceChild(n[a++],t[l++]);}else l++;else t[l++].remove();}}}var An="_$DX_DELEGATE";function $n(e,t,n,i={}){let r;return et(o=>{r=o,t===document?e():V(t,e(),t.firstChild?null:void 0,n);},i.owner),()=>{r(),t.textContent="";}}function X(e,t,n,i){let r,o=()=>{let a=i?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:i?a.firstChild:a.content.firstChild},l=t?()=>me(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(true);return l.cloneNode=l,l}function Fe(e,t=window.document){let n=t[An]||(t[An]=new Set);for(let i=0,r=e.length;i<r;i++){let o=e[i];n.has(o)||(n.add(o),t.addEventListener(o,ji));}}function D(e,t,n){(n==null?e.removeAttribute(t):e.setAttribute(t,n));}function B(e,t){(t==null?e.removeAttribute("class"):e.className=t);}function Ye(e,t,n){if(!t)return n?D(e,"style"):t;let i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let r,o;for(o in n)t[o]==null&&i.removeProperty(o),delete n[o];for(o in t)r=t[o],r!==n[o]&&(i.setProperty(o,r),n[o]=r);return n}function J(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function V(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return Ct(e,t,i,n);F(r=>Ct(e,t(),r,n),i);}function ji(e){let t=e.target,n=`$$${e.type}`,i=e.target,r=e.currentTarget,o=c=>Object.defineProperty(e,"target",{configurable:true,value:c}),l=()=>{let c=t[n];if(c&&!t.disabled){let u=t[`${n}Data`];if(u!==void 0?c.call(t,u,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),true},a=()=>{for(;l()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let c=e.composedPath();o(c[0]);for(let u=0;u<c.length-2&&(t=c[u],!!l());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===r)break}}else a();o(i);}function Ct(e,t,n,i,r){for(;typeof n=="function";)n=n();if(t===n)return n;let l=typeof t,a=i!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,l==="string"||l==="number"){if(l==="number"&&(t=t.toString(),t===n))return n;if(a){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=tt(e,n,i,c);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||l==="boolean"){n=tt(e,n,i);}else {if(l==="function")return F(()=>{let c=t();for(;typeof c=="function";)c=c();n=Ct(e,c,n,i);}),()=>n;if(Array.isArray(t)){let c=[],u=n&&Array.isArray(n);if(Ht(c,t,n,r))return F(()=>n=Ct(e,c,n,i,true)),()=>n;if(c.length===0){if(n=tt(e,n,i),a)return n}else u?n.length===0?jn(e,c,i):Ai(e,n,c):(n&&tt(e),jn(e,c));n=c;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=tt(e,n,i,t);tt(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function Ht(e,t,n,i){let r=false;for(let o=0,l=t.length;o<l;o++){let a=t[o],c=n&&n[e.length],u;if(!(a==null||a===true||a===false))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))r=Ht(e,a,c)||r;else if(u==="function")if(i){for(;typeof a=="function";)a=a();r=Ht(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||r;}else e.push(a),r=true;else {let d=String(a);c&&c.nodeType===3&&c.data===d?e.push(c):e.push(document.createTextNode(d));}}return r}function jn(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n);}function tt(e,t,n,i){if(n===void 0)return e.textContent="";let r=i||document.createTextNode("");if(t.length){let o=false;for(let l=t.length-1;l>=0;l--){let a=t[l];if(r!==a){let c=a.parentNode===e;!o&&!l?c?e.replaceChild(r,a):e.insertBefore(r,n):c&&a.remove();}else o=true;}}else e.insertBefore(r,n);return [r]}var $i="http://www.w3.org/2000/svg";function Pi(e,t=false,n=void 0){return t?document.createElementNS($i,e):document.createElement(e,{is:n})}function De(e){let {useShadow:t}=e,n=document.createTextNode(""),i=()=>e.mount||document.body,r=Tt(),o;return pe(()=>{o||(o=In(r,()=>U(()=>e.children)));let a=i();if(a instanceof HTMLHeadElement){let[c,u]=_(false),d=()=>u(true);et(s=>V(a,()=>c()?s():o(),null)),ye(d);}else {let c=Pi(e.isSVG?"g":"div",e.isSVG),u=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return n.parentNode},configurable:true}),V(u,o),a.appendChild(c),e.ref&&e.ref(c),ye(()=>a.removeChild(c));}},void 0,{render:true}),n}function Oi(){let e=null,t=null,n=null,i=null;function r(){return "scheduler"in globalThis?"scheduler":"requestIdleCallback"in window?"idle":"post-raf"}function o(s,f){if(!("scheduler"in globalThis)){l(s,f);return}let m=globalThis.scheduler,y=globalThis.TaskController;if(!y){l(s,f);return}n=new y({priority:f?"user-visible":"background"}),m.postTask(()=>{s();},{signal:n?.signal,priority:f?"user-visible":"background"}).catch(()=>{});}function l(s,f){if(!("requestIdleCallback"in window)){a(s);return}t=requestIdleCallback(m=>{m.timeRemaining()>0||m.didTimeout?s():f?a(s):l(s,false);},{timeout:f?5:50});}function a(s){e=requestAnimationFrame(()=>{Promise.resolve().then(()=>{s();});});}function c(s){i=setTimeout(()=>{s();},0);}function u(s,f=false){switch(d(),r()){case "scheduler":o(s,f);break;case "idle":l(s,f);break;case "post-raf":a(s);break;case "timeout":c(s);break}}function d(){e!==null&&(cancelAnimationFrame(e),e=null),t!==null&&"cancelIdleCallback"in window&&(cancelIdleCallback(t),t=null),n&&(n.abort(),n=null),i!==null&&(clearTimeout(i),i=null);}return {scheduleRead:u,cancel:d}}var Ri=30,Yi=16,zi=8,zn=60,_i=30,Vi=8,Xi=Vi*2,_n=6,Zt=11,Y="caliper-",Fi="caliper-bridge-tab-id",$t="caliper-overlay-root",Vn=2147483647,Hi=["caliper-","is-","has-","js-","framer-","motion-"];function Wi(e){let t=0,n=Yi,i=[],r=null,o=null;function l(s){n=Math.ceil(1e3/(s/2));}function a(s){if(i.push(s),i.length>Ri&&i.shift(),i.length>=2){let f=i[i.length-1],m=i[0];if(f!==void 0&&m!==void 0){let y=f-m,b=i.length/y*1e3;l(b);}}}function c(){if(!o)return;let{callback:s,urgent:f}=o;o=null,t=performance.now(),e.scheduleRead(s,f);}function u(s,f=false){o={callback:s,urgent:f};let y=performance.now()-t;if(f||y>=n){r!==null&&(clearTimeout(r),r=null),c();return}r===null&&(r=setTimeout(()=>{r=null,c();},n-y));}function d(){e.cancel(),o=null,r!==null&&(clearTimeout(r),r=null);}return {scheduleRead:u,cancel:d,adaptToFrameRate:l,recordFrameTime:a}}function Qt(e,t={}){let n=t.maxFrames??zi,i=t.delay??_i,r=0,o=null;return {execute(l,...a){o&&(clearTimeout(o),o=null),l&&r<n?(r++,o=setTimeout(()=>{r=0,e(...a),o=null;},i)):(r=0,e(...a));},cancel(){o&&(clearTimeout(o),o=null),r=0;}}}function Pt(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return false;let n=e.ownerDocument?.defaultView,i=n?.HTMLElement,r=n?.SVGElement;return i&&e instanceof i||r&&e instanceof r?true:"tagName"in e&&"getAttribute"in e}function Ae(){return document.getElementById($t)||document.documentElement}function Ui(e){if(!Pt(e))return false;let t=e.tagName.toUpperCase();if(["STYLE","SCRIPT","NOSCRIPT","TEMPLATE","META","LINK","HEAD"].includes(t))return false;let n=window.getComputedStyle(e),i=n.contentVisibility||n.getPropertyValue("content-visibility");return !(n.display==="none"||i==="hidden")}function Bi(e){if(!Pt(e))return false;let t=e.getBoundingClientRect();return t.width>0&&t.height>0}function Xn(e){return e.closest("[data-caliper-ignore]")?false:Ui(e)&&Bi(e)}var Gi=2;function Fn(e){return !e||!(e instanceof Element)?false:!!(e.closest("#caliper-overlay-root")||e.closest("[class*='caliper-']"))}function Zi(e,t){return document.elementsFromPoint(e,t).find(i=>Fn(i)?false:Xn(i))||null}function qt(e,t){let n=document.elementFromPoint(e,t);return !n||Fn(n)||!Xn(n)?null:n}function Qi(e,t,n){let i=Zi(t,n);if(!i)return null;for(;i;){if(i!==e)return e.contains(i)?{context:"child",element:i}:i.contains(e)?{context:"parent",element:i}:{context:"sibling",element:i};i=i.parentElement;}return null}function qi(e,t,n){let i=Math.min(Math.abs(e-n.left),Math.abs(e-n.right)),r=Math.min(Math.abs(t-n.top),Math.abs(t-n.bottom));return Math.min(i,r)}function Ki(e,t,n,i,r=null){let o=Qi(e,t,n);if(!o)return null;let{context:l,element:a}=o;if(i&&r&&(l!==i||a!==r)){let c=r.getBoundingClientRect();if(qi(t,n,c)<=Gi&&!((l==="sibling"||l==="child")&&i==="parent"))return {context:i,element:r}}return o}function ze(e){let t=window.getComputedStyle(e);return {position:t.position,overflow:t.overflow,overflowX:t.overflowX,overflowY:t.overflowY,transform:t.transform,filter:t.filter,perspective:t.perspective,contain:t.contain,willChange:t.willChange,top:t.top,bottom:t.bottom,left:t.left,right:t.right}}function Hn(e){return new DOMRect(e.left+window.scrollX,e.top+window.scrollY,e.width,e.height)}function Wn(e){return /(auto|scroll|hidden|clip)/.test(e.overflow+e.overflowY+e.overflowX)}function Pn(e){if(!Pt(e)||e.tagName.toLowerCase()==="svg")return false;let t=ze(e);return Wn(t)}function Un(e){let t=ze(e);return /(auto|scroll|hidden)/.test(t.overflow+t.overflowY+t.overflowX)}function Ji(e){let t=[],n=e;for(;n&&(t.push(n),n!==document.documentElement);)n=n.parentElement;let i=t.length;if(i<=1)return {scrollHierarchy:[],positionMode:"static",scrollAnchor:null,containingBlock:null,treeDepth:0,anchorAbsoluteDepth:-1};let r=[];for(let s=0;s<i;s++){let f=t[s];f!==void 0&&r.push(ze(f));}let o=[];o[i-1]=false;for(let s=i-2;s>=0;s--){let f=r[s+1];o[s]=f!==void 0&&f.position==="sticky"||(o[s+1]??false);}let l=[],a="static",c=null,u=null,d=-1;for(let s=0;s<i;s++){let f=t[s];if(f===void 0||f===document.documentElement)break;if(!Pt(f))continue;let m=r[s];if(m===void 0)continue;let y=i-1-s;if(a==="static"&&(m.position==="fixed"?(a="fixed",c=f,d=y):m.position==="sticky"&&(a="sticky",c=f,d=y)),f!==e&&!u&&(m.transform!=="none"||m.filter!=="none"||m.perspective!=="none"||m.contain==="paint"||m.contain==="layout"||m.willChange==="transform"||m.willChange==="filter")&&(u=f),s>=1&&Wn(m)){let b=f;l.push({element:b,initialScrollTop:b.scrollTop,initialScrollLeft:b.scrollLeft,containerRect:Hn(b.getBoundingClientRect()),absoluteDepth:y,hasStickyAncestor:o[s]??false});}}return {scrollHierarchy:l,positionMode:a,scrollAnchor:c,containingBlock:u,treeDepth:i-1,anchorAbsoluteDepth:d}}function On(e,t,n,i,r,o){let l=t-e,a=i<0,c=Math.abs(i);if(o){let u=Math.min(l,c-r-n);return u=Math.max(u,0),u}else {let u=Math.max(l,n);if(a){let d=t+c-r-e;u=Math.min(u,d);}else u=Math.min(u,c-r);return u}}function Dt(e,t,n,i,r,o,l=false){if(i===null)return e-t;let a=On(t,n,i??-1/0,r,o,l),c=On(e,n,i??-1/0,r,o,l);return a-c}function it(e,t="static",n,i=0,r=0,o=false){let l=0,a=0,c=false;for(let u=0;u<e.length;u++){let d=e[u];if(!d)continue;let s=d.element,m=ze(s).position==="fixed";if(Un(s)){let b=n&&d.absoluteDepth>n.anchorAbsoluteDepth,x=null,g=null,h=false,w=false;!c&&t==="sticky"&&n&&!b&&(n.top!==null?g=n.top:n.bottom!==null&&(g=n.bottom,w=true),n.left!==null?x=n.left:n.right!==null&&(x=n.right,h=true)),l+=Dt(s.scrollLeft,d.initialScrollLeft,n?.naturalLeft??0,x,n?.containerWidth??0,n?.elementWidth??0,h),a+=Dt(s.scrollTop,d.initialScrollTop,n?.naturalTop??0,g,n?.containerHeight??0,n?.elementHeight??0,w),(x!==null||g!==null)&&(c=true);}if(m&&!o)return l+=i-window.scrollX,a+=r-window.scrollY,{deltaX:l,deltaY:a}}if(!o){if(t==="fixed")l+=i-window.scrollX,a+=r-window.scrollY;else if(t==="sticky"&&n&&!c){let u=i-window.scrollX,d=r-window.scrollY,s=null,f=null,m=false,y=false;n.top!==null?f=n.top:n.bottom!==null&&(f=n.bottom,y=true),n.left!==null?s=n.left:n.right!==null&&(s=n.right,m=true);let b=Dt(window.scrollX,i,n.naturalLeft,s,n.containerWidth,n.elementWidth,m),x=Dt(window.scrollY,r,n.naturalTop,f,n.containerHeight,n.elementHeight,y);l+=b+u,a+=x+d;}}return {deltaX:l,deltaY:a}}function Bn(e,t,n,i,r=0,o=0){let l=new Map;for(let x=0;x<e.length;x++){let g=e[x];g&&g.element&&l.set(g.element,x);}let a=new Map;for(let x=0;x<t.length;x++){let g=t[x];g&&g.element&&a.set(g.element,x);}let c=[];for(let x=0;x<e.length;x++){let g=e[x];g&&g.element&&a.has(g.element)&&c.push(g);}if(Pn(i)){let x=l.get(i);if(x!==void 0){let g=e[x];g&&!c.includes(g)&&c.push(g);}}if(Pn(n)){let x=a.get(n);if(x!==void 0){let g=t[x];g&&!c.includes(g)&&c.push(g);}}if(c.length===0)return {minX:-1/0,maxX:1/0,minY:-1/0,maxY:1/0};let u=-1/0,d=1/0,s=-1/0,f=1/0,m=x=>{let g=new Float64Array(x.length+1),h=new Float64Array(x.length+1);for(let w=x.length-1;w>=0;w--){let p=x[w];p&&p.element?(g[w]=(g[w+1]??0)+(p.element.scrollLeft-p.initialScrollLeft),h[w]=(h[w+1]??0)+(p.element.scrollTop-p.initialScrollTop)):p&&(g[w]=g[w+1]??0,h[w]=h[w+1]??0);}return {sumsX:g,sumsY:h}},y=m(e),b=m(t);for(let x=0;x<c.length;x++){let g=c[x];if(!g||!g.element)continue;let h=l.has(g.element),w=h?y:b,p=h?l.get(g.element):a.get(g.element);if(p===void 0||p===-1)continue;let k=g.containerRect;if(!k)continue;let L=w.sumsX[p+1]??0,M=w.sumsY[p+1]??0,E=0,N=0,v;if(typeof g.hasStickyAncestor=="boolean")v=g.hasStickyAncestor;else if(g.element){let q=g.element;for(v=false;q&&q!==document.documentElement;){let se=ze(q);if(se.position==="sticky"){v=true;break}if(se.position==="fixed")break;q=q.parentElement;}}else v=false;v&&(E=window.scrollX-r,N=window.scrollY-o);let I=k.left-L+E,$=k.top-M+N,P=I+(g.element?.clientLeft??0),z=$+(g.element?.clientTop??0),H=P+(g.element?.clientWidth??k.width),te=z+(g.element?.clientHeight??k.height);u===-1/0?(u=P,d=H,s=z,f=te):(u=Math.max(u,P),d=Math.min(d,H),s=Math.max(s,z),f=Math.min(f,te));}return {minX:u,maxX:d,minY:s,maxY:f}}function ce(e,t,n="static",i,r=0,o=0,l=false){if(!e)return null;let{deltaX:a,deltaY:c}=it(t,n,i,r,o,l),u=-1/0,d=1/0,s=-1/0,f=1/0,m=t.length,y=new Float64Array(m+1),b=new Float64Array(m+1);for(let N=m-1;N>=0;N--){let v=t[N];v&&v.element?(y[N]=(y[N+1]??0)+(v.element.scrollLeft-v.initialScrollLeft),b[N]=(b[N+1]??0)+(v.element.scrollTop-v.initialScrollTop)):v&&(y[N]=y[N+1]??0,b[N]=b[N+1]??0);}for(let N=0;N<m;N++){let v=t[N];if(!v)continue;let I=v.containerRect;if(!I)continue;let $=y[N+1]??0,P=b[N+1]??0,z=0,H=0,te;if(typeof v.hasStickyAncestor=="boolean")te=v.hasStickyAncestor;else if(v.element){let ie=v.element;for(te=false;ie&&ie!==document.documentElement;){let ge=ze(ie);if(ge.position==="sticky"){te=true;break}if(ge.position==="fixed")break;ie=ie.parentElement;}}else te=false;te&&(z=window.scrollX-r,H=window.scrollY-o);let q=I.left-$+z,se=I.top-P+H,ee=q+(v.element?.clientLeft??0),re=se+(v.element?.clientTop??0);u===-1/0?(u=ee,d=ee+(v.element?.clientWidth??I.width),s=re,f=re+(v.element?.clientHeight??I.height)):(u=Math.max(u,ee),d=Math.min(d,ee+(v.element?.clientWidth??I.width)),s=Math.max(s,re),f=Math.min(f,re+(v.element?.clientHeight??I.height)));}let x=e.left-a,g=e.top-c,h=e.width,w=e.height,p=u!==-1/0&&(g+w<s||g>f||x+h<u||x>d),k=Math.max(0,s-g),L=Math.max(0,u-x),M=Math.max(0,g+w-f),E=Math.max(0,x+h-d);return {left:x,top:g,width:h,height:w,clipPath:u===-1/0?"none":`inset(${k}px ${E}px ${M}px ${L}px)`,isHidden:p,visibleMinX:u,visibleMaxX:d,visibleMinY:s,visibleMaxY:f}}function At(e){if(e==="auto")return null;let t=parseFloat(e);return isNaN(t)?null:t}function gt(e){let t=0,n=0,i=e;for(;i instanceof HTMLElement;){t+=i.offsetTop,n+=i.offsetLeft;let r=i.offsetParent;r instanceof HTMLElement&&(t+=r.clientTop||0,n+=r.clientLeft||0),i=r;}return {top:t,left:n}}function Ut(e,t){let n=[],i=e;for(;i&&(i instanceof HTMLElement&&ze(i).position==="sticky"&&n.push({element:i,originalPosition:i.style.position}),!(i===t||i===document.documentElement));)i=i.parentElement;return n}function eo(e,t){let n=Ut(e,t);for(let{element:i}of n)i.style.position="static";try{let i=gt(e),r=gt(t);return {offsetX:i.left-r.left,offsetY:i.top-r.top}}finally{for(let{element:i,originalPosition:r}of n)i.style.position=r||"sticky";}}function to(e,t,n){let i=new Set,r=[];for(let{element:o,originalPosition:l}of Ut(e,t))i.has(o)||(i.add(o),r.push({element:o,originalPosition:l}));if(n&&n!==e)for(let{element:o,originalPosition:l}of Ut(n,t))i.has(o)||(i.add(o),r.push({element:o,originalPosition:l}));for(let{element:o}of r)o.style.position="static";try{let o=gt(t),l=gt(e),a={offsetX:l.left-o.left,offsetY:l.top-o.top},c=null;if(n&&n!==t){let u=gt(n);c={offsetX:u.left-o.left,offsetY:u.top-o.top};}return {naturalPosition:a,cappingNaturalPosition:c}}finally{for(let{element:o,originalPosition:l}of r)o.style.position=l||"sticky";}}function Bt(e){let t=e.getBoundingClientRect(),n=window.scrollX,i=window.scrollY,{scrollHierarchy:r,positionMode:o,scrollAnchor:l,containingBlock:a,treeDepth:c,anchorAbsoluteDepth:u}=Ji(e),d;if(o==="sticky"&&l){let s=ze(l),f=document.documentElement,m=l.parentElement;for(;m&&m!==document.documentElement;){if(Un(m)){f=m;break}m=m.parentElement;}let y=l.parentElement||document.documentElement,b=y===document.documentElement||y===document.body,g=(y instanceof HTMLElement?ze(y):null)?.position==="sticky",h=l.getBoundingClientRect(),w=t.top-h.top,p=t.left-h.left,k=h.bottom-t.bottom,L=h.right-t.right,M=At(s.top),E=At(s.bottom),N=At(s.left),v=At(s.right),I=!b&&y!==f&&!g,$,P=null;if(I){let q=to(l,f,y);$=q.naturalPosition,P=q.cappingNaturalPosition;}else $=eo(l,f);let z,H,te=f===document.documentElement;if(b)z=window.innerHeight,H=window.innerWidth;else if(y===f||g)z=f.clientHeight,H=f.clientWidth;else if(te&&P){let q=y.clientHeight,se=y.clientWidth,ee=P.offsetY+q-$.offsetY,re=P.offsetX+se-$.offsetX;z=-ee,H=-re;}else if(P){let q=f.clientHeight,se=f.clientWidth,ee=y.clientHeight,re=y.clientWidth,ie=P.offsetY+ee-$.offsetY,ge=P.offsetX+re-$.offsetX;z=ie<q?-ie:q,H=ge<se?-ge:se;}else z=f.clientHeight,H=f.clientWidth;d={top:M===null?null:M+w,bottom:E===null?null:E+k,left:N===null?null:N+p,right:v===null?null:v+L,naturalTop:$.offsetY+w,naturalLeft:$.offsetX+p,containerWidth:H,containerHeight:z,elementWidth:h.width,elementHeight:h.height,anchorAbsoluteDepth:u};}return {rect:Hn(t),scrollHierarchy:r,position:o,stickyConfig:d,initialWindowX:n,initialWindowY:i,depth:c,hasContainingBlock:!!a,containingBlock:a}}function ot(e,t,n){return t?{x:Math.max(t.visibleMinX-n.scrollX,Math.min(e.x,t.visibleMaxX-n.scrollX)),y:Math.max(t.visibleMinY-n.scrollY,Math.min(e.y,t.visibleMaxY-n.scrollY))}:e}function Gt(e,t,n){if(!e||!n)return [];let i=[];if(e==="sibling"){let r=no(t,n);i.push(r);}else if(e==="parent"||e==="child"){let r=io(t,n,e);i.push(...r);}return i}function no(e,t){let n=Math.max(e.left,t.left),i=Math.min(e.right,t.right),r=i>n,o=Math.max(e.top,t.top),l=Math.min(e.bottom,t.bottom),a=l>o,c={startSync:"primary",endSync:"secondary"};if(r&&!a){let x=(n+i)/2,g=Math.abs(t.top-e.bottom),h=Math.abs(e.top-t.bottom),w=g<h?e.bottom:e.top,p=g<h?t.top:t.bottom;return {type:"distance",value:Math.min(g,h),start:{x,y:w},end:{x,y:p},...c}}if(a&&!r){let x=(o+l)/2,g=Math.abs(t.left-e.right),h=Math.abs(e.left-t.right),w=g<h?e.right:e.left,p=g<h?t.left:t.right;return {type:"distance",value:Math.min(g,h),start:{x:w,y:x},end:{x:p,y:x},...c}}let u=[{x:(e.left+e.right)/2,y:e.top},{x:(e.left+e.right)/2,y:e.bottom}],d=[{x:(t.left+t.right)/2,y:t.top},{x:(t.left+t.right)/2,y:t.bottom}],s=1/0,f=u[0],m=d[0];for(let x of u)for(let g of d){let h=x.x-g.x,w=x.y-g.y,p=h*h+w*w;p<s&&(s=p,f=x,m=g);}let y=f??u[0],b=m??d[0];return {type:"distance",value:Math.sqrt(s),start:{x:y.x,y:y.y},end:{x:b.x,y:b.y},...c}}function io(e,t,n){return n==="parent"?[{type:"left",value:Math.abs(e.left-t.left),start:{x:t.left,y:e.top+e.height/2},end:{x:e.left,y:e.top+e.height/2},startSync:"secondary",endSync:"primary"},{type:"top",value:Math.abs(e.top-t.top),start:{x:e.left+e.width/2,y:t.top},end:{x:e.left+e.width/2,y:e.top},startSync:"secondary",endSync:"primary"},{type:"right",value:Math.abs(t.right-e.right),start:{x:e.right,y:e.top+e.height/2},end:{x:t.right,y:e.top+e.height/2},startSync:"primary",endSync:"secondary"},{type:"bottom",value:Math.abs(t.bottom-e.bottom),start:{x:e.left+e.width/2,y:e.bottom},end:{x:e.left+e.width/2,y:t.bottom},startSync:"primary",endSync:"secondary"}]:[{type:"left",value:Math.abs(t.left-e.left),start:{x:e.left,y:t.top+t.height/2},end:{x:t.left,y:t.top+t.height/2},startSync:"primary",endSync:"secondary"},{type:"top",value:Math.abs(t.top-e.top),start:{x:t.left+t.width/2,y:e.top},end:{x:t.left+t.width/2,y:t.top},startSync:"primary",endSync:"secondary"},{type:"right",value:Math.abs(e.right-t.right),start:{x:t.right,y:t.top+t.height/2},end:{x:e.right,y:t.top+t.height/2},startSync:"secondary",endSync:"primary"},{type:"bottom",value:Math.abs(e.bottom-t.bottom),start:{x:t.left+t.width/2,y:t.bottom},end:{x:t.left+t.width/2,y:e.bottom},startSync:"secondary",endSync:"primary"}]}function We(e,t,n,i,r,o=0,l=0){let a=t==="secondary"?r:i,c=t==="secondary"?r:i;return {x:e.x-(a?.deltaX??0)-o,y:e.y-(c?.deltaY??0)-l}}function Kt(e,t){if(!t)return e.value;let n=it(t.primaryHierarchy,t.primaryPosition,t.primarySticky,t.primaryWinX,t.primaryWinY,!!t.primaryHasContainingBlock),i=it(t.secondaryHierarchy,t.secondaryPosition,t.secondarySticky,t.secondaryWinX,t.secondaryWinY,!!t.secondaryHasContainingBlock),r=We(e.start,e.startSync,e,n,i),o=We(e.end,e.endSync,e,n,i),l=Math.abs(r.x-o.x),a=Math.abs(r.y-o.y);return e.type==="top"||e.type==="bottom"?a:e.type==="left"||e.type==="right"?l:Math.sqrt(l*l+a*a)}function oo(e,t,n,i=null,r=null){let o=Ki(e,t,n,i,r);if(!o)return null;let{context:l,element:a}=o;return ro(e,a,l)}function ro(e,t,n){if(t===e)return null;let i=n??(e.contains(t)?"child":t.contains(e)?"parent":"sibling"),r=Bt(e),o=Bt(t),l=r.rect,a=o.rect,c=Gt(i,l,a);return {element:t,result:{context:i,lines:c,primary:l,secondary:a,timestamp:Date.now(),primaryHierarchy:r.scrollHierarchy,secondaryHierarchy:o.scrollHierarchy,secondaryElement:t,primaryPosition:r.position,secondaryPosition:o.position,primarySticky:r.stickyConfig,secondarySticky:o.stickyConfig,primaryWinX:r.initialWindowX,primaryWinY:r.initialWindowY,secondaryWinX:o.initialWindowX,secondaryWinY:o.initialWindowY}}}function lo(){let e="IDLE";function t(){return e}function n(a){let u={IDLE:["ARMED","FROZEN"],ARMED:["MEASURING","FROZEN","IDLE"],MEASURING:["FROZEN","IDLE"],FROZEN:["MEASURING","IDLE"]}[e];return u&&u.includes(a)?(e=a,true):false}function i(){return e==="IDLE"}function r(){return e==="ARMED"}function o(){return e==="MEASURING"}function l(){return e==="FROZEN"}return {getState:t,transitionTo:n,isIdle:i,isArmed:r,isMeasuring:o,isFrozen:l}}function ao(){let e={baseValue:0,operation:null,inputValue:"",result:null,isActive:false};function t(){let r=e.inputValue===""?"0":e.inputValue,o=parseFloat(r);if(isNaN(o))return null;switch(e.operation){case "+":return e.baseValue+o;case "-":return e.baseValue-o;case "*":return e.baseValue*o;case "/":return o!==0?e.baseValue/o:null;default:return null}}function n(r){switch(r.type){case "OPEN":e={baseValue:r.baseValue,operation:null,inputValue:"",result:null,isActive:true};break;case "SYNC_VALUE":e.isActive&&e.operation===null&&(e={...e,baseValue:r.value});break;case "INPUT_DIGIT":if(!e.isActive||!e.operation)return e;let o=r.digit===".",l=(e.inputValue||"").includes(".");if(o&&l)return e;e.result!==null?e={...e,inputValue:o?"0.":r.digit,result:null}:e={...e,inputValue:e.inputValue==="0"&&!o?r.digit:e.inputValue+r.digit};break;case "INPUT_OPERATION":if(!e.isActive)return e;let a=e.result!==null,c=e.inputValue===""||e.inputValue==="0";a||e.operation&&!c?e={baseValue:a?e.result:t()??e.baseValue,operation:r.operation,inputValue:"",result:null,isActive:true}:e={...e,operation:r.operation,inputValue:"",result:null};break;case "BACKSPACE":if(!e.isActive)return e;e.result!==null?e={...e,result:null}:e.inputValue.length>0?e={...e,inputValue:e.inputValue.slice(0,-1)}:e.operation?e={...e,operation:null}:e={...e,isActive:false};break;case "DELETE":if(!e.isActive)return e;e={baseValue:e.baseValue,operation:null,inputValue:"",result:null,isActive:false};break;case "ENTER":if(!e.isActive||!e.operation)return e;let u=t();e={...e,result:u};break;case "CLOSE":e={baseValue:0,operation:null,inputValue:"",result:null,isActive:false};break}return e}function i(){return {...e}}return {getState:i,dispatch:n,calculate:t}}function so(){let e=ao();function t(u){e.dispatch({type:"OPEN",baseValue:u});}function n(u){/^[0-9.]$/.test(u)?e.dispatch({type:"INPUT_DIGIT",digit:u}):/^[+\-*/]$/.test(u)&&e.dispatch({type:"INPUT_OPERATION",operation:u});}function i(){e.dispatch({type:"BACKSPACE"});}function r(){e.dispatch({type:"DELETE"});}function o(){e.dispatch({type:"ENTER"});}function l(){e.dispatch({type:"CLOSE"});}function a(u){e.dispatch({type:"SYNC_VALUE",value:u});}function c(){return e.getState().result}return {getState:e.getState,open:t,handleInput:n,handleBackspace:i,handleDelete:r,handleEnter:o,close:l,syncValue:a,getResult:c}}function co(){let e={direction:null,value:"",element:null},t=new Set,n=()=>{t.forEach(i=>i({...e}));};return {getState:()=>({...e}),setDirection:i=>{e.direction=i,n();},setElement:i=>{e.element=i,n();},appendValue:(i,r)=>{if(/^[0-9.]$/.test(i)){let o=i===".",l=e.value.includes(".");if(o&&l)return;let a=e.value+i,c=parseFloat(a)||0;r!==void 0&&c>r?e.value=Math.floor(r).toString():e.value=a,n();}},capValue:i=>{(parseFloat(e.value)||0)>i&&(e.value=Math.floor(i).toString(),n());},backspace:()=>{e.value.length>0?(e.value=e.value.slice(0,-1),n()):e.direction&&(e.direction=null,n());},clear:()=>{e={direction:null,value:"",element:null},n();},onUpdate:i=>(t.add(i),()=>t.delete(i))}}function yt(e=""){let t=Math.random().toString(36).substring(2,11);return e?`${e}-${t}`:t}function uo(){let e={lines:[]},t=new Set,n=()=>{t.forEach(i=>i({lines:[...e.lines]}));};return {getState:()=>({lines:[...e.lines]}),addPair:(i,r)=>{if(e.lines.length>=Xi)return null;let o={id:yt("ruler-h"),type:"horizontal",position:r},l={id:yt("ruler-v"),type:"vertical",position:i};return e.lines.push(o,l),n(),l.id},updateLine:(i,r)=>{let o=e.lines.findIndex(l=>l.id===i);o!==-1&&e.lines[o]&&(e.lines[o]={...e.lines[o],position:r},n());},removeLine:i=>{e.lines=e.lines.filter(r=>r.id!==i),n();},clear:()=>{e.lines=[],n();},onUpdate:i=>(t.add(i),()=>t.delete(i))}}function Gn(){let e=Oi(),t=Wi(e),n=lo(),i=so(),r=co(),o=uo(),l=new Set,a=null,c=null,u=null;function d(){l.forEach(I=>I());}function s(I,$){n.transitionTo("ARMED"),t.scheduleRead(()=>{performance.now();let z=oo(I,$.x,$.y,c,u);if(z){let{result:H,element:te}=z;if(!n.isMeasuring()&&!n.isArmed()||n.isMeasuring()&&te===u&&H.context===c)return;a=H,c=H.context,u=te,n.transitionTo("MEASURING"),d();}});}function f(){let I=n.getState();(I==="MEASURING"||I==="IDLE"||I==="ARMED")&&(t.cancel(),n.transitionTo("FROZEN"),d());}function m(I){n.isFrozen()&&(n.transitionTo(I?"MEASURING":"IDLE"),d());}function y(){t.cancel(),n.transitionTo("IDLE"),i.close(),r.clear(),o.clear(),a=null,c=null,u=null,d();}function b(){t.cancel(),n.getState()==="MEASURING"&&(n.transitionTo("IDLE"),d());}function x(){y(),l.clear(),a=null,c=null,u=null;}function g(){return n.getState()}function h(){return a}function w(){return u}function p(){return i}function k(){return r}function L(){return o}function M(I){return l.add(I),()=>{l.delete(I);}}function E(I){if(!a)return;let $=new DOMRect(I.left+window.scrollX,I.top+window.scrollY,I.width,I.height);a={...a,primary:$,primaryWinX:window.scrollX,primaryWinY:window.scrollY,lines:Gt(a.context,$,a.secondary)},d();}function N(I){if(!a)return;let $=new DOMRect(I.left+window.scrollX,I.top+window.scrollY,I.width,I.height);a={...a,secondary:$,secondaryWinX:window.scrollX,secondaryWinY:window.scrollY,lines:Gt(a.context,a.primary,$)},d();}function v(I){a=I,n.transitionTo("MEASURING"),d();}return {measure:s,abort:y,stop:b,freeze:f,unfreeze:m,cleanup:x,getState:g,getCurrentResult:h,getSecondaryElement:w,getCalculator:p,getProjection:k,getRuler:L,onStateChange:M,updatePrimaryRect:E,updateSecondaryRect:N,applyResult:v}}async function fo(e){return new Promise((t,n)=>{if(typeof requestAnimationFrame>"u"||typeof document<"u"&&document.hidden){setTimeout(()=>{try{t(e());}catch(i){n(i);}},0);return}requestAnimationFrame(()=>{Promise.resolve().then(()=>{try{t(e());}catch(i){n(i);}});});})}function Zn(){let e=null,t=null,n=[],i="static",r,o=0,l=0,a=0,c=new Set;function u(){return {element:e,rect:t,scrollHierarchy:n,position:i,stickyConfig:r,initialWindowX:o,initialWindowY:l,depth:a}}function d(){let g=u();c.forEach(h=>h(g));}function s(g){e===g&&(g!==null||t===null)||(e=g,g?fo(()=>{if(e===g&&document.contains(g)){let h=Bt(g);t=h.rect,n=h.scrollHierarchy,i=h.position,r=h.stickyConfig,o=h.initialWindowX,l=h.initialWindowY,a=h.depth,d();}}):(t=null,n=[],i="static",r=void 0,o=0,l=0,a=0,d()));}function f(){return e}function m(){return t}function y(){s(null);}function b(g){return c.add(g),()=>{c.delete(g);}}function x(g){e&&(t=new DOMRect(g.left+window.scrollX,g.top+window.scrollY,g.width,g.height),o=window.scrollX,l=window.scrollY,d());}return {select:s,getSelected:f,getSelectedRect:m,getMetadata:u,clear:y,onUpdate:b,updateRect:x}}var Qn=typeof window<"u";function ho(){if(!Qn)return "other";let e=navigator.userAgentData?.platform;if(e)switch(e){case "macOS":return "macos";case "iOS":return "ios";case "Windows":return "windows";case "Android":return "android";case "Linux":return "linux"}let t=navigator.userAgent;return /iPhone|iPad|iPod/.test(t)?"ios":/Macintosh/.test(t)?"macos":/Windows/.test(t)?"windows":/Android/.test(t)?"android":/Linux/.test(t)?"linux":"other"}var pt=ho(),Rn=pt==="macos"||pt==="ios",mo={IS_BROWSER:Qn,NAME:pt,IS_MAC:pt==="macos",IS_IOS:pt==="ios",IS_APPLE:Rn,getControlKey:()=>Rn?"Meta":"Control"},he={activate:"Alt",freeze:" ",select:mo.getControlKey(),clear:"Escape",calculator:{top:"t",right:"r",bottom:"b",left:"l",distance:"g"},projection:{top:"w",left:"a",bottom:"s",right:"d"},ruler:"r",selectionHoldDuration:250},ae={primary:"rgba(24, 160, 251, 1)",secondary:"rgba(242, 78, 30, 1)",calcBg:"rgba(30, 30, 30, 0.95)",calcShadow:"rgba(0, 0, 0, 0.25)",calcOpHighlight:"rgba(24, 160, 251, 0.3)",calcText:"rgba(255, 255, 255, 1)",text:"rgba(255, 255, 255, 1)",projection:"rgba(155, 81, 224, 1)",ruler:"rgba(24, 160, 251, 1)"},Yn={enabled:true,lerpFactor:.25};function qn(e,t){if(e==null||e==="")return t;let n=Number(e);return isFinite(n)&&!isNaN(n)?n:t}function He(e,t){if(e.startsWith("#")){let n=e.slice(1);n.length===3&&(n=n.split("").map(l=>l+l).join(""));let i=parseInt(n.slice(0,2),16),r=parseInt(n.slice(2,4),16),o=parseInt(n.slice(4,6),16);return `rgba(${i}, ${r}, ${o}, ${t})`}return e.startsWith("rgba")?e.replace(/[\d.]+\)$/g,`${t})`):e.startsWith("rgb")?e.replace(")",`, ${t})`).replace("rgb","rgba"):e}function Kn(e,t=document.documentElement){if(!e||!t)return;let n=t;e.primary&&(n.style.setProperty("--caliper-primary",e.primary),n.style.setProperty("--caliper-primary-90",He(e.primary,.9)),n.style.setProperty("--caliper-primary-95",He(e.primary,.95)),n.style.setProperty("--caliper-primary-50",He(e.primary,.5)),n.style.setProperty("--caliper-primary-05",He(e.primary,.05))),e.secondary&&(n.style.setProperty("--caliper-secondary",e.secondary),n.style.setProperty("--caliper-secondary-50",He(e.secondary,.5)),n.style.setProperty("--caliper-secondary-05",He(e.secondary,.05))),e.calcBg&&n.style.setProperty("--caliper-calc-bg",e.calcBg),e.calcShadow&&n.style.setProperty("--caliper-calc-shadow",e.calcShadow),e.calcOpHighlight&&n.style.setProperty("--caliper-calc-op-highlight",e.calcOpHighlight),e.calcText&&n.style.setProperty("--caliper-calc-text",e.calcText),e.text&&n.style.setProperty("--caliper-text",e.text),e.projection&&(n.style.setProperty("--caliper-projection",e.projection),n.style.setProperty("--caliper-projection-90",He(e.projection,.9)),n.style.setProperty("--caliper-projection-light",He(e.projection,.2))),e.ruler&&n.style.setProperty("--caliper-ruler",e.ruler);}function Jn(e){return {activate:e?.activate??he.activate,freeze:e?.freeze??he.freeze,select:e?.select??he.select,clear:e?.clear??he.clear,calculator:{top:e?.calculator?.top??he.calculator.top,right:e?.calculator?.right??he.calculator.right,bottom:e?.calculator?.bottom??he.calculator.bottom,left:e?.calculator?.left??he.calculator.left,distance:e?.calculator?.distance??he.calculator.distance},projection:{top:e?.projection?.top??he.projection.top,left:e?.projection?.left??he.projection.left,bottom:e?.projection?.bottom??he.projection.bottom,right:e?.projection?.right??he.projection.right},ruler:e?.ruler??he.ruler,selectionHoldDuration:qn(e?.selectionHoldDuration,he.selectionHoldDuration)}}function ei(e){return {enabled:e?.enabled??Yn.enabled,lerpFactor:qn(e?.lerpFactor,Yn.lerpFactor)}}function ti(e){return {primary:e?.primary??ae.primary,secondary:e?.secondary??ae.secondary,calcBg:e?.calcBg??ae.calcBg,calcShadow:e?.calcShadow??ae.calcShadow,calcOpHighlight:e?.calcOpHighlight??ae.calcOpHighlight,calcText:e?.calcText??ae.calcText,text:e?.text??ae.text,projection:e?.projection??ae.projection,ruler:e?.ruler??ae.ruler}}function ni(){if(typeof window<"u"){let e=window.__CALIPER_CONFIG__??{},n=(typeof document<"u"?document.currentScript:null)?.getAttribute("data-config")||(typeof document<"u"?document.querySelector("script[data-config]")?.getAttribute("data-config"):null);if(n)try{let i=JSON.parse(n);return {...e,...i,theme:{...e.theme,...i.theme},commands:{...e.commands,...i.commands},animation:{...e.animation,...i.animation},bridge:{...e.bridge,...i.bridge}}}catch(i){console.warn("[CALIPER] Failed to parse data-config attribute",i);}return e}return {}}var go="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTcyIiBoZWlnaHQ9IjUwIiB2aWV3Qm94PSIwIDAgMTcyIDUwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ3LjIxNDQgNy42MjkzOWUtMDZIMzIuNzkyOEwyNS44MjUgNDMuMzIyNUgzNS4wNjEzTDM2LjE5NTYgMzUuMDE2M0g0NC4xMzU2TDQ1LjI2OTkgNDMuMzIyNUg1NC42NjgzTDQ3LjIxNDQgNy42MjkzOWUtMDZaTTM5LjU5ODUgOC4zMDYySDQwLjczMjhMNDQuMTM1NiAyOC4xNzU5SDM2LjE5NTZMMzkuNTk4NSA4LjMwNjJaIiBmaWxsPSIjQUMyMzIzIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNS4wMjMyOCAwTDAgNS4wNDg4NlYyOC4zMzg4TDUuMTg1MzIgMzMuMzg3NkgxNy41MDA0VjM1LjM0MkgxNS41NTZWNDYuNzQyN0gxOS4xMjA5TDI0LjMwNjIgMzUuNjY3OFYyNS44OTU4SDcuMTI5ODFWNy4zMjg5OUgxMy40NDk0VjBINS4wMjMyOFoiIGZpbGw9IiNBQzIzMjMiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02Ni40OTc0IDcuNjI5MzllLTA2SDU3LjI2MVY0LjM5NzRINjIuNDQ2M1Y1LjIxMTczSDU3LjI2MVY2LjY3NzU0SDYwLjE3NzdWNy4zMjg5OUg1Ny4yNjFWOC45NTc2Nkg2MC4xNzc3VjkuNjA5MTNINTcuMjYxVjExLjA3NDlINjAuMTc3N1YxMS43MjY0SDU3LjI2MVYxMy4xOTIySDYyLjQ0NjNWMTMuODQzN0g1Ny4yNjFWMTUuNDcyM0g2MC4xNzc3VjE2LjEyMzhINTcuMjYxVjE3LjU4OTZINjAuMTc3N1YxOC4yNDExSDU3LjI2MVYxOS44Njk3SDYwLjE3NzdWMjAuNTIxMkg1Ny4yNjFWMjEuODI0MUg2Mi40NDYzVjIyLjYzODRINTcuMjYxVjI0LjI2NzFINjAuMTc3N1YyNC43NTU3SDU3LjI2MVYyNi4zODQ0SDYwLjE3NzdWMjcuMDM1OEg1Ny4yNjFWMjguNTAxNkg2MC4xNzc3VjI5LjE1MzFINTcuMjYxVjMwLjYxODlINjIuNDQ2M1YzMS40MzMySDU3LjI2MVYzMi44OTlINjAuMTc3N1YzMy41NTA1SDU3LjI2MVYzNS4wMTYzSDYwLjE3NzdWMzUuODMwNkg1Ny4yNjFWMzcuMjk2NEg2MC4xNzc3VjM3Ljk0NzlINTcuMjYxVjM5LjQxMzdINjIuNDQ2M1Y0MC4yMjhINTcuMjYxVjQzLjMyMjVINzcuODQwMlYzNS4wMTYzSDY2LjQ5NzRWNy42MjkzOWUtMDZaIiBmaWxsPSIjQUMyMzIzIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzcuODQwMiAyNy42ODczSDY3LjQ2OTZMNjkuNDE0MSAzMC42MTg5TDc5Ljc4NDcgMzQuMjAyVjQzLjk3MzlDNzcuNTQzOSA0NC4zNzMgNzYuNTQzOSA0NS4yNzY5IDc2LjU0MzkgNDcuMDY4NEM3Ni41NDM5IDQ5LjE4NTcgNzcuNTc4IDQ5Ljg1MjEgNzkuNzg0NyA1MEg4Mi44NjM1VjI4LjUwMTZINzcuODQwMlYyNy42ODczWiIgZmlsbD0iI0FDMjMyMyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg5Ljk5MzMgNy42MjkzOWUtMDZIODAuNzU3VjQuMzk3NEg4NS43ODAzVjUuMjExNzNIODAuNzU3VjYuNjc3NTRIODMuNTExN1Y3LjMyODk5SDgwLjc1N1Y4Ljk1NzY2SDgzLjUxMTdWOS40NDYyNkg4MC43NTdWMTEuMDc0OUg4My41MTE3VjExLjcyNjRIODAuNzU3VjEzLjE5MjJIODUuNzgwM1YxMy44NDM3SDgwLjc1N1YxNS40NzIzSDgzLjUxMTdWMTYuMTIzOEg4MC43NTdWMTcuNTg5Nkg4My41MTE3VjE4LjI0MTFIODAuNzU3VjE5Ljg2OTdIODMuNTExN1YyMC41MjEySDgwLjc1N1YyMS44MjQxSDg1Ljc4MDNWMjIuNjM4NEg4MC43NTdWMjcuMDM1OEg4My44MzU4VjQzLjMyMjVIODcuMjM4NlYxMi4zNzc5SDkyLjI2MTlWOS40NDYyNkg5My4wNzIxVjEwLjA5NzdIOTkuNzE1OEM5OC45MDU2IDguNzk0NzkgOTcuMTIzMSA3LjY1NDczIDk0Ljg1NDYgNy4wMDMyN0g4OS45OTMzVjcuNjI5MzllLTA2WiIgZmlsbD0iI0FDMjMyMyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTkyLjI2MTkgMTMuODQzN0g4OC4wNDg4VjQzLjMyMjVIOTIuMjYxOVYyOC41MDE2SDkzLjA3MjFWMjkuMzE2SDk0Ljg1NDZWMjUuNTdIOTMuMDcyMVYyNi4zODQ0SDkyLjI2MTlWMTMuODQzN1oiIGZpbGw9IiNBQzIzMjMiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05NS42NjQ4IDYuMzUxOFY3LjYyOTM5ZS0wNkgxMTMuMDAzTDExOS42NDcgNi4zNTE4VjIxLjgyNDFMMTEzLjAwMyAyOC41MDE2SDEwNC45MDFMMTA0LjczOSA0My4zMjI1SDk1LjY2NDhWMTEuMDc0OUgxMDAuODVDMTAwLjUyNiA4LjYzMTkzIDk4LjkwNTYgNy4zMjkgOTUuNjY0OCA2LjM1MThaTTEwNC45MDEgNy45ODA0NkgxMTAuNTczVjIwLjUyMTJIMTA0LjkwMVY3Ljk4MDQ2WiIgZmlsbD0iI0FDMjMyMyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE0My4zMDUgNy42MjkzOWUtMDZIMTIzLjIxMlY0My4zMjI1SDE0My4zMDVWMzUuMDE2M0gxMzIuNDQ4VjI0LjQzSDE0MS42ODVWMTYuMTIzOEgxMzIuNDQ4VjcuOTgwNDZIMTQzLjMwNVY3LjYyOTM5ZS0wNloiIGZpbGw9IiNBQzIzMjMiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNDcuMTk0IDQzLjMyMjVWNy42MjkzOWUtMDZIMTY1LjE4TDE3MS41IDUuODYzMlYxNi45MzgxTDE2Ni4xNTMgMjEuODI0MUwxNzEuNSAyNS41N1Y0My4zMjI1SDE2Mi40MjZWMjUuNTdIMTU2LjI2OFY0My4zMjI1SDE0Ny4xOTRaTTE1Ni4yNjggNy45ODA0NkgxNjIuNDI2VjE3LjU4OTZIMTU2LjI2OFY3Ljk4MDQ2WiIgZmlsbD0iI0FDMjMyMyIvPgo8L3N2Zz4K";async function po(){try{let t=await fetch("https://unpkg.com/@oyerinde/caliper@latest/dist/version.json",{method:"GET",cache:"no-store",headers:{Accept:"application/json"},signal:AbortSignal.timeout(3e3)});if(t.ok)return await t.json()}catch{}return null}function yo(e,t){let n=e.split(".").map(Number),i=t.split(".").map(Number);for(let r=0;r<Math.max(n.length,i.length);r++){let o=n[r]||0,l=i[r]||0;if(o<l)return -1;if(o>l)return 1}return 0}async function ii(e){if(typeof window>"u")return;let t=`
11
+ var xi=(e,t)=>e===t;var bi=Symbol("solid-track");var Et={equals:xi},En=Cn,Se=1,ft=2,Nn={owned:null,cleanups:null,context:null,owner:null};var R=null,T=null,Je=null,Z=null,le=null,fe=null,It=0;function et(e,t){let n=Z,i=R,r=e.length===0,o=t===void 0?i:t,l=r?Nn:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=r?e:()=>e(()=>me(()=>Xe(l)));R=l,Z=null;try{return De(a,!0)}finally{Z=n,R=i;}}function _(e,t){t=t?Object.assign({},Et,t):Et;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},i=r=>(typeof r=="function"&&(r=r(n.value)),Ln(n,r));return [Tn.bind(n),i]}function F(e,t,n){let i=Ft(e,t,false,Se);mt(i);}function ye(e,t,n){En=Ii;let i=Ft(e,t,false,Se);(!n||!n.render)&&(i.user=true),fe?fe.push(i):mt(i);}function U(e,t,n){n=n?Object.assign({},Et,n):Et;let i=Ft(e,t,true,0);return i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,mt(i),Tn.bind(i)}function me(e){if(Z===null)return e();let t=Z;Z=null;try{return Je?Je.untrack(e):e()}finally{Z=t;}}function In(e,t,n){let i=Array.isArray(e),r;return l=>{let a;if(i){a=Array(e.length);for(let u=0;u<e.length;u++)a[u]=e[u]();}else a=e();let s=me(()=>t(a,r,l));return r=a,s}}function kt(e){ye(()=>me(e));}function we(e){return R===null||(R.cleanups===null?R.cleanups=[e]:R.cleanups.push(e)),e}function Tt(){return R}function kn(e,t){let n=R,i=Z;R=e,Z=null;try{return De(t,!0)}catch(r){Lt(r);}finally{R=n,Z=i;}}var[sr,xn]=_(false);function Tn(){let e=T;if(this.sources&&(this.state))if((this.state)===Se)mt(this);else {let t=le;le=null,De(()=>Nt(this),false),le=t;}if(Z){let t=this.observers?this.observers.length:0;Z.sources?(Z.sources.push(this),Z.sourceSlots.push(t)):(Z.sources=[this],Z.sourceSlots=[t]),this.observers?(this.observers.push(Z),this.observerSlots.push(Z.sources.length-1)):(this.observers=[Z],this.observerSlots=[Z.sources.length-1]);}return e&&T.sources.has(this)?this.tValue:this.value}function Ln(e,t,n){let i=e.value;if(!e.comparator||!e.comparator(i,t)){e.value=t;e.observers&&e.observers.length&&De(()=>{for(let r=0;r<e.observers.length;r+=1){let o=e.observers[r],l=T&&T.running;l&&T.disposed.has(o)||((l?!o.tState:!o.state)&&(o.pure?le.push(o):fe.push(o),o.observers&&Dn(o)),l?o.tState=Se:o.state=Se);}if(le.length>1e6)throw le=[],new Error},false);}return t}function mt(e){if(!e.fn)return;Xe(e);let t=It;bn(e,e.value,t);}function bn(e,t,n){let i,r=R,o=Z;Z=R=e;try{i=e.fn(t);}catch(l){return e.pure&&((e.state=Se,e.owned&&e.owned.forEach(Xe),e.owned=null)),e.updatedAt=n+1,Lt(l)}finally{Z=o,R=r;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ln(e,i):e.value=i,e.updatedAt=n);}function Ft(e,t,n,i=Se,r){let o={fn:e,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:R,context:R?R.context:null,pure:n};if(R===null||R!==Nn&&(R.owned?R.owned.push(o):R.owned=[o]),Je);return o}function dt(e){let t=T;if((e.state)===0)return;if((e.state)===ft)return Nt(e);if(e.suspense&&me(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<It);){(e.state)&&n.push(e);}for(let i=n.length-1;i>=0;i--){if(e=n[i],t);if((e.state)===Se)mt(e);else if((e.state)===ft){let r=le;le=null,De(()=>Nt(e,n[0]),false),le=r;}}}function De(e,t){if(le)return e();let n=false;t||(le=[]),fe?n=true:fe=[],It++;try{let i=e();return Ei(n),i}catch(i){n||(fe=null),le=null,Lt(i);}}function Ei(e){if(le&&(Cn(le),le=null),e)return;let n=fe;fe=null,n.length&&De(()=>En(n),false);}function Cn(e){for(let t=0;t<e.length;t++)dt(e[t]);}function Ii(e){let t,n=0;for(t=0;t<e.length;t++){let i=e[t];i.user?e[n++]=i:dt(i);}for(t=0;t<n;t++)dt(e[t]);}function Nt(e,t){e.state=0;for(let i=0;i<e.sources.length;i+=1){let r=e.sources[i];if(r.sources){let o=r.state;o===Se?r!==t&&(!r.updatedAt||r.updatedAt<It)&&dt(r):o===ft&&Nt(r,t);}}}function Dn(e){for(let n=0;n<e.observers.length;n+=1){let i=e.observers[n];(!i.state)&&(i.state=ft,i.pure?le.push(i):fe.push(i),i.observers&&Dn(i));}}function Xe(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),i=e.sourceSlots.pop(),r=n.observers;if(r&&r.length){let o=r.pop(),l=n.observerSlots.pop();i<r.length&&(o.sourceSlots[l]=i,r[i]=o,n.observerSlots[i]=l);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Xe(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Xe(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function ki(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Lt(e,t=R){let i=ki(e);throw i;}var Ti=Symbol("fallback");function Sn(e){for(let t=0;t<e.length;t++)e[t]();}function Li(e,t,n={}){let i=[],r=[],o=[],l=0,a=t.length>1?[]:null;return we(()=>Sn(o)),()=>{let s=e()||[],u=s.length,d,c;return s[bi],me(()=>{let h,p,w,b,g,m,v,y,k;if(u===0)l!==0&&(Sn(o),o=[],i=[],r=[],l=0,a&&(a=[])),n.fallback&&(i=[Ti],r[0]=et(L=>(o[0]=L,n.fallback())),l=1);else if(l===0){for(r=new Array(u),c=0;c<u;c++)i[c]=s[c],r[c]=et(f);l=u;}else {for(w=new Array(u),b=new Array(u),a&&(g=new Array(u)),m=0,v=Math.min(l,u);m<v&&i[m]===s[m];m++);for(v=l-1,y=u-1;v>=m&&y>=m&&i[v]===s[y];v--,y--)w[y]=r[v],b[y]=o[v],a&&(g[y]=a[v]);for(h=new Map,p=new Array(y+1),c=y;c>=m;c--)k=s[c],d=h.get(k),p[c]=d===void 0?-1:d,h.set(k,c);for(d=m;d<=v;d++)k=i[d],c=h.get(k),c!==void 0&&c!==-1?(w[c]=r[d],b[c]=o[d],a&&(g[c]=a[d]),c=p[c],h.set(k,c)):o[d]();for(c=m;c<u;c++)c in w?(r[c]=w[c],o[c]=b[c],a&&(a[c]=g[c],a[c](c))):r[c]=et(f);r=r.slice(0,l=u),i=s.slice(0);}return r});function f(h){if(o[c]=h,a){let[p,w]=_(c);return a[c]=w,t(s[c],p)}return t(s[c])}}}function C(e,t){return me(()=>e(t||{}))}var Di=e=>`Stale read from <${e}>.`;function Ye(e){let t="fallback"in e&&{fallback:()=>e.fallback};return U(Li(()=>e.each,e.children,t||void 0))}function Q(e){let t=e.keyed,n=U(()=>e.when,void 0,void 0),i=t?n:U(n,void 0,{equals:(r,o)=>!r==!o});return U(()=>{let r=i();if(r){let o=e.children;return typeof o=="function"&&o.length>0?me(()=>o(t?r:()=>{if(!me(i))throw Di("Show");return n()})):o}return e.fallback},void 0,void 0)}var Ee=e=>U(()=>e());function ji(e,t,n){let i=n.length,r=t.length,o=i,l=0,a=0,s=t[r-1].nextSibling,u=null;for(;l<r||a<o;){if(t[l]===n[a]){l++,a++;continue}for(;t[r-1]===n[o-1];)r--,o--;if(r===l){let d=o<i?a?n[a-1].nextSibling:n[o-a]:s;for(;a<o;)e.insertBefore(n[a++],d);}else if(o===a)for(;l<r;)(!u||!u.has(t[l]))&&t[l].remove(),l++;else if(t[l]===n[o-1]&&n[a]===t[r-1]){let d=t[--r].nextSibling;e.insertBefore(n[a++],t[l++].nextSibling),e.insertBefore(n[--o],d),t[r]=n[o];}else {if(!u){u=new Map;let c=a;for(;c<o;)u.set(n[c],c++);}let d=u.get(t[l]);if(d!=null)if(a<d&&d<o){let c=l,f=1,h;for(;++c<r&&c<o&&!((h=u.get(t[c]))==null||h!==d+f);)f++;if(f>d-a){let p=t[l];for(;a<d;)e.insertBefore(n[a++],p);}else e.replaceChild(n[a++],t[l++]);}else l++;else t[l++].remove();}}}var jn="_$DX_DELEGATE";function Pn(e,t,n,i={}){let r;return et(o=>{r=o,t===document?e():V(t,e(),t.firstChild?null:void 0,n);},i.owner),()=>{r(),t.textContent="";}}function X(e,t,n,i){let r,o=()=>{let a=i?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:i?a.firstChild:a.content.firstChild},l=t?()=>me(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(true);return l.cloneNode=l,l}function Fe(e,t=window.document){let n=t[jn]||(t[jn]=new Set);for(let i=0,r=e.length;i<r;i++){let o=e[i];n.has(o)||(n.add(o),t.addEventListener(o,$i));}}function D(e,t,n){(n==null?e.removeAttribute(t):e.setAttribute(t,n));}function B(e,t){(t==null?e.removeAttribute("class"):e.className=t);}function ze(e,t,n){if(!t)return n?D(e,"style"):t;let i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let r,o;for(o in n)t[o]==null&&i.removeProperty(o),delete n[o];for(o in t)r=t[o],r!==n[o]&&(i.setProperty(o,r),n[o]=r);return n}function J(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function V(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return Ct(e,t,i,n);F(r=>Ct(e,t(),r,n),i);}function $i(e){let t=e.target,n=`$$${e.type}`,i=e.target,r=e.currentTarget,o=s=>Object.defineProperty(e,"target",{configurable:true,value:s}),l=()=>{let s=t[n];if(s&&!t.disabled){let u=t[`${n}Data`];if(u!==void 0?s.call(t,u,e):s.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),true},a=()=>{for(;l()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let s=e.composedPath();o(s[0]);for(let u=0;u<s.length-2&&(t=s[u],!!l());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===r)break}}else a();o(i);}function Ct(e,t,n,i,r){for(;typeof n=="function";)n=n();if(t===n)return n;let l=typeof t,a=i!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,l==="string"||l==="number"){if(l==="number"&&(t=t.toString(),t===n))return n;if(a){let s=n[0];s&&s.nodeType===3?s.data!==t&&(s.data=t):s=document.createTextNode(t),n=tt(e,n,i,s);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||l==="boolean"){n=tt(e,n,i);}else {if(l==="function")return F(()=>{let s=t();for(;typeof s=="function";)s=s();n=Ct(e,s,n,i);}),()=>n;if(Array.isArray(t)){let s=[],u=n&&Array.isArray(n);if(Ht(s,t,n,r))return F(()=>n=Ct(e,s,n,i,true)),()=>n;if(s.length===0){if(n=tt(e,n,i),a)return n}else u?n.length===0?$n(e,s,i):ji(e,n,s):(n&&tt(e),$n(e,s));n=s;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=tt(e,n,i,t);tt(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function Ht(e,t,n,i){let r=false;for(let o=0,l=t.length;o<l;o++){let a=t[o],s=n&&n[e.length],u;if(!(a==null||a===true||a===false))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))r=Ht(e,a,s)||r;else if(u==="function")if(i){for(;typeof a=="function";)a=a();r=Ht(e,Array.isArray(a)?a:[a],Array.isArray(s)?s:[s])||r;}else e.push(a),r=true;else {let d=String(a);s&&s.nodeType===3&&s.data===d?e.push(s):e.push(document.createTextNode(d));}}return r}function $n(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n);}function tt(e,t,n,i){if(n===void 0)return e.textContent="";let r=i||document.createTextNode("");if(t.length){let o=false;for(let l=t.length-1;l>=0;l--){let a=t[l];if(r!==a){let s=a.parentNode===e;!o&&!l?s?e.replaceChild(r,a):e.insertBefore(r,n):s&&a.remove();}else o=true;}}else e.insertBefore(r,n);return [r]}var Pi="http://www.w3.org/2000/svg";function Oi(e,t=false,n=void 0){return t?document.createElementNS(Pi,e):document.createElement(e,{is:n})}function Ae(e){let {useShadow:t}=e,n=document.createTextNode(""),i=()=>e.mount||document.body,r=Tt(),o;return ye(()=>{o||(o=kn(r,()=>U(()=>e.children)));let a=i();if(a instanceof HTMLHeadElement){let[s,u]=_(false),d=()=>u(true);et(c=>V(a,()=>s()?c():o(),null)),we(d);}else {let s=Oi(e.isSVG?"g":"div",e.isSVG),u=t&&s.attachShadow?s.attachShadow({mode:"open"}):s;Object.defineProperty(s,"_$host",{get(){return n.parentNode},configurable:true}),V(u,o),a.appendChild(s),e.ref&&e.ref(s),we(()=>a.removeChild(s));}},void 0,{render:true}),n}function Ri(){let e=null,t=null,n=null,i=null;function r(){return "scheduler"in globalThis?"scheduler":"requestIdleCallback"in window?"idle":"post-raf"}function o(c,f){if(!("scheduler"in globalThis)){l(c,f);return}let h=globalThis.scheduler,p=globalThis.TaskController;if(!p){l(c,f);return}n=new p({priority:f?"user-visible":"background"}),h.postTask(()=>{c();},{signal:n?.signal,priority:f?"user-visible":"background"}).catch(()=>{});}function l(c,f){if(!("requestIdleCallback"in window)){a(c);return}t=requestIdleCallback(h=>{h.timeRemaining()>0||h.didTimeout?c():f?a(c):l(c,false);},{timeout:f?5:50});}function a(c){e=requestAnimationFrame(()=>{Promise.resolve().then(()=>{c();});});}function s(c){i=setTimeout(()=>{c();},0);}function u(c,f=false){switch(d(),r()){case "scheduler":o(c,f);break;case "idle":l(c,f);break;case "post-raf":a(c);break;case "timeout":s(c);break}}function d(){e!==null&&(cancelAnimationFrame(e),e=null),t!==null&&"cancelIdleCallback"in window&&(cancelIdleCallback(t),t=null),n&&(n.abort(),n=null),i!==null&&(clearTimeout(i),i=null);}return {scheduleRead:u,cancel:d}}var Yi=30,zi=16,_i=8,_n=60,Vi=30,Xi=8,Fi=Xi*2,Vn=6,Zt=11,Y="caliper-",Hi="caliper-bridge-tab-id",$t="caliper-overlay-root",Xn=2147483647,Wi=["caliper-","is-","has-","js-","framer-","motion-"];function Ui(e){let t=0,n=zi,i=[],r=null,o=null;function l(c){n=Math.ceil(1e3/(c/2));}function a(c){if(i.push(c),i.length>Yi&&i.shift(),i.length>=2){let f=i[i.length-1],h=i[0];if(f!==void 0&&h!==void 0){let p=f-h,w=i.length/p*1e3;l(w);}}}function s(){if(!o)return;let{callback:c,urgent:f}=o;o=null,t=performance.now(),e.scheduleRead(c,f);}function u(c,f=false){o={callback:c,urgent:f};let p=performance.now()-t;if(f||p>=n){r!==null&&(clearTimeout(r),r=null),s();return}r===null&&(r=setTimeout(()=>{r=null,s();},n-p));}function d(){e.cancel(),o=null,r!==null&&(clearTimeout(r),r=null);}return {scheduleRead:u,cancel:d,adaptToFrameRate:l,recordFrameTime:a}}function Qt(e,t={}){let n=t.maxFrames??_i,i=t.delay??Vi,r=0,o=null;return {execute(l,...a){o&&(clearTimeout(o),o=null),l&&r<n?(r++,o=setTimeout(()=>{r=0,e(...a),o=null;},i)):(r=0,e(...a));},cancel(){o&&(clearTimeout(o),o=null),r=0;}}}function Pt(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return false;let n=e.ownerDocument?.defaultView,i=n?.HTMLElement,r=n?.SVGElement;return i&&e instanceof i||r&&e instanceof r?true:"tagName"in e&&"getAttribute"in e}function je(){return document.getElementById($t)||document.documentElement}function Bi(e){if(!Pt(e))return false;let t=e.tagName.toUpperCase();if(["STYLE","SCRIPT","NOSCRIPT","TEMPLATE","META","LINK","HEAD"].includes(t))return false;let n=window.getComputedStyle(e),i=n.contentVisibility||n.getPropertyValue("content-visibility");return !(n.display==="none"||i==="hidden")}function Gi(e){if(!Pt(e))return false;let t=e.getBoundingClientRect();return t.width>0&&t.height>0}function Fn(e){return e.closest("[data-caliper-ignore]")?false:Bi(e)&&Gi(e)}var Zi=2;function Hn(e){return !e||!(e instanceof Element)?false:!!(e.closest("#caliper-overlay-root")||e.closest("[class*='caliper-']"))}function Qi(e,t){return document.elementsFromPoint(e,t).find(i=>Hn(i)?false:Fn(i))||null}function qt(e,t){let n=document.elementFromPoint(e,t);return !n||Hn(n)||!Fn(n)?null:n}function qi(e,t,n){let i=Qi(t,n);if(!i)return null;for(;i;){if(i!==e)return e.contains(i)?{context:"child",element:i}:i.contains(e)?{context:"parent",element:i}:{context:"sibling",element:i};i=i.parentElement;}return null}function Ki(e,t,n){let i=Math.min(Math.abs(e-n.left),Math.abs(e-n.right)),r=Math.min(Math.abs(t-n.top),Math.abs(t-n.bottom));return Math.min(i,r)}function Ji(e,t,n,i,r=null){let o=qi(e,t,n);if(!o)return null;let{context:l,element:a}=o;if(i&&r&&(l!==i||a!==r)){let s=r.getBoundingClientRect();if(Ki(t,n,s)<=Zi&&!((l==="sibling"||l==="child")&&i==="parent"))return {context:i,element:r}}return o}function _e(e){let t=window.getComputedStyle(e);return {position:t.position,overflow:t.overflow,overflowX:t.overflowX,overflowY:t.overflowY,transform:t.transform,filter:t.filter,perspective:t.perspective,contain:t.contain,willChange:t.willChange,top:t.top,bottom:t.bottom,left:t.left,right:t.right}}function Wn(e){return new DOMRect(e.left+window.scrollX,e.top+window.scrollY,e.width,e.height)}function Un(e){return /(auto|scroll|hidden|clip)/.test(e.overflow+e.overflowY+e.overflowX)}function On(e){if(!Pt(e)||e.tagName.toLowerCase()==="svg")return false;let t=_e(e);return Un(t)}function Bn(e){let t=_e(e);return /(auto|scroll|hidden)/.test(t.overflow+t.overflowY+t.overflowX)}function eo(e){let t=[],n=e;for(;n&&(t.push(n),n!==document.documentElement);)n=n.parentElement;let i=t.length;if(i<=1)return {scrollHierarchy:[],positionMode:"static",scrollAnchor:null,containingBlock:null,treeDepth:0,anchorAbsoluteDepth:-1};let r=[];for(let c=0;c<i;c++){let f=t[c];f!==void 0&&r.push(_e(f));}let o=[];o[i-1]=false;for(let c=i-2;c>=0;c--){let f=r[c+1];o[c]=f!==void 0&&f.position==="sticky"||(o[c+1]??false);}let l=[],a="static",s=null,u=null,d=-1;for(let c=0;c<i;c++){let f=t[c];if(f===void 0||f===document.documentElement)break;if(!Pt(f))continue;let h=r[c];if(h===void 0)continue;let p=i-1-c;if(a==="static"&&(h.position==="fixed"?(a="fixed",s=f,d=p):h.position==="sticky"&&(a="sticky",s=f,d=p)),f!==e&&!u&&(h.transform!=="none"||h.filter!=="none"||h.perspective!=="none"||h.contain==="paint"||h.contain==="layout"||h.willChange==="transform"||h.willChange==="filter")&&(u=f),c>=1&&Un(h)){let w=f;l.push({element:w,initialScrollTop:w.scrollTop,initialScrollLeft:w.scrollLeft,containerRect:Wn(w.getBoundingClientRect()),absoluteDepth:p,hasStickyAncestor:o[c]??false});}}return {scrollHierarchy:l,positionMode:a,scrollAnchor:s,containingBlock:u,treeDepth:i-1,anchorAbsoluteDepth:d}}function Rn(e,t,n,i,r,o){let l=t-e,a=i<0,s=Math.abs(i);if(o){let u=Math.min(l,s-r-n);return u=Math.max(u,0),u}else {let u=Math.max(l,n);if(a){let d=t+s-r-e;u=Math.min(u,d);}else u=Math.min(u,s-r);return u}}function Dt(e,t,n,i,r,o,l=false){if(i===null)return e-t;let a=Rn(t,n,i??-1/0,r,o,l),s=Rn(e,n,i??-1/0,r,o,l);return a-s}function it(e,t="static",n,i=0,r=0,o=false){let l=0,a=0,s=false;for(let u=0;u<e.length;u++){let d=e[u];if(!d)continue;let c=d.element,h=_e(c).position==="fixed";if(Bn(c)){let w=n&&d.absoluteDepth>n.anchorAbsoluteDepth,b=null,g=null,m=false,v=false;!s&&t==="sticky"&&n&&!w&&(n.top!==null?g=n.top:n.bottom!==null&&(g=n.bottom,v=true),n.left!==null?b=n.left:n.right!==null&&(b=n.right,m=true)),l+=Dt(c.scrollLeft,d.initialScrollLeft,n?.naturalLeft??0,b,n?.containerWidth??0,n?.elementWidth??0,m),a+=Dt(c.scrollTop,d.initialScrollTop,n?.naturalTop??0,g,n?.containerHeight??0,n?.elementHeight??0,v),(b!==null||g!==null)&&(s=true);}if(h&&!o)return l+=i-window.scrollX,a+=r-window.scrollY,{deltaX:l,deltaY:a}}if(!o){if(t==="fixed")l+=i-window.scrollX,a+=r-window.scrollY;else if(t==="sticky"&&n&&!s){let u=i-window.scrollX,d=r-window.scrollY,c=null,f=null,h=false,p=false;n.top!==null?f=n.top:n.bottom!==null&&(f=n.bottom,p=true),n.left!==null?c=n.left:n.right!==null&&(c=n.right,h=true);let w=Dt(window.scrollX,i,n.naturalLeft,c,n.containerWidth,n.elementWidth,h),b=Dt(window.scrollY,r,n.naturalTop,f,n.containerHeight,n.elementHeight,p);l+=w+u,a+=b+d;}}return {deltaX:l,deltaY:a}}function Gn(e,t,n,i,r=0,o=0){let l=new Map;for(let b=0;b<e.length;b++){let g=e[b];g&&g.element&&l.set(g.element,b);}let a=new Map;for(let b=0;b<t.length;b++){let g=t[b];g&&g.element&&a.set(g.element,b);}let s=[];for(let b=0;b<e.length;b++){let g=e[b];g&&g.element&&a.has(g.element)&&s.push(g);}if(On(i)){let b=l.get(i);if(b!==void 0){let g=e[b];g&&!s.includes(g)&&s.push(g);}}if(On(n)){let b=a.get(n);if(b!==void 0){let g=t[b];g&&!s.includes(g)&&s.push(g);}}if(s.length===0)return {minX:-1/0,maxX:1/0,minY:-1/0,maxY:1/0};let u=-1/0,d=1/0,c=-1/0,f=1/0,h=b=>{let g=new Float64Array(b.length+1),m=new Float64Array(b.length+1);for(let v=b.length-1;v>=0;v--){let y=b[v];y&&y.element?(g[v]=(g[v+1]??0)+(y.element.scrollLeft-y.initialScrollLeft),m[v]=(m[v+1]??0)+(y.element.scrollTop-y.initialScrollTop)):y&&(g[v]=g[v+1]??0,m[v]=m[v+1]??0);}return {sumsX:g,sumsY:m}},p=h(e),w=h(t);for(let b=0;b<s.length;b++){let g=s[b];if(!g||!g.element)continue;let m=l.has(g.element),v=m?p:w,y=m?l.get(g.element):a.get(g.element);if(y===void 0||y===-1)continue;let k=g.containerRect;if(!k)continue;let L=v.sumsX[y+1]??0,M=v.sumsY[y+1]??0,E=0,N=0,x;if(typeof g.hasStickyAncestor=="boolean")x=g.hasStickyAncestor;else if(g.element){let q=g.element;for(x=false;q&&q!==document.documentElement;){let se=_e(q);if(se.position==="sticky"){x=true;break}if(se.position==="fixed")break;q=q.parentElement;}}else x=false;x&&(E=window.scrollX-r,N=window.scrollY-o);let I=k.left-L+E,$=k.top-M+N,P=I+(g.element?.clientLeft??0),z=$+(g.element?.clientTop??0),H=P+(g.element?.clientWidth??k.width),te=z+(g.element?.clientHeight??k.height);u===-1/0?(u=P,d=H,c=z,f=te):(u=Math.max(u,P),d=Math.min(d,H),c=Math.max(c,z),f=Math.min(f,te));}return {minX:u,maxX:d,minY:c,maxY:f}}function ce(e,t,n="static",i,r=0,o=0,l=false){if(!e)return null;let{deltaX:a,deltaY:s}=it(t,n,i,r,o,l),u=-1/0,d=1/0,c=-1/0,f=1/0,h=t.length,p=new Float64Array(h+1),w=new Float64Array(h+1);for(let N=h-1;N>=0;N--){let x=t[N];x&&x.element?(p[N]=(p[N+1]??0)+(x.element.scrollLeft-x.initialScrollLeft),w[N]=(w[N+1]??0)+(x.element.scrollTop-x.initialScrollTop)):x&&(p[N]=p[N+1]??0,w[N]=w[N+1]??0);}for(let N=0;N<h;N++){let x=t[N];if(!x)continue;let I=x.containerRect;if(!I)continue;let $=p[N+1]??0,P=w[N+1]??0,z=0,H=0,te;if(typeof x.hasStickyAncestor=="boolean")te=x.hasStickyAncestor;else if(x.element){let ie=x.element;for(te=false;ie&&ie!==document.documentElement;){let ge=_e(ie);if(ge.position==="sticky"){te=true;break}if(ge.position==="fixed")break;ie=ie.parentElement;}}else te=false;te&&(z=window.scrollX-r,H=window.scrollY-o);let q=I.left-$+z,se=I.top-P+H,ee=q+(x.element?.clientLeft??0),re=se+(x.element?.clientTop??0);u===-1/0?(u=ee,d=ee+(x.element?.clientWidth??I.width),c=re,f=re+(x.element?.clientHeight??I.height)):(u=Math.max(u,ee),d=Math.min(d,ee+(x.element?.clientWidth??I.width)),c=Math.max(c,re),f=Math.min(f,re+(x.element?.clientHeight??I.height)));}let b=e.left-a,g=e.top-s,m=e.width,v=e.height,y=u!==-1/0&&(g+v<c||g>f||b+m<u||b>d),k=Math.max(0,c-g),L=Math.max(0,u-b),M=Math.max(0,g+v-f),E=Math.max(0,b+m-d);return {left:b,top:g,width:m,height:v,clipPath:u===-1/0?"none":`inset(${k}px ${E}px ${M}px ${L}px)`,isHidden:y,visibleMinX:u,visibleMaxX:d,visibleMinY:c,visibleMaxY:f}}function At(e){if(e==="auto")return null;let t=parseFloat(e);return isNaN(t)?null:t}function gt(e){let t=0,n=0,i=e;for(;i instanceof HTMLElement;){t+=i.offsetTop,n+=i.offsetLeft;let r=i.offsetParent;r instanceof HTMLElement&&(t+=r.clientTop||0,n+=r.clientLeft||0),i=r;}return {top:t,left:n}}function Ut(e,t){let n=[],i=e;for(;i&&(i instanceof HTMLElement&&_e(i).position==="sticky"&&n.push({element:i,originalPosition:i.style.position}),!(i===t||i===document.documentElement));)i=i.parentElement;return n}function to(e,t){let n=Ut(e,t);for(let{element:i}of n)i.style.position="static";try{let i=gt(e),r=gt(t);return {offsetX:i.left-r.left,offsetY:i.top-r.top}}finally{for(let{element:i,originalPosition:r}of n)i.style.position=r||"sticky";}}function no(e,t,n){let i=new Set,r=[];for(let{element:o,originalPosition:l}of Ut(e,t))i.has(o)||(i.add(o),r.push({element:o,originalPosition:l}));if(n&&n!==e)for(let{element:o,originalPosition:l}of Ut(n,t))i.has(o)||(i.add(o),r.push({element:o,originalPosition:l}));for(let{element:o}of r)o.style.position="static";try{let o=gt(t),l=gt(e),a={offsetX:l.left-o.left,offsetY:l.top-o.top},s=null;if(n&&n!==t){let u=gt(n);s={offsetX:u.left-o.left,offsetY:u.top-o.top};}return {naturalPosition:a,cappingNaturalPosition:s}}finally{for(let{element:o,originalPosition:l}of r)o.style.position=l||"sticky";}}function Bt(e){let t=e.getBoundingClientRect(),n=window.scrollX,i=window.scrollY,{scrollHierarchy:r,positionMode:o,scrollAnchor:l,containingBlock:a,treeDepth:s,anchorAbsoluteDepth:u}=eo(e),d;if(o==="sticky"&&l){let c=_e(l),f=document.documentElement,h=l.parentElement;for(;h&&h!==document.documentElement;){if(Bn(h)){f=h;break}h=h.parentElement;}let p=l.parentElement||document.documentElement,w=p===document.documentElement||p===document.body,g=(p instanceof HTMLElement?_e(p):null)?.position==="sticky",m=l.getBoundingClientRect(),v=t.top-m.top,y=t.left-m.left,k=m.bottom-t.bottom,L=m.right-t.right,M=At(c.top),E=At(c.bottom),N=At(c.left),x=At(c.right),I=!w&&p!==f&&!g,$,P=null;if(I){let q=no(l,f,p);$=q.naturalPosition,P=q.cappingNaturalPosition;}else $=to(l,f);let z,H,te=f===document.documentElement;if(w)z=window.innerHeight,H=window.innerWidth;else if(p===f||g)z=f.clientHeight,H=f.clientWidth;else if(te&&P){let q=p.clientHeight,se=p.clientWidth,ee=P.offsetY+q-$.offsetY,re=P.offsetX+se-$.offsetX;z=-ee,H=-re;}else if(P){let q=f.clientHeight,se=f.clientWidth,ee=p.clientHeight,re=p.clientWidth,ie=P.offsetY+ee-$.offsetY,ge=P.offsetX+re-$.offsetX;z=ie<q?-ie:q,H=ge<se?-ge:se;}else z=f.clientHeight,H=f.clientWidth;d={top:M===null?null:M+v,bottom:E===null?null:E+k,left:N===null?null:N+y,right:x===null?null:x+L,naturalTop:$.offsetY+v,naturalLeft:$.offsetX+y,containerWidth:H,containerHeight:z,elementWidth:m.width,elementHeight:m.height,anchorAbsoluteDepth:u};}return {rect:Wn(t),scrollHierarchy:r,position:o,stickyConfig:d,initialWindowX:n,initialWindowY:i,depth:s,hasContainingBlock:!!a,containingBlock:a}}function ot(e,t,n){return t?{x:Math.max(t.visibleMinX-n.scrollX,Math.min(e.x,t.visibleMaxX-n.scrollX)),y:Math.max(t.visibleMinY-n.scrollY,Math.min(e.y,t.visibleMaxY-n.scrollY))}:e}function Gt(e,t,n){if(!e||!n)return [];let i=[];if(e==="sibling"){let r=io(t,n);i.push(r);}else if(e==="parent"||e==="child"){let r=oo(t,n,e);i.push(...r);}return i}function io(e,t){let n=Math.max(e.left,t.left),i=Math.min(e.right,t.right),r=i>n,o=Math.max(e.top,t.top),l=Math.min(e.bottom,t.bottom),a=l>o,s={startSync:"primary",endSync:"secondary"};if(r&&!a){let b=(n+i)/2,g=Math.abs(t.top-e.bottom),m=Math.abs(e.top-t.bottom),v=g<m?e.bottom:e.top,y=g<m?t.top:t.bottom;return {type:"distance",value:Math.min(g,m),start:{x:b,y:v},end:{x:b,y},...s}}if(a&&!r){let b=(o+l)/2,g=Math.abs(t.left-e.right),m=Math.abs(e.left-t.right),v=g<m?e.right:e.left,y=g<m?t.left:t.right;return {type:"distance",value:Math.min(g,m),start:{x:v,y:b},end:{x:y,y:b},...s}}let u=[{x:(e.left+e.right)/2,y:e.top},{x:(e.left+e.right)/2,y:e.bottom}],d=[{x:(t.left+t.right)/2,y:t.top},{x:(t.left+t.right)/2,y:t.bottom}],c=1/0,f=u[0],h=d[0];for(let b of u)for(let g of d){let m=b.x-g.x,v=b.y-g.y,y=m*m+v*v;y<c&&(c=y,f=b,h=g);}let p=f??u[0],w=h??d[0];return {type:"distance",value:Math.sqrt(c),start:{x:p.x,y:p.y},end:{x:w.x,y:w.y},...s}}function oo(e,t,n){return n==="parent"?[{type:"left",value:Math.abs(e.left-t.left),start:{x:t.left,y:e.top+e.height/2},end:{x:e.left,y:e.top+e.height/2},startSync:"secondary",endSync:"primary"},{type:"top",value:Math.abs(e.top-t.top),start:{x:e.left+e.width/2,y:t.top},end:{x:e.left+e.width/2,y:e.top},startSync:"secondary",endSync:"primary"},{type:"right",value:Math.abs(t.right-e.right),start:{x:e.right,y:e.top+e.height/2},end:{x:t.right,y:e.top+e.height/2},startSync:"primary",endSync:"secondary"},{type:"bottom",value:Math.abs(t.bottom-e.bottom),start:{x:e.left+e.width/2,y:e.bottom},end:{x:e.left+e.width/2,y:t.bottom},startSync:"primary",endSync:"secondary"}]:[{type:"left",value:Math.abs(t.left-e.left),start:{x:e.left,y:t.top+t.height/2},end:{x:t.left,y:t.top+t.height/2},startSync:"primary",endSync:"secondary"},{type:"top",value:Math.abs(t.top-e.top),start:{x:t.left+t.width/2,y:e.top},end:{x:t.left+t.width/2,y:t.top},startSync:"primary",endSync:"secondary"},{type:"right",value:Math.abs(e.right-t.right),start:{x:t.right,y:t.top+t.height/2},end:{x:e.right,y:t.top+t.height/2},startSync:"secondary",endSync:"primary"},{type:"bottom",value:Math.abs(e.bottom-t.bottom),start:{x:t.left+t.width/2,y:t.bottom},end:{x:t.left+t.width/2,y:e.bottom},startSync:"secondary",endSync:"primary"}]}function We(e,t,n,i,r,o=0,l=0){let a=t==="secondary"?r:i,s=t==="secondary"?r:i;return {x:e.x-(a?.deltaX??0)-o,y:e.y-(s?.deltaY??0)-l}}function Kt(e,t){if(!t)return e.value;let n=it(t.primaryHierarchy,t.primaryPosition,t.primarySticky,t.primaryWinX,t.primaryWinY,!!t.primaryHasContainingBlock),i=it(t.secondaryHierarchy,t.secondaryPosition,t.secondarySticky,t.secondaryWinX,t.secondaryWinY,!!t.secondaryHasContainingBlock),r=We(e.start,e.startSync,e,n,i),o=We(e.end,e.endSync,e,n,i),l=Math.abs(r.x-o.x),a=Math.abs(r.y-o.y);return e.type==="top"||e.type==="bottom"?a:e.type==="left"||e.type==="right"?l:Math.sqrt(l*l+a*a)}function ro(e,t,n,i=null,r=null){let o=Ji(e,t,n,i,r);if(!o)return null;let{context:l,element:a}=o;return lo(e,a,l)}function lo(e,t,n){if(t===e)return null;let i=n??(e.contains(t)?"child":t.contains(e)?"parent":"sibling"),r=Bt(e),o=Bt(t),l=r.rect,a=o.rect,s=Gt(i,l,a);return {element:t,result:{context:i,lines:s,primary:l,secondary:a,timestamp:Date.now(),primaryHierarchy:r.scrollHierarchy,secondaryHierarchy:o.scrollHierarchy,secondaryElement:t,primaryPosition:r.position,secondaryPosition:o.position,primarySticky:r.stickyConfig,secondarySticky:o.stickyConfig,primaryWinX:r.initialWindowX,primaryWinY:r.initialWindowY,secondaryWinX:o.initialWindowX,secondaryWinY:o.initialWindowY}}}function ao(){let e="IDLE";function t(){return e}function n(a){let u={IDLE:["ARMED","FROZEN"],ARMED:["MEASURING","FROZEN","IDLE"],MEASURING:["FROZEN","IDLE"],FROZEN:["MEASURING","IDLE"]}[e];return u&&u.includes(a)?(e=a,true):false}function i(){return e==="IDLE"}function r(){return e==="ARMED"}function o(){return e==="MEASURING"}function l(){return e==="FROZEN"}return {getState:t,transitionTo:n,isIdle:i,isArmed:r,isMeasuring:o,isFrozen:l}}function so(){let e={baseValue:0,operation:null,inputValue:"",result:null,isActive:false};function t(){let r=e.inputValue===""?"0":e.inputValue,o=parseFloat(r);if(isNaN(o))return null;switch(e.operation){case "+":return e.baseValue+o;case "-":return e.baseValue-o;case "*":return e.baseValue*o;case "/":return o!==0?e.baseValue/o:null;default:return null}}function n(r){switch(r.type){case "OPEN":e={baseValue:r.baseValue,operation:null,inputValue:"",result:null,isActive:true};break;case "SYNC_VALUE":e.isActive&&e.operation===null&&(e={...e,baseValue:r.value});break;case "INPUT_DIGIT":if(!e.isActive||!e.operation)return e;let o=r.digit===".",l=(e.inputValue||"").includes(".");if(o&&l)return e;e.result!==null?e={...e,inputValue:o?"0.":r.digit,result:null}:e={...e,inputValue:e.inputValue==="0"&&!o?r.digit:e.inputValue+r.digit};break;case "INPUT_OPERATION":if(!e.isActive)return e;let a=e.result!==null,s=e.inputValue===""||e.inputValue==="0";a||e.operation&&!s?e={baseValue:a?e.result:t()??e.baseValue,operation:r.operation,inputValue:"",result:null,isActive:true}:e={...e,operation:r.operation,inputValue:"",result:null};break;case "BACKSPACE":if(!e.isActive)return e;e.result!==null?e={...e,result:null}:e.inputValue.length>0?e={...e,inputValue:e.inputValue.slice(0,-1)}:e.operation?e={...e,operation:null}:e={...e,isActive:false};break;case "DELETE":if(!e.isActive)return e;e={baseValue:e.baseValue,operation:null,inputValue:"",result:null,isActive:false};break;case "ENTER":if(!e.isActive||!e.operation)return e;let u=t();e={...e,result:u};break;case "CLOSE":e={baseValue:0,operation:null,inputValue:"",result:null,isActive:false};break}return e}function i(){return {...e}}return {getState:i,dispatch:n,calculate:t}}function co(){let e=so();function t(u){e.dispatch({type:"OPEN",baseValue:u});}function n(u){/^[0-9.]$/.test(u)?e.dispatch({type:"INPUT_DIGIT",digit:u}):/^[+\-*/]$/.test(u)&&e.dispatch({type:"INPUT_OPERATION",operation:u});}function i(){e.dispatch({type:"BACKSPACE"});}function r(){e.dispatch({type:"DELETE"});}function o(){e.dispatch({type:"ENTER"});}function l(){e.dispatch({type:"CLOSE"});}function a(u){e.dispatch({type:"SYNC_VALUE",value:u});}function s(){return e.getState().result}return {getState:e.getState,open:t,handleInput:n,handleBackspace:i,handleDelete:r,handleEnter:o,close:l,syncValue:a,getResult:s}}function uo(){let e={direction:null,value:"",element:null},t=new Set,n=()=>{t.forEach(i=>i({...e}));};return {getState:()=>({...e}),setDirection:i=>{e.direction=i,n();},setElement:i=>{e.element=i,n();},appendValue:(i,r)=>{if(/^[0-9.]$/.test(i)){let o=i===".",l=e.value.includes(".");if(o&&l)return;let a=e.value+i,s=parseFloat(a)||0;r!==void 0&&s>r?e.value=Math.floor(r).toString():e.value=a,n();}},capValue:i=>{(parseFloat(e.value)||0)>i&&(e.value=Math.floor(i).toString(),n());},backspace:()=>{e.value.length>0?(e.value=e.value.slice(0,-1),n()):e.direction&&(e.direction=null,n());},clear:()=>{e={direction:null,value:"",element:null},n();},onUpdate:i=>(t.add(i),()=>t.delete(i))}}function yt(e=""){let t=Math.random().toString(36).substring(2,11);return e?`${e}-${t}`:t}function fo(){let e={lines:[]},t=new Set,n=()=>{t.forEach(i=>i({lines:[...e.lines]}));};return {getState:()=>({lines:[...e.lines]}),addPair:(i,r)=>{if(e.lines.length>=Fi)return null;let o={id:yt("ruler-h"),type:"horizontal",position:r},l={id:yt("ruler-v"),type:"vertical",position:i};return e.lines.push(o,l),n(),l.id},updateLine:(i,r)=>{let o=e.lines.findIndex(l=>l.id===i);o!==-1&&e.lines[o]&&(e.lines[o]={...e.lines[o],position:r},n());},removeLine:i=>{e.lines=e.lines.filter(r=>r.id!==i),n();},clear:()=>{e.lines=[],n();},onUpdate:i=>(t.add(i),()=>t.delete(i))}}function Zn(){let e=Ri(),t=Ui(e),n=ao(),i=co(),r=uo(),o=fo(),l=new Set,a=null,s=null,u=null;function d(){l.forEach(I=>I());}function c(I,$){n.transitionTo("ARMED"),t.scheduleRead(()=>{performance.now();let z=ro(I,$.x,$.y,s,u);if(z){let{result:H,element:te}=z;if(!n.isMeasuring()&&!n.isArmed()||n.isMeasuring()&&te===u&&H.context===s)return;a=H,s=H.context,u=te,n.transitionTo("MEASURING"),d();}});}function f(){let I=n.getState();(I==="MEASURING"||I==="IDLE"||I==="ARMED")&&(t.cancel(),n.transitionTo("FROZEN"),d());}function h(I){n.isFrozen()&&(n.transitionTo(I?"MEASURING":"IDLE"),d());}function p(){t.cancel(),n.transitionTo("IDLE"),i.close(),r.clear(),o.clear(),a=null,s=null,u=null,d();}function w(){t.cancel(),n.getState()==="MEASURING"&&(n.transitionTo("IDLE"),d());}function b(){p(),l.clear(),a=null,s=null,u=null;}function g(){return n.getState()}function m(){return a}function v(){return u}function y(){return i}function k(){return r}function L(){return o}function M(I){return l.add(I),()=>{l.delete(I);}}function E(I){if(!a)return;let $=new DOMRect(I.left+window.scrollX,I.top+window.scrollY,I.width,I.height);a={...a,primary:$,primaryWinX:window.scrollX,primaryWinY:window.scrollY,lines:Gt(a.context,$,a.secondary)},d();}function N(I){if(!a)return;let $=new DOMRect(I.left+window.scrollX,I.top+window.scrollY,I.width,I.height);a={...a,secondary:$,secondaryWinX:window.scrollX,secondaryWinY:window.scrollY,lines:Gt(a.context,a.primary,$)},d();}function x(I){a=I,n.transitionTo("MEASURING"),d();}return {measure:c,abort:p,stop:w,freeze:f,unfreeze:h,cleanup:b,getState:g,getCurrentResult:m,getSecondaryElement:v,getCalculator:y,getProjection:k,getRuler:L,onStateChange:M,updatePrimaryRect:E,updateSecondaryRect:N,applyResult:x}}async function ho(e){return new Promise((t,n)=>{if(typeof requestAnimationFrame>"u"||typeof document<"u"&&document.hidden){setTimeout(()=>{try{t(e());}catch(i){n(i);}},0);return}requestAnimationFrame(()=>{Promise.resolve().then(()=>{try{t(e());}catch(i){n(i);}});});})}function Qn(){let e=null,t=null,n=[],i="static",r,o=0,l=0,a=0,s=new Set;function u(){return {element:e,rect:t,scrollHierarchy:n,position:i,stickyConfig:r,initialWindowX:o,initialWindowY:l,depth:a}}function d(){let g=u();s.forEach(m=>m(g));}function c(g){e===g&&(g!==null||t===null)||(e=g,g?ho(()=>{if(e===g&&document.contains(g)){let m=Bt(g);t=m.rect,n=m.scrollHierarchy,i=m.position,r=m.stickyConfig,o=m.initialWindowX,l=m.initialWindowY,a=m.depth,d();}}):(t=null,n=[],i="static",r=void 0,o=0,l=0,a=0,d()));}function f(){return e}function h(){return t}function p(){c(null);}function w(g){return s.add(g),()=>{s.delete(g);}}function b(g){e&&(t=new DOMRect(g.left+window.scrollX,g.top+window.scrollY,g.width,g.height),o=window.scrollX,l=window.scrollY,d());}return {select:c,getSelected:f,getSelectedRect:h,getMetadata:u,clear:p,onUpdate:w,updateRect:b}}var qn=typeof window<"u";function mo(){if(!qn)return "other";let e=navigator.userAgentData?.platform;if(e)switch(e){case "macOS":return "macos";case "iOS":return "ios";case "Windows":return "windows";case "Android":return "android";case "Linux":return "linux"}let t=navigator.userAgent;return /iPhone|iPad|iPod/.test(t)?"ios":/Macintosh/.test(t)?"macos":/Windows/.test(t)?"windows":/Android/.test(t)?"android":/Linux/.test(t)?"linux":"other"}var pt=mo(),Yn=pt==="macos"||pt==="ios",go={IS_BROWSER:qn,NAME:pt,IS_MAC:pt==="macos",IS_IOS:pt==="ios",IS_APPLE:Yn,getControlKey:()=>Yn?"Meta":"Control"},he={activate:"Alt",freeze:" ",select:go.getControlKey(),clear:"Escape",calculator:{top:"t",right:"r",bottom:"b",left:"l",distance:"g"},projection:{top:"w",left:"a",bottom:"s",right:"d"},ruler:"r",selectionHoldDuration:250},ae={primary:"rgba(24, 160, 251, 1)",secondary:"rgba(242, 78, 30, 1)",calcBg:"rgba(30, 30, 30, 0.95)",calcShadow:"rgba(0, 0, 0, 0.25)",calcOpHighlight:"rgba(24, 160, 251, 0.3)",calcText:"rgba(255, 255, 255, 1)",text:"rgba(255, 255, 255, 1)",projection:"rgba(155, 81, 224, 1)",ruler:"rgba(24, 160, 251, 1)"},zn={enabled:true,lerpFactor:.25};function Kn(e,t){if(e==null||e==="")return t;let n=Number(e);return isFinite(n)&&!isNaN(n)?n:t}function He(e,t){if(e.startsWith("#")){let n=e.slice(1);n.length===3&&(n=n.split("").map(l=>l+l).join(""));let i=parseInt(n.slice(0,2),16),r=parseInt(n.slice(2,4),16),o=parseInt(n.slice(4,6),16);return `rgba(${i}, ${r}, ${o}, ${t})`}return e.startsWith("rgba")?e.replace(/[\d.]+\)$/g,`${t})`):e.startsWith("rgb")?e.replace(")",`, ${t})`).replace("rgb","rgba"):e}function Jn(e,t=document.documentElement){if(!e||!t)return;let n=t;e.primary&&(n.style.setProperty("--caliper-primary",e.primary),n.style.setProperty("--caliper-primary-90",He(e.primary,.9)),n.style.setProperty("--caliper-primary-95",He(e.primary,.95)),n.style.setProperty("--caliper-primary-50",He(e.primary,.5)),n.style.setProperty("--caliper-primary-05",He(e.primary,.05))),e.secondary&&(n.style.setProperty("--caliper-secondary",e.secondary),n.style.setProperty("--caliper-secondary-50",He(e.secondary,.5)),n.style.setProperty("--caliper-secondary-05",He(e.secondary,.05))),e.calcBg&&n.style.setProperty("--caliper-calc-bg",e.calcBg),e.calcShadow&&n.style.setProperty("--caliper-calc-shadow",e.calcShadow),e.calcOpHighlight&&n.style.setProperty("--caliper-calc-op-highlight",e.calcOpHighlight),e.calcText&&n.style.setProperty("--caliper-calc-text",e.calcText),e.text&&n.style.setProperty("--caliper-text",e.text),e.projection&&(n.style.setProperty("--caliper-projection",e.projection),n.style.setProperty("--caliper-projection-90",He(e.projection,.9)),n.style.setProperty("--caliper-projection-light",He(e.projection,.2))),e.ruler&&n.style.setProperty("--caliper-ruler",e.ruler);}function ei(e){return {activate:e?.activate??he.activate,freeze:e?.freeze??he.freeze,select:e?.select??he.select,clear:e?.clear??he.clear,calculator:{top:e?.calculator?.top??he.calculator.top,right:e?.calculator?.right??he.calculator.right,bottom:e?.calculator?.bottom??he.calculator.bottom,left:e?.calculator?.left??he.calculator.left,distance:e?.calculator?.distance??he.calculator.distance},projection:{top:e?.projection?.top??he.projection.top,left:e?.projection?.left??he.projection.left,bottom:e?.projection?.bottom??he.projection.bottom,right:e?.projection?.right??he.projection.right},ruler:e?.ruler??he.ruler,selectionHoldDuration:Kn(e?.selectionHoldDuration,he.selectionHoldDuration)}}function ti(e){return {enabled:e?.enabled??zn.enabled,lerpFactor:Kn(e?.lerpFactor,zn.lerpFactor)}}function ni(e){return {primary:e?.primary??ae.primary,secondary:e?.secondary??ae.secondary,calcBg:e?.calcBg??ae.calcBg,calcShadow:e?.calcShadow??ae.calcShadow,calcOpHighlight:e?.calcOpHighlight??ae.calcOpHighlight,calcText:e?.calcText??ae.calcText,text:e?.text??ae.text,projection:e?.projection??ae.projection,ruler:e?.ruler??ae.ruler}}function ii(){if(typeof window<"u"){let e=window.__CALIPER_CONFIG__??{},n=(typeof document<"u"?document.currentScript:null)?.getAttribute("data-config")||(typeof document<"u"?document.querySelector("script[data-config]")?.getAttribute("data-config"):null);if(n)try{let i=JSON.parse(n);return {...e,...i,theme:{...e.theme,...i.theme},commands:{...e.commands,...i.commands},animation:{...e.animation,...i.animation}}}catch(i){console.warn("[CALIPER] Failed to parse data-config attribute",i);}return e}return {}}var po="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTcyIiBoZWlnaHQ9IjUwIiB2aWV3Qm94PSIwIDAgMTcyIDUwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ3LjIxNDQgNy42MjkzOWUtMDZIMzIuNzkyOEwyNS44MjUgNDMuMzIyNUgzNS4wNjEzTDM2LjE5NTYgMzUuMDE2M0g0NC4xMzU2TDQ1LjI2OTkgNDMuMzIyNUg1NC42NjgzTDQ3LjIxNDQgNy42MjkzOWUtMDZaTTM5LjU5ODUgOC4zMDYySDQwLjczMjhMNDQuMTM1NiAyOC4xNzU5SDM2LjE5NTZMMzkuNTk4NSA4LjMwNjJaIiBmaWxsPSIjQUMyMzIzIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNS4wMjMyOCAwTDAgNS4wNDg4NlYyOC4zMzg4TDUuMTg1MzIgMzMuMzg3NkgxNy41MDA0VjM1LjM0MkgxNS41NTZWNDYuNzQyN0gxOS4xMjA5TDI0LjMwNjIgMzUuNjY3OFYyNS44OTU4SDcuMTI5ODFWNy4zMjg5OUgxMy40NDk0VjBINS4wMjMyOFoiIGZpbGw9IiNBQzIzMjMiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02Ni40OTc0IDcuNjI5MzllLTA2SDU3LjI2MVY0LjM5NzRINjIuNDQ2M1Y1LjIxMTczSDU3LjI2MVY2LjY3NzU0SDYwLjE3NzdWNy4zMjg5OUg1Ny4yNjFWOC45NTc2Nkg2MC4xNzc3VjkuNjA5MTNINTcuMjYxVjExLjA3NDlINjAuMTc3N1YxMS43MjY0SDU3LjI2MVYxMy4xOTIySDYyLjQ0NjNWMTMuODQzN0g1Ny4yNjFWMTUuNDcyM0g2MC4xNzc3VjE2LjEyMzhINTcuMjYxVjE3LjU4OTZINjAuMTc3N1YxOC4yNDExSDU3LjI2MVYxOS44Njk3SDYwLjE3NzdWMjAuNTIxMkg1Ny4yNjFWMjEuODI0MUg2Mi40NDYzVjIyLjYzODRINTcuMjYxVjI0LjI2NzFINjAuMTc3N1YyNC43NTU3SDU3LjI2MVYyNi4zODQ0SDYwLjE3NzdWMjcuMDM1OEg1Ny4yNjFWMjguNTAxNkg2MC4xNzc3VjI5LjE1MzFINTcuMjYxVjMwLjYxODlINjIuNDQ2M1YzMS40MzMySDU3LjI2MVYzMi44OTlINjAuMTc3N1YzMy41NTA1SDU3LjI2MVYzNS4wMTYzSDYwLjE3NzdWMzUuODMwNkg1Ny4yNjFWMzcuMjk2NEg2MC4xNzc3VjM3Ljk0NzlINTcuMjYxVjM5LjQxMzdINjIuNDQ2M1Y0MC4yMjhINTcuMjYxVjQzLjMyMjVINzcuODQwMlYzNS4wMTYzSDY2LjQ5NzRWNy42MjkzOWUtMDZaIiBmaWxsPSIjQUMyMzIzIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzcuODQwMiAyNy42ODczSDY3LjQ2OTZMNjkuNDE0MSAzMC42MTg5TDc5Ljc4NDcgMzQuMjAyVjQzLjk3MzlDNzcuNTQzOSA0NC4zNzMgNzYuNTQzOSA0NS4yNzY5IDc2LjU0MzkgNDcuMDY4NEM3Ni41NDM5IDQ5LjE4NTcgNzcuNTc4IDQ5Ljg1MjEgNzkuNzg0NyA1MEg4Mi44NjM1VjI4LjUwMTZINzcuODQwMlYyNy42ODczWiIgZmlsbD0iI0FDMjMyMyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg5Ljk5MzMgNy42MjkzOWUtMDZIODAuNzU3VjQuMzk3NEg4NS43ODAzVjUuMjExNzNIODAuNzU3VjYuNjc3NTRIODMuNTExN1Y3LjMyODk5SDgwLjc1N1Y4Ljk1NzY2SDgzLjUxMTdWOS40NDYyNkg4MC43NTdWMTEuMDc0OUg4My41MTE3VjExLjcyNjRIODAuNzU3VjEzLjE5MjJIODUuNzgwM1YxMy44NDM3SDgwLjc1N1YxNS40NzIzSDgzLjUxMTdWMTYuMTIzOEg4MC43NTdWMTcuNTg5Nkg4My41MTE3VjE4LjI0MTFIODAuNzU3VjE5Ljg2OTdIODMuNTExN1YyMC41MjEySDgwLjc1N1YyMS44MjQxSDg1Ljc4MDNWMjIuNjM4NEg4MC43NTdWMjcuMDM1OEg4My44MzU4VjQzLjMyMjVIODcuMjM4NlYxMi4zNzc5SDkyLjI2MTlWOS40NDYyNkg5My4wNzIxVjEwLjA5NzdIOTkuNzE1OEM5OC45MDU2IDguNzk0NzkgOTcuMTIzMSA3LjY1NDczIDk0Ljg1NDYgNy4wMDMyN0g4OS45OTMzVjcuNjI5MzllLTA2WiIgZmlsbD0iI0FDMjMyMyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTkyLjI2MTkgMTMuODQzN0g4OC4wNDg4VjQzLjMyMjVIOTIuMjYxOVYyOC41MDE2SDkzLjA3MjFWMjkuMzE2SDk0Ljg1NDZWMjUuNTdIOTMuMDcyMVYyNi4zODQ0SDkyLjI2MTlWMTMuODQzN1oiIGZpbGw9IiNBQzIzMjMiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05NS42NjQ4IDYuMzUxOFY3LjYyOTM5ZS0wNkgxMTMuMDAzTDExOS42NDcgNi4zNTE4VjIxLjgyNDFMMTEzLjAwMyAyOC41MDE2SDEwNC45MDFMMTA0LjczOSA0My4zMjI1SDk1LjY2NDhWMTEuMDc0OUgxMDAuODVDMTAwLjUyNiA4LjYzMTkzIDk4LjkwNTYgNy4zMjkgOTUuNjY0OCA2LjM1MThaTTEwNC45MDEgNy45ODA0NkgxMTAuNTczVjIwLjUyMTJIMTA0LjkwMVY3Ljk4MDQ2WiIgZmlsbD0iI0FDMjMyMyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE0My4zMDUgNy42MjkzOWUtMDZIMTIzLjIxMlY0My4zMjI1SDE0My4zMDVWMzUuMDE2M0gxMzIuNDQ4VjI0LjQzSDE0MS42ODVWMTYuMTIzOEgxMzIuNDQ4VjcuOTgwNDZIMTQzLjMwNVY3LjYyOTM5ZS0wNloiIGZpbGw9IiNBQzIzMjMiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNDcuMTk0IDQzLjMyMjVWNy42MjkzOWUtMDZIMTY1LjE4TDE3MS41IDUuODYzMlYxNi45MzgxTDE2Ni4xNTMgMjEuODI0MUwxNzEuNSAyNS41N1Y0My4zMjI1SDE2Mi40MjZWMjUuNTdIMTU2LjI2OFY0My4zMjI1SDE0Ny4xOTRaTTE1Ni4yNjggNy45ODA0NkgxNjIuNDI2VjE3LjU4OTZIMTU2LjI2OFY3Ljk4MDQ2WiIgZmlsbD0iI0FDMjMyMyIvPgo8L3N2Zz4K";async function yo(){try{let t=await fetch("https://unpkg.com/@oyerinde/caliper@latest/dist/version.json",{method:"GET",cache:"no-store",headers:{Accept:"application/json"},signal:AbortSignal.timeout(3e3)});if(t.ok)return await t.json()}catch{}return null}function wo(e,t){let n=e.split(".").map(Number),i=t.split(".").map(Number);for(let r=0;r<Math.max(n.length,i.length);r++){let o=n[r]||0,l=i[r]||0;if(o<l)return -1;if(o>l)return 1}return 0}async function oi(e){if(typeof window>"u")return;let t=`
12
12
  font-size: 1px;
13
13
  padding: 10px 34px;
14
- background-image: url('${go}');
14
+ background-image: url('${po}');
15
15
  background-size: contain;
16
16
  background-repeat: no-repeat;
17
17
  background-position: center;
18
18
  `;console.log("%c ",t),console.log(`%cMeasurement Tool v${e}
19
- %cDocs -> https://caliper.danieloyerinde.com`,"color: #3b82f6; font-weight: bold; font-family: monospace; padding-top: 5px;","color: #6b7280; font-family: monospace;"),po().then(n=>{if(!n)return;yo(e,n.version)<0&&console.log(`%c\u26A0 Update available: ${n.version} (you're on ${e})`,"color: #f59e0b; font-weight: bold; font-family: monospace;");}).catch(()=>{});}function jt(e,t,n){return e+(t-e)*n}function oi(e,t,n){return {left:jt(e.left,t.left,n),top:jt(e.top,t.top,n),width:jt(e.width,t.width,n),height:jt(e.height,t.height,n)}}function wo(e,t=100){let n="",i=e.childNodes;for(let o=0;o<i.length;o++){let l=i[o];l?.nodeType===Node.TEXT_NODE&&(n+=l.textContent||"");}let r=n.trim().replace(/\s+/g," ");if(r)return r.length>t?r.slice(0,t):r}function vo(e){return Array.from(e).filter(n=>!Hi.some(i=>n.startsWith(i)))}function Ot(e,t){let n=e.tagName.toLowerCase(),i=e.getAttribute("data-caliper-agent-id");i||(i=yt("caliper"),e.setAttribute("data-caliper-agent-id",i));let r=e.id,o=wo(e),l=vo(e.classList),a=e.parentElement,c=-1;a&&(c=Array.from(a.children).indexOf(e));let u=e.getAttribute("data-caliper-marker")||void 0,d,s;if(t?.rect)d=Math.round(t.rect.left),s=Math.round(t.rect.top);else {let y=e.getBoundingClientRect();d=Math.round(y.left+(typeof window<"u"?window.scrollX:0)),s=Math.round(y.top+(typeof window<"u"?window.scrollY:0));}let f={selector:i,tag:n,timestamp:Date.now(),nthChild:c!==-1?c:void 0,x:d,y:s,marker:u};t?.scrollHierarchy&&(f.scrollHierarchy=t.scrollHierarchy.map(y=>{let{element:b,...x}=y;return x})),t?.position&&(f.position=t.position),t?.stickyConfig&&(f.stickyConfig=t.stickyConfig),t?.initialWindowX!==void 0&&(f.initialWindowX=t.initialWindowX),t?.initialWindowY!==void 0&&(f.initialWindowY=t.initialWindowY),t?.hasContainingBlock!==void 0&&(f.hasContainingBlock=t.hasContainingBlock),t?.rect&&(f.rect=t.rect),r&&(f.id=r),o&&(f.text=o),l.length>0&&(f.classes=l);let m=typeof sessionStorage<"u"?sessionStorage.getItem(Fi):null;return m&&(f.tabId=m),f}var nt=true,xo=class{prefix;constructor(e={}){this.prefix=e.prefix?`[${e.prefix}]`:"[Caliper]";}setEnabled(e){nt=e;}debug(...e){}info(...e){}warn(...e){nt&&console.warn(this.prefix,...e);}error(...e){nt&&console.error(this.prefix,...e);}log(...e){}},ri=new xo({prefix:"Caliper"});var li=e=>{let t=e.getModifierState?.("AltGraph");return {Control:t?false:e.ctrlKey,Meta:e.metaKey,Alt:t||e.altKey,Shift:e.shiftKey}},Rt=e=>e.key==="Control"&&e.getModifierState?.("AltGraph")?"":e.key==="AltGraph"?"Alt":e.key,Ge=(e,t)=>Rt(t)===e;var bo=`
19
+ %cDocs -> https://caliper.danieloyerinde.com`,"color: #3b82f6; font-weight: bold; font-family: monospace; padding-top: 5px;","color: #6b7280; font-family: monospace;"),yo().then(n=>{if(!n)return;wo(e,n.version)<0&&console.log(`%c\u26A0 Update available: ${n.version} (you're on ${e})`,"color: #f59e0b; font-weight: bold; font-family: monospace;");}).catch(()=>{});}function jt(e,t,n){return e+(t-e)*n}function ri(e,t,n){return {left:jt(e.left,t.left,n),top:jt(e.top,t.top,n),width:jt(e.width,t.width,n),height:jt(e.height,t.height,n)}}function vo(e,t=100){let n="",i=e.childNodes;for(let o=0;o<i.length;o++){let l=i[o];l?.nodeType===Node.TEXT_NODE&&(n+=l.textContent||"");}let r=n.trim().replace(/\s+/g," ");if(r)return r.length>t?r.slice(0,t):r}function xo(e){return Array.from(e).filter(n=>!Wi.some(i=>n.startsWith(i)))}function Ot(e,t){let n=e.tagName.toLowerCase(),i=e.getAttribute("data-caliper-agent-id");i||(i=yt("caliper"),e.setAttribute("data-caliper-agent-id",i));let r=e.id,o=vo(e),l=xo(e.classList),a=e.parentElement,s=-1;a&&(s=Array.from(a.children).indexOf(e));let u=e.getAttribute("data-caliper-marker")||void 0,d,c;if(t?.rect)d=Math.round(t.rect.left),c=Math.round(t.rect.top);else {let p=e.getBoundingClientRect();d=Math.round(p.left+(typeof window<"u"?window.scrollX:0)),c=Math.round(p.top+(typeof window<"u"?window.scrollY:0));}let f={selector:i,tag:n,timestamp:Date.now(),nthChild:s!==-1?s:void 0,x:d,y:c,marker:u};t?.scrollHierarchy&&(f.scrollHierarchy=t.scrollHierarchy.map(p=>{let{element:w,...b}=p;return b})),t?.position&&(f.position=t.position),t?.stickyConfig&&(f.stickyConfig=t.stickyConfig),t?.initialWindowX!==void 0&&(f.initialWindowX=t.initialWindowX),t?.initialWindowY!==void 0&&(f.initialWindowY=t.initialWindowY),t?.hasContainingBlock!==void 0&&(f.hasContainingBlock=t.hasContainingBlock),t?.rect&&(f.rect=t.rect),r&&(f.id=r),o&&(f.text=o),l.length>0&&(f.classes=l);let h=typeof sessionStorage<"u"?sessionStorage.getItem(Hi):null;return h&&(f.tabId=h),f}var nt=true,bo=class{prefix;constructor(e={}){this.prefix=e.prefix?`[${e.prefix}]`:"[Caliper]";}setEnabled(e){nt=e;}debug(...e){}info(...e){}warn(...e){nt&&console.warn(this.prefix,...e);}error(...e){nt&&console.error(this.prefix,...e);}log(...e){}},li=new bo({prefix:"Caliper"});var ai=e=>{let t=e.getModifierState?.("AltGraph");return {Control:t?false:e.ctrlKey,Meta:e.metaKey,Alt:t||e.altKey,Shift:e.shiftKey}},Rt=e=>e.key==="Control"&&e.getModifierState?.("AltGraph")?"":e.key==="AltGraph"?"Alt":e.key,Ge=(e,t)=>Rt(t)===e;var Mo=`
20
20
  :root {
21
21
  interpolate-size: allow-keywords;
22
22
  --caliper-primary: ${ae.primary};
@@ -323,5 +323,5 @@ var vi=(e,t)=>e===t;var xi=Symbol("solid-track");var Et={equals:vi},Sn=Ln,Me=1,f
323
323
  color: white;
324
324
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
325
325
  }
326
- `,A=Y,Mo=X("<svg><defs><clipPath><rect></svg>",false,true,false),So=X("<svg style=z-index:999999><g>"),Eo=X("<svg><g data-caliper-ignore style=pointer-events:auto;cursor:pointer><line></line><line></svg>",false,true,false);function No(e){let[t,n]=_(null),i=()=>isFinite(e.data.common.minX),r=_(yt("lines-clip"))[0](),o=()=>({minX:e.data.common.minX-e.viewport.scrollX,maxX:e.data.common.maxX-e.viewport.scrollX,minY:e.data.common.minY-e.viewport.scrollY,maxY:e.data.common.maxY-e.viewport.scrollY});return (()=>{var l=So(),a=l.firstChild;return D(l,"class",`${A}viewport-fixed`),V(l,C(Q,{get when(){return i()},get children(){var c=Mo(),u=c.firstChild,d=u.firstChild;return D(u,"id",r),F(s=>{var f=o().minX,m=o().minY,y=Math.max(0,o().maxX-o().minX),b=Math.max(0,o().maxY-o().minY);return f!==s.e&&D(d,"x",s.e=f),m!==s.t&&D(d,"y",s.t=m),y!==s.a&&D(d,"width",s.a=y),b!==s.o&&D(d,"height",s.o=b),s},{e:void 0,t:void 0,a:void 0,o:void 0}),c}}),a),V(a,C(Re,{get each(){return e.lines},children:(c,u)=>{let d=U(()=>{let f=We(c.start,c.startSync,c,e.data.primary.delta,e.data.secondary.delta,e.viewport.scrollX,e.viewport.scrollY),m=We(c.end,c.endSync,c,e.data.primary.delta,e.data.secondary.delta,e.viewport.scrollX,e.viewport.scrollY),y=f,b=m;e.data.isSameContext||(y=ot(f,c.startSync==="secondary"?e.data.secondary.geo:e.data.primary.geo,e.viewport),b={...ot(m,c.endSync==="secondary"?e.data.secondary.geo:e.data.primary.geo,e.viewport)}),c.type==="top"||c.type==="bottom"?c.startSync==="primary"?b.x=y.x:y.x=b.x:(c.type==="left"||c.type==="right")&&(c.startSync==="primary"?b.y=y.y:y.y=b.y);let x=0;return c.type==="top"||c.type==="bottom"?x=Math.abs(y.y-b.y):c.type==="left"||c.type==="right"?x=Math.abs(y.x-b.x):x=Math.sqrt(Math.pow(y.x-b.x,2)+Math.pow(y.y-b.y,2)),{x1:y.x,y1:y.y,x2:b.x,y2:b.y,liveValue:x}}),s=()=>t()===u();return (()=>{var f=Eo(),m=f.firstChild,y=m.nextSibling;return f.$$click=b=>{b.stopPropagation();let x=d();e.onLineClick?.(c,x.liveValue);},f.addEventListener("mouseleave",()=>n(null)),f.addEventListener("mouseenter",()=>n(u())),D(m,"class",`${A}line-hit-target`),D(y,"class",`${A}line ${A}line-clickable`),F(b=>{var x=d().x1,g=d().y1,h=d().x2,w=d().y2,p=d().x1,k=d().y1,L=d().x2,M=d().y2,E=s()?2:1;return x!==b.e&&D(m,"x1",b.e=x),g!==b.t&&D(m,"y1",b.t=g),h!==b.a&&D(m,"x2",b.a=h),w!==b.o&&D(m,"y2",b.o=w),p!==b.i&&D(y,"x1",b.i=p),k!==b.n&&D(y,"y1",b.n=k),L!==b.s&&D(y,"x2",b.s=L),M!==b.h&&D(y,"y2",b.h=M),E!==b.r&&D(y,"stroke-width",b.r=E),b},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),f})()}})),F(()=>D(a,"clip-path",i()?`url(#${r})`:void 0)),l})()}Fe(["click"]);var Io=X("<div style=z-index:1000000>"),ko=X("<div data-caliper-ignore style=left:0;top:0>");function To(e){return (()=>{var n=Io();return B(n,`${A}viewport-fixed`),V(n,C(Re,{get each(){return e.lines},children:i=>{let r=U(()=>{e.viewport.version;let o=We(i.start,i.startSync,i,e.data.primary.delta,e.data.secondary.delta,e.viewport.scrollX,e.viewport.scrollY),l=We(i.end,i.endSync,i,e.data.primary.delta,e.data.secondary.delta,e.viewport.scrollX,e.viewport.scrollY),a=Math.abs(o.x-l.x),c=Math.abs(o.y-l.y),u=0;i.type==="top"||i.type==="bottom"?u=c:i.type==="left"||i.type==="right"?u=a:u=Math.sqrt(a*a+c*c);let d=o,s=l;e.data.isSameContext||(d=ot(o,i.startSync==="secondary"?e.data.secondary.geo:e.data.primary.geo,e.viewport),s={...ot(l,i.endSync==="secondary"?e.data.secondary.geo:e.data.primary.geo,e.viewport)}),i.type==="top"||i.type==="bottom"?i.startSync==="primary"?s.x=d.x:d.x=s.x:(i.type==="left"||i.type==="right")&&(i.startSync==="primary"?s.y=d.y:d.y=s.y);let f=(d.x+s.x)/2,m=(d.y+s.y)/2,y=0,b=e.viewport.width,x=0,g=e.viewport.height,h=e.data.common,w=isFinite(h.minX),p=w?Math.max(y,h.minX-e.viewport.scrollX):y,k=w?Math.min(b,h.maxX-e.viewport.scrollX):b,L=w?Math.max(x,h.minY-e.viewport.scrollY):x,M=w?Math.min(g,h.maxY-e.viewport.scrollY):g,E=Math.min(d.x,s.x),N=Math.max(d.x,s.x),v=Math.min(d.y,s.y),I=Math.max(d.y,s.y);if(I<L||v>M||N<p||E>k)return {x:0,y:0,isHidden:true,value:0};let P=Math.max(E,p),z=Math.min(N,k),H=Math.max(v,L),te=Math.min(I,M),q=(P+z)/2,se=(H+te)/2,ee=f,re=m;return Math.abs(d.x-s.x)<1?(re=se,ee=Math.max(p+16,Math.min(k-16,ee))):Math.abs(d.y-s.y)<1?(ee=q,re=Math.max(L+16,Math.min(M-16,re))):(ee=Math.max(p+16,Math.min(k-16,f)),re=Math.max(L+16,Math.min(M-16,m))),{x:ee,y:re,isHidden:false,value:u}});return C(Q,{get when(){return Se(()=>!!r())()&&!r().isHidden},get children(){var o=ko();return o.$$click=l=>{l.stopPropagation();let a=r();a&&!a.isHidden&&e.onLineClick?.(i,a.value);},B(o,`${A}label`),V(o,()=>Math.round(r().value*100)/100),F(l=>J(o,"transform",`translate3d(${r().x}px, ${r().y}px, 0) translate(-50%, -50%)`)),o}})}})),n})()}Fe(["click"]);var Lo=X('<svg viewBox="0 0 24 24"><line x1=12 y1=5 x2=12 y2=19></line><line x1=5 y1=12 x2=19 y2=12>'),Co=X('<svg viewBox="0 0 24 24"><line x1=5 y1=12 x2=19 y2=12>'),Do=X('<svg viewBox="0 0 24 24"><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),Ao=X('<svg viewBox="0 0 24 24"><line x1=19 y1=5 x2=5 y2=19>'),Yt={width:"12px",height:"12px","stroke-width":"2.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",display:"block"},jo={"+":()=>(()=>{var e=Lo();return F(t=>Ye(e,Yt,t)),e})(),"-":()=>(()=>{var e=Co();return F(t=>Ye(e,Yt,t)),e})(),"*":()=>(()=>{var e=Do();return F(t=>Ye(e,Yt,t)),e})(),"/":()=>(()=>{var e=Ao();return F(t=>Ye(e,Yt,t)),e})()},ai=X("<span>"),$o=X("<span>= "),Po=X("<div data-caliper-ignore style=top:0;left:0><span>");function Oo(e){let t=n=>Math.round(n*100)/100+"";return C(Q,{get when(){return e.state.isActive},get children(){var n=Po(),i=n.firstChild;return V(i,()=>t(e.state.baseValue)),V(n,C(Q,{keyed:true,get when(){return e.state.operation},children:r=>{let o=jo[r];return (()=>{var l=ai();return B(l,`${A}calculator-operation`),V(l,C(Q,{when:o,fallback:r,get children(){return C(o,{})}})),l})()}}),null),V(n,C(Q,{get when(){return e.state.inputValue||e.state.operation},get children(){var r=ai();return B(r,`${A}calculator-input`),V(r,()=>e.state.inputValue||"0"),r}}),null),V(n,C(Q,{get when(){return e.state.result!==null},get children(){var r=$o();r.firstChild;return B(r,`${A}calculator-result`),V(r,(()=>{var l=Se(()=>e.state.result!==null);return ()=>l()?t(e.state.result):""})(),null),r}}),null),F(r=>{var o=`${A}calculator ${e.isFocused?`${A}calculator-focused`:""}`,l=`translate3d(${e.position.x+10}px, ${e.position.y+10}px, 0)`,a=`${A}calculator-base ${e.state.operation?`${A}calculator-base-active`:""}`;return o!==r.e&&B(n,r.e=o),l!==r.t&&J(n,"transform",r.t=l),a!==r.a&&B(i,r.a=a),r},{e:void 0,t:void 0,a:void 0}),n}})}var si=X("<div style=left:0;top:0>");function Ro(e){let[t,n]=_(null),[i,r]=_(null),o=null,l=null,a=(s,f,m=.1)=>!s||!f?false:Math.abs(s.left-f.left)<m&&Math.abs(s.top-f.top)<m&&Math.abs(s.width-f.width)<m&&Math.abs(s.height-f.height)<m,c=(s,f,m)=>{if(!f)return null;if(!s)return {...f};let y=oi(s,f,m);return a(y,f,.1)?{...f}:{...f,left:y.left,top:y.top,width:y.width,height:y.height}},u=U(()=>(e.viewport.version,ce(e.metadata.rect,e.metadata.scrollHierarchy,e.metadata.position,e.metadata.stickyConfig,e.metadata.initialWindowX,e.metadata.initialWindowY))),d=U(()=>{e.viewport.version;let s=e.result;return !(e.isActivatePressed||e.isFrozen)||!s?null:ce(s.secondary,s.secondaryHierarchy,s.secondaryPosition,s.secondarySticky,s.secondaryWinX,s.secondaryWinY)});return pe(Nn([u,d,()=>e.animation.lerpFactor,()=>e.metadata.element],([s,f,m,y])=>{if(!s){n(null),r(null),o=null,l&&(cancelAnimationFrame(l),l=null);return}let b=o!==y,x=e.animation.enabled!==false;if(r(f),b)if(o=y,x){let g=()=>{let h=t(),w=c(h,s,m);n(w),s&&!a(w,s,.05)?l=requestAnimationFrame(g):l=null;};l&&cancelAnimationFrame(l),l=requestAnimationFrame(g);}else l&&(cancelAnimationFrame(l),l=null),n(s);else l||n(s);})),ye(()=>{l&&cancelAnimationFrame(l);}),[C(Q,{get when(){return t()},children:s=>C(De,{get mount(){return Ae()},get children(){var f=si();return B(f,`${A}boundary-box ${A}boundary-box-selected`),F(m=>{var y=`${s().width}px`,b=`${s().height}px`,x=`translate3d(${s().left-e.viewport.scrollX}px, ${s().top-e.viewport.scrollY}px, 0)`,g=s().clipPath;return y!==m.e&&J(f,"width",m.e=y),b!==m.t&&J(f,"height",m.t=b),x!==m.a&&J(f,"transform",m.a=x),g!==m.o&&J(f,"clip-path",m.o=g),m},{e:void 0,t:void 0,a:void 0,o:void 0}),f}})}),C(Q,{get when(){return i()},children:s=>C(De,{get mount(){return Ae()},get children(){var f=si();return B(f,`${A}boundary-box ${A}boundary-box-secondary`),F(m=>{var y=`${s().width}px`,b=`${s().height}px`,x=`translate3d(${s().left-e.viewport.scrollX}px, ${s().top-e.viewport.scrollY}px, 0)`,g=s().clipPath;return y!==m.e&&J(f,"width",m.e=y),b!==m.t&&J(f,"height",m.t=b),x!==m.a&&J(f,"transform",m.a=x),g!==m.o&&J(f,"clip-path",m.o=g),m},{e:void 0,t:void 0,a:void 0,o:void 0}),f}})})]}var Yo=X("<span>Copied!"),zo=X("<div style=left:0;top:0>"),_o=X("<span> \xD7 ");function Vo(e){let n=U(()=>(e.viewport.version,ce(e.metadata.rect,e.metadata.scrollHierarchy,e.metadata.position,e.metadata.stickyConfig,e.metadata.initialWindowX,e.metadata.initialWindowY))),i=U(()=>{let r=n();if(!r||r.isHidden)return null;let o=e.viewport.scrollX,l=e.viewport.scrollX+e.viewport.width,a=e.viewport.scrollY+e.viewport.height,c=r.visibleMinX,u=r.visibleMaxX,d=r.visibleMaxY,s=Math.max(o,c),f=Math.min(l,u),m=Math.min(a,d),y=Math.max(r.left,s+16),b=Math.min(r.left+r.width,f-16),x=(y+b)/2,g=r.top+r.height+8;return g>m-16-24&&r.top<m-16&&(g=m-16-24),g=Math.max(g,r.top+16),{width:Math.round(r.width),height:Math.round(r.height),x,y:g}});return C(Q,{get when(){return i()},children:r=>C(De,{get mount(){return Ae()},get children(){var o=zo();return V(o,C(Q,{get when(){return e.isCopied},get fallback(){return (()=>{var l=_o(),a=l.firstChild;return B(l,`${A}selection-label-content`),V(l,()=>r().width,a),V(l,()=>r().height,null),l})()},get children(){var l=Yo();return B(l,`${A}selection-label-content`),l}})),F(l=>{var a=`${A}selection-label ${e.isCopied?`${A}selection-label-success`:""}`,c=`translate3d(${r().x-e.viewport.scrollX}px, ${r().y-e.viewport.scrollY}px, 0) translate(-50%, 0)`,u=e.isActivatePressed?0:1;return a!==l.e&&B(o,l.e=a),c!==l.t&&J(o,"transform",l.t=c),u!==l.a&&J(o,"opacity",l.a=u),l},{e:void 0,t:void 0,a:void 0}),o}})})}var Xo=X("<svg style=z-index:1000000><line data-caliper-ignore stroke=transparent stroke-width=15></line><line>"),Fo=X("<div data-caliper-ignore style=top:0;left:0>"),Ho=X("<div data-caliper-ignore><span></span><span>");function Wo(e){return C(Q,{get when(){return Se(()=>!!e.metadata().element)()&&e.projectionState().direction},get children(){return [C(Uo,{get projectionState(){return e.projectionState},get metadata(){return e.metadata},get viewport(){return e.viewport},get onLineClick(){return e.onLineClick}}),C(Bo,{get projectionState(){return e.projectionState},get metadata(){return e.metadata},get viewport(){return e.viewport},get isFocused(){return e.isFocused}})]}})}function Uo(e){let t=U(()=>{let o=e.viewport();o.version;let l=e.projectionState(),a=parseFloat(l.value)||0,c=e.metadata(),u=ce(c.rect,c.scrollHierarchy,c.position,c.stickyConfig,c.initialWindowX,c.initialWindowY);if(!u)return null;let d=0,s=0,f=0,m=0,y=0,b=0,x=0,g=0,h=0,w=0,p=document.documentElement.scrollWidth,k=document.documentElement.scrollHeight,L=u.left-o.scrollX,M=u.top-o.scrollY,E=false;switch(l.direction){case "top":d=f=L+u.width/2,s=M,m=Math.max(-o.scrollY,s-a),y=d,x=Math.max(0,Math.min(o.height,s)),g=Math.max(0,Math.min(o.height,m)),Math.abs(x-g)<1&&(E=true),b=(Math.min(x,g)+Math.max(x,g))/2;break;case "bottom":d=f=L+u.width/2,s=M+u.height,m=Math.min(k-o.scrollY,s+a),y=d,x=Math.max(0,Math.min(o.height,s)),g=Math.max(0,Math.min(o.height,m)),Math.abs(x-g)<1&&(E=true),b=(Math.min(x,g)+Math.max(x,g))/2;break;case "left":s=m=M+u.height/2,d=L,f=Math.max(-o.scrollX,d-a),h=Math.max(0,Math.min(o.width,d)),w=Math.max(0,Math.min(o.width,f)),Math.abs(h-w)<1&&(E=true),y=(Math.min(h,w)+Math.max(h,w))/2,b=s;break;case "right":s=m=M+u.height/2,d=L+u.width,f=Math.min(p-o.scrollX,d+a),h=Math.max(0,Math.min(o.width,d)),w=Math.max(0,Math.min(o.width,f)),Math.abs(h-w)<1&&(E=true),y=(Math.min(h,w)+Math.max(h,w))/2,b=s;break}let N=Math.sqrt((f-d)**2+(m-s)**2),v=Number.isInteger(N)?N:Math.round(N*100)/100,$=(l.value||String(v)).length*8+12,P=20,z=l.direction==="left"||l.direction==="right",q=Math.abs(z?h-w:x-g)>=(z?$:P)*1.5;return {x1:d,y1:s,x2:f,y2:m,labelX:y,labelY:b,actualValue:v,isHidden:u.isHidden||E,showLabel:q}}),[n,i]=_(false),r=o=>{o.stopPropagation();let l=t();l&&e.onLineClick?.({type:"distance",value:l.actualValue,start:{x:l.x1,y:l.y1},end:{x:l.x2,y:l.y2}},l.actualValue);};return C(Q,{get when(){return Se(()=>!!t())()&&!t()?.isHidden},get children(){return [(()=>{var o=Xo(),l=o.firstChild,a=l.nextSibling;return D(o,"class",`${A}viewport-fixed`),l.addEventListener("mouseleave",()=>i(false)),l.addEventListener("mouseenter",()=>i(true)),l.$$click=r,D(l,"class",`${A}line-hit-target`),D(a,"class",`${A}projection-line`),F(c=>{var u=t().x1,d=t().y1,s=t().x2,f=t().y2,m=t().x1,y=t().y1,b=t().x2,x=t().y2,g=n()?2:1;return u!==c.e&&D(l,"x1",c.e=u),d!==c.t&&D(l,"y1",c.t=d),s!==c.a&&D(l,"x2",c.a=s),f!==c.o&&D(l,"y2",c.o=f),m!==c.i&&D(a,"x1",c.i=m),y!==c.n&&D(a,"y1",c.n=y),b!==c.s&&D(a,"x2",c.s=b),x!==c.h&&D(a,"y2",c.h=x),g!==c.r&&D(a,"stroke-width",c.r=g),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),o})(),C(Q,{get when(){return t().showLabel},get children(){var o=Fo();return o.$$click=r,B(o,`${A}label ${A}projection-label`),V(o,()=>t().actualValue),F(l=>J(o,"transform",`translate3d(${t().labelX}px, ${t().labelY}px, 0) translate(-50%, -50%)`)),o}})]}})}function Bo(e){let t=U(()=>{let n=e.viewport();n.version;let i=e.metadata(),r=ce(i.rect,i.scrollHierarchy,i.position,i.stickyConfig,i.initialWindowX,i.initialWindowY);if(!r||r.isHidden)return {display:"none"};let o=r.top-n.scrollY,l=r.left-n.scrollX,a=35,c=10,d=o<a+c?o+r.height+c:o-a;return {top:"0",left:"0",transform:`translate3d(${l}px, ${d}px, 0)`}});return (()=>{var n=Ho(),i=n.firstChild,r=i.nextSibling;return B(i,`${A}projection-direction-tag`),V(i,()=>e.projectionState().direction),B(r,`${A}projection-current-value`),V(r,()=>e.projectionState().value||"0"),F(o=>{var l=`${A}projection-input ${e.isFocused?`${A}projection-input-focused`:""}`,a=t();return l!==o.e&&B(n,o.e=l),o.t=Ye(n,a,o.t),o},{e:void 0,t:void 0}),n})()}Fe(["click"]);var Go=X("<div data-caliper-ignore><svg style=z-index:999999>"),Zo=X('<svg><g data-caliper-ignore style=cursor:pointer;pointer-events:auto><line stroke=transparent stroke-width=15></line><line stroke=var(--caliper-secondary) stroke-width=1 stroke-dasharray="4 2"></line><circle r=2.5 fill=var(--caliper-secondary)></circle><circle r=2.5 fill=var(--caliper-secondary)></svg>',false,true,false),ui=X("<div data-caliper-ignore style=left:0;top:0>"),Qo=X("<div data-caliper-ignore style=position:fixed;left:0;top:0;pointer-events:auto;z-index:1000001>"),qo=X("<div data-caliper-ignore>");function Ko(e){let[t,n]=_(null),[i,r]=_(null),[o,l]=_(new Set),[a,c]=_(new Map);pe(()=>{let h=e.state().lines,w=o(),p=new Set;w.forEach(k=>{h.find(L=>L.id===k)&&p.add(k);}),p.size!==w.size&&l(p);}),pe(()=>{let h=e.state().lines,w=e.viewport(),p=a(),k=false,L=new Map(p);h.forEach(E=>{L.has(E.id)||(L.set(E.id,{width:w.width,height:w.height}),k=true);});let M=new Set(h.map(E=>E.id));L.forEach((E,N)=>{M.has(N)||(L.delete(N),k=true);}),k&&c(L);});let u=h=>{let w=e.viewport(),p=a().get(h.id);if(!p)return h.position;let k=h.type==="vertical",L=k?p.width:p.height,M=k?w.width:w.height;return L===0?h.position:h.position/L*M},d=h=>{let w=[],p=e.projectionState?.(),k=e.metadata?.(),L=e.result?.(),M=e.viewport();if(k&&k.element){let E=ce(k.rect,k.scrollHierarchy,k.position,k.stickyConfig,k.initialWindowX,k.initialWindowY);if(E){let N=E.left-M.scrollX,v=E.top-M.scrollY;if(h?w.push(N,N+E.width,N+E.width/2):w.push(v,v+E.height,v+E.height/2),p&&p.direction&&p.element===k.element){let I=parseFloat(p.value)||0;h?p.direction==="left"?w.push(N-I):p.direction==="right"&&w.push(N+E.width+I):p.direction==="top"?w.push(v-I):p.direction==="bottom"&&w.push(v+E.height+I);}}}if(L&&L.secondary){let E=ce(L.secondary,L.secondaryHierarchy,L.secondaryPosition,L.secondarySticky,L.secondaryWinX,L.secondaryWinY);if(E){let N=E.left-M.scrollX,v=E.top-M.scrollY;h?w.push(N,N+E.width,N+E.width/2):w.push(v,v+E.height,v+E.height/2);}}return w},s=(h,w)=>{let p=d(w);for(let k of p)if(Math.abs(h-k)<=_n)return k;return h},f=h=>{let w=o();if(w.size===0)return;if(h.key==="Delete"||h.key==="Backspace"){Array.from(w).forEach(I=>e.onRemove(I)),l(new Set);return}let k=e.state().lines.filter(v=>w.has(v.id));if(k.length===0)return;let L=1;h.ctrlKey||h.metaKey?L=10:h.shiftKey&&(L=.1);let M=k[0];if(!M)return;let E=M.type==="vertical",N=0;if(E?(h.key==="ArrowLeft"&&(N=-L),h.key==="ArrowRight"&&(N=L)):(h.key==="ArrowUp"&&(N=-L),h.key==="ArrowDown"&&(N=L)),N!==0){h.preventDefault();let v=e.viewport();k.forEach(I=>{let $=I.type==="vertical",P=($?v.width:v.height)-1,z=u(I),H=Math.max(0,Math.min(z+N,P));H=s(H,$),c(te=>{let q=new Map(te);return q.set(I.id,{width:v.width,height:v.height}),q}),e.onUpdate(I.id,H);});}};kt(()=>{let h=w=>{let p=w.target;!p.closest(`.${A}ruler-line-hit`)&&!p.closest(`.${A}ruler-bridge-label`)&&!p.closest(`.${A}line-hit-target`)&&!p.closest("[data-caliper-ignore]")&&l(new Set);};window.addEventListener("pointerdown",h,{capture:true}),window.addEventListener("keydown",f,{capture:true}),ye(()=>{window.removeEventListener("pointerdown",h,{capture:true}),window.removeEventListener("keydown",f,{capture:true});});});let m=h=>{let w=h.target,p=w.getAttribute("data-ruler-id"),k=w.getAttribute("data-ruler-type");if(!p||!k)return;h.preventDefault(),h.stopPropagation(),n(p),w.setPointerCapture(h.pointerId);let L=e.viewport(),M=e.state().lines.find(v=>v.id===p);if(M){let v=u(M);c(I=>{let $=new Map(I);return $.set(p,{width:L.width,height:L.height}),$}),e.onUpdate(p,v);}h.shiftKey?l(v=>{let I=new Set(v);return I.has(p)?I.delete(p):I.add(p),I}):o().has(p)||l(new Set([p]));let E=v=>{let I=e.viewport(),$=k==="vertical",P=$?v.clientX:v.clientY,z=($?I.width:I.height)-1;P=Math.max(0,Math.min(P,z)),P=s(P,$),e.onUpdate(p,P);},N=v=>{n(null),w.releasePointerCapture(v.pointerId),window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",N);};window.addEventListener("pointermove",E),window.addEventListener("pointerup",N);},y=h=>{let p=h.target.getAttribute("data-ruler-id");p&&r(p);},b=h=>{h.target.hasAttribute("data-ruler-id")&&r(null);},x=U(()=>{let h=o();if(h.size<2)return [];let w=e.state().lines.filter(E=>h.has(E.id)),p=w.filter(E=>E.type==="vertical").map(E=>({line:E,pos:u(E)})).sort((E,N)=>E.pos-N.pos),k=w.filter(E=>E.type==="horizontal").map(E=>({line:E,pos:u(E)})).sort((E,N)=>E.pos-N.pos),L=[],M=e.viewport();for(let E=0;E<p.length-1;E++){let N=p[E],v=p[E+1],I=v.pos-N.pos;I>0&&L.push({x1:N.pos,y1:M.height/2+100,x2:v.pos,y2:M.height/2+100,value:I,type:"vertical",labelX:N.pos+I/2,labelY:M.height/2+85});}for(let E=0;E<k.length-1;E++){let N=k[E],v=k[E+1],I=v.pos-N.pos;I>0&&L.push({x1:M.width/2+100,y1:N.pos,x2:M.width/2+100,y2:v.pos,value:I,type:"horizontal",labelX:M.width/2+115,labelY:N.pos+I/2});}return L}),g=(h,w)=>{w.stopPropagation(),e.onLineClick?.({type:"distance",value:h.value,start:{x:h.x1,y:h.y1},end:{x:h.x2,y:h.y2}},h.value);};return (()=>{var h=Go(),w=h.firstChild;return h.$$pointerout=b,h.$$pointerover=y,h.$$pointerdown=m,B(h,`${A}ruler-layer`),D(w,"class",`${A}viewport-fixed`),V(w,C(Re,{get each(){return x()},children:p=>(()=>{var k=Zo(),L=k.firstChild,M=L.nextSibling,E=M.nextSibling,N=E.nextSibling;return k.$$click=v=>g(p,v),D(L,"class",`${A}line-hit-target`),F(v=>{var I=p.x1,$=p.y1,P=p.x2,z=p.y2,H=p.x1,te=p.y1,q=p.x2,se=p.y2,ee=p.x1,re=p.y1,ie=p.x2,ge=p.y2;return I!==v.e&&D(L,"x1",v.e=I),$!==v.t&&D(L,"y1",v.t=$),P!==v.a&&D(L,"x2",v.a=P),z!==v.o&&D(L,"y2",v.o=z),H!==v.i&&D(M,"x1",v.i=H),te!==v.n&&D(M,"y1",v.n=te),q!==v.s&&D(M,"x2",v.s=q),se!==v.h&&D(M,"y2",v.h=se),ee!==v.r&&D(E,"cx",v.r=ee),re!==v.d&&D(E,"cy",v.d=re),ie!==v.l&&D(N,"cx",v.l=ie),ge!==v.u&&D(N,"cy",v.u=ge),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),k})()})),V(h,C(Re,{get each(){return x()},children:p=>(()=>{var k=ui();return k.$$click=L=>g(p,L),B(k,`${A}label ${A}ruler-bridge-label`),V(k,()=>Math.round(p.value*100)/100),F(L=>J(k,"transform",`translate3d(${p.labelX}px, ${p.labelY}px, 0) translate(-50%, -50%)`)),k})()}),null),V(h,C(Re,{get each(){return e.state().lines},children:p=>C(Jo,{line:p,get pixelPosition(){return u(p)},get isDragging(){return t()===p.id},get isHovered(){return i()===p.id},get isSelected(){return o().has(p.id)},get onLineClick(){return e.onLineClick},get viewport(){return e.viewport}})}),null),h})()}function Jo(e){let t=U(()=>{let r=e.line.type==="vertical",o=e.pixelPosition,l=e.isDragging||e.isHovered||e.isSelected;return {left:"0",top:"0",width:r?"1px":"100%",height:r?"100%":"1px",transform:`translate3d(${r?o:0}px, ${r?0:o}px, 0) ${l?r?"scaleX(1.5)":"scaleY(1.5)":"scale(1)"}`,opacity:e.isSelected?"1":e.isHovered?"0.8":"0.6",filter:e.isSelected?"drop-shadow(0 0 1.5px var(--caliper-primary))":"none","transform-origin":"center"}}),n=U(()=>`${Zt}px`),i=U(()=>(Zt-1)/2);return [(()=>{var r=Qo();return B(r,`${A}ruler-line-hit`),F(o=>{var l=e.line.id,a=e.line.type,c=e.line.type==="vertical"?n():"100%",u=e.line.type==="vertical"?"100%":n(),d=`translate3d(${e.line.type==="vertical"?e.pixelPosition-i():0}px, ${e.line.type==="vertical"?0:e.pixelPosition-i()}px, 0)`,s=e.line.type==="vertical"?"col-resize":"row-resize";return l!==o.e&&D(r,"data-ruler-id",o.e=l),a!==o.t&&D(r,"data-ruler-type",o.t=a),c!==o.a&&J(r,"width",o.a=c),u!==o.o&&J(r,"height",o.o=u),d!==o.i&&J(r,"transform",o.i=d),s!==o.n&&J(r,"cursor",o.n=s),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})(),(()=>{var r=qo();return B(r,`${A}ruler-line-visual`),F(o=>Ye(r,{...t()},o)),r})(),C(Q,{get when(){return e.isDragging||e.isHovered||e.isSelected},get children(){var r=ui();return r.$$click=o=>{o.stopPropagation();let l=e.line.type==="vertical",a=e.viewport(),c=e.pixelPosition;e.onLineClick?.({type:"distance",value:c,start:l?{x:c,y:0}:{x:0,y:c},end:l?{x:c,y:a.height}:{x:a.width,y:c}},c);},B(r,`${A}label ${A}ruler-label`),V(r,()=>Math.round(e.pixelPosition*100)/100),F(o=>{var l=`translate3d(${e.line.type==="vertical"?e.pixelPosition+10:20}px, ${e.line.type==="vertical"?20:e.pixelPosition+10}px, 0)`,a=e.isSelected&&!e.isHovered&&!e.isDragging?"0.7":"1";return l!==o.e&&J(r,"transform",o.e=l),a!==o.t&&J(r,"opacity",o.t=a),o},{e:void 0,t:void 0}),r}})]}Fe(["pointerdown","pointerover","pointerout","click"]);var er=X("<div>");function tr(e){let t=U(()=>{let n=e.result();if(!n)return null;e.viewport().version;let i=ce(n.primary,n.primaryHierarchy,n.primaryPosition,n.primarySticky,n.primaryWinX,n.primaryWinY,!!n.primaryHasContainingBlock);if(!i)return null;let r={primary:{geo:i,delta:it(n.primaryHierarchy,n.primaryPosition,n.primarySticky,n.primaryWinX,n.primaryWinY,!!n.primaryHasContainingBlock)},secondary:{geo:ce(n.secondary,n.secondaryHierarchy,n.secondaryPosition,n.secondarySticky,n.secondaryWinX,n.secondaryWinY,!!n.secondaryHasContainingBlock),delta:it(n.secondaryHierarchy,n.secondaryPosition,n.secondarySticky,n.secondaryWinX,n.secondaryWinY,!!n.secondaryHasContainingBlock)},common:Bn(n.primaryHierarchy,n.secondaryHierarchy,e.selectionMetadata().element,n.secondaryElement,n.primaryWinX,n.primaryWinY)},o=n.primaryPosition===n.secondaryPosition&&n.primaryHierarchy.length===n.secondaryHierarchy.length&&n.primaryHierarchy.every((a,c)=>a.element===n.secondaryHierarchy[c]?.element),l=n.primaryHierarchy.length>0&&n.primaryHierarchy[0]?.element===n.secondaryElement||n.secondaryHierarchy.length>0&&n.secondaryHierarchy[0]?.element===e.selectionMetadata().element;return {...r,isSameContext:o||l}});return [C(Ro,{get metadata(){return e.selectionMetadata()},get result(){return e.result()},get isActivatePressed(){return e.isActivatePressed()},get isFrozen(){return e.isFrozen()},get animation(){return e.animation},get viewport(){return e.viewport()}}),C(Vo,{get metadata(){return e.selectionMetadata()},get isActivatePressed(){return e.isActivatePressed()},get isCopied(){return e.isCopied?.()??false},get viewport(){return e.viewport()}}),C(Q,{get when(){return Se(()=>!!(e.isActivatePressed()||e.isFrozen()))()&&t()},get children(){return C(De,{get mount(){return Ae()},get children(){var n=er();return B(n,`${A}overlay`),V(n,C(No,{get lines(){return e.result().lines},get data(){return t()},get viewport(){return e.viewport()},get onLineClick(){return e.onLineClick}}),null),V(n,C(To,{get lines(){return e.result().lines},get data(){return t()},get viewport(){return e.viewport()},get onLineClick(){return e.onLineClick}}),null),n}})}}),C(Q,{get when(){return Se(()=>!!e.calculatorState)()&&e.calculatorState()!==null},get children(){return C(De,{get mount(){return Ae()},get children(){return C(Oo,{get state(){return e.calculatorState()},get onClose(){return e.onCalculatorClose||(()=>{})},get position(){return {x:e.cursor().x,y:e.cursor().y}},get isFocused(){return e.activeFocus?.()==="calculator"}})}})}}),C(Q,{get when(){return Se(()=>!!(e.projectionState&&e.projectionState()?.direction!==null))()&&e.projectionState()?.element===e.selectionMetadata().element},get children(){return C(De,{get mount(){return Ae()},get children(){return C(Wo,{get projectionState(){return e.projectionState},get metadata(){return e.selectionMetadata},get viewport(){return e.viewport},get isFocused(){return e.activeFocus?.()==="projection"},get onLineClick(){return e.onLineClick}})}})}}),C(Q,{get when(){return Se(()=>!!e.rulerState)()&&e.rulerState().lines.length>0},get children(){return C(De,{get mount(){return Ae()},get children(){return C(Ko,{get state(){return e.rulerState},get viewport(){return e.viewport},get projectionState(){return e.projectionState},get metadata(){return e.selectionMetadata},get result(){return e.result},get onUpdate(){return e.onRulerUpdate||(()=>{})},get onRemove(){return e.onRulerRemove||(()=>{})},get onLineClick(){return e.onLineClick}})}})}})]}function nr(e){let{commands:t,animation:n}=e,[i,r]=_(null),[o,l]=_({x:0,y:0}),[a,c]=_({scrollX:window.scrollX,scrollY:window.scrollY,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,version:0}),[u,d]=_({element:null,rect:null,scrollHierarchy:[],position:"static",initialWindowX:0,initialWindowY:0,depth:0}),[s,f]=_(null),[m,y]=_({direction:null,value:"",element:null}),[b,x]=_(null),[g,h]=_(false),[w,p]=_("calculator"),[k,L]=_(null),M=null,E=null,N=null,v=null,[I,$]=_({lines:[]}),[P,z]=_(false),[H,te]=_(false),[q,se]=_(false),[ee,re]=_(false),ie=null,ge=new WeakSet,Qe=null,Ie=null,vt=false,Ee=null,we=null,xt=()=>{ie&&(window.clearTimeout(ie),ie=null),se(false);},qe=()=>{f(null),x(null),L(null),m().direction!==null&&p("projection");},rt=j=>{if(!j.isActive){qe();return}f(j),j.operation&&x(null);},je=U(()=>!!u().element||!!i()||I().lines.length>0||m().direction!==null),en=()=>{c(j=>({scrollX:window.scrollX,scrollY:window.scrollY,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,version:(j.version||0)+1})),Qe=null;},bt=()=>{je()&&(Qe||(Qe=requestAnimationFrame(en)));};kt(()=>{E=Zn(),M=Gn(),N=M.getProjection(),v=M.getRuler(),e.onSystemsReady&&e.onSystemsReady({measurementSystem:M,selectionSystem:E});let j=N.onUpdate(S=>{y(S),S.direction===null?(s()?.isActive&&p("calculator"),M?.getState()==="FROZEN"&&M?.unfreeze(false)):p("projection");}),G=v.onUpdate(S=>{$(S);}),ne=M.onStateChange(()=>{M&&(r(M.getCurrentResult()),te(M.getState()==="FROZEN"));}),ke=E.onUpdate(S=>{d(S);}),Te=S=>{re(S.detail.locked);},de=null,ve={x:0,y:0},Mt=(S,O)=>{if(ee())return;let W=qt(S,O);W&&E&&(M&&M.abort(),qe(),xt(),p("calculator"),_e=null,at.cancel(),st.cancel(),E.select(W));},Ke=S=>{let O=li(S),W=t.select;return W in O?Object.entries(O).every(([ue,Ne])=>ue===W?Ne===true:Ne===false):g()&&!O.Control&&!O.Meta&&!O.Alt&&!O.Shift},lt=S=>Ge(t.activate,S),$e=S=>{ee()||(ve={x:S.clientX,y:S.clientY},Ke(S)?(S.preventDefault(),S.stopImmediatePropagation(),de&&window.clearTimeout(de),de=window.setTimeout(()=>{Mt(ve.x,ve.y),de=null;},t.selectionHoldDuration)):de&&window.clearTimeout(de));},rn=S=>{ee()||Ke(S)&&(S.preventDefault(),S.stopImmediatePropagation());},ln=S=>{de&&(window.clearTimeout(de),de=null);let O=S.target;(O.closest("[data-caliper-ignore]")||O.closest(`.${A}projection-input`))&&(O.closest(`.${A}projection-input`)?p("projection"):O.closest(`.${A}calculator`)&&p("calculator"));},an=S=>{if(ee())return;let O=u().element,W=i();if(O||W){S.preventDefault(),S.stopImmediatePropagation();let ue="";if(S.shiftKey&&O)ue=O.getAttribute("data-caliper-agent-id")||"";else if(W&&M&&E){let Ne=E.getSelected(),xe=M.getSecondaryElement();Ne&&xe&&(ue=JSON.stringify({primary:Ot(Ne,u()),secondary:Ot(xe,{rect:W.secondary,scrollHierarchy:W.secondaryHierarchy,position:W.secondaryPosition,stickyConfig:W.secondarySticky,initialWindowX:W.secondaryWinX,initialWindowY:W.secondaryWinY,hasContainingBlock:W.secondaryHasContainingBlock})}));}else O&&(ue=JSON.stringify(Ot(O,u())));ue&&navigator.clipboard.writeText(ue).then(()=>{ie&&clearTimeout(ie),se(true),ie=window.setTimeout(()=>{se(false),ie=null;},1500);}).catch(()=>{});return}Ke(S)&&S.preventDefault();},zt=null,Be=null,_e=null,at=Qt(S=>{E?.getSelected()!==S&&(M?.abort(),xt()),_e=S,E?.select(S);}),st=Qt((S,O,W)=>{W&&(_e=W),M?.measure(S,O);}),pi=()=>{if(!zt||!E){Be=null;return}if(ee()){Be=null;return}let S=zt,O={x:S.clientX,y:S.clientY};l(O);let W=E.getSelected(),ue=P(),Ne=M?.getState();if(W){let xe=qt(S.clientX,S.clientY),ct=xe&&_e&&xe.contains(_e)&&xe!==_e;ue?M&&st.execute(!!ct,W,O,xe):Ne!=="FROZEN"&&xe&&at.execute(!!ct,xe);}Be=null;},sn=S=>{zt=S,ve={x:S.clientX,y:S.clientY},Be||(Be=requestAnimationFrame(pi));},cn=S=>{if(!(ee()&&!Ge(t.clear,S))){if(Ge(t.clear,S)){if(!je())return;S.preventDefault(),S.stopImmediatePropagation(),z(false),qe(),xt(),M&&M.abort(),E&&(_e=null,at.cancel(),st.cancel(),E.clear());return}if(Ge(t.select,S)&&h(true),Rt(S).toLowerCase()===t.ruler.toLowerCase()&&S.shiftKey&&v&&!ee()){S.preventDefault();let O=a(),W=Math.max(0,Math.min(o().x,O.width)),ue=Math.max(0,Math.min(o().y,O.height));v.addPair(W,ue);return}if(lt(S))u().element&&(S.preventDefault(),S.stopImmediatePropagation()),!P()&&je()&&(M&&M.abort(),qe()),z(true);else if(Ge(t.freeze,S)&&M)M.getState()==="FROZEN"?(S.preventDefault(),S.stopImmediatePropagation(),M.unfreeze(P())):u().element&&(S.preventDefault(),S.stopImmediatePropagation(),M.freeze());else {let O=Rt(S),{calculator:W,projection:ue}=t,Ne=!!s(),xe=m().direction!==null,ct=Ne&&(w()==="calculator"||!xe);if(Ne&&(ct||!/^\d$/.test(S.key))){let Le=/^[0-9]$/.test(S.key),Pe=/^[+\-*/]$/.test(S.key),Oe=S.key===".",be=S.key==="Backspace",oe=S.key==="Delete",Ve=S.key==="Enter",ut=S.key==="Escape";if((Le||Pe||Oe||be||oe||Ve||ut)&&!((Le||be||Oe)&&!ct)){S.preventDefault(),S.stopImmediatePropagation(),Le||Pe||Oe?di(S.key):be?hi():oe?mi():Ve?gi():ut&&on();return}}let _t={[ue.top]:"top",[ue.left]:"left",[ue.bottom]:"bottom",[ue.right]:"right"}[O];if(_t&&u().element){S.preventDefault(),S.stopImmediatePropagation(),p("projection");let Le=u().element;Le&&N?.setElement(Le),N?.setDirection(_t),M&&M.freeze();let Oe=(be=>{let oe=u(),Ve=ce(oe.rect,oe.scrollHierarchy,oe.position,oe.stickyConfig,oe.initialWindowX,oe.initialWindowY);if(Ve)return ci(be,Ve)})(_t);Oe!==void 0&&N?.capValue(Oe);return}if(xe){let Le=/^[0-9.]$/.test(O),Pe=S.key==="Backspace",Oe=w()==="projection"||!Ne;if((Le||Pe)&&Oe){S.preventDefault(),S.stopImmediatePropagation();let be=m().direction;if(Le&&be){let oe=u(),Ve=ce(oe.rect,oe.scrollHierarchy,oe.position,oe.stickyConfig,oe.initialWindowX,oe.initialWindowY),ut;Ve&&(ut=ci(be,Ve)),N?.appendValue(O,ut);}else Pe&&N?.backspace();return}}if(H()&&i()){let Pe={[W.top]:"top",[W.right]:"right",[W.bottom]:"bottom",[W.left]:"left",[W.distance]:"distance"}[O];if(Pe){let be=(i()?.lines||[]).find(oe=>oe.type===Pe);if(be){S.preventDefault(),S.stopImmediatePropagation();let oe=Kt(be,i());nn(be,oe);}}}}}},un=S=>{Ge(t.select,S)&&h(false),lt(S)&&(S.preventDefault(),P()&&(z(false),M&&je()&&M.stop()));},fn=()=>{P()&&(z(false),M&&je()&&M.stop());},dn=()=>{je()&&(bt(),window.focus());},hn=S=>{if(!s()?.isActive)return;S.target.closest(`.${A}calculator`)?(S.preventDefault(),S.stopImmediatePropagation(),L(null)):k()===null&&(S.preventDefault(),S.stopImmediatePropagation(),L({x:S.clientX,y:S.clientY}));};window.addEventListener("caliper:agent-lock-change",Te),window.addEventListener("pointerdown",$e,{capture:true}),window.addEventListener("pointerup",ln,{capture:true}),window.addEventListener("click",rn,{capture:true}),window.addEventListener("dblclick",hn,{capture:true}),window.addEventListener("mousemove",sn),window.addEventListener("keydown",cn,{capture:true}),window.addEventListener("keyup",un,{capture:true}),window.addEventListener("contextmenu",an,{capture:true}),window.addEventListener("blur",fn),window.addEventListener("focus",dn);let mn=location.pathname,St=()=>{let S=location.pathname;S!==mn&&(mn=S,z(false),qe(),xt(),M&&M.abort(),E&&(_e=null,at.cancel(),st.cancel(),E.clear()));},gn=history.pushState.bind(history),pn=history.replaceState.bind(history);history.pushState=function(...S){gn(...S),St();},history.replaceState=function(...S){pn(...S),St();},window.addEventListener("popstate",St),ye(()=>{window.removeEventListener("caliper:agent-lock-change",Te),window.removeEventListener("pointerdown",$e,{capture:true}),window.removeEventListener("pointerup",ln,{capture:true}),window.removeEventListener("click",rn,{capture:true}),window.removeEventListener("dblclick",hn,{capture:true}),window.removeEventListener("mousemove",sn),window.removeEventListener("keydown",cn,{capture:true}),window.removeEventListener("keyup",un,{capture:true}),window.removeEventListener("contextmenu",an,{capture:true}),window.removeEventListener("blur",fn),window.removeEventListener("focus",dn),window.removeEventListener("popstate",St),history.pushState=gn,history.replaceState=pn,Be&&cancelAnimationFrame(Be),at.cancel(),st.cancel(),ne(),ke(),j(),G(),M&&M.cleanup(),N&&(N=null),v&&(v=null);});}),pe(()=>{je()&&(window.addEventListener("scroll",bt,{passive:true,capture:true}),en(),ye(()=>{window.removeEventListener("scroll",bt,{capture:true}),Qe&&(cancelAnimationFrame(Qe),Qe=null);}));});let tn=(j,G,ne)=>{Ie&&(j&&!vt?(Ie.observe(document.documentElement),vt=true):!j&&vt&&(Ie.unobserve(document.documentElement),vt=false),!(G===Ee&&ne===we)&&(Ee&&Ee!==G&&(Ie.unobserve(Ee),Ee=null),we&&we!==ne&&we!==G&&(Ie.unobserve(we),we=null),G&&G!==Ee&&(ge.add(G),Ie.observe(G),Ee=G),ne&&ne!==G&&ne!==we&&(ge.add(ne),Ie.observe(ne),we=ne)));};pe(()=>{let j=null,G=0,ne=false,ke=false,Te=false,de=()=>{if((ne||ke)&&Ee){let ve=Ee.getBoundingClientRect();E?.updateRect(ve),M&&M.updatePrimaryRect(ve);}if((ne||Te)&&we){let ve=we.getBoundingClientRect();M?.updateSecondaryRect(ve);}ne=false,ke=false,Te=false;};Ie=new ResizeObserver(ve=>{if(!je())return;let Mt=false;for(let $e of ve){if(ge.has($e.target)){ge.delete($e.target);continue}Mt=true;}if(!Mt)return;for(let $e of ve)$e.target===document.documentElement?ne=true:$e.target===Ee?ke=true:$e.target===we&&(Te=true);ne&&bt();let Ke=Date.now(),lt=zn-(Ke-G);lt<=0?(j&&clearTimeout(j),G=Ke,de()):j||(j=window.setTimeout(()=>{G=Date.now(),j=null,de();},lt));}),ye(()=>{Ie?.disconnect(),Ie=null,Ee=null,we=null,j&&clearTimeout(j);});}),pe(()=>{let j=je(),G=u().element,ne=i(),ke=H()?ne?.secondaryElement??null:null;if(!j){tn(false,null,null);return}tn(true,G,ke);}),pe(()=>{let j=b(),G=i();if(j&&G&&M&&me(()=>s())?.isActive){a().version;let ke=G.lines.find(Te=>Te.type===j.type);if(ke){let Te=Kt(ke,G),de=M.getCalculator();de.syncValue(Te),f(de.getState());}}});let nn=(j,G)=>{if(M){let ne=M.getCalculator();ne.open(G),p("calculator"),rt(ne.getState()),"startSync"in j&&x(j);}},di=j=>{if(M){let G=M.getCalculator();G.handleInput(j),/^[+\-*/.]$/.test(j)&&p("calculator"),rt(G.getState());}},hi=()=>{if(M){let j=M.getCalculator();j.handleBackspace(),rt(j.getState());}},mi=()=>{if(M){let j=M.getCalculator();j.handleDelete(),rt(j.getState());}},gi=()=>{if(M){let j=M.getCalculator();j.handleEnter(),rt(j.getState());}},on=()=>{M&&(M.getCalculator().close(),qe());};return C(tr,{result:i,cursor:()=>k()??o(),selectionMetadata:u,isActivatePressed:P,isFrozen:H,animation:n,viewport:a,calculatorState:s,projectionState:m,rulerState:I,activeFocus:w,isCopied:q,onLineClick:nn,onRulerUpdate:(j,G)=>{v?.updateLine(j,G);},onRulerRemove:j=>{v?.removeLine(j);},onCalculatorClose:on})}function ci(e,t){let n=document.documentElement.scrollWidth,i=document.documentElement.scrollHeight;switch(e){case "top":return t.top;case "bottom":return i-(t.top+t.height);case "left":return t.left;case "right":return n-(t.left+t.width)}}var Ue=null,wt=0;function ir(){if(Ue){wt++;return}Ue=document.createElement("style"),Ue.textContent=bo,Ue.setAttribute("data-caliper-styles","true"),(document.head||document.getElementsByTagName("head")[0]).appendChild(Ue),wt=1;}function or(){Ue&&(wt--,wt<=0&&(Ue.remove(),Ue=null,wt=0));}var Jt=typeof window<"u",Ze=null;function fi(e){if(!Jt)return {mount:()=>{},dispose:()=>{},getSystems:()=>null,waitForSystems:()=>new Promise(()=>{}),use:()=>f,mounted:false};if(Ze?.mounted)return Ze;if(window.__CALIPER__?.mounted)return Ze=window.__CALIPER__,Ze;let t=ni(),n={theme:{...t?.theme,...e?.theme},commands:{...t?.commands,...e?.commands,calculator:{...t?.commands?.calculator,...e?.commands?.calculator},projection:{...t?.commands?.projection,...e?.commands?.projection}},animation:{...t?.animation,...e?.animation}},i=Jn(n.commands),r=ei(n.animation),o=ti(n.theme),l=t?.debug??true;ri.setEnabled(l);let a=null,c=null,u=new Map,d=[],f={mounted:false,mount:m=>{if(f.mounted)return;if(document.getElementById($t)){f.mounted=true;return}let y=m||document.documentElement;ir();let b=document.createElement("div");b.id=$t,b.style.zIndex=Vn.toString(),y.appendChild(b),Kn(o,b);let x=$n(()=>nr({commands:i,animation:r,onSystemsReady:g=>{c=g;let h=[...d];d.length=0,h.forEach(({resolve:w})=>w(g));}}),b);a=()=>{x(),b.remove(),or(),f.mounted=false,c=null,u.forEach(g=>g.dispose?.()),u.clear(),d.forEach(({reject:g})=>g(new Error("Overlay disposed"))),d.length=0,Ze===f&&(Ze=null);},f.mounted=true;},dispose:()=>{a&&(a(),a=null);},getSystems:()=>c,waitForSystems:()=>c?Promise.resolve(c):new Promise((m,y)=>d.push({resolve:m,reject:y})),use:m=>(u.has(m.name)||(u.set(m.name,m),m.install(f)),f)};return Ze=f,window.__CALIPER__=f,Jt&&f.mount(),f}Jt&&ii("0.2.0").catch(()=>{});typeof window<"u"&&fi();})();//# sourceMappingURL=index.global.min.js.map
326
+ `,A=Y,So=X("<svg><defs><clipPath><rect></svg>",false,true,false),Eo=X("<svg style=z-index:999999><g>"),No=X("<svg><g data-caliper-ignore style=pointer-events:auto;cursor:pointer><line></line><line></svg>",false,true,false);function Io(e){let[t,n]=_(null),i=()=>isFinite(e.data.common.minX),r=_(yt("lines-clip"))[0](),o=()=>({minX:e.data.common.minX-e.viewport.scrollX,maxX:e.data.common.maxX-e.viewport.scrollX,minY:e.data.common.minY-e.viewport.scrollY,maxY:e.data.common.maxY-e.viewport.scrollY});return (()=>{var l=Eo(),a=l.firstChild;return D(l,"class",`${A}viewport-fixed`),V(l,C(Q,{get when(){return i()},get children(){var s=So(),u=s.firstChild,d=u.firstChild;return D(u,"id",r),F(c=>{var f=o().minX,h=o().minY,p=Math.max(0,o().maxX-o().minX),w=Math.max(0,o().maxY-o().minY);return f!==c.e&&D(d,"x",c.e=f),h!==c.t&&D(d,"y",c.t=h),p!==c.a&&D(d,"width",c.a=p),w!==c.o&&D(d,"height",c.o=w),c},{e:void 0,t:void 0,a:void 0,o:void 0}),s}}),a),V(a,C(Ye,{get each(){return e.lines},children:(s,u)=>{let d=U(()=>{let f=We(s.start,s.startSync,s,e.data.primary.delta,e.data.secondary.delta,e.viewport.scrollX,e.viewport.scrollY),h=We(s.end,s.endSync,s,e.data.primary.delta,e.data.secondary.delta,e.viewport.scrollX,e.viewport.scrollY),p=f,w=h;e.data.isSameContext||(p=ot(f,s.startSync==="secondary"?e.data.secondary.geo:e.data.primary.geo,e.viewport),w={...ot(h,s.endSync==="secondary"?e.data.secondary.geo:e.data.primary.geo,e.viewport)}),s.type==="top"||s.type==="bottom"?s.startSync==="primary"?w.x=p.x:p.x=w.x:(s.type==="left"||s.type==="right")&&(s.startSync==="primary"?w.y=p.y:p.y=w.y);let b=0;return s.type==="top"||s.type==="bottom"?b=Math.abs(p.y-w.y):s.type==="left"||s.type==="right"?b=Math.abs(p.x-w.x):b=Math.sqrt(Math.pow(p.x-w.x,2)+Math.pow(p.y-w.y,2)),{x1:p.x,y1:p.y,x2:w.x,y2:w.y,liveValue:b}}),c=()=>t()===u();return (()=>{var f=No(),h=f.firstChild,p=h.nextSibling;return f.$$click=w=>{w.stopPropagation();let b=d();e.onLineClick?.(s,b.liveValue);},f.addEventListener("mouseleave",()=>n(null)),f.addEventListener("mouseenter",()=>n(u())),D(h,"class",`${A}line-hit-target`),D(p,"class",`${A}line ${A}line-clickable`),F(w=>{var b=d().x1,g=d().y1,m=d().x2,v=d().y2,y=d().x1,k=d().y1,L=d().x2,M=d().y2,E=c()?2:1;return b!==w.e&&D(h,"x1",w.e=b),g!==w.t&&D(h,"y1",w.t=g),m!==w.a&&D(h,"x2",w.a=m),v!==w.o&&D(h,"y2",w.o=v),y!==w.i&&D(p,"x1",w.i=y),k!==w.n&&D(p,"y1",w.n=k),L!==w.s&&D(p,"x2",w.s=L),M!==w.h&&D(p,"y2",w.h=M),E!==w.r&&D(p,"stroke-width",w.r=E),w},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),f})()}})),F(()=>D(a,"clip-path",i()?`url(#${r})`:void 0)),l})()}Fe(["click"]);var ko=X("<div style=z-index:1000000>"),To=X("<div data-caliper-ignore style=left:0;top:0>");function Lo(e){return (()=>{var n=ko();return B(n,`${A}viewport-fixed`),V(n,C(Ye,{get each(){return e.lines},children:i=>{let r=U(()=>{e.viewport.version;let o=We(i.start,i.startSync,i,e.data.primary.delta,e.data.secondary.delta,e.viewport.scrollX,e.viewport.scrollY),l=We(i.end,i.endSync,i,e.data.primary.delta,e.data.secondary.delta,e.viewport.scrollX,e.viewport.scrollY),a=Math.abs(o.x-l.x),s=Math.abs(o.y-l.y),u=0;i.type==="top"||i.type==="bottom"?u=s:i.type==="left"||i.type==="right"?u=a:u=Math.sqrt(a*a+s*s);let d=o,c=l;e.data.isSameContext||(d=ot(o,i.startSync==="secondary"?e.data.secondary.geo:e.data.primary.geo,e.viewport),c={...ot(l,i.endSync==="secondary"?e.data.secondary.geo:e.data.primary.geo,e.viewport)}),i.type==="top"||i.type==="bottom"?i.startSync==="primary"?c.x=d.x:d.x=c.x:(i.type==="left"||i.type==="right")&&(i.startSync==="primary"?c.y=d.y:d.y=c.y);let f=(d.x+c.x)/2,h=(d.y+c.y)/2,p=0,w=e.viewport.width,b=0,g=e.viewport.height,m=e.data.common,v=isFinite(m.minX),y=v?Math.max(p,m.minX-e.viewport.scrollX):p,k=v?Math.min(w,m.maxX-e.viewport.scrollX):w,L=v?Math.max(b,m.minY-e.viewport.scrollY):b,M=v?Math.min(g,m.maxY-e.viewport.scrollY):g,E=Math.min(d.x,c.x),N=Math.max(d.x,c.x),x=Math.min(d.y,c.y),I=Math.max(d.y,c.y);if(I<L||x>M||N<y||E>k)return {x:0,y:0,isHidden:true,value:0};let P=Math.max(E,y),z=Math.min(N,k),H=Math.max(x,L),te=Math.min(I,M),q=(P+z)/2,se=(H+te)/2,ee=f,re=h;return Math.abs(d.x-c.x)<1?(re=se,ee=Math.max(y+16,Math.min(k-16,ee))):Math.abs(d.y-c.y)<1?(ee=q,re=Math.max(L+16,Math.min(M-16,re))):(ee=Math.max(y+16,Math.min(k-16,f)),re=Math.max(L+16,Math.min(M-16,h))),{x:ee,y:re,isHidden:false,value:u}});return C(Q,{get when(){return Ee(()=>!!r())()&&!r().isHidden},get children(){var o=To();return o.$$click=l=>{l.stopPropagation();let a=r();a&&!a.isHidden&&e.onLineClick?.(i,a.value);},B(o,`${A}label`),V(o,()=>Math.round(r().value*100)/100),F(l=>J(o,"transform",`translate3d(${r().x}px, ${r().y}px, 0) translate(-50%, -50%)`)),o}})}})),n})()}Fe(["click"]);var Co=X('<svg viewBox="0 0 24 24"><line x1=12 y1=5 x2=12 y2=19></line><line x1=5 y1=12 x2=19 y2=12>'),Do=X('<svg viewBox="0 0 24 24"><line x1=5 y1=12 x2=19 y2=12>'),Ao=X('<svg viewBox="0 0 24 24"><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),jo=X('<svg viewBox="0 0 24 24"><line x1=19 y1=5 x2=5 y2=19>'),Yt={width:"12px",height:"12px","stroke-width":"2.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",display:"block"},$o={"+":()=>(()=>{var e=Co();return F(t=>ze(e,Yt,t)),e})(),"-":()=>(()=>{var e=Do();return F(t=>ze(e,Yt,t)),e})(),"*":()=>(()=>{var e=Ao();return F(t=>ze(e,Yt,t)),e})(),"/":()=>(()=>{var e=jo();return F(t=>ze(e,Yt,t)),e})()},si=X("<span>"),Po=X("<span>= "),Oo=X("<div data-caliper-ignore style=top:0;left:0><span>");function Ro(e){let t=n=>Math.round(n*100)/100+"";return C(Q,{get when(){return e.state.isActive},get children(){var n=Oo(),i=n.firstChild;return V(i,()=>t(e.state.baseValue)),V(n,C(Q,{keyed:true,get when(){return e.state.operation},children:r=>{let o=$o[r];return (()=>{var l=si();return B(l,`${A}calculator-operation`),V(l,C(Q,{when:o,fallback:r,get children(){return C(o,{})}})),l})()}}),null),V(n,C(Q,{get when(){return e.state.inputValue||e.state.operation},get children(){var r=si();return B(r,`${A}calculator-input`),V(r,()=>e.state.inputValue||"0"),r}}),null),V(n,C(Q,{get when(){return e.state.result!==null},get children(){var r=Po();r.firstChild;return B(r,`${A}calculator-result`),V(r,(()=>{var l=Ee(()=>e.state.result!==null);return ()=>l()?t(e.state.result):""})(),null),r}}),null),F(r=>{var o=`${A}calculator ${e.isFocused?`${A}calculator-focused`:""}`,l=`translate3d(${e.position.x+10}px, ${e.position.y+10}px, 0)`,a=`${A}calculator-base ${e.state.operation?`${A}calculator-base-active`:""}`;return o!==r.e&&B(n,r.e=o),l!==r.t&&J(n,"transform",r.t=l),a!==r.a&&B(i,r.a=a),r},{e:void 0,t:void 0,a:void 0}),n}})}var ci=X("<div style=left:0;top:0>");function Yo(e){let[t,n]=_(null),[i,r]=_(null),o=null,l=null,a=(f,h,p=.1)=>!f||!h?false:Math.abs(f.left-h.left)<p&&Math.abs(f.top-h.top)<p&&Math.abs(f.width-h.width)<p&&Math.abs(f.height-h.height)<p,s=(f,h,p)=>{if(!h)return null;if(!f)return {...h};let w=ri(f,h,p);return a(w,h,.1)?{...h}:{...h,left:w.left,top:w.top,width:w.width,height:w.height}},u=f=>f!==null&&f.width===0&&f.height===0,d=U(f=>{if(e.viewport.version,f&&e.metadata.element&&!document.contains(e.metadata.element))return f;let h=ce(e.metadata.rect,e.metadata.scrollHierarchy,e.metadata.position,e.metadata.stickyConfig,e.metadata.initialWindowX,e.metadata.initialWindowY);return u(h)?f:h},null),c=U(f=>{e.viewport.version;let h=e.result;if(!(e.isActivatePressed||e.isFrozen)||!h)return null;if(f&&h.secondaryElement&&!document.contains(h.secondaryElement))return f;let p=ce(h.secondary,h.secondaryHierarchy,h.secondaryPosition,h.secondarySticky,h.secondaryWinX,h.secondaryWinY);return u(p)?f:p},null);return ye(In([d,c,()=>e.animation.lerpFactor,()=>e.metadata.element],([f,h,p,w])=>{if(!f){n(null),r(null),o=null,l&&(cancelAnimationFrame(l),l=null);return}let b=o!==w,g=e.animation.enabled!==false;if(r(h),b)if(o=w,g){let m=()=>{let v=t(),y=s(v,f,p);n(y),f&&!a(y,f,.05)?l=requestAnimationFrame(m):l=null;};l&&cancelAnimationFrame(l),l=requestAnimationFrame(m);}else l&&(cancelAnimationFrame(l),l=null),n(f);else l||n(f);})),we(()=>{l&&cancelAnimationFrame(l);}),[C(Q,{get when(){return t()},children:f=>C(Ae,{get mount(){return je()},get children(){var h=ci();return B(h,`${A}boundary-box ${A}boundary-box-selected`),F(p=>{var w=`${f().width}px`,b=`${f().height}px`,g=`translate3d(${f().left-e.viewport.scrollX}px, ${f().top-e.viewport.scrollY}px, 0)`,m=f().clipPath;return w!==p.e&&J(h,"width",p.e=w),b!==p.t&&J(h,"height",p.t=b),g!==p.a&&J(h,"transform",p.a=g),m!==p.o&&J(h,"clip-path",p.o=m),p},{e:void 0,t:void 0,a:void 0,o:void 0}),h}})}),C(Q,{get when(){return i()},children:f=>C(Ae,{get mount(){return je()},get children(){var h=ci();return B(h,`${A}boundary-box ${A}boundary-box-secondary`),F(p=>{var w=`${f().width}px`,b=`${f().height}px`,g=`translate3d(${f().left-e.viewport.scrollX}px, ${f().top-e.viewport.scrollY}px, 0)`,m=f().clipPath;return w!==p.e&&J(h,"width",p.e=w),b!==p.t&&J(h,"height",p.t=b),g!==p.a&&J(h,"transform",p.a=g),m!==p.o&&J(h,"clip-path",p.o=m),p},{e:void 0,t:void 0,a:void 0,o:void 0}),h}})})]}var zo=X("<span>Copied!"),_o=X("<div style=left:0;top:0>"),Vo=X("<span> \xD7 ");function Xo(e){let n=U(()=>(e.viewport.version,ce(e.metadata.rect,e.metadata.scrollHierarchy,e.metadata.position,e.metadata.stickyConfig,e.metadata.initialWindowX,e.metadata.initialWindowY))),i=U(()=>{let r=n();if(!r||r.isHidden)return null;let o=e.viewport.scrollX,l=e.viewport.scrollX+e.viewport.width,a=e.viewport.scrollY+e.viewport.height,s=r.visibleMinX,u=r.visibleMaxX,d=r.visibleMaxY,c=Math.max(o,s),f=Math.min(l,u),h=Math.min(a,d),p=Math.max(r.left,c+16),w=Math.min(r.left+r.width,f-16),b=(p+w)/2,g=r.top+r.height+8;return g>h-16-24&&r.top<h-16&&(g=h-16-24),g=Math.max(g,r.top+16),{width:Math.round(r.width),height:Math.round(r.height),x:b,y:g}});return C(Q,{get when(){return i()},children:r=>C(Ae,{get mount(){return je()},get children(){var o=_o();return V(o,C(Q,{get when(){return e.isCopied},get fallback(){return (()=>{var l=Vo(),a=l.firstChild;return B(l,`${A}selection-label-content`),V(l,()=>r().width,a),V(l,()=>r().height,null),l})()},get children(){var l=zo();return B(l,`${A}selection-label-content`),l}})),F(l=>{var a=`${A}selection-label ${e.isCopied?`${A}selection-label-success`:""}`,s=`translate3d(${r().x-e.viewport.scrollX}px, ${r().y-e.viewport.scrollY}px, 0) translate(-50%, 0)`,u=e.isActivatePressed?0:1;return a!==l.e&&B(o,l.e=a),s!==l.t&&J(o,"transform",l.t=s),u!==l.a&&J(o,"opacity",l.a=u),l},{e:void 0,t:void 0,a:void 0}),o}})})}var Fo=X("<svg style=z-index:1000000><line data-caliper-ignore stroke=transparent stroke-width=15></line><line>"),Ho=X("<div data-caliper-ignore style=top:0;left:0>"),Wo=X("<div data-caliper-ignore><span></span><span>");function Uo(e){return C(Q,{get when(){return Ee(()=>!!e.metadata().element)()&&e.projectionState().direction},get children(){return [C(Bo,{get projectionState(){return e.projectionState},get metadata(){return e.metadata},get viewport(){return e.viewport},get onLineClick(){return e.onLineClick}}),C(Go,{get projectionState(){return e.projectionState},get metadata(){return e.metadata},get viewport(){return e.viewport},get isFocused(){return e.isFocused}})]}})}function Bo(e){let t=U(()=>{let o=e.viewport();o.version;let l=e.projectionState(),a=parseFloat(l.value)||0,s=e.metadata(),u=ce(s.rect,s.scrollHierarchy,s.position,s.stickyConfig,s.initialWindowX,s.initialWindowY);if(!u)return null;let d=0,c=0,f=0,h=0,p=0,w=0,b=0,g=0,m=0,v=0,y=document.documentElement.scrollWidth,k=document.documentElement.scrollHeight,L=u.left-o.scrollX,M=u.top-o.scrollY,E=false;switch(l.direction){case "top":d=f=L+u.width/2,c=M,h=Math.max(-o.scrollY,c-a),p=d,b=Math.max(0,Math.min(o.height,c)),g=Math.max(0,Math.min(o.height,h)),Math.abs(b-g)<1&&(E=true),w=(Math.min(b,g)+Math.max(b,g))/2;break;case "bottom":d=f=L+u.width/2,c=M+u.height,h=Math.min(k-o.scrollY,c+a),p=d,b=Math.max(0,Math.min(o.height,c)),g=Math.max(0,Math.min(o.height,h)),Math.abs(b-g)<1&&(E=true),w=(Math.min(b,g)+Math.max(b,g))/2;break;case "left":c=h=M+u.height/2,d=L,f=Math.max(-o.scrollX,d-a),m=Math.max(0,Math.min(o.width,d)),v=Math.max(0,Math.min(o.width,f)),Math.abs(m-v)<1&&(E=true),p=(Math.min(m,v)+Math.max(m,v))/2,w=c;break;case "right":c=h=M+u.height/2,d=L+u.width,f=Math.min(y-o.scrollX,d+a),m=Math.max(0,Math.min(o.width,d)),v=Math.max(0,Math.min(o.width,f)),Math.abs(m-v)<1&&(E=true),p=(Math.min(m,v)+Math.max(m,v))/2,w=c;break}let N=Math.sqrt((f-d)**2+(h-c)**2),x=Number.isInteger(N)?N:Math.round(N*100)/100,$=(l.value||String(x)).length*8+12,P=20,z=l.direction==="left"||l.direction==="right",q=Math.abs(z?m-v:b-g)>=(z?$:P)*1.5;return {x1:d,y1:c,x2:f,y2:h,labelX:p,labelY:w,actualValue:x,isHidden:u.isHidden||E,showLabel:q}}),[n,i]=_(false),r=o=>{o.stopPropagation();let l=t();l&&e.onLineClick?.({type:"distance",value:l.actualValue,start:{x:l.x1,y:l.y1},end:{x:l.x2,y:l.y2}},l.actualValue);};return C(Q,{get when(){return Ee(()=>!!t())()&&!t()?.isHidden},get children(){return [(()=>{var o=Fo(),l=o.firstChild,a=l.nextSibling;return D(o,"class",`${A}viewport-fixed`),l.addEventListener("mouseleave",()=>i(false)),l.addEventListener("mouseenter",()=>i(true)),l.$$click=r,D(l,"class",`${A}line-hit-target`),D(a,"class",`${A}projection-line`),F(s=>{var u=t().x1,d=t().y1,c=t().x2,f=t().y2,h=t().x1,p=t().y1,w=t().x2,b=t().y2,g=n()?2:1;return u!==s.e&&D(l,"x1",s.e=u),d!==s.t&&D(l,"y1",s.t=d),c!==s.a&&D(l,"x2",s.a=c),f!==s.o&&D(l,"y2",s.o=f),h!==s.i&&D(a,"x1",s.i=h),p!==s.n&&D(a,"y1",s.n=p),w!==s.s&&D(a,"x2",s.s=w),b!==s.h&&D(a,"y2",s.h=b),g!==s.r&&D(a,"stroke-width",s.r=g),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),o})(),C(Q,{get when(){return t().showLabel},get children(){var o=Ho();return o.$$click=r,B(o,`${A}label ${A}projection-label`),V(o,()=>t().actualValue),F(l=>J(o,"transform",`translate3d(${t().labelX}px, ${t().labelY}px, 0) translate(-50%, -50%)`)),o}})]}})}function Go(e){let t=U(()=>{let n=e.viewport();n.version;let i=e.metadata(),r=ce(i.rect,i.scrollHierarchy,i.position,i.stickyConfig,i.initialWindowX,i.initialWindowY);if(!r||r.isHidden)return {display:"none"};let o=r.top-n.scrollY,l=r.left-n.scrollX,a=35,s=10,d=o<a+s?o+r.height+s:o-a;return {top:"0",left:"0",transform:`translate3d(${l}px, ${d}px, 0)`}});return (()=>{var n=Wo(),i=n.firstChild,r=i.nextSibling;return B(i,`${A}projection-direction-tag`),V(i,()=>e.projectionState().direction),B(r,`${A}projection-current-value`),V(r,()=>e.projectionState().value||"0"),F(o=>{var l=`${A}projection-input ${e.isFocused?`${A}projection-input-focused`:""}`,a=t();return l!==o.e&&B(n,o.e=l),o.t=ze(n,a,o.t),o},{e:void 0,t:void 0}),n})()}Fe(["click"]);var Zo=X("<div data-caliper-ignore><svg style=z-index:999999>"),Qo=X('<svg><g data-caliper-ignore style=cursor:pointer;pointer-events:auto><line stroke=transparent stroke-width=15></line><line stroke=var(--caliper-secondary) stroke-width=1 stroke-dasharray="4 2"></line><circle r=2.5 fill=var(--caliper-secondary)></circle><circle r=2.5 fill=var(--caliper-secondary)></svg>',false,true,false),fi=X("<div data-caliper-ignore style=left:0;top:0>"),qo=X("<div data-caliper-ignore style=position:fixed;left:0;top:0;pointer-events:auto;z-index:1000001>"),Ko=X("<div data-caliper-ignore>");function Jo(e){let[t,n]=_(null),[i,r]=_(null),[o,l]=_(new Set),[a,s]=_(new Map);ye(()=>{let m=e.state().lines,v=o(),y=new Set;v.forEach(k=>{m.find(L=>L.id===k)&&y.add(k);}),y.size!==v.size&&l(y);}),ye(()=>{let m=e.state().lines,v=e.viewport(),y=a(),k=false,L=new Map(y);m.forEach(E=>{L.has(E.id)||(L.set(E.id,{width:v.width,height:v.height}),k=true);});let M=new Set(m.map(E=>E.id));L.forEach((E,N)=>{M.has(N)||(L.delete(N),k=true);}),k&&s(L);});let u=m=>{let v=e.viewport(),y=a().get(m.id);if(!y)return m.position;let k=m.type==="vertical",L=k?y.width:y.height,M=k?v.width:v.height;return L===0?m.position:m.position/L*M},d=m=>{let v=[],y=e.projectionState?.(),k=e.metadata?.(),L=e.result?.(),M=e.viewport();if(k&&k.element){let E=ce(k.rect,k.scrollHierarchy,k.position,k.stickyConfig,k.initialWindowX,k.initialWindowY);if(E){let N=E.left-M.scrollX,x=E.top-M.scrollY;if(m?v.push(N,N+E.width,N+E.width/2):v.push(x,x+E.height,x+E.height/2),y&&y.direction&&y.element===k.element){let I=parseFloat(y.value)||0;m?y.direction==="left"?v.push(N-I):y.direction==="right"&&v.push(N+E.width+I):y.direction==="top"?v.push(x-I):y.direction==="bottom"&&v.push(x+E.height+I);}}}if(L&&L.secondary){let E=ce(L.secondary,L.secondaryHierarchy,L.secondaryPosition,L.secondarySticky,L.secondaryWinX,L.secondaryWinY);if(E){let N=E.left-M.scrollX,x=E.top-M.scrollY;m?v.push(N,N+E.width,N+E.width/2):v.push(x,x+E.height,x+E.height/2);}}return v},c=(m,v)=>{let y=d(v);for(let k of y)if(Math.abs(m-k)<=Vn)return k;return m},f=m=>{let v=o();if(v.size===0)return;if(m.key==="Delete"||m.key==="Backspace"){Array.from(v).forEach(I=>e.onRemove(I)),l(new Set);return}let k=e.state().lines.filter(x=>v.has(x.id));if(k.length===0)return;let L=1;m.ctrlKey||m.metaKey?L=10:m.shiftKey&&(L=.1);let M=k[0];if(!M)return;let E=M.type==="vertical",N=0;if(E?(m.key==="ArrowLeft"&&(N=-L),m.key==="ArrowRight"&&(N=L)):(m.key==="ArrowUp"&&(N=-L),m.key==="ArrowDown"&&(N=L)),N!==0){m.preventDefault();let x=e.viewport();k.forEach(I=>{let $=I.type==="vertical",P=($?x.width:x.height)-1,z=u(I),H=Math.max(0,Math.min(z+N,P));H=c(H,$),s(te=>{let q=new Map(te);return q.set(I.id,{width:x.width,height:x.height}),q}),e.onUpdate(I.id,H);});}};kt(()=>{let m=v=>{let y=v.target;!y.closest(`.${A}ruler-line-hit`)&&!y.closest(`.${A}ruler-bridge-label`)&&!y.closest(`.${A}line-hit-target`)&&!y.closest("[data-caliper-ignore]")&&l(new Set);};window.addEventListener("pointerdown",m,{capture:true}),window.addEventListener("keydown",f,{capture:true}),we(()=>{window.removeEventListener("pointerdown",m,{capture:true}),window.removeEventListener("keydown",f,{capture:true});});});let h=m=>{let v=m.target,y=v.getAttribute("data-ruler-id"),k=v.getAttribute("data-ruler-type");if(!y||!k)return;m.preventDefault(),m.stopPropagation(),n(y),v.setPointerCapture(m.pointerId);let L=e.viewport(),M=e.state().lines.find(x=>x.id===y);if(M){let x=u(M);s(I=>{let $=new Map(I);return $.set(y,{width:L.width,height:L.height}),$}),e.onUpdate(y,x);}m.shiftKey?l(x=>{let I=new Set(x);return I.has(y)?I.delete(y):I.add(y),I}):o().has(y)||l(new Set([y]));let E=x=>{let I=e.viewport(),$=k==="vertical",P=$?x.clientX:x.clientY,z=($?I.width:I.height)-1;P=Math.max(0,Math.min(P,z)),P=c(P,$),e.onUpdate(y,P);},N=x=>{n(null),v.releasePointerCapture(x.pointerId),window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",N);};window.addEventListener("pointermove",E),window.addEventListener("pointerup",N);},p=m=>{let y=m.target.getAttribute("data-ruler-id");y&&r(y);},w=m=>{m.target.hasAttribute("data-ruler-id")&&r(null);},b=U(()=>{let m=o();if(m.size<2)return [];let v=e.state().lines.filter(E=>m.has(E.id)),y=v.filter(E=>E.type==="vertical").map(E=>({line:E,pos:u(E)})).sort((E,N)=>E.pos-N.pos),k=v.filter(E=>E.type==="horizontal").map(E=>({line:E,pos:u(E)})).sort((E,N)=>E.pos-N.pos),L=[],M=e.viewport();for(let E=0;E<y.length-1;E++){let N=y[E],x=y[E+1],I=x.pos-N.pos;I>0&&L.push({x1:N.pos,y1:M.height/2+100,x2:x.pos,y2:M.height/2+100,value:I,type:"vertical",labelX:N.pos+I/2,labelY:M.height/2+85});}for(let E=0;E<k.length-1;E++){let N=k[E],x=k[E+1],I=x.pos-N.pos;I>0&&L.push({x1:M.width/2+100,y1:N.pos,x2:M.width/2+100,y2:x.pos,value:I,type:"horizontal",labelX:M.width/2+115,labelY:N.pos+I/2});}return L}),g=(m,v)=>{v.stopPropagation(),e.onLineClick?.({type:"distance",value:m.value,start:{x:m.x1,y:m.y1},end:{x:m.x2,y:m.y2}},m.value);};return (()=>{var m=Zo(),v=m.firstChild;return m.$$pointerout=w,m.$$pointerover=p,m.$$pointerdown=h,B(m,`${A}ruler-layer`),D(v,"class",`${A}viewport-fixed`),V(v,C(Ye,{get each(){return b()},children:y=>(()=>{var k=Qo(),L=k.firstChild,M=L.nextSibling,E=M.nextSibling,N=E.nextSibling;return k.$$click=x=>g(y,x),D(L,"class",`${A}line-hit-target`),F(x=>{var I=y.x1,$=y.y1,P=y.x2,z=y.y2,H=y.x1,te=y.y1,q=y.x2,se=y.y2,ee=y.x1,re=y.y1,ie=y.x2,ge=y.y2;return I!==x.e&&D(L,"x1",x.e=I),$!==x.t&&D(L,"y1",x.t=$),P!==x.a&&D(L,"x2",x.a=P),z!==x.o&&D(L,"y2",x.o=z),H!==x.i&&D(M,"x1",x.i=H),te!==x.n&&D(M,"y1",x.n=te),q!==x.s&&D(M,"x2",x.s=q),se!==x.h&&D(M,"y2",x.h=se),ee!==x.r&&D(E,"cx",x.r=ee),re!==x.d&&D(E,"cy",x.d=re),ie!==x.l&&D(N,"cx",x.l=ie),ge!==x.u&&D(N,"cy",x.u=ge),x},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),k})()})),V(m,C(Ye,{get each(){return b()},children:y=>(()=>{var k=fi();return k.$$click=L=>g(y,L),B(k,`${A}label ${A}ruler-bridge-label`),V(k,()=>Math.round(y.value*100)/100),F(L=>J(k,"transform",`translate3d(${y.labelX}px, ${y.labelY}px, 0) translate(-50%, -50%)`)),k})()}),null),V(m,C(Ye,{get each(){return e.state().lines},children:y=>C(er,{line:y,get pixelPosition(){return u(y)},get isDragging(){return t()===y.id},get isHovered(){return i()===y.id},get isSelected(){return o().has(y.id)},get onLineClick(){return e.onLineClick},get viewport(){return e.viewport}})}),null),m})()}function er(e){let t=U(()=>{let r=e.line.type==="vertical",o=e.pixelPosition,l=e.isDragging||e.isHovered||e.isSelected;return {left:"0",top:"0",width:r?"1px":"100%",height:r?"100%":"1px",transform:`translate3d(${r?o:0}px, ${r?0:o}px, 0) ${l?r?"scaleX(1.5)":"scaleY(1.5)":"scale(1)"}`,opacity:e.isSelected?"1":e.isHovered?"0.8":"0.6",filter:e.isSelected?"drop-shadow(0 0 1.5px var(--caliper-primary))":"none","transform-origin":"center"}}),n=U(()=>`${Zt}px`),i=U(()=>(Zt-1)/2);return [(()=>{var r=qo();return B(r,`${A}ruler-line-hit`),F(o=>{var l=e.line.id,a=e.line.type,s=e.line.type==="vertical"?n():"100%",u=e.line.type==="vertical"?"100%":n(),d=`translate3d(${e.line.type==="vertical"?e.pixelPosition-i():0}px, ${e.line.type==="vertical"?0:e.pixelPosition-i()}px, 0)`,c=e.line.type==="vertical"?"col-resize":"row-resize";return l!==o.e&&D(r,"data-ruler-id",o.e=l),a!==o.t&&D(r,"data-ruler-type",o.t=a),s!==o.a&&J(r,"width",o.a=s),u!==o.o&&J(r,"height",o.o=u),d!==o.i&&J(r,"transform",o.i=d),c!==o.n&&J(r,"cursor",o.n=c),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})(),(()=>{var r=Ko();return B(r,`${A}ruler-line-visual`),F(o=>ze(r,{...t()},o)),r})(),C(Q,{get when(){return e.isDragging||e.isHovered||e.isSelected},get children(){var r=fi();return r.$$click=o=>{o.stopPropagation();let l=e.line.type==="vertical",a=e.viewport(),s=e.pixelPosition;e.onLineClick?.({type:"distance",value:s,start:l?{x:s,y:0}:{x:0,y:s},end:l?{x:s,y:a.height}:{x:a.width,y:s}},s);},B(r,`${A}label ${A}ruler-label`),V(r,()=>Math.round(e.pixelPosition*100)/100),F(o=>{var l=`translate3d(${e.line.type==="vertical"?e.pixelPosition+10:20}px, ${e.line.type==="vertical"?20:e.pixelPosition+10}px, 0)`,a=e.isSelected&&!e.isHovered&&!e.isDragging?"0.7":"1";return l!==o.e&&J(r,"transform",o.e=l),a!==o.t&&J(r,"opacity",o.t=a),o},{e:void 0,t:void 0}),r}})]}Fe(["pointerdown","pointerover","pointerout","click"]);var tr=X("<div>");function nr(e){let t=U(()=>{let n=e.result();if(!n)return null;e.viewport().version;let i=ce(n.primary,n.primaryHierarchy,n.primaryPosition,n.primarySticky,n.primaryWinX,n.primaryWinY,!!n.primaryHasContainingBlock);if(!i)return null;let r={primary:{geo:i,delta:it(n.primaryHierarchy,n.primaryPosition,n.primarySticky,n.primaryWinX,n.primaryWinY,!!n.primaryHasContainingBlock)},secondary:{geo:ce(n.secondary,n.secondaryHierarchy,n.secondaryPosition,n.secondarySticky,n.secondaryWinX,n.secondaryWinY,!!n.secondaryHasContainingBlock),delta:it(n.secondaryHierarchy,n.secondaryPosition,n.secondarySticky,n.secondaryWinX,n.secondaryWinY,!!n.secondaryHasContainingBlock)},common:Gn(n.primaryHierarchy,n.secondaryHierarchy,e.selectionMetadata().element,n.secondaryElement,n.primaryWinX,n.primaryWinY)},o=n.primaryPosition===n.secondaryPosition&&n.primaryHierarchy.length===n.secondaryHierarchy.length&&n.primaryHierarchy.every((a,s)=>a.element===n.secondaryHierarchy[s]?.element),l=n.primaryHierarchy.length>0&&n.primaryHierarchy[0]?.element===n.secondaryElement||n.secondaryHierarchy.length>0&&n.secondaryHierarchy[0]?.element===e.selectionMetadata().element;return {...r,isSameContext:o||l}});return [C(Yo,{get metadata(){return e.selectionMetadata()},get result(){return e.result()},get isActivatePressed(){return e.isActivatePressed()},get isFrozen(){return e.isFrozen()},get animation(){return e.animation},get viewport(){return e.viewport()}}),C(Xo,{get metadata(){return e.selectionMetadata()},get isActivatePressed(){return e.isActivatePressed()},get isCopied(){return e.isCopied?.()??false},get viewport(){return e.viewport()}}),C(Q,{get when(){return Ee(()=>!!(e.isActivatePressed()||e.isFrozen()))()&&t()},get children(){return C(Ae,{get mount(){return je()},get children(){var n=tr();return B(n,`${A}overlay`),V(n,C(Io,{get lines(){return e.result().lines},get data(){return t()},get viewport(){return e.viewport()},get onLineClick(){return e.onLineClick}}),null),V(n,C(Lo,{get lines(){return e.result().lines},get data(){return t()},get viewport(){return e.viewport()},get onLineClick(){return e.onLineClick}}),null),n}})}}),C(Q,{get when(){return Ee(()=>!!e.calculatorState)()&&e.calculatorState()!==null},get children(){return C(Ae,{get mount(){return je()},get children(){return C(Ro,{get state(){return e.calculatorState()},get onClose(){return e.onCalculatorClose||(()=>{})},get position(){return {x:e.cursor().x,y:e.cursor().y}},get isFocused(){return e.activeFocus?.()==="calculator"}})}})}}),C(Q,{get when(){return Ee(()=>!!(e.projectionState&&e.projectionState()?.direction!==null))()&&e.projectionState()?.element===e.selectionMetadata().element},get children(){return C(Ae,{get mount(){return je()},get children(){return C(Uo,{get projectionState(){return e.projectionState},get metadata(){return e.selectionMetadata},get viewport(){return e.viewport},get isFocused(){return e.activeFocus?.()==="projection"},get onLineClick(){return e.onLineClick}})}})}}),C(Q,{get when(){return Ee(()=>!!e.rulerState)()&&e.rulerState().lines.length>0},get children(){return C(Ae,{get mount(){return je()},get children(){return C(Jo,{get state(){return e.rulerState},get viewport(){return e.viewport},get projectionState(){return e.projectionState},get metadata(){return e.selectionMetadata},get result(){return e.result},get onUpdate(){return e.onRulerUpdate||(()=>{})},get onRemove(){return e.onRulerRemove||(()=>{})},get onLineClick(){return e.onLineClick}})}})}})]}function ir(e){let{commands:t,animation:n}=e,[i,r]=_(null),[o,l]=_({x:0,y:0}),[a,s]=_({scrollX:window.scrollX,scrollY:window.scrollY,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,version:0}),[u,d]=_({element:null,rect:null,scrollHierarchy:[],position:"static",initialWindowX:0,initialWindowY:0,depth:0}),[c,f]=_(null),[h,p]=_({direction:null,value:"",element:null}),[w,b]=_(null),[g,m]=_(false),[v,y]=_("calculator"),[k,L]=_(null),M=null,E=null,N=null,x=null,[I,$]=_({lines:[]}),[P,z]=_(false),[H,te]=_(false),[q,se]=_(false),[ee,re]=_(false),ie=null,ge=new WeakSet,Qe=null,Ie=null,vt=false,ve=null,pe=null,xt=()=>{ie&&(window.clearTimeout(ie),ie=null),se(false);},qe=()=>{f(null),b(null),L(null),h().direction!==null&&y("projection");},rt=j=>{if(!j.isActive){qe();return}f(j),j.operation&&b(null);},$e=U(()=>!!u().element||!!i()||I().lines.length>0||h().direction!==null),en=()=>{s(j=>({scrollX:window.scrollX,scrollY:window.scrollY,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,version:(j.version||0)+1})),Qe=null;},bt=()=>{$e()&&(Qe||(Qe=requestAnimationFrame(en)));};kt(()=>{E=Qn(),M=Zn(),N=M.getProjection(),x=M.getRuler(),e.onSystemsReady&&e.onSystemsReady({measurementSystem:M,selectionSystem:E});let j=N.onUpdate(S=>{p(S),S.direction===null?(c()?.isActive&&y("calculator"),M?.getState()==="FROZEN"&&M?.unfreeze(false)):y("projection");}),G=x.onUpdate(S=>{$(S);}),ne=M.onStateChange(()=>{M&&(r(M.getCurrentResult()),te(M.getState()==="FROZEN"));}),ke=E.onUpdate(S=>{d(S);}),Te=S=>{re(S.detail.locked);},de=null,xe={x:0,y:0},Mt=(S,O)=>{if(ee())return;let W=qt(S,O);W&&E&&(M&&M.abort(),qe(),xt(),y("calculator"),Le=null,at.cancel(),st.cancel(),E.select(W));},Ke=S=>{let O=ai(S),W=t.select;return W in O?Object.entries(O).every(([ue,Ne])=>ue===W?Ne===true:Ne===false):g()&&!O.Control&&!O.Meta&&!O.Alt&&!O.Shift},lt=S=>Ge(t.activate,S),Pe=S=>{ee()||(xe={x:S.clientX,y:S.clientY},Ke(S)?(S.preventDefault(),S.stopImmediatePropagation(),de&&window.clearTimeout(de),de=window.setTimeout(()=>{Mt(xe.x,xe.y),de=null;},t.selectionHoldDuration)):de&&window.clearTimeout(de));},rn=S=>{ee()||Ke(S)&&(S.preventDefault(),S.stopImmediatePropagation());},ln=S=>{de&&(window.clearTimeout(de),de=null);let O=S.target;(O.closest("[data-caliper-ignore]")||O.closest(`.${A}projection-input`))&&(O.closest(`.${A}projection-input`)?y("projection"):O.closest(`.${A}calculator`)&&y("calculator"));},an=S=>{if(ee())return;let O=u().element,W=i();if(O||W){S.preventDefault(),S.stopImmediatePropagation();let ue="";if(S.shiftKey&&O)ue=O.getAttribute("data-caliper-agent-id")||"";else if(W&&M&&E){let Ne=E.getSelected(),be=M.getSecondaryElement();Ne&&be&&(ue=JSON.stringify({primary:Ot(Ne,u()),secondary:Ot(be,{rect:W.secondary,scrollHierarchy:W.secondaryHierarchy,position:W.secondaryPosition,stickyConfig:W.secondarySticky,initialWindowX:W.secondaryWinX,initialWindowY:W.secondaryWinY,hasContainingBlock:W.secondaryHasContainingBlock})}));}else O&&(ue=JSON.stringify(Ot(O,u())));ue&&navigator.clipboard.writeText(ue).then(()=>{ie&&clearTimeout(ie),se(true),ie=window.setTimeout(()=>{se(false),ie=null;},1500);}).catch(()=>{});return}Ke(S)&&S.preventDefault();},zt=null,Be=null,Le=null,at=Qt(S=>{E?.getSelected()!==S&&(M?.abort(),xt()),Le=S,E?.select(S);}),st=Qt((S,O,W)=>{W&&(Le=W),M?.measure(S,O);}),yi=()=>{if(!zt||!E){Be=null;return}if(ee()){Be=null;return}let S=zt,O={x:S.clientX,y:S.clientY};l(O);let W=E.getSelected(),ue=P(),Ne=M?.getState();if(W){let be=qt(S.clientX,S.clientY),ct=be&&Le&&be.contains(Le)&&be!==Le,yn=Le&&!document.contains(Le);ue?M&&st.execute(!!ct,W,O,be):Ne!=="FROZEN"&&be&&!yn&&at.execute(!!ct,be);}Be=null;},sn=S=>{zt=S,xe={x:S.clientX,y:S.clientY},Be||(Be=requestAnimationFrame(yi));},cn=S=>{if(!(ee()&&!Ge(t.clear,S))){if(Ge(t.clear,S)){if(!$e())return;S.preventDefault(),S.stopImmediatePropagation(),z(false),qe(),xt(),M&&M.abort(),E&&(Le=null,at.cancel(),st.cancel(),E.clear());return}if(Ge(t.select,S)&&m(true),Rt(S).toLowerCase()===t.ruler.toLowerCase()&&S.shiftKey&&x&&!ee()){S.preventDefault();let O=a(),W=Math.max(0,Math.min(o().x,O.width)),ue=Math.max(0,Math.min(o().y,O.height));x.addPair(W,ue);return}if(lt(S))u().element&&(S.preventDefault(),S.stopImmediatePropagation()),!P()&&$e()&&(M&&M.abort(),qe()),z(true);else if(Ge(t.freeze,S)&&M)M.getState()==="FROZEN"?(S.preventDefault(),S.stopImmediatePropagation(),M.unfreeze(P())):u().element&&(S.preventDefault(),S.stopImmediatePropagation(),M.freeze());else {let O=Rt(S),{calculator:W,projection:ue}=t,Ne=!!c(),be=h().direction!==null,ct=Ne&&(v()==="calculator"||!be);if(Ne&&(ct||!/^\d$/.test(S.key))){let Ce=/^[0-9]$/.test(S.key),Oe=/^[+\-*/]$/.test(S.key),Re=S.key===".",Me=S.key==="Backspace",oe=S.key==="Delete",Ve=S.key==="Enter",ut=S.key==="Escape";if((Ce||Oe||Re||Me||oe||Ve||ut)&&!((Ce||Me||Re)&&!ct)){S.preventDefault(),S.stopImmediatePropagation(),Ce||Oe||Re?hi(S.key):Me?mi():oe?gi():Ve?pi():ut&&on();return}}let _t={[ue.top]:"top",[ue.left]:"left",[ue.bottom]:"bottom",[ue.right]:"right"}[O];if(_t&&u().element){S.preventDefault(),S.stopImmediatePropagation(),y("projection");let Ce=u().element;Ce&&N?.setElement(Ce),N?.setDirection(_t),M&&M.freeze();let Re=(Me=>{let oe=u(),Ve=ce(oe.rect,oe.scrollHierarchy,oe.position,oe.stickyConfig,oe.initialWindowX,oe.initialWindowY);if(Ve)return ui(Me,Ve)})(_t);Re!==void 0&&N?.capValue(Re);return}if(be){let Ce=/^[0-9.]$/.test(O),Oe=S.key==="Backspace",Re=v()==="projection"||!Ne;if((Ce||Oe)&&Re){S.preventDefault(),S.stopImmediatePropagation();let Me=h().direction;if(Ce&&Me){let oe=u(),Ve=ce(oe.rect,oe.scrollHierarchy,oe.position,oe.stickyConfig,oe.initialWindowX,oe.initialWindowY),ut;Ve&&(ut=ui(Me,Ve)),N?.appendValue(O,ut);}else Oe&&N?.backspace();return}}if(H()&&i()){let Oe={[W.top]:"top",[W.right]:"right",[W.bottom]:"bottom",[W.left]:"left",[W.distance]:"distance"}[O];if(Oe){let Me=(i()?.lines||[]).find(oe=>oe.type===Oe);if(Me){S.preventDefault(),S.stopImmediatePropagation();let oe=Kt(Me,i());nn(Me,oe);}}}}}},un=S=>{Ge(t.select,S)&&m(false),lt(S)&&(S.preventDefault(),P()&&(z(false),M&&$e()&&M.stop()));},fn=()=>{P()&&(z(false),M&&$e()&&M.stop());},dn=()=>{$e()&&(bt(),window.focus());},hn=S=>{if(!c()?.isActive)return;S.target.closest(`.${A}calculator`)?(S.preventDefault(),S.stopImmediatePropagation(),L(null)):k()===null&&(S.preventDefault(),S.stopImmediatePropagation(),L({x:S.clientX,y:S.clientY}));};window.addEventListener("caliper:agent-lock-change",Te),window.addEventListener("pointerdown",Pe,{capture:true}),window.addEventListener("pointerup",ln,{capture:true}),window.addEventListener("click",rn,{capture:true}),window.addEventListener("dblclick",hn,{capture:true}),window.addEventListener("mousemove",sn),window.addEventListener("keydown",cn,{capture:true}),window.addEventListener("keyup",un,{capture:true}),window.addEventListener("contextmenu",an,{capture:true}),window.addEventListener("blur",fn),window.addEventListener("focus",dn);let mn=location.pathname,St=()=>{let S=location.pathname;S!==mn&&(mn=S,z(false),qe(),xt(),M&&M.abort(),E&&(Le=null,at.cancel(),st.cancel(),E.clear()));},gn=history.pushState.bind(history),pn=history.replaceState.bind(history);history.pushState=function(...S){gn(...S),St();},history.replaceState=function(...S){pn(...S),St();},window.addEventListener("popstate",St),we(()=>{window.removeEventListener("caliper:agent-lock-change",Te),window.removeEventListener("pointerdown",Pe,{capture:true}),window.removeEventListener("pointerup",ln,{capture:true}),window.removeEventListener("click",rn,{capture:true}),window.removeEventListener("dblclick",hn,{capture:true}),window.removeEventListener("mousemove",sn),window.removeEventListener("keydown",cn,{capture:true}),window.removeEventListener("keyup",un,{capture:true}),window.removeEventListener("contextmenu",an,{capture:true}),window.removeEventListener("blur",fn),window.removeEventListener("focus",dn),window.removeEventListener("popstate",St),history.pushState=gn,history.replaceState=pn,Be&&cancelAnimationFrame(Be),at.cancel(),st.cancel(),ne(),ke(),j(),G(),M&&M.cleanup(),N&&(N=null),x&&(x=null);});}),ye(()=>{$e()&&(window.addEventListener("scroll",bt,{passive:true,capture:true}),en(),we(()=>{window.removeEventListener("scroll",bt,{capture:true}),Qe&&(cancelAnimationFrame(Qe),Qe=null);}));});let tn=(j,G,ne)=>{Ie&&(j&&!vt?(Ie.observe(document.documentElement),vt=true):!j&&vt&&(Ie.unobserve(document.documentElement),vt=false),!(G===ve&&ne===pe)&&(ve&&ve!==G&&(Ie.unobserve(ve),ve=null),pe&&pe!==ne&&pe!==G&&(Ie.unobserve(pe),pe=null),G&&G!==ve&&(ge.add(G),Ie.observe(G),ve=G),ne&&ne!==G&&ne!==pe&&(ge.add(ne),Ie.observe(ne),pe=ne)));};ye(()=>{let j=null,G=0,ne=false,ke=false,Te=false,de=()=>{if((ne||ke)&&ve&&document.contains(ve)){let xe=ve.getBoundingClientRect();E?.updateRect(xe),M&&M.updatePrimaryRect(xe);}if((ne||Te)&&pe&&document.contains(pe)){let xe=pe.getBoundingClientRect();M?.updateSecondaryRect(xe);}ne=false,ke=false,Te=false;};Ie=new ResizeObserver(xe=>{if(!$e())return;let Mt=false;for(let Pe of xe){if(ge.has(Pe.target)){ge.delete(Pe.target);continue}Mt=true;}if(!Mt)return;for(let Pe of xe)Pe.target===document.documentElement?ne=true:Pe.target===ve?ke=true:Pe.target===pe&&(Te=true);ne&&bt();let Ke=Date.now(),lt=_n-(Ke-G);lt<=0?(j&&clearTimeout(j),G=Ke,de()):j||(j=window.setTimeout(()=>{G=Date.now(),j=null,de();},lt));}),we(()=>{Ie?.disconnect(),Ie=null,ve=null,pe=null,j&&clearTimeout(j);});}),ye(()=>{let j=$e(),G=u().element,ne=i(),ke=H()?ne?.secondaryElement??null:null;if(!j){tn(false,null,null);return}tn(true,G,ke);}),ye(()=>{let j=w(),G=i();if(j&&G&&M&&me(()=>c())?.isActive){a().version;let ke=G.lines.find(Te=>Te.type===j.type);if(ke){let Te=Kt(ke,G),de=M.getCalculator();de.syncValue(Te),f(de.getState());}}});let nn=(j,G)=>{if(M){let ne=M.getCalculator();ne.open(G),y("calculator"),rt(ne.getState()),"startSync"in j&&b(j);}},hi=j=>{if(M){let G=M.getCalculator();G.handleInput(j),/^[+\-*/.]$/.test(j)&&y("calculator"),rt(G.getState());}},mi=()=>{if(M){let j=M.getCalculator();j.handleBackspace(),rt(j.getState());}},gi=()=>{if(M){let j=M.getCalculator();j.handleDelete(),rt(j.getState());}},pi=()=>{if(M){let j=M.getCalculator();j.handleEnter(),rt(j.getState());}},on=()=>{M&&(M.getCalculator().close(),qe());};return C(nr,{result:i,cursor:()=>k()??o(),selectionMetadata:u,isActivatePressed:P,isFrozen:H,animation:n,viewport:a,calculatorState:c,projectionState:h,rulerState:I,activeFocus:v,isCopied:q,onLineClick:nn,onRulerUpdate:(j,G)=>{x?.updateLine(j,G);},onRulerRemove:j=>{x?.removeLine(j);},onCalculatorClose:on})}function ui(e,t){let n=document.documentElement.scrollWidth,i=document.documentElement.scrollHeight;switch(e){case "top":return t.top;case "bottom":return i-(t.top+t.height);case "left":return t.left;case "right":return n-(t.left+t.width)}}var Ue=null,wt=0;function or(){if(Ue){wt++;return}Ue=document.createElement("style"),Ue.textContent=Mo,Ue.setAttribute("data-caliper-styles","true"),(document.head||document.getElementsByTagName("head")[0]).appendChild(Ue),wt=1;}function rr(){Ue&&(wt--,wt<=0&&(Ue.remove(),Ue=null,wt=0));}var Jt=typeof window<"u",Ze=null;function di(e){if(!Jt)return {mount:()=>{},dispose:()=>{},getSystems:()=>null,waitForSystems:()=>new Promise(()=>{}),use:()=>f,mounted:false};if(Ze?.mounted)return Ze;if(window.__CALIPER__?.mounted)return Ze=window.__CALIPER__,Ze;let t=ii(),n={theme:{...t?.theme,...e?.theme},commands:{...t?.commands,...e?.commands,calculator:{...t?.commands?.calculator,...e?.commands?.calculator},projection:{...t?.commands?.projection,...e?.commands?.projection}},animation:{...t?.animation,...e?.animation}},i=ei(n.commands),r=ti(n.animation),o=ni(n.theme),l=t?.debug??true;li.setEnabled(l);let a=null,s=null,u=new Map,d=[],f={mounted:false,mount:h=>{if(f.mounted)return;if(document.getElementById($t)){f.mounted=true;return}let p=h||document.documentElement;or();let w=document.createElement("div");w.id=$t,w.style.zIndex=Xn.toString(),p.appendChild(w),Jn(o,w);let b=Pn(()=>ir({commands:i,animation:r,onSystemsReady:g=>{s=g;let m=[...d];d.length=0,m.forEach(({resolve:v})=>v(g));}}),w);a=()=>{b(),w.remove(),rr(),f.mounted=false,s=null,u.forEach(g=>g.dispose?.()),u.clear(),d.forEach(({reject:g})=>g(new Error("Overlay disposed"))),d.length=0,Ze===f&&(Ze=null);},f.mounted=true;},dispose:()=>{a&&(a(),a=null);},getSystems:()=>s,waitForSystems:()=>s?Promise.resolve(s):new Promise((h,p)=>d.push({resolve:h,reject:p})),use:h=>(u.has(h.name)||(u.set(h.name,h),h.install(f)),f)};return Ze=f,window.__CALIPER__=f,Jt&&f.mount(),f}Jt&&oi("0.2.1").catch(()=>{});typeof window<"u"&&di();})();//# sourceMappingURL=index.global.min.js.map
327
327
  //# sourceMappingURL=index.global.min.js.map