(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["webgl"]=e():t["webgl"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s="fb15")}({"00ee":function(t,e,r){"use strict";var n=r("b622"),i=n("toStringTag"),o={};o[i]="z",t.exports="[object z]"===String(o)},"0366":function(t,e,r){"use strict";var n=r("4625"),i=r("59ed"),o=r("40d5"),a=n(n.bind);t.exports=function(t,e){return i(t),void 0===e?t:o?a(t,e):function(){return t.apply(e,arguments)}}},"04f8":function(t,e,r){"use strict";var n=r("1212"),i=r("d039"),o=r("cfe9"),a=o.String;t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!a(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},"06cf":function(t,e,r){"use strict";var n=r("83ab"),i=r("c65b"),o=r("d1e7"),a=r("5c6c"),f=r("fc6a"),c=r("a04b"),u=r("1a2d"),s=r("0cfb"),d=Object.getOwnPropertyDescriptor;e.f=n?d:function(t,e){if(t=f(t),e=c(e),s)try{return d(t,e)}catch(r){}if(u(t,e))return a(!i(o.f,t,e),t[e])}},"07fa":function(t,e,r){"use strict";var n=r("50c4");t.exports=function(t){return n(t.length)}},"0b25":function(t,e,r){"use strict";var n=r("5926"),i=r("50c4"),o=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=n(t),r=i(e);if(e!==r)throw new o("Wrong length or index");return r}},"0cfb":function(t,e,r){"use strict";var n=r("83ab"),i=r("d039"),o=r("cc12");t.exports=!n&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"0d51":function(t,e,r){"use strict";var n=String;t.exports=function(t){try{return n(t)}catch(e){return"Object"}}},1212:function(t,e,r){"use strict";var n,i,o=r("cfe9"),a=r("b5db"),f=o.process,c=o.Deno,u=f&&f.versions||c&&c.version,s=u&&u.v8;s&&(n=s.split("."),i=n[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(n=a.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/),n&&(i=+n[1]))),t.exports=i},"13d2":function(t,e,r){"use strict";var n=r("e330"),i=r("d039"),o=r("1626"),a=r("1a2d"),f=r("83ab"),c=r("5e77").CONFIGURABLE,u=r("8925"),s=r("69f3"),d=s.enforce,l=s.get,h=String,p=Object.defineProperty,y=n("".slice),v=n("".replace),g=n([].join),O=f&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),x=String(String).split("String"),b=t.exports=function(t,e,r){"Symbol("===y(h(e),0,7)&&(e="["+v(h(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!a(t,"name")||c&&t.name!==e)&&(f?p(t,"name",{value:e,configurable:!0}):t.name=e),O&&r&&a(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?f&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(i){}var n=d(t);return a(n,"source")||(n.source=g(x,"string"==typeof e?e:"")),t};Function.prototype.toString=b((function(){return o(this)&&l(this).source||u(this)}),"toString")},1626:function(t,e,r){"use strict";var n="object"==typeof document&&document.all;t.exports="undefined"==typeof n&&void 0!==n?function(t){return"function"==typeof t||t===n}:function(t){return"function"==typeof t}},1787:function(t,e,r){"use strict";var n=r("861d");t.exports=function(t){return n(t)||null===t}},"182d":function(t,e,r){"use strict";var n=r("f8cd"),i=RangeError;t.exports=function(t,e){var r=n(t);if(r%e)throw new i("Wrong offset");return r}},"19aa":function(t,e,r){"use strict";var n=r("3a9b"),i=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw new i("Incorrect invocation")}},"1a2d":function(t,e,r){"use strict";var n=r("e330"),i=r("7b0b"),o=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},"1be4":function(t,e,r){"use strict";var n=r("d066");t.exports=n("document","documentElement")},"1d02":function(t,e,r){"use strict";var n=r("ebb5"),i=r("a258").findLastIndex,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("findLastIndex",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"1d80":function(t,e,r){"use strict";var n=r("7234"),i=TypeError;t.exports=function(t){if(n(t))throw new i("Can't call method on "+t);return t}},2005:function(t,e,r){"use strict";var n=r("75bd"),i=TypeError;t.exports=function(t){if(n(t))throw new i("ArrayBuffer is detached");return t}},2266:function(t,e,r){"use strict";var n=r("0366"),i=r("c65b"),o=r("825a"),a=r("0d51"),f=r("e95a"),c=r("07fa"),u=r("3a9b"),s=r("9a1f"),d=r("35a1"),l=r("2a62"),h=TypeError,p=function(t,e){this.stopped=t,this.result=e},y=p.prototype;t.exports=function(t,e,r){var v,g,O,x,b,m,E,T=r&&r.that,P=!(!r||!r.AS_ENTRIES),R=!(!r||!r.IS_RECORD),_=!(!r||!r.IS_ITERATOR),A=!(!r||!r.INTERRUPTED),w=n(e,T),S=function(t){return v&&l(v,"normal",t),new p(!0,t)},I=function(t){return P?(o(t),A?w(t[0],t[1],S):w(t[0],t[1])):A?w(t,S):w(t)};if(R)v=t.iterator;else if(_)v=t;else{if(g=d(t),!g)throw new h(a(t)+" is not iterable");if(f(g)){for(O=0,x=c(t);x>O;O++)if(b=I(t[O]),b&&u(y,b))return b;return new p(!1)}v=s(t,g)}m=R?t.next:v.next;while(!(E=i(m,v)).done){try{b=I(E.value)}catch(C){l(v,"throw",C)}if("object"==typeof b&&b&&u(y,b))return b}return new p(!1)}},"23cb":function(t,e,r){"use strict";var n=r("5926"),i=Math.max,o=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):o(r,e)}},"23e7":function(t,e,r){"use strict";var n=r("cfe9"),i=r("06cf").f,o=r("9112"),a=r("cb2d"),f=r("6374"),c=r("e893"),u=r("94ca");t.exports=function(t,e){var r,s,d,l,h,p,y=t.target,v=t.global,g=t.stat;if(s=v?n:g?n[y]||f(y,{}):n[y]&&n[y].prototype,s)for(d in e){if(h=e[d],t.dontCallGetSet?(p=i(s,d),l=p&&p.value):l=s[d],r=u(v?d:y+(g?".":"#")+d,t.forced),!r&&void 0!==l){if(typeof h==typeof l)continue;c(h,l)}(t.sham||l&&l.sham)&&o(h,"sham",!0),a(s,d,h,t)}}},"241c":function(t,e,r){"use strict";var n=r("ca84"),i=r("7839"),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},"249d":function(t,e,r){"use strict";var n=r("23e7"),i=r("41f6");i&&n({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})},2834:function(t,e,r){"use strict";var n=r("ebb5"),i=r("e330"),o=r("59ed"),a=r("dfb9"),f=n.aTypedArray,c=n.getTypedArrayConstructor,u=n.exportTypedArrayMethod,s=i(n.TypedArrayPrototype.sort);u("toSorted",(function(t){void 0!==t&&o(t);var e=f(this),r=a(c(e),e);return s(r,t)}))},"2a07":function(t,e,r){"use strict";var n=r("cfe9"),i=r("9adc");t.exports=function(t){if(i){try{return n.process.getBuiltinModule(t)}catch(e){}try{return Function('return require("'+t+'")')()}catch(e){}}}},"2a62":function(t,e,r){"use strict";var n=r("c65b"),i=r("825a"),o=r("dc4a");t.exports=function(t,e,r){var a,f;i(t);try{if(a=o(t,"return"),!a){if("throw"===e)throw r;return r}a=n(a,t)}catch(c){f=!0,a=c}if("throw"===e)throw r;if(f)throw a;return i(a),r}},"2c66":function(t,e,r){"use strict";var n=r("83ab"),i=r("edd0"),o=r("75bd"),a=ArrayBuffer.prototype;n&&!("detached"in a)&&i(a,"detached",{configurable:!0,get:function(){return o(this)}})},"35a1":function(t,e,r){"use strict";var n=r("f5df"),i=r("dc4a"),o=r("7234"),a=r("3f8c"),f=r("b622"),c=f("iterator");t.exports=function(t){if(!o(t))return i(t,c)||i(t,"@@iterator")||a[n(t)]}},"36f2":function(t,e,r){"use strict";var n,i,o,a,f=r("cfe9"),c=r("2a07"),u=r("dbe5"),s=f.structuredClone,d=f.ArrayBuffer,l=f.MessageChannel,h=!1;if(u)h=function(t){s(t,{transfer:[t]})};else if(d)try{l||(n=c("worker_threads"),n&&(l=n.MessageChannel)),l&&(i=new l,o=new d(2),a=function(t){i.port1.postMessage(null,[t])},2===o.byteLength&&(a(o),0===o.byteLength&&(h=a)))}catch(p){}t.exports=h},"37e8":function(t,e,r){"use strict";var n=r("83ab"),i=r("aed9"),o=r("9bf2"),a=r("825a"),f=r("fc6a"),c=r("df75");e.f=n&&!i?Object.defineProperties:function(t,e){a(t);var r,n=f(e),i=c(e),u=i.length,s=0;while(u>s)o.f(t,r=i[s++],n[r]);return t}},"3a9b":function(t,e,r){"use strict";var n=r("e330");t.exports=n({}.isPrototypeOf)},"3bbe":function(t,e,r){"use strict";var n=r("1787"),i=String,o=TypeError;t.exports=function(t){if(n(t))return t;throw new o("Can't set "+i(t)+" as a prototype")}},"3c5d":function(t,e,r){"use strict";var n=r("cfe9"),i=r("c65b"),o=r("ebb5"),a=r("07fa"),f=r("182d"),c=r("7b0b"),u=r("d039"),s=n.RangeError,d=n.Int8Array,l=d&&d.prototype,h=l&&l.set,p=o.aTypedArray,y=o.exportTypedArrayMethod,v=!u((function(){var t=new Uint8ClampedArray(2);return i(h,t,{length:1,0:3},1),3!==t[1]})),g=v&&o.NATIVE_ARRAY_BUFFER_VIEWS&&u((function(){var t=new d(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));y("set",(function(t){p(this);var e=f(arguments.length>1?arguments[1]:void 0,1),r=c(t);if(v)return i(h,this,r,e);var n=this.length,o=a(r),u=0;if(o+e>n)throw new s("Wrong length");while(u=o&&(!r||y))n=g(t,0,o);else{var v=r&&!y&&x?{maxByteLength:x(t)}:void 0;n=new l(o,v);for(var E=new h(t),T=new h(n),P=p(o,i),R=0;Rs)if(u=f[s++],u!==u)return!0}else for(;c>s;s++)if((t||s in f)&&f[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"4ea1":function(t,e,r){"use strict";var n=r("d429"),i=r("ebb5"),o=r("bcbf"),a=r("5926"),f=r("f495"),c=i.aTypedArray,u=i.getTypedArrayConstructor,s=i.exportTypedArrayMethod,d=!!function(){try{new Int8Array(1)["with"](2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();s("with",{with:function(t,e){var r=c(this),i=a(t),s=o(r)?f(e):+e;return n(r,u(r),i,s)}}["with"],!d)},"50c4":function(t,e,r){"use strict";var n=r("5926"),i=Math.min;t.exports=function(t){var e=n(t);return e>0?i(e,9007199254740991):0}},5692:function(t,e,r){"use strict";var n=r("c6cd");t.exports=function(t,e){return n[t]||(n[t]=e||{})}},"56ef":function(t,e,r){"use strict";var n=r("d066"),i=r("e330"),o=r("241c"),a=r("7418"),f=r("825a"),c=i([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=o.f(f(t)),r=a.f;return r?c(e,r(t)):e}},5926:function(t,e,r){"use strict";var n=r("b42e");t.exports=function(t){var e=+t;return e!==e||0===e?0:n(e)}},"59ed":function(t,e,r){"use strict";var n=r("1626"),i=r("0d51"),o=TypeError;t.exports=function(t){if(n(t))return t;throw new o(i(t)+" is not a function")}},"5c6c":function(t,e,r){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"5e77":function(t,e,r){"use strict";var n=r("83ab"),i=r("1a2d"),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,f=i(o,"name"),c=f&&"something"===function(){}.name,u=f&&(!n||n&&a(o,"name").configurable);t.exports={EXISTS:f,PROPER:c,CONFIGURABLE:u}},6374:function(t,e,r){"use strict";var n=r("cfe9"),i=Object.defineProperty;t.exports=function(t,e){try{i(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},"69f3":function(t,e,r){"use strict";var n,i,o,a=r("cdce"),f=r("cfe9"),c=r("861d"),u=r("9112"),s=r("1a2d"),d=r("c6cd"),l=r("f772"),h=r("d012"),p="Object already initialized",y=f.TypeError,v=f.WeakMap,g=function(t){return o(t)?i(t):n(t,{})},O=function(t){return function(e){var r;if(!c(e)||(r=i(e)).type!==t)throw new y("Incompatible receiver, "+t+" required");return r}};if(a||d.state){var x=d.state||(d.state=new v);x.get=x.get,x.has=x.has,x.set=x.set,n=function(t,e){if(x.has(t))throw new y(p);return e.facade=t,x.set(t,e),e},i=function(t){return x.get(t)||{}},o=function(t){return x.has(t)}}else{var b=l("state");h[b]=!0,n=function(t,e){if(s(t,b))throw new y(p);return e.facade=t,u(t,b,e),e},i=function(t){return s(t,b)?t[b]:{}},o=function(t){return s(t,b)}}t.exports={set:n,get:i,has:o,enforce:g,getterFor:O}},"6ce5":function(t,e,r){"use strict";var n=r("df7e"),i=r("ebb5"),o=i.aTypedArray,a=i.exportTypedArrayMethod,f=i.getTypedArrayConstructor;a("toReversed",(function(){return n(o(this),f(this))}))},7234:function(t,e,r){"use strict";t.exports=function(t){return null===t||void 0===t}},7282:function(t,e,r){"use strict";var n=r("e330"),i=r("59ed");t.exports=function(t,e,r){try{return n(i(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(o){}}},7418:function(t,e,r){"use strict";e.f=Object.getOwnPropertySymbols},"75bd":function(t,e,r){"use strict";var n=r("cfe9"),i=r("4b11"),o=r("b620"),a=n.DataView;t.exports=function(t){if(!i||0!==o(t))return!1;try{return new a(t),!1}catch(e){return!0}}},7839:function(t,e,r){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,r){"use strict";var n=r("1d80"),i=Object;t.exports=function(t){return i(n(t))}},"7c73":function(t,e,r){"use strict";var n,i=r("825a"),o=r("37e8"),a=r("7839"),f=r("d012"),c=r("1be4"),u=r("cc12"),s=r("f772"),d=">",l="<",h="prototype",p="script",y=s("IE_PROTO"),v=function(){},g=function(t){return l+p+d+t+l+"/"+p+d},O=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},x=function(){var t,e=u("iframe"),r="java"+p+":";return e.style.display="none",c.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(g("document.F=Object")),t.close(),t.F},b=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}b="undefined"!=typeof document?document.domain&&n?O(n):x():O(n);var t=a.length;while(t--)delete b[h][a[t]];return b()};f[y]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(v[h]=i(t),r=new v,v[h]=null,r[y]=t):r=b(),void 0===e?r:o.f(r,e)}},"7d54":function(t,e,r){"use strict";var n=r("23e7"),i=r("2266"),o=r("59ed"),a=r("825a"),f=r("46c4");n({target:"Iterator",proto:!0,real:!0},{forEach:function(t){a(this),o(t);var e=f(this),r=0;i(e,(function(e){t(e,r++)}),{IS_RECORD:!0})}})},"825a":function(t,e,r){"use strict";var n=r("861d"),i=String,o=TypeError;t.exports=function(t){if(n(t))return t;throw new o(i(t)+" is not an object")}},"83ab":function(t,e,r){"use strict";var n=r("d039");t.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8418:function(t,e,r){"use strict";var n=r("83ab"),i=r("9bf2"),o=r("5c6c");t.exports=function(t,e,r){n?i.f(t,e,o(0,r)):t[e]=r}},8558:function(t,e,r){"use strict";var n=r("cfe9"),i=r("b5db"),o=r("c6b6"),a=function(t){return i.slice(0,t.length)===t};t.exports=function(){return a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"}()},"861d":function(t,e,r){"use strict";var n=r("1626");t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},8925:function(t,e,r){"use strict";var n=r("e330"),i=r("1626"),o=r("c6cd"),a=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},"907a":function(t,e,r){"use strict";var n=r("ebb5"),i=r("07fa"),o=r("5926"),a=n.aTypedArray,f=n.exportTypedArrayMethod;f("at",(function(t){var e=a(this),r=i(e),n=o(t),f=n>=0?n:r+n;return f<0||f>=r?void 0:e[f]}))},"90e3":function(t,e,r){"use strict";var n=r("e330"),i=0,o=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+o,36)}},9112:function(t,e,r){"use strict";var n=r("83ab"),i=r("9bf2"),o=r("5c6c");t.exports=n?function(t,e,r){return i.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},"94ca":function(t,e,r){"use strict";var n=r("d039"),i=r("1626"),o=/#|\.prototype\./,a=function(t,e){var r=c[f(t)];return r===s||r!==u&&(i(e)?n(e):!!e)},f=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",s=a.POLYFILL="P";t.exports=a},"986a":function(t,e,r){"use strict";var n=r("ebb5"),i=r("a258").findLast,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("findLast",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"9a1f":function(t,e,r){"use strict";var n=r("c65b"),i=r("59ed"),o=r("825a"),a=r("0d51"),f=r("35a1"),c=TypeError;t.exports=function(t,e){var r=arguments.length<2?f(t):e;if(i(r))return o(n(r,t));throw new c(a(t)+" is not iterable")}},"9adc":function(t,e,r){"use strict";var n=r("8558");t.exports="NODE"===n},"9bf2":function(t,e,r){"use strict";var n=r("83ab"),i=r("0cfb"),o=r("aed9"),a=r("825a"),f=r("a04b"),c=TypeError,u=Object.defineProperty,s=Object.getOwnPropertyDescriptor,d="enumerable",l="configurable",h="writable";e.f=n?o?function(t,e,r){if(a(t),e=f(e),a(r),"function"===typeof t&&"prototype"===e&&"value"in r&&h in r&&!r[h]){var n=s(t,e);n&&n[h]&&(t[e]=r.value,r={configurable:l in r?r[l]:n[l],enumerable:d in r?r[d]:n[d],writable:!1})}return u(t,e,r)}:u:function(t,e,r){if(a(t),e=f(e),a(r),i)try{return u(t,e,r)}catch(n){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},a04b:function(t,e,r){"use strict";var n=r("c04e"),i=r("d9b5");t.exports=function(t){var e=n(t,"string");return i(e)?e:e+""}},a258:function(t,e,r){"use strict";var n=r("0366"),i=r("44ad"),o=r("7b0b"),a=r("07fa"),f=function(t){var e=1===t;return function(r,f,c){var u,s,d=o(r),l=i(d),h=a(l),p=n(f,c);while(h-- >0)if(u=l[h],s=p(u,h,d),s)switch(t){case 0:return u;case 1:return h}return e?-1:void 0}};t.exports={findLast:f(0),findLastIndex:f(1)}},ae93:function(t,e,r){"use strict";var n,i,o,a=r("d039"),f=r("1626"),c=r("861d"),u=r("7c73"),s=r("e163"),d=r("cb2d"),l=r("b622"),h=r("c430"),p=l("iterator"),y=!1;[].keys&&(o=[].keys(),"next"in o?(i=s(s(o)),i!==Object.prototype&&(n=i)):y=!0);var v=!c(n)||a((function(){var t={};return n[p].call(t)!==t}));v?n={}:h&&(n=u(n)),f(n[p])||d(n,p,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:y}},aed9:function(t,e,r){"use strict";var n=r("83ab"),i=r("d039");t.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},b42e:function(t,e,r){"use strict";var n=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?i:n)(e)}},b5db:function(t,e,r){"use strict";var n=r("cfe9"),i=n.navigator,o=i&&i.userAgent;t.exports=o?String(o):""},b620:function(t,e,r){"use strict";var n=r("cfe9"),i=r("7282"),o=r("c6b6"),a=n.ArrayBuffer,f=n.TypeError;t.exports=a&&i(a.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==o(t))throw new f("ArrayBuffer expected");return t.byteLength}},b622:function(t,e,r){"use strict";var n=r("cfe9"),i=r("5692"),o=r("1a2d"),a=r("90e3"),f=r("04f8"),c=r("fdbf"),u=n.Symbol,s=i("wks"),d=c?u["for"]||u:u&&u.withoutSetter||a;t.exports=function(t){return o(s,t)||(s[t]=f&&o(u,t)?u[t]:d("Symbol."+t)),s[t]}},bcbf:function(t,e,r){"use strict";var n=r("f5df");t.exports=function(t){var e=n(t);return"BigInt64Array"===e||"BigUint64Array"===e}},c04e:function(t,e,r){"use strict";var n=r("c65b"),i=r("861d"),o=r("d9b5"),a=r("dc4a"),f=r("485a"),c=r("b622"),u=TypeError,s=c("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var r,c=a(t,s);if(c){if(void 0===e&&(e="default"),r=n(c,t,e),!i(r)||o(r))return r;throw new u("Can't convert object to primitive value")}return void 0===e&&(e="number"),f(t,e)}},c430:function(t,e,r){"use strict";t.exports=!1},c65b:function(t,e,r){"use strict";var n=r("40d5"),i=Function.prototype.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},c6b6:function(t,e,r){"use strict";var n=r("e330"),i=n({}.toString),o=n("".slice);t.exports=function(t){return o(i(t),8,-1)}},c6cd:function(t,e,r){"use strict";var n=r("c430"),i=r("cfe9"),o=r("6374"),a="__core-js_shared__",f=t.exports=i[a]||o(a,{});(f.versions||(f.versions=[])).push({version:"3.41.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})},c8ba:function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(n){"object"===typeof window&&(r=window)}t.exports=r},ca84:function(t,e,r){"use strict";var n=r("e330"),i=r("1a2d"),o=r("fc6a"),a=r("4d64").indexOf,f=r("d012"),c=n([].push);t.exports=function(t,e){var r,n=o(t),u=0,s=[];for(r in n)!i(f,r)&&i(n,r)&&c(s,r);while(e.length>u)i(n,r=e[u++])&&(~a(s,r)||c(s,r));return s}},cb2d:function(t,e,r){"use strict";var n=r("1626"),i=r("9bf2"),o=r("13d2"),a=r("6374");t.exports=function(t,e,r,f){f||(f={});var c=f.enumerable,u=void 0!==f.name?f.name:e;if(n(r)&&o(r,u,f),f.global)c?t[e]=r:a(e,r);else{try{f.unsafe?t[e]&&(c=!0):delete t[e]}catch(s){}c?t[e]=r:i.f(t,e,{value:r,enumerable:!1,configurable:!f.nonConfigurable,writable:!f.nonWritable})}return t}},cc12:function(t,e,r){"use strict";var n=r("cfe9"),i=r("861d"),o=n.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},cdce:function(t,e,r){"use strict";var n=r("cfe9"),i=r("1626"),o=n.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},cfe9:function(t,e,r){"use strict";(function(e){var r=function(t){return t&&t.Math===Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()}).call(this,r("c8ba"))},d012:function(t,e,r){"use strict";t.exports={}},d039:function(t,e,r){"use strict";t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,r){"use strict";var n=r("cfe9"),i=r("1626"),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(n[t]):n[t]&&n[t][e]}},d1e7:function(t,e,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!n.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:n},d2bb:function(t,e,r){"use strict";var n=r("7282"),i=r("861d"),o=r("1d80"),a=r("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{t=n(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch(f){}return function(r,n){return o(r),a(n),i(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0)},d429:function(t,e,r){"use strict";var n=r("07fa"),i=r("5926"),o=RangeError;t.exports=function(t,e,r,a){var f=n(t),c=i(r),u=c<0?f+c:c;if(u>=f||u<0)throw new o("Incorrect index");for(var s=new e(f),d=0;d92||"NODE"===a&&o>94||"BROWSER"===a&&o>97)return!1;var t=new ArrayBuffer(8),e=f(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength}))},dc4a:function(t,e,r){"use strict";var n=r("59ed"),i=r("7234");t.exports=function(t,e){var r=t[e];return i(r)?void 0:n(r)}},df75:function(t,e,r){"use strict";var n=r("ca84"),i=r("7839");t.exports=Object.keys||function(t){return n(t,i)}},df7e:function(t,e,r){"use strict";var n=r("07fa");t.exports=function(t,e){for(var r=n(t),i=new e(r),o=0;o2?r:n(e),a=new t(o);while(o>i)a[i]=e[i++];return a}},e163:function(t,e,r){"use strict";var n=r("1a2d"),i=r("1626"),o=r("7b0b"),a=r("f772"),f=r("e177"),c=a("IE_PROTO"),u=Object,s=u.prototype;t.exports=f?u.getPrototypeOf:function(t){var e=o(t);if(n(e,c))return e[c];var r=e.constructor;return i(r)&&e instanceof r?r.prototype:e instanceof u?s:null}},e177:function(t,e,r){"use strict";var n=r("d039");t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e330:function(t,e,r){"use strict";var n=r("40d5"),i=Function.prototype,o=i.call,a=n&&i.bind.bind(o,o);t.exports=n?a:function(t){return function(){return o.apply(t,arguments)}}},e893:function(t,e,r){"use strict";var n=r("1a2d"),i=r("56ef"),o=r("06cf"),a=r("9bf2");t.exports=function(t,e,r){for(var f=i(e),c=a.f,u=o.f,s=0;s= fInclineAngle + sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle && y1 <= (1.0- fInclineAngle) + sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle && ((x1>=0.0 && x1<=(1.0/unfoldPara-0.5)) || (x1 >=(1.5-1.0/unfoldPara) && x1<=1.0))){","x2 = x1;","y2 = (y1 - sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle - fInclineAngle) / (1.0 - 2.0 * fInclineAngle);","if(x2 < (1.0 / unfoldPara - 0.5)){","x3 = 0.0 - ((asin((x2 - (1.0 / unfoldPara - 0.5)) / (1.0 / unfoldPara - 0.5)) * 2.0 / 3.1415926) * (1.0 - 0.5 * unfoldPara) / 2.0);","y3 = y2;","}else{","x3 = 1.0 - (asin((x2 - (1.5 - 1.0 / unfoldPara)) / (1.0 / unfoldPara - 0.5)) * 2.0 / 3.1415926) * (1.0 - 0.5 * unfoldPara) / 2.0;","y3 = y2;","}","tcOut.x = (1.0 + (y3 * 0.8 + 0.2) * cos(x3 * 2.0 * 3.1415926 + fAngle)) / 2.0;","tcOut.y = (1.0 + (y3 * 0.8 + 0.2) * sin(x3 * 2.0 * 3.1415926 + fAngle)) / 2.0;","}","if(y1 >= fInclineAngle - sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle && y1 <= (1.0- fInclineAngle) - sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle && x1>=0.0 && x1<=1.0){","x2 = x1;","y2 = (y1 + sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle - fInclineAngle) / (1.0 - 2.0 * fInclineAngle);","x3 = (asin((x2 - 0.5) / 0.5) * 2.0 / 3.1415926 * 0.25 * unfoldPara + 0.5) * (2.0 - unfoldPara) + x2 * (unfoldPara - 1.0);","y3 = y2;","tcOut.x = (1.0 + (y3 * 0.8 + 0.2) * cos(x3 * 2.0 * 3.1415926 + fAngle)) / 2.0;","tcOut.y = (1.0 + (y3 * 0.8 + 0.2) * sin(x3 * 2.0 * 3.1415926 + fAngle)) / 2.0;","}","return tcOut;","}"].join("\n"),k=["vec2 fishEye(in vec2 tc, in float fAngle){","vec2 tcOut;","tcOut.x = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * cos(tc.x * 2.0 * 3.1415926 + fAngle);","tcOut.y = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * sin(tc.x * 2.0 * 3.1415926 + fAngle);","return tcOut;","}"].join("\n"),Y=["vec2 fishEye(in vec2 tc, in float fAngle){","vec2 tcOut;","tcOut.x = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * cos(tc.x * 3.1415926 + fAngle);","tcOut.y = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * sin(tc.x * 3.1415926 + fAngle);","return tcOut;","}"].join("\n"),Z=["vec2 fishEye(in vec2 tc, in float fAngle){","vec2 tcOut;","tcOut.x = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * cos((tc.x / 2.0 + 0.5) * 2.0 * 3.1415926 + fAngle);","tcOut.y = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * sin((tc.x / 2.0 + 0.5) * 2.0 * 3.1415926 + fAngle);","return tcOut;","}"].join("\n"),G=["vec2 longitude(in vec2 tc, in float heightOverWidthOfVideo, in float unfoldPara, in int projMode, in float coefficient){","vec2 tcOut;","float cutFactor;","if (heightOverWidthOfVideo > 0.75)","cutFactor = 0.5 - 0.5 * 9.0 / 16.0 / heightOverWidthOfVideo;","else","cutFactor = 0.05 / heightOverWidthOfVideo;","cutFactor = unfoldPara*cutFactor;","tc.y = (1.0-2.0*cutFactor)*tc.y+cutFactor;","tc.y = tc.y * heightOverWidthOfVideo + 0.5 - 0.5 * heightOverWidthOfVideo;","tcOut.x = 0.5 + (tc.x - 0.5) * sqrt(0.25 - (tc.y - 0.5)*(tc.y-0.5)*(1.0+(unfoldPara-1.0)*(unfoldPara-1.0)*(unfoldPara-1.0)))/0.5;","tcOut.y = tc.y;","tcOut.y = (tcOut.y - 0.5 + 0.5 * heightOverWidthOfVideo) / heightOverWidthOfVideo;","tcOut = winplane(tcOut, 0.0, 0.0, 2.0, 1.0, heightOverWidthOfVideo, heightOverWidthOfVideo, projMode, coefficient);","return tcOut;","}"].join("\n"),q=["vec2 latitude(in vec2 tc, in float heightOverWidthOfVideo, in float unfoldPara, in int projMode, in float coefficient){","vec2 tcOut;","float cutFactor;","if (heightOverWidthOfVideo < 1.33)","cutFactor = 0.5 - 0.5 * 9.0 / 16.0 * heightOverWidthOfVideo;","else","cutFactor = 0.05 * heightOverWidthOfVideo;","cutFactor = unfoldPara*cutFactor;","tc.x = (1.0-2.0*cutFactor)*tc.x+cutFactor;","tc.x = tc.x / heightOverWidthOfVideo + 0.5 - 0.5 / heightOverWidthOfVideo;","tcOut.y = 0.5 + (tc.y - 0.5) * sqrt(0.25 - (tc.x - 0.5)*(tc.x-0.5)*(1.0+(unfoldPara-1.0)*(unfoldPara-1.0)*(unfoldPara-1.0)))/0.5;","tcOut.x = tc.x;","tcOut.x = (tcOut.x - 0.5 + 0.5 / heightOverWidthOfVideo) * heightOverWidthOfVideo;","tcOut = winplane(tcOut, 0.0, 0.0, 2.0, 1.0, heightOverWidthOfVideo, heightOverWidthOfVideo, projMode, coefficient);","return tcOut;","}"].join("\n"),X=["vec2 fishEye(in vec2 tc, in float fAngle){","vec2 tcOut;","float fFactorx = 1.2;","float fFactory = 1.2;","float fFocalx = 0.331095;","float fCenterx = 0.538893;","float fFocaly = 0.331699;","float fCentery = 0.476102;","float fK1 = -0.00712683;","float fK2 = -0.00954012;","float fK3 = 0.00416203;","float fK4 = -0.00246566;","float fCamx = (tc.x - fCenterx) / fFocalx;","float fCamy = (tc.y - fCentery) / fFocaly;","if(fCamx * fCamx + fCamy * fCamy < 0.0001){","tcOut.x = fFactorx * (tc.x - fCenterx) + fCenterx;","tcOut.y = fFactory * (tc.y - fCentery) + fCentery;","return tcOut;","}","float fTheta = atan(sqrt(fCamx * fCamx + fCamy * fCamy));","float fThetad = fTheta + fK1 * fTheta * fTheta * fTheta;","fThetad += fK2 * fTheta * fTheta * fTheta * fTheta * fTheta;","fThetad += fK3 * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta;","fThetad += fK4 * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta;","float fCameraX = fThetad * fCamx / sqrt(fCamx * fCamx + fCamy * fCamy);","float fCameraY = fThetad * fCamy / sqrt(fCamx * fCamx + fCamy * fCamy);","tcOut.x = fCameraX * fFocalx * fFactorx + fCenterx;","tcOut.y = fCameraY * fFocaly * fFactory + fCentery;","return tcOut;","}"].join("\n"),K=["vec2 winplane(in vec2 tc, in float alpha, in float beta, in float sizeOverPointZ,in float viewPointZ,in float heightOverWidthOfScreen, in float heightOverWidthOfVideo, in int projMode, in float coefficient) {","vec2 tcOut = vec2(-1.0, -1.0);","int boxingMode = 0;","int baseOnHeight = 1;","if (boxingMode == 0){","if (heightOverWidthOfScreen > heightOverWidthOfVideo)","baseOnHeight = 0;","}","else if (boxingMode == 2) {","baseOnHeight = 0;","}","float x1, y1;","if (baseOnHeight == 1) {","x1=(tc.x-0.5)*sizeOverPointZ*heightOverWidthOfVideo/heightOverWidthOfScreen;","y1=(tc.y-0.5)*sizeOverPointZ*heightOverWidthOfVideo;","}","else {","x1=(tc.x-0.5)*sizeOverPointZ;","y1=(tc.y-0.5)*sizeOverPointZ*heightOverWidthOfScreen;","}","float a,b,c,delta,t,fTmp;","a=x1*x1+y1*y1+1.0;","c=1.0-1.0/(viewPointZ*viewPointZ);","delta = 1.0 - a * c;","if(delta >= 0.0){","float x2,y2,z2;","t= (1.0 + sqrt(delta)) / a;","x2 = t * x1;","y2 = t * y1;","z2 = (1.0 - t);","float x3,y3,z3,x4,y4,z4;","x3 = x2;","y3 = y2 * cos(alpha) - z2 * sin(alpha);","z3 = y2 * sin(alpha) + z2 * cos(alpha);","x4 = x3 * cos(beta) - y3 * sin(beta);","y4 = x3 * sin(beta) + y3 * cos(beta);","z4 = z3;","if(z4<0.0){","float s,t,fSinThita,fThita,x5,y5;","s=x4*x4+y4*y4;","fSinThita=sqrt(s);","fThita=asin(fSinThita*viewPointZ);","x5 = x4 / fSinThita;","y5 = y4 / fSinThita;","if (projMode == 0) ","t = 0.63662 * fThita;","else if (projMode == 1)","t = sin(fThita);","else if (projMode == 2)","t = sqrt(2.0) * sin(fThita / 2.0);","else if (projMode == 3)","t = tan(fThita / 2.0);","else if (projMode == 4)","t = 0.63662 * fThita * coefficient + tan(fThita / 2.0) * (1.0 - coefficient);","else if (projMode == 5)","t = 0.63662 * fThita * coefficient + sin(fThita) * (1.0 - coefficient);","else ","t = 0.63662 * fThita;","x5 = t*x5;","y5 = t*y5;","tcOut.x=(x5+1.0)/2.0;","tcOut.y=(y5+1.0)/2.0;","if(tcOut.y < 0.5 - 0.5 * heightOverWidthOfVideo || tcOut.y > 0.5 + 0.5 * heightOverWidthOfVideo)","{","tcOut.x = -1.0;","tcOut.y = -1.0;","}","else","{","tcOut.y = (tcOut.y - 0.5 + 0.5 * heightOverWidthOfVideo) / (heightOverWidthOfVideo);","}","}","}","return tcOut;","}"].join("\n"),$=["vec2 winplane(in vec2 tc, in float alpha, in float beta, in float sizeOverPointZ,in float viewPointZ,in float heightOverWidthOfScreen, in float heightOverWidthOfVideo, in int projMode, in float coefficient) {","vec2 tcOut = vec2(-1.0, -1.0);","int boxingMode = 0;","int baseOnHeight = 1;","if (boxingMode == 0){","if (heightOverWidthOfScreen > heightOverWidthOfVideo)","baseOnHeight = 0;","}","else if (boxingMode == 2) {","baseOnHeight = 0;","}","float x1, y1;","if (baseOnHeight == 1) {","x1=(tc.x-0.5)*sizeOverPointZ*heightOverWidthOfVideo/heightOverWidthOfScreen;","y1=(tc.y-0.5)*sizeOverPointZ*heightOverWidthOfVideo;","}","else {","x1=(tc.x-0.5)*sizeOverPointZ;","y1=(tc.y-0.5)*sizeOverPointZ*heightOverWidthOfScreen;","}","float a,b,c,delta,t,fTmp;","a=x1*x1+y1*y1+1.0;","c=1.0-1.0/(viewPointZ*viewPointZ);","delta = 1.0 - a * c;","if(delta >= 0.0){","float x2,y2,z2;","t= (1.0 + sqrt(delta)) / a;","x2 = t * x1;","y2 = t * y1;","z2 = (1.0 - t);","float x3,y3,z3,x4,y4,z4;","x3 = x2;","y3 = y2 * cos(alpha) - z2 * sin(alpha);","z3 = y2 * sin(alpha) + z2 * cos(alpha);","x4 = x3 * cos(beta) - z3 * sin(beta);","y4 = y3;","z4 = x3 * sin(beta) + z3 * cos(beta);","if(z4<0.0){","float s,t,fSinThita,fThita,x5,y5;","s=x4*x4+y4*y4;","fSinThita=sqrt(s);","fThita=asin(fSinThita*viewPointZ);","x5 = x4 / fSinThita;","y5 = y4 / fSinThita;","if (projMode == 0) ","t = 0.63662 * fThita;","else if (projMode == 1)","t = sin(fThita);","else if (projMode == 2)","t = sqrt(2.0) * sin(fThita / 2.0);","else if (projMode == 3)","t = tan(fThita / 2.0);","else if (projMode == 4)","t = 0.63662 * fThita * coefficient + tan(fThita / 2.0) * (1.0 - coefficient);","else if (projMode == 5)","t = 0.63662 * fThita * coefficient + sin(fThita) * (1.0 - coefficient);","else ","t = 0.63662 * fThita;","x5 = t*x5;","y5 = t*y5;","tcOut.x=(x5+1.0)/2.0;","tcOut.y=(y5+1.0)/2.0;","if(tcOut.y < 0.5 - 0.5 * heightOverWidthOfVideo || tcOut.y > 0.5 + 0.5 * heightOverWidthOfVideo)","{","tcOut.x = -1.0;","tcOut.y = -1.0;","}","else","{","tcOut.y = (tcOut.y - 0.5 + 0.5 * heightOverWidthOfVideo) / (heightOverWidthOfVideo);","}","}","}","return tcOut;","}"].join("\n"),Q=["const mat4 YUV2RGB = mat4","("," 1, 0, 1.5748, -0.7874,"," 1, -0.1868, -0.4680, 0.3274,"," 1, 1.856, 0, -0.928,"," 0, 0, 0, 1",");"].join("\n"),J=["void main() {","vec2 tc = vTextureCoord;"].join("\n"),tt="tc.y = 1.0 - tc.y;\n",et="tc.x = 1.0 - tc.x;\n",rt="tc = dewrap(tc);\n",nt="tc = fishEye(tc, fAngle);\n",it="tc = cylinder(tc, fAngle, unfoldPara + 1.0, heightOverWidthOfScreen);\n",ot="tc = longitude(tc, heightOverWidthOfVideo, unfoldPara, projMode, coefficient);\n",at="tc = latitude(tc, heightOverWidthOfVideo, unfoldPara, projMode, coefficient);\n",ft="tc = winplane(tc, alpha, beta, sizeOverPointZ, viewPointZ, heightOverWidthOfScreen, heightOverWidthOfVideo, projMode, coefficient);\n",ct=["vec3 yuv;","yuv.x = texture2D(YTexture, tc).x;","yuv.y = texture2D(UTexture, tc).x;","yuv.z = texture2D(VTexture, tc).x;"].join("\n"),ut=["vec2 tc1;","float stepW = 1.0 / float(hazermWidth);","float stepH = 1.0 / float(hazermHeight);","int x,y;","float tx;","float tMin = 0.15;","float sqr_tMin_minus_half = (tMin - 0.5) * (tMin - 0.5);","int winSize= 5;","float sumY = 0.0;","float scaleConMax = 2.0;","float scaleSatMax = 3.0;","float scaleCon;","float scaleSat;","if (hazermA > 0.0) {","tx = ((0.5 - tMin) * 9.0 * pow(yuv.x - hazermA, 2.0) / (hazermA * hazermA) + tMin);","tx = min(1.0, tx);","tx *= pow(abs(yuv.y) + abs(yuv.z), 2.0) / 0.03125 + 0.5;","tx = clamp(tx, tMin, 1.0);","for (y = -winSize / 2; y <= winSize / 2; y++) {","for (x = -winSize / 2; x <= winSize / 2; x++) {","tc1 = tc + vec2(float(x) * stepW, float(y) * stepH);","sumY += texture2D(YTexture, tc1).x;","}}","scaleCon = scaleConMax * (1.0 - pow(tx - 0.5, 2.0) / sqr_tMin_minus_half);","scaleCon = max(0.0, scaleCon);","yuv.x = yuv.x + (yuv.x - sumY / float(winSize * winSize)) * scaleCon;","yuv.x = clamp(yuv.x, 0.0, 1.0);","scaleSat = scaleSatMax + (1.0 - scaleSatMax) * pow(tx - 0.5, 2.0) / sqr_tMin_minus_half;","scaleSat = max(1.0, scaleSat);","yuv.y *= scaleSat;","yuv.z *= scaleSat;","yuv.y = clamp(yuv.y, -0.5, 0.5);","yuv.z = clamp(yuv.z, -0.5, 0.5);","}"].join("\n"),st="gl_FragColor = vec4(yuv, 1) * YUV2RGB;\n",dt="gl_FragColor = texture2D(videoTexture, tc);\n",lt=t=>["mediump vec2 dewarp(in vec2 tc){",`mediump vec4 k = vec4(${t.fK1},${t.fK2},${t.fK3},${t.fK4});`,`mediump vec2 center1 = vec2(${t.fCenter1x},${t.fCenter1y});`,`mediump vec2 focal1 = vec2(${t.fFocal1x},${t.fFocal1y});`,`mediump vec2 center2 = vec2(${t.fCenter2x},${t.fCenter2y});`,`mediump vec2 focal2 = vec2(${t.fFocal2x},${t.fFocal2y});`,"mediump vec2 tc1 = (tc - center2) / focal2;","float r = sqrt(dot(tc1, tc1));","float theta = atan(r);","float theta2 = theta * theta;","float theta4 = theta2 * theta2;","float theta6 = theta4 * theta2;","float theta8 = theta4 * theta4;","float theta_d = theta * (1.0 + k.x * theta2 + k.y * theta4 + k.z * theta6 + k.w * theta8);","float scale = 1.0;","if (r > 0.0001) scale = theta_d / r;","mediump vec2 tc2 = scale * focal1 * tc1 + center1;","return tc2;","}"].join("\n"),ht="}";class pt{constructor(t,e){this.gl=t,this.options=e,this.programHandle=null,this.vertexPositionHandle=-1,this.textureCoordsHandle=-1,this.vertextAttribNeedUpdate=0,this.heightOverWidthOfScreenHandle=null,this.heightOverWidthOfScreenNeedUpdate=0,this.fAngleHandle=null,this.fishEyeAngleNeedUpdate=0,this.unfoldParaHandle=null,this.unfoldParaNeedUpdate=0,this.heightOverWidthOfVideoHandle=null,this.fishEyeHeightOverWidthOfVideoNeedUpdate=0,this.winPlaneAlphaHandle=null,this.winPlaneBetaHandle=null,this.winPlaneSizeOverPointZHandle=null,this.winPlaneViewPointZHandle=null,this.winPlaneProjModeHandle=null,this.winPlaneCoefficientHandle=null,this.fishEyeWinPlaneParamsNeedUpdate=0}initProgram(){this.vertextAttribNeedUpdate=1,this.heightOverWidthOfScreenNeedUpdate=1,this.fishEyeAngleNeedUpdate=1,this.unfoldParaNeedUpdate=1,this.fishEyeHeightOverWidthOfVideoNeedUpdate=1,this.fishEyeWinPlaneParamsNeedUpdate=1;let{programIndex:t=0}=this.options,e=this.getVertexShaderSource(),r=this.getFragmentShaderSource(t);this.programHandle=this.createProgram(e,r),this.getBaseHandles()}getVertexShaderSource(){return D}getFragmentShaderSource(t=0){let{options:e}=this,[r,n,i,v,g,O,x,b,m,E,T,P,R,_,A]=[...new Array(15).fill("")];switch(e.verticalMirror&&(n=tt),e.horizontalMirror&&(i=et),e.dewarp&&(v=lt(e.dewarpParameter),g=rt),e.displayMode){case a:m=z,x=F,E=it;break;case f:m=k;break;case c:m=0==t?Y:Z;break;case u:case s:b=$,e.displayMode==u?(m=G,x=L,E=ot):(m=q,T=V,E=at);break;case d:m=X;break;case l:case h:m=K,x=H,E=ft;break;case p:m=$,x=H,E=ft;break;case o:default:break}""!==m&&(x=x||j,E=E||nt),e.hazerm&&(T=B,P=ut),e.frameType===y?(r=N,R=Q,_=ct,A=st):(r=W,A=dt);let w=[U,r,x,T,v,O,b,m,R,J,n,i,g,E,_,P,A,ht].filter(t=>!!t).join("\n");return w}createProgram(t,e){let{gl:r}=this;const n=r.createProgram(),i=this.loadShader(r.VERTEX_SHADER,t),o=this.loadShader(r.FRAGMENT_SHADER,e);return r.attachShader(n,i),r.attachShader(n,o),r.linkProgram(n),r.useProgram(n),n}loadShader(t,e){let{gl:r}=this;const n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),r.getShaderParameter(n,r.COMPILE_STATUS)?n:(console.log("An error occurred compiling the shaders: "+r.getShaderInfoLog(n)),r.deleteShader(n),null)}getBaseHandles(){let{gl:t,programHandle:e}=this;this.vertexPositionHandle=t.getAttribLocation(e,"aVertexPosition"),this.textureCoordsHandle=t.getAttribLocation(e,"aTextureCoord"),this.heightOverWidthOfScreenHandle=t.getUniformLocation(e,"heightOverWidthOfScreen"),this.heightOverWidthOfVideoHandle=t.getUniformLocation(e,"heightOverWidthOfVideo"),this.fAngleHandle=t.getUniformLocation(e,"fAngle"),this.unfoldParaHandle=t.getUniformLocation(e,"unfoldPara"),this.winPlaneAlphaHandle=t.getUniformLocation(e,"alpha"),this.winPlaneBetaHandle=t.getUniformLocation(e,"beta"),this.winPlaneSizeOverPointZHandle=t.getUniformLocation(e,"sizeOverPointZ"),this.winPlaneViewPointZHandle=t.getUniformLocation(e,"viewPointZ"),this.winPlaneProjModeHandle=t.getUniformLocation(e,"projMode"),this.winPlaneCoefficientHandle=t.getUniformLocation(e,"coefficient")}setVertexAttribData(t,e,r){let{gl:n}=this,i=n.createBuffer();return n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e),n.STATIC_DRAW),n.vertexAttribPointer(t,r,n.FLOAT,!1,0,0),n.enableVertexAttribArray(t),i}deleteProgram(){this.programHandle&&(this.gl.deleteProgram(this.programHandle),this.programHandle=void 0)}}function yt(t){if(t instanceof yt)return t;"number"===typeof t?this.code=t:"string"===typeof t&&(this.code=yt.errorTypes.COMMON_ERR_CUSTOM,this.message=t),this.message||(this.message=yt.defaultMessages[this.code]||"")}yt.prototype.code=0,yt.prototype.message="",yt.errorTypes={MEDIA_ERR_CUSTOM:1e3,MEDIA_ERR_ABORTED:1001,MEDIA_ERR_NETWORK:1002,MEDIA_ERR_DECODE:1003,MEDIA_ERR_SRC_NOT_SUPPORTED:1004,MEDIA_ERR_ENCRYPTED:1005,MEDIA_ERR_TRANSPORT:1006,MEDIA_ERR_CONNECT:1007,MEDIA_ERR_DECODER:1008,CLOUD_ERR_SERVER:1101,CLOUD_ERR_TOKEN:1102,CLOUD_ERR_DEVID:1104,CLOUD_ERR_BANDWIDTH:1105,CLOUD_ERR_PARAM:1106,CLOUD_ERR_DEV_RELAY:1107,CLOUD_ERR_STREAM:1108,CLOUD_ERR_VERSION:1109,CLOUD_ERR_STREAM_LIMIT:1110,CLOUD_ERR_FREE:1111,CLOUD_ERR_WINDOW_LIMIT:1112,CLOUD_ERR_CLIENT_LIMIT:1113,CLOUD_ERR_SHARE_FINISH:1114,CLOUD_ERR_PERMISSION:1115,CLOUD_ERR_ENCRYPT_CHANGED:1120,CLOUD_ERR_TALK_BUSY:1121,CLOUD_ERR_UNBIND:1122,AUDIO_ERR_AUDIO_ENABLE:1201,AUDIO_ERR_PERMISSION_DENIED:1202,AUDIO_ERR_NOT_SUPPORTED_ERROR:1203,AUDIO_ERR_MANDATORY_UNSATISFIED_ERROR:1204,AUDIO_ERR_NOT_FOUND_ERR:1205,AUDIO_ERR_AUDIO_NOSUPPORTED:1206,AUDIO_ERR_AUDIO_BUSY:1207,AUDIO_ERR_NOT_ALLOW:1208,DEVICE_ERR_CHN_OFFLINE:1301,DEVICE_ERR_CHN_INVALID:1302,DEVICE_ERR_PWD_CHANGED:1303,OVER_SHARE_TIME_ERROR:1304,REQUEST_NOT_MEET_SHARE_RULES:1305,COMMON_ERR_CUSTOM:1401,COMMON_ERR_TIME_OUT:1402,COMMON_ERR_NETWORK:1403,COMMON_ERR_INTERNAL:1404,COMMON_ERR_SESSION:1405,COMMON_ERR_OUT_OF_MEMORY:1406,LOCAL_ERR_CONFIG_PLAYBACK:1501,VIDEO_RES_WARNING:2001,NETWORK_UNSTABLE_WARNING:2002,DECODE_WARNING:2003,USING_APP_SPECIFIC_TRAFFIC:3001,RENDER_ERR_NOT_SUPPORT_WEBGL:4001,RENDER_ERR_TEXTURE_SIZE_OUTOFRANGE:4002},yt.defaultMessages={1001:"The fetching of the associated resource was aborted by the user's request.",1002:"Some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available.",1003:"Despite having previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error.",1004:"The associated resource or media provider object (such as a MediaStream) has been found to be unsuitable.",1005:"The media is encrypted and we do not have the keys to decrypt it.",1006:"Transport error",1007:"Websocket connection to server failed",1008:"Unsupported decoder type",1101:"Some error occurred in cloud server",1102:"Token overdued or non-existent",1104:"Invalid device id",1105:"Bandwidth limitted",1106:"The parameter of request has error",1107:"Device cannot connect to relay server",1108:"Fail to get stream",1109:"Unsupported relay protocol version",1110:"The request of stream has limitted",1111:"Had watch for a long time",1112:"Too many vip windows",1113:"Too many vip clients",1114:"Share time has finished",1115:"Permission deny",1120:"The status of media encrypt has been changed",1121:"Device is on calling",1123:"Device has been unbind",1201:"Device does not support voice intercom",1202:"Permission denied error",1203:"Not supported error",1204:"Mandatory unsatisfied error",1205:"Requested device not found",1206:"Call mode not supported",1207:"The audio device is busy and cannot initiate a call",1208:"Permission denied by system",1301:"Device offline",1302:"Device invalid",1303:"The password of the device has been changed",1304:"Not during the sharing session",1305:"The request does not meet the sharing rules",1401:"Unknown error",1402:"Time out",1403:"Network error",1404:"Server internal error",1405:"Session overdued or non-existent",1406:"Out of memory",1501:"Config error",2001:"Resolution too high",2002:"Network unstable",2003:"Decode performance insufficient",3001:"The camera is currently using app specific traffic Need to view through TP-LINK Business Cloud APP",4001:"Video render fail due to not support webgl",4002:"Video render fail due to texture width or height out of range"},Object.keys(yt.errorTypes).forEach(t=>{yt[t]=yt.errorTypes[t],yt.prototype[t]=yt.errorTypes[t]});var vt=yt;const gt={vertexPosition:x,textureCoord:b,fAngle:m,fUnfoldPara:E,fWinPlaneAlpha:A,fWinPlaneBeta:w,fWinPlaneSizeOverPointZ:S,fWinPlaneViewPointZ:I,fWinPlaneProjMode:C,fWinPlaneCoefficient:M};class Ot{constructor(t){this.gl=t,this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}bind(t,e,r){let n=this.gl;n.activeTexture([n.TEXTURE0,n.TEXTURE1,n.TEXTURE2][t]),n.bindTexture(n.TEXTURE_2D,this.texture),n.uniform1i(n.getUniformLocation(e,r),t)}fill(t,e,r,n){let i=this.gl;i.bindTexture(i.TEXTURE_2D,this.texture),n===v?i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r):i.texImage2D(i.TEXTURE_2D,0,i.LUMINANCE,t,e,0,i.LUMINANCE,i.UNSIGNED_BYTE,r)}delete(){this.gl.deleteTexture(this.texture)}}class xt{constructor(t,e){this.canvas=t,this.gl=t.getContext("webgl",{preserveDrawingBuffer:e.preserveDrawingBuffer}),this.programNum=1,this.glPrograms=[],this.zoomBeans=[],this.fDisplayRatio=1,this.fVerticalOffset=0,this.fScreenRatio=1,this.fVideoRatio=1,this.displayMode=e.displayMode||o,this.frameType=e.frameType||this.frameType,this.initGL()}initGL(){if(!this.gl)return void console.log("[ER] WebGL not supported.");switch(this.displayMode){case c:this.programNum=2;break;case l:this.programNum=4;break;default:this.programNum=1;break}let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,1);for(let e=0;e0&&(this.maxTextureSize{let s=f[u];o.useProgram(c.programHandle),c.vertextAttribNeedUpdate?(c.vBuffer=c.setVertexAttribData(c.vertexPositionHandle,s.vertexPosition,3),c.fBuffer=c.setVertexAttribData(c.textureCoordsHandle,s.textureCoord,2),c.vertextAttribNeedUpdate=0):a.length>1&&(o.bindBuffer(o.ARRAY_BUFFER,c.vBuffer),o.vertexAttribPointer(c.vertexPositionHandle,3,o.FLOAT,!1,0,0),o.enableVertexAttribArray(c.vertexPositionHandle),o.bindBuffer(o.ARRAY_BUFFER,c.fBuffer),o.vertexAttribPointer(c.textureCoordsHandle,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(c.textureCoordsHandle)),c.heightOverWidthOfScreenNeedUpdate&&null!==c.heightOverWidthOfScreenHandle&&(o.uniform1f(c.heightOverWidthOfScreenHandle,this.fScreenRatio),c.heightOverWidthOfScreenNeedUpdate=0),c.fishEyeHeightOverWidthOfVideoNeedUpdate&&null!==c.heightOverWidthOfVideoHandle&&(o.uniform1f(c.heightOverWidthOfVideoHandle,this.fVideoRatio),c.fishEyeHeightOverWidthOfVideoNeedUpdate=0),c.fishEyeAngleNeedUpdate&&null!==c.fAngleHandle&&(o.uniform1f(c.fAngleHandle,s.fAngle),c.fishEyeAngleNeedUpdate=0),c.unfoldParaNeedUpdate&&null!==c.unfoldParaHandle&&(o.uniform1f(c.unfoldParaHandle,s.fUnfoldPara),c.unfoldParaNeedUpdate=0),c.fishEyeWinPlaneParamsNeedUpdate&&(null!==c.winPlaneAlphaHandle&&o.uniform1f(c.winPlaneAlphaHandle,s.fWinPlaneAlpha),null!==c.winPlaneBetaHandle&&o.uniform1f(c.winPlaneBetaHandle,s.fWinPlaneBeta),null!==c.winPlaneSizeOverPointZHandle&&o.uniform1f(c.winPlaneSizeOverPointZHandle,s.fWinPlaneSizeOverPointZ),null!==c.winPlaneViewPointZHandle&&o.uniform1f(c.winPlaneViewPointZHandle,s.fWinPlaneViewPointZ),null!==c.winPlaneProjModeHandle&&o.uniform1f(c.winPlaneProjModeHandle,s.fWinPlaneProjMode),null!==c.winPlaneCoefficientHandle&&o.uniform1f(c.winPlaneCoefficientHandle,s.fWinPlaneCoefficient),c.fishEyeWinPlaneParamsNeedUpdate=0),this.frameType===y?(c.y.fill(e,r,t.subarray(0,n)),c.u.fill(e>>1,r>>1,t.subarray(n,n+i)),c.v.fill(e>>1,r>>1,t.subarray(n+i,t.length))):c.t.fill(e,r,t,v),o.drawArrays(o.TRIANGLE_STRIP,0,4)}),t.close&&t.close()}deleteProgram(){this.glPrograms.forEach(t=>{t.deleteProgram()}),this.glPrograms=[],this.zoomBeans=[]}setDisplayInfo(t){this.dispose(),this.displayMode=t.displayMode||o,this.frameType=t.frameType||this.frameType,this.initGL()}setFrameType(t){this.frameType!==t&&(this.dispose(),this.frameType=t,this.initGL())}dispose(){const{gl:t,glPrograms:e,frameType:r}=this;e.forEach(e=>{r===y?(e.y.delete(),e.u.delete(),e.v.delete()):e.t.delete(),t.deleteBuffer(e.vBuffer),t.deleteBuffer(e.fBuffer),e.deleteProgram()}),t.clear(t.COLOR_BUFFER_BIT),this.glPrograms=[],this.zoomBeans=[]}}var bt=xt;e["default"]=bt},fc6a:function(t,e,r){"use strict";var n=r("44ad"),i=r("1d80");t.exports=function(t){return n(i(t))}},fdbf:function(t,e,r){"use strict";var n=r("04f8");t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}})})); //# sourceMappingURL=webgl.umd.min.js.map