cubevis 1.0.0__py3-none-any.whl → 1.0.4__py3-none-any.whl

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.
Files changed (46) hide show
  1. cubevis/__init__.py +12 -23
  2. cubevis/__js__/bokeh-3.6/cubevisjs.min.js +64 -0
  3. cubevis/__js__/{cubevisjs.min.js → bokeh-3.7/cubevisjs.min.js} +3 -3
  4. cubevis/__js__/bokeh-3.8/cubevisjs.min.js +64 -0
  5. cubevis/__js__/casalib.min.js +1 -1
  6. cubevis/__version__.py +1 -1
  7. cubevis/bokeh/__init__.py +16 -0
  8. cubevis/bokeh/annotations/_ev_poly_annotation.py +2 -1
  9. cubevis/bokeh/format/_wcs_ticks.py +6 -2
  10. cubevis/bokeh/models/__init__.py +1 -0
  11. cubevis/bokeh/models/_showable.py +352 -0
  12. cubevis/bokeh/models/_tip.py +2 -1
  13. cubevis/bokeh/models/_tip_button.py +2 -3
  14. cubevis/bokeh/sources/_data_pipe.py +6 -2
  15. cubevis/bokeh/sources/_image_data_source.py +6 -2
  16. cubevis/bokeh/sources/_image_pipe.py +4 -1
  17. cubevis/bokeh/sources/_spectra_data_source.py +6 -3
  18. cubevis/bokeh/sources/_updatable_data_source.py +6 -2
  19. cubevis/bokeh/state/__init__.py +4 -3
  20. cubevis/bokeh/state/_current.py +34 -0
  21. cubevis/bokeh/state/_initialize.py +282 -116
  22. cubevis/bokeh/state/_javascript.py +95 -21
  23. cubevis/bokeh/tools/_cbreset_tool.py +2 -1
  24. cubevis/bokeh/tools/_drag_tool.py +2 -1
  25. cubevis/bokeh/utils/__init__.py +0 -1
  26. cubevis/exe/_setting.py +1 -0
  27. cubevis/private/apps/__init__.py +4 -2
  28. cubevis/private/apps/_interactiveclean.mustache +6 -2
  29. cubevis/private/apps/_interactiveclean.py +6 -2
  30. cubevis/private/apps/_interactivecleannotebook.mustache +112 -0
  31. cubevis/private/apps/_interactivecleannotebook.py +1874 -0
  32. cubevis/private/casatasks/iclean.py +4 -0
  33. cubevis/toolbox/_app_context.py +5 -9
  34. cubevis/toolbox/_cube.py +6 -2
  35. cubevis/toolbox/_interactive_clean_ui.mustache +20 -31
  36. cubevis/toolbox/_interactive_clean_ui.py +20 -31
  37. cubevis/utils/__init__.py +183 -41
  38. cubevis/utils/_git.py +36 -0
  39. cubevis/utils/_jupyter.py +12 -0
  40. {cubevis-1.0.0.dist-info → cubevis-1.0.4.dist-info}/METADATA +3 -3
  41. {cubevis-1.0.0.dist-info → cubevis-1.0.4.dist-info}/RECORD +43 -39
  42. cubevis/__js__/bokeh-3.6.1.min.js +0 -728
  43. cubevis/__js__/bokeh-tables-3.6.1.min.js +0 -119
  44. cubevis/__js__/bokeh-widgets-3.6.1.min.js +0 -141
  45. {cubevis-1.0.0.dist-info → cubevis-1.0.4.dist-info}/WHEEL +0 -0
  46. {cubevis-1.0.0.dist-info → cubevis-1.0.4.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(()=>{var si=Object.create;var gt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var oi=Object.getPrototypeOf,fi=Object.prototype.hasOwnProperty;var pt=Math.pow;var Z=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var di=(l,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of li(e))!fi.call(l,n)&&n!==t&&gt(l,n,{get:()=>e[n],enumerable:!(i=ai(e,n))||i.enumerable});return l};var ui=(l,e,t)=>(t=l!=null?si(oi(l)):{},di(e||!l||!l.__esModule?gt(t,"default",{value:l,enumerable:!0}):t,l));var ue=Z(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.Point2D=void 0;var $e=class{getX(){return this.x}setX(e){this.x=e}getY(){return this.y}setY(e){this.y=e}setLocation(e,t){this.x=e,this.y=t}constructor(e,t){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)){let i=arguments;this.x===void 0&&(this.x=0),this.y===void 0&&(this.y=0),this.x=e,this.y=t}else if(e===void 0&&t===void 0){let i=arguments;this.x===void 0&&(this.x=0),this.y===void 0&&(this.y=0),this.x=0,this.y=0}else throw new Error("invalid overload")}};Pe.Point2D=$e;$e.__class="coordtxl.geom.Point2D"});var At=Z(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.MapKeywordProvider=void 0;var xe=class{constructor(e){this.wcsMap===void 0&&(this.wcsMap=null),this.wcsMap={};{let t=Object.keys(e);for(let i=0;i<t.length;i++){let n=t[i];if(((r,s)=>r[s]===void 0?null:r[s])(e,n)!=null&&((r,s)=>r[s]===void 0?null:r[s])(e,n)instanceof Array){let r=((a,f)=>a[f]===void 0?null:a[f])(e,n);this.wcsMap[n]=(a=>{if(a.clone!=null)return a.clone();{let f=Object.create(a);for(let o in a)a.hasOwnProperty(o)&&(f[o]=a[o]);return f}})(r);let s=1;for(let a=0;a<r.length;a++){let f=r[a];this.wcsMap[n+s]=f,s+=1}}else this.wcsMap[n]=((r,s)=>r[s]===void 0?null:r[s])(e,n)}}}findKey(e){return this.wcsMap.hasOwnProperty(e)}getStringValue$java_lang_String(e){return this.getStringValue$java_lang_String$java_lang_String(e,null)}getStringValue$java_lang_String$java_lang_String(e,t){return this.wcsMap.hasOwnProperty(e)?((i,n)=>i[n]===void 0?null:i[n])(this.wcsMap,e).toString():t}getStringValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null))return this.getStringValue$java_lang_String$java_lang_String(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getStringValue$java_lang_String(e);throw new Error("invalid overload")}getDoubleValue$java_lang_String(e){return this.getDoubleValue$java_lang_String$double(e,0)}getDoubleValue$java_lang_String$double(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i:t}getDoubleValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getDoubleValue$java_lang_String$double(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getDoubleValue$java_lang_String(e);throw new Error("invalid overload")}getFloatValue$java_lang_String(e){return this.getFloatValue$java_lang_String$float(e,Math.fround(0))}getFloatValue$java_lang_String$float(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i:t}getFloatValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getFloatValue$java_lang_String$float(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getFloatValue$java_lang_String(e);throw new Error("invalid overload")}getIntValue$java_lang_String(e){return this.getIntValue$java_lang_String$int(e,0)}getIntValue$java_lang_String$int(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i|0:t}getIntValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getIntValue$java_lang_String$int(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getIntValue$java_lang_String(e);throw new Error("invalid overload")}toString(){let e=!1,t={str:"{ ",toString:function(){return this.str}};{let i=Object.keys(this.wcsMap);for(let n=0;n<i.length;n++){let r=i[n];{e?(a=>(a.str+=", ",a))(t):e=!0,(a=>(a.str+=r,a))(t),(a=>(a.str+="=",a))(t);let s=((a,f)=>a[f]===void 0?null:a[f])(this.wcsMap,r);if(typeof s=="string")(a=>(a.str+='"',a))(t),(a=>(a.str+=s,a))(t),(a=>(a.str+='"',a))(t);else if(s!=null&&s instanceof Array){let a=s,f="[";for(let o=0;o<a.length;++o){o!==0&&(f+=", ");let u=a[o];typeof u=="string"?f+='"'+u+'"':f+=u}f+="]",(o=>(o.str+=f,o))(t)}else(a=>(a.str+=s,a))(t)}}}return(i=>(i.str+=" }",i))(t),t.str}};Te.MapKeywordProvider=xe;xe.__class="coordtxl.coords.MapKeywordProvider";xe.__interfaces=["coordtxl.coords.WCSKeywordProvider"]});var Et=Z(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.slasubs=void 0;var hi=ue(),te=class{static slaDcs2c(e,t){let i=Math.cos(t),n=[0,0,0];return n[0]=Math.cos(e)*i,n[1]=Math.sin(e)*i,n[2]=Math.sin(t),n}static slaDmxv(e,t){let i,n,r,s=[0,0,0],a=[0,0,0];for(n=0;n<3;n++){for(r=0,i=0;i<3;i++)r+=e[n][i]*t[i];s[n]=r}for(n=0;n<3;n++)a[n]=s[n];return a}static slaDcc2s(e){let t,i,n,r;t=e[0],i=e[1],n=e[2],r=Math.sqrt(t*t+i*i);let s=new hi.Point2D;return s.x=r!==0?Math.atan2(i,t):0,s.y=n!==0?Math.atan2(n,r):0,s}static slaDranrm(e){let t;return t=((i,n)=>{let r=Math.abs(i%n);return isNaN(r)||r==n||r<=Math.abs(n)/2?r:(i>0?1:-1)*(r-n)})(e,te.D2PI),t>=0?t:t+te.D2PI}static slaDeuler(e,t,i,n){let r,s,a,f,o,u=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),c=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),h,g,d,p,x=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),y;for(r=0;r<3;r++)for(s=0;s<3;s++)u[s][r]=s===r?1:0;for(a=e.length,f=0;f<3;f++)if(f<=a){for(r=0;r<3;r++)for(s=0;s<3;s++)c[s][r]=s===r?1:0;switch(f){case 0:default:h=t;break;case 1:h=i;break;case 2:h=n;break}for(g=Math.sin(h),d=Math.cos(h),y=e.charAt(f),(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="X".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="x".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="1".charCodeAt(0)?(c[1][1]=d,c[1][2]=g,c[2][1]=-g,c[2][2]=d):(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="Y".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="y".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="2".charCodeAt(0)?(c[0][0]=d,c[0][2]=-g,c[2][0]=g,c[2][2]=d):(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="Z".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="z".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="3".charCodeAt(0)?(c[0][0]=d,c[0][1]=g,c[1][0]=-g,c[1][1]=d):a=0,s=0;s<3;s++)for(r=0;r<3;r++){for(p=0,o=0;o<3;o++)p+=c[s][o]*u[o][r];x[s][r]=p}for(r=0;r<3;r++)for(s=0;s<3;s++)u[s][r]=x[s][r]}return u}static slDE2H(e,t,i){let n=[0,0],r=Math.sin(e),s=Math.cos(e),a=Math.sin(t),f=Math.cos(t),o=Math.sin(i),u=Math.cos(i),c=-s*f*o+a*u,h=-r*f,g=s*f*u+a*o,d=Math.sqrt(c*c+h*h),p;return d===0?p=0:p=Math.atan2(h,c),p<0&&(p=p+2*Math.PI),n[0]=p,n[1]=Math.atan2(g,d),n}static slDVTP(e,t){let i,n=e[0],r=e[1],s=e[2],a=t[0],f=t[1],o=t[2],u=a*a+f*f,c=Math.sqrt(u);c===0&&(c=1e-20,a=c);let h=n*a+r*f,g=h+s*o;g>te.TINY?i=0:g>=0?(i=1,g=te.TINY):g>-te.TINY?(i=2,g=-te.TINY):i=3,g=g*c;let d=(r*a-n*f)/g,p=(s*u-o*h)/g;return i!==0&&console.info("ERROR: From slDVTP, J = "+i),[d,p]}};Ie.slasubs=te;te.TINY=1e-6;te.D2PI=6.283185307179586;te.__class="coordtxl.coords.slasubs"});var jt=Z(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.wcscon=void 0;var X=ue(),b=class{static a_$LI$(){return b.a==null&&(b.a=[-162557e-11,-31919e-11,-13843e-11]),b.a}static ad_$LI$(){return b.ad==null&&(b.ad=[.001245,-.00158,-659e-6]),b.ad}static emi_$LI$(){return b.emi==null&&(b.emi=[[.99992567949991,-.011181482788805,-.004859004008828,-.000541640798032,-.237963047085011,.436218238658637],[.011181482840782,.999937484898031,-27155744957e-15,.237912530551179,-.00266070648897,-.008537588719453],[.004859003889183,-27177143501e-15,.999988194601879,-.436101961325347,.012258830424865,.002119065556992],[-2423898405e-15,27105439e-15,11777422e-15,.999904322043106,-.011181451601069,-.004858519608686],[-27105439e-15,-2423927017e-15,65851e-15,.011181451608968,.999916125340107,-27162614355e-15],[-11777422e-15,65846e-15,-2424049954e-15,.004858519590501,-27165866691e-15,.999966838131419]]),b.emi}static fk524(e){let t=new X.Point2D(0,0);return b.fk524m(e,t)}static fk524e(e,t){let i=new X.Point2D(0,0),n=b.fk524m(e,i);return n.x=n.x+i.x*(t-1950),n.y=n.y+i.y*(t-1950),n}static fk524m(e,t){let i,n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D=[0,0,0,0,0,0],T=[0,0,0,0,0,0],$,K,V,S,E,w,P,_,M=6.283185307179586,A,q=1e-30,j=0;for(A=100*60*60*360/M,i=I.WCSTransform.degrad(e.x),n=I.WCSTransform.degrad(e.y),r=I.WCSTransform.degrad(t.x),s=I.WCSTransform.degrad(t.y),c=r*A,h=s*A,g=Math.sin(i),d=Math.cos(i),p=Math.sin(n),x=Math.cos(n),y=d*x,m=g*x,C=p,D[0]=y,D[1]=m,D[2]=C,c!==j||h!==j?(D[3]=-(c*m)-d*p*h,D[4]=c*y-g*p*h,D[5]=x*h):(D[3]=j,D[4]=j,D[5]=j),P=0;P<6;P++){for(v=j,_=0;_<6;_++)v=v+b.emi_$LI$()[_][P]*D[_];T[P]=v}return y=T[0],m=T[1],C=T[2],$=T[3],K=T[4],V=T[5],S=Math.sqrt(y*y+m*m+C*C),y=y+b.a_$LI$()[0]*S,m=m+b.a_$LI$()[1]*S,C=C+b.a_$LI$()[2]*S,$=$+b.ad_$LI$()[0]*S,K=K+b.ad_$LI$()[1]*S,V=V+b.ad_$LI$()[2]*S,E=y*y+m*m,w=Math.sqrt(E),y===j&&m===j?a=j:(a=Math.atan2(m,y),a<j&&(a=a+M)),f=Math.atan2(C,w),w>q&&(c=(y*K-m*$)/E,h=(V*E-C*(y*$+m*K))/((E+C*C)*w)),o=c/A,u=h/A,e.x=I.WCSTransform.raddeg(a),e.y=I.WCSTransform.raddeg(f),t.x=I.WCSTransform.raddeg(o),t.y=I.WCSTransform.raddeg(u),e}static em_$LI$(){return b.em==null&&(b.em=[[.999925678186902,.011182059571766,.004857946721186,-.000541652366951,.237917612131583,-.43611127603927],[-.011182059642247,.999937478448132,-27147426498e-15,-.237968129744288,-.002660763319071,.012259092261564],[-.00485794655896,-27176441185e-15,.99998819973877,.436227555856097,-.008537771074048,.002119110818172],[2423950176e-15,27106627e-15,11776559e-15,.999947035154614,.011182506007242,.00485766994865],[-27106627e-15,2423978783e-15,-65816e-15,-.011182506121805,.999958833818833,-27137309539e-15],[-11776558e-15,-65874e-15,2424101735e-15,-.004857669684959,-27184471371e-15,1.000009560363559]]),b.em}static fk425(e){let t=new X.Point2D(0,0);return b.fk425m(e,t)}static fk425e(e,t){let i=new X.Point2D(0,0),n=b.fk425m(e,i);return n.x=n.x+i.x*(t-2e3),n.y=n.y+i.y*(t-2e3),n}static fk425m(e,t){let i,n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P,_,M=[0,0,0],A=[0,0,0],q=[0,0,0,0,0,0],j=[0,0,0,0,0,0],L=6.283185307179586,R,ie=1e-30,ee=0;for(R=100*60*60*360/L,i=I.WCSTransform.degrad(e.x),n=I.WCSTransform.degrad(e.y),r=I.WCSTransform.degrad(t.x),s=I.WCSTransform.degrad(t.y),c=r*R,h=s*R,g=Math.sin(i),d=Math.cos(i),p=Math.sin(n),x=Math.cos(n),M[0]=d*x,M[1]=g*x,M[2]=p,A[0]=-g*x*c-d*p*h,A[1]=d*x*c-g*p*h,A[2]=x*h,y=M[0]*b.a_$LI$()[0]+M[1]*b.a_$LI$()[1]+M[2]*b.a_$LI$()[2],m=M[0]*b.ad_$LI$()[0]+M[1]*b.ad_$LI$()[1]+M[2]*b.ad_$LI$()[2],P=0;P<3;P++)q[P]=M[P]-b.a_$LI$()[P]+y*M[P],q[P+3]=A[P]-b.ad_$LI$()[P]+m*M[P];for(P=0;P<6;P++){for(y=ee,_=0;_<6;_++)y=y+b.em_$LI$()[_][P]*q[_];j[P]=y}return C=j[0],v=j[1],D=j[2],T=j[3],$=j[4],K=j[5],V=C*C+v*v,S=V+D*D,E=Math.sqrt(V),w=C*T+v*$,C===ee&&v===ee?a=ee:(a=Math.atan2(v,C),a<ee&&(a=a+L)),f=Math.atan2(D,E),E>ie&&(c=(C*$-v*T)/V,h=(K*V-D*w)/(S*E)),o=c/R,u=h/R,e.x=I.WCSTransform.raddeg(a),e.y=I.WCSTransform.raddeg(f),t.x=I.WCSTransform.raddeg(o),t.y=I.WCSTransform.raddeg(u),e}static bgal_$LI$(){return b.bgal==null&&(b.bgal=[[-.066988739415,-.872755765852,-.483538914632],[.492728466075,-.45034695802,.744584633283],[-.867600811151,-.188374601723,.460199784784]]),b.bgal}static fk42gal(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;f=e.x,o=e.y,s=I.WCSTransform.degrad(f),a=I.WCSTransform.degrad(o);let c=new X.Point2D,h=new X.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.bgal_$LI$()[u][0]+t[1]*b.bgal_$LI$()[u][1]+t[2]*b.bgal_$LI$()[u][2];let g=new X.Point2D,d=new X.Point2D;return b.jpcon(i,g,d),n=I.WCSTransform.raddeg(g.x),r=I.WCSTransform.raddeg(g.y),e.x=n,e.y=r,b.idg>0,e}static gal2fk4(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;n=e.x,r=e.y,s=I.WCSTransform.degrad(n),a=I.WCSTransform.degrad(r);let c=new X.Point2D,h=new X.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.bgal_$LI$()[0][u]+t[1]*b.bgal_$LI$()[1][u]+t[2]*b.bgal_$LI$()[2][u];let g=new X.Point2D,d=new X.Point2D;return b.jpcon(i,g,d),f=I.WCSTransform.raddeg(g.x),o=I.WCSTransform.raddeg(g.y),e.x=f,e.y=o,b.idg>0,e}static jgal_$LI$(){return b.jgal==null&&(b.jgal=[[-.054875539726,-.87343710801,-.483834985808],[.494109453312,-.444829589425,.74698225181],[-.867666135858,-.198076386122,.455983795705]]),b.jgal}static fk52gal(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;f=e.x,o=e.y,s=I.WCSTransform.degrad(f),a=I.WCSTransform.degrad(o);let c=new X.Point2D,h=new X.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.jgal_$LI$()[u][0]+t[1]*b.jgal_$LI$()[u][1]+t[2]*b.jgal_$LI$()[u][2];let g=new X.Point2D,d=new X.Point2D;return b.jpcon(i,g,d),n=I.WCSTransform.raddeg(g.x),r=I.WCSTransform.raddeg(g.y),e.x=n,e.y=r,b.idg>0,e}static gal2fk5(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;n=e.x,r=e.y,s=I.WCSTransform.degrad(n),a=I.WCSTransform.degrad(r);let c=new X.Point2D,h=new X.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.jgal_$LI$()[0][u]+t[1]*b.jgal_$LI$()[1][u]+t[2]*b.jgal_$LI$()[2][u];let g=new X.Point2D,d=new X.Point2D;return b.jpcon(i,g,d),f=I.WCSTransform.raddeg(g.x),o=I.WCSTransform.raddeg(g.y),e.x=f,e.y=o,b.idg>0,e}static jpcon(e,t,i){let n,r,s,a,f,o;n=e[0],r=e[1],s=e[2],t.x=Math.atan2(r,n),t.x<0&&(t.x=t.x+6.283185307179586),f=n*n+r*r,a=Math.sqrt(f),t.y=Math.atan2(s,a),o=s*s,i.x=Math.sqrt(f+o)}static jpcop(e,t,i,n,r){n.x=i*Math.cos(e)*Math.cos(t),n.y=i*Math.sin(e)*Math.cos(t),r.x=i*Math.sin(t)}static fk4prec(e,t,i){let n=I.WCSTransform.degrad(i.x),r=I.WCSTransform.degrad(i.y),s=b.mprecfk4(e,t),a=re.slasubs.slaDcs2c(n,r),f=re.slasubs.slaDmxv(s,a),o=re.slasubs.slaDcc2s(f);return n=o.x,r=o.y,n=re.slasubs.slaDranrm(n),i.x=I.WCSTransform.raddeg(n),i.y=I.WCSTransform.raddeg(r),i}static fk5prec(e,t,i){let n=I.WCSTransform.degrad(i.x),r=I.WCSTransform.degrad(i.y),s=b.mprecfk5(e,t),a=re.slasubs.slaDcs2c(n,r),f=re.slasubs.slaDmxv(s,a),o=re.slasubs.slaDcc2s(f);return n=o.x,r=o.y,n=re.slasubs.slaDranrm(n),i.x=I.WCSTransform.raddeg(n),i.y=I.WCSTransform.raddeg(r),i}static mprecfk4(e,t){let i,n,r,s,a,f,o;return i=(e-1850)/100,n=(t-e)/100,r=n*b.DAS2R,s=2303.5548+(1.3972+59e-6*i)*i,a=(s+(.30242-269e-6*i+.017996*n)*n)*r,f=(s+(1.09478+387e-6*i+.018324*n)*n)*r,o=(2005.1125+(-.85294-365e-6*i)*i+(-.42647-365e-6*i-.041802*n)*n)*r,re.slasubs.slaDeuler("ZYZ",-a,o,-f)}static mprecfk5(e,t){let i,n,r,s,a,f,o;return i=(e-2e3)/100,n=(t-e)/100,r=n*b.DAS2R,s=2306.2181+(1.39656-139e-6*i)*i,a=(s+(.30188-344e-6*i+.017998*n)*n)*r,f=(s+(1.09468+66e-6*i+.018203*n)*n)*r,o=(2004.3109+(-.8533-217e-6*i)*i+(-.42665-217e-6*i-.041833*n)*n)*r,re.slasubs.slaDeuler("ZYZ",-a,o,-f)}};Ve.wcscon=b;b.idg=0;b.DAS2R=484813681109536e-20;b.__class="coordtxl.coords.wcscon";var re=Et(),I=we()});var $t=Z(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.worldpos=void 0;var tt=ue(),Oe=class{static getPosition(e,t,i){let n,r,s,a,f,o,u,c,h=0,g=0,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P=.01745329252,_=6.28318530717959,M=1e-5,A,q,j,L,R,ie,ee,De=i.pcode,pe,Ae;if(A=i.xref,q=i.yref,j=i.xrefpix,L=i.yrefpix,R=i.xinc,ie=i.yinc,ee=O.WCSTransform.degrad(i.rot),n=Math.cos(ee),r=Math.sin(ee),s=e-j,a=t-L,i.rotmat>0)o=s*i.cd11+a*i.cd12,a=s*i.cd21+a*i.cd22,s=o;else{if(R===0||ie===0)return null;s=s*R,a=a*ie,ee!==0&&(o=s*n-a*r,a=s*r+a*n,s=o)}if(pe=A+s,Ae=q+a,De<0)return new tt.Point2D(pe,Ae);switch(i.coorflip>0?(T=O.WCSTransform.degrad(A),$=O.WCSTransform.degrad(q),o=s,s=a,a=o):($=O.WCSTransform.degrad(A),T=O.WCSTransform.degrad(q)),p=O.WCSTransform.degrad(s),x=O.WCSTransform.degrad(a),u=p*p+x*x,v=Math.cos(T),D=Math.sin(T),De){case-1:case 0:g=$+p,h=T+x;break;case 1:if(c=Math.sqrt(1-u),d=D*c+v*x,d>1||d<-1||(h=Math.asin(d),g=v*c-D*x,g===0&&p===0))return null;g=Math.atan2(p,g)+$;break;case 2:if(h=v-x*D,h===0)return null;g=$+Math.atan2(p,h),h=Math.atan(Math.cos(g-$)*(x*v+D)/h);break;case 3:if(u>=_*_/4||(u=Math.sqrt(u),c=Math.cos(u),u!==0?u=Math.sin(u)/u:u=1,d=x*v*u+D*c,d>1||d<-1)||(h=Math.asin(d),m=c-d*D,d=p*u*v,m===0&&d===0))return null;g=$+Math.atan2(d,m);break;case 4:if(h=v-x*D,h===0||(g=$+Math.atan2(p,h),d=Math.cos(g-$),d===0)||(h=h/d,h>1||h<-1))return null;h=Math.acos(h),T<0&&(h=-h);break;case 5:if(h=T+x,Math.abs(h)>_/4||(c=Math.cos(h),Math.abs(p)>_*c/2))return null;g=$,c>M&&(g=g+p/c);break;case 6:if(d=ie*n+R*r,d===0&&(d=1),a=O.WCSTransform.degrad(q/2+45),s=a+d/2*P,a=Math.log(Math.tan(a)),s=Math.log(Math.tan(s)),E=O.WCSTransform.degrad(d)/(s-a),w=E*a,S=Math.cos(O.WCSTransform.degrad(q)),S<=0&&(S=1),g=p/S+$,Math.abs(g-$)>_)return null;d=0,E!==0&&(d=(x+w)/E),d=Math.exp(d),h=2*Math.atan(d)-_/4;break;case 7:if(d=ie*n+R*r,d===0&&(d=1),d=O.WCSTransform.degrad(d),a=O.WCSTransform.degrad(q),s=Math.sin(a+d)/Math.sqrt((1+Math.cos(a+d))/2)-Math.sin(a)/Math.sqrt((1+Math.cos(a))/2),s===0&&(s=1),E=d/s,d=R*n-ie*r,d===0&&(d=1),d=O.WCSTransform.degrad(d),s=2*Math.cos(a)*Math.sin(d/2),s===0&&(s=1),S=d*Math.sqrt((1+Math.cos(a)*Math.cos(d/2))/2)/s,w=E*Math.sin(a)/Math.sqrt((1+Math.cos(a))/2),g=$,h=T,p===0&&x===0)break;if(f=4-p*p/(4*S*S)-(x+w)/E*((x+w)/E),f>4||f<2||(f=.5*Math.sqrt(f),C=(x+w)*f/E,Math.abs(C)>1)||(C=Math.asin(C),Math.abs(Math.cos(C))<M)||(m=p*f/(2*S*Math.cos(C)),Math.abs(m)>1))return null;m=Math.asin(m),g=$+2*m,h=C;break;case 8:if(f=(4-u)/(4+u),Math.abs(f)>1||(h=f*D+x*v*(1+f)/2,Math.abs(h)>1)||(h=Math.asin(h),g=Math.cos(h),Math.abs(g)<M)||(g=p*(1+f)/(2*g),Math.abs(g)>1)||(g=Math.asin(g),y=1+Math.sin(h)*D+Math.cos(h)*v*Math.cos(g),Math.abs(y)<M))return null;y=2*(Math.sin(h)*v-Math.cos(h)*D*Math.cos(g))/y,Math.abs(y-x)>M&&(g=_/2-g),g=$+g;break}return V=g,K=h,V-$>_/2&&(V=V-_),V-$<-_/2&&(V=V+_),V<0&&(V+=_),pe=O.WCSTransform.raddeg(V),Ae=O.WCSTransform.raddeg(K),new tt.Point2D(pe,Ae)}static getPixels(e,t,i){let n,r,s=0,a=0,f=0,o=0,u=0,c=0,h,g,d,p=0,x=0,y=0,m,C,v,D,T,$,K=.01745329252,V=1e-5,S=6.28318530717959,E,w,P,_,M,A,q,j;switch(E=i.xref,w=i.yref,P=i.xrefpix,_=i.yrefpix,M=i.xinc,A=i.yinc,q=O.WCSTransform.degrad(i.rot),T=Math.cos(q),D=Math.sin(q),j=i.pcode,j>0&&j<9&&(i.coorflip>0?(a=O.WCSTransform.degrad(E),s=O.WCSTransform.degrad(w),h=e-w):(s=O.WCSTransform.degrad(E),a=O.WCSTransform.degrad(w),h=e-E),j>=0&&(h>180&&(e-=360),h<-180&&(e+=360)),f=O.WCSTransform.degrad(e),o=O.WCSTransform.degrad(t),u=Math.cos(o),c=Math.sin(o),x=Math.sin(f-s)*u,p=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s)),j){case 1:if(p<0)return null;y=c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s);break;case 2:if(p<=0)return null;y=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s),x=x/y,y=(c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s))/y;break;case 3:y=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s),y<-1&&(y=-1),y>1&&(y=1),y=Math.acos(y),y!==0?y=y/Math.sin(y):y=1,x=x*y,y=(c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s))*y;break;case 4:if(a===0)return null;y=(Math.cos(a)-u*Math.cos(f-s))/Math.sin(a);break;case 5:if(h=f-s,Math.abs(o)>S/4||Math.abs(a)>S/4)return null;y=o-a,x=h*u;break;case 6:if(h=A*T+M*D,h===0&&(h=1),r=O.WCSTransform.degrad(w/2+45),n=r+h/2*K,r=Math.log(Math.tan(r)),n=Math.log(Math.tan(n)),C=O.WCSTransform.degrad(h)/(n-r),v=C*r,m=Math.cos(O.WCSTransform.degrad(w)),m<=0&&(m=1),h=f-s,x=m*h,h=o/2+S/8,h=Math.tan(h),h<V)return null;y=C*Math.log(h)-v;break;case 7:if(g=(f-s)/2,Math.abs(g)>S/4||(h=A*T+M*D,h===0&&(h=1),h=O.WCSTransform.degrad(h),r=O.WCSTransform.degrad(w),n=Math.sin(r+h)/Math.sqrt((1+Math.cos(r+h))/2)-Math.sin(r)/Math.sqrt((1+Math.cos(r))/2),n===0&&(n=1),C=h/n,h=M*T-A*D,h===0&&(h=1),h=O.WCSTransform.degrad(h),n=2*Math.cos(r)*Math.sin(h/2),n===0&&(n=1),m=h*Math.sqrt((1+Math.cos(r)*Math.cos(h/2))/2)/n,v=C*Math.sin(r)/Math.sqrt((1+Math.cos(r))/2),h=Math.sqrt((1+Math.cos(o)*Math.cos(g))/2),Math.abs(h)<V))return null;x=2*m*Math.cos(o)*Math.sin(g)/h,y=C*Math.sin(o)/h-v;break;case 8:if(g=f-s,Math.abs(o)>S/4||(d=1+c*Math.sin(a)+u*Math.cos(a)*Math.cos(g),Math.abs(d)<V))return null;d=2/d,x=x*d,y=d*(c*Math.cos(a)-u*Math.sin(a)*Math.cos(g));break}j>0&&j<9?(n=O.WCSTransform.raddeg(x),r=O.WCSTransform.raddeg(y)):(n=e-E,r=t-w),i.coorflip>0&&($=n,n=r,r=$),i.rotmat>0?($=n*i.dc11+r*i.dc12,r=n*i.dc21+r*i.dc22,n=$):(q!==0&&($=n*T+r*D,r=r*T-n*D,n=$),M!==0&&(n=n/M),A!==0&&(r=r/A));let L=n+P,R=r+_;return new tt.Point2D(L,R)}};Le.worldpos=Oe;Oe.__class="coordtxl.coords.worldpos";var O=we()});var Tt=Z(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.platepos=void 0;var Pt=ue(),k=class{static getPosition(e,t,i){let n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D;return n=e+i.x_pixel_offset-1+.5,r=t+i.y_pixel_offset-1+.5,s=(i.ppo_coeff[2]-n*i.x_pixel_size)/1e3,a=(r*i.y_pixel_size-i.ppo_coeff[5])/1e3,f=s*s,o=a*a,u=s*f,c=a*o,h=f+o,g=i.amd_x_coeff[0]*s+i.amd_x_coeff[1]*a+i.amd_x_coeff[2]+i.amd_x_coeff[3]*f+i.amd_x_coeff[4]*s*a+i.amd_x_coeff[5]*o+i.amd_x_coeff[6]*h+i.amd_x_coeff[7]*u+i.amd_x_coeff[8]*f*a+i.amd_x_coeff[9]*s*o+i.amd_x_coeff[10]*c+i.amd_x_coeff[11]*s*h+i.amd_x_coeff[12]*s*h*h,p=i.amd_y_coeff[0]*a+i.amd_y_coeff[1]*s+i.amd_y_coeff[2]+i.amd_y_coeff[3]*o+i.amd_y_coeff[4]*s*a+i.amd_y_coeff[5]*f+i.amd_y_coeff[6]*h+i.amd_y_coeff[7]*c+i.amd_y_coeff[8]*o*s+i.amd_y_coeff[9]*a*f+i.amd_y_coeff[10]*u+i.amd_y_coeff[11]*a*h+i.amd_y_coeff[12]*a*h*h,d=g/k.CONS2R,x=p/k.CONS2R,v=Math.tan(i.plate_dec),D=Math.cos(i.plate_dec),y=Math.atan2(d/D,1-x*v),m=y+i.plate_ra,m<0&&(m=m+k.TWOPI),C=Math.atan(Math.cos(y)/((1-x*v)/(x+v))),new Pt.Point2D(m/k.COND2R,C/k.COND2R)}static getPixels(e,t,i){let n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P,_,M,A,q,j,L,R,ie,ee;for(ie=e*k.COND2R,ee=t*k.COND2R,T=Math.sin(ee),$=Math.cos(ee),K=Math.sin(i.plate_dec),V=Math.cos(i.plate_dec),S=Math.sin(ie-i.plate_ra),E=Math.cos(ie-i.plate_ra),n=T*K+$*V*E,r=$*S*k.CONR2S/n,s=(T*V-$*K*E)*k.CONR2S/n,j=r/i.plate_scale,L=s/i.plate_scale,R=0;R<k.MAX_ITERATIONS&&(o=j*L,u=j*j,c=L*L,h=u*L,g=c*j,m=u+c,C=m*m,d=u*j,p=c*L,x=u*u,y=c*c,w=i.amd_x_coeff[0]*j+i.amd_x_coeff[1]*L+i.amd_x_coeff[2]+i.amd_x_coeff[3]*u+i.amd_x_coeff[4]*o+i.amd_x_coeff[5]*c+i.amd_x_coeff[6]*m+i.amd_x_coeff[7]*d+i.amd_x_coeff[8]*h+i.amd_x_coeff[9]*g+i.amd_x_coeff[10]*p+i.amd_x_coeff[11]*j*m+i.amd_x_coeff[12]*j*C,P=i.amd_x_coeff[0]+i.amd_x_coeff[3]*2*j+i.amd_x_coeff[4]*L+i.amd_x_coeff[6]*2*j+i.amd_x_coeff[7]*3*u+i.amd_x_coeff[8]*2*o+i.amd_x_coeff[9]*c+i.amd_x_coeff[11]*(3*u+c)+i.amd_x_coeff[12]*(5*x+6*u*c+y),_=i.amd_x_coeff[1]+i.amd_x_coeff[4]*j+i.amd_x_coeff[5]*2*L+i.amd_x_coeff[6]*2*L+i.amd_x_coeff[8]*u+i.amd_x_coeff[9]*2*o+i.amd_x_coeff[10]*3*c+i.amd_x_coeff[11]*2*o+i.amd_x_coeff[12]*4*o*m,M=i.amd_y_coeff[0]*L+i.amd_y_coeff[1]*j+i.amd_y_coeff[2]+i.amd_y_coeff[3]*c+i.amd_y_coeff[4]*o+i.amd_y_coeff[5]*u+i.amd_y_coeff[6]*m+i.amd_y_coeff[7]*p+i.amd_y_coeff[8]*g+i.amd_y_coeff[9]*h+i.amd_y_coeff[10]*d+i.amd_y_coeff[11]*L*m+i.amd_y_coeff[12]*L*C,A=i.amd_y_coeff[1]+i.amd_y_coeff[4]*L+i.amd_y_coeff[5]*2*j+i.amd_y_coeff[6]*2*j+i.amd_y_coeff[8]*c+i.amd_y_coeff[9]*2*o+i.amd_y_coeff[10]*3*u+i.amd_y_coeff[11]*2*o+i.amd_y_coeff[12]*4*o*m,q=i.amd_y_coeff[0]+i.amd_y_coeff[3]*2*L+i.amd_y_coeff[4]*j+i.amd_y_coeff[6]*2*L+i.amd_y_coeff[7]*3*c+i.amd_y_coeff[8]*2*o+i.amd_y_coeff[9]*u+i.amd_y_coeff[11]*(u+3*c)+i.amd_y_coeff[12]*(5*y+6*u*c+x),w=w-r,M=M-s,v=(-w*q+M*_)/(P*q-_*A),D=(-M*P+w*A)/(P*q-_*A),j=j+v,L=L+D,!(Math.abs(v)<k.TOLERANCE&&Math.abs(D)<k.TOLERANCE));R++);a=(i.ppo_coeff[2]-j*1e3)/i.x_pixel_size,f=(i.ppo_coeff[5]+L*1e3)/i.y_pixel_size;let De=a-i.x_pixel_offset+1-.5,pe=f-i.y_pixel_offset+1-.5;return new Pt.Point2D(De,pe)}};Ke.platepos=k;k.COND2R=.01745329252;k.CONS2R=206264.8062470964;k.TWOPI=6.28318530717959;k.MAX_ITERATIONS=50;k.TOLERANCE=5e-7;k.CONR2S=206264.8062470964;k.__class="coordtxl.coords.platepos"});var we=Z(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.WCSTransform=void 0;var We=ue(),W=class{static degrad(e){return e*Math.PI/180}static raddeg(e){return e*180/Math.PI}static hrdeg(e){return e*15}static deghr(e){return e/15}static hrrad(e){return W.degrad(W.hrdeg(e))}static radhr(e){return W.deghr(W.raddeg(e))}constructor(e,t,i,n,r,s,a,f,o,u,c,h){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&(typeof a=="number"||a===null)&&(typeof f=="number"||f===null)&&(typeof o=="number"||o===null)&&(typeof u=="number"||u===null)&&(typeof c=="number"||c===null)&&(typeof h=="string"||h===null)){let g=arguments;this.xref===void 0&&(this.xref=0),this.yref===void 0&&(this.yref=0),this.xrefpix===void 0&&(this.xrefpix=0),this.yrefpix===void 0&&(this.yrefpix=0),this.xinc===void 0&&(this.xinc=0),this.yinc===void 0&&(this.yinc=0),this.rot===void 0&&(this.rot=0),this.crot===void 0&&(this.crot=0),this.srot===void 0&&(this.srot=0),this.cd11===void 0&&(this.cd11=0),this.cd12===void 0&&(this.cd12=0),this.cd21===void 0&&(this.cd21=0),this.cd22===void 0&&(this.cd22=0),this.dc11===void 0&&(this.dc11=0),this.dc12===void 0&&(this.dc12=0),this.dc21===void 0&&(this.dc21=0),this.dc22===void 0&&(this.dc22=0),this.mrot===void 0&&(this.mrot=0),this.cmrot===void 0&&(this.cmrot=0),this.smrot===void 0&&(this.smrot=0),this.xmpix===void 0&&(this.xmpix=0),this.ympix===void 0&&(this.ympix=0),this.equinox===void 0&&(this.equinox=0),this.epoch===void 0&&(this.epoch=0),this.nxpix===void 0&&(this.nxpix=0),this.nypix===void 0&&(this.nypix=0),this.plate_ra===void 0&&(this.plate_ra=0),this.plate_dec===void 0&&(this.plate_dec=0),this.plate_scale===void 0&&(this.plate_scale=0),this.x_pixel_offset===void 0&&(this.x_pixel_offset=0),this.y_pixel_offset===void 0&&(this.y_pixel_offset=0),this.x_pixel_size===void 0&&(this.x_pixel_size=0),this.y_pixel_size===void 0&&(this.y_pixel_size=0),this.xpix===void 0&&(this.xpix=0),this.ypix===void 0&&(this.ypix=0),this.xpos===void 0&&(this.xpos=0),this.ypos===void 0&&(this.ypos=0),this.pcode===void 0&&(this.pcode=0),this.changesys===void 0&&(this.changesys=0),this.printsys===void 0&&(this.printsys=0),this.ndec===void 0&&(this.ndec=0),this.degout===void 0&&(this.degout=0),this.tabsys===void 0&&(this.tabsys=0),this.rotmat===void 0&&(this.rotmat=0),this.coorflip===void 0&&(this.coorflip=0),this.offscl===void 0&&(this.offscl=0),this.plate_fit===void 0&&(this.plate_fit=0),this.wcson===void 0&&(this.wcson=0),this.detector===void 0&&(this.detector=0),this.fCenterRa===void 0&&(this.fCenterRa=0),this.fCenterDec===void 0&&(this.fCenterDec=0),this.fHalfWidthRa===void 0&&(this.fHalfWidthRa=0),this.fHalfWidthDec===void 0&&(this.fHalfWidthDec=0),this.fWidthDeg===void 0&&(this.fWidthDeg=0),this.fHeightDeg===void 0&&(this.fHeightDeg=0),this.degPerPixel===void 0&&(this.degPerPixel=null),this.ppo_coeff=[0,0,0,0,0,0],this.amd_x_coeff=(d=>{let p=[];for(;d-- >0;)p.push(0);return p})(20),this.amd_y_coeff=(d=>{let p=[];for(;d-- >0;)p.push(0);return p})(20),this.instrument="",this.c1type="",this.c2type="",this.ctypes=["-SIN","-TAN","-ARC","-NCP","-GLS","-MER","-AIT","-STG"],this.ptype="",this.radecsys="",this.sysout="",this.center="",this.plate_fit=0,this.nxpix=a,this.nypix=f,this.xinc=i/3600,this.yinc=n/3600,this.xrefpix=r,this.yrefpix=s,this.xref=e,this.yref=t,this.c1type="RA-",this.c2type="DEC",this.ptype=h,this.pcode=1,this.coorflip=0,this.rot=o,this.rotmat=0,this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.dc11=0,this.dc21=0,this.dc12=0,this.dc22=0,this.equinox=u,u>1980?this.radecsys="FK5":this.radecsys="FK4",c>0?this.epoch=c:this.epoch=0,this.wcson=1,this.sysout=this.radecsys,this.changesys=0,this.printsys=1,this.tabsys=0,this.pcode=0;for(let d=0;d<8;d++)((p,x,y=0)=>p.substr(y,x.length)===x)(this.ptype,this.ctypes[d])&&(this.pcode=d+1);this.wcsfull()}else if((e!=null&&e.constructor!=null&&e.constructor.__interfaces!=null&&e.constructor.__interfaces.indexOf("coordtxl.coords.WCSKeywordProvider")>=0||e===null)&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0&&f===void 0&&o===void 0&&u===void 0&&c===void 0&&h===void 0){let d=arguments[0];this.xref===void 0&&(this.xref=0),this.yref===void 0&&(this.yref=0),this.xrefpix===void 0&&(this.xrefpix=0),this.yrefpix===void 0&&(this.yrefpix=0),this.xinc===void 0&&(this.xinc=0),this.yinc===void 0&&(this.yinc=0),this.rot===void 0&&(this.rot=0),this.crot===void 0&&(this.crot=0),this.srot===void 0&&(this.srot=0),this.cd11===void 0&&(this.cd11=0),this.cd12===void 0&&(this.cd12=0),this.cd21===void 0&&(this.cd21=0),this.cd22===void 0&&(this.cd22=0),this.dc11===void 0&&(this.dc11=0),this.dc12===void 0&&(this.dc12=0),this.dc21===void 0&&(this.dc21=0),this.dc22===void 0&&(this.dc22=0),this.mrot===void 0&&(this.mrot=0),this.cmrot===void 0&&(this.cmrot=0),this.smrot===void 0&&(this.smrot=0),this.xmpix===void 0&&(this.xmpix=0),this.ympix===void 0&&(this.ympix=0),this.equinox===void 0&&(this.equinox=0),this.epoch===void 0&&(this.epoch=0),this.nxpix===void 0&&(this.nxpix=0),this.nypix===void 0&&(this.nypix=0),this.plate_ra===void 0&&(this.plate_ra=0),this.plate_dec===void 0&&(this.plate_dec=0),this.plate_scale===void 0&&(this.plate_scale=0),this.x_pixel_offset===void 0&&(this.x_pixel_offset=0),this.y_pixel_offset===void 0&&(this.y_pixel_offset=0),this.x_pixel_size===void 0&&(this.x_pixel_size=0),this.y_pixel_size===void 0&&(this.y_pixel_size=0),this.xpix===void 0&&(this.xpix=0),this.ypix===void 0&&(this.ypix=0),this.xpos===void 0&&(this.xpos=0),this.ypos===void 0&&(this.ypos=0),this.pcode===void 0&&(this.pcode=0),this.changesys===void 0&&(this.changesys=0),this.printsys===void 0&&(this.printsys=0),this.ndec===void 0&&(this.ndec=0),this.degout===void 0&&(this.degout=0),this.tabsys===void 0&&(this.tabsys=0),this.rotmat===void 0&&(this.rotmat=0),this.coorflip===void 0&&(this.coorflip=0),this.offscl===void 0&&(this.offscl=0),this.plate_fit===void 0&&(this.plate_fit=0),this.wcson===void 0&&(this.wcson=0),this.detector===void 0&&(this.detector=0),this.fCenterRa===void 0&&(this.fCenterRa=0),this.fCenterDec===void 0&&(this.fCenterDec=0),this.fHalfWidthRa===void 0&&(this.fHalfWidthRa=0),this.fHalfWidthDec===void 0&&(this.fHalfWidthDec=0),this.fWidthDeg===void 0&&(this.fWidthDeg=0),this.fHeightDeg===void 0&&(this.fHeightDeg=0),this.degPerPixel===void 0&&(this.degPerPixel=null),this.ppo_coeff=[0,0,0,0,0,0],this.amd_x_coeff=(P=>{let _=[];for(;P-- >0;)_.push(0);return _})(20),this.amd_y_coeff=(P=>{let _=[];for(;P-- >0;)_.push(0);return _})(20),this.instrument="",this.c1type="",this.c2type="",this.ctypes=["-SIN","-TAN","-ARC","-NCP","-GLS","-MER","-AIT","-STG"],this.ptype="",this.radecsys="",this.sysout="",this.center="";let p,x,y,m,C,v,D,T,$,K,V,S,E,w;if(this.plate_fit=0,this.nxpix=d.getDoubleValue$java_lang_String("NAXIS1"),this.nypix=d.getDoubleValue$java_lang_String("NAXIS2"),this.xmpix=.5*this.nxpix,this.ympix=.5*this.nypix,this.mrot=0,this.equinox=d.getDoubleValue$java_lang_String("EQUINOX"),d.findKey("PLTRAH")){this.plate_fit=1,y=d.getDoubleValue$java_lang_String("PLTRAH"),m=d.getDoubleValue$java_lang_String("PLTRAM"),C=d.getDoubleValue$java_lang_String("PLTRAS"),V=y+m/60+C/3600,this.plate_ra=W.hrrad(V),x="+";let P=d.getStringValue$java_lang_String("PLTDECSN");P!=null&&(x=P.charAt(0)),(_=>_.charCodeAt==null?_:_.charCodeAt(0))(x)=="-".charCodeAt(0)?v=-1:v=1,D=d.getDoubleValue$java_lang_String("PLTDECD"),T=d.getDoubleValue$java_lang_String("PLTDECM"),$=d.getDoubleValue$java_lang_String("PLTDECS"),K=v*(D+T/60+$/3600),this.plate_dec=W.degrad(K),w=this.equinox|0,w===1950?this.radecsys="FK4":this.radecsys="FK5",this.epoch=this.equinox,d.findKey("EPOCH")&&(this.epoch=d.getDoubleValue$java_lang_String("EPOCH")),this.plate_scale=d.getDoubleValue$java_lang_String("PLTSCALE"),this.x_pixel_size=d.getDoubleValue$java_lang_String("XPIXELSZ"),this.y_pixel_size=d.getDoubleValue$java_lang_String("YPIXELSZ"),this.x_pixel_offset=d.getDoubleValue$java_lang_String("CNPIX1"),this.y_pixel_offset=d.getDoubleValue$java_lang_String("CNPIX2"),this.ppo_coeff[0]=d.getDoubleValue$java_lang_String("PPO1"),this.ppo_coeff[1]=d.getDoubleValue$java_lang_String("PPO2"),this.ppo_coeff[2]=d.getDoubleValue$java_lang_String("PPO3"),this.ppo_coeff[3]=d.getDoubleValue$java_lang_String("PPO4"),this.ppo_coeff[4]=d.getDoubleValue$java_lang_String("PPO5"),this.ppo_coeff[5]=d.getDoubleValue$java_lang_String("PPO6"),this.amd_x_coeff[0]=d.getDoubleValue$java_lang_String("AMDX1"),this.amd_x_coeff[1]=d.getDoubleValue$java_lang_String("AMDX2"),this.amd_x_coeff[2]=d.getDoubleValue$java_lang_String("AMDX3"),this.amd_x_coeff[3]=d.getDoubleValue$java_lang_String("AMDX4"),this.amd_x_coeff[4]=d.getDoubleValue$java_lang_String("AMDX5"),this.amd_x_coeff[5]=d.getDoubleValue$java_lang_String("AMDX6"),this.amd_x_coeff[6]=d.getDoubleValue$java_lang_String("AMDX7"),this.amd_x_coeff[7]=d.getDoubleValue$java_lang_String("AMDX8"),this.amd_x_coeff[8]=d.getDoubleValue$java_lang_String("AMDX9"),this.amd_x_coeff[9]=d.getDoubleValue$java_lang_String("AMDX10"),this.amd_x_coeff[10]=d.getDoubleValue$java_lang_String("AMDX11"),this.amd_x_coeff[11]=d.getDoubleValue$java_lang_String("AMDX12"),this.amd_x_coeff[12]=d.getDoubleValue$java_lang_String("AMDX13"),this.amd_x_coeff[13]=d.getDoubleValue$java_lang_String("AMDX14"),this.amd_x_coeff[14]=d.getDoubleValue$java_lang_String("AMDX15"),this.amd_x_coeff[15]=d.getDoubleValue$java_lang_String("AMDX16"),this.amd_x_coeff[16]=d.getDoubleValue$java_lang_String("AMDX17"),this.amd_x_coeff[17]=d.getDoubleValue$java_lang_String("AMDX18"),this.amd_x_coeff[18]=d.getDoubleValue$java_lang_String("AMDX19"),this.amd_x_coeff[19]=d.getDoubleValue$java_lang_String("AMDX20"),this.amd_y_coeff[0]=d.getDoubleValue$java_lang_String("AMDY1"),this.amd_y_coeff[1]=d.getDoubleValue$java_lang_String("AMDY2"),this.amd_y_coeff[2]=d.getDoubleValue$java_lang_String("AMDY3"),this.amd_y_coeff[3]=d.getDoubleValue$java_lang_String("AMDY4"),this.amd_y_coeff[4]=d.getDoubleValue$java_lang_String("AMDY5"),this.amd_y_coeff[5]=d.getDoubleValue$java_lang_String("AMDY6"),this.amd_y_coeff[6]=d.getDoubleValue$java_lang_String("AMDY7"),this.amd_y_coeff[7]=d.getDoubleValue$java_lang_String("AMDY8"),this.amd_y_coeff[8]=d.getDoubleValue$java_lang_String("AMDY9"),this.amd_y_coeff[9]=d.getDoubleValue$java_lang_String("AMDY10"),this.amd_y_coeff[10]=d.getDoubleValue$java_lang_String("AMDY11"),this.amd_y_coeff[11]=d.getDoubleValue$java_lang_String("AMDY12"),this.amd_y_coeff[12]=d.getDoubleValue$java_lang_String("AMDY13"),this.amd_y_coeff[13]=d.getDoubleValue$java_lang_String("AMDY14"),this.amd_y_coeff[14]=d.getDoubleValue$java_lang_String("AMDY15"),this.amd_y_coeff[15]=d.getDoubleValue$java_lang_String("AMDY16"),this.amd_y_coeff[16]=d.getDoubleValue$java_lang_String("AMDY17"),this.amd_y_coeff[17]=d.getDoubleValue$java_lang_String("AMDY18"),this.amd_y_coeff[18]=d.getDoubleValue$java_lang_String("AMDY19"),this.amd_y_coeff[19]=d.getDoubleValue$java_lang_String("AMDY20"),this.wcson=1,this.c1type="RA-",this.c2type="DEC",this.ptype="PLATE",this.degout=0,this.ndec=3}else if((p=d.getStringValue$java_lang_String("CTYPE1"))!=null){let P=p.length;if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"LINEAR"))this.pcode=0,this.c1type=p,this.ptype=p;else if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"PIXEL"))this.pcode=-1,this.c1type=p,this.ptype=p;else if(P>1&&((_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="R".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="D".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0))){this.c1type=p.substring(0,2),P>2&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(2))!="-".charCodeAt(0)&&(this.c1type+=p.charAt(2)),P>3&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(3))!="-".charCodeAt(0)&&(this.c1type+=p.charAt(3)),P>4&&(this.ptype=p.substring(3,7)),this.pcode=0;for(let _=0;_<8;_++)if(((M,A,q=0)=>M.substr(q,A.length)===A)(this.ptype,this.ctypes[_])){this.pcode=_+1;break}}else throw console.error("WCSINIT: CTYPE1 not sky coordinates or LINEAR -> no WCS"),Object.defineProperty(new Error,"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if((p=d.getStringValue$java_lang_String("CTYPE2"))==null)throw console.error("WCSINIT: No CTYPE2 -> no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if(P=p.length,((_,M,A=0)=>_.substr(A,M.length)===M)(p,"LINEAR"))this.pcode=0,this.c2type=p;else if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"PIXEL"))this.pcode=-1,this.c2type=p;else if(P>1&&((_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="R".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="D".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0)))this.c2type=p.substring(0,2),P>2&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(2))!="-".charCodeAt(0)&&(this.c2type+=p.charAt(2)),P>3&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(3))!="-".charCodeAt(0)&&(this.c2type+=p.charAt(3)),((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"DEC")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"GLAT")?this.coorflip=1:this.coorflip=0,(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)?(this.degout=1,this.ndec=5):(this.degout=0,this.ndec=3);else throw console.error("WCSINIT: CTYPE2 not sky coordinates or LINEAR -> no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.xrefpix=d.getDoubleValue$java_lang_String$double("CRPIX1",1),this.yrefpix=d.getDoubleValue$java_lang_String$double("CRPIX2",1),this.xref=d.getDoubleValue$java_lang_String$double("CRVAL1",1),this.yref=d.getDoubleValue$java_lang_String$double("CRVAL2",1),(this.xinc=d.getDoubleValue$java_lang_String("CDELT1"))!==0?(this.yinc=d.getDoubleValue$java_lang_String$double("CDELT2",this.xinc),this.rot=d.getDoubleValue$java_lang_String$double("CROTA1",0),this.rot===0&&(this.rot=d.getDoubleValue$java_lang_String("CROTA2")),this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.rotmat=0):(this.cd11=d.getDoubleValue$java_lang_String("CD1_1"))!==0?(this.rotmat=1,this.cd12=d.getDoubleValue$java_lang_String$double("CD1_2",0),this.cd21=d.getDoubleValue$java_lang_String$double("CD2_1",0),this.cd22=d.getDoubleValue$java_lang_String$double("CD2_2",this.cd11),E=this.cd11*this.cd22-this.cd12*this.cd21,E!==0&&(this.dc11=this.cd22/E,this.dc12=-this.cd12/E,this.dc21=-this.cd21/E,this.dc22=this.cd11/E),this.xinc=Math.sqrt(this.cd11*this.cd11+this.cd21*this.cd21),this.yinc=Math.sqrt(this.cd12*this.cd12+this.cd22*this.cd22),this.cd11*this.cd11-this.cd12*this.cd12<0?((((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"RA")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"GLON"))&&(this.xinc=-this.xinc),(((_,M,A=0)=>_.substr(A,M.length)===M)(this.c2type,"RA")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c2type,"GLON"))&&(this.yinc=-this.yinc),this.rot=W.raddeg(Math.atan2(-this.cd12,this.cd22))):this.rot=W.raddeg(Math.atan2(this.cd12,this.cd22))):(this.xinc=1,this.yinc=1,console.error("WCSINIT: setting CDELT to 1")),this.xmpix=d.getDoubleValue$java_lang_String("CCPIX1"),this.ympix=d.getDoubleValue$java_lang_String("CCPIX2"),this.mrot=d.getDoubleValue$java_lang_String("CCROT1"),((_,M,A=0)=>_.substr(A,M.length)===M)(this.ptype,"LINEAR")&&((_,M,A=0)=>_.substr(A,M.length)===M)(this.ptype,"PIXEL")?this.degout=-1:this.wcseq(d),this.wcson=1}else if(d.findKey("SECPIX")||d.findKey("PIXSCAL1")||d.findKey("SECPIX1")){if(S=d.getDoubleValue$java_lang_String$double("SECPIX",0),S===0?(S=d.getDoubleValue$java_lang_String$double("SECPIX1",0),S!==0?(this.xinc=-S/3600,S=d.getDoubleValue$java_lang_String$double("SECPIX2",0),this.yinc=S/3600):(S=d.getDoubleValue$java_lang_String$double("PIXSCAL1",0),this.xinc=-S/3600,S=d.getDoubleValue$java_lang_String$double("PIXSCAL2",0),this.yinc=S/3600)):(this.yinc=S/3600,this.xinc=-this.yinc),this.xrefpix=d.getDoubleValue$java_lang_String$double("CRPIX1",this.nxpix*.5),this.yrefpix=d.getDoubleValue$java_lang_String$double("CRPIX2",this.nypix*.5),this.xref=0,(this.xref=d.getDoubleValue$java_lang_String$double("RA",0))===0)throw console.error("WCSINIT: No RA with SECPIX, no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if(this.yref=0,(this.yref=d.getDoubleValue$java_lang_String$double("DEC",0))===0)throw console.error("WCSINIT: No DEC with SECPIX, no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.c1type="RA--TAN",this.c2type="DEC-TAN",this.ptype="-TAN",this.pcode=1,this.coorflip=0,this.degout=0,this.ndec=3,this.rot=d.getDoubleValue$java_lang_String$double("CROTA1",0),this.rot===0&&(this.rot=d.getDoubleValue$java_lang_String$double("CROTA2",0)),this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.dc11=0,this.dc21=0,this.dc12=0,this.dc22=0,this.rotmat=0,this.xmpix=d.getDoubleValue$java_lang_String("CCPIX1"),this.ympix=d.getDoubleValue$java_lang_String("CCPIX2"),this.mrot=d.getDoubleValue$java_lang_String("CCROT1"),this.wcseq(d),(this.epoch=d.getDoubleValue$java_lang_String$double("DATE-OBS",0))===0&&(this.epoch=d.getDoubleValue$java_lang_String$double("EPOCH",0))===0&&(this.epoch=this.equinox),this.wcson=1}else throw Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.sysout=this.radecsys,this.changesys=0,this.printsys=1,this.tabsys=0,this.wcsfull()}else throw new Error("invalid overload")}getEquinox(){return this.equinox}getWCSCenter(){if(this.isValid())return new We.Point2D(this.fCenterRa,this.fCenterDec);throw Object.defineProperty(new Error("No WCS information."),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}getImageCenter(){return new We.Point2D(.5*this.nxpix,.5*this.nypix)}isWCS(){return this.isValid()}imageToWorldCoords(e,t){if(!!this.isValid())if(t)e.x=Math.abs(e.x*this.degPerPixel.x),e.y=Math.abs(e.y*this.degPerPixel.y);else{let i=this.pix2wcs(e.x,e.y);if(i!=null)e.setLocation(i.x,i.y);else throw Object.defineProperty(new Error("Image coordinates out of WCS range: "+e),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}}worldToImageCoords(e,t){if(!!this.isValid())if(t)e.x=Math.abs(e.x/this.degPerPixel.x),e.y=Math.abs(e.y/this.degPerPixel.y);else{let i=this.wcs2pix(e.x,e.y);if(i!=null)e.setLocation(i.x,i.y);else throw Object.defineProperty(new Error("World coordinates out of range: "+e),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}}getWidthInDeg(){return this.fWidthDeg}getHeightInDeg(){return this.fHeightDeg}getWidth(){return this.nxpix}getHeight(){return this.nypix}wcseq(e){let t=0,i;e.findKey("EQUINOX")?(this.equinox=e.getDoubleValue$java_lang_String("EQUINOX"),t=2e3):e.findKey("EPOCH")?(t=e.getDoubleValue$java_lang_String$double("EPOCH",0)|0,t===0?(t=1950,this.equinox=1950):this.equinox=e.getDoubleValue$java_lang_String("EPOCH")):e.findKey("RADECSYS")&&(i=e.getStringValue$java_lang_String("RADECSYS"),((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK4")?(this.equinox=1950,t=1950):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK5")?(this.equinox=2e3,t=2e3):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"GAL")?(this.equinox=2e3,t=2e3):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"ECL")&&(this.equinox=2e3,t=2e3)),t===0&&(this.equinox=2e3,t=2e3),(this.epoch=e.getDoubleValue$java_lang_String$double("DATE-OBS",0))===0&&(this.epoch=e.getDoubleValue$java_lang_String$double("EPOCH",0))===0&&(this.epoch=this.equinox),this.epoch===0&&(this.epoch=this.equinox),e.findKey("RADECSYS")?((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK4")?this.equinox=1950:((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK5")?this.equinox=2e3:((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"GAL")&&t===0&&(this.equinox=2e3):(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="G".charCodeAt(0)?this.radecsys="GALACTIC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="E".charCodeAt(0)?this.radecsys="ECLIPTIC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="S".charCodeAt(0)?this.radecsys="SGALACTC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="H".charCodeAt(0)?this.radecsys="HELIOECL":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="A".charCodeAt(0)?this.radecsys="ALTAZ":t>1980?this.radecsys="FK5":this.radecsys="FK4"}isValid(){return this.wcson>0}wcsshift(e,t,i){!this.isValid()||(this.fCenterRa=this.xref=e,this.fCenterDec=this.yref=t,this.radecsys=i,((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK4")?this.equinox=1950:this.equinox=2e3)}wcssize(){let e,t,i,n;if(this.isValid()){e=.5*this.nxpix,t=.5*this.nypix;let r=this.pix2wcs(e,t);if(r==null)return;this.fCenterRa=r.x,this.fCenterDec=r.y;let s=this.pix2wcs(1,t),a=this.pix2wcs(this.nxpix,t);if(s==null||a==null||(!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"LINEAR")&&!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"PIXEL")?(i=this.wcsdist(s.x,s.y,a.x,a.y),this.fHalfWidthRa=i*.5/Math.cos(W.degrad(this.fCenterDec))):this.fHalfWidthRa=Math.sqrt((a.y-s.y)*(a.y-s.y)+(a.x-s.x)*(a.x-s.x)),s=this.pix2wcs(e,1),a=this.pix2wcs(e,this.nypix),s==null||a==null))return;!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"LINEAR")&&!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"PIXEL")?(n=this.wcsdist(s.x,s.y,a.x,a.y),this.fHalfWidthDec=n*.5):this.fHalfWidthDec=Math.sqrt((a.y-s.y)*(a.y-s.y)+(a.x-s.x)*(a.x-s.x))}}wcsfull(){let e,t;if(this.isValid()){e=.5*this.nxpix,t=.5*this.nypix;let i=this.pix2wcs(e,t);if(i==null)return;this.fCenterRa=i.x,this.fCenterDec=i.y;let n=this.pix2wcs(0,t),r=this.pix2wcs(this.nxpix,t);if(n==null||r==null||(!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"LINEAR")&&!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"PIXEL")?this.fWidthDeg=this.wcsdist(n.x,n.y,r.x,r.y):this.fWidthDeg=Math.sqrt((r.y-n.y)*(r.y-n.y)+(r.x-n.x)*(r.x-n.x)),n=this.pix2wcs(e,0),r=this.pix2wcs(e,this.nypix),n==null||r==null))return;!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"LINEAR")&&!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"PIXEL")?this.fHeightDeg=this.wcsdist(n.x,n.y,r.x,r.y):this.fHeightDeg=Math.sqrt((r.y-n.y)*(r.y-n.y)+(r.x-n.x)*(r.x-n.x)),this.degPerPixel=new We.Point2D(this.fWidthDeg/this.nxpix,this.fHeightDeg/this.nypix)}}wcsdist(e,t,i,n){let r,s,a,f,o=[0,0,0],u=[0,0,0],c,h,g,d;for(r=W.degrad(e),a=W.degrad(t),g=Math.cos(a),o[0]=Math.cos(r)*g,o[1]=Math.sin(r)*g,o[2]=Math.sin(a),s=W.degrad(i),f=W.degrad(n),g=Math.cos(f),u[0]=Math.cos(s)*g,u[1]=Math.sin(s)*g,u[2]=Math.sin(f),c=0,d=0;d<3;d++)c=c+(o[d]-u[d])*(o[d]-u[d]);return c=c/4,c>1&&(c=1),h=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),h=W.raddeg(h),h}pix2wcs(e,t){let i;return this.isValid()?(this.xpix=e,this.ypix=t,this.offscl=0,this.plate_fit>0?(i=Vt.platepos.getPosition(e,t,this))==null&&(this.offscl=1):(i=It.worldpos.getPosition(e,t,this))==null&&(this.offscl=1),this.pcode>0&&(((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK4")?this.equinox!==1950&&(i=se.wcscon.fk4prec(this.equinox,1950,i)):((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK5")&&this.equinox!==2e3&&(i=se.wcscon.fk5prec(this.equinox,2e3,i)),this.changesys===1?i=se.wcscon.fk425e(i,this.epoch):this.changesys===2?i=se.wcscon.fk524e(i,this.epoch):this.changesys===3?i=se.wcscon.fk42gal(i):this.changesys===4&&(i=se.wcscon.fk52gal(i))),this.offscl===0&&i!=null&&(this.xpos=i.x,this.ypos=i.y),i):null}wcs2pix(e,t){let i;if(!this.isValid())return null;this.xpos=e,this.ypos=t;let n=new We.Point2D(e,t);return this.changesys===1?n=se.wcscon.fk524e(n,this.epoch):this.changesys===2&&(n=se.wcscon.fk425e(n,this.epoch)),((r,s,a=0)=>r.substr(a,s.length)===s)(this.radecsys,"FK4")?this.equinox!==1950&&(n=se.wcscon.fk4prec(1950,this.equinox,n)):((r,s,a=0)=>r.substr(a,s.length)===s)(this.radecsys,"FK5")&&this.equinox!==2e3&&(n=se.wcscon.fk5prec(2e3,this.equinox,n)),this.plate_fit>0?(i=Vt.platepos.getPixels(n.x,n.y,this))==null&&(this.offscl=1):(i=It.worldpos.getPixels(n.x,n.y,this))==null&&(this.offscl=1),i!=null&&(this.xpix=i.x,this.ypix=i.y),i}};Ne.WCSTransform=W;W.NO_WCS_IN_HEADER_MESSAGE="The header does not contain a valid world coordinate system.";W.__class="coordtxl.coords.WCSTransform";W.__interfaces=["coordtxl.coords.WorldCoordinateConverter"];var se=jt(),It=$t(),Vt=Tt()});var wt=Z(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.Trigod=void 0;var H=class{static DEG_$LI$(){return H.DEG==null&&(H.DEG=180/Math.PI),H.DEG}static fractionalPart(e){return Math.abs(e-(e|0))}static cosd(e){let t=0,i=H.fractionalPart(e/360);return i>.5&&(i=1-i),i>.25&&(i=.5-i,t=1),i>.125?i=Math.sin(Math.PI*2*(.25-i)):i=Math.cos(Math.PI*2*i),t!==0&&(i=-i),i}static sind(e){let t=H.fractionalPart(e/360),i=e>=0?0:1;return t>.5&&(t=1-t,i^=1),t>.25&&(t=.5-t),t>.125?t=Math.cos(Math.PI*2*(.25-t)):t=Math.sin(Math.PI*2*t),i!==0&&(t=-t),t}static tand(e){let t=H.fractionalPart(e/180);return t===.5?t=H.DOUBLE_MAX:t=Math.tan(Math.PI*t),e>0?t:-t}static atand(e){return H.DEG_$LI$()*Math.atan(e)}static atan2d(e,t){return H.DEG_$LI$()*Math.atan2(e,t)}static acosd(e){return H.DEG_$LI$()*Math.acos(e)}asind(e){return H.DEG_$LI$()*Math.asin(e)}};qe.Trigod=H;H.DOUBLE_MAX=17e37;H.__class="coordtxl.coords.Trigod"});var Ot=Z(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.Cotr=void 0;var ne=class{static tr_Euler(e,t){let s;t[0][2]=U.Trigod.cosd(e[0]),t[1][2]=U.Trigod.sind(e[0]),t[2][0]=U.Trigod.cosd(e[2]),t[2][1]=U.Trigod.sind(e[2]),t[2][2]=U.Trigod.cosd(e[1]),s=U.Trigod.sind(e[1]),t[0][0]=t[2][0]*t[2][2]*t[0][2]-t[2][1]*t[1][2],t[1][0]=t[2][0]*t[2][2]*t[1][2]+t[2][1]*t[0][2],t[0][1]=-t[2][1]*t[2][2]*t[0][2]-t[2][0]*t[1][2],t[1][1]=-t[2][1]*t[2][2]*t[1][2]+t[2][0]*t[0][2],t[2][0]=t[2][0]*s,t[2][1]=-t[2][1]*s,t[0][2]=-s*t[0][2],t[1][2]=-s*t[1][2]}static tr_oo(e,t,i){let n=[0,0,0];ne.tr_ou(e,n),ne.tr_uu(n,n,i),ne.tr_uo(n,t)}static tr_oo1(e,t,i){let n=[0,0,0];ne.tr_ou(e,n),ne.tr_uu1(n,n,i),ne.tr_uo(n,t)}static tr_oR(e,t){let i=e[0],n=e[1];t[2][2]=U.Trigod.cosd(n),t[0][2]=U.Trigod.sind(n),t[1][1]=U.Trigod.cosd(i),t[1][0]=-U.Trigod.sind(i),t[1][2]=0,t[0][0]=t[2][2]*t[1][1],t[0][1]=-t[2][2]*t[1][0],t[2][0]=-t[0][2]*t[1][1],t[2][1]=t[0][2]*t[1][0]}static tr_ou(e,t){let i=e[0],n=e[1],r=U.Trigod.cosd(n);t[0]=r*U.Trigod.cosd(i),t[1]=r*U.Trigod.sind(i),t[2]=U.Trigod.sind(n)}static tr_uo(e,t){let i=e[0],n=e[1],r=e[2],s=i*i+n*n;if(t[0]=0,s===0){if(r===0)return;t[1]=r>0?90:-90;return}t[1]=U.Trigod.atand(r/Math.sqrt(s)),t[0]=U.Trigod.atan2d(n,i),t[0]<0&&(t[0]+=360)}static tr_uR(e,t){let i=e[0],n=e[1],r=e[2];t[0][0]=i,t[0][1]=n,t[0][2]=r,t[2][2]=Math.sqrt(i*i+n*n),t[1][0]=0,t[1][1]=1,t[1][2]=0,t[2][2]!==0&&(t[1][1]=i/t[2][2],t[1][0]=-n/t[2][2]),t[2][0]=-t[0][2]*t[1][1],t[2][1]=t[0][2]*t[1][0]}static tr_uu(e,t,i){let n,r,s,a=[0,0,0];for(n=0;n<3;n++){for(s=0,r=0;r<3;r++)s+=i[n][r]*e[r];a[n]=s}for(n=0;n<3;n++)t[n]=a[n]}static tr_uu1(e,t,i){let n,r,s,a=[0,0,0];for(n=0;n<3;n++){for(r=0,s=0;r<3;r++)s+=i[r][n]*e[r];a[n]=s}for(n=0;n<3;n++)t[n]=a[n]}static tr_RR(e,t,i){let n,r,s,a,f=function(o){let u=function(c){if(c.length===0)return 0;{let h=[];for(let g=0;g<c[0];g++)h.push(u(c.slice(1)));return h}};return u(o)}([3,3]);for(n=0;n<3;n++)for(r=0;r<3;r++){for(s=0,a=0;s<3;s++)a+=i[n][s]*e[s][r];f[n][r]=a}for(n=0;n<3;n++)for(r=0;r<3;r++)t[n][r]=f[n][r]}static tr_RR1(e,t,i){let n,r,s,a,f=function(o){let u=function(c){if(c.length===0)return 0;{let h=[];for(let g=0;g<c[0];g++)h.push(u(c.slice(1)));return h}};return u(o)}([3,3]);for(n=0;n<3;n++)for(r=0;r<3;r++){for(s=0,a=0;s<3;s++)a+=i[s][n]*e[s][r];f[n][r]=a}for(n=0;n<3;n++)for(r=0;r<3;r++)t[n][r]=f[n][r]}};ke.Cotr=ne;ne.__class="coordtxl.coords.Cotr";var U=wt()});var Lt=Z(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.JPrec=void 0;var ce=class{static prej_R(e,t,i){let n,r,s,a=[0,0,0],f=0,o=1,u=2;n=(t-2e3)/100,r=(i-t)/100,s=2306.2181+(1.39656-139e-6*n)*n,a[u]=(s+(.30188-344e-6*n+.017998*r)*r)*r/3600,a[f]=(s+(1.09468+66e-6*n+.018203*r)*r)*r/3600,a[o]=(2004.3109+(-.8533-217e-6*n)*n+(-.42665-217e-6*n-.041833*r)*r)*r/3600,ze.Cotr.tr_Euler(a,e)}static prej_q(e,t,i,n){let r=[0,0,0];if(i===n){t[0]=e[0],t[1]=e[1];return}ze.Cotr.tr_ou(e,r),ce.prej_u(r,r,i,n),ze.Cotr.tr_uo(r,t)}static prej_u(e,t,i,n){let r=[[1,0,0],[0,1,0],[0,0,1]];if(i===n){t[0]=e[0],t[1]=e[1],t[2]=e[2];return}ce.prej_R(r,i,n),ze.Cotr.tr_uu(e,t,r)}};Xe.JPrec=ce;ce.__class="coordtxl.coords.JPrec";var ze=Ot()});var it=Z(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.StringUtil=void 0;var me=class{static replace(e,t,i){return e.split(t).join(i)}static split(e,t){let i=e.indexOf(String.fromCharCode(t));if(i>0){let n;return n=[null,null],n[0]=e.substring(0,i),n[1]=e.substring(i+1),n}return null}static combine(e,t){if(e==null)return"";let i={str:"",toString:function(){return this.str}};for(let n=0;n<e.length;n++)(r=>(r.str+=e[n],r))(i),n+1<e.length&&(r=>(r.str+=t,r))(i);return i.str}static equals(e,t){return e==null&&t==null||!(e==null||t==null)&&e===t}static match(e,t){let i=t.length,n=e.length;for(let r=0;;r++){for(let s=0;;r++,s++){let a=s>=i,f=r>=n||(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="|".charCodeAt(0);if(a&&!f&&(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="*".charCodeAt(0)&&(r===n-1||r<n-1&&(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r+1))=="|".charCodeAt(0))||a&&f)return!0;if(a||f)break;if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="?".charCodeAt(0))continue;if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="*".charCodeAt(0)||(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="%".charCodeAt(0)){r++;for(let o=i;o>=s;--o)if(me.match(e.substring(r),t.substring(o)))return!0;break}if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r).toUpperCase())!=(o=>o.charCodeAt==null?o:o.charCodeAt(0))(t.charAt(s).toUpperCase()))break}if(r=e.indexOf("|",r),r===-1)return!1}}static pad(e,t,i){let n={str:"",toString:function(){return this.str}};if(i){(s=>(s.str+=e,s))(n);let r=e.length;for(;r++<t;)(s=>(s.str+=" ",s))(n)}else{let r=e.length;for(;r++<t;)(s=>(s.str+=" ",s))(n);(s=>(s.str+=e,s))(n)}return n.str}static arrayContains(e,t){for(let i=0;i<e.length;i++){let n=e[i];if(t===n)return!0}return!1}static capitalize(e){if(e==null||e.length===0)return e;let t={str:"",toString:function(){return this.str}},i=e.split("[\\s]+");for(let n=0;n<i.length;n++){let r=i[n];{let s=r.trim();s.length!==0&&((a=>(a.str+=s.substring(1).toLowerCase(),a))((a=>(a.str+=s.substring(0,1).toUpperCase(),a))(t)),(a=>(a.str+=" ",a))(t))}}return t.str.trim()}};Re.StringUtil=me;me.__class="coordtxl.util.StringUtil"});var Kt=Z(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.DMS=void 0;var ci=it(),J=class{static fmt_deg_min(e){let t=Math.round(e),i=(""+t).split(".").join("@").split("@");if(i.length<1)return"00";let n="";for(let r=i[0].length;r<2;++r)n+="0";for(let r=i[0].length>2?i[0].length-2:0;r<i[0].length;++r)n+=i[0].charAt(r);return n}static fmt_sec(e){let t=Math.round(e*100)/100,i=(""+t).split(".").join("@").split("@");if(i.length===0)return"00.00";if(i.length<2)return i[0]+".00";let n="";for(let s=i[0].length;s<2;++s)n+="0";for(let s=i[0].length>2?i[0].length-2:0;s<i[0].length;++s)n+=i[0].charAt(s);n+=".";let r=0;for(;r<2&&r<i[1].length;++r)n+=i[1].charAt(r);for(;r<2;++r)n+="0";return n}constructor(e,t,i){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)){let n=arguments;this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.set(e,t,i)}else if((e!=null&&e instanceof J||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r.val)}else if((typeof e=="string"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=ci.StringUtil.replace(r,",",".");let s=[0,0,0],a=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),f=0;for(;f<3&&f<a.length;)s[f]=parseFloat(a[f]),f+=1;if(f>=2)this.set(s[0],s[1]|0,s[2]);else if(f===1)this.setVal(s[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}else if((typeof e=="number"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r)}else if(e===void 0&&t===void 0&&i===void 0){let n=arguments;this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else throw new Error("invalid overload")}set(e,t,i){this.degrees=e|0,this.min=t,this.sec=i,this.val=(i/60+t)/60,e<0||e===J.MINUS_ZERO?(this.val=e-this.val,this.degrees=-this.degrees,this.sign=-1):(this.val=this.degrees+this.val,this.sign=1),this.initialized=!0}setVal(e){this.val=e;let t=e;t<0||t===J.MINUS_ZERO?(this.sign=-1,t=-t):this.sign=1;let i=t+1e-10;this.degrees=i|0;let n=(i-this.degrees)*60;this.min=n|0,this.sec=(n-this.min)*60,this.initialized=!0}toString$(){let e=J.fmt_sec(this.sec),t;return this.sign===-1?t="-":t="+",t+J.fmt_deg_min(this.degrees)+":"+J.fmt_deg_min(this.min)+":"+e}toString$boolean(e){if(e)return this.toString$();let t;return this.sign===-1?t="-":t="+",t+J.fmt_deg_min(this.degrees)+":"+J.fmt_deg_min(this.min)}toString(e){if(typeof e=="boolean"||e===null)return this.toString$boolean(e);if(e===void 0)return this.toString$();throw new Error("invalid overload")}isInitialized(){return this.initialized}getDegrees(){return this.degrees}getMin(){return this.min}getSec(){return this.sec}getVal(){return this.val}getSign(){return this.sign}equals(e){return e!=null&&e instanceof J&&this.val===e.val}};He.DMS=J;J.MINUS_ZERO=-0;J.__class="coordtxl.coords.DMS"});var Nt=Z(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.HMS=void 0;var Wt=it(),Q=class{static fmt_hr_min(e){let t=Math.round(e),i=(""+t).split(".").join("@").split("@");if(i.length<1)return"00";let n="";for(let r=i[0].length;r<2;++r)n+="0";for(let r=i[0].length>2?i[0].length-2:0;r<i[0].length;++r)n+=i[0].charAt(r);return n}static fmt_sec(e){let t=Math.round(e*1e3)/1e3,i=(""+t).split(".").join("@").split("@");if(i.length===0)return"00.000";if(i.length<2)return i[0]+".000";let n="";for(let s=i[0].length;s<2;++s)n+="0";for(let s=i[0].length>2?i[0].length-2:0;s<i[0].length;++s)n+=i[0].charAt(s);n+=".";let r=0;for(;r<3&&r<i[1].length;++r)n+=i[1].charAt(r);for(;r<3;++r)n+="0";return n}constructor(e,t,i){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)){let n=arguments;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.set(e,t,i)}else if((typeof e=="string"||e===null)&&(typeof t=="boolean"||t===null)&&i===void 0){let n=arguments,r=n[0],s=n[1];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=Wt.StringUtil.replace(r,",",".");let a=[0,0,0],f=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),o=0;for(;o<3&&o<f.length;)a[o]=parseFloat(f[o]),o+=1;if(o>=2)this.set(a[0],a[1]|0,a[2]);else if(o===1)!s&&r.indexOf(".")!==-1?this.setVal(a[0]/15):this.setVal(a[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}else if((e!=null&&e instanceof Q||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r.val)}else if((typeof e=="string"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];{let s=arguments,a=!1;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=Wt.StringUtil.replace(r,",",".");let f=[0,0,0],o=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),u=0;for(;u<3&&u<o.length;)f[u]=parseFloat(o[u]),u+=1;if(u>=2)this.set(f[0],f[1]|0,f[2]);else if(u===1)!a&&r.indexOf(".")!==-1?this.setVal(f[0]/15):this.setVal(f[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else if((typeof e=="number"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r)}else if(e===void 0&&t===void 0&&i===void 0){let n=arguments;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else throw new Error("invalid overload")}set(e,t,i){this.hours=e|0,this.min=t,this.sec=i,this.val=(i/60+t)/60,e<0||e===Q.MINUS_ZERO?(this.val=e-this.val,this.hours=-this.hours,this.sign=-1):(this.val=this.hours+this.val,this.sign=1),this.initialized=!0}setVal(e){this.val=e;let t=e;t<0||t===Q.MINUS_ZERO?(this.sign=-1,t=-t):this.sign=1;let i=t+1e-10;this.hours=i|0;let n=(i-this.hours)*60;this.min=n|0,this.sec=(n-this.min)*60,this.initialized=!0}toString$(){let e=Q.fmt_sec(this.sec),t;return this.sign===-1?t="-":t="",t+Q.fmt_hr_min(this.hours)+":"+Q.fmt_hr_min(this.min)+":"+e}toString$boolean(e){if(e)return this.toString$();let t;return this.sign===-1?t="-":t=" ",t+Q.fmt_hr_min(this.hours)+":"+Q.fmt_hr_min(this.min)}toString(e){if(typeof e=="boolean"||e===null)return this.toString$boolean(e);if(e===void 0)return this.toString$();throw new Error("invalid overload")}isInitialized(){return this.initialized}getHours(){return this.hours}getMin(){return this.min}getSec(){return this.sec}getVal(){return this.val}getSign(){return this.sign}equals(e){return e!=null&&e instanceof Q&&this.val===e.val}};Ye.HMS=Q;Q.MINUS_ZERO=-0;Q.__class="coordtxl.coords.HMS"});var kt=Z(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.WorldCoords=void 0;var qt=ue(),Y=class{constructor(e,t,i,n,r,s,a){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&(typeof a=="number"||a===null)){let f=arguments;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(e,t,i),this.dec=new G.DMS(n,r,s),this.init(a)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&a===void 0){let f=arguments;{let o=arguments,u=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(e,t,i),this.dec=new G.DMS(n,r,s),this.init(u)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="boolean"||n===null)&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2],h=f[3];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o,h),this.dec=new G.DMS(u),this.init(c)}else if((e!=null&&e instanceof B.HMS||e===null)&&(t!=null&&t instanceof G.DMS||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=o,this.dec=u,this.init(c)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(c)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o),this.dec=new G.DMS(u),this.init(c)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="boolean"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];{let h=arguments,g=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o,c),this.dec=new G.DMS(u),this.init(g)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(c)}else if((e!=null&&e instanceof B.HMS||e===null)&&(t!=null&&t instanceof G.DMS||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=o,this.dec=u,this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=c[0],g=c[1],d=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(h/15),this.dec=new G.DMS(g),this.init(d)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o),this.dec=new G.DMS(u),this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((e!=null&&e instanceof qt.Point2D||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=o.getX(),g=o.getY();this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(h/15),this.dec=new G.DMS(g),this.init(u)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((e!=null&&e instanceof qt.Point2D||e===null)&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let o=arguments[0];{let u=arguments,c=o.getX(),h=o.getY(),g=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(c/15),this.dec=new G.DMS(h),this.init(g)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if(e===void 0&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS,this.dec=new G.DMS}else throw new Error("invalid overload")}getRA(){return this.ra}getDec(){return this.dec}getRaDeg(){return this.ra.getVal()*15}getDecDeg(){return this.dec.getVal()}getX(){return this.ra.getVal()*15}getY(){return this.dec.getVal()}toString(){return this.ra.toString$()+", "+this.dec.toString$()+" J2000"}format$double(e){let t=[null,null];if(e===2e3)t[0]=this.ra.toString$(),t[1]=this.dec.toString$();else{let i=new Y(this.ra,this.dec);i.convertEquinox(2e3,e),t[0]=i.ra.toString$(),t[1]=i.dec.toString$()}return t}format(e){if(typeof e=="number"||e===null)return this.format$double(e);if(e===void 0)return this.format$();throw new Error("invalid overload")}format$(){return this.format$double(2e3)}getRaDec(e){let t=[0,0];if(e===2e3)t[0]=this.getRaDeg(),t[1]=this.getDecDeg();else{let i=new Y(this.ra,this.dec);i.convertEquinox(2e3,e),t[0]=i.getRaDeg(),t[1]=i.getDecDeg()}return t}static dispos(e,t,i,n){let r=[0,0],s,a,f,o,u,c,h,g,d,p,x,y,m,C,v=180/Math.PI;s=i/v,a=e/v,f=n/v,o=t/v,h=Math.sin(o),c=Math.sin(f),d=Math.cos(o),g=Math.cos(f),p=Math.cos(s-a),x=h*c+d*g*p;let D=Math.acos(x);return u=0,D>4e-7&&(y=Math.sin(D),C=(c*d-g*h*p)/y,Math.abs(C)>1&&(C=C/Math.abs(C)),m=g*Math.sin(s-a)/y,u=Math.acos(C)*v,m<0&&(u=360-u)),D*=v,D*=60,t===90&&(u=180),t===-90&&(u=0),r[0]=D,r[1]=u,r}dispos(e){return Y.dispos(this.getRaDeg(),this.getDecDeg(),e.getRaDeg(),e.getDecDeg())}static wcsdist(e,t,i,n){let r,s,a,f,o,u,c,h=[0,0,0],g=[0,0,0],d,p=Math.PI/180;for(r=e*p,a=t*p,c=Math.cos(a),h[0]=Math.cos(r)*c,h[1]=Math.sin(r)*c,h[2]=Math.sin(a),s=i*p,f=n*p,c=Math.cos(f),g[0]=Math.cos(s)*c,g[1]=Math.sin(s)*c,g[2]=Math.sin(f),o=0,d=0;d<3;d++)o=o+(h[d]-g[d])*(h[d]-g[d]);return o=o/4,o>1&&(o=1),u=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)),u*180/Math.PI}dist$coordtxl_coords_WorldCoords(e){return Y.dispos(this.getRaDeg(),this.getDecDeg(),e.getRaDeg(),e.getDecDeg())[0]}dist(e){if(e!=null&&e instanceof Y||e===null)return this.dist$coordtxl_coords_WorldCoords(e);if(e!=null&&e.constructor!=null&&e.constructor.__interfaces!=null&&e.constructor.__interfaces.indexOf("coordtxl.coords.Coordinates")>=0||e===null)return this.dist$coordtxl_coords_Coordinates(e);throw new Error("invalid overload")}dist$coordtxl_coords_Coordinates(e){return this.dist$coordtxl_coords_WorldCoords(e)}static dist(e,t,i,n){return Y.dispos(e,t,i,n)[0]}box(e){let t=[null,null],i=this.ra.getVal(),n=this.dec.getVal();e/=60;let r=Math.sqrt(2*e*e),s,a,f,o,u;return f=n-r/2,f<=-90?(f=-90,o=n+r/2,s=0,a=24):(o=n+r/2,o>=90?(f=n-r/2,o=90,s=0,a=24):(n>0?u=Math.abs(Math.cos(f*Math.PI/180)):u=Math.abs(Math.cos(o*Math.PI/180)),s=i-r/15/2/u,a=i+r/15/2/u,s<0&&(s+=24),a>24&&(a-=24))),t[0]=new Y(s*15,f),t[1]=new Y(a*15,o),t}center(e,t){let i=[0,0,0,0,0],n=e.getRaDeg(),r=e.getDecDeg(),s=t.getRaDeg(),a=t.getDecDeg();return i[0]=(n+s)/2,i[1]=(r+a)/2,i[2]=Y.wcsdist(n,r,s,r)*60,i[3]=Y.wcsdist(n,r,n,a)*60,i[4]=Y.wcsdist(n,r,s,a)*60/2,i}getCoordinateSystemName(){return"wcs"}init(e){this.checkRange(),this.convertEquinox(e,2e3)}convertEquinox(e,t){if(e===t)return;let i=[0,0],n=[0,0];i[0]=this.ra.getVal()*15,i[1]=this.dec.getVal(),gi.JPrec.prej_q(i,n,e,t),this.ra=new B.HMS(n[0]/15),this.dec=new G.DMS(n[1])}checkRange(){let e=this.ra.getVal(),t=this.dec.getVal();e<-.001||e>=25,t<-90||t>90}};Fe.WorldCoords=Y;Y.__class="coordtxl.coords.WorldCoords";Y.__interfaces=["coordtxl.coords.WorldCoordinates","coordtxl.coords.Coordinates"];var gi=Lt(),G=Kt(),B=Nt()});var zt=Z(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.WorldCoords=ae.WCSTransform=ae.MapKeywordProvider=ae.Point2D=void 0;var pi=ue();Object.defineProperty(ae,"Point2D",{enumerable:!0,get:function(){return pi.Point2D}});var _i=At();Object.defineProperty(ae,"MapKeywordProvider",{enumerable:!0,get:function(){return _i.MapKeywordProvider}});var mi=we();Object.defineProperty(ae,"WCSTransform",{enumerable:!0,get:function(){return mi.WCSTransform}});var yi=kt();Object.defineProperty(ae,"WorldCoords",{enumerable:!0,get:function(){return yi.WorldCoords}})});function _t(l){if(typeof l._casagui_id_=="undefined"){let e=null;if(typeof window=="undefined"){if(typeof crypto!="undefined"){let n=crypto.randomBytes(8);e=new Uint32Array(n.buffer.slice(-4))}}else e=new Uint32Array(1),window.crypto.getRandomValues(e);let t=new Date,i=Math.floor(t.getTime()/1e3);l._casagui_id_=`${e?e[0]:i}-${i}`}return l._casagui_id_}function mt(l,e){if(Array.isArray(e))e.map(l);else if(typeof e=="object"&&e!==null)Object.entries(e).map(t=>l(t[0],t[1]));else throw new Error(`casalib.map applied to ${typeof e}`)}function yt(l,e,t){if(Array.isArray(e))return e.reduce(l,t);if(e instanceof Set)return[...e].reduce(l,t);if(typeof e=="object"&&e!==null)return Object.entries(e).reduce((i,n,r)=>l(i,n[0],n[1],r),t);throw new Error(`casalib.reduce applied to ${typeof e}`)}function xt(l,e){let t=null,i=function(){t!==null&&clearTimeout(t),t=window.setTimeout(()=>{l(),t=null},e)};return i.cancel=function(){t!==null&&(clearTimeout(t),t=null)},i}function et(l){return Array.isArray(l)&&(l.length==0||l.every(et))}function bt(l){if(l.length<1)return[NaN,NaN];let e,t;e=t=l[0];for(let i=l.length-1;i>0;--i)l[i]<e&&(e=l[i]),l[i]>t&&(t=l[i]);return[e,t]}function Ee(l){if(l instanceof Set)return Array.from(l).sort((e,t)=>e-t);if(Array.isArray(l))return l.slice().sort((e,t)=>e-t);throw new Error(`unexpected parameter type (${typeof l})`)}function Mt(l,e=!1){let t=[],i=l.split(",");for(let n of i){let[r,s]=n.trim().split(":"),a=parseInt(r,10),f=s?parseInt(s,10):a;if(isNaN(a)||isNaN(f))throw new Error(`Invalid range: ${n}`);if(a>f)if(e)t.push([f,a]);else throw new Error(`Invalid range: ${n}`);else t.push([a,f])}return t}function vt(l){return Ee(l).reduce((t,i)=>t[0][0]==null?[[i,i]]:i>t[0][1]+1?[[i,i],...t]:[[t[0][0],i],...t.slice(1)],[[null,-1]]).reverse().map(t=>t[0]==t[1]?`${t[0]}`:`${t[0]}:${t[1]}`).join(", ")}function St(l,e,t,i){let n=i;for(let r=l;r<=e;r++)n=t(n,r,r-l);return n}function Ct(){this.timeout=1e3,this.retries=20,this.connected=!0,this.backoff=()=>{this.connected=!1,this.timeout+=Math.floor(pt(1.8,22-this.retries)),this.retries-=1}}function je(...l){let e=Math.max(...l.map(i=>i.length)),t=[];for(let i=0;i<e;i++){let n=l.map(r=>r[i]);t.push(n)}return t}function Dt(l){return l.length<=0?l:l.reduce((e,t)=>e.map((i,n)=>[...i,t[n]]),l[0].map(e=>[]))}var he=class{constructor(){this.forwardMap=new Map,this.inverseMap=new Map}set(e,t){this.forwardMap.set(e,t),this.inverseMap.set(t,e)}get(e){return this.forwardMap.get(e)}getKey(e){return this.inverseMap.get(e)}delete(e){let t=this.forwardMap.get(e);if(t!==void 0)return this.forwardMap.delete(e),this.inverseMap.delete(t),t}deleteValue(e){let t=this.inverseMap.get(e);if(t!==void 0)return this.inverseMap.delete(e),this.forwardMap.delete(t),t}has(e){return this.forwardMap.has(e)}hasValue(e){return this.inverseMap.has(e)}clear(){this.forwardMap.clear(),this.inverseMap.clear()}get size(){return this.forwardMap.size}*entries(){return this.forwardMap.entries()}map(e){let t=[];for(let[i,n]of this.entries())t.push(e(n,i,this));return t}};var ye=class extends he{constructor(t){super();this.keyset=t;this.usedKeys=new Set,this.availKeys=new Set(t)}clear(){super.clear(),this.usedKeys=new Set,this.availKeys=new Set(this.keyset)}add(t){if(this.availKeys.size!==0)for(let i of this.availKeys)return this.availKeys.delete(i),this.usedKeys.add(i),super.set(i,t),i}get bound(){return new Set(this.keyset)}set(t,i){if(!this.keyset.has(t))throw new Error(`${t} is not a valid key`);this.availKeys.has(t)&&this.availKeys.delete(t),this.usedKeys.has(t)||this.usedKeys.add(t),super.set(t,i)}delete(t){return t&&(this.usedKeys.delete(t),this.availKeys.add(t)),super.delete(t)}deleteValue(t){let i=super.getKey(t);return i&&(this.usedKeys.delete(i),this.availKeys.add(i)),super.deleteValue(t)}};function _e(l,e){if(l===e)return!0;if(typeof l!=typeof e)return!1;if(Array.isArray(l)&&Array.isArray(e)){if(l.length!==e.length)return!1;for(let t=0;t<l.length;t++)if(!_e(l[t],e[t]))return!1;return!0}if(typeof l=="object"&&typeof e=="object"){let t=Object.keys(l),i=Object.keys(e);if(t.length!==i.length)return!1;for(let n of t)if(!i.includes(n)||!_e(l[n],e[n]))return!1;return!0}return!1}var de=class extends Set{constructor(t,i=_e){super(t);this.comparator=i}add(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return this}return super.add(t)}has(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return!0;return!1}return super.has(t)}delete(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return super.delete(i),!0;return!1}return super.delete(t)}difference(t){let i=new de(void 0,this.comparator);for(let n of this)t.has(n)||i.add(n);return i}intersection(t){let i=new de(void 0,this.comparator);for(let n of this)t.has(n)&&i.add(n);return i}};var ki=ui(zt());var nt=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function rt(l,e,t,i){l.addEventListener?l.addEventListener(e,t,i):l.attachEvent&&l.attachEvent("on".concat(e),function(){t(window.event)})}function Ft(l,e){for(var t=e.slice(0,e.length-1),i=0;i<t.length;i++)t[i]=l[t[i].toLowerCase()];return t}function Ut(l){typeof l!="string"&&(l=""),l=l.replace(/\s/g,"");for(var e=l.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function xi(l,e){for(var t=l.length>=e.length?l:e,i=l.length>=e.length?e:l,n=!0,r=0;r<t.length;r++)i.indexOf(t[r])===-1&&(n=!1);return n}var Me={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":nt?173:189,"=":nt?61:187,";":nt?59:186,"'":222,"[":219,"]":221,"\\":220},oe={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},lt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},F={16:!1,18:!1,17:!1,91:!1},z={};for(be=1;be<20;be++)Me["f".concat(be)]=111+be;var be,N=[],Xt=!1,Gt="all",Bt=[],Se=function(e){return Me[e.toLowerCase()]||oe[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)},bi=function(e){return Object.keys(Me).find(function(t){return Me[t]===e})},Mi=function(e){return Object.keys(oe).find(function(t){return oe[t]===e})};function Zt(l){Gt=l||"all"}function ve(){return Gt||"all"}function vi(){return N.slice(0)}function Si(){return N.map(function(l){return bi(l)||Mi(l)||String.fromCharCode(l)})}function Ci(){var l=[];return Object.keys(z).forEach(function(e){z[e].forEach(function(t){var i=t.key,n=t.scope,r=t.mods,s=t.shortcut;l.push({scope:n,shortcut:s,mods:r,keys:i.split("+").map(function(a){return Se(a)})})})}),l}function Di(l){var e=l.target||l.srcElement,t=e.tagName,i=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(i=!1),i}function Ai(l){return typeof l=="string"&&(l=Se(l)),N.indexOf(l)!==-1}function Ei(l,e){var t,i;l||(l=ve());for(var n in z)if(Object.prototype.hasOwnProperty.call(z,n))for(t=z[n],i=0;i<t.length;)t[i].scope===l?t.splice(i,1):i++;ve()===l&&Zt(e||"all")}function ji(l){var e=l.keyCode||l.which||l.charCode,t=N.indexOf(e);if(t>=0&&N.splice(t,1),l.key&&l.key.toLowerCase()==="meta"&&N.splice(0,N.length),(e===93||e===224)&&(e=91),e in F){F[e]=!1;for(var i in oe)oe[i]===e&&(le[i]=!1)}}function $i(l){if(typeof l>"u")Object.keys(z).forEach(function(s){return delete z[s]});else if(Array.isArray(l))l.forEach(function(s){s.key&&st(s)});else if(typeof l=="object")l.key&&st(l);else if(typeof l=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var n=t[0],r=t[1];typeof n=="function"&&(r=n,n=""),st({key:l,scope:n,method:r,splitKey:"+"})}}var st=function(e){var t=e.key,i=e.scope,n=e.method,r=e.splitKey,s=r===void 0?"+":r,a=Ut(t);a.forEach(function(f){var o=f.split(s),u=o.length,c=o[u-1],h=c==="*"?"*":Se(c);if(!!z[h]){i||(i=ve());var g=u>1?Ft(oe,o):[];z[h]=z[h].filter(function(d){var p=n?d.method===n:!0;return!(p&&d.scope===i&&xi(d.mods,g))})}})};function Rt(l,e,t,i){if(e.element===i){var n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(var r in F)Object.prototype.hasOwnProperty.call(F,r)&&(!F[r]&&e.mods.indexOf(+r)>-1||F[r]&&e.mods.indexOf(+r)===-1)&&(n=!1);(e.mods.length===0&&!F[16]&&!F[18]&&!F[17]&&!F[91]||n||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(N),e.method(l,e)===!1&&(l.preventDefault?l.preventDefault():l.returnValue=!1,l.stopPropagation&&l.stopPropagation(),l.cancelBubble&&(l.cancelBubble=!0)))}}}function Ht(l,e){var t=z["*"],i=l.keyCode||l.which||l.charCode;if(!!le.filter.call(this,l)){if((i===93||i===224)&&(i=91),N.indexOf(i)===-1&&i!==229&&N.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(d){var p=lt[d];l[d]&&N.indexOf(p)===-1?N.push(p):!l[d]&&N.indexOf(p)>-1?N.splice(N.indexOf(p),1):d==="metaKey"&&l[d]&&N.length===3&&(l.ctrlKey||l.shiftKey||l.altKey||(N=N.slice(N.indexOf(p))))}),i in F){F[i]=!0;for(var n in oe)oe[n]===i&&(le[n]=!0);if(!t)return}for(var r in F)Object.prototype.hasOwnProperty.call(F,r)&&(F[r]=l[lt[r]]);l.getModifierState&&!(l.altKey&&!l.ctrlKey)&&l.getModifierState("AltGraph")&&(N.indexOf(17)===-1&&N.push(17),N.indexOf(18)===-1&&N.push(18),F[17]=!0,F[18]=!0);var s=ve();if(t)for(var a=0;a<t.length;a++)t[a].scope===s&&(l.type==="keydown"&&t[a].keydown||l.type==="keyup"&&t[a].keyup)&&Rt(l,t[a],s,e);if(i in z){for(var f=0;f<z[i].length;f++)if((l.type==="keydown"&&z[i][f].keydown||l.type==="keyup"&&z[i][f].keyup)&&z[i][f].key){for(var o=z[i][f],u=o.splitKey,c=o.key.split(u),h=[],g=0;g<c.length;g++)h.push(Se(c[g]));h.sort().join("")===N.sort().join("")&&Rt(l,o,s,e)}}}}function Pi(l){return Bt.indexOf(l)>-1}function le(l,e,t){N=[];var i=Ut(l),n=[],r="all",s=document,a=0,f=!1,o=!0,u="+",c=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(r=e.scope),e.element&&(s=e.element),e.keyup&&(f=e.keyup),e.keydown!==void 0&&(o=e.keydown),e.capture!==void 0&&(c=e.capture),typeof e.splitKey=="string"&&(u=e.splitKey)),typeof e=="string"&&(r=e);a<i.length;a++)l=i[a].split(u),n=[],l.length>1&&(n=Ft(oe,l)),l=l[l.length-1],l=l==="*"?"*":Se(l),l in z||(z[l]=[]),z[l].push({keyup:f,keydown:o,scope:r,mods:n,shortcut:i[a],method:t,key:i[a],splitKey:u,element:s});typeof s<"u"&&!Pi(s)&&window&&(Bt.push(s),rt(s,"keydown",function(h){Ht(h,s)},c),Xt||(Xt=!0,rt(window,"focus",function(){N=[]},c)),rt(s,"keyup",function(h){Ht(h,s),ji(h)},c))}function Ti(l){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(z).forEach(function(t){var i=z[t].filter(function(n){return n.scope===e&&n.shortcut===l});i.forEach(function(n){n&&n.method&&n.method()})})}var at={getPressedKeyString:Si,setScope:Zt,getScope:ve,deleteScope:Ei,getPressedKeyCodes:vi,getAllKeyCodes:Ci,isPressed:Ai,filter:Di,trigger:Ti,unbind:$i,keyMap:Me,modifier:oe,modifierMap:lt};for(Ue in at)Object.prototype.hasOwnProperty.call(at,Ue)&&(le[Ue]=at[Ue]);var Ue;typeof window<"u"&&(Yt=window.hotkeys,le.noConflict=function(l){return l&&window.hotkeys===le&&(window.hotkeys=Yt),le},window.hotkeys=le);var Yt;function ot(l,e){let t=0;if(e===void 0)for(let i of l)i!=null&&(i=+i)>=i&&++t;else{let i=-1;for(let n of l)(n=e(n,++i,l))!=null&&(n=+n)>=n&&++t}return t}function Ge(l,e){let t,i;if(e===void 0)for(let n of l)n!=null&&(t===void 0?n>=n&&(t=i=n):(t>n&&(t=n),i<n&&(i=n)));else{let n=-1;for(let r of l)(r=e(r,++n,l))!=null&&(t===void 0?r>=r&&(t=i=r):(t>r&&(t=r),i<r&&(i=r)))}return[t,i]}var Ii=Math.sqrt(50),Vi=Math.sqrt(10),wi=Math.sqrt(2);function Be(l,e,t){let i=(e-l)/Math.max(0,t),n=Math.floor(Math.log10(i)),r=i/Math.pow(10,n),s=r>=Ii?10:r>=Vi?5:r>=wi?2:1,a,f,o;return n<0?(o=Math.pow(10,-n)/s,a=Math.round(l*o),f=Math.round(e*o),a/o<l&&++a,f/o>e&&--f,o=-o):(o=Math.pow(10,n)*s,a=Math.round(l/o),f=Math.round(e/o),a*o<l&&++a,f*o>e&&--f),f<a&&.5<=t&&t<2?Be(l,e,t*2):[a,f,o]}function Ze(l,e,t){if(e=+e,l=+l,t=+t,!(t>0))return[];if(l===e)return[l];let i=e<l,[n,r,s]=i?Be(e,l,t):Be(l,e,t);if(!(r>=n))return[];let a=r-n+1,f=new Array(a);if(i)if(s<0)for(let o=0;o<a;++o)f[o]=(r-o)/-s;else for(let o=0;o<a;++o)f[o]=(r-o)*s;else if(s<0)for(let o=0;o<a;++o)f[o]=(n+o)/-s;else for(let o=0;o<a;++o)f[o]=(n+o)*s;return f}function ft(l,e,t){return e=+e,l=+l,t=+t,Be(l,e,t)[2]}function Je(l,e,t){let i;for(;;){let n=ft(l,e,t);if(n===i||n===0||!isFinite(n))return[l,e];n>0?(l=Math.floor(l/n)*n,e=Math.ceil(e/n)*n):n<0&&(l=Math.ceil(l*n)/n,e=Math.floor(e*n)/n),i=n}}function Qe(l){return Math.max(1,Math.ceil(Math.log(ot(l))/Math.LN2)+1)}var Oi=Array.prototype,Jt=Oi.slice;function Qt(l,e){return l-e}function ei(l){for(var e=0,t=l.length,i=l[t-1][1]*l[0][0]-l[t-1][0]*l[0][1];++e<t;)i+=l[e-1][1]*l[e][0]-l[e-1][0]*l[e][1];return i}var dt=l=>()=>l;function ti(l,e){for(var t=-1,i=e.length,n;++t<i;)if(n=Li(l,e[t]))return n;return 0}function Li(l,e){for(var t=e[0],i=e[1],n=-1,r=0,s=l.length,a=s-1;r<s;a=r++){var f=l[r],o=f[0],u=f[1],c=l[a],h=c[0],g=c[1];if(Ki(f,c,e))return 0;u>i!=g>i&&t<(h-o)*(i-u)/(g-u)+o&&(n=-n)}return n}function Ki(l,e,t){var i;return Wi(l,e,t)&&Ni(l[i=+(l[0]===e[0])],t[i],e[i])}function Wi(l,e,t){return(e[0]-l[0])*(t[1]-l[1])===(t[0]-l[0])*(e[1]-l[1])}function Ni(l,e,t){return l<=e&&e<=t||t<=e&&e<=l}function ii(){}var fe=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function ht(){var l=1,e=1,t=Qe,i=f;function n(o){var u=t(o);if(Array.isArray(u))u=u.slice().sort(Qt);else{let c=Ge(o,qi);for(u=Ze(...Je(c[0],c[1],u),u);u[u.length-1]>=c[1];)u.pop();for(;u[1]<c[0];)u.shift()}return u.map(c=>r(o,c))}function r(o,u){let c=u==null?NaN:+u;if(isNaN(c))throw new Error(`invalid value: ${u}`);var h=[],g=[];return s(o,c,function(d){i(d,o,c),ei(d)>0?h.push([d]):g.push(d)}),g.forEach(function(d){for(var p=0,x=h.length,y;p<x;++p)if(ti((y=h[p])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:u,coordinates:h}}function s(o,u,c){var h=new Array,g=new Array,d,p,x,y,m,C;for(d=p=-1,y=ge(o[0],u),fe[y<<1].forEach(v);++d<l-1;)x=y,y=ge(o[d+1],u),fe[x|y<<1].forEach(v);for(fe[y<<0].forEach(v);++p<e-1;){for(d=-1,y=ge(o[p*l+l],u),m=ge(o[p*l],u),fe[y<<1|m<<2].forEach(v);++d<l-1;)x=y,y=ge(o[p*l+l+d+1],u),C=m,m=ge(o[p*l+d+1],u),fe[x|y<<1|m<<2|C<<3].forEach(v);fe[y|m<<3].forEach(v)}for(d=-1,m=o[p*l]>=u,fe[m<<2].forEach(v);++d<l-1;)C=m,m=ge(o[p*l+d+1],u),fe[m<<2|C<<3].forEach(v);fe[m<<3].forEach(v);function v(D){var T=[D[0][0]+d,D[0][1]+p],$=[D[1][0]+d,D[1][1]+p],K=a(T),V=a($),S,E;(S=g[K])?(E=h[V])?(delete g[S.end],delete h[E.start],S===E?(S.ring.push($),c(S.ring)):h[S.start]=g[E.end]={start:S.start,end:E.end,ring:S.ring.concat(E.ring)}):(delete g[S.end],S.ring.push($),g[S.end=V]=S):(S=h[V])?(E=g[K])?(delete h[S.start],delete g[E.end],S===E?(S.ring.push($),c(S.ring)):h[E.start]=g[S.end]={start:E.start,end:S.end,ring:E.ring.concat(S.ring)}):(delete h[S.start],S.ring.unshift(T),h[S.start=K]=S):h[K]=g[V]={start:K,end:V,ring:[T,$]}}}function a(o){return o[0]*2+o[1]*(l+1)*4}function f(o,u,c){o.forEach(function(h){var g=h[0],d=h[1],p=g|0,x=d|0,y=ut(u[x*l+p]);g>0&&g<l&&p===g&&(h[0]=ni(g,ut(u[x*l+p-1]),y,c)),d>0&&d<e&&x===d&&(h[1]=ni(d,ut(u[(x-1)*l+p]),y,c))})}return n.contour=r,n.size=function(o){if(!arguments.length)return[l,e];var u=Math.floor(o[0]),c=Math.floor(o[1]);if(!(u>=0&&c>=0))throw new Error("invalid size");return l=u,e=c,n},n.thresholds=function(o){return arguments.length?(t=typeof o=="function"?o:Array.isArray(o)?dt(Jt.call(o)):dt(o),n):t},n.smooth=function(o){return arguments.length?(i=o?f:ii,n):i===f},n}function qi(l){return isFinite(l)?l:NaN}function ge(l,e){return l==null?!1:+l>=e}function ut(l){return l==null||isNaN(l=+l)?-1/0:l}function ni(l,e,t,i){let n=i-e,r=t-e,s=isFinite(n)||isFinite(r)?n/r:Math.sign(n)/Math.sign(r);return isNaN(s)?l:l+s-.5}function Ce(l){for(var e=-1,t=l.length,i,n=l[t-1],r=0;++e<t;)i=n,n=l[e],r+=i[1]*n[0]-i[0]*n[1];return r/2}function ct(l,e){for(var t=l.length,i=l[t-1],n=e[0],r=e[1],s=i[0],a=i[1],f,o,u=!1,c=0;c<t;++c)i=l[c],f=i[0],o=i[1],o>r!=a>r&&n<(s-f)*(r-o)/(a-o)+f&&(u=!u),s=f,a=o;return u}function zi(l,e){return typeof l=="object"&&l&&e in l}function Xi(l){if(!Array.isArray(l))return!1;for(let e of l)if(!Array.isArray(e)||e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")return!1;return!0}function Ri(l,e){return l.length<=0?0:(Xi(l)&&Ce(l),Ce(je(l,e)))}var ri={is_empty:et,minmax:bt,sorted:Ee,strparse_intranges:Mt,intlist_to_rangestr:vt,map:mt,reduce:yt,debounce:xt,zip:je,unzip:Dt,forexpr:St,object_id:_t,coordtxl:ki,hotkeys:le,ReconnectState:Ct,polyArea:Ri,BiMap:he,BoundedBiMap:ye,EqSet:de,eq:_e,d3:{contours:ht,polygonContains:ct,polygonArea:Ce},_dummy:void 0};typeof Bokeh!="undefined"&&typeof Bokeh._dummy!="undefined"&&(ri._dummy=Bokeh._dummy);window.casalib=ri;window.hasprop=zi;window.zip=je;window.EqSet=de;window.BiMap=he;window.BoundedBiMap=ye;})();
1
+ "use strict";(()=>{var si=Object.create;var gt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var oi=Object.getPrototypeOf,fi=Object.prototype.hasOwnProperty;var pt=Math.pow;var Z=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var di=(l,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of li(e))!fi.call(l,n)&&n!==t&&gt(l,n,{get:()=>e[n],enumerable:!(i=ai(e,n))||i.enumerable});return l};var ui=(l,e,t)=>(t=l!=null?si(oi(l)):{},di(e||!l||!l.__esModule?gt(t,"default",{value:l,enumerable:!0}):t,l));var ue=Z(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.Point2D=void 0;var $e=class{getX(){return this.x}setX(e){this.x=e}getY(){return this.y}setY(e){this.y=e}setLocation(e,t){this.x=e,this.y=t}constructor(e,t){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)){let i=arguments;this.x===void 0&&(this.x=0),this.y===void 0&&(this.y=0),this.x=e,this.y=t}else if(e===void 0&&t===void 0){let i=arguments;this.x===void 0&&(this.x=0),this.y===void 0&&(this.y=0),this.x=0,this.y=0}else throw new Error("invalid overload")}};Pe.Point2D=$e;$e.__class="coordtxl.geom.Point2D"});var At=Z(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.MapKeywordProvider=void 0;var xe=class{constructor(e){this.wcsMap===void 0&&(this.wcsMap=null),this.wcsMap={};{let t=Object.keys(e);for(let i=0;i<t.length;i++){let n=t[i];if(((r,s)=>r[s]===void 0?null:r[s])(e,n)!=null&&((r,s)=>r[s]===void 0?null:r[s])(e,n)instanceof Array){let r=((a,f)=>a[f]===void 0?null:a[f])(e,n);this.wcsMap[n]=(a=>{if(a.clone!=null)return a.clone();{let f=Object.create(a);for(let o in a)a.hasOwnProperty(o)&&(f[o]=a[o]);return f}})(r);let s=1;for(let a=0;a<r.length;a++){let f=r[a];this.wcsMap[n+s]=f,s+=1}}else this.wcsMap[n]=((r,s)=>r[s]===void 0?null:r[s])(e,n)}}}findKey(e){return this.wcsMap.hasOwnProperty(e)}getStringValue$java_lang_String(e){return this.getStringValue$java_lang_String$java_lang_String(e,null)}getStringValue$java_lang_String$java_lang_String(e,t){return this.wcsMap.hasOwnProperty(e)?((i,n)=>i[n]===void 0?null:i[n])(this.wcsMap,e).toString():t}getStringValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null))return this.getStringValue$java_lang_String$java_lang_String(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getStringValue$java_lang_String(e);throw new Error("invalid overload")}getDoubleValue$java_lang_String(e){return this.getDoubleValue$java_lang_String$double(e,0)}getDoubleValue$java_lang_String$double(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i:t}getDoubleValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getDoubleValue$java_lang_String$double(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getDoubleValue$java_lang_String(e);throw new Error("invalid overload")}getFloatValue$java_lang_String(e){return this.getFloatValue$java_lang_String$float(e,Math.fround(0))}getFloatValue$java_lang_String$float(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i:t}getFloatValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getFloatValue$java_lang_String$float(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getFloatValue$java_lang_String(e);throw new Error("invalid overload")}getIntValue$java_lang_String(e){return this.getIntValue$java_lang_String$int(e,0)}getIntValue$java_lang_String$int(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i|0:t}getIntValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getIntValue$java_lang_String$int(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getIntValue$java_lang_String(e);throw new Error("invalid overload")}toString(){let e=!1,t={str:"{ ",toString:function(){return this.str}};{let i=Object.keys(this.wcsMap);for(let n=0;n<i.length;n++){let r=i[n];{e?(a=>(a.str+=", ",a))(t):e=!0,(a=>(a.str+=r,a))(t),(a=>(a.str+="=",a))(t);let s=((a,f)=>a[f]===void 0?null:a[f])(this.wcsMap,r);if(typeof s=="string")(a=>(a.str+='"',a))(t),(a=>(a.str+=s,a))(t),(a=>(a.str+='"',a))(t);else if(s!=null&&s instanceof Array){let a=s,f="[";for(let o=0;o<a.length;++o){o!==0&&(f+=", ");let u=a[o];typeof u=="string"?f+='"'+u+'"':f+=u}f+="]",(o=>(o.str+=f,o))(t)}else(a=>(a.str+=s,a))(t)}}}return(i=>(i.str+=" }",i))(t),t.str}};Te.MapKeywordProvider=xe;xe.__class="coordtxl.coords.MapKeywordProvider";xe.__interfaces=["coordtxl.coords.WCSKeywordProvider"]});var Et=Z(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.slasubs=void 0;var hi=ue(),te=class{static slaDcs2c(e,t){let i=Math.cos(t),n=[0,0,0];return n[0]=Math.cos(e)*i,n[1]=Math.sin(e)*i,n[2]=Math.sin(t),n}static slaDmxv(e,t){let i,n,r,s=[0,0,0],a=[0,0,0];for(n=0;n<3;n++){for(r=0,i=0;i<3;i++)r+=e[n][i]*t[i];s[n]=r}for(n=0;n<3;n++)a[n]=s[n];return a}static slaDcc2s(e){let t,i,n,r;t=e[0],i=e[1],n=e[2],r=Math.sqrt(t*t+i*i);let s=new hi.Point2D;return s.x=r!==0?Math.atan2(i,t):0,s.y=n!==0?Math.atan2(n,r):0,s}static slaDranrm(e){let t;return t=((i,n)=>{let r=Math.abs(i%n);return isNaN(r)||r==n||r<=Math.abs(n)/2?r:(i>0?1:-1)*(r-n)})(e,te.D2PI),t>=0?t:t+te.D2PI}static slaDeuler(e,t,i,n){let r,s,a,f,o,u=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),c=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),h,g,d,p,x=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),y;for(r=0;r<3;r++)for(s=0;s<3;s++)u[s][r]=s===r?1:0;for(a=e.length,f=0;f<3;f++)if(f<=a){for(r=0;r<3;r++)for(s=0;s<3;s++)c[s][r]=s===r?1:0;switch(f){case 0:default:h=t;break;case 1:h=i;break;case 2:h=n;break}for(g=Math.sin(h),d=Math.cos(h),y=e.charAt(f),(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="X".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="x".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="1".charCodeAt(0)?(c[1][1]=d,c[1][2]=g,c[2][1]=-g,c[2][2]=d):(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="Y".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="y".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="2".charCodeAt(0)?(c[0][0]=d,c[0][2]=-g,c[2][0]=g,c[2][2]=d):(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="Z".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="z".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="3".charCodeAt(0)?(c[0][0]=d,c[0][1]=g,c[1][0]=-g,c[1][1]=d):a=0,s=0;s<3;s++)for(r=0;r<3;r++){for(p=0,o=0;o<3;o++)p+=c[s][o]*u[o][r];x[s][r]=p}for(r=0;r<3;r++)for(s=0;s<3;s++)u[s][r]=x[s][r]}return u}static slDE2H(e,t,i){let n=[0,0],r=Math.sin(e),s=Math.cos(e),a=Math.sin(t),f=Math.cos(t),o=Math.sin(i),u=Math.cos(i),c=-s*f*o+a*u,h=-r*f,g=s*f*u+a*o,d=Math.sqrt(c*c+h*h),p;return d===0?p=0:p=Math.atan2(h,c),p<0&&(p=p+2*Math.PI),n[0]=p,n[1]=Math.atan2(g,d),n}static slDVTP(e,t){let i,n=e[0],r=e[1],s=e[2],a=t[0],f=t[1],o=t[2],u=a*a+f*f,c=Math.sqrt(u);c===0&&(c=1e-20,a=c);let h=n*a+r*f,g=h+s*o;g>te.TINY?i=0:g>=0?(i=1,g=te.TINY):g>-te.TINY?(i=2,g=-te.TINY):i=3,g=g*c;let d=(r*a-n*f)/g,p=(s*u-o*h)/g;return i!==0&&console.info("ERROR: From slDVTP, J = "+i),[d,p]}};Ie.slasubs=te;te.TINY=1e-6;te.D2PI=6.283185307179586;te.__class="coordtxl.coords.slasubs"});var jt=Z(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.wcscon=void 0;var R=ue(),b=class{static a_$LI$(){return b.a==null&&(b.a=[-162557e-11,-31919e-11,-13843e-11]),b.a}static ad_$LI$(){return b.ad==null&&(b.ad=[.001245,-.00158,-659e-6]),b.ad}static emi_$LI$(){return b.emi==null&&(b.emi=[[.99992567949991,-.011181482788805,-.004859004008828,-.000541640798032,-.237963047085011,.436218238658637],[.011181482840782,.999937484898031,-27155744957e-15,.237912530551179,-.00266070648897,-.008537588719453],[.004859003889183,-27177143501e-15,.999988194601879,-.436101961325347,.012258830424865,.002119065556992],[-2423898405e-15,27105439e-15,11777422e-15,.999904322043106,-.011181451601069,-.004858519608686],[-27105439e-15,-2423927017e-15,65851e-15,.011181451608968,.999916125340107,-27162614355e-15],[-11777422e-15,65846e-15,-2424049954e-15,.004858519590501,-27165866691e-15,.999966838131419]]),b.emi}static fk524(e){let t=new R.Point2D(0,0);return b.fk524m(e,t)}static fk524e(e,t){let i=new R.Point2D(0,0),n=b.fk524m(e,i);return n.x=n.x+i.x*(t-1950),n.y=n.y+i.y*(t-1950),n}static fk524m(e,t){let i,n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D=[0,0,0,0,0,0],T=[0,0,0,0,0,0],$,K,V,S,E,w,P,_,M=6.283185307179586,A,q=1e-30,j=0;for(A=100*60*60*360/M,i=I.WCSTransform.degrad(e.x),n=I.WCSTransform.degrad(e.y),r=I.WCSTransform.degrad(t.x),s=I.WCSTransform.degrad(t.y),c=r*A,h=s*A,g=Math.sin(i),d=Math.cos(i),p=Math.sin(n),x=Math.cos(n),y=d*x,m=g*x,C=p,D[0]=y,D[1]=m,D[2]=C,c!==j||h!==j?(D[3]=-(c*m)-d*p*h,D[4]=c*y-g*p*h,D[5]=x*h):(D[3]=j,D[4]=j,D[5]=j),P=0;P<6;P++){for(v=j,_=0;_<6;_++)v=v+b.emi_$LI$()[_][P]*D[_];T[P]=v}return y=T[0],m=T[1],C=T[2],$=T[3],K=T[4],V=T[5],S=Math.sqrt(y*y+m*m+C*C),y=y+b.a_$LI$()[0]*S,m=m+b.a_$LI$()[1]*S,C=C+b.a_$LI$()[2]*S,$=$+b.ad_$LI$()[0]*S,K=K+b.ad_$LI$()[1]*S,V=V+b.ad_$LI$()[2]*S,E=y*y+m*m,w=Math.sqrt(E),y===j&&m===j?a=j:(a=Math.atan2(m,y),a<j&&(a=a+M)),f=Math.atan2(C,w),w>q&&(c=(y*K-m*$)/E,h=(V*E-C*(y*$+m*K))/((E+C*C)*w)),o=c/A,u=h/A,e.x=I.WCSTransform.raddeg(a),e.y=I.WCSTransform.raddeg(f),t.x=I.WCSTransform.raddeg(o),t.y=I.WCSTransform.raddeg(u),e}static em_$LI$(){return b.em==null&&(b.em=[[.999925678186902,.011182059571766,.004857946721186,-.000541652366951,.237917612131583,-.43611127603927],[-.011182059642247,.999937478448132,-27147426498e-15,-.237968129744288,-.002660763319071,.012259092261564],[-.00485794655896,-27176441185e-15,.99998819973877,.436227555856097,-.008537771074048,.002119110818172],[2423950176e-15,27106627e-15,11776559e-15,.999947035154614,.011182506007242,.00485766994865],[-27106627e-15,2423978783e-15,-65816e-15,-.011182506121805,.999958833818833,-27137309539e-15],[-11776558e-15,-65874e-15,2424101735e-15,-.004857669684959,-27184471371e-15,1.000009560363559]]),b.em}static fk425(e){let t=new R.Point2D(0,0);return b.fk425m(e,t)}static fk425e(e,t){let i=new R.Point2D(0,0),n=b.fk425m(e,i);return n.x=n.x+i.x*(t-2e3),n.y=n.y+i.y*(t-2e3),n}static fk425m(e,t){let i,n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P,_,M=[0,0,0],A=[0,0,0],q=[0,0,0,0,0,0],j=[0,0,0,0,0,0],L=6.283185307179586,X,ie=1e-30,ee=0;for(X=100*60*60*360/L,i=I.WCSTransform.degrad(e.x),n=I.WCSTransform.degrad(e.y),r=I.WCSTransform.degrad(t.x),s=I.WCSTransform.degrad(t.y),c=r*X,h=s*X,g=Math.sin(i),d=Math.cos(i),p=Math.sin(n),x=Math.cos(n),M[0]=d*x,M[1]=g*x,M[2]=p,A[0]=-g*x*c-d*p*h,A[1]=d*x*c-g*p*h,A[2]=x*h,y=M[0]*b.a_$LI$()[0]+M[1]*b.a_$LI$()[1]+M[2]*b.a_$LI$()[2],m=M[0]*b.ad_$LI$()[0]+M[1]*b.ad_$LI$()[1]+M[2]*b.ad_$LI$()[2],P=0;P<3;P++)q[P]=M[P]-b.a_$LI$()[P]+y*M[P],q[P+3]=A[P]-b.ad_$LI$()[P]+m*M[P];for(P=0;P<6;P++){for(y=ee,_=0;_<6;_++)y=y+b.em_$LI$()[_][P]*q[_];j[P]=y}return C=j[0],v=j[1],D=j[2],T=j[3],$=j[4],K=j[5],V=C*C+v*v,S=V+D*D,E=Math.sqrt(V),w=C*T+v*$,C===ee&&v===ee?a=ee:(a=Math.atan2(v,C),a<ee&&(a=a+L)),f=Math.atan2(D,E),E>ie&&(c=(C*$-v*T)/V,h=(K*V-D*w)/(S*E)),o=c/X,u=h/X,e.x=I.WCSTransform.raddeg(a),e.y=I.WCSTransform.raddeg(f),t.x=I.WCSTransform.raddeg(o),t.y=I.WCSTransform.raddeg(u),e}static bgal_$LI$(){return b.bgal==null&&(b.bgal=[[-.066988739415,-.872755765852,-.483538914632],[.492728466075,-.45034695802,.744584633283],[-.867600811151,-.188374601723,.460199784784]]),b.bgal}static fk42gal(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;f=e.x,o=e.y,s=I.WCSTransform.degrad(f),a=I.WCSTransform.degrad(o);let c=new R.Point2D,h=new R.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.bgal_$LI$()[u][0]+t[1]*b.bgal_$LI$()[u][1]+t[2]*b.bgal_$LI$()[u][2];let g=new R.Point2D,d=new R.Point2D;return b.jpcon(i,g,d),n=I.WCSTransform.raddeg(g.x),r=I.WCSTransform.raddeg(g.y),e.x=n,e.y=r,b.idg>0,e}static gal2fk4(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;n=e.x,r=e.y,s=I.WCSTransform.degrad(n),a=I.WCSTransform.degrad(r);let c=new R.Point2D,h=new R.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.bgal_$LI$()[0][u]+t[1]*b.bgal_$LI$()[1][u]+t[2]*b.bgal_$LI$()[2][u];let g=new R.Point2D,d=new R.Point2D;return b.jpcon(i,g,d),f=I.WCSTransform.raddeg(g.x),o=I.WCSTransform.raddeg(g.y),e.x=f,e.y=o,b.idg>0,e}static jgal_$LI$(){return b.jgal==null&&(b.jgal=[[-.054875539726,-.87343710801,-.483834985808],[.494109453312,-.444829589425,.74698225181],[-.867666135858,-.198076386122,.455983795705]]),b.jgal}static fk52gal(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;f=e.x,o=e.y,s=I.WCSTransform.degrad(f),a=I.WCSTransform.degrad(o);let c=new R.Point2D,h=new R.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.jgal_$LI$()[u][0]+t[1]*b.jgal_$LI$()[u][1]+t[2]*b.jgal_$LI$()[u][2];let g=new R.Point2D,d=new R.Point2D;return b.jpcon(i,g,d),n=I.WCSTransform.raddeg(g.x),r=I.WCSTransform.raddeg(g.y),e.x=n,e.y=r,b.idg>0,e}static gal2fk5(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;n=e.x,r=e.y,s=I.WCSTransform.degrad(n),a=I.WCSTransform.degrad(r);let c=new R.Point2D,h=new R.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.jgal_$LI$()[0][u]+t[1]*b.jgal_$LI$()[1][u]+t[2]*b.jgal_$LI$()[2][u];let g=new R.Point2D,d=new R.Point2D;return b.jpcon(i,g,d),f=I.WCSTransform.raddeg(g.x),o=I.WCSTransform.raddeg(g.y),e.x=f,e.y=o,b.idg>0,e}static jpcon(e,t,i){let n,r,s,a,f,o;n=e[0],r=e[1],s=e[2],t.x=Math.atan2(r,n),t.x<0&&(t.x=t.x+6.283185307179586),f=n*n+r*r,a=Math.sqrt(f),t.y=Math.atan2(s,a),o=s*s,i.x=Math.sqrt(f+o)}static jpcop(e,t,i,n,r){n.x=i*Math.cos(e)*Math.cos(t),n.y=i*Math.sin(e)*Math.cos(t),r.x=i*Math.sin(t)}static fk4prec(e,t,i){let n=I.WCSTransform.degrad(i.x),r=I.WCSTransform.degrad(i.y),s=b.mprecfk4(e,t),a=re.slasubs.slaDcs2c(n,r),f=re.slasubs.slaDmxv(s,a),o=re.slasubs.slaDcc2s(f);return n=o.x,r=o.y,n=re.slasubs.slaDranrm(n),i.x=I.WCSTransform.raddeg(n),i.y=I.WCSTransform.raddeg(r),i}static fk5prec(e,t,i){let n=I.WCSTransform.degrad(i.x),r=I.WCSTransform.degrad(i.y),s=b.mprecfk5(e,t),a=re.slasubs.slaDcs2c(n,r),f=re.slasubs.slaDmxv(s,a),o=re.slasubs.slaDcc2s(f);return n=o.x,r=o.y,n=re.slasubs.slaDranrm(n),i.x=I.WCSTransform.raddeg(n),i.y=I.WCSTransform.raddeg(r),i}static mprecfk4(e,t){let i,n,r,s,a,f,o;return i=(e-1850)/100,n=(t-e)/100,r=n*b.DAS2R,s=2303.5548+(1.3972+59e-6*i)*i,a=(s+(.30242-269e-6*i+.017996*n)*n)*r,f=(s+(1.09478+387e-6*i+.018324*n)*n)*r,o=(2005.1125+(-.85294-365e-6*i)*i+(-.42647-365e-6*i-.041802*n)*n)*r,re.slasubs.slaDeuler("ZYZ",-a,o,-f)}static mprecfk5(e,t){let i,n,r,s,a,f,o;return i=(e-2e3)/100,n=(t-e)/100,r=n*b.DAS2R,s=2306.2181+(1.39656-139e-6*i)*i,a=(s+(.30188-344e-6*i+.017998*n)*n)*r,f=(s+(1.09468+66e-6*i+.018203*n)*n)*r,o=(2004.3109+(-.8533-217e-6*i)*i+(-.42665-217e-6*i-.041833*n)*n)*r,re.slasubs.slaDeuler("ZYZ",-a,o,-f)}};Ve.wcscon=b;b.idg=0;b.DAS2R=484813681109536e-20;b.__class="coordtxl.coords.wcscon";var re=Et(),I=we()});var $t=Z(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.worldpos=void 0;var tt=ue(),Oe=class{static getPosition(e,t,i){let n,r,s,a,f,o,u,c,h=0,g=0,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P=.01745329252,_=6.28318530717959,M=1e-5,A,q,j,L,X,ie,ee,De=i.pcode,pe,Ae;if(A=i.xref,q=i.yref,j=i.xrefpix,L=i.yrefpix,X=i.xinc,ie=i.yinc,ee=O.WCSTransform.degrad(i.rot),n=Math.cos(ee),r=Math.sin(ee),s=e-j,a=t-L,i.rotmat>0)o=s*i.cd11+a*i.cd12,a=s*i.cd21+a*i.cd22,s=o;else{if(X===0||ie===0)return null;s=s*X,a=a*ie,ee!==0&&(o=s*n-a*r,a=s*r+a*n,s=o)}if(pe=A+s,Ae=q+a,De<0)return new tt.Point2D(pe,Ae);switch(i.coorflip>0?(T=O.WCSTransform.degrad(A),$=O.WCSTransform.degrad(q),o=s,s=a,a=o):($=O.WCSTransform.degrad(A),T=O.WCSTransform.degrad(q)),p=O.WCSTransform.degrad(s),x=O.WCSTransform.degrad(a),u=p*p+x*x,v=Math.cos(T),D=Math.sin(T),De){case-1:case 0:g=$+p,h=T+x;break;case 1:if(c=Math.sqrt(1-u),d=D*c+v*x,d>1||d<-1||(h=Math.asin(d),g=v*c-D*x,g===0&&p===0))return null;g=Math.atan2(p,g)+$;break;case 2:if(h=v-x*D,h===0)return null;g=$+Math.atan2(p,h),h=Math.atan(Math.cos(g-$)*(x*v+D)/h);break;case 3:if(u>=_*_/4||(u=Math.sqrt(u),c=Math.cos(u),u!==0?u=Math.sin(u)/u:u=1,d=x*v*u+D*c,d>1||d<-1)||(h=Math.asin(d),m=c-d*D,d=p*u*v,m===0&&d===0))return null;g=$+Math.atan2(d,m);break;case 4:if(h=v-x*D,h===0||(g=$+Math.atan2(p,h),d=Math.cos(g-$),d===0)||(h=h/d,h>1||h<-1))return null;h=Math.acos(h),T<0&&(h=-h);break;case 5:if(h=T+x,Math.abs(h)>_/4||(c=Math.cos(h),Math.abs(p)>_*c/2))return null;g=$,c>M&&(g=g+p/c);break;case 6:if(d=ie*n+X*r,d===0&&(d=1),a=O.WCSTransform.degrad(q/2+45),s=a+d/2*P,a=Math.log(Math.tan(a)),s=Math.log(Math.tan(s)),E=O.WCSTransform.degrad(d)/(s-a),w=E*a,S=Math.cos(O.WCSTransform.degrad(q)),S<=0&&(S=1),g=p/S+$,Math.abs(g-$)>_)return null;d=0,E!==0&&(d=(x+w)/E),d=Math.exp(d),h=2*Math.atan(d)-_/4;break;case 7:if(d=ie*n+X*r,d===0&&(d=1),d=O.WCSTransform.degrad(d),a=O.WCSTransform.degrad(q),s=Math.sin(a+d)/Math.sqrt((1+Math.cos(a+d))/2)-Math.sin(a)/Math.sqrt((1+Math.cos(a))/2),s===0&&(s=1),E=d/s,d=X*n-ie*r,d===0&&(d=1),d=O.WCSTransform.degrad(d),s=2*Math.cos(a)*Math.sin(d/2),s===0&&(s=1),S=d*Math.sqrt((1+Math.cos(a)*Math.cos(d/2))/2)/s,w=E*Math.sin(a)/Math.sqrt((1+Math.cos(a))/2),g=$,h=T,p===0&&x===0)break;if(f=4-p*p/(4*S*S)-(x+w)/E*((x+w)/E),f>4||f<2||(f=.5*Math.sqrt(f),C=(x+w)*f/E,Math.abs(C)>1)||(C=Math.asin(C),Math.abs(Math.cos(C))<M)||(m=p*f/(2*S*Math.cos(C)),Math.abs(m)>1))return null;m=Math.asin(m),g=$+2*m,h=C;break;case 8:if(f=(4-u)/(4+u),Math.abs(f)>1||(h=f*D+x*v*(1+f)/2,Math.abs(h)>1)||(h=Math.asin(h),g=Math.cos(h),Math.abs(g)<M)||(g=p*(1+f)/(2*g),Math.abs(g)>1)||(g=Math.asin(g),y=1+Math.sin(h)*D+Math.cos(h)*v*Math.cos(g),Math.abs(y)<M))return null;y=2*(Math.sin(h)*v-Math.cos(h)*D*Math.cos(g))/y,Math.abs(y-x)>M&&(g=_/2-g),g=$+g;break}return V=g,K=h,V-$>_/2&&(V=V-_),V-$<-_/2&&(V=V+_),V<0&&(V+=_),pe=O.WCSTransform.raddeg(V),Ae=O.WCSTransform.raddeg(K),new tt.Point2D(pe,Ae)}static getPixels(e,t,i){let n,r,s=0,a=0,f=0,o=0,u=0,c=0,h,g,d,p=0,x=0,y=0,m,C,v,D,T,$,K=.01745329252,V=1e-5,S=6.28318530717959,E,w,P,_,M,A,q,j;switch(E=i.xref,w=i.yref,P=i.xrefpix,_=i.yrefpix,M=i.xinc,A=i.yinc,q=O.WCSTransform.degrad(i.rot),T=Math.cos(q),D=Math.sin(q),j=i.pcode,j>0&&j<9&&(i.coorflip>0?(a=O.WCSTransform.degrad(E),s=O.WCSTransform.degrad(w),h=e-w):(s=O.WCSTransform.degrad(E),a=O.WCSTransform.degrad(w),h=e-E),j>=0&&(h>180&&(e-=360),h<-180&&(e+=360)),f=O.WCSTransform.degrad(e),o=O.WCSTransform.degrad(t),u=Math.cos(o),c=Math.sin(o),x=Math.sin(f-s)*u,p=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s)),j){case 1:if(p<0)return null;y=c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s);break;case 2:if(p<=0)return null;y=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s),x=x/y,y=(c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s))/y;break;case 3:y=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s),y<-1&&(y=-1),y>1&&(y=1),y=Math.acos(y),y!==0?y=y/Math.sin(y):y=1,x=x*y,y=(c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s))*y;break;case 4:if(a===0)return null;y=(Math.cos(a)-u*Math.cos(f-s))/Math.sin(a);break;case 5:if(h=f-s,Math.abs(o)>S/4||Math.abs(a)>S/4)return null;y=o-a,x=h*u;break;case 6:if(h=A*T+M*D,h===0&&(h=1),r=O.WCSTransform.degrad(w/2+45),n=r+h/2*K,r=Math.log(Math.tan(r)),n=Math.log(Math.tan(n)),C=O.WCSTransform.degrad(h)/(n-r),v=C*r,m=Math.cos(O.WCSTransform.degrad(w)),m<=0&&(m=1),h=f-s,x=m*h,h=o/2+S/8,h=Math.tan(h),h<V)return null;y=C*Math.log(h)-v;break;case 7:if(g=(f-s)/2,Math.abs(g)>S/4||(h=A*T+M*D,h===0&&(h=1),h=O.WCSTransform.degrad(h),r=O.WCSTransform.degrad(w),n=Math.sin(r+h)/Math.sqrt((1+Math.cos(r+h))/2)-Math.sin(r)/Math.sqrt((1+Math.cos(r))/2),n===0&&(n=1),C=h/n,h=M*T-A*D,h===0&&(h=1),h=O.WCSTransform.degrad(h),n=2*Math.cos(r)*Math.sin(h/2),n===0&&(n=1),m=h*Math.sqrt((1+Math.cos(r)*Math.cos(h/2))/2)/n,v=C*Math.sin(r)/Math.sqrt((1+Math.cos(r))/2),h=Math.sqrt((1+Math.cos(o)*Math.cos(g))/2),Math.abs(h)<V))return null;x=2*m*Math.cos(o)*Math.sin(g)/h,y=C*Math.sin(o)/h-v;break;case 8:if(g=f-s,Math.abs(o)>S/4||(d=1+c*Math.sin(a)+u*Math.cos(a)*Math.cos(g),Math.abs(d)<V))return null;d=2/d,x=x*d,y=d*(c*Math.cos(a)-u*Math.sin(a)*Math.cos(g));break}j>0&&j<9?(n=O.WCSTransform.raddeg(x),r=O.WCSTransform.raddeg(y)):(n=e-E,r=t-w),i.coorflip>0&&($=n,n=r,r=$),i.rotmat>0?($=n*i.dc11+r*i.dc12,r=n*i.dc21+r*i.dc22,n=$):(q!==0&&($=n*T+r*D,r=r*T-n*D,n=$),M!==0&&(n=n/M),A!==0&&(r=r/A));let L=n+P,X=r+_;return new tt.Point2D(L,X)}};Le.worldpos=Oe;Oe.__class="coordtxl.coords.worldpos";var O=we()});var Tt=Z(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.platepos=void 0;var Pt=ue(),k=class{static getPosition(e,t,i){let n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D;return n=e+i.x_pixel_offset-1+.5,r=t+i.y_pixel_offset-1+.5,s=(i.ppo_coeff[2]-n*i.x_pixel_size)/1e3,a=(r*i.y_pixel_size-i.ppo_coeff[5])/1e3,f=s*s,o=a*a,u=s*f,c=a*o,h=f+o,g=i.amd_x_coeff[0]*s+i.amd_x_coeff[1]*a+i.amd_x_coeff[2]+i.amd_x_coeff[3]*f+i.amd_x_coeff[4]*s*a+i.amd_x_coeff[5]*o+i.amd_x_coeff[6]*h+i.amd_x_coeff[7]*u+i.amd_x_coeff[8]*f*a+i.amd_x_coeff[9]*s*o+i.amd_x_coeff[10]*c+i.amd_x_coeff[11]*s*h+i.amd_x_coeff[12]*s*h*h,p=i.amd_y_coeff[0]*a+i.amd_y_coeff[1]*s+i.amd_y_coeff[2]+i.amd_y_coeff[3]*o+i.amd_y_coeff[4]*s*a+i.amd_y_coeff[5]*f+i.amd_y_coeff[6]*h+i.amd_y_coeff[7]*c+i.amd_y_coeff[8]*o*s+i.amd_y_coeff[9]*a*f+i.amd_y_coeff[10]*u+i.amd_y_coeff[11]*a*h+i.amd_y_coeff[12]*a*h*h,d=g/k.CONS2R,x=p/k.CONS2R,v=Math.tan(i.plate_dec),D=Math.cos(i.plate_dec),y=Math.atan2(d/D,1-x*v),m=y+i.plate_ra,m<0&&(m=m+k.TWOPI),C=Math.atan(Math.cos(y)/((1-x*v)/(x+v))),new Pt.Point2D(m/k.COND2R,C/k.COND2R)}static getPixels(e,t,i){let n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P,_,M,A,q,j,L,X,ie,ee;for(ie=e*k.COND2R,ee=t*k.COND2R,T=Math.sin(ee),$=Math.cos(ee),K=Math.sin(i.plate_dec),V=Math.cos(i.plate_dec),S=Math.sin(ie-i.plate_ra),E=Math.cos(ie-i.plate_ra),n=T*K+$*V*E,r=$*S*k.CONR2S/n,s=(T*V-$*K*E)*k.CONR2S/n,j=r/i.plate_scale,L=s/i.plate_scale,X=0;X<k.MAX_ITERATIONS&&(o=j*L,u=j*j,c=L*L,h=u*L,g=c*j,m=u+c,C=m*m,d=u*j,p=c*L,x=u*u,y=c*c,w=i.amd_x_coeff[0]*j+i.amd_x_coeff[1]*L+i.amd_x_coeff[2]+i.amd_x_coeff[3]*u+i.amd_x_coeff[4]*o+i.amd_x_coeff[5]*c+i.amd_x_coeff[6]*m+i.amd_x_coeff[7]*d+i.amd_x_coeff[8]*h+i.amd_x_coeff[9]*g+i.amd_x_coeff[10]*p+i.amd_x_coeff[11]*j*m+i.amd_x_coeff[12]*j*C,P=i.amd_x_coeff[0]+i.amd_x_coeff[3]*2*j+i.amd_x_coeff[4]*L+i.amd_x_coeff[6]*2*j+i.amd_x_coeff[7]*3*u+i.amd_x_coeff[8]*2*o+i.amd_x_coeff[9]*c+i.amd_x_coeff[11]*(3*u+c)+i.amd_x_coeff[12]*(5*x+6*u*c+y),_=i.amd_x_coeff[1]+i.amd_x_coeff[4]*j+i.amd_x_coeff[5]*2*L+i.amd_x_coeff[6]*2*L+i.amd_x_coeff[8]*u+i.amd_x_coeff[9]*2*o+i.amd_x_coeff[10]*3*c+i.amd_x_coeff[11]*2*o+i.amd_x_coeff[12]*4*o*m,M=i.amd_y_coeff[0]*L+i.amd_y_coeff[1]*j+i.amd_y_coeff[2]+i.amd_y_coeff[3]*c+i.amd_y_coeff[4]*o+i.amd_y_coeff[5]*u+i.amd_y_coeff[6]*m+i.amd_y_coeff[7]*p+i.amd_y_coeff[8]*g+i.amd_y_coeff[9]*h+i.amd_y_coeff[10]*d+i.amd_y_coeff[11]*L*m+i.amd_y_coeff[12]*L*C,A=i.amd_y_coeff[1]+i.amd_y_coeff[4]*L+i.amd_y_coeff[5]*2*j+i.amd_y_coeff[6]*2*j+i.amd_y_coeff[8]*c+i.amd_y_coeff[9]*2*o+i.amd_y_coeff[10]*3*u+i.amd_y_coeff[11]*2*o+i.amd_y_coeff[12]*4*o*m,q=i.amd_y_coeff[0]+i.amd_y_coeff[3]*2*L+i.amd_y_coeff[4]*j+i.amd_y_coeff[6]*2*L+i.amd_y_coeff[7]*3*c+i.amd_y_coeff[8]*2*o+i.amd_y_coeff[9]*u+i.amd_y_coeff[11]*(u+3*c)+i.amd_y_coeff[12]*(5*y+6*u*c+x),w=w-r,M=M-s,v=(-w*q+M*_)/(P*q-_*A),D=(-M*P+w*A)/(P*q-_*A),j=j+v,L=L+D,!(Math.abs(v)<k.TOLERANCE&&Math.abs(D)<k.TOLERANCE));X++);a=(i.ppo_coeff[2]-j*1e3)/i.x_pixel_size,f=(i.ppo_coeff[5]+L*1e3)/i.y_pixel_size;let De=a-i.x_pixel_offset+1-.5,pe=f-i.y_pixel_offset+1-.5;return new Pt.Point2D(De,pe)}};Ke.platepos=k;k.COND2R=.01745329252;k.CONS2R=206264.8062470964;k.TWOPI=6.28318530717959;k.MAX_ITERATIONS=50;k.TOLERANCE=5e-7;k.CONR2S=206264.8062470964;k.__class="coordtxl.coords.platepos"});var we=Z(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.WCSTransform=void 0;var We=ue(),W=class{static degrad(e){return e*Math.PI/180}static raddeg(e){return e*180/Math.PI}static hrdeg(e){return e*15}static deghr(e){return e/15}static hrrad(e){return W.degrad(W.hrdeg(e))}static radhr(e){return W.deghr(W.raddeg(e))}constructor(e,t,i,n,r,s,a,f,o,u,c,h){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&(typeof a=="number"||a===null)&&(typeof f=="number"||f===null)&&(typeof o=="number"||o===null)&&(typeof u=="number"||u===null)&&(typeof c=="number"||c===null)&&(typeof h=="string"||h===null)){let g=arguments;this.xref===void 0&&(this.xref=0),this.yref===void 0&&(this.yref=0),this.xrefpix===void 0&&(this.xrefpix=0),this.yrefpix===void 0&&(this.yrefpix=0),this.xinc===void 0&&(this.xinc=0),this.yinc===void 0&&(this.yinc=0),this.rot===void 0&&(this.rot=0),this.crot===void 0&&(this.crot=0),this.srot===void 0&&(this.srot=0),this.cd11===void 0&&(this.cd11=0),this.cd12===void 0&&(this.cd12=0),this.cd21===void 0&&(this.cd21=0),this.cd22===void 0&&(this.cd22=0),this.dc11===void 0&&(this.dc11=0),this.dc12===void 0&&(this.dc12=0),this.dc21===void 0&&(this.dc21=0),this.dc22===void 0&&(this.dc22=0),this.mrot===void 0&&(this.mrot=0),this.cmrot===void 0&&(this.cmrot=0),this.smrot===void 0&&(this.smrot=0),this.xmpix===void 0&&(this.xmpix=0),this.ympix===void 0&&(this.ympix=0),this.equinox===void 0&&(this.equinox=0),this.epoch===void 0&&(this.epoch=0),this.nxpix===void 0&&(this.nxpix=0),this.nypix===void 0&&(this.nypix=0),this.plate_ra===void 0&&(this.plate_ra=0),this.plate_dec===void 0&&(this.plate_dec=0),this.plate_scale===void 0&&(this.plate_scale=0),this.x_pixel_offset===void 0&&(this.x_pixel_offset=0),this.y_pixel_offset===void 0&&(this.y_pixel_offset=0),this.x_pixel_size===void 0&&(this.x_pixel_size=0),this.y_pixel_size===void 0&&(this.y_pixel_size=0),this.xpix===void 0&&(this.xpix=0),this.ypix===void 0&&(this.ypix=0),this.xpos===void 0&&(this.xpos=0),this.ypos===void 0&&(this.ypos=0),this.pcode===void 0&&(this.pcode=0),this.changesys===void 0&&(this.changesys=0),this.printsys===void 0&&(this.printsys=0),this.ndec===void 0&&(this.ndec=0),this.degout===void 0&&(this.degout=0),this.tabsys===void 0&&(this.tabsys=0),this.rotmat===void 0&&(this.rotmat=0),this.coorflip===void 0&&(this.coorflip=0),this.offscl===void 0&&(this.offscl=0),this.plate_fit===void 0&&(this.plate_fit=0),this.wcson===void 0&&(this.wcson=0),this.detector===void 0&&(this.detector=0),this.fCenterRa===void 0&&(this.fCenterRa=0),this.fCenterDec===void 0&&(this.fCenterDec=0),this.fHalfWidthRa===void 0&&(this.fHalfWidthRa=0),this.fHalfWidthDec===void 0&&(this.fHalfWidthDec=0),this.fWidthDeg===void 0&&(this.fWidthDeg=0),this.fHeightDeg===void 0&&(this.fHeightDeg=0),this.degPerPixel===void 0&&(this.degPerPixel=null),this.ppo_coeff=[0,0,0,0,0,0],this.amd_x_coeff=(d=>{let p=[];for(;d-- >0;)p.push(0);return p})(20),this.amd_y_coeff=(d=>{let p=[];for(;d-- >0;)p.push(0);return p})(20),this.instrument="",this.c1type="",this.c2type="",this.ctypes=["-SIN","-TAN","-ARC","-NCP","-GLS","-MER","-AIT","-STG"],this.ptype="",this.radecsys="",this.sysout="",this.center="",this.plate_fit=0,this.nxpix=a,this.nypix=f,this.xinc=i/3600,this.yinc=n/3600,this.xrefpix=r,this.yrefpix=s,this.xref=e,this.yref=t,this.c1type="RA-",this.c2type="DEC",this.ptype=h,this.pcode=1,this.coorflip=0,this.rot=o,this.rotmat=0,this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.dc11=0,this.dc21=0,this.dc12=0,this.dc22=0,this.equinox=u,u>1980?this.radecsys="FK5":this.radecsys="FK4",c>0?this.epoch=c:this.epoch=0,this.wcson=1,this.sysout=this.radecsys,this.changesys=0,this.printsys=1,this.tabsys=0,this.pcode=0;for(let d=0;d<8;d++)((p,x,y=0)=>p.substr(y,x.length)===x)(this.ptype,this.ctypes[d])&&(this.pcode=d+1);this.wcsfull()}else if((e!=null&&e.constructor!=null&&e.constructor.__interfaces!=null&&e.constructor.__interfaces.indexOf("coordtxl.coords.WCSKeywordProvider")>=0||e===null)&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0&&f===void 0&&o===void 0&&u===void 0&&c===void 0&&h===void 0){let d=arguments[0];this.xref===void 0&&(this.xref=0),this.yref===void 0&&(this.yref=0),this.xrefpix===void 0&&(this.xrefpix=0),this.yrefpix===void 0&&(this.yrefpix=0),this.xinc===void 0&&(this.xinc=0),this.yinc===void 0&&(this.yinc=0),this.rot===void 0&&(this.rot=0),this.crot===void 0&&(this.crot=0),this.srot===void 0&&(this.srot=0),this.cd11===void 0&&(this.cd11=0),this.cd12===void 0&&(this.cd12=0),this.cd21===void 0&&(this.cd21=0),this.cd22===void 0&&(this.cd22=0),this.dc11===void 0&&(this.dc11=0),this.dc12===void 0&&(this.dc12=0),this.dc21===void 0&&(this.dc21=0),this.dc22===void 0&&(this.dc22=0),this.mrot===void 0&&(this.mrot=0),this.cmrot===void 0&&(this.cmrot=0),this.smrot===void 0&&(this.smrot=0),this.xmpix===void 0&&(this.xmpix=0),this.ympix===void 0&&(this.ympix=0),this.equinox===void 0&&(this.equinox=0),this.epoch===void 0&&(this.epoch=0),this.nxpix===void 0&&(this.nxpix=0),this.nypix===void 0&&(this.nypix=0),this.plate_ra===void 0&&(this.plate_ra=0),this.plate_dec===void 0&&(this.plate_dec=0),this.plate_scale===void 0&&(this.plate_scale=0),this.x_pixel_offset===void 0&&(this.x_pixel_offset=0),this.y_pixel_offset===void 0&&(this.y_pixel_offset=0),this.x_pixel_size===void 0&&(this.x_pixel_size=0),this.y_pixel_size===void 0&&(this.y_pixel_size=0),this.xpix===void 0&&(this.xpix=0),this.ypix===void 0&&(this.ypix=0),this.xpos===void 0&&(this.xpos=0),this.ypos===void 0&&(this.ypos=0),this.pcode===void 0&&(this.pcode=0),this.changesys===void 0&&(this.changesys=0),this.printsys===void 0&&(this.printsys=0),this.ndec===void 0&&(this.ndec=0),this.degout===void 0&&(this.degout=0),this.tabsys===void 0&&(this.tabsys=0),this.rotmat===void 0&&(this.rotmat=0),this.coorflip===void 0&&(this.coorflip=0),this.offscl===void 0&&(this.offscl=0),this.plate_fit===void 0&&(this.plate_fit=0),this.wcson===void 0&&(this.wcson=0),this.detector===void 0&&(this.detector=0),this.fCenterRa===void 0&&(this.fCenterRa=0),this.fCenterDec===void 0&&(this.fCenterDec=0),this.fHalfWidthRa===void 0&&(this.fHalfWidthRa=0),this.fHalfWidthDec===void 0&&(this.fHalfWidthDec=0),this.fWidthDeg===void 0&&(this.fWidthDeg=0),this.fHeightDeg===void 0&&(this.fHeightDeg=0),this.degPerPixel===void 0&&(this.degPerPixel=null),this.ppo_coeff=[0,0,0,0,0,0],this.amd_x_coeff=(P=>{let _=[];for(;P-- >0;)_.push(0);return _})(20),this.amd_y_coeff=(P=>{let _=[];for(;P-- >0;)_.push(0);return _})(20),this.instrument="",this.c1type="",this.c2type="",this.ctypes=["-SIN","-TAN","-ARC","-NCP","-GLS","-MER","-AIT","-STG"],this.ptype="",this.radecsys="",this.sysout="",this.center="";let p,x,y,m,C,v,D,T,$,K,V,S,E,w;if(this.plate_fit=0,this.nxpix=d.getDoubleValue$java_lang_String("NAXIS1"),this.nypix=d.getDoubleValue$java_lang_String("NAXIS2"),this.xmpix=.5*this.nxpix,this.ympix=.5*this.nypix,this.mrot=0,this.equinox=d.getDoubleValue$java_lang_String("EQUINOX"),d.findKey("PLTRAH")){this.plate_fit=1,y=d.getDoubleValue$java_lang_String("PLTRAH"),m=d.getDoubleValue$java_lang_String("PLTRAM"),C=d.getDoubleValue$java_lang_String("PLTRAS"),V=y+m/60+C/3600,this.plate_ra=W.hrrad(V),x="+";let P=d.getStringValue$java_lang_String("PLTDECSN");P!=null&&(x=P.charAt(0)),(_=>_.charCodeAt==null?_:_.charCodeAt(0))(x)=="-".charCodeAt(0)?v=-1:v=1,D=d.getDoubleValue$java_lang_String("PLTDECD"),T=d.getDoubleValue$java_lang_String("PLTDECM"),$=d.getDoubleValue$java_lang_String("PLTDECS"),K=v*(D+T/60+$/3600),this.plate_dec=W.degrad(K),w=this.equinox|0,w===1950?this.radecsys="FK4":this.radecsys="FK5",this.epoch=this.equinox,d.findKey("EPOCH")&&(this.epoch=d.getDoubleValue$java_lang_String("EPOCH")),this.plate_scale=d.getDoubleValue$java_lang_String("PLTSCALE"),this.x_pixel_size=d.getDoubleValue$java_lang_String("XPIXELSZ"),this.y_pixel_size=d.getDoubleValue$java_lang_String("YPIXELSZ"),this.x_pixel_offset=d.getDoubleValue$java_lang_String("CNPIX1"),this.y_pixel_offset=d.getDoubleValue$java_lang_String("CNPIX2"),this.ppo_coeff[0]=d.getDoubleValue$java_lang_String("PPO1"),this.ppo_coeff[1]=d.getDoubleValue$java_lang_String("PPO2"),this.ppo_coeff[2]=d.getDoubleValue$java_lang_String("PPO3"),this.ppo_coeff[3]=d.getDoubleValue$java_lang_String("PPO4"),this.ppo_coeff[4]=d.getDoubleValue$java_lang_String("PPO5"),this.ppo_coeff[5]=d.getDoubleValue$java_lang_String("PPO6"),this.amd_x_coeff[0]=d.getDoubleValue$java_lang_String("AMDX1"),this.amd_x_coeff[1]=d.getDoubleValue$java_lang_String("AMDX2"),this.amd_x_coeff[2]=d.getDoubleValue$java_lang_String("AMDX3"),this.amd_x_coeff[3]=d.getDoubleValue$java_lang_String("AMDX4"),this.amd_x_coeff[4]=d.getDoubleValue$java_lang_String("AMDX5"),this.amd_x_coeff[5]=d.getDoubleValue$java_lang_String("AMDX6"),this.amd_x_coeff[6]=d.getDoubleValue$java_lang_String("AMDX7"),this.amd_x_coeff[7]=d.getDoubleValue$java_lang_String("AMDX8"),this.amd_x_coeff[8]=d.getDoubleValue$java_lang_String("AMDX9"),this.amd_x_coeff[9]=d.getDoubleValue$java_lang_String("AMDX10"),this.amd_x_coeff[10]=d.getDoubleValue$java_lang_String("AMDX11"),this.amd_x_coeff[11]=d.getDoubleValue$java_lang_String("AMDX12"),this.amd_x_coeff[12]=d.getDoubleValue$java_lang_String("AMDX13"),this.amd_x_coeff[13]=d.getDoubleValue$java_lang_String("AMDX14"),this.amd_x_coeff[14]=d.getDoubleValue$java_lang_String("AMDX15"),this.amd_x_coeff[15]=d.getDoubleValue$java_lang_String("AMDX16"),this.amd_x_coeff[16]=d.getDoubleValue$java_lang_String("AMDX17"),this.amd_x_coeff[17]=d.getDoubleValue$java_lang_String("AMDX18"),this.amd_x_coeff[18]=d.getDoubleValue$java_lang_String("AMDX19"),this.amd_x_coeff[19]=d.getDoubleValue$java_lang_String("AMDX20"),this.amd_y_coeff[0]=d.getDoubleValue$java_lang_String("AMDY1"),this.amd_y_coeff[1]=d.getDoubleValue$java_lang_String("AMDY2"),this.amd_y_coeff[2]=d.getDoubleValue$java_lang_String("AMDY3"),this.amd_y_coeff[3]=d.getDoubleValue$java_lang_String("AMDY4"),this.amd_y_coeff[4]=d.getDoubleValue$java_lang_String("AMDY5"),this.amd_y_coeff[5]=d.getDoubleValue$java_lang_String("AMDY6"),this.amd_y_coeff[6]=d.getDoubleValue$java_lang_String("AMDY7"),this.amd_y_coeff[7]=d.getDoubleValue$java_lang_String("AMDY8"),this.amd_y_coeff[8]=d.getDoubleValue$java_lang_String("AMDY9"),this.amd_y_coeff[9]=d.getDoubleValue$java_lang_String("AMDY10"),this.amd_y_coeff[10]=d.getDoubleValue$java_lang_String("AMDY11"),this.amd_y_coeff[11]=d.getDoubleValue$java_lang_String("AMDY12"),this.amd_y_coeff[12]=d.getDoubleValue$java_lang_String("AMDY13"),this.amd_y_coeff[13]=d.getDoubleValue$java_lang_String("AMDY14"),this.amd_y_coeff[14]=d.getDoubleValue$java_lang_String("AMDY15"),this.amd_y_coeff[15]=d.getDoubleValue$java_lang_String("AMDY16"),this.amd_y_coeff[16]=d.getDoubleValue$java_lang_String("AMDY17"),this.amd_y_coeff[17]=d.getDoubleValue$java_lang_String("AMDY18"),this.amd_y_coeff[18]=d.getDoubleValue$java_lang_String("AMDY19"),this.amd_y_coeff[19]=d.getDoubleValue$java_lang_String("AMDY20"),this.wcson=1,this.c1type="RA-",this.c2type="DEC",this.ptype="PLATE",this.degout=0,this.ndec=3}else if((p=d.getStringValue$java_lang_String("CTYPE1"))!=null){let P=p.length;if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"LINEAR"))this.pcode=0,this.c1type=p,this.ptype=p;else if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"PIXEL"))this.pcode=-1,this.c1type=p,this.ptype=p;else if(P>1&&((_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="R".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="D".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0))){this.c1type=p.substring(0,2),P>2&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(2))!="-".charCodeAt(0)&&(this.c1type+=p.charAt(2)),P>3&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(3))!="-".charCodeAt(0)&&(this.c1type+=p.charAt(3)),P>4&&(this.ptype=p.substring(3,7)),this.pcode=0;for(let _=0;_<8;_++)if(((M,A,q=0)=>M.substr(q,A.length)===A)(this.ptype,this.ctypes[_])){this.pcode=_+1;break}}else throw console.error("WCSINIT: CTYPE1 not sky coordinates or LINEAR -> no WCS"),Object.defineProperty(new Error,"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if((p=d.getStringValue$java_lang_String("CTYPE2"))==null)throw console.error("WCSINIT: No CTYPE2 -> no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if(P=p.length,((_,M,A=0)=>_.substr(A,M.length)===M)(p,"LINEAR"))this.pcode=0,this.c2type=p;else if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"PIXEL"))this.pcode=-1,this.c2type=p;else if(P>1&&((_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="R".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="D".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0)))this.c2type=p.substring(0,2),P>2&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(2))!="-".charCodeAt(0)&&(this.c2type+=p.charAt(2)),P>3&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(3))!="-".charCodeAt(0)&&(this.c2type+=p.charAt(3)),((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"DEC")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"GLAT")?this.coorflip=1:this.coorflip=0,(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)?(this.degout=1,this.ndec=5):(this.degout=0,this.ndec=3);else throw console.error("WCSINIT: CTYPE2 not sky coordinates or LINEAR -> no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.xrefpix=d.getDoubleValue$java_lang_String$double("CRPIX1",1),this.yrefpix=d.getDoubleValue$java_lang_String$double("CRPIX2",1),this.xref=d.getDoubleValue$java_lang_String$double("CRVAL1",1),this.yref=d.getDoubleValue$java_lang_String$double("CRVAL2",1),(this.xinc=d.getDoubleValue$java_lang_String("CDELT1"))!==0?(this.yinc=d.getDoubleValue$java_lang_String$double("CDELT2",this.xinc),this.rot=d.getDoubleValue$java_lang_String$double("CROTA1",0),this.rot===0&&(this.rot=d.getDoubleValue$java_lang_String("CROTA2")),this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.rotmat=0):(this.cd11=d.getDoubleValue$java_lang_String("CD1_1"))!==0?(this.rotmat=1,this.cd12=d.getDoubleValue$java_lang_String$double("CD1_2",0),this.cd21=d.getDoubleValue$java_lang_String$double("CD2_1",0),this.cd22=d.getDoubleValue$java_lang_String$double("CD2_2",this.cd11),E=this.cd11*this.cd22-this.cd12*this.cd21,E!==0&&(this.dc11=this.cd22/E,this.dc12=-this.cd12/E,this.dc21=-this.cd21/E,this.dc22=this.cd11/E),this.xinc=Math.sqrt(this.cd11*this.cd11+this.cd21*this.cd21),this.yinc=Math.sqrt(this.cd12*this.cd12+this.cd22*this.cd22),this.cd11*this.cd11-this.cd12*this.cd12<0?((((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"RA")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"GLON"))&&(this.xinc=-this.xinc),(((_,M,A=0)=>_.substr(A,M.length)===M)(this.c2type,"RA")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c2type,"GLON"))&&(this.yinc=-this.yinc),this.rot=W.raddeg(Math.atan2(-this.cd12,this.cd22))):this.rot=W.raddeg(Math.atan2(this.cd12,this.cd22))):(this.xinc=1,this.yinc=1,console.error("WCSINIT: setting CDELT to 1")),this.xmpix=d.getDoubleValue$java_lang_String("CCPIX1"),this.ympix=d.getDoubleValue$java_lang_String("CCPIX2"),this.mrot=d.getDoubleValue$java_lang_String("CCROT1"),((_,M,A=0)=>_.substr(A,M.length)===M)(this.ptype,"LINEAR")&&((_,M,A=0)=>_.substr(A,M.length)===M)(this.ptype,"PIXEL")?this.degout=-1:this.wcseq(d),this.wcson=1}else if(d.findKey("SECPIX")||d.findKey("PIXSCAL1")||d.findKey("SECPIX1")){if(S=d.getDoubleValue$java_lang_String$double("SECPIX",0),S===0?(S=d.getDoubleValue$java_lang_String$double("SECPIX1",0),S!==0?(this.xinc=-S/3600,S=d.getDoubleValue$java_lang_String$double("SECPIX2",0),this.yinc=S/3600):(S=d.getDoubleValue$java_lang_String$double("PIXSCAL1",0),this.xinc=-S/3600,S=d.getDoubleValue$java_lang_String$double("PIXSCAL2",0),this.yinc=S/3600)):(this.yinc=S/3600,this.xinc=-this.yinc),this.xrefpix=d.getDoubleValue$java_lang_String$double("CRPIX1",this.nxpix*.5),this.yrefpix=d.getDoubleValue$java_lang_String$double("CRPIX2",this.nypix*.5),this.xref=0,(this.xref=d.getDoubleValue$java_lang_String$double("RA",0))===0)throw console.error("WCSINIT: No RA with SECPIX, no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if(this.yref=0,(this.yref=d.getDoubleValue$java_lang_String$double("DEC",0))===0)throw console.error("WCSINIT: No DEC with SECPIX, no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.c1type="RA--TAN",this.c2type="DEC-TAN",this.ptype="-TAN",this.pcode=1,this.coorflip=0,this.degout=0,this.ndec=3,this.rot=d.getDoubleValue$java_lang_String$double("CROTA1",0),this.rot===0&&(this.rot=d.getDoubleValue$java_lang_String$double("CROTA2",0)),this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.dc11=0,this.dc21=0,this.dc12=0,this.dc22=0,this.rotmat=0,this.xmpix=d.getDoubleValue$java_lang_String("CCPIX1"),this.ympix=d.getDoubleValue$java_lang_String("CCPIX2"),this.mrot=d.getDoubleValue$java_lang_String("CCROT1"),this.wcseq(d),(this.epoch=d.getDoubleValue$java_lang_String$double("DATE-OBS",0))===0&&(this.epoch=d.getDoubleValue$java_lang_String$double("EPOCH",0))===0&&(this.epoch=this.equinox),this.wcson=1}else throw Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.sysout=this.radecsys,this.changesys=0,this.printsys=1,this.tabsys=0,this.wcsfull()}else throw new Error("invalid overload")}getEquinox(){return this.equinox}getWCSCenter(){if(this.isValid())return new We.Point2D(this.fCenterRa,this.fCenterDec);throw Object.defineProperty(new Error("No WCS information."),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}getImageCenter(){return new We.Point2D(.5*this.nxpix,.5*this.nypix)}isWCS(){return this.isValid()}imageToWorldCoords(e,t){if(!!this.isValid())if(t)e.x=Math.abs(e.x*this.degPerPixel.x),e.y=Math.abs(e.y*this.degPerPixel.y);else{let i=this.pix2wcs(e.x,e.y);if(i!=null)e.setLocation(i.x,i.y);else throw Object.defineProperty(new Error("Image coordinates out of WCS range: "+e),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}}worldToImageCoords(e,t){if(!!this.isValid())if(t)e.x=Math.abs(e.x/this.degPerPixel.x),e.y=Math.abs(e.y/this.degPerPixel.y);else{let i=this.wcs2pix(e.x,e.y);if(i!=null)e.setLocation(i.x,i.y);else throw Object.defineProperty(new Error("World coordinates out of range: "+e),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}}getWidthInDeg(){return this.fWidthDeg}getHeightInDeg(){return this.fHeightDeg}getWidth(){return this.nxpix}getHeight(){return this.nypix}wcseq(e){let t=0,i;e.findKey("EQUINOX")?(this.equinox=e.getDoubleValue$java_lang_String("EQUINOX"),t=2e3):e.findKey("EPOCH")?(t=e.getDoubleValue$java_lang_String$double("EPOCH",0)|0,t===0?(t=1950,this.equinox=1950):this.equinox=e.getDoubleValue$java_lang_String("EPOCH")):e.findKey("RADECSYS")&&(i=e.getStringValue$java_lang_String("RADECSYS"),((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK4")?(this.equinox=1950,t=1950):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK5")?(this.equinox=2e3,t=2e3):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"GAL")?(this.equinox=2e3,t=2e3):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"ECL")&&(this.equinox=2e3,t=2e3)),t===0&&(this.equinox=2e3,t=2e3),(this.epoch=e.getDoubleValue$java_lang_String$double("DATE-OBS",0))===0&&(this.epoch=e.getDoubleValue$java_lang_String$double("EPOCH",0))===0&&(this.epoch=this.equinox),this.epoch===0&&(this.epoch=this.equinox),e.findKey("RADECSYS")?((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK4")?this.equinox=1950:((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK5")?this.equinox=2e3:((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"GAL")&&t===0&&(this.equinox=2e3):(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="G".charCodeAt(0)?this.radecsys="GALACTIC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="E".charCodeAt(0)?this.radecsys="ECLIPTIC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="S".charCodeAt(0)?this.radecsys="SGALACTC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="H".charCodeAt(0)?this.radecsys="HELIOECL":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="A".charCodeAt(0)?this.radecsys="ALTAZ":t>1980?this.radecsys="FK5":this.radecsys="FK4"}isValid(){return this.wcson>0}wcsshift(e,t,i){!this.isValid()||(this.fCenterRa=this.xref=e,this.fCenterDec=this.yref=t,this.radecsys=i,((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK4")?this.equinox=1950:this.equinox=2e3)}wcssize(){let e,t,i,n;if(this.isValid()){e=.5*this.nxpix,t=.5*this.nypix;let r=this.pix2wcs(e,t);if(r==null)return;this.fCenterRa=r.x,this.fCenterDec=r.y;let s=this.pix2wcs(1,t),a=this.pix2wcs(this.nxpix,t);if(s==null||a==null||(!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"LINEAR")&&!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"PIXEL")?(i=this.wcsdist(s.x,s.y,a.x,a.y),this.fHalfWidthRa=i*.5/Math.cos(W.degrad(this.fCenterDec))):this.fHalfWidthRa=Math.sqrt((a.y-s.y)*(a.y-s.y)+(a.x-s.x)*(a.x-s.x)),s=this.pix2wcs(e,1),a=this.pix2wcs(e,this.nypix),s==null||a==null))return;!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"LINEAR")&&!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"PIXEL")?(n=this.wcsdist(s.x,s.y,a.x,a.y),this.fHalfWidthDec=n*.5):this.fHalfWidthDec=Math.sqrt((a.y-s.y)*(a.y-s.y)+(a.x-s.x)*(a.x-s.x))}}wcsfull(){let e,t;if(this.isValid()){e=.5*this.nxpix,t=.5*this.nypix;let i=this.pix2wcs(e,t);if(i==null)return;this.fCenterRa=i.x,this.fCenterDec=i.y;let n=this.pix2wcs(0,t),r=this.pix2wcs(this.nxpix,t);if(n==null||r==null||(!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"LINEAR")&&!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"PIXEL")?this.fWidthDeg=this.wcsdist(n.x,n.y,r.x,r.y):this.fWidthDeg=Math.sqrt((r.y-n.y)*(r.y-n.y)+(r.x-n.x)*(r.x-n.x)),n=this.pix2wcs(e,0),r=this.pix2wcs(e,this.nypix),n==null||r==null))return;!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"LINEAR")&&!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"PIXEL")?this.fHeightDeg=this.wcsdist(n.x,n.y,r.x,r.y):this.fHeightDeg=Math.sqrt((r.y-n.y)*(r.y-n.y)+(r.x-n.x)*(r.x-n.x)),this.degPerPixel=new We.Point2D(this.fWidthDeg/this.nxpix,this.fHeightDeg/this.nypix)}}wcsdist(e,t,i,n){let r,s,a,f,o=[0,0,0],u=[0,0,0],c,h,g,d;for(r=W.degrad(e),a=W.degrad(t),g=Math.cos(a),o[0]=Math.cos(r)*g,o[1]=Math.sin(r)*g,o[2]=Math.sin(a),s=W.degrad(i),f=W.degrad(n),g=Math.cos(f),u[0]=Math.cos(s)*g,u[1]=Math.sin(s)*g,u[2]=Math.sin(f),c=0,d=0;d<3;d++)c=c+(o[d]-u[d])*(o[d]-u[d]);return c=c/4,c>1&&(c=1),h=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),h=W.raddeg(h),h}pix2wcs(e,t){let i;return this.isValid()?(this.xpix=e,this.ypix=t,this.offscl=0,this.plate_fit>0?(i=Vt.platepos.getPosition(e,t,this))==null&&(this.offscl=1):(i=It.worldpos.getPosition(e,t,this))==null&&(this.offscl=1),this.pcode>0&&(((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK4")?this.equinox!==1950&&(i=se.wcscon.fk4prec(this.equinox,1950,i)):((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK5")&&this.equinox!==2e3&&(i=se.wcscon.fk5prec(this.equinox,2e3,i)),this.changesys===1?i=se.wcscon.fk425e(i,this.epoch):this.changesys===2?i=se.wcscon.fk524e(i,this.epoch):this.changesys===3?i=se.wcscon.fk42gal(i):this.changesys===4&&(i=se.wcscon.fk52gal(i))),this.offscl===0&&i!=null&&(this.xpos=i.x,this.ypos=i.y),i):null}wcs2pix(e,t){let i;if(!this.isValid())return null;this.xpos=e,this.ypos=t;let n=new We.Point2D(e,t);return this.changesys===1?n=se.wcscon.fk524e(n,this.epoch):this.changesys===2&&(n=se.wcscon.fk425e(n,this.epoch)),((r,s,a=0)=>r.substr(a,s.length)===s)(this.radecsys,"FK4")?this.equinox!==1950&&(n=se.wcscon.fk4prec(1950,this.equinox,n)):((r,s,a=0)=>r.substr(a,s.length)===s)(this.radecsys,"FK5")&&this.equinox!==2e3&&(n=se.wcscon.fk5prec(2e3,this.equinox,n)),this.plate_fit>0?(i=Vt.platepos.getPixels(n.x,n.y,this))==null&&(this.offscl=1):(i=It.worldpos.getPixels(n.x,n.y,this))==null&&(this.offscl=1),i!=null&&(this.xpix=i.x,this.ypix=i.y),i}};Ne.WCSTransform=W;W.NO_WCS_IN_HEADER_MESSAGE="The header does not contain a valid world coordinate system.";W.__class="coordtxl.coords.WCSTransform";W.__interfaces=["coordtxl.coords.WorldCoordinateConverter"];var se=jt(),It=$t(),Vt=Tt()});var wt=Z(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.Trigod=void 0;var H=class{static DEG_$LI$(){return H.DEG==null&&(H.DEG=180/Math.PI),H.DEG}static fractionalPart(e){return Math.abs(e-(e|0))}static cosd(e){let t=0,i=H.fractionalPart(e/360);return i>.5&&(i=1-i),i>.25&&(i=.5-i,t=1),i>.125?i=Math.sin(Math.PI*2*(.25-i)):i=Math.cos(Math.PI*2*i),t!==0&&(i=-i),i}static sind(e){let t=H.fractionalPart(e/360),i=e>=0?0:1;return t>.5&&(t=1-t,i^=1),t>.25&&(t=.5-t),t>.125?t=Math.cos(Math.PI*2*(.25-t)):t=Math.sin(Math.PI*2*t),i!==0&&(t=-t),t}static tand(e){let t=H.fractionalPart(e/180);return t===.5?t=H.DOUBLE_MAX:t=Math.tan(Math.PI*t),e>0?t:-t}static atand(e){return H.DEG_$LI$()*Math.atan(e)}static atan2d(e,t){return H.DEG_$LI$()*Math.atan2(e,t)}static acosd(e){return H.DEG_$LI$()*Math.acos(e)}asind(e){return H.DEG_$LI$()*Math.asin(e)}};qe.Trigod=H;H.DOUBLE_MAX=17e37;H.__class="coordtxl.coords.Trigod"});var Ot=Z(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.Cotr=void 0;var ne=class{static tr_Euler(e,t){let s;t[0][2]=U.Trigod.cosd(e[0]),t[1][2]=U.Trigod.sind(e[0]),t[2][0]=U.Trigod.cosd(e[2]),t[2][1]=U.Trigod.sind(e[2]),t[2][2]=U.Trigod.cosd(e[1]),s=U.Trigod.sind(e[1]),t[0][0]=t[2][0]*t[2][2]*t[0][2]-t[2][1]*t[1][2],t[1][0]=t[2][0]*t[2][2]*t[1][2]+t[2][1]*t[0][2],t[0][1]=-t[2][1]*t[2][2]*t[0][2]-t[2][0]*t[1][2],t[1][1]=-t[2][1]*t[2][2]*t[1][2]+t[2][0]*t[0][2],t[2][0]=t[2][0]*s,t[2][1]=-t[2][1]*s,t[0][2]=-s*t[0][2],t[1][2]=-s*t[1][2]}static tr_oo(e,t,i){let n=[0,0,0];ne.tr_ou(e,n),ne.tr_uu(n,n,i),ne.tr_uo(n,t)}static tr_oo1(e,t,i){let n=[0,0,0];ne.tr_ou(e,n),ne.tr_uu1(n,n,i),ne.tr_uo(n,t)}static tr_oR(e,t){let i=e[0],n=e[1];t[2][2]=U.Trigod.cosd(n),t[0][2]=U.Trigod.sind(n),t[1][1]=U.Trigod.cosd(i),t[1][0]=-U.Trigod.sind(i),t[1][2]=0,t[0][0]=t[2][2]*t[1][1],t[0][1]=-t[2][2]*t[1][0],t[2][0]=-t[0][2]*t[1][1],t[2][1]=t[0][2]*t[1][0]}static tr_ou(e,t){let i=e[0],n=e[1],r=U.Trigod.cosd(n);t[0]=r*U.Trigod.cosd(i),t[1]=r*U.Trigod.sind(i),t[2]=U.Trigod.sind(n)}static tr_uo(e,t){let i=e[0],n=e[1],r=e[2],s=i*i+n*n;if(t[0]=0,s===0){if(r===0)return;t[1]=r>0?90:-90;return}t[1]=U.Trigod.atand(r/Math.sqrt(s)),t[0]=U.Trigod.atan2d(n,i),t[0]<0&&(t[0]+=360)}static tr_uR(e,t){let i=e[0],n=e[1],r=e[2];t[0][0]=i,t[0][1]=n,t[0][2]=r,t[2][2]=Math.sqrt(i*i+n*n),t[1][0]=0,t[1][1]=1,t[1][2]=0,t[2][2]!==0&&(t[1][1]=i/t[2][2],t[1][0]=-n/t[2][2]),t[2][0]=-t[0][2]*t[1][1],t[2][1]=t[0][2]*t[1][0]}static tr_uu(e,t,i){let n,r,s,a=[0,0,0];for(n=0;n<3;n++){for(s=0,r=0;r<3;r++)s+=i[n][r]*e[r];a[n]=s}for(n=0;n<3;n++)t[n]=a[n]}static tr_uu1(e,t,i){let n,r,s,a=[0,0,0];for(n=0;n<3;n++){for(r=0,s=0;r<3;r++)s+=i[r][n]*e[r];a[n]=s}for(n=0;n<3;n++)t[n]=a[n]}static tr_RR(e,t,i){let n,r,s,a,f=function(o){let u=function(c){if(c.length===0)return 0;{let h=[];for(let g=0;g<c[0];g++)h.push(u(c.slice(1)));return h}};return u(o)}([3,3]);for(n=0;n<3;n++)for(r=0;r<3;r++){for(s=0,a=0;s<3;s++)a+=i[n][s]*e[s][r];f[n][r]=a}for(n=0;n<3;n++)for(r=0;r<3;r++)t[n][r]=f[n][r]}static tr_RR1(e,t,i){let n,r,s,a,f=function(o){let u=function(c){if(c.length===0)return 0;{let h=[];for(let g=0;g<c[0];g++)h.push(u(c.slice(1)));return h}};return u(o)}([3,3]);for(n=0;n<3;n++)for(r=0;r<3;r++){for(s=0,a=0;s<3;s++)a+=i[s][n]*e[s][r];f[n][r]=a}for(n=0;n<3;n++)for(r=0;r<3;r++)t[n][r]=f[n][r]}};ke.Cotr=ne;ne.__class="coordtxl.coords.Cotr";var U=wt()});var Lt=Z(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.JPrec=void 0;var ce=class{static prej_R(e,t,i){let n,r,s,a=[0,0,0],f=0,o=1,u=2;n=(t-2e3)/100,r=(i-t)/100,s=2306.2181+(1.39656-139e-6*n)*n,a[u]=(s+(.30188-344e-6*n+.017998*r)*r)*r/3600,a[f]=(s+(1.09468+66e-6*n+.018203*r)*r)*r/3600,a[o]=(2004.3109+(-.8533-217e-6*n)*n+(-.42665-217e-6*n-.041833*r)*r)*r/3600,ze.Cotr.tr_Euler(a,e)}static prej_q(e,t,i,n){let r=[0,0,0];if(i===n){t[0]=e[0],t[1]=e[1];return}ze.Cotr.tr_ou(e,r),ce.prej_u(r,r,i,n),ze.Cotr.tr_uo(r,t)}static prej_u(e,t,i,n){let r=[[1,0,0],[0,1,0],[0,0,1]];if(i===n){t[0]=e[0],t[1]=e[1],t[2]=e[2];return}ce.prej_R(r,i,n),ze.Cotr.tr_uu(e,t,r)}};Re.JPrec=ce;ce.__class="coordtxl.coords.JPrec";var ze=Ot()});var it=Z(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.StringUtil=void 0;var me=class{static replace(e,t,i){return e.split(t).join(i)}static split(e,t){let i=e.indexOf(String.fromCharCode(t));if(i>0){let n;return n=[null,null],n[0]=e.substring(0,i),n[1]=e.substring(i+1),n}return null}static combine(e,t){if(e==null)return"";let i={str:"",toString:function(){return this.str}};for(let n=0;n<e.length;n++)(r=>(r.str+=e[n],r))(i),n+1<e.length&&(r=>(r.str+=t,r))(i);return i.str}static equals(e,t){return e==null&&t==null||!(e==null||t==null)&&e===t}static match(e,t){let i=t.length,n=e.length;for(let r=0;;r++){for(let s=0;;r++,s++){let a=s>=i,f=r>=n||(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="|".charCodeAt(0);if(a&&!f&&(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="*".charCodeAt(0)&&(r===n-1||r<n-1&&(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r+1))=="|".charCodeAt(0))||a&&f)return!0;if(a||f)break;if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="?".charCodeAt(0))continue;if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="*".charCodeAt(0)||(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="%".charCodeAt(0)){r++;for(let o=i;o>=s;--o)if(me.match(e.substring(r),t.substring(o)))return!0;break}if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r).toUpperCase())!=(o=>o.charCodeAt==null?o:o.charCodeAt(0))(t.charAt(s).toUpperCase()))break}if(r=e.indexOf("|",r),r===-1)return!1}}static pad(e,t,i){let n={str:"",toString:function(){return this.str}};if(i){(s=>(s.str+=e,s))(n);let r=e.length;for(;r++<t;)(s=>(s.str+=" ",s))(n)}else{let r=e.length;for(;r++<t;)(s=>(s.str+=" ",s))(n);(s=>(s.str+=e,s))(n)}return n.str}static arrayContains(e,t){for(let i=0;i<e.length;i++){let n=e[i];if(t===n)return!0}return!1}static capitalize(e){if(e==null||e.length===0)return e;let t={str:"",toString:function(){return this.str}},i=e.split("[\\s]+");for(let n=0;n<i.length;n++){let r=i[n];{let s=r.trim();s.length!==0&&((a=>(a.str+=s.substring(1).toLowerCase(),a))((a=>(a.str+=s.substring(0,1).toUpperCase(),a))(t)),(a=>(a.str+=" ",a))(t))}}return t.str.trim()}};Xe.StringUtil=me;me.__class="coordtxl.util.StringUtil"});var Kt=Z(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.DMS=void 0;var ci=it(),J=class{static fmt_deg_min(e){let t=Math.round(e),i=(""+t).split(".").join("@").split("@");if(i.length<1)return"00";let n="";for(let r=i[0].length;r<2;++r)n+="0";for(let r=i[0].length>2?i[0].length-2:0;r<i[0].length;++r)n+=i[0].charAt(r);return n}static fmt_sec(e){let t=Math.round(e*100)/100,i=(""+t).split(".").join("@").split("@");if(i.length===0)return"00.00";if(i.length<2)return i[0]+".00";let n="";for(let s=i[0].length;s<2;++s)n+="0";for(let s=i[0].length>2?i[0].length-2:0;s<i[0].length;++s)n+=i[0].charAt(s);n+=".";let r=0;for(;r<2&&r<i[1].length;++r)n+=i[1].charAt(r);for(;r<2;++r)n+="0";return n}constructor(e,t,i){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)){let n=arguments;this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.set(e,t,i)}else if((e!=null&&e instanceof J||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r.val)}else if((typeof e=="string"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=ci.StringUtil.replace(r,",",".");let s=[0,0,0],a=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),f=0;for(;f<3&&f<a.length;)s[f]=parseFloat(a[f]),f+=1;if(f>=2)this.set(s[0],s[1]|0,s[2]);else if(f===1)this.setVal(s[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}else if((typeof e=="number"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r)}else if(e===void 0&&t===void 0&&i===void 0){let n=arguments;this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else throw new Error("invalid overload")}set(e,t,i){this.degrees=e|0,this.min=t,this.sec=i,this.val=(i/60+t)/60,e<0||e===J.MINUS_ZERO?(this.val=e-this.val,this.degrees=-this.degrees,this.sign=-1):(this.val=this.degrees+this.val,this.sign=1),this.initialized=!0}setVal(e){this.val=e;let t=e;t<0||t===J.MINUS_ZERO?(this.sign=-1,t=-t):this.sign=1;let i=t+1e-10;this.degrees=i|0;let n=(i-this.degrees)*60;this.min=n|0,this.sec=(n-this.min)*60,this.initialized=!0}toString$(){let e=J.fmt_sec(this.sec),t;return this.sign===-1?t="-":t="+",t+J.fmt_deg_min(this.degrees)+":"+J.fmt_deg_min(this.min)+":"+e}toString$boolean(e){if(e)return this.toString$();let t;return this.sign===-1?t="-":t="+",t+J.fmt_deg_min(this.degrees)+":"+J.fmt_deg_min(this.min)}toString(e){if(typeof e=="boolean"||e===null)return this.toString$boolean(e);if(e===void 0)return this.toString$();throw new Error("invalid overload")}isInitialized(){return this.initialized}getDegrees(){return this.degrees}getMin(){return this.min}getSec(){return this.sec}getVal(){return this.val}getSign(){return this.sign}equals(e){return e!=null&&e instanceof J&&this.val===e.val}};He.DMS=J;J.MINUS_ZERO=-0;J.__class="coordtxl.coords.DMS"});var Nt=Z(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.HMS=void 0;var Wt=it(),Q=class{static fmt_hr_min(e){let t=Math.round(e),i=(""+t).split(".").join("@").split("@");if(i.length<1)return"00";let n="";for(let r=i[0].length;r<2;++r)n+="0";for(let r=i[0].length>2?i[0].length-2:0;r<i[0].length;++r)n+=i[0].charAt(r);return n}static fmt_sec(e){let t=Math.round(e*1e3)/1e3,i=(""+t).split(".").join("@").split("@");if(i.length===0)return"00.000";if(i.length<2)return i[0]+".000";let n="";for(let s=i[0].length;s<2;++s)n+="0";for(let s=i[0].length>2?i[0].length-2:0;s<i[0].length;++s)n+=i[0].charAt(s);n+=".";let r=0;for(;r<3&&r<i[1].length;++r)n+=i[1].charAt(r);for(;r<3;++r)n+="0";return n}constructor(e,t,i){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)){let n=arguments;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.set(e,t,i)}else if((typeof e=="string"||e===null)&&(typeof t=="boolean"||t===null)&&i===void 0){let n=arguments,r=n[0],s=n[1];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=Wt.StringUtil.replace(r,",",".");let a=[0,0,0],f=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),o=0;for(;o<3&&o<f.length;)a[o]=parseFloat(f[o]),o+=1;if(o>=2)this.set(a[0],a[1]|0,a[2]);else if(o===1)!s&&r.indexOf(".")!==-1?this.setVal(a[0]/15):this.setVal(a[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}else if((e!=null&&e instanceof Q||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r.val)}else if((typeof e=="string"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];{let s=arguments,a=!1;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=Wt.StringUtil.replace(r,",",".");let f=[0,0,0],o=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),u=0;for(;u<3&&u<o.length;)f[u]=parseFloat(o[u]),u+=1;if(u>=2)this.set(f[0],f[1]|0,f[2]);else if(u===1)!a&&r.indexOf(".")!==-1?this.setVal(f[0]/15):this.setVal(f[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else if((typeof e=="number"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r)}else if(e===void 0&&t===void 0&&i===void 0){let n=arguments;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else throw new Error("invalid overload")}set(e,t,i){this.hours=e|0,this.min=t,this.sec=i,this.val=(i/60+t)/60,e<0||e===Q.MINUS_ZERO?(this.val=e-this.val,this.hours=-this.hours,this.sign=-1):(this.val=this.hours+this.val,this.sign=1),this.initialized=!0}setVal(e){this.val=e;let t=e;t<0||t===Q.MINUS_ZERO?(this.sign=-1,t=-t):this.sign=1;let i=t+1e-10;this.hours=i|0;let n=(i-this.hours)*60;this.min=n|0,this.sec=(n-this.min)*60,this.initialized=!0}toString$(){let e=Q.fmt_sec(this.sec),t;return this.sign===-1?t="-":t="",t+Q.fmt_hr_min(this.hours)+":"+Q.fmt_hr_min(this.min)+":"+e}toString$boolean(e){if(e)return this.toString$();let t;return this.sign===-1?t="-":t=" ",t+Q.fmt_hr_min(this.hours)+":"+Q.fmt_hr_min(this.min)}toString(e){if(typeof e=="boolean"||e===null)return this.toString$boolean(e);if(e===void 0)return this.toString$();throw new Error("invalid overload")}isInitialized(){return this.initialized}getHours(){return this.hours}getMin(){return this.min}getSec(){return this.sec}getVal(){return this.val}getSign(){return this.sign}equals(e){return e!=null&&e instanceof Q&&this.val===e.val}};Ye.HMS=Q;Q.MINUS_ZERO=-0;Q.__class="coordtxl.coords.HMS"});var kt=Z(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.WorldCoords=void 0;var qt=ue(),Y=class{constructor(e,t,i,n,r,s,a){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&(typeof a=="number"||a===null)){let f=arguments;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(e,t,i),this.dec=new G.DMS(n,r,s),this.init(a)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&a===void 0){let f=arguments;{let o=arguments,u=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(e,t,i),this.dec=new G.DMS(n,r,s),this.init(u)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="boolean"||n===null)&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2],h=f[3];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o,h),this.dec=new G.DMS(u),this.init(c)}else if((e!=null&&e instanceof B.HMS||e===null)&&(t!=null&&t instanceof G.DMS||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=o,this.dec=u,this.init(c)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(c)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o),this.dec=new G.DMS(u),this.init(c)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="boolean"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];{let h=arguments,g=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o,c),this.dec=new G.DMS(u),this.init(g)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(c)}else if((e!=null&&e instanceof B.HMS||e===null)&&(t!=null&&t instanceof G.DMS||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=o,this.dec=u,this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=c[0],g=c[1],d=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(h/15),this.dec=new G.DMS(g),this.init(d)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o),this.dec=new G.DMS(u),this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((e!=null&&e instanceof qt.Point2D||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=o.getX(),g=o.getY();this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(h/15),this.dec=new G.DMS(g),this.init(u)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((e!=null&&e instanceof qt.Point2D||e===null)&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let o=arguments[0];{let u=arguments,c=o.getX(),h=o.getY(),g=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(c/15),this.dec=new G.DMS(h),this.init(g)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if(e===void 0&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS,this.dec=new G.DMS}else throw new Error("invalid overload")}getRA(){return this.ra}getDec(){return this.dec}getRaDeg(){return this.ra.getVal()*15}getDecDeg(){return this.dec.getVal()}getX(){return this.ra.getVal()*15}getY(){return this.dec.getVal()}toString(){return this.ra.toString$()+", "+this.dec.toString$()+" J2000"}format$double(e){let t=[null,null];if(e===2e3)t[0]=this.ra.toString$(),t[1]=this.dec.toString$();else{let i=new Y(this.ra,this.dec);i.convertEquinox(2e3,e),t[0]=i.ra.toString$(),t[1]=i.dec.toString$()}return t}format(e){if(typeof e=="number"||e===null)return this.format$double(e);if(e===void 0)return this.format$();throw new Error("invalid overload")}format$(){return this.format$double(2e3)}getRaDec(e){let t=[0,0];if(e===2e3)t[0]=this.getRaDeg(),t[1]=this.getDecDeg();else{let i=new Y(this.ra,this.dec);i.convertEquinox(2e3,e),t[0]=i.getRaDeg(),t[1]=i.getDecDeg()}return t}static dispos(e,t,i,n){let r=[0,0],s,a,f,o,u,c,h,g,d,p,x,y,m,C,v=180/Math.PI;s=i/v,a=e/v,f=n/v,o=t/v,h=Math.sin(o),c=Math.sin(f),d=Math.cos(o),g=Math.cos(f),p=Math.cos(s-a),x=h*c+d*g*p;let D=Math.acos(x);return u=0,D>4e-7&&(y=Math.sin(D),C=(c*d-g*h*p)/y,Math.abs(C)>1&&(C=C/Math.abs(C)),m=g*Math.sin(s-a)/y,u=Math.acos(C)*v,m<0&&(u=360-u)),D*=v,D*=60,t===90&&(u=180),t===-90&&(u=0),r[0]=D,r[1]=u,r}dispos(e){return Y.dispos(this.getRaDeg(),this.getDecDeg(),e.getRaDeg(),e.getDecDeg())}static wcsdist(e,t,i,n){let r,s,a,f,o,u,c,h=[0,0,0],g=[0,0,0],d,p=Math.PI/180;for(r=e*p,a=t*p,c=Math.cos(a),h[0]=Math.cos(r)*c,h[1]=Math.sin(r)*c,h[2]=Math.sin(a),s=i*p,f=n*p,c=Math.cos(f),g[0]=Math.cos(s)*c,g[1]=Math.sin(s)*c,g[2]=Math.sin(f),o=0,d=0;d<3;d++)o=o+(h[d]-g[d])*(h[d]-g[d]);return o=o/4,o>1&&(o=1),u=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)),u*180/Math.PI}dist$coordtxl_coords_WorldCoords(e){return Y.dispos(this.getRaDeg(),this.getDecDeg(),e.getRaDeg(),e.getDecDeg())[0]}dist(e){if(e!=null&&e instanceof Y||e===null)return this.dist$coordtxl_coords_WorldCoords(e);if(e!=null&&e.constructor!=null&&e.constructor.__interfaces!=null&&e.constructor.__interfaces.indexOf("coordtxl.coords.Coordinates")>=0||e===null)return this.dist$coordtxl_coords_Coordinates(e);throw new Error("invalid overload")}dist$coordtxl_coords_Coordinates(e){return this.dist$coordtxl_coords_WorldCoords(e)}static dist(e,t,i,n){return Y.dispos(e,t,i,n)[0]}box(e){let t=[null,null],i=this.ra.getVal(),n=this.dec.getVal();e/=60;let r=Math.sqrt(2*e*e),s,a,f,o,u;return f=n-r/2,f<=-90?(f=-90,o=n+r/2,s=0,a=24):(o=n+r/2,o>=90?(f=n-r/2,o=90,s=0,a=24):(n>0?u=Math.abs(Math.cos(f*Math.PI/180)):u=Math.abs(Math.cos(o*Math.PI/180)),s=i-r/15/2/u,a=i+r/15/2/u,s<0&&(s+=24),a>24&&(a-=24))),t[0]=new Y(s*15,f),t[1]=new Y(a*15,o),t}center(e,t){let i=[0,0,0,0,0],n=e.getRaDeg(),r=e.getDecDeg(),s=t.getRaDeg(),a=t.getDecDeg();return i[0]=(n+s)/2,i[1]=(r+a)/2,i[2]=Y.wcsdist(n,r,s,r)*60,i[3]=Y.wcsdist(n,r,n,a)*60,i[4]=Y.wcsdist(n,r,s,a)*60/2,i}getCoordinateSystemName(){return"wcs"}init(e){this.checkRange(),this.convertEquinox(e,2e3)}convertEquinox(e,t){if(e===t)return;let i=[0,0],n=[0,0];i[0]=this.ra.getVal()*15,i[1]=this.dec.getVal(),gi.JPrec.prej_q(i,n,e,t),this.ra=new B.HMS(n[0]/15),this.dec=new G.DMS(n[1])}checkRange(){let e=this.ra.getVal(),t=this.dec.getVal();e<-.001||e>=25,t<-90||t>90}};Fe.WorldCoords=Y;Y.__class="coordtxl.coords.WorldCoords";Y.__interfaces=["coordtxl.coords.WorldCoordinates","coordtxl.coords.Coordinates"];var gi=Lt(),G=Kt(),B=Nt()});var zt=Z(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.WorldCoords=ae.WCSTransform=ae.MapKeywordProvider=ae.Point2D=void 0;var pi=ue();Object.defineProperty(ae,"Point2D",{enumerable:!0,get:function(){return pi.Point2D}});var _i=At();Object.defineProperty(ae,"MapKeywordProvider",{enumerable:!0,get:function(){return _i.MapKeywordProvider}});var mi=we();Object.defineProperty(ae,"WCSTransform",{enumerable:!0,get:function(){return mi.WCSTransform}});var yi=kt();Object.defineProperty(ae,"WorldCoords",{enumerable:!0,get:function(){return yi.WorldCoords}})});function _t(l){if(typeof l._casagui_id_=="undefined"){let e=null;if(typeof window=="undefined"){if(typeof crypto!="undefined"){let n=crypto.randomBytes(8);e=new Uint32Array(n.buffer.slice(-4))}}else e=new Uint32Array(1),window.crypto.getRandomValues(e);let t=new Date,i=Math.floor(t.getTime()/1e3);l._casagui_id_=`${e?e[0]:i}-${i}`}return l._casagui_id_}function mt(l,e){if(Array.isArray(e))e.map(l);else if(typeof e=="object"&&e!==null)Object.entries(e).map(t=>l(t[0],t[1]));else throw new Error(`casalib.map applied to ${typeof e}`)}function yt(l,e,t){if(Array.isArray(e))return e.reduce(l,t);if(e instanceof Set)return[...e].reduce(l,t);if(typeof e=="object"&&e!==null)return Object.entries(e).reduce((i,n,r)=>l(i,n[0],n[1],r),t);throw new Error(`casalib.reduce applied to ${typeof e}`)}function xt(l,e){let t=null,i=function(){t!==null&&clearTimeout(t),t=window.setTimeout(()=>{l(),t=null},e)};return i.cancel=function(){t!==null&&(clearTimeout(t),t=null)},i}function et(l){return Array.isArray(l)&&(l.length==0||l.every(et))}function bt(l){if(l.length<1)return[NaN,NaN];let e,t;e=t=l[0];for(let i=l.length-1;i>0;--i)l[i]<e&&(e=l[i]),l[i]>t&&(t=l[i]);return[e,t]}function Ee(l){if(l instanceof Set)return Array.from(l).sort((e,t)=>e-t);if(Array.isArray(l))return l.slice().sort((e,t)=>e-t);throw new Error(`unexpected parameter type (${typeof l})`)}function Mt(l,e=!1){let t=[],i=l.split(",");for(let n of i){let[r,s]=n.trim().split(":"),a=parseInt(r,10),f=s?parseInt(s,10):a;if(isNaN(a)||isNaN(f))throw new Error(`Invalid range: ${n}`);if(a>f)if(e)t.push([f,a]);else throw new Error(`Invalid range: ${n}`);else t.push([a,f])}return t}function vt(l){return Ee(l).reduce((t,i)=>t[0][0]==null?[[i,i]]:i>t[0][1]+1?[[i,i],...t]:[[t[0][0],i],...t.slice(1)],[[null,-1]]).reverse().map(t=>t[0]==t[1]?`${t[0]}`:`${t[0]}:${t[1]}`).join(", ")}function St(l,e,t,i){let n=i;for(let r=l;r<=e;r++)n=t(n,r,r-l);return n}function Ct(){this.timeout=1e3,this.retries=20,this.connected=!0,this.backoff=()=>{this.connected=!1,this.timeout+=Math.floor(pt(1.8,22-this.retries)),this.retries-=1}}function je(...l){let e=Math.max(...l.map(i=>i.length)),t=[];for(let i=0;i<e;i++){let n=l.map(r=>r[i]);t.push(n)}return t}function Dt(l){return l.length<=0?l:l.reduce((e,t)=>e.map((i,n)=>[...i,t[n]]),l[0].map(e=>[]))}var he=class{constructor(){this.forwardMap=new Map,this.inverseMap=new Map}set(e,t){this.forwardMap.set(e,t),this.inverseMap.set(t,e)}get(e){return this.forwardMap.get(e)}getKey(e){return this.inverseMap.get(e)}delete(e){let t=this.forwardMap.get(e);if(t!==void 0)return this.forwardMap.delete(e),this.inverseMap.delete(t),t}deleteValue(e){let t=this.inverseMap.get(e);if(t!==void 0)return this.inverseMap.delete(e),this.forwardMap.delete(t),t}has(e){return this.forwardMap.has(e)}hasValue(e){return this.inverseMap.has(e)}clear(){this.forwardMap.clear(),this.inverseMap.clear()}get size(){return this.forwardMap.size}*entries(){return this.forwardMap.entries()}map(e){let t=[];for(let[i,n]of this.entries())t.push(e(n,i,this));return t}};var ye=class extends he{constructor(t){super();this.keyset=t;this.usedKeys=new Set,this.availKeys=new Set(t)}clear(){super.clear(),this.usedKeys=new Set,this.availKeys=new Set(this.keyset)}add(t){if(this.availKeys.size!==0)for(let i of this.availKeys)return this.availKeys.delete(i),this.usedKeys.add(i),super.set(i,t),i}get bound(){return new Set(this.keyset)}set(t,i){if(!this.keyset.has(t))throw new Error(`${t} is not a valid key`);this.availKeys.has(t)&&this.availKeys.delete(t),this.usedKeys.has(t)||this.usedKeys.add(t),super.set(t,i)}delete(t){return t&&(this.usedKeys.delete(t),this.availKeys.add(t)),super.delete(t)}deleteValue(t){let i=super.getKey(t);return i&&(this.usedKeys.delete(i),this.availKeys.add(i)),super.deleteValue(t)}};function _e(l,e){if(l===e)return!0;if(typeof l!=typeof e)return!1;if(Array.isArray(l)&&Array.isArray(e)){if(l.length!==e.length)return!1;for(let t=0;t<l.length;t++)if(!_e(l[t],e[t]))return!1;return!0}if(typeof l=="object"&&typeof e=="object"){let t=Object.keys(l),i=Object.keys(e);if(t.length!==i.length)return!1;for(let n of t)if(!i.includes(n)||!_e(l[n],e[n]))return!1;return!0}return!1}var de=class extends Set{constructor(t,i=_e){super(t);this.comparator=i}add(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return this}return super.add(t)}has(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return!0;return!1}return super.has(t)}delete(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return super.delete(i),!0;return!1}return super.delete(t)}difference(t){let i=new de(void 0,this.comparator);for(let n of this)t.has(n)||i.add(n);return i}intersection(t){let i=new de(void 0,this.comparator);for(let n of this)t.has(n)&&i.add(n);return i}};var ki=ui(zt());var nt=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function rt(l,e,t,i){l.addEventListener?l.addEventListener(e,t,i):l.attachEvent&&l.attachEvent("on".concat(e),function(){t(window.event)})}function Ft(l,e){for(var t=e.slice(0,e.length-1),i=0;i<t.length;i++)t[i]=l[t[i].toLowerCase()];return t}function Ut(l){typeof l!="string"&&(l=""),l=l.replace(/\s/g,"");for(var e=l.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function xi(l,e){for(var t=l.length>=e.length?l:e,i=l.length>=e.length?e:l,n=!0,r=0;r<t.length;r++)i.indexOf(t[r])===-1&&(n=!1);return n}var Me={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":nt?173:189,"=":nt?61:187,";":nt?59:186,"'":222,"[":219,"]":221,"\\":220},oe={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},lt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},F={16:!1,18:!1,17:!1,91:!1},z={};for(be=1;be<20;be++)Me["f".concat(be)]=111+be;var be,N=[],Rt=!1,Gt="all",Bt=[],Se=function(e){return Me[e.toLowerCase()]||oe[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)},bi=function(e){return Object.keys(Me).find(function(t){return Me[t]===e})},Mi=function(e){return Object.keys(oe).find(function(t){return oe[t]===e})};function Zt(l){Gt=l||"all"}function ve(){return Gt||"all"}function vi(){return N.slice(0)}function Si(){return N.map(function(l){return bi(l)||Mi(l)||String.fromCharCode(l)})}function Ci(){var l=[];return Object.keys(z).forEach(function(e){z[e].forEach(function(t){var i=t.key,n=t.scope,r=t.mods,s=t.shortcut;l.push({scope:n,shortcut:s,mods:r,keys:i.split("+").map(function(a){return Se(a)})})})}),l}function Di(l){var e=l.target||l.srcElement,t=e.tagName,i=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(i=!1),i}function Ai(l){return typeof l=="string"&&(l=Se(l)),N.indexOf(l)!==-1}function Ei(l,e){var t,i;l||(l=ve());for(var n in z)if(Object.prototype.hasOwnProperty.call(z,n))for(t=z[n],i=0;i<t.length;)t[i].scope===l?t.splice(i,1):i++;ve()===l&&Zt(e||"all")}function ji(l){var e=l.keyCode||l.which||l.charCode,t=N.indexOf(e);if(t>=0&&N.splice(t,1),l.key&&l.key.toLowerCase()==="meta"&&N.splice(0,N.length),(e===93||e===224)&&(e=91),e in F){F[e]=!1;for(var i in oe)oe[i]===e&&(le[i]=!1)}}function $i(l){if(typeof l>"u")Object.keys(z).forEach(function(s){return delete z[s]});else if(Array.isArray(l))l.forEach(function(s){s.key&&st(s)});else if(typeof l=="object")l.key&&st(l);else if(typeof l=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var n=t[0],r=t[1];typeof n=="function"&&(r=n,n=""),st({key:l,scope:n,method:r,splitKey:"+"})}}var st=function(e){var t=e.key,i=e.scope,n=e.method,r=e.splitKey,s=r===void 0?"+":r,a=Ut(t);a.forEach(function(f){var o=f.split(s),u=o.length,c=o[u-1],h=c==="*"?"*":Se(c);if(!!z[h]){i||(i=ve());var g=u>1?Ft(oe,o):[];z[h]=z[h].filter(function(d){var p=n?d.method===n:!0;return!(p&&d.scope===i&&xi(d.mods,g))})}})};function Xt(l,e,t,i){if(e.element===i){var n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(var r in F)Object.prototype.hasOwnProperty.call(F,r)&&(!F[r]&&e.mods.indexOf(+r)>-1||F[r]&&e.mods.indexOf(+r)===-1)&&(n=!1);(e.mods.length===0&&!F[16]&&!F[18]&&!F[17]&&!F[91]||n||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(N),e.method(l,e)===!1&&(l.preventDefault?l.preventDefault():l.returnValue=!1,l.stopPropagation&&l.stopPropagation(),l.cancelBubble&&(l.cancelBubble=!0)))}}}function Ht(l,e){var t=z["*"],i=l.keyCode||l.which||l.charCode;if(!!le.filter.call(this,l)){if((i===93||i===224)&&(i=91),N.indexOf(i)===-1&&i!==229&&N.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(d){var p=lt[d];l[d]&&N.indexOf(p)===-1?N.push(p):!l[d]&&N.indexOf(p)>-1?N.splice(N.indexOf(p),1):d==="metaKey"&&l[d]&&N.length===3&&(l.ctrlKey||l.shiftKey||l.altKey||(N=N.slice(N.indexOf(p))))}),i in F){F[i]=!0;for(var n in oe)oe[n]===i&&(le[n]=!0);if(!t)return}for(var r in F)Object.prototype.hasOwnProperty.call(F,r)&&(F[r]=l[lt[r]]);l.getModifierState&&!(l.altKey&&!l.ctrlKey)&&l.getModifierState("AltGraph")&&(N.indexOf(17)===-1&&N.push(17),N.indexOf(18)===-1&&N.push(18),F[17]=!0,F[18]=!0);var s=ve();if(t)for(var a=0;a<t.length;a++)t[a].scope===s&&(l.type==="keydown"&&t[a].keydown||l.type==="keyup"&&t[a].keyup)&&Xt(l,t[a],s,e);if(i in z){for(var f=0;f<z[i].length;f++)if((l.type==="keydown"&&z[i][f].keydown||l.type==="keyup"&&z[i][f].keyup)&&z[i][f].key){for(var o=z[i][f],u=o.splitKey,c=o.key.split(u),h=[],g=0;g<c.length;g++)h.push(Se(c[g]));h.sort().join("")===N.sort().join("")&&Xt(l,o,s,e)}}}}function Pi(l){return Bt.indexOf(l)>-1}function le(l,e,t){N=[];var i=Ut(l),n=[],r="all",s=document,a=0,f=!1,o=!0,u="+",c=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(r=e.scope),e.element&&(s=e.element),e.keyup&&(f=e.keyup),e.keydown!==void 0&&(o=e.keydown),e.capture!==void 0&&(c=e.capture),typeof e.splitKey=="string"&&(u=e.splitKey)),typeof e=="string"&&(r=e);a<i.length;a++)l=i[a].split(u),n=[],l.length>1&&(n=Ft(oe,l)),l=l[l.length-1],l=l==="*"?"*":Se(l),l in z||(z[l]=[]),z[l].push({keyup:f,keydown:o,scope:r,mods:n,shortcut:i[a],method:t,key:i[a],splitKey:u,element:s});typeof s<"u"&&!Pi(s)&&window&&(Bt.push(s),rt(s,"keydown",function(h){Ht(h,s)},c),Rt||(Rt=!0,rt(window,"focus",function(){N=[]},c)),rt(s,"keyup",function(h){Ht(h,s),ji(h)},c))}function Ti(l){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(z).forEach(function(t){var i=z[t].filter(function(n){return n.scope===e&&n.shortcut===l});i.forEach(function(n){n&&n.method&&n.method()})})}var at={getPressedKeyString:Si,setScope:Zt,getScope:ve,deleteScope:Ei,getPressedKeyCodes:vi,getAllKeyCodes:Ci,isPressed:Ai,filter:Di,trigger:Ti,unbind:$i,keyMap:Me,modifier:oe,modifierMap:lt};for(Ue in at)Object.prototype.hasOwnProperty.call(at,Ue)&&(le[Ue]=at[Ue]);var Ue;typeof window<"u"&&(Yt=window.hotkeys,le.noConflict=function(l){return l&&window.hotkeys===le&&(window.hotkeys=Yt),le},window.hotkeys=le);var Yt;function ot(l,e){let t=0;if(e===void 0)for(let i of l)i!=null&&(i=+i)>=i&&++t;else{let i=-1;for(let n of l)(n=e(n,++i,l))!=null&&(n=+n)>=n&&++t}return t}function Ge(l,e){let t,i;if(e===void 0)for(let n of l)n!=null&&(t===void 0?n>=n&&(t=i=n):(t>n&&(t=n),i<n&&(i=n)));else{let n=-1;for(let r of l)(r=e(r,++n,l))!=null&&(t===void 0?r>=r&&(t=i=r):(t>r&&(t=r),i<r&&(i=r)))}return[t,i]}var Ii=Math.sqrt(50),Vi=Math.sqrt(10),wi=Math.sqrt(2);function Be(l,e,t){let i=(e-l)/Math.max(0,t),n=Math.floor(Math.log10(i)),r=i/Math.pow(10,n),s=r>=Ii?10:r>=Vi?5:r>=wi?2:1,a,f,o;return n<0?(o=Math.pow(10,-n)/s,a=Math.round(l*o),f=Math.round(e*o),a/o<l&&++a,f/o>e&&--f,o=-o):(o=Math.pow(10,n)*s,a=Math.round(l/o),f=Math.round(e/o),a*o<l&&++a,f*o>e&&--f),f<a&&.5<=t&&t<2?Be(l,e,t*2):[a,f,o]}function Ze(l,e,t){if(e=+e,l=+l,t=+t,!(t>0))return[];if(l===e)return[l];let i=e<l,[n,r,s]=i?Be(e,l,t):Be(l,e,t);if(!(r>=n))return[];let a=r-n+1,f=new Array(a);if(i)if(s<0)for(let o=0;o<a;++o)f[o]=(r-o)/-s;else for(let o=0;o<a;++o)f[o]=(r-o)*s;else if(s<0)for(let o=0;o<a;++o)f[o]=(n+o)/-s;else for(let o=0;o<a;++o)f[o]=(n+o)*s;return f}function ft(l,e,t){return e=+e,l=+l,t=+t,Be(l,e,t)[2]}function Je(l,e,t){let i;for(;;){let n=ft(l,e,t);if(n===i||n===0||!isFinite(n))return[l,e];n>0?(l=Math.floor(l/n)*n,e=Math.ceil(e/n)*n):n<0&&(l=Math.ceil(l*n)/n,e=Math.floor(e*n)/n),i=n}}function Qe(l){return Math.max(1,Math.ceil(Math.log(ot(l))/Math.LN2)+1)}var Oi=Array.prototype,Jt=Oi.slice;function Qt(l,e){return l-e}function ei(l){for(var e=0,t=l.length,i=l[t-1][1]*l[0][0]-l[t-1][0]*l[0][1];++e<t;)i+=l[e-1][1]*l[e][0]-l[e-1][0]*l[e][1];return i}var dt=l=>()=>l;function ti(l,e){for(var t=-1,i=e.length,n;++t<i;)if(n=Li(l,e[t]))return n;return 0}function Li(l,e){for(var t=e[0],i=e[1],n=-1,r=0,s=l.length,a=s-1;r<s;a=r++){var f=l[r],o=f[0],u=f[1],c=l[a],h=c[0],g=c[1];if(Ki(f,c,e))return 0;u>i!=g>i&&t<(h-o)*(i-u)/(g-u)+o&&(n=-n)}return n}function Ki(l,e,t){var i;return Wi(l,e,t)&&Ni(l[i=+(l[0]===e[0])],t[i],e[i])}function Wi(l,e,t){return(e[0]-l[0])*(t[1]-l[1])===(t[0]-l[0])*(e[1]-l[1])}function Ni(l,e,t){return l<=e&&e<=t||t<=e&&e<=l}function ii(){}var fe=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function ht(){var l=1,e=1,t=Qe,i=f;function n(o){var u=t(o);if(Array.isArray(u))u=u.slice().sort(Qt);else{let c=Ge(o,qi);for(u=Ze(...Je(c[0],c[1],u),u);u[u.length-1]>=c[1];)u.pop();for(;u[1]<c[0];)u.shift()}return u.map(c=>r(o,c))}function r(o,u){let c=u==null?NaN:+u;if(isNaN(c))throw new Error(`invalid value: ${u}`);var h=[],g=[];return s(o,c,function(d){i(d,o,c),ei(d)>0?h.push([d]):g.push(d)}),g.forEach(function(d){for(var p=0,x=h.length,y;p<x;++p)if(ti((y=h[p])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:u,coordinates:h}}function s(o,u,c){var h=new Array,g=new Array,d,p,x,y,m,C;for(d=p=-1,y=ge(o[0],u),fe[y<<1].forEach(v);++d<l-1;)x=y,y=ge(o[d+1],u),fe[x|y<<1].forEach(v);for(fe[y<<0].forEach(v);++p<e-1;){for(d=-1,y=ge(o[p*l+l],u),m=ge(o[p*l],u),fe[y<<1|m<<2].forEach(v);++d<l-1;)x=y,y=ge(o[p*l+l+d+1],u),C=m,m=ge(o[p*l+d+1],u),fe[x|y<<1|m<<2|C<<3].forEach(v);fe[y|m<<3].forEach(v)}for(d=-1,m=o[p*l]>=u,fe[m<<2].forEach(v);++d<l-1;)C=m,m=ge(o[p*l+d+1],u),fe[m<<2|C<<3].forEach(v);fe[m<<3].forEach(v);function v(D){var T=[D[0][0]+d,D[0][1]+p],$=[D[1][0]+d,D[1][1]+p],K=a(T),V=a($),S,E;(S=g[K])?(E=h[V])?(delete g[S.end],delete h[E.start],S===E?(S.ring.push($),c(S.ring)):h[S.start]=g[E.end]={start:S.start,end:E.end,ring:S.ring.concat(E.ring)}):(delete g[S.end],S.ring.push($),g[S.end=V]=S):(S=h[V])?(E=g[K])?(delete h[S.start],delete g[E.end],S===E?(S.ring.push($),c(S.ring)):h[E.start]=g[S.end]={start:E.start,end:S.end,ring:E.ring.concat(S.ring)}):(delete h[S.start],S.ring.unshift(T),h[S.start=K]=S):h[K]=g[V]={start:K,end:V,ring:[T,$]}}}function a(o){return o[0]*2+o[1]*(l+1)*4}function f(o,u,c){o.forEach(function(h){var g=h[0],d=h[1],p=g|0,x=d|0,y=ut(u[x*l+p]);g>0&&g<l&&p===g&&(h[0]=ni(g,ut(u[x*l+p-1]),y,c)),d>0&&d<e&&x===d&&(h[1]=ni(d,ut(u[(x-1)*l+p]),y,c))})}return n.contour=r,n.size=function(o){if(!arguments.length)return[l,e];var u=Math.floor(o[0]),c=Math.floor(o[1]);if(!(u>=0&&c>=0))throw new Error("invalid size");return l=u,e=c,n},n.thresholds=function(o){return arguments.length?(t=typeof o=="function"?o:Array.isArray(o)?dt(Jt.call(o)):dt(o),n):t},n.smooth=function(o){return arguments.length?(i=o?f:ii,n):i===f},n}function qi(l){return isFinite(l)?l:NaN}function ge(l,e){return l==null?!1:+l>=e}function ut(l){return l==null||isNaN(l=+l)?-1/0:l}function ni(l,e,t,i){let n=i-e,r=t-e,s=isFinite(n)||isFinite(r)?n/r:Math.sign(n)/Math.sign(r);return isNaN(s)?l:l+s-.5}function Ce(l){for(var e=-1,t=l.length,i,n=l[t-1],r=0;++e<t;)i=n,n=l[e],r+=i[1]*n[0]-i[0]*n[1];return r/2}function ct(l,e){for(var t=l.length,i=l[t-1],n=e[0],r=e[1],s=i[0],a=i[1],f,o,u=!1,c=0;c<t;++c)i=l[c],f=i[0],o=i[1],o>r!=a>r&&n<(s-f)*(r-o)/(a-o)+f&&(u=!u),s=f,a=o;return u}var zi="0.0.8";function Ri(l,e){return typeof l=="object"&&l&&e in l}function Xi(l){if(!Array.isArray(l))return!1;for(let e of l)if(!Array.isArray(e)||e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")return!1;return!0}function Hi(l,e){return l.length<=0?0:(Xi(l)&&Ce(l),Ce(je(l,e)))}var ri={version:zi,is_empty:et,minmax:bt,sorted:Ee,strparse_intranges:Mt,intlist_to_rangestr:vt,map:mt,reduce:yt,debounce:xt,zip:je,unzip:Dt,forexpr:St,object_id:_t,coordtxl:ki,hotkeys:le,ReconnectState:Ct,polyArea:Hi,BiMap:he,BoundedBiMap:ye,EqSet:de,eq:_e,d3:{contours:ht,polygonContains:ct,polygonArea:Ce},_dummy:void 0};typeof Bokeh!="undefined"&&typeof Bokeh._dummy!="undefined"&&(ri._dummy=Bokeh._dummy);window.casalib=ri;window.hasprop=Ri;window.zip=je;window.EqSet=de;window.BiMap=he;window.BoundedBiMap=ye;})();
cubevis/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '1.0.0'
1
+ __version__ = '1.0.4'
cubevis/bokeh/__init__.py CHANGED
@@ -27,3 +27,19 @@
27
27
  ########################################################################
28
28
  '''This module contains the extensions and additions to the functionality
29
29
  provided by Bokeh'''
30
+
31
+ from .state import order_bokeh_js as _order_bokeh_js
32
+ from .state import register_model as _register_model
33
+ from .state import set_cubevis_lib
34
+
35
+ class BokehInit:
36
+ """Mixin for all cubevis models"""
37
+
38
+ def __init_subclass__(cls, **kwargs):
39
+ """Auto-register subclasses"""
40
+ _order_bokeh_js()
41
+ super().__init_subclass__(**kwargs)
42
+ _register_model(cls)
43
+
44
+ def __init__(self, *args, **kwargs):
45
+ super().__init__(*args, **kwargs)
@@ -1,6 +1,7 @@
1
1
  from bokeh.models import PolyAnnotation
2
+ from .. import BokehInit
2
3
 
3
- class EvPolyAnnotation(PolyAnnotation):
4
+ class EvPolyAnnotation(PolyAnnotation,BokehInit):
4
5
 
5
6
  def __init__(self, *args, **kwargs) -> None:
6
7
  super().__init__(*args, **kwargs)
@@ -30,8 +30,9 @@ from bokeh.util.compiler import TypeScript
30
30
  from bokeh.core.properties import Instance, String
31
31
  from cubevis.bokeh.sources import ImageDataSource
32
32
  from ..state import casalib_url, cubevisjs_url
33
+ from .. import BokehInit
33
34
 
34
- class WcsTicks(TickFormatter):
35
+ class WcsTicks(TickFormatter,BokehInit):
35
36
 
36
37
  ## which axis are we labeling
37
38
  axis = String( )
@@ -39,7 +40,10 @@ class WcsTicks(TickFormatter):
39
40
  ## source containing the WCS information
40
41
  image_source = Instance(ImageDataSource)
41
42
 
42
- __javascript__ = [ casalib_url( ), cubevisjs_url( ) ]
43
+ ###################################################################
44
+ ### filled from cubevis.bokeh.state._initialize._order_bokeh_js ###
45
+ ###################################################################
46
+ #__javascript__ = [ casalib_url( ), cubevisjs_url( ) ]
43
47
 
44
48
  def __init__( self, *args, **kwargs ):
45
49
  super( ).__init__( *args, **kwargs )
@@ -2,4 +2,5 @@ from ._tip_button import TipButton
2
2
  from ._tip import Tip
3
3
  from ._edit_span import EditSpan
4
4
  from ._ev_text_input import EvTextInput
5
+ from ._showable import Showable
5
6
  from ._shared_dict import SharedDict