19 lines
133 KiB
JavaScript
19 lines
133 KiB
JavaScript
|
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function r(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(n){if(n.ep)return;n.ep=!0;const i=r(n);fetch(n.href,i)}})();var Ac=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function so(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Et={},et={},sr={exports:{}},F=String,lo=function(){return{isColorSupported:!1,reset:F,bold:F,dim:F,italic:F,underline:F,inverse:F,hidden:F,strikethrough:F,black:F,red:F,green:F,yellow:F,blue:F,magenta:F,cyan:F,white:F,gray:F,bgBlack:F,bgRed:F,bgGreen:F,bgYellow:F,bgBlue:F,bgMagenta:F,bgCyan:F,bgWhite:F}};sr.exports=lo();sr.exports.createColors=lo;var Hi=sr.exports;Object.defineProperty(et,"__esModule",{value:!0});et.dim=Ni;et.default=void 0;var ve=Ci(Hi);function Ci(e){return e&&e.__esModule?e:{default:e}}let gr=new Set;function Ht(e,t,r){typeof process<"u"&&{}.JEST_WORKER_ID||r&&gr.has(r)||(r&&gr.add(r),console.warn(""),t.forEach(o=>console.warn(e,"-",o)))}function Ni(e){return ve.default.dim(e)}var Oi={info(e,t){Ht(ve.default.bold(ve.default.cyan("info")),...Array.isArray(e)?[e]:[t,e])},warn(e,t){Ht(ve.default.bold(ve.default.yellow("warn")),...Array.isArray(e)?[e]:[t,e])},risk(e,t){Ht(ve.default.bold(ve.default.magenta("risk")),...Array.isArray(e)?[e]:[t,e])}};et.default=Oi;Object.defineProperty(Et,"__esModule",{value:!0});Et.default=void 0;var Mi=Ii(et);function Ii(e){return e&&e.__esModule?e:{default:e}}function qe({version:e,from:t,to:r}){Mi.default.warn(`${t}-color-renamed`,[`As of Tailwind CSS ${e}, \`${t}\` has been renamed to \`${r}\`.`,"Update your configuration file to silence this warning."])}var Li={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",80
|
||
|
|
/queue/join`);A&&Q.searchParams.set("__sign",A),W=new WebSocket(Q),W.onclose=ne=>{ne.wasClean||G({type:"status",stage:"error",broken:!0,message:it,queue:!0,endpoint:L,fn_index:P,time:new Date})},W.onmessage=function(ne){const ie=JSON.parse(ne.data),{type:m,status:Z,data:V}=Qi(ie,E[P]);if(m==="update"&&Z&&!le)G({type:"status",endpoint:L,fn_index:P,time:new Date,...Z}),Z.stage==="error"&&W.close();else if(m==="hash"){W.send(JSON.stringify({fn_index:P,session_hash:w}));return}else m==="data"?W.send(JSON.stringify({...ee,session_hash:w})):m==="complete"?le=Z:m==="log"?G({type:"log",log:V.log,level:V.level,endpoint:L,fn_index:P}):m==="generating"&&G({type:"status",time:new Date,...Z,stage:Z?.stage,queue:!0,endpoint:L,fn_index:P});V&&(G({type:"data",time:new Date,data:d?Er(V.data,ue,h.root,h.root_url):V.data,endpoint:L,fn_index:P}),le&&(G({type:"status",time:new Date,...le,stage:Z?.stage,queue:!0,endpoint:L,fn_index:P}),W.close()))},yr(h.version||"2.0.0","3.6")<0&&addEventListener("open",()=>W.send(JSON.stringify({hash:w})))}});function G(J){const ne=fe[J.type]||[];ne?.forEach(ie=>ie(J))}function x(J,Q){const ne=fe,ie=ne[J]||[];return ne[J]=ie,ie?.push(Q),{on:x,off:Ae,cancel:Ge,destroy:Fe}}function Ae(J,Q){const ne=fe;let ie=ne[J]||[];return ie=ie?.filter(m=>m!==Q),ne[J]=ie,{on:x,off:Ae,cancel:Ge,destroy:Fe}}async function Ge(){const J={stage:"complete",queue:!1,time:new Date};le=J,G({...J,type:"status",endpoint:L,fn_index:P}),W&&W.readyState===0?W.addEventListener("open",()=>{W.close()}):W.close();try{await e(`${p}//${g+h.path}/reset`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({fn_index:P,session_hash:w})})}catch{console.warn("The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.")}}function Fe(){for(const J in fe)fe[J].forEach(Q=>{Ae(J,Q)})}return{on:x,off:Ae,cancel:Ge,destroy:Fe}}async function U(C){if(S)return S;const R={"Content-Type":"application/json"};s&&(R.Authorization=`Bearer ${s}`);let oe;if(yr(C.version||"2.0.0","3.30")<0?oe=await e("https://gradio-space-api-fetcher-v2.hf.space/api",{method:"POST",body:JSON.stringify({serialize:!1,config:JSON.stringify(C)}),headers:R}):oe=await e(`${C.root}/info`,{headers:R}),!oe.ok)throw new Error(it);let P=await oe.json();return"api"in P&&(P=P.api),P.named_endpoints["/predict"]&&!P.unnamed_endpoints[0]&&(P.unnamed_endpoints[0]=P.named_endpoints["/predict"]),Wi(P,C,v)}})}async function n(i,a,l,u){const s=await Ft(a,void 0,[],!0,l);return Promise.all(s.map(async({path:c,blob:f,data:d,type:_})=>{if(f){const p=(await r(i,[f],u)).files[0];return{path:c,file_url:p,type:_}}return{path:c,base64:d,type:_}})).then(c=>(c.forEach(({path:f,file_url:d,base64:_,type:p})=>{if(_)Mt(a,_,f);else if(p==="Gallery")Mt(a,d,f);else if(d){const g={is_file:!0,name:`${d}`,data:null};Mt(a,g,f)}}),a))}}const{post_data:Pc,upload_files:wr,client:xr,handle_blob:Hc}=Xi(fetch);function Er(e,t,r,o){return e.map((n,i)=>{var a,l,u,s;return((l=(a=t?.returns)==null?void 0:a[i])==null?void 0:l.component)==="File"?We(n,r,o):((s=(u=t?.returns)==null?void 0:u[i])==null?void 0:s.component)==="Gallery"?n.map(c=>Array.isArray(c)?[We(c[0],r,o),c[1]]:[We(c,r,o),null]):typeof n=="object"&&n?.is_file?We(n,r,o):n})}function We(e,t,r){if(e==null)return null;if(typeof e=="string")return{name:"file_data",data:e};if(Array.isArray(e)){const o=[];for(const n of e)n===null?o.push(null):o.push(We(n,t,r));return o}else e.is_file&&(r?e.data="/proxy="+r+"file="+e.name:e.data=t+"/file="+e.name);return e}function Sr(e,t,r,o){switch(e.type){case"string":return"string";case"boolean":return"boolean";case"number":return"number"}if(r==="JSONSerializable"||r==="StringSerializable")return"any";if(r==="ListStringSerializable")return"string[]";if(t==="Image")return o==="parameter"?"Blob | File | Buffer":"string";if(r==="FileSerializable")return e?.type==="array"?o==="parameter"?"(Blob | File | Buffer)[]":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]":o==="parameter"?"Blob | File | Buffer":"{ name: string; data: string; size?: numbe
|
||
|
|
`;for(let y=0;y<=1;y+=u){const w=t+(r-t)*i(y);s+=y*100+`%{${a(w,1-w)}}
|
||
|
|
`}const c=s+`100% {${a(r,1-r)}}
|
||
|
|
}`,f=`__svelte_${ca(c)}_${l}`,d=xo(e),{stylesheet:_,rules:p}=_t.get(d)||ua(d,e);p[f]||(p[f]=!0,_.insertRule(`@keyframes ${f} ${c}`,_.cssRules.length));const g=e.style.animation||"";return e.style.animation=`${g?`${g}, `:""}${f} ${o}ms linear ${n}ms 1 both`,gt+=1,f}function bt(e,t){const r=(e.style.animation||"").split(", "),o=r.filter(t?i=>i.indexOf(t)<0:i=>i.indexOf("__svelte")===-1),n=r.length-o.length;n&&(e.style.animation=o.join(", "),gt-=n,gt||fa())}function fa(){cr(()=>{gt||(_t.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&k(t)}),_t.clear())})}let Qe;function Je(e){Qe=e}function ke(){if(!Qe)throw new Error("Function called outside component initialization");return Qe}function qc(e){ke().$$.before_update.push(e)}function Xt(e){ke().$$.on_mount.push(e)}function Vc(e){ke().$$.after_update.push(e)}function da(e){ke().$$.on_destroy.push(e)}function Xc(){const e=ke();return(t,r,{cancelable:o=!1}={})=>{const n=e.$$.callbacks[t];if(n){const i=So(t,r,{cancelable:o});return n.slice().forEach(a=>{a.call(e,i)}),!i.defaultPrevented}return!0}}function ha(e,t){return ke().$$.context.set(e,t),t}function Wc(e){return ke().$$.context.get(e)}function Zc(e,t){const r=e.$$.callbacks[t.type];r&&r.slice().forEach(o=>o.call(this,t))}const Pe=[],me=[];let Ne=[];const Wt=[],ko=Promise.resolve();let Zt=!1;function Ao(){Zt||(Zt=!0,ko.then(To))}function pa(){return Ao(),ko}function Oe(e){Ne.push(e)}function Jt(e){Wt.push(e)}const It=new Set;let Te=0;function To(){if(Te!==0)return;const e=Qe;do{try{for(;Te<Pe.length;){const t=Pe[Te];Te++,Je(t),_a(t.$$)}}catch(t){throw Pe.length=0,Te=0,t}for(Je(null),Pe.length=0,Te=0;me.length;)me.pop()();for(let t=0;t<Ne.length;t+=1){const r=Ne[t];It.has(r)||(It.add(r),r())}Ne.length=0}while(Pe.length);for(;Wt.length;)Wt.pop()();Zt=!1,It.clear(),Je(e)}function _a(e){if(e.fragment!==null){e.update(),pe(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Oe)}}function ga(e){const t=[],r=[];Ne.forEach(o=>e.indexOf(o)===-1?t.push(o):r.push(o)),r.forEach(o=>o()),Ne=t}let Ve;function ur(){return Ve||(Ve=Promise.resolve(),Ve.then(()=>{Ve=null})),Ve}function we(e,t,r){e.dispatchEvent(So(`${t?"intro":"outro"}${r}`))}const ut=new Set;let he;function yt(){he={r:0,c:[],p:he}}function vt(){he.r||pe(he.c),he=he.p}function $(e,t){e&&e.i&&(ut.delete(e),e.i(t))}function se(e,t,r,o){if(e&&e.o){if(ut.has(e))return;ut.add(e),he.c.push(()=>{ut.delete(e),o&&(r&&e.d(1),o())}),e.o(t)}else o&&o()}const fr={duration:0};function Jc(e,t,r){const o={direction:"in"};let n=t(e,r,o),i=!1,a,l,u=0;function s(){a&&bt(e,a)}function c(){const{delay:d=0,duration:_=300,easing:p=lr,tick:g=K,css:y}=n||fr;y&&(a=mt(e,0,1,_,d,p,y,u++)),g(0,1);const w=Ye()+d,E=w+_;l&&l.abort(),i=!0,Oe(()=>we(e,!0,"start")),l=St(h=>{if(i){if(h>=E)return g(1,0),we(e,!0,"end"),s(),i=!1;if(h>=w){const v=p((h-w)/_);g(v,1-v)}}return i})}let f=!1;return{start(){f||(f=!0,bt(e),Ee(n)?(n=n(o),ur().then(c)):c())},invalidate(){f=!1},end(){i&&(s(),i=!1)}}}function Yc(e,t,r){const o={direction:"out"};let n=t(e,r,o),i=!0,a;const l=he;l.r+=1;let u;function s(){const{delay:c=0,duration:f=300,easing:d=lr,tick:_=K,css:p}=n||fr;p&&(a=mt(e,1,0,f,c,d,p));const g=Ye()+c,y=g+f;Oe(()=>we(e,!1,"start")),"inert"in e&&(u=e.inert,e.inert=!0),St(w=>{if(i){if(w>=y)return _(0,1),we(e,!1,"end"),--l.r||pe(l.c),!1;if(w>=g){const E=d((w-g)/f);_(1-E,E)}}return i})}return Ee(n)?ur().then(()=>{n=n(o),s()}):s(),{end(c){c&&"inert"in e&&(e.inert=u),c&&n.tick&&n.tick(1,0),i&&(a&&bt(e,a),i=!1)}}}function Qc(e,t,r,o){let i=t(e,r,{direction:"both"}),a=o?0:1,l=null,u=null,s=null,c;function f(){s&&bt(e,s)}function d(p,g){const y=p.b-a;return g*=Math.abs(y),{a,b:p.b,d:y,duration:g,start:p.start,end:p.start+g,group:p.group}}function _(p){const{delay:g=0,duration:y=300,easing:w=lr,tick:E=K,css:h}=i||fr,v={start:Ye()+g,b:p};p||(v.group=he,he.r+=1),"inert"in e&&(p?c!==void 0&&(e.inert=c):(c=e.inert,e.inert=!0)),l||u?u=v:(h&&(f(),s=mt(e,a,p,y,g,w,h)),p&&E(0,1),l=d(v,y),Oe(()=>we(e,p,"start")),St(A=>{if(u&&A>u.start&&(l=d(u,y),u=null,we(e,l.b,"start"),h&&(f(),s=mt(e,a,l.b,l
|
||
|
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
||
|
|
`,Le.MISSING_INTL_API,a);var v=r.getPluralRules(t,{type:c.pluralType}).select(d-(c.offset||0));h=c.options[v]||c.options.other}if(!h)throw new Rr(c.value,d,Object.keys(c.options),a);l.push.apply(l,ft(h.value,t,r,o,n,d-(c.offset||0)));continue}}return Ss(l)}function As(e,t){return t?z(z(z({},e||{}),t||{}),Object.keys(e).reduce(function(r,o){return r[o]=z(z({},e[o]),t[o]||{}),r},{})):e}function Ts(e,t){return t?Object.keys(e).reduce(function(r,o){return r[o]=As(e[o],t[o]),r},z({},e)):e}function jt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function Bs(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:zt(function(){for(var t,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return new((t=Intl.NumberFormat).bind.apply(t,Lt([void 0],r,!1)))},{cache:jt(e.number),strategy:Dt.variadic}),getDateTimeFormat:zt(function(){for(var t,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return new((t=Intl.DateTimeFormat).bind.apply(t,Lt([void 0],r,!1)))},{cache:jt(e.dateTime),strategy:Dt.variadic}),getPluralRules:zt(function(){for(var t,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return new((t=Intl.PluralRules).bind.apply(t,Lt([void 0],r,!1)))},{cache:jt(e.pluralRules),strategy:Dt.variadic})}}var Ps=function(){function e(t,r,o,n){var i=this;if(r===void 0&&(r=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(a){var l=i.formatToParts(a);if(l.length===1)return l[0].value;var u=l.reduce(function(s,c){return!s.length||c.type!==ce.literal||typeof s[s.length-1]!="string"?s.push(c.value):s[s.length-1]+=c.value,s},[]);return u.length<=1?u[0]||"":u},this.formatToParts=function(a){return ft(i.ast,i.locales,i.formatters,i.formats,a,void 0,i.message)},this.resolvedOptions=function(){return{locale:i.resolvedLocale.toString()}},this.getAst=function(){return i.ast},this.locales=r,this.resolvedLocale=e.resolveLocale(r),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:n?.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Ts(e.formats,o),this.formatters=n&&n.formatters||Bs(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=_s,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const ge={},Hs=(e,t,r)=>r&&(t in ge||(ge[t]={}),e in ge[t]||(ge[t][e]=r),r),Vo=(e,t)=>{if(t==null)return;if(t in ge&&e in ge[t])return ge[t][e];const r=nt(t);for(let o=0;o<r.length;o++){const n=Cs(r[o],e);if(n)return Hs(e,t,n)}};let pr;const ot=be({});function Xo(e){return e in pr}function Cs(e,t){if(!Xo(e))return null;const r=function(o){return pr[o]||null}(e);return function(o,n){if(n==null)return;if(n in o)return o[n];const i=n.split(".");let a=o;for(let l=0;l<i.length;l++)if(typeof a=="object"){if(l>0){const u=i.slice(l,i.length).join(".");if(u in a){a=a[u];break}}a=a[i[l]]}else a=void 0;return a}(r,t)}function Wo(e,...t){delete ge[e],ot.update(r=>(r[e]=Da.all([r[e]||{},...t]),r))}je(
|
||
|
|
|
||
|
|
Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const Ze={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Re(){return Ze}function Ms(e){const{formats:t,...r}=e,o=e.initialLocale||e.fallbackLocale;return r.warnOnMissingMessages&&(delete r.warnOnMissingMessages,r.handleMissingMessage==null?r.handleMissingMessage=Os:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(Ze,r,{initialLocale:o}),t&&("number"in t&&Object.assign(Ze.formats.number,t.number),"date"in t&&Object.assign(Ze.formats.date,t.date),"time"in t&&Object.assign(Ze.formats.time,t.time)),Ue.set(o)}const Ut=be(!1);let nr;const ht=be(null);function zr(e){return e.split("-").map((t,r,o)=>o.slice(0,r+1).join("-")).reverse()}function nt(e,t=Re().fallbackLocale){const r=zr(e);return t?[...new Set([...r,...zr(t)])]:r}function ye(){return nr??void 0}ht.subscribe(e=>{nr=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const Ue={...ht,set:e=>{if(e&&function(t){if(t==null)return;const r=nt(t);for(let o=0;o<r.length;o++){const n=r[o];if(Xo(n))return n}}(e)&&xt(e)){const{loadingDelay:t}=Re();let r;return typeof window<"u"&&ye()!=null&&t?r=window.setTimeout(()=>Ut.set(!0),t):Ut.set(!0),Jo(e).then(()=>{ht.set(e)}).finally(()=>{clearTimeout(r),Ut.set(!1)})}return ht.set(e)}},Is=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],Pt=e=>{const t=Object.create(null);return r=>{const o=JSON.stringify(r);return o in t?t[o]:t[o]=e(r)}},$e=(e,t)=>{const{formats:r}=Re();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Ls=Pt(({locale:e,format:t,...r})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(r=$e("number",t)),new Intl.NumberFormat(e,r)}),Rs=Pt(({locale:e,format:t,...r})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?r=$e("date",t):Object.keys(r).length===0&&(r=$e("date","short")),new Intl.DateTimeFormat(e,r)}),zs=Pt(({locale:e,format:t,...r})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?r=$e("time",t):Object.keys(r).length===0&&(r=$e("time","short")),new Intl.DateTimeFormat(e,r)}),Ds=({locale:e=ye(),...t}={})=>Ls({locale:e,...t}),js=({locale:e=ye(),...t}={})=>Rs({locale:e,...t}),Us=({locale:e=ye(),...t}={})=>zs({locale:e,...t}),Gs=Pt((e,t=ye())=>new Ps(e,t,Re().formats,{ignoreTag:Re().ignoreTag})),Fs=(e,t={})=>{var r,o,n,i;let a=t;typeof e=="object"&&(a=e,e=a.id);const{values:l,locale:u=ye(),default:s}=a;if(u==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let c=Vo(e,u);if(c){if(typeof c!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof c}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),c}else c=(i=(n=(o=(r=Re()).handleMissingMessage)===null||o===void 0?void 0:o.call(r,{locale:u,id:e,defaultValue:s}))!==null&&n!==void 0?n:s)!==null&&i!==void 0?i:e;if(!l)return c;let f=c;try{f=Gs(c,u).format(l)}catch(d){d instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has s
|
||
|
|
|
||
|
|
Firstly, thanks for creating this space!
|
||
|
|
|
||
|
|
I noticed that the space isn't working correctly because there is ${this.readable_error[m]||"an error"}.
|
||
|
|
|
||
|
|
It would be great if you could take a look at this because this space is being embedded on ${Z}.
|
||
|
|
|
||
|
|
Thanks!`)}};Xt(async()=>{io.register(I,H)});function Q(m){j=m,r(10,j)}function ne(m){X=m,r(11,X)}function ie(m){H=m,r(9,H)}return e.$$set=m=>{"autoscroll"in m&&r(0,i=m.autoscroll),"version"in m&&r(1,a=m.version),"initial_height"in m&&r(2,l=m.initial_height),"app_mode"in m&&r(3,u=m.app_mode),"is_embed"in m&&r(4,s=m.is_embed),"theme_mode"in m&&r(23,c=m.theme_mode),"control_page_title"in m&&r(5,f=m.control_page_title),"container"in m&&r(6,d=m.container),"info"in m&&r(7,_=m.info),"eager"in m&&r(24,p=m.eager),"mount_css"in m&&r(25,y=m.mount_css),"client"in m&&r(26,w=m.client),"upload_files"in m&&r(27,E=m.upload_files),"space"in m&&r(8,h=m.space),"host"in m&&r(28,v=m.host),"src"in m&&r(29,A=m.src)},e.$$.update=()=>{e.$$.dirty[0]&4096&&U?.app_id&&U.app_id,e.$$.dirty[0]&9216&&r(14,S=!j&&L.load_status!=="error"?"pending":!j&&L.load_status==="error"?"error":L.load_status),e.$$.dirty[0]&1090523136&&U&&(p||n[I])&&Fe(),e.$$.dirty[0]&2560&&X&&H.dispatchEvent(new CustomEvent("render",{bubbles:!0,cancelable:!1,composed:!0}))},[i,a,l,u,s,f,d,_,h,H,j,X,U,L,S,R,ee,le,G,x,o,C,J,c,p,y,w,E,v,A,n,Q,ne,ie]}class ao extends At{constructor(t){super(),kt(this,t,Ec,vc,tt,{autoscroll:0,version:1,initial_height:2,app_mode:3,is_embed:4,theme_mode:23,control_page_title:5,container:6,info:7,eager:24,mount_css:25,client:26,upload_files:27,space:8,host:28,src:29},null,[-1,-1])}}const Sc="./assets/index-0ef7ae29.css";let ar;ar=[];function kc(){class e extends HTMLElement{constructor(){super(),this.host=this.getAttribute("host"),this.space=this.getAttribute("space"),this.src=this.getAttribute("src"),this.control_page_title=this.getAttribute("control_page_title"),this.initial_height=this.getAttribute("initial_height")??"300px",this.is_embed=this.getAttribute("embed")??"true",this.container=this.getAttribute("container")??"true",this.info=this.getAttribute("info")??!0,this.autoscroll=this.getAttribute("autoscroll"),this.eager=this.getAttribute("eager"),this.theme_mode=this.getAttribute("theme_mode"),this.updating=!1,this.loading=!1}async connectedCallback(){this.loading=!0,this.app&&this.app.$destroy(),typeof ar!="string"&&ar.forEach(n=>Vt(n,document.head)),await Vt(Sc,document.head);const r=new CustomEvent("domchange",{bubbles:!0,cancelable:!1,composed:!0});new MutationObserver(n=>{this.dispatchEvent(r)}).observe(this,{childList:!0}),this.app=new ao({target:this,props:{space:this.space?this.space.trim():this.space,src:this.src?this.src.trim():this.src,host:this.host?this.host.trim():this.host,info:this.info!=="false",container:this.container!=="false",is_embed:this.is_embed!=="false",initial_height:this.initial_height,eager:this.eager==="true",version:"3-44-3",theme_mode:this.theme_mode,autoscroll:this.autoscroll==="true",control_page_title:this.control_page_title==="true",client:xr,upload_files:wr,app_mode:window.__gradio_mode__==="app"}}),this.updating&&this.setAttribute(this.updating.name,this.updating.value),this.loading=!1}static get observedAttributes(){return["src","space","host"]}attributeChangedCallback(r,o,n){if((r==="host"||r==="space"||r==="src")&&n!==o){if(this.updating={name:r,value:n},this.loading)return;this.app&&this.app.$destroy(),this.space=null,this.host=null,this.src=null,r==="host"?this.host=n:r==="space"?this.space=n:r==="src"&&(this.src=n),this.app=new ao({target:this,props:{space:this.space?this.space.trim():this.space,src:this.src?this.src.trim():this.src,host:this.host?this.host.trim():this.host,info:this.info!=="false",container:this.container!=="false",is_embed:this.is_embed!=="false",initial_height:this.initial_height,eager:this.eager==="true",version:"3-44-3",theme_mode:this.theme_mode,autoscroll:this.autoscroll==="true",control_page_title:this.control_page_title==="true",client:xr,upload_files:wr,app_mode:window.__gradio_mode__==="app"}}),this.updating=!1}}}customElements.get("gradio-app")||customElements.define("gradio-app",e)}kc();export{ma as $,Yc as A,pe as B,Xc as C,Xt as D,Zc as E,rt as F,ze as G,De as H,wt as I,eu as J,ae as K,$c as L,Ki as M,Y as N,Eo as O,el as P,Se as Q,me as R,At as S,Fc as T,Yt as U,ba as V,ya as
|
||
|
|
//# sourceMappingURL=index-59874607.js.map
|