PageSourceSearch

https://www.copilot3d.org/_next/static/chunks/62-59e5f3ff99782041.js

js copilot3d.org collected 2026-10-01 06:34:03 UTC 62,412 bytes, 3 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[62],{12403:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]])},13313:(e,t,r)=>{"use strict";var n=r(69431),i=r(72274),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return f(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|p(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(T(e,SharedArrayBuffer)||e&&T(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var i=function(e){if(a.isBuffer(e)){var t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?s(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return c(e),s(e<0?0:0|h(e))}function l(e){for(var t=e.length<0?0:0|h(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.hp=a,t.IS=50,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(c(e),e<=0)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},a.allocUnsafe=function(e){return f(e)},a.allocUnsafeSlow=function(e){return f(e)};function h(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||T(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(i)return n?-1:A(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i,o,s,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=C[e[o]];return i}(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,o=t,s=r,0===o&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}
vendor: 13,068 bytes, line 1
1else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var f=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else -1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){l=!1;break}if(l)return o}return -1}a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(T(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),T(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(T(o,Uint8Array)&&(o=a.from(o)),!a.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?_(this,0,e):d.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(T(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,u=Math.min(o,s),c=this.slice(n,i),f=e.slice(t,r),l=0;l<u;++l)if(c[l]!==f[l]){o=c[l],s=f[l];break}return o<s?-1:+(s<o)},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)};function _(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:(192&(o=e[i+1]))==128&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],s=e[i+2],(192&o)==128&&(192&s)==128&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function w(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function b(e,t,r,n,i,o){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function v(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function E(e,t,r,n,o){return t*=1,r>>>=0,o||v(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,o){return t*=1,r>>>=0,o||v(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,a,u,c,f,l,h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a,u=parseInt(t.substr(2*s,2),16);if((a=u)!=a)break;e[r+s]=u}return s}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,B(A(e,this.length-i),this,i,o);case"ascii":return s=t,a=r,B(S(e),this,s,a);case"latin1":case"binary":return function(e,t,r,n){return B(S(t),e,r,n)}(this,e,t,r);case"base64":return u=t,c=r,B($(e),this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f=t,l=r,B(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-f),this,f,l);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;b(this,e,t,r,i,0)}var o=1,s=0;for(this[t]=255&e;++s<r&&(o*=256);)this[t+s]=e/o&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;b(this,e,t,r,i,0)}var o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);b(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);b(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=i-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),u=s.length;
1if(0===u)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%u]}return this};var x=/[^+/0-9A-Za-z-_]/g;function A(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function S(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function T(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var C=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},18004:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},26569:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]])},28032:(e,t,r)=>{"use strict";r.d(t,{default:()=>i.a});var n=r(42503),i=r.n(n)},36593:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},37303:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},42503:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return u},getImageProps:function(){return a}});let n=r(72719),i=r(69593),o=r(94705),s=n._(r(9515));function a(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:s.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let u=o.Image},45706:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},59864:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},62028:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]])},69343:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},69431:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i((s+a)*3/4-a),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(e,t,n){for(var i,o=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72274:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=5960464477539062e-23*(23===i),p=n?0:o-1,d=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+l>=1?t+=h/u:t+=h*Math.pow(2,1-l),t*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*g}},74553:e=>{e.exports=function({client_id:e,auto_select:t=!1,cancel_on_tap_outside:r=!1,context:n="signin",...i},o){if(!e)throw Error("client_id is required");if("undefined"!=typeof window&&window.document){let s=["signin","signup","use"].includes(n)?n:"signin",a=document.createElement("script");a.src="https://accounts.google.com/gsi/client",a.async=!0,a.defer=!0,document.head.appendChild(a),window.onload=function(){window.google.accounts.id.initialize({client_id:e,callback:o,auto_select:t,cancel_on_tap_outside:r,context:s,...i}),window.google.accounts.id.prompt()}}}},85922:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]])},93827:(e,t,r)=>{"use strict";r.d(t,{Kj:()=>eo});var n=r(55036);r(13313).hp;let i="queue/data",o="upload",s="config",a="This application is currently busy. Please try again. ",u="Connection errored out. ",c="Could not resolve app config. ",f="Space metadata could not be loaded. ",l="Invalid credentials. Could not login. ",h="Root URL not found in client config";async function p(e,t,r){try{return(await (await fetch(`https://huggingface.co/api/spaces/${e}/jwt`,{headers:{Authorization:`Bearer ${t}`,...r?{Cookie:r}:{}}})).json()).token||!1}catch{return!1}}async function d(e){let t=this.options.token?{Authorization:`Bearer ${this.options.token}`}:{};if(t["Content-Type"]="application/json","u">typeof window&&window.gradio_config&&"http://localhost:9876"!==location.origin){if(window.gradio_config.current_page&&(e=e.substring(0,e.lastIndexOf("/"))),window.gradio_config.dev_mode||"u">typeof window&&window?.BUILD_MODE==="dev"){let r=k(e,this.deep_link?s+"?deep_link="+this.deep_link:s),n=await this.fetch(r,{headers:t,credentials:"include"}),i=await g(n,!!this.options.auth);i.root=e||i.root,window.gradio_config={...i,current_page:window.gradio_config.current_page}}return{...window.gradio_config}}if(e){let r=k(e,this.deep_link?s+"?deep_link="+this.deep_link:s),n=await this.fetch(r,{headers:t,credentials:"include"}),i=await g(n,!!this.options.auth);return i.root||(i.root=e),i}throw Error(c)}async function g(e,t){if(e?.status!==401||t){if(e?.status===401&&t)throw Error(l)}else throw Error((await e.json())?.detail?.auth_message||"Login credentials are required to access this space.");if(e?.status===200){let t=await e.json();return t.dependencies?.forEach((e,t)=>{void 0===e.id&&(e.id=t)}),t}if(e?.status===401)throw Error("Not authorized to access this space. ");throw Error(c)}async function y(){let{http_protocol:e,host:t}=await E(this.app_reference,this.options.token);try{if(this.options.auth){let r=await m(e,t,this.options.auth,this.fetch,this.options.token);r&&this.set_cookies(r)}}catch(e){throw Error(e.message)}}async function m(e,t,r,n,i){let o=new FormData;o.append("username",r?.[0]),o.append("password",r?.[1]);let s={};i&&(s.Authorization=`Bearer ${i}`);let a=await n(`${e}//${t}/login`,{headers:s,method:"POST",body:o,credentials:"include"});if(200===a.status)return a.headers.get("set-cookie");throw 401===a.status?Error(l):Error(f)}function _(e){if(e.startsWith("http")){let{protocol:t,host:r,pathname:n}=new URL(e);return{ws_protocol:"https:"===t?"wss":"ws",http_protocol:t,host:r+("/"!==n?n:"")}}return{ws_protocol:"wss",http_protocol:"https:",host:new URL(e).host}}let w=e=>{let t=[];return e.split(/,(?=\s*[^\s=;]+=[^\s=;
1]+)/).forEach(e=>{let[r,n]=e.split(";")[0].split("=");r&&n&&t.push(`${r.trim()}=${n.trim()}`)}),t},b=/^[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+$/,v=/.*hf\.space\/{0,1}.*$/;async function E(e,t){let r={};t&&(r.Authorization=`Bearer ${t}`);let n=e.trim().replace(/\/$/,"");if(b.test(n))try{let t=(await (await fetch(`https://huggingface.co/api/spaces/${n}/host`,{headers:r})).json()).host;return{space_id:e,..._(t)}}catch{throw Error(f)}if(v.test(n)){let{ws_protocol:e,http_protocol:t,host:r}=_(n);return{space_id:r.split("/")[0].replace(".hf.space",""),ws_protocol:e,http_protocol:t,host:r}}return{space_id:!1,..._(n)}}let k=(...e)=>{try{return e.reduce((e,t)=>(e=e.replace(/\/+$/,""),t=t.replace(/^\/+/,""),new URL(t,e+"/").toString()))}catch{throw Error("Invalid URL. A full URL path is required.")}};function x(e,t){switch(e.msg){case"send_data":return{type:"data"};case"send_hash":return{type:"hash"};case"queue_full":return{type:"update",status:{queue:!0,message:a,stage:"error",code:e.code,success:e.success}};case"heartbeat":return{type:"heartbeat"};case"unexpected_error":return{type:"unexpected_error",status:{queue:!0,message:e.message,session_not_found:e.session_not_found,stage:"error",success:!1}};case"broken_connection":return{type:"broken_connection",status:{queue:!0,message:e.message,stage:"error",success:!1}};case"estimation":return{type:"update",status:{queue:!0,stage:t||"pending",code:e.code,size:e.queue_size,position:e.rank,eta:e.rank_eta,success:e.success}};case"progress":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,progress_data:e.progress_data,success:e.success}};case"log":return{type:"log",data:e};case"process_generating":return{type:"generating",status:{queue:!0,message:e.success?null:e.output.error,stage:e.success?"generating":"error",code:e.code,progress_data:e.progress_data,eta:e.average_duration,changed_state_ids:e.success?e.output.changed_state_ids:void 0},data:e.success?e.output:null};case"process_streaming":return{type:"streaming",status:{queue:!0,message:e.output.error,stage:"streaming",time_limit:e.time_limit,code:e.code,progress_data:e.progress_data,eta:e.eta},data:e.output};case"process_completed":return"error"in e.output?{type:"update",status:{queue:!0,title:e.output.title??"Error",message:e.output.error??"An error occurred",visible:e.output.visible,duration:e.output.duration,stage:"error",code:e.code,success:e.success}}:{type:"complete",status:{queue:!0,message:e.success?void 0:e.output.error,stage:e.success?"complete":"error",code:e.code,progress_data:e.progress_data,changed_state_ids:e.success?e.output.changed_state_ids:void 0,used_cache:e.used_cache,cache_duration:e.cache_duration,avg_time:e.avg_time},data:e.success?e.output:null};case"process_starts":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,size:e.rank,position:0,success:e.success,eta:e.eta},original_msg:"process_starts"}}return{type:"none",status:{stage:"error",queue:!0}}}let A=(e=[],t)=>{let r=t?t.parameters:[];if(Array.isArray(e))return t&&r.length>0&&e.length>r.length&&console.warn("Too many arguments provided for the endpoint."),e;let n=[],i=Object.keys(e);return r.forEach((t,r)=>{if(e.hasOwnProperty(t.parameter_name))n[r]=e[t.parameter_name];else if(t.parameter_has_default)n[r]=t.parameter_default;else throw Error(`No value provided for required parameter: ${t.parameter_name}`)}),i.forEach(e=>{if(!r.some(t=>t.parameter_name===e))throw Error(`Parameter \`${e}\` is not a valid keyword argument. Please refer to the API for usage.`)}),n.forEach((e,t)=>{if(void 0===e&&!r[t].parameter_has_default)throw Error(`No value provided for required parameter: ${r[t].parameter_name}`)}),n};async function S(){if(this.api_info)return this.api_info;let{token:e}=this.options,{config:t}=this,r={"Content-Type":"application/json"};if(e&&(r.Authorization=`Bearer ${e}`),t)try{let e,n;if("u">typeof window&&window.gradio_api_info)n=window.gradio_api_info;else{let i=k(t.root,this.api_prefix,"info");if(!(e=await this.fetch(i,{headers:r,credentials:"include"})).ok)throw Error(u);n=await e.json()}return"api"in n&&(n=n.api),n.named_endpoints["/predict"]&&!n.unnamed_endpoints[0]&&(n.unnamed_endpoints[0]=n.named_endpoints["/predict"]),function(e,t,r){let n={named_endpoints:{},unnamed_endpoints:{}};return Object.keys(e).forEach(i=>
1{("named_endpoints"===i||"unnamed_endpoints"===i)&&(n[i]={},Object.entries(e[i]).forEach(([e,{parameters:o,returns:s}])=>{let a=t.dependencies.find(t=>t.api_name===e||t.api_name===e.replace("/",""))?.id||r[e.replace("/","")]||-1,u=-1!==a?t.dependencies.find(e=>e.id==a)?.types:{generator:!1,cancel:!1};if(-1!==a&&t.dependencies.find(e=>e.id==a)?.inputs?.length!==o.length){let e=t.dependencies.find(e=>e.id==a).inputs.map(e=>t.components.find(t=>t.id===e)?.type);try{e.forEach((e,t)=>{"state"===e&&o.splice(t,0,{component:"state",example:null,parameter_default:null,parameter_has_default:!0,parameter_name:null,hidden:!0})})}catch(e){console.error(e)}}let c=(e,t,r,n)=>{var i,o;return{...e,description:(i=e?.type,o=r,"GallerySerializable"===o?"array of [file, label] tuples":"ListStringSerializable"===o?"array of strings":"FileSerializable"===o?"array of files or single file":i?.description),type:function(e,t,r,n){if("Api"===t)return e.type;switch(e?.type){case"string":return"string";case"boolean":return"boolean";case"number":return"number"}return"JSONSerializable"===r||"StringSerializable"===r?"any":"ListStringSerializable"===r?"string[]":"Image"===t?"parameter"===n?"Blob | File | Buffer":"string":"FileSerializable"===r?e?.type==="array"?"parameter"===n?"(Blob | File | Buffer)[]":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]":"parameter"===n?"Blob | File | Buffer":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}":"GallerySerializable"===r?"parameter"===n?"[(Blob | File | Buffer), (string | null)][]":"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]":void 0}(e?.type,t,r,n)||""}};n[i][e]={parameters:o.map(e=>c(e,e?.component,e?.serializer,"parameter")),returns:s.map(e=>c(e,e?.component,e?.serializer,"return")),type:u}}))}),n}(n,t,this.api_map)}catch(e){throw Error("Could not get API info. "+e.message)}}async function $(e,t,r){let n;let i={};this?.options?.token&&(i.Authorization=`Bearer ${this.options.token}`);let s=[];for(let a=0;a<t.length;a+=1e3){let c=t.slice(a,a+1e3),f=new FormData;c.forEach(e=>{f.append("files",e)});try{let t=r?`${e}${this.api_prefix}/${o}?upload_id=${r}`:`${e}${this.api_prefix}/${o}`;n=await this.fetch(t,{method:"POST",body:f,headers:i,credentials:"include"})}catch(e){throw Error(u+e.message)}if(!n.ok){let e=await n.text();return{error:`HTTP ${n.status}: ${e}`}}let l=await n.json();l&&s.push(...l)}return{files:s}}let B={si:{radix:1e3,unit:["b","kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]},iec:{radix:1024,unit:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"]},jedec:{radix:1024,unit:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]}};async function T(e,t,r,n){let i=(Array.isArray(e)?e:[e]).map(e=>e.blob),o=i.filter(e=>e.size>(n??1/0));if(o.length)throw Error(`File(s) exceed the maximum allowed size of ${function(e,t=1,r="jedec"){e=Math.abs(e);let{radix:n,unit:i}=B[r]||B.jedec,o=0;for(;e>=n;)e/=n,++o;return`${e.toFixed(t)} ${i[o]}`}(n||1/0)}: ${o.map(e=>`"${e.name}"`).join(", ")}`);return await Promise.all(await this.upload_files(t,i,r).then(async r=>{if(r.error)throw Error(r.error);return r.files?r.files.map((r,n)=>new C({...e[n],path:r,url:`${t}${this.api_prefix}/file=${r}`})):[]}))}class C{path;url;orig_name;size;blob;is_stream;mime_type;alt_text;b64;meta={_type:"gradio.FileData"};constructor({path:e,url:t,orig_name:r,size:n,blob:i,is_stream:o,mime_type:s,alt_text:a,b64:u}){this.path=e,this.url=t,this.orig_name=r,this.size=n,this.blob=t?void 0:i,this.is_stream=o,this.mime_type=s,this.alt_text=a,this.b64=u}}class O{type;command;meta;fileData;constructor(e,t){this.type="command",this.command=e,this.meta=t}}function j(e,t,r){for(;r.length>1;){let t=r.shift();if("string"==typeof t||"number"==typeof t)e=e[t];else throw Error("Invalid key type")}let n=r.shift();if("string"==typeof n||"number"==typeof n)e[n]=t;else throw Error("Invalid key type")}async function U(e,t,r=[],n=!1,i){if(Array.isArray(e)){let o=[];return await Promise.all(e.map(async(s,a)=>{let u=r.slice();u.push(String(a));let c=await U(e[a],n?i?.parameters[a]?.component||void 0:t,u,!1,i);o=o.concat(c)})),o}if(globalThis.Buffer&&e instanceof globalThis.Buffer||e instanceof Blob)return[{path:r,blob:new Blob([e]),type:t}];if("object"==typeof e&&null!==e){let t=[];for(let n of Object.keys(e)){let o=[...r,n],s=e[n];t=t.concat(await U(s,void 0,o,!1,i))}return t}return[]}function L(e,t,r,n,i=!1){if("input"===n&&!i)throw Error("Invalid code path. Cannot skip state inputs for input.");if("output"===n&&i)return e;let o=[],s=0,a="input"===n?t.inputs:t.outputs;for(let t=0;t<a.length;t++){let n=a[t];if(r.find(e=>e.id===n)?.type==="state"){if(i){if(e.length===a.length){let t=e[s];o.push(t),s++}else o.push(null)}else s++;continue}{let t=e[s];o.push(t),s++}}return o}async function P(e,t,r){let n=this;await I(n,t);let i=await U(t,void 0,[],!0,r);return(await Promise.all(i.map(async({path:t,blob:r,type:i})=>{if(!r)return{path:t,type:i};let o=await n.upload_files(e,[r]);return{path:t,file_url:o.files&&o.files[0],type:i,name:"u">typeof File&&r instanceof File?r?.name:void 0}}
1))).forEach(({path:e,file_url:r,type:n,name:i})=>{"Gallery"===n?j(t,r,e):r&&j(t,new C({path:r,orig_name:i}),e)}),t}async function I(e,t){if(!(e.config?.root||e.config?.root_url))throw Error(h);await z(e,t)}async function z(e,t,r=[]){for(let n in t)t[n]instanceof O?await R(e,t,n):"object"==typeof t[n]&&null!==t[n]&&await z(e,t[n],[...r,n])}async function R(e,t,i){let o=t[i],s=e.config?.root||e.config?.root_url;if(!s)throw Error(h);try{let a,u;if("u">typeof n&&n.versions&&n.versions.node){let e=await r.e(9919).then(r.bind(r,99919));u=(await r.e(9919).then(r.bind(r,99919))).resolve(n.cwd(),o.meta.path),a=await e.readFile(u)}else throw Error("File system access is only available in Node.js environments");let c=new Blob([a],{type:"application/octet-stream"}),f=await e.upload_files(s,[c]),l=f.files&&f.files[0];if(l){let e=new C({path:l,orig_name:o.meta.name||""});t[i]=e}}catch(e){console.error("Error uploading file",e)}}async function q(e,t,r){let n,i;let o={"Content-Type":"application/json"};this.options.token&&(o.Authorization=`Bearer ${this.options.token}`);try{var s=await this.fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...o,...r},credentials:"include"})}catch{return[{error:u},500]}try{n=await s.json(),i=s.status}catch(e){n={error:`Could not parse server response: ${e}`},i=500}return[n,i]}async function D(e,t={}){let r=!1,n=!1;if(!this.config)throw Error("Could not resolve app config");if("number"==typeof e)this.config.dependencies.find(t=>t.id==e);else{let t=e.replace(/^\//,"");this.config.dependencies.find(e=>e.id==this.api_map[t])}return new Promise(async(i,o)=>{let s;for await(let a of this.submit(e,t,null,null,!0))"data"===a.type&&(n&&i(s),r=!0,s=a),"status"===a.type&&("error"===a.stage&&o(a),"complete"===a.stage&&(n=!0,r&&i(s)))})}async function N(e,t,r){let n="subdomain"===t?`https://huggingface.co/api/spaces/by-subdomain/${e}`:`https://huggingface.co/api/spaces/${e}`,i,o;try{if(o=(i=await fetch(n)).status,200!==o)throw Error();i=await i.json()}catch{r({status:"error",load_status:"error",message:"Could not get space status. ",detail:"NOT_FOUND"});return}if(!i||200!==o)return;let{runtime:{stage:s},id:a}=i;switch(s){case"STOPPED":case"SLEEPING":r({status:"sleeping",load_status:"pending",message:"Space is asleep. Waking it up...",detail:s}),setTimeout(()=>{N(e,t,r)},1e3);break;case"PAUSED":r({status:"paused",load_status:"error",message:"This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",detail:s,discussions_enabled:await G(a)});break;case"RUNNING":case"RUNNING_BUILDING":r({status:"running",load_status:"complete",message:"Space is running.",detail:s});break;case"BUILDING":r({status:"building",load_status:"pending",message:"Space is building...",detail:s}),setTimeout(()=>{N(e,t,r)},1e3);break;case"APP_STARTING":r({status:"starting",load_status:"pending",message:"Space is starting...",detail:s}),setTimeout(()=>{N(e,t,r)},1e3);break;default:r({status:"space_error",load_status:"error",message:"This space is experiencing an issue.",detail:s,discussions_enabled:await G(a)})}}"u">typeof n&&n.versions&&n.versions.node;let M=async(e,t)=>{let r=0;return new Promise(n=>{N(e,b.test(e)?"space_name":"subdomain",i=>{t(i),"running"===i.status||"error"===i.status||"paused"===i.status||"space_error"===i.status?n():("sleeping"===i.status||"building"===i.status)&&(r<12?(r++,setTimeout(()=>{M(e,t).then(n)},5e3)):n())})})},F=/^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;async function G(e){try{let t=await fetch(`https://huggingface.co/api/spaces/${e}/discussions`,{method:"HEAD"}),r=t.headers.get("x-error-message");return!(!t.ok||r&&F.test(r))}catch{return!1}}async function H(e,t){let r={};t&&(r.Authorization=`Bearer ${t}`);try{let t=await fetch(`https://huggingface.co/api/spaces/${e}/runtime`,{headers:r});if(200!==t.status)throw Error("Space hardware could not be obtained.");let{hardware:n}=await t.json();return n.current}catch(e){throw Error(e.message)}}async function J(e,t,r){let n={};r&&(n.Authorization=`Bearer ${r}`);try{let r=await fetch(`https://huggingface.co/api/spaces/${e}/sleeptime`,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify({seconds:t})});if(200!==r.status)throw Error("Could not set sleep timeout on duplicated Space. Please visit *ADD HF LINK TO SETTINGS* to set a timeout manually to reduce billing charges.");return await r.json()}catch(e){throw Error(e.message)}}let W=["cpu-basic","cpu-upgrade","cpu-xl","t4-small","t4-medium","a10g-small","a10g-large","a10g-largex2","a10g-largex4","a100-large","zero-a10g","h100","h100x8"];async function Z(e,t){let r;let{token:n,private:i,hardware:o,timeout:s,auth:a}=t;if(o&&!W.includes(o))throw Error(`Invalid hardware type provided. Valid types are: ${W.map(e=>`"${e}"`).join(",")}.`);let{http_protocol:u,host:c}
1=await E(e,n),l=null;if(a){let e=await m(u,c,a,fetch);e&&(l=w(e))}let h={Authorization:`Bearer ${n}`,"Content-Type":"application/json",...l?{Cookie:l.join("; ")}:{}},p=(await (await fetch("https://huggingface.co/api/whoami-v2",{headers:h})).json()).name,d=e.split("/")[1],g={repository:`${p}/${d}`};i&&(g.private=!0);try{o||(r=await H(e,n))}catch(e){throw Error(f+e.message)}g.hardware=o||r||"cpu-basic";try{let r=await fetch(`https://huggingface.co/api/spaces/${e}/duplicate`,{method:"POST",headers:h,body:JSON.stringify(g)});if(409===r.status)try{return await eo.connect(`${p}/${d}`,t)}catch(e){throw console.error("Failed to connect Client instance:",e),e}else if(200!==r.status)throw Error(r.statusText);let i=await r.json();return await J(`${p}/${d}`,s||300,n),await eo.connect(function(e){let t=e.match(/https:\/\/huggingface.co\/spaces\/([^/]+\/[^/]+)/);if(t)return t[1]}(i.url),t)}catch(e){throw Error(e)}}let Y="supports-zerogpu-headers",K=!1;function V(e){return e.includes(".dev.")?`https://moon-${e.split(".")[1]}.dev.spaces.huggingface.tech`:e.endsWith(".hf.space")?"https://huggingface.co":null}class Q extends TransformStream{#e="";constructor(e={allowCR:!1}){super({transform:(t,r)=>{for(t=this.#e+t;;){let n=t.indexOf(`
2`),i=e.allowCR?t.indexOf("\r"):-1;if(-1!==i&&i!==t.length-1&&(-1===n||n-1>i)){r.enqueue(t.slice(0,i)),t=t.slice(i+1);continue}if(-1===n)break;let o="\r"===t[n-1]?n-1:n;r.enqueue(t.slice(0,o)),t=t.slice(n+1)}this.#e=t},flush:t=>{if(""===this.#e)return;let r=e.allowCR&&this.#e.endsWith("\r")?this.#e.slice(0,-1):this.#e;t.enqueue(r)}})}}function X(e,t,r){e.get(t)||e.set(t,r)}async function*ee(e,t){var r;let n,i;if(!e.body)return;let o,s=(r=e.body,n=new TextDecoderStream,i=new Q({allowCR:!0}),r.pipeThrough(n).pipeThrough(i)).getReader(),a;for(;;){if(t&&t.aborted)return s.cancel();if((o=await s.read()).done)return;if(!o.value){a&&(yield a),a=void 0;continue}let[e,r]=function(e){let t=/[:]\s*/.exec(e),r=t&&t.index;if(r)return[e.substring(0,r),e.substring(r+t[0].length)]}(o.value)||[];"data"===e?(a||={})[e]=a[e]?a[e]+`
3`+r:r:"event"===e?(a||={})[e]=r:"id"===e?(a||={})[e]=String(+r)===r?+r:r:"retry"===e&&((a||={})[e]=+r||void 0)}}async function et(e,t){let r=new Request(e,t);X(r.headers,"Accept","text/event-stream"),X(r.headers,"Content-Type","application/json");let n=await fetch(r);if(!n.ok)throw n;return ee(n,r.signal)}async function er(){let{event_callbacks:e,unclosed_events:t,pending_stream_messages:r,stream_status:n,config:o,jwt:s}=this,a=this;if(!o)throw Error("Could not resolve app config");n.open=!0;let c=null,f=new URLSearchParams({session_hash:this.session_hash}).toString(),l=new URL(`${o.root}${this.api_prefix}/${i}?${f}`);if(s&&l.searchParams.set("__sign",s),!(c=this.stream(l))){console.warn("Cannot connect to SSE endpoint: "+l.toString());return}c.onmessage=async function(i){let s=JSON.parse(i.data);if("close_stream"===s.msg){en(n,a.abort_controller);return}let u=s.event_id;if(u){if(e[u]&&o){"process_completed"===s.msg&&["sse","sse_v1","sse_v2","sse_v2.1","sse_v3"].includes(o.protocol)&&t.delete(u);let r=e[u];"u">typeof window&&"u">typeof document?setTimeout(r,0,s):r(s)}else r[u]||(r[u]=[]),r[u].push(s)}else await Promise.all(Object.keys(e).map(t=>e[t](s)))},c.onerror=async function(t){console.error(t),await Promise.all(Object.keys(e).map(t=>e[t]({msg:"broken_connection",message:u})))}}function en(e,t){e&&(e.open=!1,t?.abort())}function ei(e,t={},r,n,o,s){try{let l=function(e){(o||K[e.type])&&g(e)},h=function(){for(ee=!0;er.length>0;)er.shift()({value:void 0,done:!0})},p=function(e){er.length>0?er.shift()(e):et.push(e)},d=function(e){var t;p((t=e,{then:(e,r)=>r(t)})),h()},g=function(e){p({value:e,done:!1})},y=function(){return et.length>0?Promise.resolve(et.shift()):ee?Promise.resolve({value:void 0,done:!0}):new Promise(e=>er.push(e))},{token:m}=this.options,{fetch:_,app_reference:w,config:b,session_hash:v,api_info:E,api_map:k,stream_status:S,pending_stream_messages:$,pending_diff_streams:B,event_callbacks:T,unclosed_events:C,post_data:O,options:j,api_prefix:U}=this,P=s||{"x-gradio-user":"api"},I=this;if(!E)throw Error("No API found");if(!b)throw Error("Could not resolve app config");let{fn_index:z,endpoint_info:R,dependency:q}=function(e,t,r,n){let i,o,s;if("number"==typeof t)i=t,o=e.unnamed_endpoints[i],s=n.dependencies.find(e=>e.id==t);else{let a=t.replace(/^\//,"");i=r[a],o=e.named_endpoints[t.trim()],s=n.dependencies.find(e=>e.id==r[a])}if("number"!=typeof i)throw Error("There is no endpoint matching that name of fn_index matching that number.");return{fn_index:i,endpoint_info:o,dependency:s}}(E,e,k,b),D=A(t,R),N,M=b.protocol??"ws";if("ws"===M)throw Error("WebSocket protocol is not supported in this version");let F="",G="number"==typeof e?"/predict":e,H,J=null,W=!1,Z={},Y="u">typeof window&&"u">typeof document?new URLSearchParams(window.location.search).toString():"",K=j?.events?.reduce((e,t)=>
3(e[t]=!0,e),{})||{};async function c(){let e={},t={};e={event_id:J},t={event_id:J,session_hash:v,fn_index:z};try{if(!b)throw Error("Could not resolve app config");"event_id"in t&&await _(`${b.root}${U}/cancel`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(t)}),await _(`${b.root}${U}/reset`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(e)})}catch{console.warn("The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.")}}let Q=async e=>{await this._resolve_heartbeat(e)};async function f(e){if(!b)return;let t=e.render_id;b.components=[...b.components.filter(e=>e.props.rendered_in!==t),...e.components],b.dependencies=[...b.dependencies.filter(e=>e.rendered_in!==t),...e.dependencies];let r=b.components.some(e=>"state"===e.type),n=b.dependencies.some(e=>e.targets.some(e=>"unload"===e[1]));b.connect_heartbeat=r||n,await Q(b),l({type:"render",data:e,endpoint:G,fn_index:z})}let X=this.handle_blob(b.root,D,R).then(async e=>{let t;if(H={data:L(e,q,b.components,"input",!0)||[],event_data:r,fn_index:z,trigger_id:n},t=b?.dependencies?.find(e=>e.id==z)?.queue,null!=t?t:b.enable_queue){if("sse"==M){l({type:"status",stage:"pending",queue:!0,endpoint:G,fn_index:z,time:new Date});var o=new URLSearchParams({fn_index:z.toString(),session_hash:v}).toString();let e=new URL(`${b.root}${U}/${i}?${Y?Y+"&":""}${o}`);if(this.jwt&&e.searchParams.set("__sign",this.jwt),!(N=this.stream(e)))return Promise.reject(Error("Cannot connect to SSE endpoint: "+e.toString()));N.onmessage=async function(e){let t=JSON.parse(e.data),{type:i,status:o,data:s}=x(t,Z[z]);if("update"===i&&o&&!W)l({type:"status",endpoint:G,fn_index:z,time:new Date,...o}),"error"===o.stage&&(N?.close(),h());else if("data"===i){let[e,t]=await O(`${b.root}${U}/queue/data`,{...H,session_hash:v,event_id:J});200!==t&&(l({type:"status",stage:"error",message:u,queue:!0,endpoint:G,fn_index:z,time:new Date}),N?.close(),h())}else"complete"===i?W=o:"log"===i?l({type:"log",title:s.title,log:s.log,level:s.level,endpoint:G,duration:s.duration,visible:s.visible,fn_index:z}):("generating"===i||"streaming"===i)&&l({type:"status",time:new Date,...o,stage:o?.stage,queue:!0,endpoint:G,fn_index:z});s&&(l({type:"data",time:new Date,data:L(s.data,q,b.components,"output",j.with_null_state),endpoint:G,fn_index:z,event_data:r,trigger_id:n}),W&&(l({type:"status",time:new Date,...W,stage:o?.stage,queue:!0,endpoint:G,fn_index:z}),N?.close(),h()))}}else if("sse_v1"==M||"sse_v2"==M||"sse_v2.1"==M||"sse_v3"==M){l({type:"status",stage:"pending",queue:!0,endpoint:G,fn_index:z,time:new Date});let e="";"u">typeof window&&"u">typeof document&&(e=window?.location?.hostname);let t=V(e);return("u">typeof window&&"u">typeof document&&window.parent!=window&&t&&window.supports_zerogpu_headers?new Promise((e,r)=>{let n=new MessageChannel;n.port1.onmessage=({data:t})=>{n.port1.close(),e(t)},window.parent.postMessage("zerogpu-headers",t,[n.port2])}):Promise.resolve(null)).then(e=>{let t={...P,...e||{}};return O(`${b.root}${U}/queue/join?${Y}`,{...H,session_hash:v},t)}).then(async([e,t])=>{if(e.event_id&&(F=e.event_id),503===t)l({type:"status",stage:"error",message:a,queue:!0,endpoint:G,fn_index:z,time:new Date,visible:!0}),h();else if(422===t)l({type:"status",stage:"error",message:e.detail,queue:!0,endpoint:G,fn_index:z,code:"validation_error",time:new Date,visible:!0}),h();else if(200!==t){let t=e?.error===u;l({type:"status",stage:"error",broken:t,message:t?u:e.detail||e.error,queue:!0,endpoint:G,fn_index:z,time:new Date,visible:!0}),h()}else{F=J=e.event_id;let t=async function(e){try{let{type:r,status:n,data:i,original_msg:o}=x(e,Z[z]);if("heartbeat"==r)return;if("update"===r&&n&&!W)l({type:"status",endpoint:G,fn_index:z,time:new Date,original_msg:o,...n});else if("complete"===r)W=n;else if("unexpected_error"==r||"broken_connection"==r)console.error("Unexpected error",n?.message),l({type:"status",stage:"error",message:n?.message||"An Unexpected Error Occurred!",queue:!0,endpoint:G,broken:"broken_connection"===r,session_not_found:n?.session_not_found,fn_index:z,time:new Date});else if("log"===r){l({type:"log",title:i.title,log:i.log,level:i.level,endpoint:G,duration:i.duration,visible:i.visible,fn_index:z});return}else{var t;("generating"===r||"streaming"===r)&&(l({type:"status",time:new Date,...n,stage:n?.stage,queue:!0,endpoint:G,fn_index:z}),i&&"stream"!==q.connection&&["sse_v2","sse_v2.1","sse_v3"].includes(M)&&(B[t=J]?i.data.forEach((e,r)=>{var n;let o=(n=B[t][r],e.forEach(([e,t,r])=>{n=function(e,t,r,n){if(0===t.length){if("replace"===r)return n;if("append"===r)return e+n;throw Error(`Unsupported action: ${r}`)}let i=e;for(let e=0;e<t.length-1;e++)i=i[t[e]];let o=t[t.length-1];switch(r){case"replace":i[o]=n;break;case"append":i[o]+=n;break;case"add":Array.isArray(i)?i.splice(Number(o),0,n):i[o]=n;break;case"delete":Array.isArray(i)?i.splice(Number(o),1):delete i[o];break;default:throw Error(`Unknown action: ${r}`)}return e}(n,t,e,r)}),n);B[t][r]=o,i.data[r]=o}):(B[t]=[],i.data.forEach((e,r)=>{B[t][r]=e}))))}i&&(l({type:"data",time:new Date,data:L(i.data,q,b.components,"output",j.with_null_state),endpoint:G,fn_index:z}),i.render_config&&await f(i.render_config),W&&(l({type:"status",time:new Date,...W,stage:n?.stage,queue:!0,endpoint:G,fn_index:z}),h())),(n?.stage==="complete"||n?.stage==="error")&&(T[J]&&delete T[J],J in B&&delete B[J],h())}catch(e){console.error("Unexpected client exception",e),l({type:"status",stage:"error",message:"An Unexpected Error Occurred!",queue:!0,endpoint:G,fn_index:z,time:new Date}),["sse_v2","sse_v2.1","sse_v3"].includes(M)&&(en(S,I.abort_controller),S.open=!1,h())}};
3J in $&&($[J].forEach(e=>t(e)),delete $[J]),T[J]=t,C.add(J),S.open||await this.open_stream()}})}}else l({type:"status",endpoint:G,stage:"pending",queue:!1,fn_index:z,time:new Date}),O(`${b.root}${U}/run${G.startsWith("/")?G:`/${G}`}${Y?"?"+Y:""}`,{...H,session_hash:v},P).then(async([e,t])=>{let i=e.data;if(200==t)l({type:"data",endpoint:G,fn_index:z,data:L(i,q,b.components,"output",j.with_null_state),time:new Date,event_data:r,trigger_id:n}),e.render_config&&await f(e.render_config),l({type:"status",endpoint:G,fn_index:z,stage:"complete",eta:e.average_duration,queue:!1,time:new Date});else{let t=e?.error===u;l({type:"status",stage:"error",endpoint:G,fn_index:z,message:e.error,broken:t,queue:!1,time:new Date})}}).catch(e=>{l({type:"status",stage:"error",message:e.message,endpoint:G,fn_index:z,queue:!1,time:new Date})})}),ee=!1,et=[],er=[],ei={[Symbol.asyncIterator]:()=>ei,next:y,throw:async e=>(d(e),y()),return:async()=>(h(),{value:void 0,done:!0}),cancel:c,send_chunk:e=>{this.post_data(`${b.root}${U}/stream/${F}`,{...e,session_hash:this.session_hash})},close_stream:()=>{this.post_data(`${b.root}${U}/stream/${F}/close`,{}),h()},event_id:()=>F,wait_for_id:async()=>(await X,J)};return ei}catch(e){throw console.error("Submit function encountered an error:",e),e}}class eo{app_reference;options;deep_link=null;config;api_prefix="";api_info;api_map={};session_hash=Math.random().toString(36).substring(2);jwt=!1;last_status={};cookies=null;stream_status={open:!1};closed=!1;pending_stream_messages={};pending_diff_streams={};event_callbacks={};unclosed_events=new Set;heartbeat_event=null;abort_controller=null;stream_instance=null;current_payload;get_url_config(e=null){if(!this.config)throw Error(c);null===e&&(e=window.location.href);let t=e=>e.replace(/^\/+|\/+$/g,""),r=t(new URL(this.config.root).pathname),n=t(new URL(e).pathname),i;return i=n.startsWith(r)?t(n.substring(r.length)):"",this.get_page_config(i)}get_page_config(e){if(!this.config)throw Error(c);let t=this.config;return e in t.page||(e=""),{...t,current_page:e,layout:t.page[e].layout,components:t.components.filter(r=>t.page[e].components.includes(r.id)),dependencies:this.config.dependencies.filter(r=>t.page[e].dependencies.includes(r.id))}}fetch(e,t){let r=new Headers(t?.headers||{});return this&&this.cookies&&r.append("Cookie",this.cookies),this&&this.options.headers&&new Headers(this.options.headers).forEach((e,t)=>{r.append(t,e)}),fetch(e,{...t,headers:r})}stream(e){let t=new Headers;return this&&this.cookies&&t.append("Cookie",this.cookies),this&&this.options.headers&&new Headers(this.options.headers).forEach((e,r)=>{t.append(r,e)}),this&&this.options.token&&t.append("Authorization",`Bearer ${this.options.token}`),this.abort_controller=new AbortController,this.stream_instance=function(e,t={}){let r={close:()=>{console.warn("Method not implemented.")},onerror:null,onmessage:null,onopen:null,readyState:0,url:e.toString(),withCredentials:!1,CONNECTING:0,OPEN:1,CLOSED:2,addEventListener:()=>{throw Error("Method not implemented.")},dispatchEvent:()=>{throw Error("Method not implemented.")},removeEventListener:()=>{throw Error("Method not implemented.")}};return et(e,t).then(async e=>{r.readyState=r.OPEN;try{for await(let t of e)r.onmessage&&r.onmessage(t);r.readyState=r.CLOSED}catch(e){r.onerror&&r.onerror(e),r.readyState=r.CLOSED}}).catch(e=>{console.error(e),r.onerror&&r.onerror(e),r.readyState=r.CLOSED}),r}(e.toString(),{credentials:"include",headers:t,signal:this.abort_controller.signal}),this.stream_instance}view_api;upload_files;upload;handle_blob;post_data;submit;predict;open_stream;resolve_config;resolve_cookies;constructor(e,t={events:["data"]}){this.app_reference=e,this.deep_link=t.query_params?.deep_link||null,t.events||(t.events=["data"]),this.options=t,this.current_payload={},t.cookies&&(this.cookies=t.cookies),this.view_api=S.bind(this),this.upload_files=$.bind(this),this.handle_blob=P.bind(this),this.post_data=q.bind(this),this.submit=ei.bind(this),this.predict=D.bind(this),this.open_stream=er.bind(this),this.resolve_config=d.bind(this),this.resolve_cookies=y.bind(this),this.upload=T.bind(this),this.fetch=this.fetch.bind(this),this.handle_space_success=this.handle_space_success.bind(this),this.stream=this.stream.bind(this)}
3async init(){var e;let t;(function(){if(!("u">typeof window&&"u">typeof document&&"function"==typeof window.addEventListener)||K)return;window.addEventListener("message",e=>{e.data===Y&&(window.supports_zerogpu_headers=!0)}),K=!0;let e=V(window.location.hostname);e&&window.parent!==window&&window.parent.postMessage(Y,e)})(),this.options.auth&&await this.resolve_cookies(),await this._resolve_config().then(({config:e})=>this._resolve_heartbeat(e)),this.api_info=await this.view_api(),this.api_map=(e=this.config?.dependencies||[],t={},e.forEach(({api_name:e,id:r})=>{e&&(t[e]=r)}),t)}async _resolve_heartbeat(e){if(e&&(this.config=e,this.api_prefix=e.api_prefix||"",this.config&&this.config.connect_heartbeat&&this.config.space_id&&this.options.token&&(this.jwt=await p(this.config.space_id,this.options.token,this.cookies))),e.space_id&&this.options.token&&(this.jwt=await p(e.space_id,this.options.token)),this.config&&this.config.connect_heartbeat){let e=new URL(`${this.config.root}${this.api_prefix}/heartbeat/${this.session_hash}`);this.jwt&&e.searchParams.set("__sign",this.jwt),this.heartbeat_event||(this.heartbeat_event=this.stream(e))}}static async connect(e,t={events:["data"]}){let r=new this(e,t);return t.session_hash&&(r.session_hash=t.session_hash),await r.init(),r}async reconnect(){let e;let t=new URL(`${this.config.root}${this.api_prefix}/app_id`);try{let r=await this.fetch(t);if(!r.ok)throw Error();e=(await r.json()).app_id}catch{return"broken"}return e!==this.config.app_id?"changed":"connected"}close(){this.closed=!0,en(this.stream_status,this.abort_controller)}set_current_payload(e){this.current_payload=e}static async duplicate(e,t={events:["data"]}){return Z(e,t)}async _resolve_config(){let e;let{http_protocol:t,host:r,space_id:n}=await E(this.app_reference,this.options.token),{status_callback:i}=this.options;n&&i&&await M(n,i);try{let n=`${t}//${r}`;if(!(e=await this.resolve_config(n)))throw Error(c);return this.config_success(e)}catch(e){if(n&&i)N(n,b.test(n)?"space_name":"subdomain",this.handle_space_success);else throw i&&i({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),Error(e)}}async config_success(e){if(this.config=e,this.api_prefix=e.api_prefix||"",this.config.auth_required)return this.prepare_return_obj();try{this.api_info=await this.view_api()}catch(e){console.error("Could not get API info. "+e.message)}return this.prepare_return_obj()}async handle_space_success(e){if(!this)throw Error(c);let{status_callback:t}=this.options;if(t&&t(e),"running"===e.status)try{if(this.config=await this._resolve_config(),this.api_prefix=this?.config?.api_prefix||"",!this.config)throw Error(c);return await this.config_success(this.config)}catch(e){throw t&&t({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),e}}async component_server(e,t,r){let n;if(!this.config)throw Error(c);let i={},{token:o}=this.options,{session_hash:s}=this;o&&(i.Authorization=`Bearer ${this.options.token}`);let a,u=this.config.components.find(t=>t.id===e);if(a=u?.props?.root_url?u.props.root_url:this.config.root,"object"==typeof r&&null!==r&&"binary"in r){for(let e in n=new FormData,r.data)"binary"!==e&&n.append(e,r.data[e]);n.set("component_id",e.toString()),n.set("fn_name",t),n.set("session_hash",s)}else n=JSON.stringify({data:r,component_id:e,fn_name:t,session_hash:s}),i["Content-Type"]="application/json";o&&(i.Authorization=`Bearer ${o}`);try{let e=await this.fetch(`${a}${this.api_prefix}/component_server/`,{method:"POST",body:n,headers:i,credentials:"include"});if(!e.ok)throw Error("Could not connect to component server: "+e.statusText);return await e.json()}catch(e){console.warn(e)}}set_cookies(e){this.cookies=w(e).join("; ")}prepare_return_obj(){return{config:this.config,predict:this.predict,submit:this.submit,view_api:this.view_api,component_server:this.component_server}}}},94112:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(26944).A)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.