const __vite__fileDeps=["./Index-Dh8nompC.js","./Block-CB3nIXHA.js","./IconButtonWrapper.svelte_svelte_type_style_lang-BiUMvbOz.js","./IconButtonWrapper-lzaRMLrS.css","./MarkdownCode.svelte_svelte_type_style_lang-zyyENBrq.js","./prism-python-D3jiSh5d.js","./MarkdownCode-BXQ11Ge3.css","./index-BhihDgyz.js","./StreamingBar.svelte_svelte_type_style_lang-CxOfZBE-.js","./StreamingBar-DPKKRe-n.css","./IconButton-B3BI2i6T.js","./Clear-By3xiIwg.js","./Index-BgdKmvOr.js","./Index-CptIZeFZ.css","./Index-C5NYahSl.css","./Index-DNqeP-tU.js","./BlockLabel-CCoHIDM7.js","./Empty-B_fwEKaS.js","./FullscreenButton-DPB3CMf4.js","./IconButtonWrapper-BMUxHqmv.js","./file-url-DgijyRSD.js","./context-TgWPFwN2.js","./Index-E3yBBMTH.css","./DownloadLink-CqD3Uu0l.css","./StaticAudio-DfVCLJJe.js","./utils-BsGrhMNe.js","./ShareButton-HkxSYutN.js","./Community-Dw1micSV.js","./Download-DVtk-Jv3.js","./Music-CDm0RGMk.js","./Trim-JQYgj7Jd.js","./Play-B0Q0U1Qz.js","./Undo-DCjBnnSO.js","./hls-CnVhpNcu.js","./DownloadLink-IzUam-rM.js","./StaticAudio-BAKhejK8.css","./Example-BQyGztrG.js","./Example-D7K5RtQ2.css","./index-Cv5sh61d.js","./Upload-1o7B_Nhh.js","./Upload-A42O3qlm.css","./ModifyUpload-CiBOvreF.js","./SelectSource-cjMqi4BC.js","./Upload-DXgDHKDd.js","./StreamingBar-CCUnT5tf.js","./UploadText-BVcQ46sk.js","./index-4lHb9Y67.css","./Index-CTsTpmPH.js","./Index-DGqJ3qrC.js","./_commonjs-dynamic-modules-TDtrdbi3.js","./___vite-browser-external_commonjs-proxy-C0_fkYBJ.js","./__vite-browser-external-D7Ct-6yo.js","./Index-BajvF4KO.js","./Button-B0q4NsZL.js","./Button-C-VfIjPJ.css","./Index-D1I_m9_S.js","./File-BQ_9P3Ye.js","./Image-BRVH1yXn.js","./Image-B8dFOee4.css","./MarkdownCode-CZg6hJC-.js","./Check-BiRlaMNo.js","./Copy-CxQ9EyK2.js","./index-CnqicUFC.js","./Trash-RbZEwH-j.js","./Index-CNX2b6F8.css","./ImagePreview-DJhr8Mfv.css","./Example-CZ-iEz1g.js","./Index-CWZc4YzD.js","./Info-GoO0i2rQ.js","./Index-WIAKB-_s.css","./Example-DccrJI--.js","./Index-BH1i39ad.js","./BlockTitle-PA5QeAZI.js","./Index-DMKGW8pW.css","./Example-Wp-_4AVX.js","./Example-oomIF0ca.css","./Index-ij5MzOs7.js","./Code-DGNrTu_I.js","./Index-DloLYeAi.css","./Example-BaLyJYAe.js","./Example-Bw8Q_3wB.css","./Index-BKBVMsVp.js","./tinycolor-DhRrpXkc.js","./Index-DwWu86Nh.css","./index-C8e5gTWT.js","./Embed-BhQI8DnN.js","./Example-BT2jlY4j.js","./Example-CX34aPix.css","./Index-BzxhIzNZ.js","./dsv-DB8NKgIY.js","./Index-B9LHDxHs.css","./Index-BbiEOwpQ.js","./Example-DN4wtGrM.js","./Example-Cj3ii62O.css","./Index-D3f6Hf9S.css","./Textbox-jWD3sCxr.css","./Index-BgeqMc1S.js","./Example-BBLMS951.js","./Index-GDHg_u1o.css","./Index-Cukq6A5E.js","./Index-tcNSQSor.css","./Example-BFOhuzTJ.js","./Index-DNFClAqG.js","./DropdownArrow-CRmyeEUc.js","./index-DY56glHo.js","./Index-CWxB-qJp.css","./Example-DrmWnoSo.js","./Example-DpWs9cEC.css","./Index-DzM9Z_i-.js","./FileUpload-tE_lj5Tq.js","./FileUpload-2TE7T7kD.css","./Example-CIFMxn5c.js","./Example-DfhEULNF.css","./Index-BJOuoLuu.js","./Index-BKaa_GXG.css","./Index-DE1Sah7F.js","./Index-12OnbRhk.css","./Gallery-DOAyoK2F.js","./Video-DiLYgEjl.js","./Video-DJw86Ppo.css","./Gallery-BqrYX9d2.css","./Index-BJhxhBcj.js","./Index-WEzAIkMk.js","./Index-Cgj6KPvj.css","./Index-dK23Qm6o.js","./color-Nc2yzdX8.js","./Index-Dwy3Ni24.css","./Index-Bu94Mi4v.js","./Index-Csm0OGa9.css","./Example-C2a4WxRl.js","./Example-CSw4pLi5.css","./ImagePreview-DAzqiY5z.js","./utils-Gtzs_Zla.js","./Example-DqJU7ngj.js","./Example-DikqVAPo.css","./Index-D1Sctail.js","./ImageUploader-BNGTtEfb.js","./Square-oAGqOwsh.js","./ImageUploader-C-a3Rtgj.css","./Example-C1-2lGgw.js","./Example-6rv12T44.css","./Index-CdyWBn1t.js","./Index-0Xr0wRLN.css","./Index-DnAqgjIh.js","./Index-DItMwpQq.css","./Index-Dlgpf-xm.js","./LineChart-CKh1Fdep.js","./Index-D3BKJl5I.css","./Example-SuYbdWRY.js","./Index-DNbVk847.js","./Index-7U9UAML0.css","./Example-uQ8MuYg6.js","./Index-CZxuaJbf.js","./Index-Be3F7oKw.css","./Example-8FJXX_hU.js","./Example-CCTTJ5R1.css","./Index-D2d0IpGF.js","./Send-DyoOovnk.js","./Video-fsmLZWjA.js","./Index-DvhQHWsm.css","./Index-A_Qk3wph.js","./Index-DvmFt2zS.css","./Example-CqL1e7EB.js","./Index-CxffjuJf.js","./Index-Dclo02rM.css","./Example-C9__vDgN.js","./Index-Dy_mqWjD.js","./Index-LsUS5Mg7.css","./Plot-CpgEHEjI.js","./Index-DGdj4WDW.js","./Example-BoMLuz1A.js","./Index-DmjmLuoa.js","./Index-Abr5JeXp.css","./Index-DTO-pu-x.js","./Index-BGB95BqN.css","./Example-BrizabXh.js","./Index-I7mocZbf.js","./Index-SemGnOnE.css","./index-DoRgJgfw.js","./Toast-DgYC2eSU.js","./Index-C-z7S1pt.js","./Tabs-Chq9GXD9.js","./Tabs-C0qLuAtA.css","./Index-BcNLXLca.css","./Index-ChXoeHiw.js","./Index-Dp0kPtDk.js","./Textbox-BToaa-mI.js","./Index-QnH13YPZ.js","./Index-DYDmCduo.css","./VideoPreview-BOFThaMb.js","./VideoPreview-wQufNXbv.css","./Example-DaR9ZNwp.js","./Example-B5CSTz0f.css","./index-CqNV607b.js","./index-CFBZQE_H.css","./Example-DxdiEFS_.js","./Index-FpNbsG0I.js","./Index-CgDrEMlk.css","./Index-DjLHM9wg.js","./Index-BJ_RfjVB.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); import*as Je from"./svelte/svelte.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function o(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 r(n){if(n.ep)return;n.ep=!0;const i=o(n);fetch(n.href,i)}})();const ki="modulepreload",Ci=function(e,t){return new URL(e,t).href},At={},_=function(t,o,r){let n=Promise.resolve();if(o&&o.length>0){const i=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=s?.nonce||s?.getAttribute("nonce");n=Promise.all(o.map(c=>{if(c=Ci(c,r),c in At)return;At[c]=!0;const l=c.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(!!r)for(let f=i.length-1;f>=0;f--){const d=i[f];if(d.href===c&&(!l||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${u}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":ki,l||(h.as="script",h.crossOrigin=""),h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),l)return new Promise((f,d)=>{h.addEventListener("load",f),h.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${c}`)))})}))}return n.then(()=>t()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};var Ze=new Intl.Collator(0,{numeric:1}).compare;function ro(e,t,o){return e=e.split("."),t=t.split("."),Ze(e[0],t[0])||Ze(e[1],t[1])||(t[2]=t.slice(2).join("."),o=/[.-]/.test(e[2]=e.slice(2).join(".")),o==/[.-]/.test(t[2])?Ze(e[2],t[2]):o?-1:1)}const Hi="host",no="queue/data",Di="queue/join",Pt="upload",Bi="login",Ni="config",$i="info",Mi="runtime",ji="sleeptime",Ui="heartbeat",Vi="component_server",Gi="reset",Fi="cancel",qi="https://gradio-space-api-fetcher-v2.hf.space/api",io="This application is currently busy. Please try again. ",ce="Connection errored out. ",de="Could not resolve app config. ",zi="Could not get space status. ",Xi="Could not get API info. ",mt="Space metadata could not be loaded. ",Wi="Invalid URL. A full URL path is required.",Ji="Not authorized to access this space. ",so="Invalid credentials. Could not login. ",Zi="Login credentials are required to access this space.",Yi="File system access is only available in Node.js environments",ao="Root URL not found in client config",Qi="Error uploading file";function lo(e,t,o){return t.startsWith("http://")||t.startsWith("https://")?o?e:t:e+t}async function Lt(e,t,o){try{return(await(await fetch(`https://huggingface.co/api/spaces/${e}/jwt`,{headers:{Authorization:`Bearer ${t}`,...o?{Cookie:o}:{}}})).json()).token||!1}catch{return!1}}function Ki(e){let t={};return e.forEach(({api_name:o,id:r})=>{o&&(t[o]=r)}),t}async function es(e){const t=this.options.hf_token?{Authorization:`Bearer ${this.options.hf_token}`}:{};if(t["Content-Type"]="application/json",typeof window<"u"&&window.gradio_config&&location.origin!=="http://localhost:9876"&&!window.gradio_config.dev_mode){const o=window.gradio_config.root,r=window.gradio_config;let n=lo(e,r.root,!1);return r.root=n,{...r,path:o}}else if(e){const o=po(e,Ni),r=await this.fetch(o,{headers:t,credentials:"include"});if(r?.status===401&&!this.options.auth)throw new Error(Zi);if(r?.status===401&&this.options.auth)throw new Error(so);if(r?.status===200){let n=await r.json();return n.path=n.path??"",n.root=e,n.dependencies?.forEach((i,s)=>{i.id===void 0&&(i.id=s)}),n}else if(r?.status===401)throw new Error(Ji);throw new Error(de)}throw new Error(de)}async function ts(){const{http_protocol:e,host:t}=await je(this.app_reference,this.options.hf_token);try{if(this.options.auth){const o=await uo(e,t,this.options.auth,this.fetch,this.options.hf_token);o&&this.set_cookies(o)}}catch(o){throw Error(o.message)}}async function uo(e,t,o,r,n){const i=new FormData;i.append("username",o?.[0]),i.append("password",o?.[1]);let s={};n&&(s.Authorization=`Bearer ${n}`);const a=await r(`${e}//${t}/${Bi}`,{headers:s,method:"POST",body:i,credentials:"include"});if(a.status===200)return a.headers.get("set-cookie");throw a.status===401?new Error(so):new Error(mt)}function Ye(e){if(e.startsWith("http")){const{protocol:t,host:o,pathname:r}=new URL(e);return{ws_protocol:t==="https:"?"wss":"ws",http_protocol:t,host:o+(r!=="/"?r:"")}}else if(e.startsWith("file:"))return{ws_protocol:"ws",http_protocol:"http:",host:"lite.local"};return{ws_protocol:"wss",http_protocol:"https:",host:new URL(e).host}}const co=e=>{let t=[];return e.split(/,(?=\s*[^\s=;]+=[^\s=;]+)/).forEach(r=>{const[n,i]=r.split(";")[0].split("=");n&&i&&t.push(`${n.trim()}=${i.trim()}`)}),t},gt=/^[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+$/,os=/.*hf\.space\/{0,1}.*$/;async function je(e,t){const o={};t&&(o.Authorization=`Bearer ${t}`);const r=e.trim().replace(/\/$/,"");if(gt.test(r))try{const i=(await(await fetch(`https://huggingface.co/api/spaces/${r}/${Hi}`,{headers:o})).json()).host;return{space_id:e,...Ye(i)}}catch{throw new Error(mt)}if(os.test(r)){const{ws_protocol:n,http_protocol:i,host:s}=Ye(r);return{space_id:s.split("/")[0].replace(".hf.space",""),ws_protocol:n,http_protocol:i,host:s}}return{space_id:!1,...Ye(r)}}const po=(...e)=>{try{return e.reduce((t,o)=>(t=t.replace(/\/+$/,""),o=o.replace(/^\/+/,""),new URL(o,t+"/").toString()))}catch{throw new Error(Wi)}};function rs(e,t,o){const r={named_endpoints:{},unnamed_endpoints:{}};return Object.keys(e).forEach(n=>{(n==="named_endpoints"||n==="unnamed_endpoints")&&(r[n]={},Object.entries(e[n]).forEach(([i,{parameters:s,returns:a}])=>{const c=t.dependencies.find(p=>p.api_name===i||p.api_name===i.replace("/",""))?.id||o[i.replace("/","")]||-1,l=c!==-1?t.dependencies.find(p=>p.id==c)?.types:{generator:!1,cancel:!1};if(c!==-1&&t.dependencies.find(p=>p.id==c)?.inputs?.length!==s.length){const p=t.dependencies.find(h=>h.id==c).inputs.map(h=>t.components.find(f=>f.id===h)?.type);try{p.forEach((h,f)=>{if(h==="state"){const d={component:"state",example:null,parameter_default:null,parameter_has_default:!0,parameter_name:null,hidden:!0};s.splice(f,0,d)}})}catch(h){console.error(h)}}const u=(p,h,f,d)=>({...p,description:is(p?.type,f),type:ns(p?.type,h,f,d)||""});r[n][i]={parameters:s.map(p=>u(p,p?.component,p?.serializer,"parameter")),returns:a.map(p=>u(p,p?.component,p?.serializer,"return")),type:l}}))}),r}function ns(e,t,o,r){switch(e?.type){case"string":return"string";case"boolean":return"boolean";case"number":return"number"}if(o==="JSONSerializable"||o==="StringSerializable")return"any";if(o==="ListStringSerializable")return"string[]";if(t==="Image")return r==="parameter"?"Blob | File | Buffer":"string";if(o==="FileSerializable")return e?.type==="array"?r==="parameter"?"(Blob | File | Buffer)[]":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]":r==="parameter"?"Blob | File | Buffer":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";if(o==="GallerySerializable")return r==="parameter"?"[(Blob | File | Buffer), (string | null)][]":"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"}function is(e,t){return t==="GallerySerializable"?"array of [file, label] tuples":t==="ListStringSerializable"?"array of strings":t==="FileSerializable"?"array of files or single file":e?.description}function Qe(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:io,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,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,message:e.output.error,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},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}}}const ss=(e=[],t)=>{const o=t?t.parameters:[];if(Array.isArray(e))return e.length>o.length&&console.warn("Too many arguments provided for the endpoint."),e;const r=[],n=Object.keys(e);return o.forEach((i,s)=>{if(e.hasOwnProperty(i.parameter_name))r[s]=e[i.parameter_name];else if(i.parameter_has_default)r[s]=i.parameter_default;else throw new Error(`No value provided for required parameter: ${i.parameter_name}`)}),n.forEach(i=>{if(!o.some(s=>s.parameter_name===i))throw new Error(`Parameter \`${i}\` is not a valid keyword argument. Please refer to the API for usage.`)}),r.forEach((i,s)=>{if(i===void 0&&!o[s].parameter_has_default)throw new Error(`No value provided for required parameter: ${o[s].parameter_name}`)}),r};async function as(){if(this.api_info)return this.api_info;const{hf_token:e}=this.options,{config:t}=this,o={"Content-Type":"application/json"};if(e&&(o.Authorization=`Bearer ${e}`),!!t)try{let r,n;if(typeof window<"u"&&window.gradio_api_info)n=window.gradio_api_info;else{if(ro(t?.version||"2.0.0","3.30")<0)r=await this.fetch(qi,{method:"POST",body:JSON.stringify({serialize:!1,config:JSON.stringify(t)}),headers:o,credentials:"include"});else{const i=po(t.root,this.api_prefix,$i);r=await this.fetch(i,{headers:o,credentials:"include"})}if(!r.ok)throw new Error(ce);n=await r.json()}return"api"in n&&(n=n.api),n.named_endpoints["/predict"]&&!n.unnamed_endpoints[0]&&(n.unnamed_endpoints[0]=n.named_endpoints["/predict"]),rs(n,t,this.api_map)}catch(r){""+r.message}}async function ls(e,t,o){const r={};this?.options?.hf_token&&(r.Authorization=`Bearer ${this.options.hf_token}`);const n=1e3,i=[];let s;for(let a=0;a{l.append("files",p)});try{const p=o?`${e}${this.api_prefix}/${Pt}?upload_id=${o}`:`${e}${this.api_prefix}/${Pt}`;s=await this.fetch(p,{method:"POST",body:l,headers:r,credentials:"include"})}catch(p){throw new Error(ce+p.message)}if(!s.ok){const p=await s.text();return{error:`HTTP ${s.status}: ${p}`}}const u=await s.json();u&&i.push(...u)}return{files:i}}async function us(e,t,o,r){let n=(Array.isArray(e)?e:[e]).map(s=>s.blob);const i=n.filter(s=>s.size>(r??1/0));if(i.length)throw new Error(`File size exceeds the maximum allowed size of ${r} bytes: ${i.map(s=>s.name).join(", ")}`);return await Promise.all(await this.upload_files(t,n,o).then(async s=>{if(s.error)throw new Error(s.error);return s.files?s.files.map((a,c)=>new Ue({...e[c],path:a,url:`${t}${this.api_prefix}/file=${a}`})):[]}))}async function Gu(e,t){return e.map(o=>new Ue({path:o.name,orig_name:o.name,blob:o,size:o.size,mime_type:o.type,is_stream:t}))}class Ue{path;url;orig_name;size;blob;is_stream;mime_type;alt_text;b64;meta={_type:"gradio.FileData"};constructor({path:t,url:o,orig_name:r,size:n,blob:i,is_stream:s,mime_type:a,alt_text:c,b64:l}){this.path=t,this.url=o,this.orig_name=r,this.size=n,this.blob=o?void 0:i,this.is_stream=s,this.mime_type=a,this.alt_text=c,this.b64=l}}class cs{type;command;meta;fileData;constructor(t,o){this.type="command",this.command=t,this.meta=o}}typeof process<"u"&&process.versions&&process.versions.node;function It(e,t,o){for(;o.length>1;){const n=o.shift();if(typeof n=="string"||typeof n=="number")e=e[n];else throw new Error("Invalid key type")}const r=o.shift();if(typeof r=="string"||typeof r=="number")e[r]=t;else throw new Error("Invalid key type")}async function it(e,t=void 0,o=[],r=!1,n=void 0){if(Array.isArray(e)){let i=[];return await Promise.all(e.map(async(s,a)=>{let c=o.slice();c.push(String(a));const l=await it(e[a],r?n?.parameters[a]?.component||void 0:t,c,!1,n);i=i.concat(l)})),i}else{if(globalThis.Buffer&&e instanceof globalThis.Buffer||e instanceof Blob)return[{path:o,blob:new Blob([e]),type:t}];if(typeof e=="object"&&e!==null){let i=[];for(const s of Object.keys(e)){const a=[...o,s],c=e[s];i=i.concat(await it(c,void 0,a,!1,n))}return i}}return[]}function ps(e,t){let o=t?.dependencies?.find(r=>r.id==e)?.queue;return o!=null?!o:!t.enable_queue}function hs(e,t){return new Promise((o,r)=>{const n=new MessageChannel;n.port1.onmessage=({data:i})=>{n.port1.close(),o(i)},window.parent.postMessage(e,t,[n.port2])})}function Se(e,t,o,r,n=!1){if(r==="input"&&!n)throw new Error("Invalid code path. Cannot skip state inputs for input.");if(r==="output"&&n)return e;let i=[],s=0;const a=r==="input"?t.inputs:t.outputs;for(let c=0;cp.id===l)?.type==="state"){if(n)if(e.length===a.length){const p=e[s];i.push(p),s++}else i.push(null);else{s++;continue}continue}else{const p=e[s];i.push(p),s++}}return i}async function _s(e,t,o){const r=this;await ds(r,t);const n=await it(t,void 0,[],!0,o);return(await Promise.all(n.map(async({path:s,blob:a,type:c})=>{if(!a)return{path:s,type:c};const l=await r.upload_files(e,[a]),u=l.files&&l.files[0];return{path:s,file_url:u,type:c,name:typeof File<"u"&&a instanceof File?a?.name:void 0}}))).forEach(({path:s,file_url:a,type:c,name:l})=>{if(c==="Gallery")It(t,a,s);else if(a){const u=new Ue({path:a,orig_name:l});It(t,u,s)}}),t}async function ds(e,t){if(!(e.config?.root||e.config?.root_url))throw new Error(ao);await ho(e,t)}async function ho(e,t,o=[]){for(const r in t)t[r]instanceof cs?await fs(e,t,r):typeof t[r]=="object"&&t[r]!==null&&await ho(e,t[r],[...o,r])}async function fs(e,t,o){let r=t[o];const n=e.config?.root||e.config?.root_url;if(!n)throw new Error(ao);try{let i,s;if(typeof process<"u"&&process.versions&&process.versions.node){const u=await _(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(h=>h._),[],import.meta.url);s=(await _(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(h=>h._),[],import.meta.url)).resolve(process.cwd(),r.meta.path),i=await u.readFile(s)}else throw new Error(Yi);const a=new Blob([i],{type:"application/octet-stream"}),c=await e.upload_files(n,[a]),l=c.files&&c.files[0];if(l){const u=new Ue({path:l,orig_name:r.meta.name||""});t[o]=u}}catch(i){console.error(Qi,i)}}async function ms(e,t,o){const r={"Content-Type":"application/json"};this.options.hf_token&&(r.Authorization=`Bearer ${this.options.hf_token}`);try{var n=await this.fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,...o},credentials:"include"})}catch{return[{error:ce},500]}let i,s;try{i=await n.json(),s=n.status}catch(a){i={error:`Could not parse server response: ${a}`},s=500}return[i,s]}async function gs(e,t={}){let o=!1,r=!1;if(!this.config)throw new Error("Could not resolve app config");if(typeof e=="number")this.config.dependencies.find(n=>n.id==e);else{const n=e.replace(/^\//,"");this.config.dependencies.find(i=>i.id==this.api_map[n])}return new Promise(async(n,i)=>{const s=this.submit(e,t,null,null,!0);let a;for await(const c of s)c.type==="data"&&(r&&n(a),o=!0,a=c),c.type==="status"&&(c.stage==="error"&&i(c),c.stage==="complete"&&(r=!0,o&&n(a)))})}async function Ae(e,t,o){let r=t==="subdomain"?`https://huggingface.co/api/spaces/by-subdomain/${e}`:`https://huggingface.co/api/spaces/${e}`,n,i;try{if(n=await fetch(r),i=n.status,i!==200)throw new Error;n=await n.json()}catch{o({status:"error",load_status:"error",message:zi,detail:"NOT_FOUND"});return}if(!n||i!==200)return;const{runtime:{stage:s},id:a}=n;switch(s){case"STOPPED":case"SLEEPING":o({status:"sleeping",load_status:"pending",message:"Space is asleep. Waking it up...",detail:s}),setTimeout(()=>{Ae(e,t,o)},1e3);break;case"PAUSED":o({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 Rt(a)});break;case"RUNNING":case"RUNNING_BUILDING":o({status:"running",load_status:"complete",message:"Space is running.",detail:s});break;case"BUILDING":o({status:"building",load_status:"pending",message:"Space is building...",detail:s}),setTimeout(()=>{Ae(e,t,o)},1e3);break;case"APP_STARTING":o({status:"starting",load_status:"pending",message:"Space is starting...",detail:s}),setTimeout(()=>{Ae(e,t,o)},1e3);break;default:o({status:"space_error",load_status:"error",message:"This space is experiencing an issue.",detail:s,discussions_enabled:await Rt(a)});break}}const _o=async(e,t)=>{let o=0;const r=12,n=5e3;return new Promise(i=>{Ae(e,gt.test(e)?"space_name":"subdomain",s=>{t(s),s.status==="running"||s.status==="error"||s.status==="paused"||s.status==="space_error"?i():(s.status==="sleeping"||s.status==="building")&&(o{_o(e,t).then(i)},n)):i())})})},bs=/^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;async function Rt(e){try{const t=await fetch(`https://huggingface.co/api/spaces/${e}/discussions`,{method:"HEAD"}),o=t.headers.get("x-error-message");return!(!t.ok||o&&bs.test(o))}catch{return!1}}async function vs(e,t){const o={};t&&(o.Authorization=`Bearer ${t}`);try{const r=await fetch(`https://huggingface.co/api/spaces/${e}/${Mi}`,{headers:o});if(r.status!==200)throw new Error("Space hardware could not be obtained.");const{hardware:n}=await r.json();return n.current}catch(r){throw new Error(r.message)}}async function ys(e,t,o){const r={};o&&(r.Authorization=`Bearer ${o}`);const n={seconds:t};try{const i=await fetch(`https://huggingface.co/api/spaces/${e}/${ji}`,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(n)});if(i.status!==200)throw new 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 i.json()}catch(i){throw new Error(i.message)}}const kt=["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 ws(e,t){const{hf_token:o,private:r,hardware:n,timeout:i,auth:s}=t;if(n&&!kt.includes(n))throw new Error(`Invalid hardware type provided. Valid types are: ${kt.map(T=>`"${T}"`).join(",")}.`);const{http_protocol:a,host:c}=await je(e,o);let l=null;if(s){const T=await uo(a,c,s,fetch);T&&(l=co(T))}const u={Authorization:`Bearer ${o}`,"Content-Type":"application/json",...l?{Cookie:l.join("; ")}:{}},p=(await(await fetch("https://huggingface.co/api/whoami-v2",{headers:u})).json()).name,h=e.split("/")[1],f={repository:`${p}/${h}`};r&&(f.private=!0);let d;try{n||(d=await vs(e,o))}catch(T){throw Error(mt+T.message)}const S=n||d||"cpu-basic";f.hardware=S;try{const T=await fetch(`https://huggingface.co/api/spaces/${e}/duplicate`,{method:"POST",headers:u,body:JSON.stringify(f)});if(T.status===409)try{return await Be.connect(`${p}/${h}`,t)}catch(H){throw console.error("Failed to connect Client instance:",H),H}else if(T.status!==200)throw new Error(T.statusText);const V=await T.json();return await ys(`${p}/${h}`,i||300,o),await Be.connect(Es(V.url),t)}catch(T){throw new Error(T)}}function Es(e){const t=/https:\/\/huggingface.co\/spaces\/([^/]+\/[^/]+)/,o=e.match(t);if(o)return o[1]}class xs extends TransformStream{#e="";constructor(t={allowCR:!1}){super({transform:(o,r)=>{for(o=this.#e+o;;){const n=o.indexOf(` `),i=t.allowCR?o.indexOf("\r"):-1;if(i!==-1&&i!==o.length-1&&(n===-1||n-1>i)){r.enqueue(o.slice(0,i)),o=o.slice(i+1);continue}if(n===-1)break;const s=o[n-1]==="\r"?n-1:n;r.enqueue(o.slice(0,s)),o=o.slice(n+1)}this.#e=o},flush:o=>{if(this.#e==="")return;const r=t.allowCR&&this.#e.endsWith("\r")?this.#e.slice(0,-1):this.#e;o.enqueue(r)}})}}function Ss(e){let t=new TextDecoderStream,o=new xs({allowCR:!0});return e.pipeThrough(t).pipeThrough(o)}function Ts(e){let o=/[:]\s*/.exec(e),r=o&&o.index;if(r)return[e.substring(0,r),e.substring(r+o[0].length)]}function Ct(e,t,o){e.get(t)||e.set(t,o)}async function*Os(e,t){if(!e.body)return;let o=Ss(e.body),r,n=o.getReader(),i;for(;;){if(t&&t.aborted)return n.cancel();if(r=await n.read(),r.done)return;if(!r.value){i&&(yield i),i=void 0;continue}let[s,a]=Ts(r.value)||[];s&&(s==="data"?(i||={},i[s]=i[s]?i[s]+` `+a:a):s==="event"?(i||={},i[s]=a):s==="id"?(i||={},i[s]=+a||a):s==="retry"&&(i||={},i[s]=+a||void 0))}}async function As(e,t){let o=new Request(e,t);Ct(o.headers,"Accept","text/event-stream"),Ct(o.headers,"Content-Type","application/json");let r=await fetch(o);if(!r.ok)throw r;return Os(r,o.signal)}async function Ps(){let{event_callbacks:e,unclosed_events:t,pending_stream_messages:o,stream_status:r,config:n,jwt:i}=this;const s=this;if(!n)throw new Error("Could not resolve app config");r.open=!0;let a=null,c=new URLSearchParams({session_hash:this.session_hash}).toString(),l=new URL(`${n.root}${this.api_prefix}/${no}?${c}`);if(i&&l.searchParams.set("__sign",i),a=this.stream(l),!a){console.warn("Cannot connect to SSE endpoint: "+l.toString());return}a.onmessage=async function(u){let p=JSON.parse(u.data);if(p.msg==="close_stream"){De(r,s.abort_controller);return}const h=p.event_id;if(!h)await Promise.all(Object.keys(e).map(f=>e[f](p)));else if(e[h]&&n){p.msg==="process_completed"&&["sse","sse_v1","sse_v2","sse_v2.1","sse_v3"].includes(n.protocol)&&t.delete(h);let f=e[h];typeof window<"u"&&typeof document<"u"?setTimeout(f,0,p):f(p)}else o[h]||(o[h]=[]),o[h].push(p)},a.onerror=async function(){await Promise.all(Object.keys(e).map(u=>e[u]({msg:"unexpected_error",message:ce})))}}function De(e,t){e&&(e.open=!1,t?.abort())}function Ls(e,t,o){!e[t]?(e[t]=[],o.data.forEach((n,i)=>{e[t][i]=n})):o.data.forEach((n,i)=>{let s=Is(e[t][i],n);e[t][i]=s,o.data[i]=s})}function Is(e,t){return t.forEach(([o,r,n])=>{e=Rs(e,r,o,n)}),e}function Rs(e,t,o,r){if(t.length===0){if(o==="replace")return r;if(o==="append")return e+r;throw new Error(`Unsupported action: ${o}`)}let n=e;for(let s=0;s{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 new Error("Method not implemented.")},dispatchEvent:()=>{throw new Error("Method not implemented.")},removeEventListener:()=>{throw new Error("Method not implemented.")}};return As(e,t).then(async r=>{o.readyState=o.OPEN;try{for await(const n of r)o.onmessage&&o.onmessage(n);o.readyState=o.CLOSED}catch(n){o.onerror&&o.onerror(n),o.readyState=o.CLOSED}}).catch(r=>{console.error(r),o.onerror&&o.onerror(r),o.readyState=o.CLOSED}),o}function Cs(e,t={},o,r,n){try{let i=function(L){(n||Pi[L.type])&&l(L)},s=function(){for(ze=!0;xe.length>0;)xe.shift()({value:void 0,done:!0})},a=function(L){ze||(xe.length>0?xe.shift()(L):Xe.push(L))},c=function(L){a(Hs(L)),s()},l=function(L){a({value:L,done:!1})},u=function(){return Xe.length>0?Promise.resolve(Xe.shift()):ze?Promise.resolve({value:void 0,done:!0}):new Promise(L=>xe.push(L))};const{hf_token:p}=this.options,{fetch:h,app_reference:f,config:d,session_hash:S,api_info:T,api_map:V,stream_status:H,pending_stream_messages:B,pending_diff_streams:M,event_callbacks:G,unclosed_events:k,post_data:$,options:F,api_prefix:X}=this,pe=this;if(!T)throw new Error("No API found");if(!d)throw new Error("Could not resolve app config");let{fn_index:b,endpoint_info:w,dependency:m}=Ds(T,e,V,d),P=ss(t,w),y,g,C=d.protocol??"ws",I="",j=()=>I;const v=typeof e=="number"?"/predict":e;let A,D=null,U=!1,qe={},le=typeof window<"u"&&typeof document<"u"?new URLSearchParams(window.location.search).toString():"";const Pi=F?.events?.reduce((L,te)=>(L[te]=!0,L),{})||{};async function Li(){const L={stage:"complete",queue:!1,time:new Date};U=L,i({...L,type:"status",endpoint:v,fn_index:b});let te={},ue={};C==="ws"?(y&&y.readyState===0?y.addEventListener("open",()=>{y.close()}):y.close(),te={fn_index:b,session_hash:S}):(De(H,pe.abort_controller),s(),te={event_id:D},ue={event_id:D,session_hash:S,fn_index:b});try{if(!d)throw new Error("Could not resolve app config");"event_id"in ue&&await h(`${d.root}${X}/${Fi}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(ue)}),await h(`${d.root}${X}/${Gi}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(te)})}catch{console.warn("The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.")}}const Ii=async L=>{await this._resolve_hearbeat(L)};async function xt(L){if(!d)return;let te=L.render_id;d.components=[...d.components.filter(W=>W.props.rendered_in!==te),...L.components],d.dependencies=[...d.dependencies.filter(W=>W.rendered_in!==te),...L.dependencies];const ue=d.components.some(W=>W.type==="state"),N=d.dependencies.some(W=>W.targets.some(K=>K[1]==="unload"));d.connect_heartbeat=ue||N,await Ii(d),i({type:"render",data:L,endpoint:v,fn_index:b})}this.handle_blob(d.root,P,w).then(async L=>{if(A={data:Se(L,m,d.components,"input",!0)||[],event_data:o,fn_index:b,trigger_id:r},ps(b,d))i({type:"status",endpoint:v,stage:"pending",queue:!1,fn_index:b,time:new Date}),$(`${d.root}${X}/run${v.startsWith("/")?v:`/${v}`}${le?"?"+le:""}`,{...A,session_hash:S}).then(([N,W])=>{const K=N.data;W==200?(i({type:"data",endpoint:v,fn_index:b,data:Se(K,m,d.components,"output",F.with_null_state),time:new Date,event_data:o,trigger_id:r}),N.render_config&&xt(N.render_config),i({type:"status",endpoint:v,fn_index:b,stage:"complete",eta:N.average_duration,queue:!1,time:new Date})):i({type:"status",stage:"error",endpoint:v,fn_index:b,message:N.error,queue:!1,time:new Date})}).catch(N=>{i({type:"status",stage:"error",message:N.message,endpoint:v,fn_index:b,queue:!1,time:new Date})});else if(C=="ws"){const{ws_protocol:N,host:W}=await je(f,p);i({type:"status",stage:"pending",queue:!0,endpoint:v,fn_index:b,time:new Date});let K=new URL(`${N}://${lo(W,d.path,!0)}/queue/join${le?"?"+le:""}`);this.jwt&&K.searchParams.set("__sign",this.jwt),y=new WebSocket(K),y.onclose=Z=>{Z.wasClean||i({type:"status",stage:"error",broken:!0,message:ce,queue:!0,endpoint:v,fn_index:b,time:new Date})},y.onmessage=function(Z){const Y=JSON.parse(Z.data),{type:q,status:oe,data:J}=Qe(Y,qe[b]);if(q==="update"&&oe&&!U)i({type:"status",endpoint:v,fn_index:b,time:new Date,...oe}),oe.stage==="error"&&y.close();else if(q==="hash"){y.send(JSON.stringify({fn_index:b,session_hash:S}));return}else q==="data"?y.send(JSON.stringify({...A,session_hash:S})):q==="complete"?U=oe:q==="log"?i({type:"log",title:J.title,log:J.log,level:J.level,endpoint:v,duration:J.duration,visible:J.visible,fn_index:b}):q==="generating"&&i({type:"status",time:new Date,...oe,stage:oe?.stage,queue:!0,endpoint:v,fn_index:b});J&&(i({type:"data",time:new Date,data:Se(J.data,m,d.components,"output",F.with_null_state),endpoint:v,fn_index:b,event_data:o,trigger_id:r}),U&&(i({type:"status",time:new Date,...U,stage:oe?.stage,queue:!0,endpoint:v,fn_index:b}),y.close()))},ro(d.version||"2.0.0","3.6")<0&&addEventListener("open",()=>y.send(JSON.stringify({hash:S})))}else if(C=="sse"){i({type:"status",stage:"pending",queue:!0,endpoint:v,fn_index:b,time:new Date});var ue=new URLSearchParams({fn_index:b.toString(),session_hash:S}).toString();let N=new URL(`${d.root}${X}/${no}?${le?le+"&":""}${ue}`);if(this.jwt&&N.searchParams.set("__sign",this.jwt),g=this.stream(N),!g)return Promise.reject(new Error("Cannot connect to SSE endpoint: "+N.toString()));g.onmessage=async function(W){const K=JSON.parse(W.data),{type:Z,status:Y,data:q}=Qe(K,qe[b]);if(Z==="update"&&Y&&!U)i({type:"status",endpoint:v,fn_index:b,time:new Date,...Y}),Y.stage==="error"&&(g?.close(),s());else if(Z==="data"){let[oe,J]=await $(`${d.root}${X}/queue/data`,{...A,session_hash:S,event_id:D});J!==200&&(i({type:"status",stage:"error",message:ce,queue:!0,endpoint:v,fn_index:b,time:new Date}),g?.close(),s())}else Z==="complete"?U=Y:Z==="log"?i({type:"log",title:q.title,log:q.log,level:q.level,endpoint:v,duration:q.duration,visible:q.visible,fn_index:b}):(Z==="generating"||Z==="streaming")&&i({type:"status",time:new Date,...Y,stage:Y?.stage,queue:!0,endpoint:v,fn_index:b});q&&(i({type:"data",time:new Date,data:Se(q.data,m,d.components,"output",F.with_null_state),endpoint:v,fn_index:b,event_data:o,trigger_id:r}),U&&(i({type:"status",time:new Date,...U,stage:Y?.stage,queue:!0,endpoint:v,fn_index:b}),g?.close(),s()))}}else if(C=="sse_v1"||C=="sse_v2"||C=="sse_v2.1"||C=="sse_v3"){i({type:"status",stage:"pending",queue:!0,endpoint:v,fn_index:b,time:new Date});let N="";typeof window<"u"&&typeof document<"u"&&(N=window?.location?.hostname);const K=N.includes(".dev.")?`https://moon-${N.split(".")[1]}.dev.spaces.huggingface.tech`:"https://huggingface.co",Z=typeof window<"u"&&typeof document<"u"&&window.parent!=window,Y=m.zerogpu&&d.space_id;(Z&&Y?hs("zerogpu-headers",K):Promise.resolve(null)).then(J=>$(`${d.root}${X}/${Di}?${le}`,{...A,session_hash:S},J)).then(async([J,Tt])=>{if(Tt===503)i({type:"status",stage:"error",message:io,queue:!0,endpoint:v,fn_index:b,time:new Date});else if(Tt!==200)i({type:"status",stage:"error",message:ce,queue:!0,endpoint:v,fn_index:b,time:new Date});else{D=J.event_id,I=D;let Ot=async function(We){try{const{type:re,status:ee,data:Q,original_msg:Ri}=Qe(We,qe[b]);if(re=="heartbeat")return;if(re==="update"&&ee&&!U)i({type:"status",endpoint:v,fn_index:b,time:new Date,original_msg:Ri,...ee});else if(re==="complete")U=ee;else if(re=="unexpected_error")console.error("Unexpected error",ee?.message),i({type:"status",stage:"error",message:ee?.message||"An Unexpected Error Occurred!",queue:!0,endpoint:v,fn_index:b,time:new Date});else if(re==="log"){i({type:"log",title:Q.title,log:Q.log,level:Q.level,endpoint:v,duration:Q.duration,visible:Q.visible,fn_index:b});return}else(re==="generating"||re==="streaming")&&(i({type:"status",time:new Date,...ee,stage:ee?.stage,queue:!0,endpoint:v,fn_index:b}),Q&&m.connection!=="stream"&&["sse_v2","sse_v2.1","sse_v3"].includes(C)&&Ls(M,D,Q));Q&&(i({type:"data",time:new Date,data:Se(Q.data,m,d.components,"output",F.with_null_state),endpoint:v,fn_index:b}),Q.render_config&&await xt(Q.render_config),U&&(i({type:"status",time:new Date,...U,stage:ee?.stage,queue:!0,endpoint:v,fn_index:b}),s())),(ee?.stage==="complete"||ee?.stage==="error")&&(G[D]&&delete G[D],D in M&&delete M[D])}catch(re){console.error("Unexpected client exception",re),i({type:"status",stage:"error",message:"An Unexpected Error Occurred!",queue:!0,endpoint:v,fn_index:b,time:new Date}),["sse_v2","sse_v2.1","sse_v3"].includes(C)&&(De(H,pe.abort_controller),H.open=!1,s())}};D in B&&(B[D].forEach(We=>Ot(We)),delete B[D]),G[D]=Ot,k.add(D),H.open||await this.open_stream()}})}});let ze=!1;const Xe=[],xe=[],St={[Symbol.asyncIterator]:()=>St,next:u,throw:async L=>(c(L),u()),return:async()=>(s(),u()),cancel:Li,event_id:j};return St}catch(i){throw console.error("Submit function encountered an error:",i),i}}function Hs(e){return{then:(t,o)=>o(e)}}function Ds(e,t,o,r){let n,i,s;if(typeof t=="number")n=t,i=e.unnamed_endpoints[n],s=r.dependencies.find(a=>a.id==t);else{const a=t.replace(/^\//,"");n=o[a],i=e.named_endpoints[t.trim()],s=r.dependencies.find(c=>c.id==o[a])}if(typeof n!="number")throw new Error("There is no endpoint matching that name of fn_index matching that number.");return{fn_index:n,endpoint_info:i,dependency:s}}class Be{app_reference;options;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};pending_stream_messages={};pending_diff_streams={};event_callbacks={};unclosed_events=new Set;heartbeat_event=null;abort_controller=null;stream_instance=null;current_payload;ws_map={};fetch(t,o){const r=new Headers(o?.headers||{});if(this&&this.cookies&&r.append("Cookie",this.cookies),this&&this.options.headers)for(const n in this.options.headers)r.append(n,this.options.headers[n]);return fetch(t,{...o,headers:r})}stream(t){const o=new Headers;if(this&&this.cookies&&o.append("Cookie",this.cookies),this&&this.options.headers)for(const r in this.options.headers)o.append(r,this.options.headers[r]);return this.abort_controller=new AbortController,this.stream_instance=ks(t.toString(),{credentials:"include",headers:o,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(t,o={events:["data"]}){this.app_reference=t,o.events||(o.events=["data"]),this.options=o,this.current_payload={},this.view_api=as.bind(this),this.upload_files=ls.bind(this),this.handle_blob=_s.bind(this),this.post_data=ms.bind(this),this.submit=Cs.bind(this),this.predict=gs.bind(this),this.open_stream=Ps.bind(this),this.resolve_config=es.bind(this),this.resolve_cookies=ts.bind(this),this.upload=us.bind(this),this.fetch=this.fetch.bind(this),this.handle_space_success=this.handle_space_success.bind(this),this.stream=this.stream.bind(this)}async init(){if((typeof window>"u"||!("WebSocket"in window))&&!global.WebSocket){const t=await _(()=>import("./browser-Rz_E7u_y.js").then(o=>o.b),[],import.meta.url);global.WebSocket=t.WebSocket}this.options.auth&&await this.resolve_cookies(),await this._resolve_config().then(({config:t})=>this._resolve_hearbeat(t)),this.api_info=await this.view_api(),this.api_map=Ki(this.config?.dependencies||[])}async _resolve_hearbeat(t){if(t&&(this.config=t,this.api_prefix=t.api_prefix||"",this.config&&this.config.connect_heartbeat&&this.config.space_id&&this.options.hf_token&&(this.jwt=await Lt(this.config.space_id,this.options.hf_token,this.cookies))),t.space_id&&this.options.hf_token&&(this.jwt=await Lt(t.space_id,this.options.hf_token)),this.config&&this.config.connect_heartbeat){const o=new URL(`${this.config.root}${this.api_prefix}/${Ui}/${this.session_hash}`);this.jwt&&o.searchParams.set("__sign",this.jwt),this.heartbeat_event||(this.heartbeat_event=this.stream(o))}}static async connect(t,o={events:["data"]}){const r=new this(t,o);return await r.init(),r}close(){De(this.stream_status,this.abort_controller)}set_current_payload(t){this.current_payload=t}static async duplicate(t,o={events:["data"]}){return ws(t,o)}async _resolve_config(){const{http_protocol:t,host:o,space_id:r}=await je(this.app_reference,this.options.hf_token),{status_callback:n}=this.options;r&&n&&await _o(r,n);let i;try{if(i=await this.resolve_config(`${t}//${o}`),!i)throw new Error(de);return this.config_success(i)}catch(s){if(r&&n)Ae(r,gt.test(r)?"space_name":"subdomain",this.handle_space_success);else throw n&&n({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),Error(s)}}async config_success(t){if(this.config=t,this.api_prefix=t.api_prefix||"",typeof window<"u"&&typeof document<"u"&&window.location.protocol==="https:"&&(this.config.root=this.config.root.replace("http://","https://")),this.config.auth_required)return this.prepare_return_obj();try{this.api_info=await this.view_api()}catch(o){console.error(Xi+o.message)}return this.prepare_return_obj()}async handle_space_success(t){if(!this)throw new Error(de);const{status_callback:o}=this.options;if(o&&o(t),t.status==="running")try{if(this.config=await this._resolve_config(),this.api_prefix=this?.config?.api_prefix||"",!this.config)throw new Error(de);return await this.config_success(this.config)}catch(r){throw o&&o({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),r}}async component_server(t,o,r){if(!this.config)throw new Error(de);const n={},{hf_token:i}=this.options,{session_hash:s}=this;i&&(n.Authorization=`Bearer ${this.options.hf_token}`);let a,c=this.config.components.find(u=>u.id===t);c?.props?.root_url?a=c.props.root_url:a=this.config.root;let l;if("binary"in r){l=new FormData;for(const u in r.data)u!=="binary"&&l.append(u,r.data[u]);l.set("component_id",t.toString()),l.set("fn_name",o),l.set("session_hash",s)}else l=JSON.stringify({data:r,component_id:t,fn_name:o,session_hash:s}),n["Content-Type"]="application/json";i&&(n.Authorization=`Bearer ${i}`);try{const u=await this.fetch(`${a}${this.api_prefix}/${Vi}/`,{method:"POST",body:l,headers:n,credentials:"include"});if(!u.ok)throw new Error("Could not connect to component server: "+u.statusText);return await u.json()}catch(u){console.warn(u)}}set_cookies(t){this.cookies=co(t).join("; ")}prepare_return_obj(){return{config:this.config,predict:this.predict,submit:this.submit,view_api:this.view_api,component_server:this.component_server}}async connect_ws(t){return new Promise((o,r)=>{let n;try{n=new WebSocket(t)}catch{this.ws_map[t]="failed";return}n.onopen=()=>{o()},n.onerror=i=>{console.error("WebSocket error:",i),this.close_ws(t),this.ws_map[t]="failed",o()},n.onclose=()=>{delete this.ws_map[t],this.ws_map[t]="failed"},n.onmessage=i=>{},this.ws_map[t]=n})}async send_ws_message(t,o){t in this.ws_map||await this.connect_ws(t);const r=this.ws_map[t];r instanceof WebSocket?r.send(JSON.stringify(o)):this.post_data(t,o)}async close_ws(t){if(t in this.ws_map){const o=this.ws_map[t];o instanceof WebSocket&&(o.close(),delete this.ws_map[t])}}}function fe(){}const Fu=e=>e;function Bs(e){return e()}function Ns(e){e.forEach(Bs)}function $s(e){return typeof e=="function"}function Ms(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function fo(e,...t){if(e==null){for(const r of t)r(void 0);return fe}const o=e.subscribe(...t);return o.unsubscribe?()=>o.unsubscribe():o}function js(e){let t;return fo(e,o=>t=o)(),t}function qu(e){const t=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}const he=[];function Us(e,t){return{subscribe:se(e,t).subscribe}}function se(e,t=fe){let o;const r=new Set;function n(a){if(Ms(e,a)&&(e=a,o)){const c=!he.length;for(const l of r)l[1](),he.push(l,e);if(c){for(let l=0;l{r.delete(l),r.size===0&&o&&(o(),o=null)}}return{set:n,update:i,subscribe:s}}function ye(e,t,o){const r=!Array.isArray(e),n=r?[e]:e;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const i=t.length<2;return Us(o,(s,a)=>{let c=!1;const l=[];let u=0,p=fe;const h=()=>{if(u)return;p();const d=t(r?l[0]:l,s,a);i?s(d):p=$s(d)?d:fe},f=n.map((d,S)=>fo(d,T=>{l[S]=T,u&=~(1<{u|=1<0}),o=[],r=0,n=t;r1)throw new RangeError("integer-width stems only accept a single optional option");n.options[0].replace(ha,function(c,l,u,p,h,f){if(l)t.minimumIntegerDigits=u.length;else{if(p&&h)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Oo.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(Bt.test(n.stem)){if(n.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(Bt,function(c,l,u,p,h,f){return u==="*"?t.minimumFractionDigits=l.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:h&&f?(t.minimumFractionDigits=h.length,t.maximumFractionDigits=h.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var i=n.options[0];i==="w"?t=O(O({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=O(O({},t),Nt(i)));continue}if(To.test(n.stem)){t=O(O({},t),Nt(n.stem));continue}var s=Ao(n.stem);s&&(t=O(O({},t),s));var a=_a(n.stem);a&&(t=O(O({},t),a))}return t}var ke={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function fa(e,t){for(var o="",r=0;r>1),c="a",l=ma(t);for((l=="H"||l=="k")&&(a=0);a-- >0;)o+=c;for(;s-- >0;)o=l+o}else n==="J"?o+="H":o+=n}return o}function ma(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var o=e.language,r;o!=="root"&&(r=e.maximize().region);var n=ke[r||""]||ke[o||""]||ke["".concat(o,"-001")]||ke["001"];return n[0]}var et,ga=new RegExp("^".concat(So.source,"*")),ba=new RegExp("".concat(So.source,"*$"));function x(e,t){return{start:e,end:t}}var va=!!String.prototype.startsWith&&"_a".startsWith("a",1),ya=!!String.fromCodePoint,wa=!!Object.fromEntries,Ea=!!String.prototype.codePointAt,xa=!!String.prototype.trimStart,Sa=!!String.prototype.trimEnd,Ta=!!Number.isSafeInteger,Oa=Ta?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},lt=!0;try{var Aa=Lo("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");lt=((et=Aa.exec("a"))===null||et===void 0?void 0:et[0])==="a"}catch{lt=!1}var Mt=va?function(t,o,r){return t.startsWith(o,r)}:function(t,o,r){return t.slice(r,r+o.length)===o},ut=ya?String.fromCodePoint:function(){for(var t=[],o=0;oi;){if(s=t[i++],s>1114111)throw RangeError(s+" is not a valid code point");r+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return r},jt=wa?Object.fromEntries:function(t){for(var o={},r=0,n=t;r=r)){var n=t.charCodeAt(o),i;return n<55296||n>56319||o+1===r||(i=t.charCodeAt(o+1))<56320||i>57343?n:(n-55296<<10)+(i-56320)+65536}},Pa=xa?function(t){return t.trimStart()}:function(t){return t.replace(ga,"")},La=Sa?function(t){return t.trimEnd()}:function(t){return t.replace(ba,"")};function Lo(e,t){return new RegExp(e,t)}var ct;if(lt){var Ut=Lo("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ct=function(t,o){var r;Ut.lastIndex=o;var n=Ut.exec(t);return(r=n[1])!==null&&r!==void 0?r:""}}else ct=function(t,o){for(var r=[];;){var n=Po(t,o);if(n===void 0||Io(n)||Ca(n))break;r.push(n),o+=n>=65536?2:1}return ut.apply(void 0,r)};var Ia=function(){function e(t,o){o===void 0&&(o={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!o.ignoreTag,this.locale=o.locale,this.requiresOtherClause=!!o.requiresOtherClause,this.shouldParseSkeletons=!!o.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,o,r){for(var n=[];!this.isEOF();){var i=this.char();if(i===123){var s=this.parseArgument(t,r);if(s.err)return s;n.push(s.val)}else{if(i===125&&t>0)break;if(i===35&&(o==="plural"||o==="selectordinal")){var a=this.clonePosition();this.bump(),n.push({type:R.pound,location:x(a,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(E.UNMATCHED_CLOSING_TAG,x(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&pt(this.peek()||0)){var s=this.parseTag(t,o);if(s.err)return s;n.push(s.val)}else{var s=this.parseLiteral(t,o);if(s.err)return s;n.push(s.val)}}}return{val:n,err:null}},e.prototype.parseTag=function(t,o){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:R.literal,value:"<".concat(n,"/>"),location:x(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,o,!0);if(i.err)return i;var s=i.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:R.tag,value:n,children:s,location:x(r,this.clonePosition())},err:null}:this.error(E.INVALID_TAG,x(a,this.clonePosition())))}else return this.error(E.UNCLOSED_TAG,x(r,this.clonePosition()))}else return this.error(E.INVALID_TAG,x(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ka(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,o){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(o);if(i){n+=i;continue}var s=this.tryParseUnquoted(t,o);if(s){n+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){n+=a;continue}break}var c=x(r,this.clonePosition());return{val:{type:R.literal,value:n,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Ra(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var o=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)o.push(39),this.bump();else{this.bump();break}else o.push(r);this.bump()}return ut.apply(void 0,o)},e.prototype.tryParseUnquoted=function(t,o){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(o==="plural"||o==="selectordinal")||r===125&&t>0?null:(this.bump(),ut(r))},e.prototype.parseArgument=function(t,o){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,x(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(E.EMPTY_ARGUMENT,x(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(E.MALFORMED_ARGUMENT,x(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,x(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:R.argument,value:n,location:x(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,x(r,this.clonePosition())):this.parseArgumentOptions(t,o,n,r);default:return this.error(E.MALFORMED_ARGUMENT,x(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),o=this.offset(),r=ct(this.message,o),n=o+r.length;this.bumpTo(n);var i=this.clonePosition(),s=x(t,i);return{value:r,location:s}},e.prototype.parseArgumentOptions=function(t,o,r,n){var i,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(E.EXPECT_ARGUMENT_TYPE,x(s,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var h=La(p.val);if(h.length===0)return this.error(E.EXPECT_ARGUMENT_STYLE,x(this.clonePosition(),this.clonePosition()));var f=x(u,this.clonePosition());l={style:h,styleLocation:f}}var d=this.tryParseArgumentClose(n);if(d.err)return d;var S=x(n,this.clonePosition());if(l&&Mt(l?.style,"::",0)){var T=Pa(l.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(T,l.styleLocation);return p.err?p:{val:{type:R.number,value:r,location:S,style:p.val},err:null}}else{if(T.length===0)return this.error(E.EXPECT_DATE_TIME_SKELETON,S);var V=T;this.locale&&(V=fa(T,this.locale));var h={type:ge.dateTime,pattern:V,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?la(V):{}},H=a==="date"?R.date:R.time;return{val:{type:H,value:r,location:S,style:h},err:null}}}return{val:{type:a==="number"?R.number:a==="date"?R.date:R.time,value:r,location:S,style:(i=l?.style)!==null&&i!==void 0?i:null},err:null}}case"plural":case"selectordinal":case"select":{var B=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(E.EXPECT_SELECT_ARGUMENT_OPTIONS,x(B,O({},B)));this.bumpSpace();var M=this.parseIdentifierIfPossible(),G=0;if(a!=="select"&&M.value==="offset"){if(!this.bumpIf(":"))return this.error(E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,E.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),M=this.parseIdentifierIfPossible(),G=p.val}var k=this.tryParsePluralOrSelectOptions(t,a,o,M);if(k.err)return k;var d=this.tryParseArgumentClose(n);if(d.err)return d;var $=x(n,this.clonePosition());return a==="select"?{val:{type:R.select,value:r,options:jt(k.val),location:$},err:null}:{val:{type:R.plural,value:r,options:jt(k.val),offset:G,pluralType:a==="plural"?"cardinal":"ordinal",location:$},err:null}}default:return this.error(E.INVALID_ARGUMENT_TYPE,x(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,x(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,o=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(E.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,x(n,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(o.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(o.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,o){var r=[];try{r=ca(t)}catch{return this.error(E.INVALID_NUMBER_SKELETON,o)}return{val:{type:ge.number,tokens:r,location:o,parsedOptions:this.shouldParseSkeletons?da(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,o,r,n){for(var i,s=!1,a=[],c=new Set,l=n.value,u=n.location;;){if(l.length===0){var p=this.clonePosition();if(o!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(E.EXPECT_PLURAL_ARGUMENT_SELECTOR,E.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;u=x(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(o==="select"?E.DUPLICATE_SELECT_ARGUMENT_SELECTOR:E.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);l==="other"&&(s=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(o==="select"?E.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:E.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,x(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,o,r);if(d.err)return d;var S=this.tryParseArgumentClose(f);if(S.err)return S;a.push([l,{value:d.val,location:x(f,this.clonePosition())}]),c.add(l),this.bumpSpace(),i=this.parseIdentifierIfPossible(),l=i.value,u=i.location}return a.length===0?this.error(o==="select"?E.EXPECT_SELECT_ARGUMENT_SELECTOR:E.EXPECT_PLURAL_ARGUMENT_SELECTOR,x(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(E.MISSING_OTHER_CLAUSE,x(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,o){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var i=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)i=!0,s=s*10+(a-48),this.bump();else break}var c=x(n,this.clonePosition());return i?(s*=r,Oa(s)?{val:s,err:null}:this.error(o,c)):this.error(t,c)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var o=Po(this.message,t);if(o===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return o},e.prototype.error=function(t,o){return{val:null,err:{kind:t,message:this.message,location:o}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Mt(this.message,t,this.offset())){for(var o=0;o=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var o=this.offset();if(o===t)break;if(o>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Io(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),o=this.offset(),r=this.message.charCodeAt(o+(t>=65536?2:1));return r??null},e}();function pt(e){return e>=97&&e<=122||e>=65&&e<=90}function Ra(e){return pt(e)||e===47}function ka(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Io(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Ca(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function ht(e){e.forEach(function(t){if(delete t.location,yo(t)||wo(t))for(var o in t.options)delete t.options[o].location,ht(t.options[o].value);else go(t)&&xo(t.style)||(bo(t)||vo(t))&&at(t.style)?delete t.style.location:Eo(t)&&ht(t.children)})}function Ha(e,t){t===void 0&&(t={}),t=O({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var o=new Ia(e,t).parse();if(o.err){var r=SyntaxError(E[o.err.kind]);throw r.location=o.err.location,r.originalMessage=o.err.message,r}return t?.captureLocation||ht(o.val),o.val}function tt(e,t){var o=t&&t.cache?t.cache:ja,r=t&&t.serializer?t.serializer:Ma,n=t&&t.strategy?t.strategy:Ba;return n(e,{cache:o,serializer:r})}function Da(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Ro(e,t,o,r){var n=Da(r)?r:o(r),i=t.get(n);return typeof i>"u"&&(i=e.call(this,r),t.set(n,i)),i}function ko(e,t,o){var r=Array.prototype.slice.call(arguments,3),n=o(r),i=t.get(n);return typeof i>"u"&&(i=e.apply(this,r),t.set(n,i)),i}function bt(e,t,o,r,n){return o.bind(t,e,r,n)}function Ba(e,t){var o=e.length===1?Ro:ko;return bt(e,this,o,t.cache.create(),t.serializer)}function Na(e,t){return bt(e,this,ko,t.cache.create(),t.serializer)}function $a(e,t){return bt(e,this,Ro,t.cache.create(),t.serializer)}var Ma=function(){return JSON.stringify(arguments)};function vt(){this.cache=Object.create(null)}vt.prototype.get=function(e){return this.cache[e]};vt.prototype.set=function(e,t){this.cache[e]=t};var ja={create:function(){return new vt}},ot={variadic:Na,monadic:$a},be;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(be||(be={}));var Ge=function(e){Ve(t,e);function t(o,r,n){var i=e.call(this,o)||this;return i.code=r,i.originalMessage=n,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Vt=function(e){Ve(t,e);function t(o,r,n,i){return e.call(this,'Invalid values for "'.concat(o,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),be.INVALID_VALUE,i)||this}return t}(Ge),Ua=function(e){Ve(t,e);function t(o,r,n){return e.call(this,'Value for "'.concat(o,'" must be of type ').concat(r),be.INVALID_VALUE,n)||this}return t}(Ge),Va=function(e){Ve(t,e);function t(o,r){return e.call(this,'The intl string context variable "'.concat(o,'" was not provided to the string "').concat(r,'"'),be.MISSING_VALUE,r)||this}return t}(Ge),z;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(z||(z={}));function Ga(e){return e.length<2?e:e.reduce(function(t,o){var r=t[t.length-1];return!r||r.type!==z.literal||o.type!==z.literal?t.push(o):r.value+=o.value,t},[])}function Fa(e){return typeof e=="function"}function Ce(e,t,o,r,n,i,s){if(e.length===1&&Dt(e[0]))return[{type:z.literal,value:e[0].value}];for(var a=[],c=0,l=e;c"u")){var o=Intl.NumberFormat.supportedLocalesOf(t);return o.length>0?new Intl.Locale(o[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Ha,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}();function Wa(e,t){if(t==null)return;if(t in e)return e[t];const o=t.split(".");let r=e;for(let n=0;n0){const i=o.slice(n,o.length).join(".");if(i in r){r=r[i];break}}r=r[o[n]]}else r=void 0;return r}const ie={},Ja=(e,t,o)=>o&&(t in ie||(ie[t]={}),e in ie[t]||(ie[t][e]=o),o),Ho=(e,t)=>{if(t==null)return;if(t in ie&&e in ie[t])return ie[t][e];const o=Re(t);for(let r=0;r(o[e]=ra.all([o[e]||{},...t]),o))}ye([Ie],([e])=>Object.keys(e));Ie.subscribe(e=>yt=e);const He={};function Ka(e,t){He[e].delete(t),He[e].size===0&&delete He[e]}function No(e){return He[e]}function el(e){return Re(e).map(t=>{const o=No(t);return[t,o?[...o]:[]]}).filter(([,t])=>t.length>0)}function Ne(e){return e==null?!1:Re(e).some(t=>{var o;return(o=No(t))==null?void 0:o.size})}function tl(e,t){return Promise.all(t.map(r=>(Ka(e,r),r().then(n=>n.default||n)))).then(r=>Bo(e,...r))}const Te={};function $o(e){if(!Ne(e))return e in Te?Te[e]:Promise.resolve();const t=el(e);return Te[e]=Promise.all(t.map(([o,r])=>tl(o,r))).then(()=>{if(Ne(e))return $o(e);delete Te[e]}),Te[e]}var Gt=Object.getOwnPropertySymbols,ol=Object.prototype.hasOwnProperty,rl=Object.prototype.propertyIsEnumerable,nl=(e,t)=>{var o={};for(var r in e)ol.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Gt)for(var r of Gt(e))t.indexOf(r)<0&&rl.call(e,r)&&(o[r]=e[r]);return o};const il={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"}}};function sl({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${Re(e).join('", "')}".${Ne(ae())?` Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const al={fallbackLocale:null,loadingDelay:200,formats:il,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},Oe=al;function ve(){return Oe}function ll(e){const t=e,{formats:o}=t,r=nl(t,["formats"]);let n=e.fallbackLocale;if(e.initialLocale)try{Co.resolveLocale(e.initialLocale)&&(n=e.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${e.initialLocale}" is not a valid locale.`)}return r.warnOnMissingMessages&&(delete r.warnOnMissingMessages,r.handleMissingMessage==null?r.handleMissingMessage=sl:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(Oe,r,{initialLocale:n}),o&&("number"in o&&Object.assign(Oe.formats.number,o.number),"date"in o&&Object.assign(Oe.formats.date,o.date),"time"in o&&Object.assign(Oe.formats.time,o.time)),we.set(n)}const nt=se(!1);var ul=Object.defineProperty,cl=Object.defineProperties,pl=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,hl=Object.prototype.hasOwnProperty,_l=Object.prototype.propertyIsEnumerable,qt=(e,t,o)=>t in e?ul(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,dl=(e,t)=>{for(var o in t||(t={}))hl.call(t,o)&&qt(e,o,t[o]);if(Ft)for(var o of Ft(t))_l.call(t,o)&&qt(e,o,t[o]);return e},fl=(e,t)=>cl(e,pl(t));let _t;const $e=se(null);function zt(e){return e.split("-").map((t,o,r)=>r.slice(0,o+1).join("-")).reverse()}function Re(e,t=ve().fallbackLocale){const o=zt(e);return t?[...new Set([...o,...zt(t)])]:o}function ae(){return _t??void 0}$e.subscribe(e=>{_t=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const ml=e=>{if(e&&Qa(e)&&Ne(e)){const{loadingDelay:t}=ve();let o;return typeof window<"u"&&ae()!=null&&t?o=window.setTimeout(()=>nt.set(!0),t):nt.set(!0),$o(e).then(()=>{$e.set(e)}).finally(()=>{clearTimeout(o),nt.set(!1)})}return $e.set(e)},we=fl(dl({},$e),{set:ml}),gl=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],Fe=e=>{const t=Object.create(null);return r=>{const n=JSON.stringify(r);return n in t?t[n]:t[n]=e(r)}};var bl=Object.defineProperty,Me=Object.getOwnPropertySymbols,Mo=Object.prototype.hasOwnProperty,jo=Object.prototype.propertyIsEnumerable,Xt=(e,t,o)=>t in e?bl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,wt=(e,t)=>{for(var o in t||(t={}))Mo.call(t,o)&&Xt(e,o,t[o]);if(Me)for(var o of Me(t))jo.call(t,o)&&Xt(e,o,t[o]);return e},Ee=(e,t)=>{var o={};for(var r in e)Mo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Me)for(var r of Me(e))t.indexOf(r)<0&&jo.call(e,r)&&(o[r]=e[r]);return o};const Le=(e,t)=>{const{formats:o}=ve();if(e in o&&t in o[e])return o[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},vl=Fe(e=>{var t=e,{locale:o,format:r}=t,n=Ee(t,["locale","format"]);if(o==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return r&&(n=Le("number",r)),new Intl.NumberFormat(o,n)}),yl=Fe(e=>{var t=e,{locale:o,format:r}=t,n=Ee(t,["locale","format"]);if(o==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return r?n=Le("date",r):Object.keys(n).length===0&&(n=Le("date","short")),new Intl.DateTimeFormat(o,n)}),wl=Fe(e=>{var t=e,{locale:o,format:r}=t,n=Ee(t,["locale","format"]);if(o==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return r?n=Le("time",r):Object.keys(n).length===0&&(n=Le("time","short")),new Intl.DateTimeFormat(o,n)}),El=(e={})=>{var t=e,{locale:o=ae()}=t,r=Ee(t,["locale"]);return vl(wt({locale:o},r))},xl=(e={})=>{var t=e,{locale:o=ae()}=t,r=Ee(t,["locale"]);return yl(wt({locale:o},r))},Sl=(e={})=>{var t=e,{locale:o=ae()}=t,r=Ee(t,["locale"]);return wl(wt({locale:o},r))},Tl=Fe((e,t=ae())=>new Co(e,t,ve().formats,{ignoreTag:ve().ignoreTag})),Ol=(e,t={})=>{var o,r,n,i;let s=t;typeof e=="object"&&(s=e,e=s.id);const{values:a,locale:c=ae(),default:l}=s;if(c==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=Ho(e,c);if(!u)u=(i=(n=(r=(o=ve()).handleMissingMessage)==null?void 0:r.call(o,{locale:c,id:e,defaultValue:l}))!=null?n:l)!=null?i:e;else if(typeof u!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u;if(!a)return u;let p=u;try{p=Tl(u,c).format(a)}catch(h){h instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,h.message)}return p},Al=(e,t)=>Sl(t).format(e),Pl=(e,t)=>xl(t).format(e),Ll=(e,t)=>El(t).format(e),Il=(e,t=ae())=>Ho(e,t),Wu=ye([we,Ie],()=>Ol);ye([we],()=>Al);ye([we],()=>Pl);ye([we],()=>Ll);ye([we,Ie],()=>Il);let Uo=!1;typeof window<"u"&&"attachShadow"in Element.prototype&&"adoptedStyleSheets"in Document.prototype&&(Uo="adoptedStyleSheets"in document.createElement("div").attachShadow({mode:"open"}));function Wt(e,t){const o=new URL(import.meta.url).origin;var r=e;if(window.location.origin!==o&&(r=new URL(e,o).href),document.querySelector(`link[href='${r}']`))return Promise.resolve();const i=document.createElement("link");return i.rel="stylesheet",i.href=r,new Promise((s,a)=>{i.addEventListener("load",()=>s()),i.addEventListener("error",()=>{console.error(`Unable to preload CSS for ${r}`),s()}),t.appendChild(i)})}function Ju(e,t,o){if(!Uo)return e;o||(o=document.createElement("style")),o.remove();const r=new CSSStyleSheet;r.replaceSync(e);let n="";e=e.replace(/@import\s+url\((.*?)\);\s*/g,(c,l)=>(n+=`@import url(${l}); `,""));const i=r.cssRules;let s="",a=`.gradio-container.gradio-container-${t} .contain `;for(let c=0;c`${u?".dark":""} ${a} ${f.trim()} `).join(",");s+=l.cssText,s+=l.cssText.replace(p,h)}}else if(l instanceof CSSMediaRule){let p=`@media ${l.media.mediaText} {`;for(let h=0;h`${d?".dark":""} ${a} ${V.trim()} `).join(",");p+=f.cssText.replace(S,T)}}p+="}",s+=p}else if(l instanceof CSSKeyframesRule){s+=`@keyframes ${l.name} {`;for(let p=0;p_(()=>import("./Index-Dh8nompC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)},annotatedimage:{component:()=>_(()=>import("./Index-DNqeP-tU.js"),__vite__mapDeps([15,1,2,3,4,5,6,16,17,18,10,19,7,8,9,11,20,21,22,23]),import.meta.url)},audio:{base:()=>_(()=>import("./StaticAudio-DfVCLJJe.js").then(e=>e.b),__vite__mapDeps([24,2,3,25,4,5,6,16,10,17,26,27,28,29,19,30,31,32,20,21,33,34,23,35]),import.meta.url),example:()=>_(()=>import("./Example-BQyGztrG.js"),__vite__mapDeps([36,37]),import.meta.url),component:()=>_(()=>import("./index-Cv5sh61d.js"),__vite__mapDeps([38,24,2,3,25,4,5,6,16,10,17,26,27,28,29,19,30,31,32,20,21,33,34,23,35,39,40,41,11,42,43,8,9,44,7,1,45,36,37,46]),import.meta.url)},box:{component:()=>_(()=>import("./Index-CTsTpmPH.js"),__vite__mapDeps([47,1,2,3,4,5,6]),import.meta.url)},browserstate:{component:()=>_(()=>import("./Index-DGqJ3qrC.js"),__vite__mapDeps([48,49,50,51]),import.meta.url)},button:{component:()=>_(()=>import("./Index-BajvF4KO.js"),__vite__mapDeps([52,53,54]),import.meta.url)},chatbot:{component:()=>_(()=>import("./Index-D1I_m9_S.js"),__vite__mapDeps([55,2,3,25,56,57,20,21,58,23,59,4,5,6,10,60,61,32,19,62,27,63,29,1,16,7,8,9,11,64,65]),import.meta.url)},checkbox:{example:()=>_(()=>import("./Example-CZ-iEz1g.js"),__vite__mapDeps([66,37]),import.meta.url),component:()=>_(()=>import("./Index-CWZc4YzD.js"),__vite__mapDeps([67,1,2,3,68,59,4,5,6,7,8,9,10,11,69]),import.meta.url)},checkboxgroup:{example:()=>_(()=>import("./Example-DccrJI--.js"),__vite__mapDeps([70,37]),import.meta.url),component:()=>_(()=>import("./Index-BH1i39ad.js"),__vite__mapDeps([71,1,2,3,72,68,59,4,5,6,7,8,9,10,11,73]),import.meta.url)},code:{example:()=>_(()=>import("./Example-Wp-_4AVX.js"),__vite__mapDeps([74,75]),import.meta.url),component:()=>_(()=>import("./Index-ij5MzOs7.js").then(e=>e.F),__vite__mapDeps([76,60,61,2,3,4,5,6,10,28,34,21,20,23,19,7,8,9,11,77,1,16,17,74,75,78]),import.meta.url)},colorpicker:{example:()=>_(()=>import("./Example-BaLyJYAe.js"),__vite__mapDeps([79,80]),import.meta.url),component:()=>_(()=>import("./Index-BKBVMsVp.js"),__vite__mapDeps([81,82,2,3,72,68,59,4,5,6,1,7,8,9,10,11,79,80,83]),import.meta.url)},column:{component:()=>_(()=>import("./Index-BgdKmvOr.js"),__vite__mapDeps([12,7,8,9,2,3,4,5,6,10,11,13]),import.meta.url)},core:{component:()=>_(()=>import("./index-C8e5gTWT.js"),__vite__mapDeps([84,85]),import.meta.url)},dataframe:{example:()=>_(()=>import("./Example-BT2jlY4j.js"),__vite__mapDeps([86,87]),import.meta.url),component:()=>_(()=>import("./Index-BzxhIzNZ.js"),__vite__mapDeps([88,1,2,3,4,5,6,62,25,39,40,59,89,7,8,9,10,11,86,87,90,23]),import.meta.url)},dataset:{component:()=>_(()=>import("./Index-BbiEOwpQ.js"),__vite__mapDeps([91,1,2,3,4,5,6,8,9,92,93,94,95]),import.meta.url)},datetime:{example:()=>_(()=>import("./Example-BBLMS951.js"),[],import.meta.url),component:()=>_(()=>import("./Index-BgeqMc1S.js"),__vite__mapDeps([96,1,2,3,72,68,59,4,5,6,97,98]),import.meta.url)},downloadbutton:{component:()=>_(()=>import("./Index-Cukq6A5E.js"),__vite__mapDeps([99,53,54,100]),import.meta.url)},dropdown:{example:()=>_(()=>import("./Example-BFOhuzTJ.js"),__vite__mapDeps([101,37]),import.meta.url),component:()=>_(()=>import("./Index-DNFClAqG.js"),__vite__mapDeps([102,2,3,72,68,59,4,5,6,103,104,1,7,8,9,10,11,101,37,105]),import.meta.url)},file:{example:()=>_(()=>import("./Example-DrmWnoSo.js"),__vite__mapDeps([106,107]),import.meta.url),component:()=>_(()=>import("./Index-DzM9Z_i-.js"),__vite__mapDeps([108,109,2,3,4,5,6,16,17,56,39,40,10,11,43,19,34,21,20,23,110,1,45,7,8,9,106,107]),import.meta.url)},fileexplorer:{example:()=>_(()=>import("./Example-CIFMxn5c.js"),__vite__mapDeps([111,112]),import.meta.url),component:()=>_(()=>import("./Index-BJOuoLuu.js"),__vite__mapDeps([113,2,3,56,1,4,5,6,16,7,8,9,10,11,114]),import.meta.url)},form:{component:()=>_(()=>import("./Index-DE1Sah7F.js"),__vite__mapDeps([115,116]),import.meta.url)},gallery:{base:()=>_(()=>import("./Gallery-DOAyoK2F.js"),__vite__mapDeps([117,2,3,4,5,6,16,10,17,26,27,25,11,28,18,31,19,41,32,34,21,20,23,57,58,118,33,119,120,40,65]),import.meta.url),component:()=>_(()=>import("./Index-BJhxhBcj.js"),__vite__mapDeps([121,1,2,3,4,5,6,45,43,117,16,10,17,26,27,25,11,28,18,31,19,41,32,34,21,20,23,57,58,118,33,119,120,40,65,7,8,9,109,56,39,110,107]),import.meta.url)},group:{component:()=>_(()=>import("./Index-WEzAIkMk.js"),__vite__mapDeps([122,123]),import.meta.url)},highlightedtext:{component:()=>_(()=>import("./Index-dK23Qm6o.js"),__vite__mapDeps([124,125,2,3,1,4,5,6,16,17,7,8,9,10,11,126]),import.meta.url)},html:{base:()=>_(()=>import("./Index-Bu94Mi4v.js"),__vite__mapDeps([127,7,8,9,2,3,4,5,6,10,11,77,1,16,25,128]),import.meta.url),example:()=>_(()=>import("./Example-C2a4WxRl.js"),__vite__mapDeps([129,130]),import.meta.url),component:()=>_(()=>import("./Index-Bu94Mi4v.js"),__vite__mapDeps([127,7,8,9,2,3,4,5,6,10,11,77,1,16,25,128]),import.meta.url)},image:{base:()=>_(()=>import("./ImagePreview-DAzqiY5z.js"),__vite__mapDeps([131,2,3,25,4,5,6,16,10,17,26,27,28,18,19,132,57,20,21,58,23,34,65]),import.meta.url),example:()=>_(()=>import("./Example-DqJU7ngj.js"),__vite__mapDeps([133,57,20,21,58,23,134]),import.meta.url),component:()=>_(()=>import("./Index-D1Sctail.js"),__vite__mapDeps([135,131,2,3,25,4,5,6,16,10,17,26,27,28,18,19,132,57,20,21,58,23,34,65,136,11,42,43,103,137,8,9,104,44,39,40,138,1,45,7,133,134]),import.meta.url)},imageeditor:{example:()=>_(()=>import("./Example-C1-2lGgw.js"),__vite__mapDeps([139,2,3,4,5,6,57,20,21,58,23,136,16,10,11,18,42,43,19,132,103,137,8,9,104,44,39,40,138,140,65,134]),import.meta.url),component:()=>_(()=>import("./Index-CdyWBn1t.js"),__vite__mapDeps([141,131,2,3,25,4,5,6,16,10,17,26,27,28,18,19,132,57,20,21,58,23,34,65,136,11,42,43,103,137,8,9,104,44,39,40,138,1,7,50,51,60,63,32,82,142,134]),import.meta.url)},json:{component:()=>_(()=>import("./Index-DnAqgjIh.js"),__vite__mapDeps([143,60,61,2,3,4,5,6,10,17,19,1,16,7,8,9,11,144]),import.meta.url)},label:{component:()=>_(()=>import("./Index-Dlgpf-xm.js"),__vite__mapDeps([145,2,3,146,1,4,5,6,16,17,7,8,9,10,11,147]),import.meta.url)},markdown:{example:()=>_(()=>import("./Example-SuYbdWRY.js"),__vite__mapDeps([148,59,4,5,6,37]),import.meta.url),component:()=>_(()=>import("./Index-DNbVk847.js"),__vite__mapDeps([149,2,3,25,60,61,59,4,5,6,10,19,7,8,9,11,1,148,37,150]),import.meta.url)},model3d:{example:()=>_(()=>import("./Example-uQ8MuYg6.js"),__vite__mapDeps([151,37]),import.meta.url),component:()=>_(()=>import("./Index-CZxuaJbf.js"),__vite__mapDeps([152,2,3,4,5,6,16,10,28,56,32,19,39,40,41,11,34,21,20,23,1,17,45,43,7,8,9,151,37,153]),import.meta.url)},multimodaltextbox:{example:()=>_(()=>import("./Example-8FJXX_hU.js"),__vite__mapDeps([154,57,20,21,58,23,2,3,4,5,6,118,33,119,155,65]),import.meta.url),component:()=>_(()=>import("./Index-D2d0IpGF.js"),__vite__mapDeps([156,2,3,72,68,59,4,5,6,11,56,29,157,137,158,39,40,57,20,21,58,23,1,7,8,9,10,154,118,33,119,155,65,159]),import.meta.url)},nativeplot:{example:()=>_(()=>import("./Example-Creifpe8.js"),[],import.meta.url),component:()=>_(()=>import("./Index-A_Qk3wph.js"),__vite__mapDeps([160,1,2,3,72,68,59,4,5,6,17,146,7,8,9,10,11,161]),import.meta.url)},number:{example:()=>_(()=>import("./Example-CqL1e7EB.js"),__vite__mapDeps([162,37]),import.meta.url),component:()=>_(()=>import("./Index-CxffjuJf.js"),__vite__mapDeps([163,1,2,3,72,68,59,4,5,6,7,8,9,10,11,164]),import.meta.url)},paramviewer:{example:()=>_(()=>import("./Example-C9__vDgN.js"),__vite__mapDeps([165,37]),import.meta.url),component:()=>_(()=>import("./Index-Dy_mqWjD.js"),__vite__mapDeps([166,5,167]),import.meta.url)},plot:{base:()=>_(()=>import("./Plot-CpgEHEjI.js").then(e=>e.b),__vite__mapDeps([168,2,3,4,5,6,17]),import.meta.url),component:()=>_(()=>import("./Index-DGdj4WDW.js"),__vite__mapDeps([169,168,2,3,4,5,6,17,1,16,7,8,9,10,11]),import.meta.url)},radio:{example:()=>_(()=>import("./Example-BoMLuz1A.js"),__vite__mapDeps([170,37]),import.meta.url),component:()=>_(()=>import("./Index-DmjmLuoa.js"),__vite__mapDeps([171,1,2,3,72,68,59,4,5,6,7,8,9,10,11,170,37,172]),import.meta.url)},row:{component:()=>_(()=>import("./Index-DTO-pu-x.js"),__vite__mapDeps([173,7,8,9,2,3,4,5,6,10,11,174]),import.meta.url)},slider:{example:()=>_(()=>import("./Example-BrizabXh.js"),__vite__mapDeps([175,37]),import.meta.url),component:()=>_(()=>import("./Index-I7mocZbf.js"),__vite__mapDeps([176,1,2,3,72,68,59,4,5,6,7,8,9,10,11,177]),import.meta.url)},state:{component:()=>_(()=>import("./Index-uRgjJb4U.js"),[],import.meta.url)},statustracker:{component:()=>_(()=>import("./index-DoRgJgfw.js"),__vite__mapDeps([178,7,8,9,2,3,4,5,6,10,11,179,104,44]),import.meta.url)},tabitem:{component:()=>_(()=>import("./Index-C-z7S1pt.js"),__vite__mapDeps([180,181,182,12,7,8,9,2,3,4,5,6,10,11,13,183]),import.meta.url)},tabs:{component:()=>_(()=>import("./Index-ChXoeHiw.js"),__vite__mapDeps([184,181,182]),import.meta.url)},textbox:{example:()=>_(()=>import("./Example-DN4wtGrM.js"),__vite__mapDeps([92,93]),import.meta.url),component:()=>_(()=>import("./Index-Dp0kPtDk.js"),__vite__mapDeps([185,186,2,3,72,68,59,4,5,6,60,61,157,137,104,95,1,7,8,9,10,11,92,93]),import.meta.url)},timer:{component:()=>_(()=>import("./Index-BMLc4VxK.js"),[],import.meta.url)},uploadbutton:{component:()=>_(()=>import("./Index-QnH13YPZ.js"),__vite__mapDeps([187,53,54,188]),import.meta.url)},video:{base:()=>_(()=>import("./VideoPreview-BOFThaMb.js").then(e=>e.a),__vite__mapDeps([189,2,3,4,5,6,16,10,17,26,27,25,28,158,19,34,21,20,23,30,31,32,118,33,119,41,11,190,40]),import.meta.url),example:()=>_(()=>import("./Example-DaR9ZNwp.js"),__vite__mapDeps([191,118,20,21,33,119,23,192]),import.meta.url),component:()=>_(()=>import("./index-CqNV607b.js"),__vite__mapDeps([193,39,40,2,3,4,5,6,16,158,42,43,57,20,21,58,23,136,10,11,18,19,132,103,137,8,9,104,44,138,118,33,119,189,17,26,27,25,28,34,30,31,32,41,190,191,192,1,45,7,194,65,134]),import.meta.url)}},ne={},Et=typeof window<"u";function Jt({api_url:e,name:t,id:o,variant:r}){const n=Et&&window.__GRADIO__CC__,i={...Rl,...n||{}};let s=o||t;if(ne[`${s}-${r}`])return{component:ne[`${s}-${r}`],name:t};try{if(!i?.[s]?.[r]&&!i?.[t]?.[r])throw new Error;return ne[`${s}-${r}`]=(i?.[s]?.[r]||i?.[t]?.[r])(),{name:t,component:ne[`${s}-${r}`]}}catch{if(!s)throw new Error(`Component not found: ${t}`);try{return ne[`${s}-${r}`]=kl(e,s,r),{name:t,component:ne[`${s}-${r}`]}}catch(c){if(r==="example")return ne[`${s}-${r}`]=_(()=>import("./Example-DxdiEFS_.js"),__vite__mapDeps([195,37]),import.meta.url),{name:t,component:ne[`${s}-${r}`]};throw console.error(`failed to load: ${t}`),console.error(c),c}}}function Zt(e){return Et?new Promise((t,o)=>{const r=document.createElement("link");r.rel="stylesheet",r.href=e,document.head.appendChild(r),r.onload=()=>t(),r.onerror=()=>o()}):Promise.resolve()}function kl(e,t,o){const r=Et?"client":"server";let n;return r==="server"?Promise.all([Zt(`${e}/custom_component/${t}/${o}/style.css`),_(()=>import("./Index-FpNbsG0I.js"),__vite__mapDeps([196,1,2,3,4,5,6,7,8,9,10,11,197]),import.meta.url)]).then(([i,s])=>s):(n=`${e}/custom_component/${t}/${r}/${o}/index.js`,Promise.all([Zt(`${e}/custom_component/${t}/${r}/${o}/style.css`),import(n)]).then(([i,s])=>s))}function Cl(){const e=se({}),t={},o={},r=new Map,n=new Map,i=new Map,s={};function a({fn_index:l,status:u,queue:p=!0,size:h,position:f=null,eta:d=null,message:S=null,progress:T,time_limit:V=null}){const H=o[l],B=t[l],M=s[l],G=H.map(k=>{let $;const F=r.get(k)||0;if(M==="pending"&&u!=="pending"){let X=F-1;r.set(k,X<0?0:X),$=X>0?"pending":u}else M==="pending"&&u==="pending"?$="pending":M!=="pending"&&u==="pending"?($="pending",r.set(k,F+1)):$=u;return{id:k,queue_position:f,queue_size:h,eta:d,status:$,message:S,progress:T}});B.forEach(k=>{const $=n.get(k)||0;if(M==="pending"&&u!=="pending"){let F=$-1;n.set(k,F<0?0:F),i.set(k,u)}else M!=="pending"&&u==="pending"?(n.set(k,$+1),i.set(k,u)):i.delete(k)}),e.update(k=>(G.forEach(({id:$,queue_position:F,queue_size:X,eta:pe,status:b,message:w,progress:m})=>{k[$]={queue:p,queue_size:X,queue_position:F,eta:pe,message:w,progress:m,status:b,fn_index:l}}),k)),s[l]=u}function c(l,u,p){t[l]=u,o[l]=p}return{update:a,register:c,subscribe:e.subscribe,get_status_for_fn(l){return s[l]},get_inputs_to_update(){return i}}}let _e=[];const Hl=typeof window<"u",Dl=Hl?requestAnimationFrame:async e=>await e();function Zu(e){let t,o=se({}),r={},n,i,s,a,c=Cl();const l=se(e);let u=[],p,h={},f;function d(w){w.forEach(m=>{m.targets.forEach(P=>{const y=a[P[0]];y&&m.event_specific_args?.length>0&&m.event_specific_args?.forEach(g=>{y.props[g]=m[g]})})})}async function S({app:w,components:m,layout:P,dependencies:y,root:g,options:C}){G(),p=w,M(u),u=m,n=new Set,i=new Set,_e=[],s=new Map,t=new Map,a={},f={id:P.id,type:"column",props:{interactive:!1,scale:C.fill_height?1:null},has_modes:!1,instance:null,component:null,component_class_id:"",key:null},m.push(f),y.forEach(I=>{c.register(I.id,I.inputs,I.outputs),I.frontend_fn=Yt(I.js,!!I.backend_fn,I.inputs.length,I.outputs.length),Qt(I.targets,I.id,r),Kt(I,n,i)}),o.set(r),s=eo(m,g),a=m.reduce((I,j)=>(I[j.id]=j,I),{}),await V(P,g,u),l.set(f),d(y)}function T({render_id:w,components:m,layout:P,root:y,dependencies:g}){eo(m,y).forEach((A,D)=>{s.set(D,A)}),r={},g.forEach(A=>{c.register(A.id,A.inputs,A.outputs),A.frontend_fn=Yt(A.js,!!A.backend_fn,A.inputs.length,A.outputs.length),Qt(A.targets,A.id,r),Kt(A,n,i)}),o.set(r);let I=a[P.id],j=[];const v=A=>{j.push(A),A.children&&A.children.forEach(D=>{v(D)})};v(I),M(j),Object.entries(a).forEach(([A,D])=>{let U=Number(A);D.rendered_in===w&&(delete a[U],t.has(U)&&t.delete(U))}),m.forEach(A=>{a[A.id]=A,t.set(A.id,A)}),I.parent&&(I.parent.children[I.parent.children.indexOf(I)]=a[P.id]),V(P,y,u.concat(m),I.parent).then(()=>{l.set(f)}),d(g)}async function V(w,m,P,y){const g=a[w.id];if(g.component=(await s.get(g.component_class_id||g.type))?.default,g.parent=y,g.type==="dataset"&&(g.props.component_map=Vo(g.type,g.component_class_id,m,P,g.props.components).example_components),r[g.id]&&(g.props.attached_events=Object.keys(r[g.id])),g.props.interactive=$l(g.id,g.props.interactive,g.props.value,n,i),g.props.server=Ml(g.id,g.props.server_fns,p),g.key!=null&&h[g.key]!==void 0&&(g.props.value=h[g.key]),t.set(g.id,g),w.children&&(g.children=await Promise.all(w.children.map(C=>V(C,m,P,g)))),g.type==="tabs"&&!g.props.initial_tabs){const I=(w.children?.map(j=>{const v=a[j.id];return v.props.id??=j.id,{type:v.type,props:{...v.props,id:v.props.id}}})||[]).filter(j=>j.type==="tabitem");g.props.initial_tabs=I?.map(j=>({label:j.props.label,id:j.props.id,visible:j.props.visible,interactive:j.props.interactive}))}return g}let H=!1,B=se(!1);function M(w){w.forEach(m=>{m.key!=null&&(h[m.key]=m.props.value)})}function G(){l.update(w=>{for(let m=0;m<_e.length;m++)for(let P=0;P<_e[m].length;P++){const y=_e[m][P];if(!y)continue;const g=a[y.id];if(!g)continue;let C;y.value instanceof Map?C=new Map(y.value):y.value instanceof Set?C=new Set(y.value):Array.isArray(y.value)?C=[...y.value]:y.value==null?C=null:typeof y.value=="object"?C={...y.value}:C=y.value,g.props[y.prop]=C}return w}),_e=[],H=!1,B.set(!1)}function k(w){w&&(_e.push(w),H||(H=!0,B.set(!0),Dl(G)))}function $(w){let m=t.get(w);if(!m){const P=js(l);m=F(P,w)}return m?m.instance.get_value?m.instance.get_value():m.props.value:null}function F(w,m){if(w.id===m)return w;if(w.children)for(const P of w.children){const y=F(P,m);if(y)return y}}function X(w,m){const P=t.get(w);P&&P.instance.modify_stream_state&&P.instance.modify_stream_state(m)}function pe(w){const m=t.get(w);return m&&m.instance.get_stream_state?m.instance.get_stream_state():"not_set"}function b(w,m){const P=t.get(w);P&&P.instance.set_time_limit&&P.instance.set_time_limit(m)}return{layout:l,targets:o,update_value:k,get_data:$,modify_stream:X,get_stream_state:pe,set_time_limit:b,loading_status:c,scheduled_updates:B,create_layout:S,rerender_layout:T}}const Bl=Object.getPrototypeOf(async function(){}).constructor;function Yt(e,t,o,r){if(!e)return null;const n=t?o===1:r===1;try{return new Bl("__fn_args",` let result = await (${e})(...__fn_args); if (typeof result === "undefined") return []; return (${n} && !Array.isArray(result)) ? [result] : result;`)}catch(i){return console.error("Could not parse custom js method."),console.error(i),null}}function Qt(e,t,o){return e.forEach(([r,n])=>{o[r]||(o[r]={}),o[r]?.[n]&&!o[r]?.[n].includes(t)?o[r][n].push(t):o[r][n]=[t]}),o}function Kt(e,t,o){return e.inputs.forEach(r=>t.add(r)),e.outputs.forEach(r=>o.add(r)),[t,o]}function Nl(e){return Array.isArray(e)&&e.length===0||e===""||e===0||!e}function $l(e,t,o,r,n){return t===!1?!1:t===!0?!0:!!(r.has(e)||!n.has(e)&&Nl(o))}function Ml(e,t,o){return t?t.reduce((r,n)=>(r[n]=async(...i)=>(i.length===1&&(i=i[0]),await o.component_server(e,n,i)),r),{}):{}}function Vo(e,t,o,r,n){let i=new Map;e==="dataset"&&n&&n.forEach(a=>{if(i.has(a))return;let c;const l=r.find(u=>u.type===a);l&&(c=Jt({api_url:o,name:a,id:l.component_class_id,variant:"example"}),i.set(a,c.component))});const s=Jt({api_url:o,name:e,id:t,variant:"component"});return{component:s.component,name:s.name,example_components:i.size>0?i:void 0}}function eo(e,t){let o=new Map;return e.forEach(r=>{const{component:n,example_components:i}=Vo(r.type,r.component_class_id,t,e);if(o.set(r.component_class_id||r.type,n),i)for(const[s,a]of i)o.set(s,a)}),o}const Go={built_with_gradio:"تم الإنشاء بإستخدام Gradio",clear:"أمسح",or:"أو",submit:"أرسل"},Fo={click_to_upload:"إضغط للتحميل",drop_audio:"أسقط الملف الصوتي هنا",drop_csv:"أسقط ملف البيانات هنا",drop_file:"أسقط الملف هنا",drop_image:"أسقط الصورة هنا",drop_video:"أسقط الفيديو هنا"},jl={common:Go,upload_text:Fo},Ul=Object.freeze(Object.defineProperty({__proto__:null,common:Go,default:jl,upload_text:Fo},Symbol.toStringTag,{value:"Module"})),qo={built_with_gradio:"Construït amb gradio",clear:"Neteja",empty:"Buit",error:"Error",loading:"S'està carregant",or:"o",submit:"Envia"},zo={click_to_upload:"Feu clic per pujar",drop_audio:"Deixeu anar l'àudio aquí",drop_csv:"Deixeu anar el CSV aquí",drop_file:"Deixeu anar el fitxer aquí",drop_image:"Deixeu anar la imatge aquí",drop_video:"Deixeu anar el vídeo aquí"},Vl={common:qo,upload_text:zo},Gl=Object.freeze(Object.defineProperty({__proto__:null,common:qo,default:Vl,upload_text:zo},Symbol.toStringTag,{value:"Module"})),Xo={annotated_image:"وێنەی نیشانە کراو"},Wo={allow_recording_access:"تکایە ڕێگە بدە بە بەکارهێنانی مایکرۆفۆنەکە بۆ تۆمارکردن.",audio:"دەنگ",record_from_microphone:"تۆمارکردن لە مایکەوە",stop_recording:"تۆمارکردن بوەستێنە"},Jo={connection_can_break:"لە مۆبایلدا، پەیوەندییەکە دەکرێت بپچڕێت ئەگەر ئەم تابە چالاک نەبێت یان ئامێرەکە بچێتە دۆخی پشوو، ئەمەش شوێنی خۆت لە ڕیزدا لەدەست دەدات.",long_requests_queue:"ڕیزێکی درێژی داواکاری هەیە. ئەم سپەیسە دووباد بکە بۆی چاوەڕوان نەبیت.",lost_connection:"پەیوەندی پچڕا بەهۆی جێهێشتنی پەیج. "},Zo={checkbox:"بۆکسی هەڵبژاردن",checkbox_group:"گروپی بۆکسی هەڵبژاردن"},Yo={code:"کۆد"},Qo={color_picker:"ڕەنگ هەڵبژاردە"},Ko={built_with:"دروستکراوە لەگەڵ...",built_with_gradio:"Gradio دروستکراوە بە",clear:"خاوێنکردنەوە",download:"دابەزاندن",edit:"بژارکردن",empty:"بەتاڵ",error:"هەڵە",hosted_on:"میوانداری کراوە لە",loading:"بارکردن",logo:"لۆگۆ",or:"یان",remove:"لابردن",share:"هاوبەشکردن",submit:"پێشکەشکردن",undo:"پووچکردنەوە"},er={incorrect_format:"فۆرماتێکی هەڵە، تەنها فایلەکانی CSV و TSV پشتگیری دەکرێن",new_column:"ستوونی نوێ",new_row:"ڕیزێکی نوێ"},tr={dropdown:"فڕێدانە خوار"},or={build_error:"هەڵەی دروستکردن هەیە",config_error:"هەڵەی ڕێکخستن هەیە",contact_page_author:"تکایە پەیوەندی بە نووسەری پەیجەوە بکەن بۆ ئەوەی ئاگاداریان بکەنەوە.",no_app_file:"هیچ فایلێکی ئەپ نییە",runtime_error:"هەڵەیەکی runtime هەیە",space_not_working:'"سپەیسەکە کارناکات چونکە" {0}',space_paused:"فەزاکە وەستاوە",use_via_api:"لە ڕێگەی API بەکاری بهێنە"},rr={uploading:"بارکردن..."},nr={highlighted_text:"دەقی ڕۆشن کراو"},ir={allow_webcam_access:"تکایە ڕێگە بدە بە بەکارهێنانی وێبکامەکە بۆ تۆمارکردن.",brush_color:"ڕەنگی فڵچە",brush_radius:"تیژڕەوی فڵچە",image:"وێنە",remove_image:"لابردنی وێنە",select_brush_color:"ڕەنگی فڵچە هەڵبژێرە",start_drawing:"دەست بکە بە وێنەکێشان",use_brush:"فڵچە بەکاربهێنە"},sr={label:"لەیبڵ"},ar={enable_cookies:"ئەگەر تۆ سەردانی HuggingFace Space دەکەیت لە دۆخی نادیاردا، پێویستە کووکی لایەنی سێیەم چالاک بکەیت.",incorrect_credentials:"بڕوانامەی هەڵە",login:"چونه‌ ژووره‌وه‌"},lr={number:"ژمارە"},ur={plot:"هێڵکاری"},cr={radio:"ڕادیۆ"},pr={slider:"خلیسکە"},hr={click_to_upload:"کلیک بکە بۆ بارکردن",drop_audio:"دەنگ لێرە دابنێ",drop_csv:"لێرەدا CSV دابنێ",drop_file:"فایل لێرە دابنێ",drop_image:"وێنە لێرەدا دابنێ",drop_video:"ڤیدیۆ لێرە دابنێ"},Fl={"3D_model":{"3d_model":"مۆدێلی سێ ڕەهەندی"},annotated_image:Xo,audio:Wo,blocks:Jo,checkbox:Zo,code:Yo,color_picker:Qo,common:Ko,dataframe:er,dropdown:tr,errors:or,file:rr,highlighted_text:nr,image:ir,label:sr,login:ar,number:lr,plot:ur,radio:cr,slider:pr,upload_text:hr},ql=Object.freeze(Object.defineProperty({__proto__:null,annotated_image:Xo,audio:Wo,blocks:Jo,checkbox:Zo,code:Yo,color_picker:Qo,common:Ko,dataframe:er,default:Fl,dropdown:tr,errors:or,file:rr,highlighted_text:nr,image:ir,label:sr,login:ar,number:lr,plot:ur,radio:cr,slider:pr,upload_text:hr},Symbol.toStringTag,{value:"Module"})),_r={built_with_gradio:"Mit Gradio erstellt",clear:"Löschen",or:"oder",submit:"Absenden"},dr={click_to_upload:"Hochladen",drop_audio:"Audio hier ablegen",drop_csv:"CSV Datei hier ablegen",drop_file:"Datei hier ablegen",drop_image:"Bild hier ablegen",drop_video:"Video hier ablegen"},zl={common:_r,upload_text:dr},Xl=Object.freeze(Object.defineProperty({__proto__:null,common:_r,default:zl,upload_text:dr},Symbol.toStringTag,{value:"Module"})),fr={annotated_image:"Annotated Image"},mr={allow_recording_access:"Please allow access to the microphone for recording.",audio:"Audio",record_from_microphone:"Record from microphone",stop_recording:"Stop recording",no_device_support:"Media devices could not be accessed. Check that you are running on a secure origin (https) or localhost (or you have passed a valid SSL certificate to ssl_verify), and you have allowed browser access to your device.",stop:"Stop",resume:"Resume",record:"Record",no_microphone:"No microphone found",pause:"Pause",play:"Play",waiting:"Waiting"},gr={connection_can_break:"On mobile, the connection can break if this tab is unfocused or the device sleeps, losing your position in queue.",long_requests_queue:"There is a long queue of requests pending. Duplicate this Space to skip.",lost_connection:"Lost connection due to leaving page. Rejoining queue...",waiting_for_inputs:"Waiting for file(s) to finish uploading, please retry."},br={checkbox:"Checkbox",checkbox_group:"Checkbox Group"},vr={code:"Code"},yr={color_picker:"Color Picker"},wr={built_with:"built with",built_with_gradio:"Built with Gradio",clear:"Clear",download:"Download",edit:"Edit",empty:"Empty",error:"Error",hosted_on:"Hosted on",loading:"Loading",logo:"logo",or:"or",remove:"Remove",share:"Share",submit:"Submit",undo:"Undo",no_devices:"No devices found"},Er={incorrect_format:"Incorrect format, only CSV and TSV files are supported",new_column:"Add column",new_row:"New row",add_row_above:"Add row above",add_row_below:"Add row below",add_column_left:"Add column to the left",add_column_right:"Add column to the right"},xr={dropdown:"Dropdown"},Sr={build_error:"there is a build error",config_error:"there is a config error",contact_page_author:"Please contact the author of the page to let them know.",no_app_file:"there is no app file",runtime_error:"there is a runtime error",space_not_working:`"Space isn't working because" {0}`,space_paused:"the space is paused",use_via_api:"Use via API"},Tr={uploading:"Uploading..."},Or={highlighted_text:"Highlighted Text"},Ar={allow_webcam_access:"Please allow access to the webcam for recording.",brush_color:"Brush color",brush_radius:"Brush radius",image:"Image",remove_image:"Remove Image",select_brush_color:"Select brush color",start_drawing:"Start drawing",use_brush:"Use brush"},Pr={label:"Label"},Lr={enable_cookies:"If you are visiting a HuggingFace Space in Incognito mode, you must enable third party cookies.",incorrect_credentials:"Incorrect Credentials",username:"username",password:"password",login:"Login"},Ir={number:"Number"},Rr={plot:"Plot"},kr={radio:"Radio"},Cr={slider:"Slider"},Hr={click_to_upload:"Click to Upload",drop_audio:"Drop Audio Here",drop_csv:"Drop CSV Here",drop_file:"Drop File Here",drop_image:"Drop Image Here",drop_video:"Drop Video Here",drop_gallery:"Drop Media Here",paste_clipboard:"Paste from Clipboard"},Wl={"3D_model":{"3d_model":"3D Model"},annotated_image:fr,audio:mr,blocks:gr,checkbox:br,code:vr,color_picker:yr,common:wr,dataframe:Er,dropdown:xr,errors:Sr,file:Tr,highlighted_text:Or,image:Ar,label:Pr,login:Lr,number:Ir,plot:Rr,radio:kr,slider:Cr,upload_text:Hr},Jl=Object.freeze(Object.defineProperty({__proto__:null,annotated_image:fr,audio:mr,blocks:gr,checkbox:br,code:vr,color_picker:yr,common:wr,dataframe:Er,default:Wl,dropdown:xr,errors:Sr,file:Tr,highlighted_text:Or,image:Ar,label:Pr,login:Lr,number:Ir,plot:Rr,radio:kr,slider:Cr,upload_text:Hr},Symbol.toStringTag,{value:"Module"})),Dr={built_with_gradio:"Construido con Gradio",clear:"Limpiar",or:"o",submit:"Enviar"},Br={click_to_upload:"Haga click para cargar",drop_audio:"Coloque el audio aquí",drop_csv:"Coloque el CSV aquí",drop_file:"Coloque el archivo aquí",drop_image:"Coloque la imagen aquí",drop_video:"Coloque el video aquí",drop_gallery:"Coloque las imagenes aquí"},Zl={common:Dr,upload_text:Br},Yl=Object.freeze(Object.defineProperty({__proto__:null,common:Dr,default:Zl,upload_text:Br},Symbol.toStringTag,{value:"Module"})),Nr={built_with_gradio:"Gradiorekin eraikia",clear:"Garbitu",or:"edo",submit:"Bidali"},$r={click_to_upload:"Klik egin kargatzeko",drop_audio:"Jarri hemen audioa",drop_csv:"Jarri hemen CSVa",drop_file:"Jarri hemen fitxategia",drop_image:"Jarri hemen irudia",drop_video:"Jarri hemen bideoa"},Ql={common:Nr,upload_text:$r},Kl=Object.freeze(Object.defineProperty({__proto__:null,common:Nr,default:Ql,upload_text:$r},Symbol.toStringTag,{value:"Module"})),Mr={built_with_gradio:"ساخته شده با gradio",clear:"حذف",or:"یا",submit:"ارسال"},jr={click_to_upload:"برای آپلود کلیک کنید",drop_audio:"صوت را اینجا رها کنید",drop_csv:"فایل csv را اینجا رها کنید",drop_file:"فایل را اینجا رها کنید",drop_image:"تصویر را اینجا رها کنید",drop_video:"ویدیو را اینجا رها کنید"},eu={common:Mr,upload_text:jr},tu=Object.freeze(Object.defineProperty({__proto__:null,common:Mr,default:eu,upload_text:jr},Symbol.toStringTag,{value:"Module"})),Ur={annotated_image:"Annotoitu kuva"},Vr={allow_recording_access:"Ole hyvä ja anna selaimelle ja sivustolle pääsy mikrofoniin.",audio:"Audio",record_from_microphone:"Äänitä mikrofonia",stop_recording:"Lopeta äänitys",no_device_support:"Medialaitteita ei voitu käyttää. Tarkista, että yhteys on salattu (https), paikallinen (localhost), tai ssl_verify on saanut voimassa olevan SSL-sertifikaatin. Tarkista, että olet antanut selaimelle pääsyn medialaitteeseen.",stop:"Stop",resume:"Jatka",record:"Äänitä",no_microphone:"Ei mikrofonia käytössä",pause:"Pause",play:"Play",waiting:"Odotetaan"},Gr={connection_can_break:"Mobiililaitteella yhteys voi katketa, jos vaihdat välilehteä tai laite menee lepotilaa. Tällöin menetät paikkasi jonossa.",long_requests_queue:"Spacessa on ruuhkaa ja jono on pitkä. Kopioi tämä Space hypätäksesi jonon ohi.",lost_connection:"Yhteys katkesi sivulta poistumisen seurauksena. Liitytään takaisin jonoon...",waiting_for_inputs:"Odotetaan latauksen valmistumista, ole hyvä ja yritä uudelleen."},Fr={checkbox:"Valintaruutu",checkbox_group:"Valintaruuturyhmä"},qr={code:"Koodi"},zr={color_picker:"Värivalitsin"},Xr={built_with:"tehty",built_with_gradio:"tehty Gradiolla",clear:"Poista",download:"Lataa",edit:"Muokkaa",empty:"Tyhjennä",error:"Virhe",hosted_on:"Hostattu",loading:"Ladataan",logo:"logo",or:"tai",remove:"Poista",share:"Jaa",submit:"Suorita",undo:"Kumoa",no_devices:"Laitetta ei löytynyt"},Wr={incorrect_format:"Yhteensopimaton tiedostomuoto, vain CSV- ja TSV-tiedostoja tuetaan.",new_column:"Lisää sarake",new_row:"Lisää rivi",add_row_above:"Lisää rivi yläpuolelle",add_row_below:"Lisää rivi alle",add_column_left:"Lisää sarake vasemmalle",add_column_right:"Lisää sarake oikealle"},Jr={dropdown:"Pudotusvalikko"},Zr={build_error:"tapahtui virhe",config_error:"virhe asetuksissa",contact_page_author:"Kerro ylläpitäjälle virheestä.",no_app_file:"sovellustiedosto puuttuu",runtime_error:"ohjelman suorituksen aikana tapahtui virhe",space_not_working:'"Space ei toimi, koska" {0}',space_paused:"tila on tauolla",use_via_api:"Käytä rajapinnan kautta"},Yr={uploading:"Ladataan..."},Qr={highlighted_text:"Korostettu teksti"},Kr={allow_webcam_access:"Ole hyvä ja anna lupa web-kameran käyttöön.",brush_color:"Siveltimen väri",brush_radius:"Siveltimen koko",image:"Kuva",remove_image:"Poista kuva",select_brush_color:"Valitse siveltimen väri",start_drawing:"Aloita piirtäminen",use_brush:"Käytä sivellintä"},en={label:"Tunniste"},tn={enable_cookies:"Jos käytät Hugging Face Spacea Incognito-tilassa, sinun on otettava käyttöön kolmansien osapuolten evästeet..",incorrect_credentials:"Käyttäjätietoja ei löytynyt",login:"Kirjaudu sisään"},on={number:"Numero"},rn={plot:"Kuvaaja"},nn={radio:"Radio"},sn={slider:"Säädin"},an={click_to_upload:"Lataa palvelimelle",drop_audio:"Vedä audiotiedosto tähän",drop_csv:"Vedä CSV tähän",drop_file:"Vedä tiedosto tähän",drop_image:"Vedä kuva tähän",drop_video:"Vedä video tähän",drop_gallery:"Vedä media tähän",paste_clipboard:"Liitä leikepöydältä"},ou={"3D_model":{"3d_model":"3D-malli"},annotated_image:Ur,audio:Vr,blocks:Gr,checkbox:Fr,code:qr,color_picker:zr,common:Xr,dataframe:Wr,dropdown:Jr,errors:Zr,file:Yr,highlighted_text:Qr,image:Kr,label:en,login:tn,number:on,plot:rn,radio:nn,slider:sn,upload_text:an},ru=Object.freeze(Object.defineProperty({__proto__:null,annotated_image:Ur,audio:Vr,blocks:Gr,checkbox:Fr,code:qr,color_picker:zr,common:Xr,dataframe:Wr,default:ou,dropdown:Jr,errors:Zr,file:Yr,highlighted_text:Qr,image:Kr,label:en,login:tn,number:on,plot:rn,radio:nn,slider:sn,upload_text:an},Symbol.toStringTag,{value:"Module"})),ln={allow_recording_access:"Veuillez autoriser l'accès à l'enregistrement",audio:"Audio",record_from_microphone:"Enregistrer avec le microphone",stop_recording:"Arrêter l'enregistrement"},un={built_with:"Construit avec",built_with_gradio:"Construit avec Gradio",clear:"Effacer",download:"Télécharger",edit:"Éditer",error:"Erreur",loading:"Chargement",logo:"logo",or:"ou",remove:"Supprimer",share:"Partager",submit:"Soumettre"},cn={click_to_upload:"Cliquer pour Télécharger",drop_audio:"Déposer l'Audio Ici",drop_csv:"Déposer le CSV Ici",drop_file:"Déposer le Fichier Ici",drop_image:"Déposer l'Image Ici",drop_video:"Déposer la Vidéo Ici"},nu={audio:ln,common:un,upload_text:cn},iu=Object.freeze(Object.defineProperty({__proto__:null,audio:ln,common:un,default:nu,upload_text:cn},Symbol.toStringTag,{value:"Module"})),pn={built_with_gradio:"בנוי עם גרדיו",clear:"נקה",or:"או",submit:"שלח"},hn={click_to_upload:"לחץ כדי להעלות",drop_audio:"גרור לכאן קובץ שמע",drop_csv:"גרור csv קובץ לכאן",drop_file:"גרור קובץ לכאן",drop_image:"גרור קובץ תמונה לכאן",drop_video:"גרור קובץ סרטון לכאן"},su={common:pn,upload_text:hn},au=Object.freeze(Object.defineProperty({__proto__:null,common:pn,default:su,upload_text:hn},Symbol.toStringTag,{value:"Module"})),_n={built_with_gradio:"Gradio से बना",clear:"हटाये",or:"या",submit:"सबमिट करे"},dn={click_to_upload:"अपलोड के लिए बटन दबायें",drop_audio:"यहाँ ऑडियो ड्रॉप करें",drop_csv:"यहाँ CSV ड्रॉप करें",drop_file:"यहाँ File ड्रॉप करें",drop_image:"यहाँ इमेज ड्रॉप करें",drop_video:"यहाँ वीडियो ड्रॉप करें"},lu={common:_n,upload_text:dn},uu=Object.freeze(Object.defineProperty({__proto__:null,common:_n,default:lu,upload_text:dn},Symbol.toStringTag,{value:"Module"})),fn={built_with_gradio:"gradioで作ろう",clear:"クリア",or:"または",submit:"送信"},mn={use_via_api:"API経由で使おう"},gn={incorrect_credentials:"認証情報が正しくありません",username:"ユーザ名",password:"パスワード",login:"ログイン"},bn={click_to_upload:"クリックしてアップロード",drop_audio:"ここに音声をドロップ",drop_csv:"ここにCSVをドロップ",drop_file:"ここにファイルをドロップ",drop_image:"ここに画像をドロップ",drop_video:"ここに動画をドロップ"},cu={common:fn,errors:mn,login:gn,upload_text:bn},pu=Object.freeze(Object.defineProperty({__proto__:null,common:fn,default:cu,errors:mn,login:gn,upload_text:bn},Symbol.toStringTag,{value:"Module"})),vn={built_with_gradio:"gradio로 제작되었습니다",clear:"클리어",or:"또는",submit:"제출하기"},yn={click_to_upload:"클릭해서 업로드하기",drop_audio:"오디오를 끌어 놓으세요",drop_csv:"CSV파일을 끌어 놓으세요",drop_file:"파일을 끌어 놓으세요",drop_image:"이미지를 끌어 놓으세요",drop_video:"비디오를 끌어 놓으세요"},hu={common:vn,upload_text:yn},_u=Object.freeze(Object.defineProperty({__proto__:null,common:vn,default:hu,upload_text:yn},Symbol.toStringTag,{value:"Module"})),wn={built_with_gradio:"sukurta su gradio",clear:"Trinti",or:"arba",submit:"Pateikti"},En={click_to_upload:"Spustelėkite norėdami įkelti",drop_audio:"Įkelkite garso įrašą čia",drop_csv:"Įkelkite CSV čia",drop_file:"Įkelkite bylą čia",drop_image:"Įkelkite paveikslėlį čia",drop_video:"Įkelkite vaizdo įrašą čia"},du={common:wn,upload_text:En},fu=Object.freeze(Object.defineProperty({__proto__:null,common:wn,default:du,upload_text:En},Symbol.toStringTag,{value:"Module"})),xn={built_with_gradio:"gemaakt met gradio",clear:"Wis",or:"of",submit:"Zend in"},Sn={click_to_upload:"Klik om the Uploaden",drop_audio:"Sleep een Geluidsbestand hier",drop_csv:"Sleep een CSV hier",drop_file:"Sleep een Document hier",drop_image:"Sleep een Afbeelding hier",drop_video:"Sleep een Video hier"},mu={common:xn,upload_text:Sn},gu=Object.freeze(Object.defineProperty({__proto__:null,common:xn,default:mu,upload_text:Sn},Symbol.toStringTag,{value:"Module"})),Tn={built_with_gradio:"utworzone z gradio",clear:"Wyczyść",or:"lub",submit:"Zatwierdź"},On={click_to_upload:"Kliknij, aby przesłać",drop_audio:"Przeciągnij tutaj audio",drop_csv:"Przeciągnij tutaj CSV",drop_file:"Przeciągnij tutaj plik",drop_image:"Przeciągnij tutaj zdjęcie",drop_video:"Przeciągnij tutaj video"},bu={common:Tn,upload_text:On},vu=Object.freeze(Object.defineProperty({__proto__:null,common:Tn,default:bu,upload_text:On},Symbol.toStringTag,{value:"Module"})),An={built_with_gradio:"Construído com gradio",clear:"Limpar",error:"Erro",flag:"Marcar",loading:"Carregando",or:"ou",submit:"Enviar"},Pn={click_to_upload:"Clique para o Upload",drop_audio:"Solte o Áudio Aqui",drop_csv:"Solte o CSV Aqui",drop_file:"Solte o Arquivo Aqui",drop_image:"Solte a Imagem Aqui",drop_video:"Solte o Vídeo Aqui"},yu={common:An,upload_text:Pn},wu=Object.freeze(Object.defineProperty({__proto__:null,common:An,default:yu,upload_text:Pn},Symbol.toStringTag,{value:"Module"})),Ln={annotated_image:"Аннотированное изображение"},In={allow_recording_access:"Пожалуйста, предоставьте доступ к микрофону для записи.",audio:"Аудио",record_from_microphone:"Записать с микрофона",stop_recording:"Остановить запись",no_device_support:"Не удалось получить доступ к медиаустройствам. Убедитесь, что вы работаете на защищенном источнике (https) или localhost (или передали действительный SSL-сертификат в ssl_verify), и разрешили браузеру доступ к устройству.",stop:"Стоп",resume:"Продолжить",record:"Записать",no_microphone:"Микрофон не найден",pause:"Пауза",play:"Воспроизвести"},Rn={connection_can_break:"На мобильных устройствах соединение может прерваться, если вкладка будет переключена или устройство отключится, что приведет к потере вашей позиции в очереди.",long_requests_queue:"Очередь запросов длинная. Продублируйте это пространство, чтобы пропустить.",lost_connection:"Потеряно соединение из-за ухода со страницы. Повторное подключение..."},kn={checkbox:"Чекбокс",checkbox_group:"Группа чекбоксов"},Cn={code:"Код"},Hn={color_picker:"Выбор цвета"},Dn={built_with:"создано с",built_with_gradio:"Создано с помощью Gradio",clear:"Очистить",download:"Скачать",edit:"Изменить",empty:"Пусто",error:"Ошибка",hosted_on:"Размещено на",loading:"Загрузка",logo:"логотип",or:"или",remove:"Удалить",share:"Поделиться",submit:"Отправить",undo:"Отменить",no_devices:"Не найдено ни одного устройства"},Bn={incorrect_format:"Неправильный формат, поддерживаются только файлы CSV и TSV",new_column:"Новая колонка",new_row:"Новый ряд"},Nn={dropdown:"Dropdown"},$n={build_error:"возникла ошибка сборки",config_error:"возникла ошибка конфигурации",contact_page_author:"Пожалуйста, свяжитесь с автором страницы, чтобы сообщить ему об этом.",no_app_file:"отсутствует файл приложения",runtime_error:"возникла проблема с выполнением",space_not_working:'"Пространство не работает, потому что" {0}',space_paused:"пространство приостановлено",use_via_api:"Использовать через API"},Mn={uploading:"Загружаем..."},jn={highlighted_text:"Выделенный текст"},Un={allow_webcam_access:"Пожалуйста, разрешите доступ к веб-камере для записи.",brush_color:"Цвет кисти",brush_radius:"Радиус кисти",image:"Изображение",remove_image:"Удалить изображение",select_brush_color:"Выберите цвет кисти",start_drawing:"Начните рисовать",use_brush:"Используйте кисть"},Vn={label:"Лейбл"},Gn={enable_cookies:"Если вы посещаете пространство HuggingFace в режиме инкогнито, вы должны разрешить сторонние файлы cookie.",incorrect_credentials:"Неправильные учетные данные",login:"Вход в систему"},Fn={number:"Число"},qn={plot:"Схема"},zn={radio:"Радио"},Xn={slider:"Слайдер"},Wn={click_to_upload:"Нажмите, чтобы загрузить",drop_audio:"Перетащите аудио сюда",drop_csv:"Перетащите файл CSV сюда",drop_file:"Перетащите файл сюда",drop_image:"Перетащите изображение сюда",drop_video:"Перетащите видео сюда",drop_gallery:"Перетащите изображение(-я) сюда",paste_clipboard:"Вставка из буфера обмена"},Eu={"3D_model":{"3d_model":"3D-модель"},annotated_image:Ln,audio:In,blocks:Rn,checkbox:kn,code:Cn,color_picker:Hn,common:Dn,dataframe:Bn,dropdown:Nn,errors:$n,file:Mn,highlighted_text:jn,image:Un,label:Vn,login:Gn,number:Fn,plot:qn,radio:zn,slider:Xn,upload_text:Wn},xu=Object.freeze(Object.defineProperty({__proto__:null,annotated_image:Ln,audio:In,blocks:Rn,checkbox:kn,code:Cn,color_picker:Hn,common:Dn,dataframe:Bn,default:Eu,dropdown:Nn,errors:$n,file:Mn,highlighted_text:jn,image:Un,label:Vn,login:Gn,number:Fn,plot:qn,radio:zn,slider:Xn,upload_text:Wn},Symbol.toStringTag,{value:"Module"})),Jn={built_with_gradio:"கிரேடியோ வுடன் உருவாக்கப்பட்டது",clear:"அழிக்கவும்",or:"அல்லது",submit:"சமர்ப்பிக்கவும்"},Zn={click_to_upload:"பதிவேற்ற அழுத்தவும்",drop_audio:"ஆடியோவை பதிவேற்றவும்",drop_csv:"csv ஐ பதிவேற்றவும்",drop_file:"கோப்பை பதிவேற்றவும்",drop_image:"படத்தை பதிவேற்றவும்",drop_video:"காணொளியை பதிவேற்றவும்"},Su={common:Jn,upload_text:Zn},Tu=Object.freeze(Object.defineProperty({__proto__:null,common:Jn,default:Su,upload_text:Zn},Symbol.toStringTag,{value:"Module"})),Yn={built_with_gradio:"Gradio ile oluşturulmuştur",clear:"Temizle",or:"veya",submit:"Yükle"},Qn={click_to_upload:"Yüklemek için Tıkla",drop_audio:"Kaydı Buraya Sürükle",drop_csv:"CSV'yi Buraya Sürükle",drop_file:"Dosyayı Buraya Sürükle",drop_image:"Resmi Buraya Sürükle",drop_video:"Videoyu Buraya Sürükle"},Ou={common:Yn,upload_text:Qn},Au=Object.freeze(Object.defineProperty({__proto__:null,common:Yn,default:Ou,upload_text:Qn},Symbol.toStringTag,{value:"Module"})),Kn={built_with_gradio:"Зроблено на основі gradio",clear:"Очистити",or:"або",submit:"Надіслати"},ei={click_to_upload:"Натисніть щоб завантажити",drop_audio:"Перетягніть аудіо сюди",drop_csv:"Перетягніть CSV-файл сюди",drop_file:"Перетягніть файл сюди",drop_image:"Перетягніть зображення сюди",drop_video:"Перетягніть відео сюди"},Pu={common:Kn,upload_text:ei},Lu=Object.freeze(Object.defineProperty({__proto__:null,common:Kn,default:Pu,upload_text:ei},Symbol.toStringTag,{value:"Module"})),ti={built_with_gradio:"کے ساتھ بنایا گیا Gradio",clear:"ہٹا دیں",or:"یا",submit:"جمع کریں"},oi={click_to_upload:"اپ لوڈ کے لیے کلک کریں",drop_audio:"یہاں آڈیو ڈراپ کریں",drop_csv:"یہاں فائل ڈراپ کریں",drop_file:"یہاں فائل ڈراپ کریں",drop_image:"یہاں تصویر ڈراپ کریں",drop_video:"یہاں ویڈیو ڈراپ کریں"},Iu={common:ti,upload_text:oi},Ru=Object.freeze(Object.defineProperty({__proto__:null,common:ti,default:Iu,upload_text:oi},Symbol.toStringTag,{value:"Module"})),ri={built_with_gradio:"gradio bilan qilingan",clear:"Tozalash",submit:"Yubor"},ni={click_to_upload:"Yuklash uchun Bosing",drop_audio:"Audioni Shu Yerga Tashlang",drop_csv:"CSVni Shu Yerga Tashlang",drop_file:"Faylni Shu Yerga Tashlang",drop_image:"Rasmni Shu Yerga Tashlang",drop_video:"Videoni Shu Yerga Tashlang"},ku={common:ri,upload_text:ni},Cu=Object.freeze(Object.defineProperty({__proto__:null,common:ri,default:ku,upload_text:ni},Symbol.toStringTag,{value:"Module"})),ii={annotated_image:"标注图像"},si={allow_recording_access:"请允许访问麦克风以进行录音。",audio:"音频",record_from_microphone:"从麦克风录制",stop_recording:"停止录制",no_device_support:"无法访问媒体设备。请检查您是否在安全来源(https)或本地主机上运行(或者您已经通过 ssl_verify 传递了有效的 SSL 证书),并且您已经允许浏览器访问您的设备。",stop:"停止",resume:"继续",record:"录制",no_microphone:"找不到麦克风",pause:"暂停",play:"播放",waiting:"等待"},ai={connection_can_break:"在移动设备上,如果此标签页失去焦点或设备休眠,连接可能会中断,导致您在队列中失去位置。",long_requests_queue:"有一个长时间的待处理请求队列。复制此空间以跳过。",lost_connection:"由于离开页面,连接已丢失。重新加入队列..."},li={checkbox:"复选框",checkbox_group:"复选框组"},ui={code:"代码"},ci={color_picker:"颜色选择器"},pi={built_with:"构建于",built_with_gradio:"使用 Gradio 构建",clear:"清除",download:"下载",edit:"编辑",empty:"空",error:"错误",hosted_on:"托管在",loading:"加载中",logo:"标志",or:"或",remove:"移除",share:"分享",submit:"提交",undo:"撤销"},hi={incorrect_format:"格式不正确,仅支持 CSV 和 TSV 文件",new_column:"新列",new_row:"新行"},_i={dropdown:"下拉菜单"},di={build_error:"存在构建错误",config_error:"存在配置错误",contact_page_author:"请联系页面的作者并告知他们。",no_app_file:"不存在应用文件",runtime_error:"存在运行时错误",space_not_working:'"空间无法工作,原因:" {0}',space_paused:"空间已暂停",use_via_api:"通过 API 使用"},fi={uploading:"正在上传..."},mi={highlighted_text:"高亮文本"},gi={allow_webcam_access:"请允许访问网络摄像头以进行录制。",brush_color:"画笔颜色",brush_radius:"画笔半径",image:"图像",remove_image:"移除图像",select_brush_color:"选择画笔颜色",start_drawing:"开始绘画",use_brush:"使用画笔"},bi={label:"标签"},vi={enable_cookies:"如果您正在使用隐身模式访问 HuggingFace 空间,您必须启用第三方 cookie。",incorrect_credentials:"凭据不正确",login:"登录"},yi={number:"数字"},wi={plot:"图表"},Ei={radio:"单选框"},xi={slider:"滑块"},Si={click_to_upload:"点击上传",drop_audio:"将音频拖放到此处",drop_csv:"将 CSV 文件拖放到此处",drop_file:"将文件拖放到此处",drop_image:"将图像拖放到此处",drop_video:"将视频拖放到此处"},Hu={"3D_model":{"3d_model":"3D模型"},annotated_image:ii,audio:si,blocks:ai,checkbox:li,code:ui,color_picker:ci,common:pi,dataframe:hi,dropdown:_i,errors:di,file:fi,highlighted_text:mi,image:gi,label:bi,login:vi,number:yi,plot:wi,radio:Ei,slider:xi,upload_text:Si},Du=Object.freeze(Object.defineProperty({__proto__:null,annotated_image:ii,audio:si,blocks:ai,checkbox:li,code:ui,color_picker:ci,common:pi,dataframe:hi,default:Hu,dropdown:_i,errors:di,file:fi,highlighted_text:mi,image:gi,label:bi,login:vi,number:yi,plot:wi,radio:Ei,slider:xi,upload_text:Si},Symbol.toStringTag,{value:"Module"})),Ti={built_with_gradio:"使用Gradio構建",clear:"清除",or:"或",submit:"提交"},Oi={click_to_upload:"點擊上傳",drop_audio:"拖放音訊至此處",drop_csv:"拖放CSV至此處",drop_file:"拖放檔案至此處",drop_image:"拖放圖片至此處",drop_video:"拖放影片至此處"},Bu={common:Ti,upload_text:Oi},Nu=Object.freeze(Object.defineProperty({__proto__:null,common:Ti,default:Bu,upload_text:Oi},Symbol.toStringTag,{value:"Module"})),to=Object.assign({"./lang/ar.json":Ul,"./lang/ca.json":Gl,"./lang/ckb.json":ql,"./lang/de.json":Xl,"./lang/en.json":Jl,"./lang/es.json":Yl,"./lang/eu.json":Kl,"./lang/fa.json":tu,"./lang/fi.json":ru,"./lang/fr.json":iu,"./lang/he.json":au,"./lang/hi.json":uu,"./lang/ja.json":pu,"./lang/ko.json":_u,"./lang/lt.json":fu,"./lang/nl.json":gu,"./lang/pl.json":vu,"./lang/pt-BR.json":wu,"./lang/ru.json":xu,"./lang/ta.json":Tu,"./lang/tr.json":Au,"./lang/uk.json":Lu,"./lang/ur.json":Ru,"./lang/uz.json":Cu,"./lang/zh-CN.json":Du,"./lang/zh-TW.json":Nu});function $u(){let e={};for(const t in to){const o=t.split("/").pop().split(".").shift();e[o]=to[t].default}return e}const oo=$u();for(const e in oo)Bo(e,oo[e]);async function Yu(){await ll({fallbackLocale:"en",initialLocale:gl()})}const Mu="./assets/index-B8rPY1CB.css";let dt;dt=[];let ft,Ai,ju=new Promise(e=>{Ai=e});async function Uu(){ft=(await _(()=>import("./Index-DjLHM9wg.js"),__vite__mapDeps([198,85,7,8,9,2,3,4,5,6,10,11,21,199,23]),import.meta.url)).default,Ai()}function Vu(){const e={SvelteComponent:Je.SvelteComponent};for(const o in Je)o!=="SvelteComponent"&&(o==="SvelteComponentDev"?e[o]=e.SvelteComponent:e[o]=Je[o]);window.__gradio__svelte__internal=e;class t extends HTMLElement{control_page_title;initial_height;is_embed;container;info;autoscroll;eager;theme_mode;host;space;src;app;loading;updating;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(){await Uu(),this.loading=!0,this.app&&this.app.$destroy(),typeof dt!="string"&&dt.forEach(i=>Wt(i,document.head)),await Wt(Mu,document.head);const r=new CustomEvent("domchange",{bubbles:!0,cancelable:!1,composed:!0});new MutationObserver(i=>{this.dispatchEvent(r)}).observe(this,{childList:!0}),this.app=new ft({target:this,props:{space:this.space?this.space.trim():this.space,src:this.src?this.src.trim():this.src,info:this.info!=="false",container:this.container!=="false",is_embed:this.is_embed!=="false",initial_height:this.initial_height,eager:this.eager==="true",version:"5-9-0",theme_mode:this.theme_mode,autoscroll:this.autoscroll==="true",control_page_title:this.control_page_title==="true",Client:Be,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"]}async attributeChangedCallback(r,n,i){if(await ju,(r==="host"||r==="space"||r==="src")&&i!==n){if(this.updating={name:r,value:i},this.loading)return;this.app&&this.app.$destroy(),this.space=null,this.host=null,this.src=null,r==="host"?this.host=i:r==="space"?this.space=i:r==="src"&&(this.src=i),this.app=new ft({target:this,props:{space:this.space?this.space.trim():this.space,src:this.src?this.src.trim():this.src,info:this.info!=="false",container:this.container!=="false",is_embed:this.is_embed!=="false",initial_height:this.initial_height,eager:this.eager==="true",version:"5-9-0",theme_mode:this.theme_mode,autoscroll:this.autoscroll==="true",control_page_title:this.control_page_title==="true",Client:Be,app_mode:window.__gradio_mode__==="app"}}),this.updating=!1}}}customElements.get("gradio-app")||customElements.define("gradio-app",t)}Vu();export{Wu as $,Bl as A,_,$u as a,Xu as b,Zu as c,Gu as d,qu as e,zu as f,Vs as g,$s as h,Fu as i,js as j,Jt as l,Wt as m,fe as n,Ju as p,Yu as s,se as w}; //# sourceMappingURL=index-CP09mL-w.js.map