@modelmap/a1-notation
Version:
Work with A1 notation like "A1" or "A1:B2"
3 lines (2 loc) • 25.6 kB
JavaScript
var A1=function(t){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,r){return t(r={exports:{}},r.exports),r.exports}function e(t){return t&&t.Math==Math&&t}function a(t){try{return!!t()}catch(t){return!0}}function o(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}function i(t){return S.call(t).slice(8,-1)}function c(t){if(null==t)throw TypeError("Can't call method on "+t);return t}function s(t){return m(c(t))}function l(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(t,r){if(!l(t))return t;var n,e;if(r&&"function"==typeof(n=t.toString)&&!l(e=n.call(t)))return e;if("function"==typeof(n=t.valueOf)&&!l(e=n.call(t)))return e;if(!r&&"function"==typeof(n=t.toString)&&!l(e=n.call(t)))return e;throw TypeError("Can't convert object to primitive value")}function f(t,r){return _.call(t,r)}function v(t){if(!l(t))throw TypeError(String(t)+" is not an object");return t}function h(r,n){try{R(p,r,n)}catch(t){p[r]=n}return n}var p=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof r&&r)||Function("return this")(),g=!a(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),y={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,w={f:d&&!y.call({1:2},1)?function(t){var r=d(this,t);return!!r&&r.enumerable}:y},S={}.toString,b="".split,m=a(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==i(t)?b.call(t,""):Object(t)}:Object,_={}.hasOwnProperty,E=p.document,x=l(E)&&l(E.createElement),O=!g&&!a(function(){return 7!=Object.defineProperty(x?E.createElement("div"):{},"a",{get:function(){return 7}}).a}),A=Object.getOwnPropertyDescriptor,k={f:g?A:function(t,r){if(t=s(t),r=u(r,!0),O)try{return A(t,r)}catch(t){}if(f(t,r))return o(!w.f.call(t,r),t[r])}},N=Object.defineProperty,j={f:g?N:function(t,r,n){if(v(t),r=u(r,!0),v(n),O)try{return N(t,r,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[r]=n.value),t}},R=g?function(t,r,n){return j.f(t,r,o(1,n))}:function(t,r,n){return t[r]=n,t},C="__core-js_shared__",I=p[C]||h(C,{}),T=Function.toString;"function"!=typeof I.inspectSource&&(I.inspectSource=function(t){return T.call(t)});function P(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+H).toString(36)}var U,M,D,L,$,F,Y,X,z,Z=I.inspectSource,B=p.WeakMap,K="function"==typeof B&&/native code/.test(Z(B)),W=n(function(t){(t.exports=function(t,r){return I[t]||(I[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})}),G=0,H=Math.random(),J=W("keys"),V={},q=p.WeakMap;Y=K?(U=new q,M=U.get,D=U.has,L=U.set,$=function(t,r){return L.call(U,t,r),r},F=function(t){return M.call(U,t)||{}},function(t){return D.call(U,t)}):(X=J[z="state"]||(J[z]=P(z)),V[X]=!0,$=function(t,r){return R(t,X,r),r},F=function(t){return f(t,X)?t[X]:{}},function(t){return f(t,X)});function Q(t){return"function"==typeof t?t:void 0}function tt(t,r){return arguments.length<2?Q(pt[t])||Q(p[t]):pt[t]&&pt[t][r]||p[t]&&p[t][r]}function rt(t){return isNaN(t=+t)?0:(0<t?yt:gt)(t)}function nt(t){return 0<t?dt(rt(t),9007199254740991):0}function et(l){return function(t,r,n){var e,o,i,a=s(t),u=nt(a.length),c=(e=u,(o=rt(n))<0?wt(o+e,0):St(o,e));if(l&&r!=r){for(;c<u;)if((i=a[c++])!=i)return!0}else for(;c<u;c++)if((l||c in a)&&a[c]===r)return l||c||0;return!l&&-1}}function ot(t,r){var n=Nt[kt(t)];return n==Rt||n!=jt&&("function"==typeof r?a(r):!!r)}function it(t,r){var n,e,o,i,a=t.target,u=t.global,c=t.stat,l=u?p:c?p[a]||h(a,{}):(p[a]||{}).prototype;if(l)for(n in r){if(o=r[n],e=t.noTargetGet?(i=It(l,n))&&i.value:l[n],!Ct(u?n:a+(c?".":"#")+n,t.forced)&&void 0!==e){if(typeof o==typeof e)continue;!function(t,r){for(var n=Ot(r),e=j.f,o=k.f,i=0;i<n.length;i++){var a=n[i];f(t,a)||e(t,a,o(r,a))}}(o,e)}(t.sham||e&&e.sham)&&R(o,"sham",!0),vt(l,n,o,t)}}function at(t){return Object(c(t))}function ut(t,r,n){var e=u(r);e in t?j.f(t,e,o(0,n)):t[e]=n}function ct(t){return f(Mt,t)||(Pt&&f(Dt,t)?Mt[t]=Dt[t]:Mt[t]=Lt("Symbol."+t)),Mt[t]}function lt(t,r){var n;return Tt(t)&&("function"==typeof(n=t.constructor)&&(n===Array||Tt(n.prototype))||l(n)&&null===(n=n[$t]))&&(n=void 0),new(void 0===n?Array:n)(0===r?0:r)}var st,ft,ht={set:$,get:F,has:Y,enforce:function(t){return Y(t)?F(t):$(t,{})},getterFor:function(n){return function(t){var r;if(!l(t)||(r=F(t)).type!==n)throw TypeError("Incompatible receiver, "+n+" required");return r}}},vt=n(function(t){var r=ht.get,u=ht.enforce,c=String(String).split("String");(t.exports=function(t,r,n,e){var o=!!e&&!!e.unsafe,i=!!e&&!!e.enumerable,a=!!e&&!!e.noTargetGet;"function"==typeof n&&("string"!=typeof r||f(n,"name")||R(n,"name",r),u(n).source=c.join("string"==typeof r?r:"")),t!==p?(o?!a&&t[r]&&(i=!0):delete t[r],i?t[r]=n:R(t,r,n)):i?t[r]=n:h(r,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&r(this).source||Z(this)})}),pt=p,gt=Math.ceil,yt=Math.floor,dt=Math.min,wt=Math.max,St=Math.min,bt={includes:et(!0),indexOf:et(!1)},mt=bt.indexOf,_t=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),Et={f:Object.getOwnPropertyNames||function(t){return function(t,r){var n,e=s(t),o=0,i=[];for(n in e)!f(V,n)&&f(e,n)&&i.push(n);for(;r.length>o;)f(e,n=r[o++])&&(~mt(i,n)||i.push(n));return i}(t,_t)}},xt={f:Object.getOwnPropertySymbols},Ot=tt("Reflect","ownKeys")||function(t){var r=Et.f(v(t)),n=xt.f;return n?r.concat(n(t)):r},At=/#|\.prototype\./,kt=ot.normalize=function(t){return String(t).replace(At,".").toLowerCase()},Nt=ot.data={},jt=ot.NATIVE="N",Rt=ot.POLYFILL="P",Ct=ot,It=k.f,Tt=Array.isArray||function(t){return"Array"==i(t)},Pt=!!Object.getOwnPropertySymbols&&!a(function(){return!String(Symbol())}),Ut=Pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Mt=W("wks"),Dt=p.Symbol,Lt=Ut?Dt:Dt&&Dt.withoutSetter||P,$t=ct("species"),Ft=tt("navigator","userAgent")||"",Yt=p.process,Xt=Yt&&Yt.versions,zt=Xt&&Xt.v8;zt?ft=(st=zt.split("."))[0]+st[1]:Ft&&(!(st=Ft.match(/Edge\/(\d+)/))||74<=st[1])&&(st=Ft.match(/Chrome\/(\d+)/))&&(ft=st[1]);var Zt,Bt=ft&&+ft,Kt=ct("species"),Wt=ct("isConcatSpreadable"),Gt=9007199254740991,Ht="Maximum allowed index exceeded",Jt=51<=Bt||!a(function(){var t=[];return t[Wt]=!1,t.concat()[0]!==t}),Vt=(Zt="concat",51<=Bt||!a(function(){var t=[];return(t.constructor={})[Kt]=function(){return{foo:1}},1!==t[Zt](Boolean).foo}));it({target:"Array",proto:!0,forced:!Jt||!Vt},{concat:function(t){for(var r,n,e,o=at(this),i=lt(o,0),a=0,u=-1,c=arguments.length;u<c;u++)if(function(t){if(!l(t))return!1;var r=t[Wt];return void 0!==r?!!r:Tt(t)}(e=-1===u?o:arguments[u])){if(n=nt(e.length),Gt<a+n)throw TypeError(Ht);for(r=0;r<n;r++,a++)r in e&&ut(i,a,e[r])}else{if(Gt<=a)throw TypeError(Ht);ut(i,a++,e)}return i.length=a,i}});function qt(e,o,t){if(!function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(e),void 0===o)return e;switch(t){case 0:return function(){return e.call(o)};case 1:return function(t){return e.call(o,t)};case 2:return function(t,r){return e.call(o,t,r)};case 3:return function(t,r,n){return e.call(o,t,r,n)}}return function(){return e.apply(o,arguments)}}function Qt(v){var p=1==v,g=2==v,y=3==v,d=4==v,w=6==v,S=5==v||w;return function(t,r,n,e){for(var o,i,a=at(t),u=m(a),c=qt(r,n,3),l=nt(u.length),s=0,f=e||lt,h=p?f(t,l):g?f(t,0):void 0;s<l;s++)if((S||s in u)&&(i=c(o=u[s],s,a),v))if(p)h[s]=i;else if(i)switch(v){case 3:return!0;case 5:return o;case 6:return s;case 2:er.call(h,o)}else if(d)return!1;return w?-1:y||d?d:h}}function tr(t,r){var n=[][t];return!!n&&a(function(){n.call(null,r||function(){throw 1},1)})}function rr(t){throw t}function nr(t,r){if(f(ar,t))return ar[t];var n=[][t],e=!!f(r=r||{},"ACCESSORS")&&r.ACCESSORS,o=f(r,0)?r[0]:rr,i=f(r,1)?r[1]:void 0;return ar[t]=!!n&&!a(function(){if(e&&!g)return 1;var t={length:-1};e?ir(t,1,{enumerable:!0,get:rr}):t[1]=1,n.call(t,o,i)})}var er=[].push,or={forEach:Qt(0),map:Qt(1),filter:Qt(2),some:Qt(3),every:Qt(4),find:Qt(5),findIndex:Qt(6)},ir=Object.defineProperty,ar={},ur=or.every,cr=tr("every"),lr=nr("every");it({target:"Array",proto:!0,forced:!cr||!lr},{every:function(t,r){return ur(this,t,1<arguments.length?r:void 0)}});var sr=or.forEach,fr=tr("forEach"),hr=nr("forEach"),vr=fr&&hr?[].forEach:function(t,r){return sr(this,t,1<arguments.length?r:void 0)};it({target:"Array",proto:!0,forced:[].forEach!=vr},{forEach:vr});var pr=bt.indexOf,gr=[].indexOf,yr=!!gr&&1/[1].indexOf(1,-0)<0,dr=tr("indexOf"),wr=nr("indexOf",{ACCESSORS:!0,1:0});it({target:"Array",proto:!0,forced:yr||!dr||!wr},{indexOf:function(t,r){return yr?gr.apply(this,arguments)||0:pr(this,t,1<arguments.length?r:void 0)}}),it({target:"Array",stat:!0},{isArray:Tt});var Sr=[].join,br=m!=Object,mr=tr("join",",");it({target:"Array",proto:!0,forced:br||!mr},{join:function(t){return Sr.call(s(this),void 0===t?",":t)}});function _r(){var t=v(this),r="";return t.global&&(r+="g"),t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.dotAll&&(r+="s"),t.unicode&&(r+="u"),t.sticky&&(r+="y"),r}function Er(t,r){return RegExp(t,r)}var xr,Or,Ar={UNSUPPORTED_Y:a(function(){var t=Er("a","y");return t.lastIndex=2,null!=t.exec("abcd")}),BROKEN_CARET:a(function(){var t=Er("^r","gy");return t.lastIndex=2,null!=t.exec("str")})},kr=RegExp.prototype.exec,Nr=String.prototype.replace,jr=kr,Rr=(xr=/a/,Or=/b*/g,kr.call(xr,"a"),kr.call(Or,"a"),0!==xr.lastIndex||0!==Or.lastIndex),Cr=Ar.UNSUPPORTED_Y||Ar.BROKEN_CARET,Ir=void 0!==/()??/.exec("")[1];(Rr||Ir||Cr)&&(jr=function(t){var r,n,e,o,i=this,a=Cr&&i.sticky,u=_r.call(i),c=i.source,l=0,s=t;return a&&(-1===(u=u.replace("y","")).indexOf("g")&&(u+="g"),s=String(t).slice(i.lastIndex),0<i.lastIndex&&(!i.multiline||i.multiline&&"\n"!==t[i.lastIndex-1])&&(c="(?: "+c+")",s=" "+s,l++),n=new RegExp("^(?:"+c+")",u)),Ir&&(n=new RegExp("^"+c+"$(?!\\s)",u)),Rr&&(r=i.lastIndex),e=kr.call(a?n:i,s),a?e?(e.input=e.input.slice(l),e[0]=e[0].slice(l),e.index=i.lastIndex,i.lastIndex+=e[0].length):i.lastIndex=0:Rr&&e&&(i.lastIndex=i.global?e.index+e[0].length:r),Ir&&e&&1<e.length&&Nr.call(e[0],n,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(e[o]=void 0)}),e});var Tr=jr;it({target:"RegExp",proto:!0,forced:/./.exec!==Tr},{exec:Tr});function Pr(u){return function(t,r){var n,e,o=String(c(t)),i=rt(r),a=o.length;return i<0||a<=i?u?"":void 0:(n=o.charCodeAt(i))<55296||56319<n||i+1===a||(e=o.charCodeAt(i+1))<56320||57343<e?u?o.charAt(i):n:u?o.slice(i,i+2):e-56320+(n-55296<<10)+65536}}function Ur(t,r){var n=t.exec;if("function"==typeof n){var e=n.call(t,r);if("object"!=typeof e)throw TypeError("RegExp exec method returned something other than an Object or null");return e}if("RegExp"!==i(t))throw TypeError("RegExp#exec called on incompatible receiver");return Tr.call(t,r)}var Mr,Dr,Lr,$r,Fr,Yr,Xr,zr,Zr,Br,Kr,Wr=ct("species"),Gr=!a(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),Hr="$0"==="a".replace(/./,"$0"),Jr=ct("replace"),Vr=!!/./[Jr]&&""===/./[Jr]("a","$0"),qr=!a(function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}),Qr={codeAt:Pr(!1),charAt:Pr(!0)}.charAt;function tn(t){return(tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rn(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function nn(t,r){for(var n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function en(t,r,n){return r&&nn(t.prototype,r),n&&nn(t,n),t}function on(t){return(on=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function an(t,r){return(an=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t})(t,r)}function un(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function cn(t,r,n){return(cn=un()?Reflect.construct:function(t,r,n){var e=[null];e.push.apply(e,r);var o=new(Function.bind.apply(t,e));return n&&an(o,n.prototype),o}).apply(null,arguments)}function ln(t){var e="function"==typeof Map?new Map:void 0;return(ln=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return cn(t,arguments,on(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),an(n,t)})(t)}function sn(t,r){return!r||"object"!=typeof r&&"function"!=typeof r?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):r}function fn(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],e=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){o=!0,i=t}finally{try{e||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return hn(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hn(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hn(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}Dr=1,Lr=function(e,f,h){return[function(t){var r=c(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(t){var r=h(f,t,this);if(r.done)return r.value;var n=v(t),e=String(this);if(!n.global)return Ur(n,e);for(var o,i,a,u=n.unicode,c=[],l=n.lastIndex=0;null!==(o=Ur(n,e));){var s=String(o[0]);""===(c[l]=s)&&(n.lastIndex=(i=e,(a=nt(n.lastIndex))+(u?Qr(i,a).length:1))),l++}return 0===l?null:c}]},Zr=ct(Mr="match"),Br=!a(function(){var t={};return t[Zr]=function(){return 7},7!=""[Mr](t)}),Kr=Br&&!a(function(){var t=!1,r=/a/;return"split"===Mr&&((r={constructor:{}}).constructor[Wr]=function(){return r},r.flags="",r[Zr]=/./[Zr]),r.exec=function(){return t=!0,null},r[Zr](""),!t}),Br&&Kr&&("replace"!==Mr||Gr&&Hr&&!Vr)&&("split"!==Mr||qr)||(Fr=/./[Zr],Xr=(Yr=Lr(Zr,""[Mr],function(t,r,n,e,o){return r.exec===Tr?Br&&!o?{done:!0,value:Fr.call(r,n,e)}:{done:!0,value:t.call(n,r,e)}:{done:!1}},{REPLACE_KEEPS_$0:Hr,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Vr}))[0],zr=Yr[1],vt(String.prototype,Mr,Xr),vt(RegExp.prototype,Zr,2==Dr?function(t,r){return zr.call(t,this,r)}:function(t){return zr.call(t,this)})),$r&&R(RegExp.prototype[Zr],"sham",!0);function vn(n){return function(t){var r=String(c(t));return 1&n&&(r=r.replace(yn,"")),2&n&&(r=r.replace(dn,"")),r}}var pn="\t\n\v\f\r \u2028\u2029\ufeff",gn="["+pn+"]",yn=RegExp("^"+gn+gn+"*"),dn=RegExp(gn+gn+"*$"),wn={start:vn(1),end:vn(2),trim:vn(3)}.trim,Sn=p.parseInt,bn=/^[+-]?0[Xx]/,mn=8!==Sn(pn+"08")||22!==Sn(pn+"0x16")?function(t,r){var n=wn(String(t));return Sn(n,r>>>0||(bn.test(n)?16:10))}:Sn;function _n(t){return parseInt(t,10)}function En(t){for(var r,n="";0<t;)r=(t-1)%26,n=String.fromCharCode(65+r)+n,t=(t-r-1)/26;return n}it({global:!0,forced:parseInt!=mn},{parseInt:mn});var xn=Date.prototype,On="Invalid Date",An="toString",kn=xn[An],Nn=xn.getTime;new Date(NaN)+""!=On&&vt(xn,An,function(){var t=Nn.call(this);return t==t?kn.call(this):On});var jn={};jn[ct("toStringTag")]="z";var Rn="[object z]"===String(jn),Cn=ct("toStringTag"),In="Arguments"==i(function(){return arguments}()),Tn=Rn?i:function(t){var r,n,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,r){try{return t[r]}catch(t){}}(r=Object(t),Cn))?n:In?i(r):"Object"==(e=i(r))&&"function"==typeof r.callee?"Arguments":e},Pn=Rn?{}.toString:function(){return"[object "+Tn(this)+"]"};Rn||vt(Object.prototype,"toString",Pn,{unsafe:!0});var Un="toString",Mn=RegExp.prototype,Dn=Mn[Un],Ln=a(function(){return"/a/b"!=Dn.call({source:"a",flags:"b"})}),$n=Dn.name!=Un;function Fn(t){return t.toString()}function Yn(t){return/^[A-Z]+\d+(:[A-Z]+\d+)?$/i.test(t)}function Xn(t,r){var n="number"==typeof t&&t%1==0;return!(1<arguments.length&&void 0!==r)||r?n&&0<+t:n}(Ln||$n)&&vt(RegExp.prototype,Un,function(){var t=v(this),r=String(t.source),n=t.flags;return"/"+r+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in Mn)?_r.call(t):n)},{unsafe:!0});var zn=j.f,Zn=Function.prototype,Bn=Zn.toString,Kn=/^\s*function ([^ (]*)/;!g||"name"in Zn||zn(Zn,"name",{configurable:!0,get:function(){try{return Bn.call(this).match(Kn)[1]}catch(t){return""}}});var Wn=function(){!function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&an(t,r)}(i,ln(Error));var n,e,o=(n=i,e=un(),function(){var t,r=on(n);return sn(this,e?(t=on(this).constructor,Reflect.construct(r,arguments,t)):r.apply(this,arguments))});function i(t){rn(this,i);var r,n=JSON.stringify(t);return(r=o.call(this,n)).name="A1Error",r.message=n,r}return en(i,[{key:"wasString",value:function(){return this.message="Invalid A1 notation: ".concat(this.message),this}},{key:"wasNumber",value:function(){return this.message="Invalid A1 number(s): ".concat(this.message),this}},{key:"wasUnknown",value:function(){return this.message="Invalid A1 argument(s): ".concat(this.message),this}}]),i}(),Gn=function(){function f(t,r,n,e){if(rn(this,f),this._colStart=0,this._rowStart=0,this._colEnd=0,this._rowEnd=0,this._converter=1,!arguments.length)throw(new Wn).wasUnknown();var o=tn(t);if(t&&"object"===o)this._initObject.apply(this,arguments);else if("number"===o)this._initNumber.apply(this,arguments);else{if("string"!==o)throw new Wn(t).wasUnknown();this._initString.apply(this,arguments)}}return en(f,[{key:"_initObject",value:function(t){function r(t,r){for(var n in Array.isArray(r)||(r=[r]),t)if(-1===r.indexOf(n)&&t[n].val)return!1;return!0}var n=arguments.length<=0?void 0:t,e=n.converter;if(e&&-1===[1,2].indexOf(e))throw new Wn({converter:e}).wasUnknown();this._converter=e||1;var o={};["colStart","rowStart","colEnd","rowEnd","a1Start","a1End","nCols","nRows"].forEach(function(t){var r=n[t];o[t]={isString:"string"==typeof r,isNumber:Xn(r),val:r}});var i=o.colStart,a=o.rowStart,u=o.colEnd,c=o.rowEnd,l=o.a1Start,s=o.a1End,f=o.nCols,h=o.nRows;switch(!0){case l.isString&&r(o,"a1Start"):return this._initString(l.val);case l.isString&&s.isString&&r(o,["a1Start","a1End"]):return this._initString(l.val,s.val);case i.isString&&a.isString&&r(o,["colStart","rowStart"]):return this._initString(i.val+a.val);case i.isNumber&&a.isNumber&&r(o,["colStart","rowStart"]):return this._initNumber(i.val,a.val);case i.isNumber&&a.isNumber&&h.isNumber&&r(o,["colStart","rowStart","nRows"]):return this._initNumber(i.val,a.val,h.val);case i.isNumber&&a.isNumber&&f.isNumber&&r(o,["colStart","rowStart","nCols"]):return this._initNumber(i.val,a.val,1,f.val);case i.isNumber&&a.isNumber&&h.isNumber&&f.isNumber&&r(o,["colStart","rowStart","nRows","nCols"]):return this._initNumber(i.val,a.val,h.val,f.val);case i.isString&&a.isString&&u.isString&&r(o,["colStart","rowStart","colEnd"]):return this._initString("".concat(i.val).concat(a.val,":").concat(u.val).concat(a.val));case i.isNumber&&a.isNumber&&u.isNumber&&r(o,["colStart","rowStart","colEnd"]):return this._initNumber(i.val,a.val,1,u.val-i.val+1);case i.isString&&a.isString&&c.isString&&r(o,["colStart","rowStart","rowEnd"]):return this._initString("".concat(i.val).concat(a.val,":").concat(i.val).concat(c.val));case i.isNumber&&a.isNumber&&c.isNumber&&r(o,["colStart","rowStart","rowEnd"]):return this._initNumber(i.val,a.val,c.val-a.val+1);case i.isString&&a.isString&&u.isString&&c.isString&&r(o,["colStart","rowStart","colEnd","rowEnd"]):return this._initString("".concat(i.val).concat(a.val,":").concat(u.val).concat(c.val));case i.isNumber&&a.isNumber&&u.isNumber&&c.isNumber&&r(o,["colStart","rowStart","colEnd","rowEnd"]):return this._initNumber(i.val,a.val,c.val-a.val+1,u.val-i.val+1);default:throw new Wn(n).wasUnknown()}}},{key:"_initNumber",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var e=r[0],o=r[1],i=r[2],a=r[3],u=[e,o,i=i||1,a=a||1];if(!u.every(function(t){return Xn(t)}))throw new Wn(u.join(", ")).wasNumber();this._colStart=e,this._rowStart=o,this._colEnd=e+a-1,this._rowEnd=o+i-1}},{key:"_initString",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var e=r[0],o=r[1],i=o?"".concat(e,":").concat(o):e;if(!Yn(i))throw new Wn(i).wasString();var a=f._parse(i,this._converter),u=a.cs,c=a.rs,l=a.ce,s=a.re;this._colStart=u,this._rowStart=c,this._colEnd=l,this._rowEnd=s}},{key:"get",value:function(){var t=En(this._colStart)+Fn(this._rowStart),r=En(this._colEnd)+Fn(this._rowEnd);return t===r?t:"".concat(t,":").concat(r)}},{key:"toString",value:function(){return this.get()}},{key:"toJSON",value:function(){return{colStart:this._colStart,rowStart:this._rowStart,colEnd:this._colEnd,rowEnd:this._rowEnd,a1:this.get(),rowsCount:this._rowEnd-this._rowStart+1,colsCount:this._colEnd-this._colStart+1}}},{key:"getCol",value:function(){return this._colStart}},{key:"getLastCol",value:function(){return this._colEnd}},{key:"getRow",value:function(){return this._rowStart}},{key:"getLastRow",value:function(){return this._rowEnd}},{key:"getWidth",value:function(){return this._colEnd-this._colStart+1}},{key:"getHeight",value:function(){return this._rowEnd-this._rowStart+1}},{key:"copy",value:function(){return new f(this.get())}},{key:"addX",value:function(t){if(!Xn(t,!1))throw new Wn(t).wasUnknown();return 0<=t?this._colEnd+=t:this._colStart+=t,this._colStart<=0&&(this._colStart=1),this}},{key:"addY",value:function(t){if(!Xn(t,!1))throw new Wn(t).wasUnknown();return 0<=t?this._rowEnd+=t:this._rowStart+=t,this._rowStart<=0&&(this._rowStart=1),this}},{key:"add",value:function(t,r){return this.addX(t),this.addY(r),this}},{key:"removeX",value:function(t){if(!Xn(t,!1))throw new Wn(t).wasUnknown();return 0<=t?(this._colEnd-=t,this._colEnd<this._colStart&&(this._colEnd=this._colStart)):(this._colStart-=t,this._colStart>this._colEnd&&(this._colStart=this._colEnd)),this}},{key:"removeY",value:function(t){if(!Xn(t,!1))throw new Wn(t).wasUnknown();return 0<=t?(this._rowEnd-=t,this._rowEnd<this._rowStart&&(this._rowEnd=this._rowStart)):(this._rowStart-=t,this._rowStart>this._rowEnd&&(this._rowStart=this._rowEnd)),this}},{key:"remove",value:function(t,r){return this.removeX(t),this.removeY(r),this}},{key:"shiftX",value:function(t){if(!Xn(t,!1))throw new Wn(t).wasUnknown();var r=this._colEnd-this._colStart,n=this._colStart+t,e=this._colEnd+t;return this._colStart=0<n?n:1,this._colEnd=0<n?e:1+r,this}},{key:"shiftY",value:function(t){if(!Xn(t,!1))throw new Wn(t).wasUnknown();var r=this._rowEnd-this._rowStart,n=this._rowStart+t,e=this._rowEnd+t;return this._rowStart=0<n?n:1,this._rowEnd=0<n?e:1+r,this}},{key:"shift",value:function(t,r){return this.shiftX(t),this.shiftY(r),this}}],[{key:"_parse",value:function(t,r){var n=fn(t.toUpperCase().match(this._reg),5),e=n[1],o=n[2],i=(i=n[3])||e,a=(a=n[4])||o,u=this._A1Col(e,r),c=this._A1Col(i,r),l=_n(o),s=_n(a);return{cs:u<c?u:c,rs:l<s?l:s,ce:u<c?c:u,re:l<s?s:l}}},{key:"_A1Col",value:function(t,r){return(1===r?function(t){for(var r=0,n=t.length,e=0;e<n;e++)r+=(t.charCodeAt(e)-64)*Math.pow(26,n-e-1);return r}:function(t){for(var r=0,n="A".charCodeAt(0),e="Z".charCodeAt(0)-n+1,o=0,i=t.length;o<i;o++)r=r*e+t.charCodeAt(o)-n+1;return r})(t)}},{key:"isValid",value:Yn},{key:"getCol",value:function(t,r){var n=1<arguments.length&&void 0!==r?r:1;if(!Yn(t))throw new Wn(t).wasString();return this._parse(t,n).cs}},{key:"getLastCol",value:function(t,r){var n=1<arguments.length&&void 0!==r?r:1;if(!Yn(t))throw new Wn(t).wasString();return this._parse(t,n).ce}},{key:"toCol",value:function(t){if(!Xn(t))throw new Wn(t).wasNumber();return En(t)}},{key:"getRow",value:function(t){if(!Yn(t))throw new Wn(t).wasString();return this._parse(t,1).rs}},{key:"getLastRow",value:function(t){if(!Yn(t))throw new Wn(t).wasString();return this._parse(t,1).re}},{key:"toRow",value:function(t){if(!Xn(t))throw new Wn(t).wasNumber();return Fn(t)}},{key:"getWidth",value:function(t,r){var n=1<arguments.length&&void 0!==r?r:1;if(!Yn(t))throw new Wn(t).wasString();var e=this._parse(t,n);return e.ce-e.cs+1}},{key:"getHeight",value:function(t){if(!Yn(t))throw new Wn(t).wasString();var r=this._parse(t,1);return r.re-r.rs+1}}]),f}();return Gn._reg=/^([A-Z]+)(\d+)(?::([A-Z]+)(\d+))?$/,t.A1=Gn,t}({});
//# sourceMappingURL=index.min.js.map