PageSourceSearch

https://yves28-lerningos.hf.space/assets/index-B7J2Z2jS.js

js yves28-lerningos.hf.space collected 2026-10-03 17:32:35 UTC 138,759 bytes, 12 lines download raw bytes

1const __vite__fileDeps=["./Index-BZCxldx4.js","./Block-CJdXVpa7.js","./IconButtonWrapper-BqcF4N5S.css","./MarkdownCode.svelte_svelte_type_style_lang-Cf_zCqIz.js","./prism-python-MMh3z1bK.js","./MarkdownCode-GC7vPJ5f.css","./index-B1FJGuzG.js","./StreamingBar.svelte_svelte_type_style_lang-DyfAPhwM.js","./StreamingBar-pGVW9eBG.css","./IconButton-C_HS7fTi.js","./Clear-By3xiIwg.js","./Index-C7inCcrM.js","./Index-D-5U5m91.css","./Index-C5NYahSl.css","./Index-wtmxIslC.js","./BlockLabel-3KxTaaiM.js","./Empty-ZqppqzTN.js","./Image-Bsh8Umrh.js","./IconButtonWrapper--EIOWuEM.js","./FullscreenButton-jgOGhOHz.js","./file-url-DoxvUUVV.js","./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js","./DownloadLink-CqD3Uu0l.css","./Index-E3yBBMTH.css","./StaticAudio-CEEuz0kn.js","./utils-BsGrhMNe.js","./ShareButton-BuIiIMKb.js","./Community-Dw1micSV.js","./Download-DVtk-Jv3.js","./Music-CDm0RGMk.js","./AudioPlayer-73PUar21.js","./Trim-JQYgj7Jd.js","./Play-B0Q0U1Qz.js","./Undo-DCjBnnSO.js","./hls-CnVhpNcu.js","./AudioPlayer-BAKhejK8.css","./DownloadLink-QIttOhoR.js","./Example-BQyGztrG.js","./Example-D7K5RtQ2.css","./index-DbAp2Rgu.js","./InteractiveAudio-DBS9gPHc.js","./Upload-D4uXt6Nz.js","./Upload-L7mprsyN.css","./ModifyUpload-5lgGIpMc.js","./Edit-BpRIf5rU.js","./SelectSource-CVJruJ8L.js","./StreamingBar-JqJtcvLZ.js","./InteractiveAudio-B76TQFG-.css","./UploadText-DtO3Yo94.js","./Index-CuHioI51.js","./Index-COCIsOdf.js","./__vite-browser-external-D7Ct-6yo.js","./Index-FxnluDmK.js","./Button-B3gqVEq2.js","./Image-CnqB5dbD.js","./Image-B8dFOee4.css","./Button-DTh9AgeE.css","./ImagePreview-C_qhEOxI.css","./Index-CB1YfUW4.js","./Check-CEkiXcyC.js","./Copy-CxQ9EyK2.js","./File-BQ_9P3Ye.js","./MarkdownCode-CkSMBRHJ.js","./index-CEGzm7H5.js","./index-CnqicUFC.js","./Trash-RbZEwH-j.js","./Index-rX6M_998.css","./Example-CZ-iEz1g.js","./Index-B0AlGE52.js","./Info-IGMCDo7y.js","./Checkbox-CjOIpf6b.js","./Checkbox-COx9d1js.css","./Example-DccrJI--.js","./Index-CmM1-Kgi.js","./BlockTitle-Ct-h8ev5.js","./Index-DMKGW8pW.css","./Example-DQvZIwBt.js","./Example-oomIF0ca.css","./Index-XeBgsyZk.js","./Code-DGNrTu_I.js","./Index-DloLYeAi.css","./Example-BaLyJYAe.js","./Example-Bw8Q_3wB.css","./Index-k7d3hggf.js","./tinycolor-DhRrpXkc.js","./Index-DwWu86Nh.css","./index-B2T8hc6C.js","./Embed-HnJWX_lT.js","./Example-CqPGqNav.js","./Example-1kVNej19.css","./Index-B0grnMRw.js","./index-tFQomdd2.js","./dsv-DB8NKgIY.js","./DropdownArrow-DYWFcSFn.js","./Index-BLHCXS_b.js","./ImagePreview-lAInKGA8.js","./utils-Gtzs_Zla.js","./ImageUploader-CGsNpf2-.js","./Square-oAGqOwsh.js","./ImageUploader-DMdYP1a9.css","./Example-CC8yxxGn.js","./Example-DikqVAPo.css","./Index-DctcNp5N.css","./Index-loH_ztvM.js","./Example-BdAjEacD.js","./Example-ClKJOMGh.css","./Index-D3f6Hf9S.css","./Textbox-jWD3sCxr.css","./Index-BN36UgrQ.js","./Example-BBLMS951.js","./Index-Bk5ZTHOI.css","./Index-DRJTgarg.js","./Index-tcNSQSor.css","./Example-BgQNfMWT.js","./Index-Cm-BYlsY.js","./Dropdown-vf9-p-La.js","./Dropdown-CWxB-qJp.css","./Example-DrmWnoSo.js","./Example-DpWs9cEC.css","./Index-BH3WSrmS.js","./FileUpload-3WZGI66M.js","./FileUpload-CQVu-hjH.css","./Example-CIFMxn5c.js","./Example-DfhEULNF.css","./Index-HcdSJvd1.js","./Index-BKaa_GXG.css","./Index-DE1Sah7F.js","./Index-12OnbRhk.css","./Gallery-Ctw0WwP3.js","./Video-DtShVFLe.js","./Video-DJw86Ppo.css","./Gallery-CUVAWrOv.css","./Index-CPGNVvBX.js","./Index-WEzAIkMk.js","./Index-Cgj6KPvj.css","./Index-DePFwAr4.js","./color-Bp-SbB1W.js","./Index-Dwy3Ni24.css","./Index-BKGQD_Df.js","./Index-Csm0OGa9.css","./Example-C2a4WxRl.js","./Example-CSw4pLi5.css","./Example-BYSsGuG2.js","./Example-6rv12T44.css","./Index-CbHblLM3.js","./Index-ClP1ItfE.css","./Example-j_9MW44b.js","./Example-fMB4cHw6.css","./Index-CS9KQP_a.js","./select-BigU4G0v.js","./dispatch-kxCwF96_.js","./Index-CTOeqf6n.css","./Example-CUXQMlMe.js","./JSON-D1BmJsmI.js","./JSON-DItMwpQq.css","./Example-CG7uBGLE.css","./Index-CRCQNxH7.js","./Index-DLt4Oneb.js","./LineChart-CKh1Fdep.js","./Index-D3BKJl5I.css","./Example-CyYX3U0b.js","./Index-DsYu4Vp2.js","./Index-BTXaMQgd.css","./Example-uQ8MuYg6.js","./Index-DTpkVUiy.js","./Index-Be3F7oKw.css","./Example-CiCdQyhW.js","./Example-CCTTJ5R1.css","./Index-DzyfujkC.js","./Send-DyoOovnk.js","./Video-fsmLZWjA.js","./Index-1zeyvqK2.css","./Index-DRkwtSQ6.js","./Index-WdTVQ0oj.css","./Example-CqL1e7EB.js","./Index-BI
vendor: 51,248 bytes, lines 1-4
1dUk9av.js","./Index-Dclo02rM.css","./Example-C9__vDgN.js","./Index-DkqotP0T.js","./Index-BXWS2J4r.css","./Plot-ByQgMKrE.js","./Index-BZ8wivy_.js","./Example-BoMLuz1A.js","./Index-DhgnLShX.js","./Index--UpFQsHg.css","./Index-EtmCJbY4.js","./Index-CfowPFmo.css","./Index-Cjafj7_6.js","./Index-w1Ra_uQ1.css","./Index-BlWK1-fD.js","./Index-B0hFno2n.css","./Example-BrizabXh.js","./Index-6xwbSvdF.js","./Index-zdBaScbz.css","./index-C0xhtHu7.js","./Toast-BMPuxKCO.js","./Index-DwhpTNaY.js","./Tabs-DS4O-Nv1.js","./Tabs-C0qLuAtA.css","./Index-Gmwqb-vD.css","./Index-BIK3OPds.js","./Index-C5yNnGyH.js","./Textbox-kv26zexc.js","./Index-eHFoCXcv.js","./Index-DYDmCduo.css","./VideoPreview-DBQL_gko.js","./VideoPreview-wQufNXbv.css","./Example-B74kJcnr.js","./Example-B5CSTz0f.css","./index-BeWruw2y.js","./index-CFBZQE_H.css","./Example-DxdiEFS_.js","./Index-ZgZSqOvY.js","./Index-CgDrEMlk.css","./Index-BJo1nj4S.js","./Index-BJ_RfjVB.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2import*as rt from"./svelte/svelte.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();const Dn="modulepreload",Hn=function(e,t){return new URL(e,t).href},Ut={},h=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=s?.nonce||s?.getAttribute("nonce");i=Promise.all(r.map(c=>{if(c=Hn(c,n),c in Ut)return;Ut[c]=!0;const u=c.endsWith(".css"),l=u?'[rel="stylesheet"]':"";if(!!n)for(let m=o.length-1;m>=0;m--){const _=o[m];if(_.href===c&&(!u||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${l}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":Dn,u||(p.as="script",p.crossOrigin=""),p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((m,_)=>{p.addEventListener("load",m),p.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>t()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};var nt=new Intl.Collator(0,{numeric:1}).compare;function vr(e,t,r){return e=e.split("."),t=t.split("."),nt(e[0],t[0])||nt(e[1],t[1])||(t[2]=t.slice(2).join("."),r=/[.-]/.test(e[2]=e.slice(2).join(".")),r==/[.-]/.test(t[2])?nt(e[2],t[2]):r?-1:1)}const Nn="host",wr="queue/data",Cn="queue/join",jt="upload",Bn="login",Vt="config",Mn="info",kn="runtime",Un="sleeptime",jn="heartbeat",Vn="component_server",$n="reset",Gn="cancel",Fn="app_id",zn="https://gradio-space-api-fetcher-v2.hf.space/api",xr="This application is currently busy. Please try again. ",de="Connection errored out. ",ce="Could not resolve app config. ",qn="Could not get space status. ",Xn="Could not get API info. ",At="Space metadata could not be loaded. ",Wn="Invalid URL. A full URL path is required.",Jn="Not authorized to access this space. ",Tr="Invalid credentials. Could not login. ",Zn="Login credentials are required to access this space.",Qn="File system access is only available in Node.js environments",Sr="Root URL not found in client config",Yn="Error uploading file";function Kn(e,t,r){return t.startsWith("http://")||t.startsWith("https://")?r?e:t:e+t}async function $t(e,t,r){try{return(await(await fetch(`https://huggingface.co/api/spaces/${e}/jwt`,{headers:{Authorization:`Bearer ${t}`,...r?{Cookie:r}:{}}})).json()).token||!1}catch{return!1}}function ei(e){let t={};return e.forEach(({api_name:r,id:n})=>{r&&(t[r]=n)}),t}async function ti(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)return window.gradio_config.current_page&&(e=e.substring(0,e.lastIndexOf("/"))),window.gradio_config.root=e,{...window.gradio_config};if(e){let r=Pr(e,this.deep_link?Vt+"?deep_link="+this.deep_link:Vt);const n=await this.fetch(r,{headers:t,credentials:"include"});return ri(n,e,!!this.options.auth)}throw new Error(ce)}async function ri(e,t,r){if(e?.status===401&&!r){const i=(await e.json())?.detail?.auth_message;throw new Error(i||Zn)}else if(e?.status===401&&r)throw new Error(Tr);if(e?.status===200){let n=await e.json();return n.root=t,n.dependencies?.forEach((i,o)=>{i.id===void 0&&(i.id=o)}),n}else if(e?.status===401)throw new Error(Jn);throw new Error(ce)}async function ni(){const{http_protocol:e,host:t}=await Je(this.app_reference,this.options.hf_token);try{if(this.options.auth){const r=await Ar(e,t,this.options.auth,this.fetch,this.options.hf_token);r&&this.set_cookies(r)}}catch(r){throw Error(r.message)}}async function Ar(e,t,r,n,i){const o=new FormData;o.append("username",r?.[0]),o.append("password",r?.[1]);let s={};i&&(s.Authorization=`Bearer ${i}`);const a=await n(`${e}//${t}/${Bn}`,{headers:s,method:"POST",body:o,credentials:"include"});if(a.status===200)return a.headers.get("set-cookie");throw a.status===401?new Error(Tr):new Error(At)}function it(e){if(e.startsWith("http")){const{protocol:t,host:r,pathname:n}=new URL(e);return{ws_protocol:t==="https:"?"wss":"ws",http_protocol:t,host:r+(n!=="/"?n:"")}}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 Or=e=>{let t=[];return e.split(/,(?=\s*[^\s=;]+=[^\s=;]+)/).forEach(n=>{const[i,o]=n.split(";")[0].split("=");i&&o&&t.push(`${i.trim()}=${o.trim()}`)}),t},Ot=/^[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+$/,ii=/.*hf\.space\/{0,1}.*$/;async function Je(e,t){const r={};t&&(r.Authorization=`Bearer ${t}`);const n=e.trim().replace(/\/$/,"");if(Ot.test(n))try{const o=(await(await fetch(`https://huggingface.co/api/spaces/${n}/${Nn}`,{headers:r})).json()).host;return{space_id:e,...it(o)}}catch{throw new Error(At)}if(ii.test(n)){const{ws_protocol:i,http_protocol:o,host:s}=it(n);return{space_id:s.split("/")[0].replace(".hf.space",""),ws_protocol:i,http_protocol:o,host:s}}return{space_id:!1,...it(n)}}const Pr=(...e)=>{try{return e.reduce((t,r)=>(t=t.replace(/\/+$/,""),r=r.replace(/^\/+/,""),new URL(r,t+"/").toString()))}catch{throw new Error(Wn)}};function oi(e,t,r){const n={named_endpoints:{},unnamed_endpoints:{}};return Object.keys(e).forEach(i=>{(i==="named_endpoints"||i==="unnamed_endpoints")&&(n[i]={},Object.entries(e[i]).forEach(([o,{parameters:s,returns:a}])=>{const c=t.dependencies.find(f=>f.api_name===o||f.api_name===o.replace("/",""))?.id||r[o.replace("/","")]||-1,u=c!==-1?t.dependencies.find(f=>f.id==c)?.types:{generator:!1,cancel:!1};if(c!==-1&&t.dependencies.find(f=>f.id==c)?.inputs?.length!==s.length){const f=t.dependencies.find(p=>p.id==c).inputs.map(p=>t.components.find(m=>m.id===p)?.type);try{f.forEach((p,m)=>{if(p==="state"){const _={component:"state",example:null,parameter_default:null,parameter_has_default:!0,parameter_name:null,hidden:!0};s.splice(m,0,_)}})}catch(p){console.error(p)}}const l=(f,p,m,_)=>({...f,description:ai(f?.type,m),type:si(f?.type,p,m,_)||""});n[i][o]={parameters:s.map(f=>l(f,f?.component,f?.serializer,"parameter")),returns:a.map(f=>l(f,f?.component,f?.serializer,"return")),type:u}}))}),n}function si(e,t,r,n){if(t==="Api")return e.type;switch(e?.type){case"string":return"string";case"boolean":return"boolean";case"number":return"number"}if(r==="JSONSerializable"||r==="StringSerializable")return"any";if(r==="ListStringSerializable")return"string[]";if(t==="Image")return n==="parameter"?"Blob | File | Buffer":"string";if(r==="FileSerializable")return e?.type==="array"?n==="parameter"?"(Blob | File | Buffer)[]":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]":n==="parameter"?"Blob | File | Buffer":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";if(r==="GallerySerializable")return n==="parameter"?"[(Blob | File | Buffer), (string | null)][]":"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"}function ai(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 ot(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:xr,stage:"error",code:e.code,success:e.success}};case"heartbeat":return{type:"heartbeat"};case"unexpected_error":return{type:"unexpected_error",status:{queue:!0,message:e.message,session_not_found:e.session_not_found,stage:"error",success:!1}};case"broken_connection":return{type:"broken_connection",status:{queue:!0,message:e.message,stage:"error",success:!1}};case"estimation":return{type:"update",status:{queue:!0,stage:t||"pending",code:e.code,size:e.queue_size,position:e.rank,eta:e.rank_eta,success:e.success}};case"progress":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,progress_data:e.progress_data,success:e.success}};case"log":return{type:"log",data:e};case"process_generating":return{type:"generating",status:{queue:!0,message:e.success?null:e.output.error,stage:e.success?"generating":"error",code:e.code,progress_data:e.progress_data,eta:e.average_duration,changed_state_ids:e.success?e.output.changed_state_ids:void 0},data:e.success?e.output:null};case"process_streaming":return{type:"streaming",status:{queue:!0,message:e.output.error,stage:"streaming",time_limit:e.time_limit,code:e.code,progress_data:e.progress_data,eta:e.eta},data:e.output};case"process_completed":return"error"in e.output?{type:"update",status:{queue:!0,title:e.output.title,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 ui=(e=[],t)=>{const r=t?t.parameters:[];if(Array.isArray(e))return t&&r.length>0&&e.length>r.length&&console.warn("Too many arguments provided for the endpoint."),e;const n=[],i=Object.keys(e);return r.forEach((o,s)=>{if(e.hasOwnProperty(o.parameter_name))n[s]=e[o.parameter_name];else if(o.parameter_has_default)n[s]=o.parameter_default;else throw new Error(`No value provided for required parameter: ${o.parameter_name}`)}),i.forEach(o=>{if(!r.some(s=>s.parameter_name===o))throw new Error(`Parameter \`${o}\` is not a valid keyword argument. Please refer to the API for usage.`)}),n.forEach((o,s)=>{if(o===void 0&&!r[s].parameter_has_default)throw new Error(`No value provided for required parameter: ${r[s].parameter_name}`)}),n};async function li(){if(this.api_info)return this.api_info;const{hf_token:e}=this.options,{config:t}=this,r={"Content-Type":"application/json"};if(e&&(r.Authorization=`Bearer ${e}`),!!t)try{let n,i;if(typeof window<"u"&&window.gradio_api_info)i=window.gradio_api_info;else{if(vr(t?.version||"2.0.0","3.30")<0)n=await this.fetch(zn,{method:"POST",body:JSON.stringify({serialize:!1,config:JSON.stringify(t)}),headers:r,credentials:"include"});else{const o=Pr(t.root,this.api_prefix,Mn);n=await this.fetch(o,{headers:r,credentials:"include"})}if(!n.ok)throw new Error(de);i=await n.json()}return"api"in i&&(i=i.api),i.named_endpoints["/predict"]&&!i.unnamed_endpoints[0]&&(i.unnamed_endpoints[0]=i.named_endpoints["/predict"]),oi(i,t,this.api_map)}catch(n){throw new Error("Could not get API info. "+n.message)}}async function ci(e,t,r){const n={};this?.options?.hf_token&&(n.Authorization=`Bearer ${this.options.hf_token}`);const i=1e3,o=[];let s;for(let a=0;a<t.length;a+=i){const c=t.slice(a,a+i),u=new FormData;c.forEach(f=>{u.append("files",f)});try{const f=r?`${e}${this.api_prefix}/${jt}?upload_id=${r}`:`${e}${this.api_prefix}/${jt}`;s=await this.fetch(f,{method:"POST",body:u,headers:n,credentials:"include"})}catch(f){throw new Error(de+f.message)}if(!s.ok){const f=await s.text();return{error:`HTTP ${s.status}: ${f}`}}const l=await s.json();l&&o.push(...l)}return{files:o}}async function hi(e,t,r,n){let i=(Array.isArray(e)?e:[e]).map(s=>s.blob);const o=i.filter(s=>s.size>(n??1/0));if(o.length)throw new Error(`File size exceeds the maximum allowed size of ${n} bytes: ${o.map(s=>s.name).join(", ")}`);return await Promise.all(await this.upload_files(t,i,r).then(async s=>{if(s.error)throw new Error(s.error);return s.files?s.files.map((a,c)=>new Ze({...e[c],path:a,url:`${t}${this.api_prefix}/file=${a}`})):[]}))}async function ra(e,t){return e.map(r=>new Ze({path:r.name,orig_name:r.name,blob:r,size:r.size,mime_type:r.type,is_stream:t}))}class Ze{path;url;orig_name;size;blob;is_stream;mime_type;alt_text;b64;meta={_type:"gradio.FileData"};constructor({path:t,url:r,orig_name:n,size:i,blob:o,is_stream:s,mime_type:a,alt_text:c,b64:u}){this.path=t,this.url=r,this.orig_name=n,this.size=i,this.blob=r?void 0:o,this.is_stream=s,this.mime_type=a,this.alt_text=c,this.b64=u}}class fi{type;command;meta;fileData;constructor(t,r){this.type="command",this.command=t,this.meta=r}}typeof process<"u"&&process.versions&&process.versions.node;function Gt(e,t,r){for(;r.length>1;){const i=r.shift();if(typeof i=="string"||typeof i=="number")e=e[i];else throw new Error("Invalid key type")}const n=r.shift();if(typeof n=="string"||typeof n=="number")e[n]=t;else throw new Error("Invalid key type")}async function _t(e,t=void 0,r=[],n=!1,i=void 0){if(Array.isArray(e)){let o=[];return await Promise.all(e.map(async(s,a)=>{let c=r.slice();c.push(String(a));const u=await _t(e[a],n?i?.parameters[a]?.component||void 0:t,c,!1,i);o=o.concat(u)})),o}else{if(globalThis.Buffer&&e instanceof globalThis.Buffer||e instanceof Blob)return[{path:r,blob:new Blob([e]),type:t}];if(typeof e=="object"&&e!==null){let o=[];for(const s of Object.keys(e)){const a=[...r,s],c=e[s];o=o.concat(await _t(c,void 0,a,!1,i))}return o}}return[]}function pi(e,t){let r=t?.dependencies?.find(n=>n.id==e)?.queue;return r!=null?!r:!t.enable_queue}function _i(e,t){return new Promise((r,n)=>{const i=new MessageChannel;i.port1.onmessage=({data:o})=>{i.port1.close(),r(o)},window.parent.postMessage(e,t,[i.port2])})}function Re(e,t,r,n,i=!1){if(n==="input"&&!i)throw new Error("Invalid code path. Cannot skip state inputs for input.");if(n==="output"&&i)return e;let o=[],s=0;const a=n==="input"?t.inputs:t.outputs;for(let c=0;c<a.length;c++){const u=a[c];if(r.find(f=>f.id===u)?.type==="state"){if(i)if(e.length===a.length){const f=e[s];o.push(f),s++}else o.push(null);else{s++;continue}continue}else{const f=e[s];o.push(f),s++}}return o}async function di(e,t,r){const n=this;await mi(n,t);const i=await _t(t,void 0,[],!0,r);return(await Promise.all(i.map(async({path:s,blob:a,type:c})=>{if(!a)return{path:s,type:c};const u=await n.upload_files(e,[a]),l=u.files&&u.files[0];return{path:s,file_url:l,type:c,name:typeof File<"u"&&a instanceof File?a?.name:void 0}}))).forEach(({path:s,file_url:a,type:c,name:u})=>{if(c==="Gallery")Gt(t,a,s);else if(a){const l=new Ze({path:a,orig_name:u});Gt(t,l,s)}}),t}async function mi(e,t){if(!(e.config?.root||e.config?.root_url))throw new Error(Sr);await Lr(e,t)}async function Lr(e,t,r=[]){for(const n in t)t[n]instanceof fi?await gi(e,t,n):typeof t[n]=="object"&&t[n]!==null&&await Lr(e,t[n],[...r,n])}async function gi(e,t,r){let n=t[r];const i=e.config?.root||e.config?.root_url;if(!i)throw new Error(Sr);try{let o,s;if(typeof process<"u"&&process.versions&&process.versions.node){const l=await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(p=>p._),[],import.meta.url);s=(await h(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(p=>p._),[],import.meta.url)).resolve(process.cwd(),n.meta.path),o=await l.readFile(s)}else throw new Error(Qn);const a=new Blob([o],{type:"application/octet-stream"}),c=await e.upload_files(i,[a]),u=c.files&&c.files[0];if(u){const l=new Ze({path:u,orig_name:n.meta.name||""});t[r]=l}}catch(o){console.error(Yn,o)}}async function bi(e,t,r){const n={"Content-Type":"application/json"};this.options.hf_token&&(n.Authorization=`Bearer ${this.options.hf_token}`);try{var i=await this.fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...n,...r},credentials:"include"})}catch{return[{error:de},500]}let o,s;try{o=await i.json(),s=i.status}catch(a){o={error:`Could not parse server response: ${a}`},s=500}return[o,s]}async function yi(e,t={}){let r=!1,n=!1;if(!this.config)throw new Error("Could not resolve app config");if(typeof e=="number")this.config.dependencies.find(i=>i.id==e);else{const i=e.replace(/^\//,"");this.config.dependencies.find(o=>o.id==this.api_map[i])}return new Promise(async(i,o)=>{const s=this.submit(e,t,null,null,!0);let a;for await(const c of s)c.type==="data"&&(n&&i(a),r=!0,a=c),c.type==="status"&&(c.stage==="error"&&o(c),c.stage==="complete"&&(n=!0,r&&i(a)))})}async function He(e,t,r){let n=t==="subdomain"?`https://huggingface.co/api/spaces/by-subdomain/${e}`:`https://huggingface.co/api/spaces/${e}`,i,o;try{if(i=await fetch(n),o=i.status,o!==200)throw new Error;i=await i.json()}catch{r({status:"error",load_status:"error",message:qn,detail:"NOT_FOUND"});return}if(!i||o!==200)return;const{runtime:{stage:s},id:a}=i;switch(s){case"STOPPED":case"SLEEPING":r({status:"sleeping",load_status:"pending",message:"Space is asleep. Waking it up...",detail:s}),setTimeout(()=>{He(e,t,r)},1e3);break;case"PAUSED":r({status:"paused",load_status:"error",message:"This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",detail:s,discussions_enabled:await Ft(a)});break;case"RUNNING":case"RUNNING_BUILDING":r({status:"running",load_status:"complete",message:"Space is running.",detail:s});break;case"BUILDING":r({status:"building",load_status:"pending",message:"Space is building...",detail:s}),setTimeout(()=>{He(e,t,r)},1e3);break;case"APP_STARTING":r({status:"starting",load_status:"pending",message:"Space is starting...",detail:s}),setTimeout(()=>{He(e,t,r)},1e3);break;default:r({status:"space_error",load_status:"error",message:"This space is experiencing an issue.",detail:s,discussions_enabled:await Ft(a)});break}}const Rr=async(e,t)=>{let r=0;const n=12,i=5e3;return new Promise(o=>{He(e,Ot.test(e)?"space_name":"subdomain",s=>{t(s),s.status==="running"||s.status==="error"||s.status==="paused"||s.status==="space_error"?o():(s.status==="sleeping"||s.status==="building")&&(r<n?(r++,setTimeout(()=>{Rr(e,t).then(o)},i)):o())})})},Ei=/^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;async function Ft(e){try{const t=await fetch(`https://huggingface.co/api/spaces/${e}/discussions`,{method:"HEAD"}),r=t.headers.get("x-error-message");return!(!t.ok||r&&Ei.test(r))}catch{return!1}}async function vi(e,t){const r={};t&&(r.Authorization=`Bearer ${t}`);try{const n=await fetch(`https://huggingface.co/api/spaces/${e}/${kn}`,{headers:r});if(n.status!==200)throw new Error("Space hardware could not be obtained.");const{hardware:i}=await n.json();return i.current}catch(n){throw new Error(n.message)}}async function wi(e,t,r){const n={};r&&(n.Authorization=`Bearer ${r}`);const i={seconds:t};try{const o=await fetch(`https://huggingface.co/api/spaces/${e}/${Un}`,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(i)});if(o.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 o.json()}catch(o){throw new Error(o.message)}}const zt=["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 xi(e,t){const{hf_token:r,private:n,hardware:i,timeout:o,auth:s}=t;if(i&&!zt.includes(i))throw new Error(`Invalid hardware type provided. Valid types are: ${zt.map(S=>`"${S}"`).join(",")}.`);const{http_protocol:a,host:c}=await Je(e,r);let u=null;if(s){const S=await Ar(a,c,s,fetch);S&&(u=Or(S))}const l={Authorization:`Bearer ${r}`,"Content-Type":"application/json",...u?{Cookie:u.join("; ")}:{}},f=(await(await fetch("https://huggingface.co/api/whoami-v2",{headers:l})).json()).name,p=e.split("/")[1],m={repository:`${f}/${p}`};n&&(m.private=!0);let _;try{i||(_=await vi(e,r))}catch(S){throw Error(At+S.message)}const L=i||_||"cpu-basic";m.hardware=L;try{const S=await fetch(`https://huggingface.co/api/spaces/${e}/duplicate`,{method:"POST",headers:l,body:JSON.stringify(m)});if(S.status===409)try{return await Fe.connect(`${f}/${p}`,t)}catch(B){throw console.error("Failed to connect Client instance:",B),B}else if(S.status!==200)throw new Error(S.statusText);const V=await S.json();return await wi(`${f}/${p}`,o||300,r),await Fe.connect(Ti(V.url),t)}catch(S){throw new Error(S)}}function Ti(e){const t=/https:\/\/huggingface.co\/spaces\/([^/]+\/[^/]+)/,r=e.match(t);if(r)return r[1]}class Si extends TransformStream{#e="";constructor(t={allowCR:!1}){super({transform:(r,n)=>{for(r=this.#e+r;;){const i=r.indexOf(`
3`),o=t.allowCR?r.indexOf("\r"):-1;if(o!==-1&&o!==r.length-1&&(i===-1||i-1>o)){n.enqueue(r.slice(0,o)),r=r.slice(o+1);continue}if(i===-1)break;const s=r[i-1]==="\r"?i-1:i;n.enqueue(r.slice(0,s)),r=r.slice(i+1)}this.#e=r},flush:r=>{if(this.#e==="")return;const n=t.allowCR&&this.#e.endsWith("\r")?this.#e.slice(0,-1):this.#e;r.enqueue(n)}})}}function Ai(e){let t=new TextDecoderStream,r=new Si({allowCR:!0});return e.pipeThrough(t).pipeThrough(r)}function Oi(e){let r=/[:]\s*/.exec(e),n=r&&r.index;if(n)return[e.substring(0,n),e.substring(n+r[0].length)]}function qt(e,t,r){e.get(t)||e.set(t,r)}async function*Pi(e,t){if(!e.body)return;let r=Ai(e.body),n,i=r.getReader(),o;for(;;){if(t&&t.aborted)return i.cancel();if(n=await i.read(),n.done)return;if(!n.value){o&&(yield o),o=void 0;continue}let[s,a]=Oi(n.value)||[];s&&(s==="data"?(o||={},o[s]=o[s]?o[s]+`
4`+a:a):s==="event"?(o||={},o[s]=a):s==="id"?(o||={},o[s]=+a||a):s==="retry"&&(o||={},o[s]=+a||void 0))}}async function Li(e,t){let r=new Request(e,t);qt(r.headers,"Accept","text/event-stream"),qt(r.headers,"Content-Type","application/json");let n=await fetch(r);if(!n.ok)throw n;return Pi(n,r.signal)}async function Ri(){let{event_callbacks:e,unclosed_events:t,pending_stream_messages:r,stream_status:n,config:i,jwt:o}=this;const s=this;if(!i)throw new Error("Could not resolve app config");n.open=!0;let a=null,c=new URLSearchParams({session_hash:this.session_hash}).toString(),u=new URL(`${i.root}${this.api_prefix}/${wr}?${c}`);if(o&&u.searchParams.set("__sign",o),a=this.stream(u),!a){console.warn("Cannot connect to SSE endpoint: "+u.toString());return}a.onmessage=async function(l){let f=JSON.parse(l.data);if(f.msg==="close_stream"){Pt(n,s.abort_controller);return}const p=f.event_id;if(!p)await Promise.all(Object.keys(e).map(m=>e[m](f)));else if(e[p]&&i){f.msg==="process_completed"&&["sse","sse_v1","sse_v2","sse_v2.1","sse_v3"].includes(i.protocol)&&t.delete(p);let m=e[p];typeof window<"u"&&typeof document<"u"?setTimeout(m,0,f):m(f)}else r[p]||(r[p]=[]),r[p].push(f)},a.onerror=async function(l){console.error(l),await Promise.all(Object.keys(e).map(f=>e[f]({msg:"broken_connection",message:de})))}}function Pt(e,t){e&&(e.open=!1,t?.abort())}function Ii(e,t,r){!e[t]?(e[t]=[],r.data.forEach((i,o)=>{e[t][o]=i})):r.data.forEach((i,o)=>{let s=Di(e[t][o],i);e[t][o]=s,r.data[o]=s})}function Di(e,t){return t.forEach(([r,n,i])=>{e=Hi(e,n,r,i)}),e}function Hi(e,t,r,n){if(t.length===0){if(r==="replace")return n;if(r==="append")return e+n;throw new Error(`Unsupported action: ${r}`)}let i=e;for(let s=0;s<t.length-1;s++)i=i[t[s]];const o=t[t.length-1];switch(r){case"replace":i[o]=n;break;case"append":i[o]+=n;break;case"add":Array.isArray(i)?i.splice(Number(o),0,n):i[o]=n;break;case"delete":Array.isArray(i)?i.splice(Number(o),1):delete i[o];break;default:throw new Error(`Unknown action: ${r}`)}return e}function Ni(e,t={}){const r={close:()=>{console.warn("Method not implemented.")},onerror:null,onmessage:null,onopen:null,readyState:0,url:e.toString(),withCredentials:!1,CONNECTING:0,OPEN:1,CLOSED:2,addEventListener:()=>{throw new Error("Method not implemented.")},dispatchEvent:()=>{throw new Error("Method not implemented.")},removeEventListener:()=>{throw new Error("Method not implemented.")}};return Li(e,t).then(async n=>{r.readyState=r.OPEN;try{for await(const i of n)r.onmessage&&r.onmessage(i);r.readyState=r.CLOSED}catch(i){r.onerror&&r.onerror(i),r.readyState=r.CLOSED}}).catch(n=>{console.error(n),r.onerror&&r.onerror(n),r.readyState=r.CLOSED}),r}function Ci(e,t={},r,n,i){try{let o=function(I){(i||ie[I.type])&&u(I)},s=function(){for(Le=!0;oe.length>0;)oe.shift()({value:void 0,done:!0})},a=function(I){oe.length>0?oe.shift()(I):ue.push(I)},c=function(I){a(Bi(I)),s()},u=function(I){a({value:I,done:!1})},l=function(){return ue.length>0?Promise.resolve(ue.shift()):new Promise(I=>oe.push(I))};const{hf_token:f}=this.options,{fetch:p,app_reference:m,config:_,session_hash:L,api_info:S,api_map:V,stream_status:B,pending_stream_messages:k,pending_diff_streams:U,event_callbacks:j,unclosed_events:D,post_data:N,options:$,api_prefix:q}=this,be=this;if(!S)throw new Error("No API found");if(!_)throw new Error("Could not resolve app config");let{fn_index:x,endpoint_info:ye,dependency:Q}=Mi(S,e,V,_),et=ui(t,ye),G,ae,y=_.protocol??"ws",w="",v=()=>w;const d=typeof e=="number"?"/predict":e;let g,E=null,b=!1,A={},C=typeof window<"u"&&typeof document<"u"?new URLSearchParams(window.location.search).toString():"";const ie=$?.events?.reduce((I,se)=>(I[se]=!0,I),{})||{};async function Mt(){let I={},se={};y==="ws"?(G&&G.readyState===0?G.addEventListener("open",()=>{G.close()}):G.close(),I={fn_index:x,session_hash:L}):(I={event_id:E},se={event_id:E,session_hash:L,fn_index:x});try{if(!_)throw new Error("Could not resolve app config");"event_id"in se&&await p(`${_.root}${q}/${Gn}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(se)}),await p(`${_.root}${q}/${$n}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(I)})}catch{console.warn("The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.")}}const T=async I=>{await this._resolve_heartbeat(I)};async function X(I){if(!_)return;let se=I.render_id;_.components=[..._.components.filter(W=>W.props.rendered_in!==se),...I.components],_.dependencies=[..._.dependencies.filter(W=>W.rendered_in!==se),...I.dependencies];const je=_.components.some(W=>W.type==="state"),M=_.dependencies.some(W=>W.targets.some(re=>re[1]==="unload"));_.connect_heartbeat=je||M,await T(_),o({type:"render",data:I,endpoint:d,fn_index:x})}this.handle_blob(_.root,et,ye).then(async I=>{if(g={data:Re(I,Q,_.components,"input",!0)||[],event_data:r,fn_index:x,trigger_id:n},pi(x,_))o({type:"status",endpoint:d,stage:"pending",queue:!1,fn_index:x,time:new Date}),N(`${_.root}${q}/run${d.startsWith("/")?d:`/${d}`}${C?"?"+C:""}`,{...g,session_hash:L}).then(([M,W])=>{const re=M.data;W==200?(o({type:"data",endpoint:d,fn_index:x,data:Re(re,Q,_.components,"output",$.with_null_state),time:new Date,event_data:r,trigger_id:n}),M.render_config&&X(M.render_config),o({type:"status",endpoint:d,fn_index:x,stage:"complete",eta:M.average_duration,queue:!1,time:new Date})):o({type:"status",stage:"error",endpoint:d,fn_index:x,message:M.error,queue:!1,time:new Date})}).catch(M=>{o({type:"status",stage:"error",message:M.message,endpoint:d,fn_index:x,queue:!1,time:new Date})});else if(y=="ws"){const{ws_protocol:M,host:W}=await Je(m,f);o({type:"status",stage:"pending",queue:!0,endpoint:d,fn_index:x,time:new Date});let re=new URL(`${M}://${Kn(W,_.root,!0)}/queue/join${C?"?"+C:""}`);this.jwt&&re.searchParams.set("__sign",this.jwt),G=new WebSocket(re),G.onclose=Y=>{Y.wasClean||o({type:"status",stage:"error",broken:!0,message:de,queue:!0,endpoint:d,fn_index:x,time:new Date})},G.onmessage=function(Y){const ne=JSON.parse(Y.data),{type:F,status:J,data:Z}=ot(ne,A[x]);if(F==="update"&&J&&!b)o({type:"status",endpoint:d,fn_index:x,time:new Date,...J}),J.stage==="error"&&G.close();else if(F==="hash"){G.send(JSON.stringify({fn_index:x,session_hash:L}));return}else F==="data"?G.send(JSON.stringify({...g,session_hash:L})):F==="complete"?b=J:F==="log"?o({type:"log",title:Z.title,log:Z.log,level:Z.level,endpoint:d,duration:Z.duration,visible:Z.visible,fn_index:x}):F==="generating"&&o({type:"status",time:new Date,...J,stage:J?.stage,queue:!0,endpoint:d,fn_index:x});Z&&(o({type:"data",time:new Date,data:Re(Z.data,Q,_.components,"output",$.with_null_state),endpoint:d,fn_index:x,event_data:r,trigger_id:n}),b&&(o({type:"status",time:new Date,...b,stage:J?.stage,queue:!0,endpoint:d,fn_index:x}),G.close()))},vr(_.version||"2.0.0","3.6")<0&&addEventListener("open",()=>G.send(JSON.stringify({hash:L})))}else if(y=="sse"){o({type:"status",stage:"pending",queue:!0,endpoint:d,fn_index:x,time:new Date});var je=new URLSearchParams({fn_index:x.toString(),session_hash:L}).toString();let M=new URL(`${_.root}${q}/${wr}?${C?C+"&":""}${je}`);if(this.jwt&&M.searchParams.set("__sign",this.jwt),ae=this.stream(M),!ae)return Promise.reject(new Error("Cannot connect to SSE endpoint: "+M.toString()));ae.onmessage=async function(W){const re=JSON.parse(W.data),{type:Y,status:ne,data:F}=ot(re,A[x]);if(Y==="update"&&ne&&!b)o({type:"status",endpoint:d,fn_index:x,time:new Date,...ne}),ne.stage==="error"&&(ae?.close(),s());else if(Y==="data"){let[J,Z]=await N(`${_.root}${q}/queue/data`,{...g,session_hash:L,event_id:E});Z!==200&&(o({type:"status",stage:"error",message:de,queue:!0,endpoint:d,fn_index:x,time:new Date}),ae?.close(),s())}else Y==="complete"?b=ne:Y==="log"?o({type:"log",title:F.title,log:F.log,level:F.level,endpoint:d,duration:F.duration,visible:F.visible,fn_index:x}):(Y==="generating"||Y==="streaming")&&o({type:"status",time:new Date,...ne,stage:ne?.stage,queue:!0,endpoint:d,fn_index:x});F&&(o({type:"data",time:new Date,data:Re(F.data,Q,_.components,"output",$.with_null_state),endpoint:d,fn_index:x,event_data:r,trigger_id:n}),b&&(o({type:"status",time:new Date,...b,stage:ne?.stage,queue:!0,endpoint:d,fn_index:x}),ae?.close(),s()))}}else if(y=="sse_v1"||y=="sse_v2"||y=="sse_v2.1"||y=="sse_v3"){o({type:"status",stage:"pending",queue:!0,endpoint:d,fn_index:x,time:new Date});let M="";typeof window<"u"&&typeof document<"u"&&(M=window?.location?.hostname);const re=M.includes(".dev.")?`https://moon-${M.split(".")[1]}.dev.spaces.huggingface.tech`:"https://huggingface.co";(typeof window<"u"&&typeof document<"u"&&window.parent!=window&&window.supports_zerogpu_headers?_i("zerogpu-headers",re):Promise.resolve(null)).then(J=>N(`${_.root}${q}/${Cn}?${C}`,{...g,session_hash:L},J)).then(async([J,Z])=>{if(Z===503)o({type:"status",stage:"error",message:xr,queue:!0,endpoint:d,fn_index:x,time:new Date});else if(Z!==200)o({type:"status",stage:"error",broken:!0,message:de,queue:!0,endpoint:d,fn_index:x,time:new Date});else{E=J.event_id,w=E;let kt=async function(tt){try{const{type:K,status:ee,data:te,original_msg:Rn}=ot(tt,A[x]);if(K=="heartbeat")return;if(K==="update"&&ee&&!b)o({type:"status",endpoint:d,fn_index:x,time:new Date,original_msg:Rn,...ee});else if(K==="complete")b=ee;else if(K=="unexpected_error"||K=="broken_connection"){console.error("Unexpected error",ee?.message);const In=K==="broken_connection";o({type:"status",stage:"error",message:ee?.message||"An Unexpected Error Occurred!",queue:!0,endpoint:d,broken:In,session_not_found:ee?.session_not_found,fn_index:x,time:new Date})}else if(K==="log"){o({type:"log",title:te.title,log:te.log,level:te.level,endpoint:d,duration:te.duration,visible:te.visible,fn_index:x});return}else(K==="generating"||K==="streaming")&&(o({type:"status",time:new Date,...ee,stage:ee?.stage,queue:!0,endpoint:d,fn_index:x}),te&&Q.connection!=="stream"&&["sse_v2","sse_v2.1","sse_v3"].includes(y)&&Ii(U,E,te));te&&(o({type:"data",time:new Date,data:Re(te.data,Q,_.components,"output",$.with_null_state),endpoint:d,fn_index:x}),te.render_config&&await X(te.render_config),b&&(o({type:"status",time:new Date,...b,stage:ee?.stage,queue:!0,endpoint:d,fn_index:x}),s())),(ee?.stage==="complete"||ee?.stage==="error")&&(j[E]&&delete j[E],E in U&&delete U[E])}catch(K){console.error("Unexpected client exception",K),o({type:"status",stage:"error",message:"An Unexpected Error Occurred!",queue:!0,endpoint:d,fn_index:x,time:new Date}),["sse_v2","sse_v2.1","sse_v3"].includes(y)&&(Pt(B,be.abort_controller),B.open=!1,s())}};E in k&&(k[E].forEach(tt=>kt(tt)),delete k[E]),j[E]=kt,D.add(E),B.open||await this.open_stream()}})}});let Le=!1;const ue=[],oe=[],Ee={[Symbol.asyncIterator]:()=>Ee,next:l,throw:async I=>(c(I),l()),return:async()=>(s(),l()),cancel:Mt,event_id:v};return Ee}catch(o){throw console.error("Submit function encountered an error:",o),o}}function Bi(e){return{then:(t,r)=>r(e)}}function Mi(e,t,r,n){let i,o,s;if(typeof t=="number")i=t,o=e.unnamed_endpoints[i],s=n.dependencies.find(a=>a.id==t);else{const a=t.replace(/^\//,"");i=r[a],o=e.named_endpoints[t.trim()],s=n.dependencies.find(c=>c.id==r[a])}if(typeof i!="number")throw new Error("There is no endpoint matching that name of fn_index matching that number.");return{fn_index:i,endpoint_info:o,dependency:s}}class Fe{app_reference;options;deep_link=null;config;api_prefix="";api_info;api_map={};session_hash=Math.random().toString(36).substring(2);jwt=!1;last_status={};cookies=null;stream_status={open:!1};closed=!1;pending_stream_messages={};pending_diff_streams={};event_callbacks={};unclosed_events=new Set;heartbeat_event=null;abort_controller=null;stream_instance=null;current_payload;ws_map={};get_url_config(t=null){if(!this.config)throw new Error(ce);t===null&&(t=window.location.href);const r=s=>s.replace(/^\/+|\/+$/g,"");let n=r(new URL(this.config.root).pathname),i=r(new URL(t).pathname),o;return i.startsWith(n)?o=r(i.substring(n.length)):o="",this.get_page_config(o)}get_page_config(t){if(!this.config)throw new Error(ce);let r=this.config;return t in r.page||(t=""),{...r,current_page:t,layout:r.page[t].layout,components:r.components.filter(n=>r.page[t].components.includes(n.id)),dependencies:this.config.dependencies.filter(n=>r.page[t].dependencies.includes(n.id))}}fetch(t,r){const n=new Headers(r?.headers||{});if(this&&this.cookies&&n.append("Cookie",this.cookies),this&&this.options.headers)for(const i in this.options.headers)n.append(i,this.options.headers[i]);return fetch(t,{...r,headers:n})}stream(t){const r=new 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 this&&this.options.hf_token&&r.append("Authorization",`Bearer ${this.options.hf_token}`),this.abort_controller=new AbortController,this.stream_instance=Ni(t.toString(),{credentials:"include",headers:r,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,r={events:["data"]}){this.app_reference=t,this.deep_link=r.query_params?.deep_link||null,r.events||(r.events=["data"]),this.options=r,this.current_payload={},this.view_api=li.bind(this),this.upload_files=ci.bind(this),this.handle_blob=di.bind(this),this.post_data=bi.bind(this),this.submit=Ci.bind(this),this.predict=yi.bind(this),this.open_stream=Ri.bind(this),this.resolve_config=ti.bind(this),this.resolve_cookies=ni.bind(this),this.upload=hi.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(){this.options.auth&&await this.resolve_cookies(),await this._resolve_config().then(({config:t})=>this._resolve_heartbeat(t)),this.api_info=await this.view_api(),this.api_map=ei(this.config?.dependencies||[])}async _resolve_heartbeat(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 $t(this.config.space_id,this.options.hf_token,this.cookies))),t.space_id&&this.options.hf_token&&(this.jwt=await $t(t.space_id,this.options.hf_token)),this.config&&this.config.connect_heartbeat){const r=new URL(`${this.config.root}${this.api_prefix}/${jn}/${this.session_hash}`);this.jwt&&r.searchParams.set("__sign",this.jwt),this.heartbeat_event||(this.heartbeat_event=this.stream(r))}}static async connect(t,r={events:["data"]}){const n=new this(t,r);return r.session_hash&&(n.session_hash=r.session_hash),await n.init(),n}async reconnect(){const t=new URL(`${this.config.root}${this.api_prefix}/${Fn}`);let r;try{const n=await this.fetch(t);if(!n.ok)throw new Error;r=(await n.json()).app_id}catch{return"broken"}return r!==this.config.app_id?"changed":"connected"}close(){this.closed=!0,Pt(this.stream_status,this.abort_controller)}set_current_payload(t){this.current_payload=t}static async duplicate(t,r={events:["data"]}){return xi(t,r)}async _resolve_config(){const{http_protocol:t,host:r,space_id:n}=await Je(this.app_reference,this.options.hf_token),{status_callback:i}=this.options;n&&i&&await Rr(n,i);let o;try{let s=`${t}//${r}`;if(o=await this.resolve_config(s),!o)throw new Error(ce);return this.config_success(o)}catch(s){if(n&&i)He(n,Ot.test(n)?"space_name":"subdomain",this.handle_space_success);else throw i&&i({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),Error(s)}}async config_success(t){if(this.config=t,this.api_prefix=t.api_prefix||"",this.config.auth_required)return this.prepare_return_obj();try{this.api_info=await this.view_api()}catch(r){console.error(Xn+r.message)}return this.prepare_return_obj()}async handle_space_success(t){if(!this)throw new Error(ce);const{status_callback:r}=this.options;if(r&&r(t),t.status==="running")try{if(this.config=await this._resolve_config(),this.api_prefix=this?.config?.api_prefix||"",!this.config)throw new Error(ce);return await this.config_success(this.config)}catch(n){throw r&&r({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),n}}async component_server(t,r,n){if(!this.config)throw new Error(ce);const i={},{hf_token:o}=this.options,{session_hash:s}=this;o&&(i.Authorization=`Bearer ${this.options.hf_token}`);let a,c=this.config.components.find(l=>l.id===t);c?.props?.root_url?a=c.props.root_url:a=this.config.root;let u;if("binary"in n){u=new FormData;for(const l in n.data)l!=="binary"&&u.append(l,n.data[l]);u.set("component_id",t.toString()),u.set("fn_name",r),u.set("session_hash",s)}else u=JSON.stringify({data:n,component_id:t,fn_name:r,session_hash:s}),i["Content-Type"]="application/json";o&&(i.Authorization=`Bearer ${o}`);try{const l=await this.fetch(`${a}${this.api_prefix}/${Vn}/`,{method:"POST",body:u,headers:i,credentials:"include"});if(!l.ok)throw new Error("Could not connect to component server: "+l.statusText);return await l.json()}catch(l){console.warn(l)}}set_cookies(t){this.cookies=Or(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((r,n)=>{let i;try{i=new WebSocket(t)}catch{this.ws_map[t]="failed";return}this.ws_map[t]="pending",i.onopen=()=>{this.ws_map[t]=i,r()},i.onerror=o=>{console.error("WebSocket error:",o),this.close_ws(t),this.ws_map[t]="failed",r()},i.onclose=()=>{this.ws_map[t]="closed"},i.onmessage=o=>{}})}async send_ws_message(t,r){if(!(t in this.ws_map))await this.connect_ws(t);else if(this.ws_map[t]==="pending"||this.ws_map[t]==="closed"||this.ws_map[t]==="failed")return;const n=this.ws_map[t];n instanceof WebSocket?n.send(JSON.stringify(r)):this.post_data(t,r)}async close_ws(t){if(t in this.ws_map){const r=this.ws_map[t];r instanceof WebSocket&&(r.close(),delete this.ws_map[t])}}}function we(){}const na=e=>e;function ia(e,t){for(const r in t)e[r]=t[r];return e}function ki(e){return e()}function Ui(e){e.forEach(ki)}function ji(e){return typeof e=="function"}function Vi(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Ir(e,...t){if(e==null){for(const n of t)n(void 0);return we}const r=e.subscribe(...t);return r.unsubscribe?()=>r.unsubscribe():r}function Dr(e){let t;return Ir(e,r=>t=r)(),t}function oa(e){const t=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}const ve=[];function $i(e,t){return{subscribe:fe(e,t).subscribe}}function fe(e,t=we){let r;const n=new Set;function i(a){if(Vi(e,a)&&(e=a,r)){const c=!ve.length;for(const u of n)u[1](),ve.push(u,e);if(c){for(let u=0;u<ve.length;u+=2)ve[u][0](ve[u+1]);ve.length=0}}}function o(a){i(a(e))}function s(a,c=we){const u=[a,c];return n.add(u),n.size===1&&(r=t(i,o)||we),a(e),()=>{n.delete(u),n.size===0&&r&&(r(),r=null)}}return{set:i,update:o,subscribe:s}}function me(e,t,r){const n=!Array.isArray(e),i=n?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const o=t.length<2;return $i(r,(s,a)=>{let c=!1;const u=[];let l=0,f=we;const p=()=>{if(l)return;f();const _=t(n?u[0]:u,s,a);o?s(_):f=ji(_)?_:we},m=i.map((_,L)=>Ir(_,S=>{u[L]=S,l&=~(1<<L),c&&p()},()=>{l|=1<<L}));return c=!0,p(),function(){Ui(m),f(),c=!1}})}var sa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function aa(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Fi=function(t){return zi(t)&&!qi(t)};function zi(e){return!!e&&typeof e=="object"}function qi(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Ji(e)}var Xi=typeof Symbol=="function"&&Symbol.for,Wi=Xi?Symbol.for("react.element"):60103;function Ji(e){return e.$$typeof===Wi}function Zi(e){return Array.isArray(e)?[]:{}}function Me(e,t){return t.clone!==!1&&t.isMergeableObject(e)?xe(Zi(e),e,t):e}function Qi(e,t,r){return e.concat(t).map(function(n){return Me(n,r)})}function Yi(e,t){if(!t.customMerge)return xe;var r=t.customMerge(e);return typeof r=="function"?r:xe}function Ki(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Xt(e){return Object.keys(e).concat(Ki(e))}function Hr(e,t){try{return t in e}catch{return!1}}function eo(e,t){return Hr(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function to(e,t,r){var n={};return r.isMergeableObject(e)&&Xt(e).forEach(function(i){n[i]=Me(e[i],r)}),Xt(t).forEach(function(i){eo(e,i)||(Hr(e,i)&&r.isMergeableObject(t[i])?n[i]=Yi(i,r)(e[i],t[i],r):n[i]=Me(t[i],r))}),n}function xe(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||Qi,r.isMergeableObject=r.isMergeableObject||Fi,r.cloneUnlessOtherwiseSpecified=Me;var n=Array.isArray(t),i=Array.isArray(e),o=n===i;return o?n?r.arrayMerge(e,t,r):to(e,t,r):Me(t,r)}xe.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return xe(n,i,r)},{})};var ro=xe,no=ro;const io=Gi(no);var dt=function(e,t){return dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},dt(e,t)};function Qe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");dt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var R=function(){return R=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},R.apply(this,arguments)};function oo(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function st(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var O;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(O||(O={}));var H;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(H||(H={}));var Te;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Te||(Te={}));function Wt(e){return e.type===H.literal}function so(e){return e.type===H.argument}function Nr(e){return e.type===H.number}function Cr(e){return e.type===H.date}function Br(e){return e.type===H.time}function Mr(e){return e.type===H.select}function kr(e){return e.type===H.plural}function ao(e){return e.type===H.pound}function Ur(e){return e.type===H.tag}function jr(e){return!!(e&&typeof e=="object"&&e.type===Te.number)}function mt(e){return!!(e&&typeof e=="object"&&e.type===Te.dateTime)}var Vr=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,uo=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function lo(e){var t={};return e.replace(uo,function(r){var n=r.length;switch(r[0]){case"G":t.era=n===4?"long":n===5?"narrow":"short";break;case"y":t.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=n===4?"long":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var co=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function ho(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(co).filter(function(p){return p.length>0}),r=[],n=0,i=t;n<i.length;n++){var o=i[n],s=o.split("/");if(s.length===0)throw new Error("Invalid number skeleton");for(var a=s[0],c=s.slice(1),u=0,l=c;u<l.length;u++){var f=l[u];if(f.length===0)throw new Error("Invalid number skeleton")}r.push({stem:a,options:c})}return r}function fo(e){return e.replace(/^(.*?)-/,"")}var Jt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,$r=/^(@+)?(\+|#+)?[rs]?$/g,po=/(\*)(0+)|(#+)(0+)|(0+)/g,Gr=/^(0+)$/;function Zt(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace($r,function(r,n,i){return typeof i!="str
4ing"?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):i==="+"?t.minimumSignificantDigits=n.length:n[0]==="#"?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+(typeof i=="string"?i.length:0)),""}),t}function Fr(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function _o(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if(r==="+!"?(t.signDisplay="always",e=e.slice(2)):r==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Gr.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Qt(e){var t={},r=Fr(e);return r||t}function mo(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=fo(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=R(R(R({},t),{notation:"scientific"}),i.options.reduce(function(c,u){return R(R({},c),Qt(u))},{}));continue;case"engineering":t=R(R(R({},t),{notation:"engineering"}),i.options.reduce(function(c,u){return R(R({},c),Qt(u))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(po,function(c,u,l,f,p,m){if(u)t.minimumIntegerDigits=l.length;else{if(f&&p)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Gr.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Jt.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Jt,function(c,u,l,f,p,m){return l==="*"?t.minimumFractionDigits=u.length:f&&f[0]==="#"?t.maximumFractionDigits=f.length:p&&m?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+m.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var o=i.options[0];o==="w"?t=R(R({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=R(R({},t),Zt(o)));continue}if($r.test(i.stem)){t=R(R({},t),Zt(i.stem));continue}var s=Fr(i.stem);s&&(t=R(R({},t),s));var a=_o(i.stem);a&&(t=R(R({},t),a))}return t}var Ve={"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
vendor: 50,707 bytes, lines 4-9
4:["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 go(e,t){for(var r="",n=0;n<e.length;n++){var i=e.charAt(n);if(i==="j"){for(var o=0;n+1<e.length&&e.charAt(n+1)===i;)o++,n++;var s=1+(o&1),a=o<2?1:3+(o>>1),c="a",u=bo(t);for((u=="H"||u=="k")&&(a=0);a-- >0;)r+=c;for(;s-- >0;)r=u+r}else i==="J"?r+="H":r+=i}return r}function bo(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 r=e.language,n;r!=="root"&&(n=e.maximize().region);var i=Ve[n||""]||Ve[r||""]||Ve["".concat(r,"-001")]||Ve["001"];return i[0]}var at,yo=new RegExp("^".concat(Vr.source,"*")),Eo=new RegExp("".concat(Vr.source,"*$"));function P(e,t){return{start:e,end:t}}var vo=!!String.prototype.startsWith&&"_a".startsWith("a",1),wo=!!String.fromCodePoint,xo=!!Object.fromEntries,To=!!String.prototype.codePointAt,So=!!String.prototype.trimStart,Ao=!!String.prototype.trimEnd,Oo=!!Number.isSafeInteger,Po=Oo?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},gt=!0;try{var Lo=qr("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");gt=((at=Lo.exec("a"))===null||at===void 0?void 0:at[0])==="a"}catch{gt=!1}var Yt=vo?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},bt=wo?String.fromCodePoint:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n="",i=t.length,o=0,s;i>o;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},Kt=xo?Object.fromEntries:function(t){for(var r={},n=0,i=t;n<i.length;n++){var o=i[n],s=o[0],a=o[1];r[s]=a}return r},zr=To?function(t,r){return t.codePointAt(r)}:function(t,r){var n=t.length;if(!(r<0||r>=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Ro=So?function(t){return t.trimStart()}:function(t){return t.replace(yo,"")},Io=Ao?function(t){return t.trimEnd()}:function(t){return t.replace(Eo,"")};function qr(e,t){return new RegExp(e,t)}var yt;if(gt){var er=qr("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");yt=function(t,r){var n;er.lastIndex=r;var i=er.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}}else yt=function(t,r){for(var n=[];;){var i=zr(t,r);if(i===void 0||Xr(i)||Co(i))break;n.push(i),r+=i>=65536?2:1}return bt.apply(void 0,n)};var Do=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.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,r,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:H.pound,location:P(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(O.UNMATCHED_CLOSING_TAG,P(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&Et(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:H.literal,value:"<".concat(i,"/>"),location:P(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Et(this.char()))return this.error(O.INVALID_TAG,P(a,this.clonePosition()));var c=this.clonePosition(),u=this.parseTagName();return i!==u?this.error(O.UNMATCHED_CLOSING_TAG,P(c,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:H.tag,value:i,children:s,location:P(n,this.clonePosition())},err:null}:this.error(O.INVALID_TAG,P(a,this.clonePosition())))}else return this.error(O.UNCLOSED_TAG,P(n,this.clonePosition()))}else return this.error(O.INVALID_TAG,P(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&No(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=P(n,this.clonePosition());return{val:{type:H.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Ho(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 r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return bt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),bt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(O.EXPECT_ARGUMENT_CLOSING_BRACE,P(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(O.EMPTY_ARGUMENT,P(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(O.MALFORMED_ARGUMENT,P(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(O.EXPECT_ARGUMENT_CLOSING_BRACE,P(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:H.argument,value:i,location:P(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(O.EXPECT_ARGUMENT_CLOSING_BRACE,P(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(O.MALFORMED_ARGUMENT,P(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=yt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=P(t,o);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(O.EXPECT_ARGUMENT_TYPE,P(s,c));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;var p=Io(f.val);if(p.length===0)return this.error(O.EXPECT_ARGUMENT_STYLE,P(this.clonePosition(),this.clonePosition()));var m=P(l,this.clonePosition());u={style:p,styleLocation:m}}var _=this.tryParseArgumentClose(i);if(_.err)return _;var L=P(i,this.clonePosition());if(u&&Yt(u?.style,"::",0)){var S=Ro(u.style.slice(2));if(a==="number"){var f=this.parseNumberSkeletonFromString(S,u.styleLocation);return f.err?f:{val:{type:H.number,value:n,location:L,style:f.val},err:null}}else{if(S.length===0)return this.error(O.EXPECT_DATE_TIME_SKELETON,L);var V=S;this.locale&&(V=go(S,this.locale));var p={type:Te.dateTime,pattern:V,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?lo(V):{}},B=a==="date"?H.date:H.time;return{val:{type:B,value:n,location:L,style:p},err:null}}}return{val:{type:a==="number"?H.number:a==="date"?H.date:H.time,value:n,location:L,style:(o=u?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var k=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(O.EXPECT_SELECT_ARGUMENT_OPTIONS,P(k,R({},k)));this.bumpSpace();var U=this.parseIdentifierIfPossible(),j=0;if(a!=="select"&&U.value==="offset"){if(!this.bumpIf(":"))return this.error(O.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,P(this.clonePosition(),this.clonePosition()));this.bumpSpace();var f=this.tryParseDecimalInteger(O.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,O.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(f.err)return f;this.bumpSpace(),U=this.parseIdentifierIfPossible(),j=f.val}var D=this.tryParsePluralOrSelectOptions(t,a,r,U);if(D.err)return D;var _=this.tryParseArgumentClose(i);if(_.err)return _;var N=P(i,this.clonePosition());return a==="select"?{val:{type:H.select,value:n,options:Kt(D.val),location:N},err:null}:{val:{type:H.plural,value:n,options:Kt(D.val),offset:j,pluralType:a==="plural"?"cardinal":"ordinal",location:N},err:null}}default:return this.error(O.INVALID_ARGUMENT_TYPE,P(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(O.EXPECT_ARGUMENT_CLOSING_BRACE,P(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(O.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,P(i,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(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=ho(t)}catch{return this.error(O.INVALID_NUMBER_SKELETON,r)}return{val:{type:Te.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?mo(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,u=i.value,l=i.location;;){if(u.length===0){var f=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var p=this.tryParseDecimalInteger(O.EXPECT_PLURAL_ARGUMENT_SELECTOR,O.INVALID_PLURAL_ARGUMENT_SELECTOR);if(p.err)return p;l=P(f,this.clonePosition()),u=this.message.slice(f.offset,this.offset())}else break}if(c.has(u))return this.error(r==="select"?O.DUPLICATE_SELECT_ARGUMENT_SELECTOR:O.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);u==="other"&&(s=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?O.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:O.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,P(this.clonePosition(),this.clonePosition()));var _=this.parseMessage(t+1,r,n);if(_.err)return _;var L=this.tryParseArgumentClose(m);if(L.err)return L;a.push([u,{value:_.val,location:P(m,this.clonePosition())}]),c.add(u),this.bumpSpace(),o=this.parseIdentifierIfPossible(),u=o.value,l=o.location}return a.length===0?this.error(r==="select"?O.EXPECT_SELECT_ARGUMENT_SELECTOR:O.EXPECT_PLURAL_ARGUMENT_SELECTOR,P(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(O.MISSING_OTHER_CLAUSE,P(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var c=P(i,this.clonePosition());return o?(s*=n,Po(s)?{val:s,err:null}:this.error(r,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 r=zr(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},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(Yt(this.message,t,this.offset())){for(var r=0;r<t.length;r++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var r=this.offset(),n=this.message.indexOf(t,r);return n>=0?(this.bumpTo(n),!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 r=this.offset();if(r===t)break;if(r>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()&&Xr(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function Et(e){return e>=97&&e<=122||e>=65&&e<=90}function Ho(e){return Et(e)||e===47}function No(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 Xr(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Co(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 vt(e){e.forEach(function(t){if(delete t.location,Mr(t)||kr(t))for(var r in t.options)delete t.options[r].location,vt(t.options[r].value);else Nr(t)&&jr(t.style)||(Cr(t)||Br(t))&&mt(t.style)?delete t.style.location:Ur(t)&&vt(t.children)})}function Bo(e,t){t===void 0&&(t={}),t=R({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new Do(e,t).parse();if(r.err){var n=SyntaxError(O[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||vt(r.val),r.val}function ut(e,t){var r=t&&t.cache?t.cache:$o,n=t&&t.serializer?t.serializer:Vo,i=t&&t.strategy?t.strategy:ko;return i(e,{cache:r,serializer:n})}function Mo(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Wr(e,t,r,n){var i=Mo(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function Jr(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function Lt(e,t,r,n,i){return r.bind(t,e,n,i)}function ko(e,t){var r=e.length===1?Wr:Jr;return Lt(e,this,r,t.cache.create(),t.serializer)}function Uo(e,t){return Lt(e,this,Jr,t.cache.create(),t.serializer)}function jo(e,t){return Lt(e,this,Wr,t.cache.create(),t.serializer)}var Vo=function(){return JSON.stringify(arguments)};function Rt(){this.cache=Object.create(null)}Rt.prototype.get=function(e){return this.cache[e]};Rt.prototype.set=function(e,t){this.cache[e]=t};var $o={create:function(){return new Rt}},lt={variadic:Uo,monadic:jo},Se;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Se||(Se={}));var Ye=function(e){Qe(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),tr=function(e){Qe(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Se.INVALID_VALUE,o)||this}return t}(Ye),Go=function(e){Qe(t,e);function t(r,n,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),Se.INVALID_VALUE,i)||this}return t}(Ye),Fo=function(e){Qe(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),Se.MISSING_VALUE,n)||this}return t}(Ye),z;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(z||(z={}));function zo(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==z.literal||r.type!==z.literal?t.push(r):n.value+=r.value,t},[])}function qo(e){return typeof e=="function"}function $e(e,t,r,n,i,o,s){if(e.length===1&&Wt(e[0]))return[{type:z.literal,value:e[0].value}];for(var a=[],c=0,u=e;c<u.length;c++){var l=u[c];if(Wt(l)){a.push({type:z.literal,value:l.value});continue}if(ao(l)){typeof o=="number"&&a.push({type:z.literal,value:r.getNumberFormat(t).format(o)});continue}var f=l.value;if(!(i&&f in i))throw new Fo(f,s);var p=i[f];if(so(l)){(!p||typeof p=="string"||typeof p=="number")&&(p=typeof p=="string"||typeof p=="number"?String(p):""),a.push({type:typeof p=="string"?z.literal:z.object,value:p});continue}if(Cr(l)){var m=typeof l.style=="string"?n.date[l.style]:mt(l.style)?l.style.parsedOptions:void 0;a.push({type:z.literal,value:r.getDateTimeFormat(t,m).format(p)});continue}if(Br(l)){var m=typeof l.style=="string"?n.time[l.style]:mt(l.style)?l.style.parsedOptions:n.time.medium;a.push({type:z.literal,value:r.getDateTimeFormat(t,m).format(p)});continue}if(Nr(l)){var m=typeof l.style=="string"?n.number[l.style]:jr(l.style)?l.style.parsedOptions:void 0;m&&m.scale&&(p=p*(m.scale||1)),a.push({type:z.literal,value:r.getNumberFormat(t,m).format(p)});continue}if(Ur(l)){var _=l.children,L=l.value,S=i[L];if(!qo(S))throw new Go(L,"function",s);var V=$e(_,t,r,n,i,o),B=S(V.map(function(j){return j.value}));Array.isArray(B)||(B=[B]),a.push.apply(a,B.map(function(j){return{type:typeof j=="string"?z.literal:z.object,value:j}}))}if(Mr(l)){var k=l.options[p]||l.options.other;if(!k)throw new tr(l.value,p,Object.keys(l.options),s);a.push.apply(a,$e(k.value,t,r,n,i));continue}if(kr(l)){var k=l.options["=".concat(p)];if(!k){if(!Intl.PluralRules)throw new Ye(`Intl.PluralRules is not available in this environment.
5Try polyfilling it using "@formatjs/intl-pluralrules"
6`,Se.MISSING_INTL_API,s);var U=r.getPluralRules(t,{type:l.pluralType}).select(p-(l.offset||0));k=l.options[U]||l.options.other}if(!k)throw new tr(l.value,p,Object.keys(l.options),s);a.push.apply(a,$e(k.value,t,r,n,i,p-(l.offset||0)));continue}}return zo(a)}function Xo(e,t){return t?R(R(R({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=R(R({},e[n]),t[n]||{}),r},{})):e}function Wo(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=Xo(e[n],t[n]),r},R({},e)):e}function ct(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function Jo(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:ut(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.NumberFormat).bind.apply(t,st([void 0],r,!1)))},{cache:ct(e.number),strategy:lt.variadic}),getDateTimeFormat:ut(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.DateTimeFormat).bind.apply(t,st([void 0],r,!1)))},{cache:ct(e.dateTime),strategy:lt.variadic}),getPluralRules:ut(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.PluralRules).bind.apply(t,st([void 0],r,!1)))},{cache:ct(e.pluralRules),strategy:lt.variadic})}}var Zr=function(){function e(t,r,n,i){var o=this;if(r===void 0&&(r=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(c){var u=o.formatToParts(c);if(u.length===1)return u[0].value;var l=u.reduce(function(f,p){return!f.length||p.type!==z.literal||typeof f[f.length-1]!="string"?f.push(p.value):f[f.length-1]+=p.value,f},[]);return l.length<=1?l[0]||"":l},this.formatToParts=function(c){return $e(o.ast,o.locales,o.formatters,o.formats,c,void 0,o.message)},this.resolvedOptions=function(){var c;return{locale:((c=o.resolvedLocale)===null||c===void 0?void 0:c.toString())||Intl.NumberFormat.supportedLocalesOf(o.locales)[0]}},this.getAst=function(){return o.ast},this.locales=r,this.resolvedLocale=e.resolveLocale(r),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=i||{};s.formatters;var a=oo(s,["formatters"]);this.ast=e.__parse(t,R(R({},a),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Wo(e.formats,n),this.formatters=i&&i.formatters||Jo(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(!(typeof Intl.Locale>"u")){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Bo,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 Zo(e,t){if(t==null)return;if(t in e)return e[t];const r=t.split(".");let n=e;for(let i=0;i<r.length;i++)if(typeof n=="object"){if(i>0){const o=r.slice(i,r.length).join(".");if(o in n){n=n[o];break}}n=n[r[i]]}else n=void 0;return n}const he={},Qo=(e,t,r)=>r&&(t in he||(he[t]={}),e in he[t]||(he[t][e]=r),r),Qr=(e,t)=>{if(t==null)return;if(t in he&&e in he[t])return he[t][e];const r=Ue(t);for(let n=0;n<r.length;n++){const i=r[n],o=Ko(i,e);if(o)return Qo(e,t,o)}};let It;const Oe=fe({});function Yo(e){return It[e]||null}function Dt(e){return e in It}function Ko(e,t){if(!Dt(e))return null;const r=Yo(e);return Zo(r,t)}function es(e){if(e==null)return;const t=Ue(e);for(let r=0;r<t.length;r++){const n=t[r];if(Dt(n))return n}}function Ge(e,...t){delete he[e],Oe.update(r=>(r[e]=io.all([r[e]||{},...t]),r))}me([Oe],([e])=>Object.keys(e));Oe.subscribe(e=>It=e);const Ne={};function ts(e){Ne[e]=new Set}function rs(e,t){Ne[e].delete(t),Ne[e].size===0&&delete Ne[e]}function Ce(e){return Ne[e]}function ns(e){return Ue(e).map(t=>{const r=Ce(t);return[t,r?[...r]:[]]}).filter(([,t])=>t.length>0)}function ze(e){return e==null?!1:Ue(e).some(t=>{var r;return(r=Ce(t))==null?void 0:r.size})}function is(e,t){return Promise.all(t.map(n=>(rs(e,n),n().then(i=>i.default||i)))).then(n=>Ge(e,...n))}const Ie={};function Yr(e){if(!ze(e))return e in Ie?Ie[e]:Promise.resolve();const t=ns(e);return Ie[e]=Promise.all(t.map(([r,n])=>is(r,n))).then(()=>{if(ze(e))return Yr(e);delete Ie[e]}),Ie[e]}function os(e,t){Ce(e)||ts(e);const r=Ce(e);Ce(e).has(t)||(Dt(e)||Oe.update(n=>(n[e]={},n)),r.add(t))}var rr=Object.getOwnPropertySymbols,ss=Object.prototype.hasOwnProperty,as=Object.prototype.propertyIsEnumerable,us=(e,t)=>{var r={};for(var n in e)ss.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rr)for(var n of rr(e))t.indexOf(n)<0&&as.call(e,n)&&(r[n]=e[n]);return r};const ls={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 cs({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${Ue(e).join('", "')}".${ze(pe())?`
7
8Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const hs={fallbackLocale:null,loadingDelay:200,formats:ls,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},De=hs;function Ae(){return De}function fs(e){const t=e,{formats:r}=t,n=us(t,["formats"]);let i=e.fallbackLocale;if(e.initialLocale)try{Zr.resolveLocale(e.initialLocale)&&(i=e.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${e.initialLocale}" is not a valid locale.`)}return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=cs:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(De,n,{initialLocale:i}),r&&("number"in r&&Object.assign(De.formats.number,r.number),"date"in r&&Object.assign(De.formats.date,r.date),"time"in r&&Object.assign(De.formats.time,r.time)),ge.set(i)}const ht=fe(!1);var ps=Object.defineProperty,_s=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,nr=Object.getOwnPropertySymbols,ms=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,ir=(e,t,r)=>t in e?ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bs=(e,t)=>{for(var r in t||(t={}))ms.call(t,r)&&ir(e,r,t[r]);if(nr)for(var r of nr(t))gs.call(t,r)&&ir(e,r,t[r]);return e},ys=(e,t)=>_s(e,ds(t));let wt;const qe=fe(null);function or(e){return e.split("-").map((t,r,n)=>n.slice(0,r+1).join("-")).reverse()}function Ue(e,t=Ae().fallbackLocale){const r=or(e);return t?[...new Set([...r,...or(t)])]:r}function pe(){return wt??void 0}qe.subscribe(e=>{wt=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const Es=e=>{if(e&&es(e)&&ze(e)){const{loadingDelay:t}=Ae();let r;return typeof window<"u"&&pe()!=null&&t?r=window.setTimeout(()=>ht.set(!0),t):ht.set(!0),Yr(e).then(()=>{qe.set(e)}).finally(()=>{clearTimeout(r),ht.set(!1)})}return qe.set(e)},ge=ys(bs({},qe),{set:Es}),vs=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],Ke=e=>{const t=Object.create(null);return n=>{const i=JSON.stringify(n);return i in t?t[i]:t[i]=e(n)}};var ws=Object.defineProperty,Xe=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable,sr=(e,t,r)=>t in e?ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ht=(e,t)=>{for(var r in t||(t={}))Kr.call(t,r)&&sr(e,r,t[r]);if(Xe)for(var r of Xe(t))en.call(t,r)&&sr(e,r,t[r]);return e},Pe=(e,t)=>{var r={};for(var n in e)Kr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xe)for(var n of Xe(e))t.indexOf(n)<0&&en.call(e,n)&&(r[n]=e[n]);return r};const ke=(e,t)=>{const{formats:r}=Ae();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},xs=Ke(e=>{var t=e,{locale:r,format:n}=t,i=Pe(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(i=ke("number",n)),new Intl.NumberFormat(r,i)}),Ts=Ke(e=>{var t=e,{locale:r,format:n}=t,i=Pe(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?i=ke("date",n):Object.keys(i).length===0&&(i=ke("date","short")),new Intl.DateTimeFormat(r,i)}),Ss=Ke(e=>{var t=e,{locale:r,format:n}=t,i=Pe(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?i=ke("time",n):Object.keys(i).length===0&&(i=ke("time","short")),new Intl.DateTimeFormat(r,i)}),As=(e={})=>{var t=e,{locale:r=pe()}=t,n=Pe(t,["locale"]);return xs(Ht({locale:r},n))},Os=(e={})=>{var t=e,{locale:r=pe()}=t,n=Pe(t,["locale"]);return Ts(Ht({locale:r},n))},Ps=(e={})=>{var t=e,{locale:r=pe()}=t,n=Pe(t,["locale"]);return Ss(Ht({locale:r},n))},Ls=Ke((e,t=pe())=>new Zr(e,t,Ae().formats,{ignoreTag:Ae().ignoreTag})),Rs=(e,t={})=>{var r,n,i,o;let s=t;typeof e=="object"&&(s=e,e=s.id);const{values:a,locale:c=pe(),default:u}=s;if(c==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let l=Qr(e,c);if(!l)l=(o=(i=(n=(r=Ae()).handleMissingMessage)==null?void 0:n.call(r,{locale:c,id:e,defaultValue:u}))!=null?i:u)!=null?o:e;else if(typeof l!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof l}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),l;if(!a)return l;let f=l;try{f=Ls(l,c).format(a)}catch(p){p instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,p.message)}return f},Is=(e,t)=>Ps(t).format(e),Ds=(e,t)=>Os(t).format(e),Hs=(e,t)=>As(t).format(e),Ns=(e,t=pe())=>Qr(e,t),tn=me([ge,Oe],()=>Rs);me([ge],()=>Is);me([ge],()=>Ds);me([ge],()=>Hs);me([ge,Oe],()=>Ns);let rn=!1;typeof window<"u"&&"attachShadow"in Element.prototype&&"adoptedStyleSheets"in Document.prototype&&(rn="adoptedStyleSheets"in document.createElement("div").attachShadow({mode:"open"}));function ar(e,t){const r=new URL(import.meta.url).origin;var n=e;if(window.location.origin!==r&&(n=new URL(e,r).href),document.querySelector(`link[href='${n}']`))return Promise.resolve();const o=document.createElement("link");return o.rel="stylesheet",o.href=n,new Promise((s,a)=>{o.addEventListener("load",()=>s()),o.addEventListener("error",()=>{console.error(`Unable to preload CSS for ${n}`),s()}),t.appendChild(o)})}function ua(e,t,r){if(!rn)return e;r||(r=document.createElement("style")),r.remove();const n=new CSSStyleSheet;n.replaceSync(e);let i="";e=e.replace(/@import\s+url\((.*?)\);\s*/g,(c,u)=>(i+=`@import url(${u});
9`,""));const o=n.cssRules;let s="",a=`.gradio-container.gradio-container-${t} .contain `;for(let c=0;c<o.length;c++){const u=o[c];let l=u.cssText.includes(".dark");if(u instanceof CSSStyleRule){const f=u.selectorText;if(f){const p=f.replace(".dark","").split(",").map(m=>`${l?".dark":""} ${a} ${m.trim()} `).join(",");s+=u.cssText,s+=u.cssText.replace(f,p)}}else if(u instanceof CSSMediaRule){let f=`@media ${u.media.mediaText} {`;for(let p=0;p<u.cssRules.length;p++){const m=u.cssRules[p];if(m instanceof CSSStyleRule){let _=m.cssText.includes(".dark ");const L=m.selectorText,S=L.replace(".dark","").split(",").map(V=>`${_?".dark":""} ${a} ${V.trim()} `).join(",");f+=m.cssText.replace(L,S)}}f+="}",s+=f}else if(u instanceof CSSKeyframesRule){s+=`@keyframes ${u.name} {`;for(let f=0;f<u.cssRules.length;f++){const p=u.cssRules[f];p instanceof CSSKeyframeRule&&(s+=`${p.keyText} { ${p.style.cssText} }`)}s+="}"}else u instanceof CSSFontFaceRule&&(s+=`@font-face { ${u.style.cssText} }`)}return i+s}var ur=Object.prototype.hasOwnProperty;function lr(e,t,r){for(r of e.keys())if(Be(r,t))return r}function Be(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&Be(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(i=n,i&&typeof i=="object"&&(i=lr(t,i),!i)||!t.has(i))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(i=n[0],i&&typeof i=="object"&&(i=lr(t,i),!i)||!Be(n[1],t.get(i)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(ur.call(e,r)&&++n&&!ur.call(t,r)||!(r in t)||!Be(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}const Cs={accordion:{component:()=>h(()=>import("./Index-BZCxldx4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)},annotatedimage:{component:()=>h(()=>import("./Index-wtmxIslC.js"),__vite__mapDeps([14,1,2,3,4,5,15,16,17,18,19,9,6,7,8,10,20,21,22,23]),import.meta.url)},audio:{base:()=>h(()=>import("./StaticAudio-CEEuz0kn.js"),__vite__mapDeps([24,25,3,4,5,15,2,9,16,26,27,28,29,18,30,31,32,33,20,21,22,34,35,36]),import.meta.url),example:()=>h(()=>import("./Example-BQyGztrG.js"),__vite__mapDeps([37,38]),import.meta.url),component:()=>h(()=>import("./index-DbAp2Rgu.js"),__vite__mapDeps([39,24,25,3,4,5,15,2,9,16,26,27,28,29,18,30,31,32,33,20,21,22,34,35,36,40,41,42,43,10,44,45,7,8,46,47,6,1,48,37,38]),import.meta.url)},box:{component:()=>h(()=>import("./Index-CuHioI51.js"),__vite__mapDeps([49,1,2,3,4,5]),import.meta.url)},browserstate:{component:()=>h(()=>import("./Index-COCIsOdf.js"),__vite__mapDeps([50,51]),import.meta.url)},button:{component:()=>h(()=>import("./Index-FxnluDmK.js"),__vite__mapDeps([52,53,54,20,21,22,55,3,4,5,56,2,57]),import.meta.url)},chatbot:{component:()=>h(()=>import("./Index-CB1YfUW4.js"),__vite__mapDeps([58,25,54,20,21,22,55,3,4,5,9,2,59,60,10,44,33,18,61,62,63,64,27,65,29,1,15,6,7,8,66,57]),import.meta.url)},checkbox:{example:()=>h(()=>import("./Example-CZ-iEz1g.js"),__vite__mapDeps([67,38]),import.meta.url),component:()=>h(()=>import("./Index-B0AlGE52.js"),__vite__mapDeps([68,1,2,69,62,3,4,5,6,7,8,9,10,70,71]),import.meta.url)},checkboxgroup:{example:()=>h(()=>import("./Example-DccrJI--.js"),__vite__mapDeps([72,38]),import.meta.url),component:()=>h(()=>import("./Index-CmM1-Kgi.js"),__vite__mapDeps([73,1,2,74,69,62,3,4,5,6,7,8,9,10,75]),import.meta.url)},code:{example:()=>h(()=>import("./Example-DQvZIwBt.js"),__vite__mapDeps([76,77]),import.meta.url),component:()=>h(()=>import("./Index-XeBgsyZk.js").then(e=>e.K),__vite__mapDeps([78,21,22,59,60,3,4,5,9,2,28,36,20,18,6,7,8,10,79,1,15,16,76,77,80]),import.meta.url)},colorpicker:{example:()=>h(()=>import("./Example-BaLyJYAe.js"),__vite__mapDeps([81,82]),import.meta.url),component:()=>h(()=>import("./Index-k7d3hggf.js"),__vite__mapDeps([83,84,74,69,62,3,4,5,2,1,6,7,8,9,10,81,82,85]),import.meta.url)},column:{component:()=>h(()=>import("./Index-C7inCcrM.js"),__vite__mapDeps([11,6,7,8,3,4,5,9,2,10,12]),import.meta.url)},core:{component:()=>h(()=>import("./index-B2T8hc6C.js"),__vite__mapDeps([86,87]),import.meta.url)},dataframe:{example:()=>h(()=>import("./Example-CqPGqNav.js"),__vite__mapDeps([88,89]),import.meta.url),component:()=>h(()=>import("./Index-B0grnMRw.js"),__vite__mapDeps([90,1,2,3,4,5,91,92,64,41,42,21,22,62,7,8,70,71,59,93,60,19,9,6,10,94,95,25,15,16,26,27,28,17,18,96,54,20,55,36,57,97,45,98,63,46,99,48,100,101,88,89,102]),import.meta.url)},dataset:{component:()=>h(()=>import("./Index-loH_ztvM.js"),__vite__mapDeps([103,1,2,3,4,5,7,8,104,105,106,107]),import.meta.url)},datetime:{example:()=>h(()=>import("./Example-BBLMS951.js"),[],import.meta.url),component:()=>h(()=>import("./Index-BN36UgrQ.js"),__vite__mapDeps([108,1,2,74,69,62,3,4,5,109,110]),import.meta.url)},downloadbutton:{component:()=>h(()=>import("./Index-DRJTgarg.js"),__vite__mapDeps([111,53,54,20,21,22,55,3,4,5,56,2,57,112]),import.meta.url)},dropdown:{example:()=>h(()=>import("./Example-BgQNfMWT.js"),__vite__mapDeps([113,38]),import.meta.url),component:()=>h(()=>import("./Index-Cm-BYlsY.js"),__vite__mapDeps([114,74,69,62,3,4,5,2,93,115,63,116,1,6,7,8,9,10,113,38]),import.meta.url)},file:{example:()=>h(()=>import("./Example-DrmWnoSo.js"),__vite__mapDeps([117,118]),import.meta.url),component:()=>h(()=>import("./Index-BH3WSrmS.js"),__vite__mapDeps([119,120,3,4,5,15,2,16,61,41,42,9,10,18,21,22,36,20,121,1,48,6,7,8,117,118]),import.meta.url)},fileexplorer:{example:()=>h(()=>import("./Example-CIFMxn5c.js"),__vite__mapDeps([122,123]),import.meta.url),component:()=>h(()=>import("./Index-HcdSJvd1.js"),__vite__mapDeps([124,61,1,2,3,4,5,15,6,7,8,9,10,125]),import.meta.url)},form:{component:()=>h(()=>import("./Index-DE1Sah7F.js"),__vite__mapDeps([126,127]),import.meta.url)},gallery:{base:()=>h(()=>import("./Gallery-Ctw0WwP3.js"),__vite__mapDeps([128,3,4,5,15,2,9,16,26,27,25,10,28,17,32,18,19,43,44,33,36,21,22,20,54,55,129,34,130,91,131,42,57]),import.meta.url),component:()=>h(()=>import("./Index-CPGNVvBX.js"),__vite__mapDeps([132,1,2,3,4,5,48,41,42,128,15,9,16,26,27,25,10,28,17,32,18,19,43,44,33,36,21,22,20,54,55,129,34,130,91,131,57,6,7,8,120,61,121,118]),import.meta.url)},group:{component:()=>h(()=>import("./Index-WEzAIkMk.js"),__vite__mapDeps([133,134]),import.meta.url)},highlightedtext:{component:()=>h(()=>import("./Index-DePFwAr4.js"),__vite__mapDeps([135,136,1,2,3,4,5,15,16,6,7,8,9,10,137]),import.meta.url)},html:{base:()=>h(()=>import("./Index-BKGQD_Df.js"),__vite__mapDeps([138,6,7,8,3,4,5,9,2,10,79,1,15,25,139]),import.meta.url),example:()=>h(()=>import("./Example-C2a4WxRl.js"),__vite__mapDeps([140,141]),import.meta.url),component:()=>h(()=>import("./Index-BKGQD_Df.js"),__vite__mapDeps([138,6,7,8,3,4,5,9,2,10,79,1,15,25,139]),import.meta.url)},image:{base:()=>h(()=>import("./ImagePreview-lAInKGA8.js"),__vite__mapDeps([95,25,3,4,5,15,2,9,16,26,27,28,17,18,19,96,54,20,21,22,55,36,57]),import.meta.url),example:()=>h(()=>import("./Example-CC8yxxGn.js"),__vite__mapDeps([100,54,20,21,22,55,101]),import.meta.url),component:()=>h(()=>import("./Index-BLHCXS_b.js"),__vite__mapDeps([94,95,25,3,4,5,15,2,9,16,26,27,28,17,18,19,96,54,20,21,22,55,36,57,97,10,45,41,42,93,98,7,8,63,46,99,1,48,6,100,101]),import.meta.url)},imageeditor:{example:()=>h(()=>import("./Example-BYSsGuG2.js"),__vite__mapDeps([142,3,4,5,54,20,21,22,55,97,15,2,9,10,17,45,41,42,18,19,96,93,98,7,8,63,46,99,143,57,101]),import.meta.url),component:()=>h(()=>import("./Index-CbHblLM3.js").then(e=>e.as),__vite__mapDeps([144,95,25,3,4,5,15,2,9,16,26,27,28,17,18,19,96,54,20,21,22,55,36,57,97,10,45,41,42,93,98,7,8,63,46,99,1,6,84,59,65,33,145,101]),import.meta.url)},imageslider:{example:()=>h(()=>import("./Example-j_9MW44b.js"),__vite__mapDeps([146,147]),import.meta.url),component:()=>h(()=>import("./Index-CS9KQP_a.js"),__vite__mapDeps([148,149,150,20,21,22,3,4,5,15,2,9,16,10,28,17,33,18,19,36,6,7,8,41,42,1,48,151]),import.meta.url)},json:{example:()=>h(()=>import("./Example-CUXQMlMe.js"),__vite__mapDeps([152,153,59,60,3,4,5,9,2,16,18,154,155]),import.meta.url),component:()=>h(()=>import("./Index-CRCQNxH7.js"),__vite__mapDeps([156,153,59,60,3,4,5,9,2,16,18,154,1,15,6,7,8,10]),import.meta.url)},label:{component:()=>h(()=>import("./Index-DLt4Oneb.js"),__vite__mapDeps([157,158,1,2,3,4,5,15,16,6,7,8,9,10,159]),import.meta.url)},markdown:{example:()=>h(()=>import("./Example-CyYX3U0b.js"),__vite__mapDeps([160,62,3,4,5,38]),import.meta.url),component:()=>h(()=>import("./Index-DsYu4Vp2.js"),__vite__mapDeps([161,25,59,60,62,3,4,5,9,2,18,6,7,8,10,1,160,38,162]),import.meta.url)},model3d:{example:()=>h(()=>import("./Example-uQ8MuYg6.js"),__vite__mapDeps([163,38]),import.meta.url),component:()=>h(()=>import("./Index-DTpkVUiy.js"),__vite__mapDeps([164,3,4,5,15,2,9,28,61,33,18,41,42,43,10,44,36,21,22,20,1,16,48,6,7,8,163,38,165]),import.meta.url)},multimodaltextbox:{example:()=>h(()=>import("./Example-CiCdQyhW.js"),__vite__mapDeps([166,54,20,21,22,55,3,4,5,129,34,130,167,2,57]),import.meta.url),component:()=>h(()=>import("./Index-DzyfujkC.js"),__vite__mapDeps([168,74,69,62,3,4,5,2,10,61,45,41,42,29,169,98,170,21,22,54,20,55,40,43,9,28,44,33,18,36,15,7,8,46,30,25,31,32,16,34,35,47,1,6,166,129,130,167,57,171]),import.meta.url)},nativeplot:{example:()=>h(()=>import("./Example-Creifpe8.js"),[],import.meta.url),component:()=>h(()=>import("./Index-DRkwtSQ6.js"),__vite__mapDeps([172,1,2,74,69,62,3,4,5,16,158,18,19,9,6,7,8,10,173]),import.meta.url)},number:{example:()=>h(()=>import("./Example-CqL1e7EB.js"),__vite__mapDeps([174,38]),import.meta.url),component:()=>h(()=>import("./Index-BIdUk9av.js"),__vite__mapDeps([175,1,2,74,69,62,3,4,5,6,7,8,9,10,176]),import.meta.url)},paramviewer:{example:()=>h(()=>import("./Example-C9__vDgN.js"),__vite__mapDeps([177,38]),import.meta.url),component:()=>h(()=>import("./Index-DkqotP0T.js"),__vite__mapDeps([178,4,179]),import.meta.url)},plot:{base:()=>h(()=>import("./Plot-ByQgMKrE.js").then(e=>e.b),__vite__mapDeps([180,3,4,5,16,2]),import.meta.url),component:()=>h(()=>import("./Index-BZ8wivy_.js"),__vite__mapDeps([181,180,3,4,5,16,2,1,15,18,19,9,6,7,8,10]),import.meta.url)},radio:{example:()=>h(()=>import("./Example-BoMLuz1A.js"),__vite__mapDeps([182,38]),import.meta.url),component:()=>h(()=>import("./Index-DhgnLShX.js"),__vite__mapDeps([183,1,2,74,69,62,3,4,5,6,7,8,9,10,182,38,184]),import.meta.url)},row:{component:()=>h(()=>import("./Index-EtmCJbY4.js"),__vite__mapDeps([185,6,7,8,3,4,5,9,2,10,186]),import.meta.url)},sidebar:{component:()=>h(()=>import("./Index-Cjafj7_6.js"),__vite__mapDeps([187,6,7,8,3,4,5,9,2,10,11,12,188]),import.meta.url)},sketchbox:{component:()=>h(()=>import("./Index-BlWK1-fD.js"),__vite__mapDeps([189,190]),import.meta.url)},slider:{example:()=>h(()=>import("./Example-BrizabXh.js"),__vite__mapDeps([191,38]),import.meta.url),component:()=>h(()=>import("./Index-6xwbSvdF.js"),__vite__mapDeps([192,1,2,74,69,62,3,4,5,6,7,8,9,10,193]),import.meta.url)},state:{component:()=>h(()=>import("./Index-uRgjJb4U.js"),[],import.meta.url)},statustracker:{component:()=>h(()=>import("./index-C0xhtHu7.js"),__vite__mapDeps([194,6,7,8,3,4,5,9,2,10,195,63,46]),import.meta.url)},tabitem:{component:()=>h(()=>import("./Index-DwhpTNaY.js"),__vite__mapDeps([196,197,198,11,6,7,8,3,4,5,9,2,10,12,199]),import.meta.url)},tabs:{component:()=>h(()=>import("./Index-BIK3OPds.js"),__vite__mapDeps([200,197,198]),import.meta.url)},textbox:{example:()=>h(()=>import("./Example-BdAjEacD.js"),__vite__mapDeps([104,105]),import.meta.url),component:()=>h(()=>import("./Index-C5yNnGyH.js"),__vite__mapDeps([201,202,74,69,62,3,4,5,2,59,60,169,98,63,107,1,6,7,8,9,10,104,105]),import.meta.url)},timer:{component:()=>h(()=>import("./Index-BMLc4VxK.js"),[],import.meta.url)},uploadbutton:{component:()=>h(()=>import("./Index-eHFoCXcv.js"),__vite__mapDeps([203,53,54,20,21,22,55,3,4,5,56,2,57,204]),import.meta.url)},video:{base:()=>h(()=>import("./VideoPreview-DBQL_gko.js").then(e=>e.a),__vite__mapDeps([205,3,4,5,15,2,9,16,26,27,25,28,170,18,36,21,22,20,31,32,33,129,34,130,43,10,44,206,42]),import.meta.url),example:()=>h(()=>import("./Example-B74kJcnr.js"),__vite__mapDeps([207,129,20,21,22,34,130,208]),import.meta.url),component:()=>h(()=>import("./index-BeWruw2y.js"),__vite__mapDeps([209,41,42,3,4,5,15,2,170,45,21,22,54,20,55,97,9,10,17,18,19,96,93,98,7,8,63,46,99,129,34,130,205,16,26,27,25,28,36,31,32,33,43,44,206,207,208,1,48,6,210,57,101]),import.meta.url)}},le={},Nt=typeof window<"u";function cr({api_url:e,name:t,id:r,variant:n}){const i=Nt&&window.__GRADIO__CC__,o={...Cs,...i||{}};let s=r||t;if(le[`${s}-${n}`])return{component:le[`${s}-${n}`],name:t};try{if(!o?.[s]?.[n]&&!o?.[t]?.[n])throw new Error;return le[`${s}-${n}`]=(o?.[s]?.[n]||o?.[t]?.[n])(),{name:t,component:le[`${s}-${n}`]}}catch{if(!s)throw new Error(`Component not found: ${t}`);try{return le[`${s}-${n}`]=Bs(e,s,n),{name:t,component:le[`${s}-${n}`]}}catch(c){if(n==="example")return le[`${s}-${n}`]=h(()=>import("./Example-DxdiEFS_.js"),__vite__mapDeps([211,38]),import.meta.url),{name:t,component:le[`${s}-${n}`]};throw console.error(`failed to load: ${t}`),console.error(c),c}}}function hr(e){return Nt?new Promise((t,r)=>{const n=document.createElement("link");n.rel="stylesheet",n.href=e,document.head.appendChild(n),n.onload=()=>t(),n.onerror=()=>r()}):Promise.resolve()}function Bs(e,t,r){const n=Nt?"client":"server";let i;return n==="server"?Promise.all([hr(`${e}/custom_component/${t}/${r}/style.css`),h(()=>import("./Index-ZgZSqOvY.js"),__vite__mapDeps([212,1,2,3,4,5,6,7,8,9,10,213]),import.meta.url)]).then(([o,s])=>s):(i=`${e}/custom_component/${t}/${n}/${r}/index.js`,Promise.all([hr(`${e}/custom_component/${t}/${n}/${r}/style.css`),import(i)]).then(([o,s])=>s))}function Ms(){const e=fe({}),t={},r={},n=new Map,i=new Map,o=new Map,s={};function a({fn_index:u,status:l,queue:f=!0,size:p,position:m=null,eta:_=null,message:L=null,progress:S,time_limit:V=null}){const B=r[u],k=t[u],U=s[u],j=B.map(D=>{let N;const $=n.get(D)||0;if(U==="pending"&&l!=="pending"){let q=$-1;n.set(D,q<0?0:q),N=q>
90?"pending":l}else U==="pending"&&l==="pending"?N="pending":U!=="pending"&&l==="pending"?(N="pending",n.set(D,$+1)):N=l;return{id:D,queue_position:m,queue_size:p,eta:_,status:N,message:L,progress:S}});k.forEach(D=>{const N=i.get(D)||0;if(U==="pending"&&l!=="pending"){let $=N-1;i.set(D,$<0?0:$),o.set(D,l)}else U!=="pending"&&l==="pending"?(i.set(D,N+1),o.set(D,l)):o.delete(D)}),e.update(D=>(j.forEach(({id:N,queue_position:$,queue_size:q,eta:be,status:x,message:ye,progress:Q})=>{D[N]={queue:f,queue_size:q,queue_position:$,eta:be,message:ye,progress:Q,status:x,fn_index:u}}),D)),s[u]=l}function c(u,l,f){t[u]=l,r[u]=f}return{update:a,register:c,subscribe:e.subscribe,get_status_for_fn(u){return s[u]},get_inputs_to_update(){return o}}}let _e=[];const ks=typeof window<"u",fr=ks?requestAnimationFrame:async e=>await e();function la({initial_layout:e=void 0}={initial_layout:void 0}){let t,r=fe({}),n={},i,o,s,a,c=Ms();const u=fe(e);let l=[],f,p={},m,_=null;function L(y){_=y}let S,V;function B(y){y.forEach(w=>{w.targets.forEach(v=>{const d=a[v[0]];d&&w.event_specific_args?.length>0&&w.event_specific_args?.forEach(g=>{d.props[g]=w[g]})})})}async function k({app:y,components:w,layout:v,dependencies:d,root:g,options:E}){be(),f=y,a&&w.forEach(b=>{if(b.props.value==null&&b.key){const A=Object.values(a).find(C=>C.key===b.key);A&&(b.props.value=A.props.value)}}),l=w,i=new Set,o=new Set,_e=[],s=new Map,t=new Map,a={},S=v,V=g,m={id:v.id,type:"column",props:{interactive:!1,scale:E.fill_height?1:null},has_modes:!1,instance:null,component:null,component_class_id:"",key:null},w.push(m),d.forEach(b=>{c.register(b.id,b.inputs,b.show_progress_on||b.outputs),b.frontend_fn=pr(b.js,!!b.backend_fn,b.inputs.length,b.outputs.length),_r(b.targets,b.id,n),dr(b,i,o)}),r.set(n),s=mr(w,v,g),a=w.reduce((b,A)=>(b[A.id]=A,b),{}),await j(v,g,l),u.set(m),B(d)}function U({render_id:y,components:w,layout:v,root:d,dependencies:g}){S=v,V=d,w.forEach(T=>{for(const X in T.props)T.props[X]===null&&(T.props[X]=void 0)});let E=[],b=[];w.forEach(T=>{T.key==null||!p[y]?.includes(T.key)?b.push(T):E.push(T)}),mr(b,v,d).forEach((T,X)=>{s.set(X,T)}),n={},g.forEach(T=>{c.register(T.id,T.inputs,T.outputs),T.frontend_fn=pr(T.js,!!T.backend_fn,T.inputs.length,T.outputs.length),_r(T.targets,T.id,n),dr(T,i,o)}),r.set(n);let C=a[v.id];const ie=T=>{T.children&&T.children.forEach(X=>{ie(X)})};ie(C),Object.entries(a).forEach(([T,X])=>{let Le=Number(T);if(X.rendered_in===y){let ue=E.find(oe=>oe.key===X.key);if(X.key!=null&&ue!==void 0){const oe=a[X.id];for(const Ee in ue.props)ue.props.preserved_by_key?.includes(Ee)||(oe.props[Ee]=ue.props[Ee])}else delete a[Le],t.has(Le)&&t.delete(Le)}}),b.concat(E.filter(T=>!a[T.id])).forEach(T=>{a[T.id]=T,t.set(T.id,T)}),C.parent&&(C.parent.children[C.parent.children.indexOf(C)]=a[v.id]),j(v,d,l.concat(w),C.parent).then(()=>{u.set(m),p[y]=w.map(T=>T.key).filter(T=>T!=null)}),B(g)}async function j(y,w,v,d){const g=a[y.id];if(!g.component){const E=g.component_class_id||g.type;let b=s.get(E);b&&(g.component=(await b)?.default)}if(g.parent=d,g.type==="dataset"&&(g.props.component_map=xt(g.type,g.component_class_id,w,v,g.props.components).example_components),n[g.id]&&(g.props.attached_events=Object.keys(n[g.id])),g.props.interactive=Vs(g.id,g.props.interactive,g.props.value,i,o),g.props.server=$s(g.id,g.props.server_fns,f),t.set(g.id,g),y.children&&(g.children=await Promise.all(y.children.map(E=>j(E,w,v,g)))),g.type==="tabs"&&!g.props.initial_tabs){const b=(y.children?.map((A,C)=>{const ie=a[A.id];return ie.props.id??=A.id,{type:ie.type,props:{...ie.props,id:ie.props.id,order:C}}})||[]).filter(A=>A.type==="tabitem");g.props.initial_tabs=b?.map(A=>({label:A.props.label,id:A.props.id,visible:typeof A.props.visible=="boolean"?A.props.visible:!0,interactive:A.props.interactive,order:A.props.order}))}return g.type==="tabs"&&y.children?.forEach((E,b)=>{const A=a[E.id];A.props.order=b}),g}let D=!1,N=fe(!1);async function $(y){if(y.size===0)return;const w=l.filter(v=>y.has(v.id));for(const v of w){const d=v.component_class_id||v.type;if(s.has(d))v.component=(await s.get(d))?.default??v.component;else{const{component:g,example_components:E}=xt(v.type,v.component_class_id,V,l);if(s.set(d,g),E)for(const[b,A]of E)s.set(b,A);v.component||(v.component=(await g)?.default)}}}function q(y){return y.some(w=>w.some(v=>{const d=a[v.id];return d?v.prop==="visible"||v.prop==="selected"&&d.type==="tabs":!1}))}function be(){const y=q(_e);let w;y&&S&&(w=We(S,l)),u.update(v=>{for(let d=0;d<_e.length;d++)for(let g=0;g<_e[d].length;g++){const E=_e[d][g];if(!E)continue;const b=a[E.id];if(!b)continue;let A;const C=b.props[E.prop];E.value instanceof Map?A=new Map(E.value):E.value instanceof Set?A=new Set(E.value):Array.isArray(E.value)?A=[...E.value]:E.value==null?A=null:typeof E.value=="object"?A={...E.value}:A=E.value,b.props[E.prop]=A,E.prop==="value"&&!nn(b)&&!Be(C,A)&&_?.(E.id,A)}return v}),y&&S&&w&&fr(async()=>{const v=We(S,l),d=new Set;for(const g of v)w.has(g)||d.add(g);await $(d),d.size>0&&u.update(g=>g)}),_e=[],D=!1,N.set(!1)}function x(y){y&&(_e.push(y),D||(D=!0,N.set(!0),fr(be)))}function ye(y){let w=t.get(y);if(!w){const v=Dr(u);w=Q(v,y)}return w?w.instance?.get_value?w.instance.get_value():w.props.value:null}
vendor: 13,031 bytes, lines 9-11
9function Q(y,w){if(y.id===w)return y;if(y.children)for(const v of y.children){const d=Q(v,w);if(d)return d}}function et(y,w){const v=t.get(y);v&&v.instance?.modify_stream_state&&v.instance.modify_stream_state(w)}function G(y){const w=t.get(y);return w?.instance?.get_stream_state?w.instance.get_stream_state():"not_set"}function ae(y,w){const v=t.get(y);v?.instance?.set_time_limit&&v.instance.set_time_limit(w)}return{layout:u,targets:r,update_value:x,get_data:ye,modify_stream:et,get_stream_state:G,set_time_limit:ae,loading_status:c,scheduled_updates:N,create_layout:k,rerender_layout:U,value_change:L}}const Us=Object.getPrototypeOf(async function(){}).constructor;function pr(e,t,r,n){if(!e||e===!0)return null;const i=t?r===1:n===1;try{return new Us("__fn_args",`  let result = await (${e})(...__fn_args);
10  if (typeof result === "undefined") return [];
11  return (${i} && !Array.isArray(result)) ? [result] : result;`)}catch(o){return console.error("Could not parse custom js method."),console.error(o),null}}function _r(e,t,r){return e.forEach(([n,i])=>{r[n]||(r[n]={}),r[n]?.[i]&&!r[n]?.[i].includes(t)?r[n][i].push(t):r[n][i]=[t]}),r}function dr(e,t,r){return e.inputs.forEach(n=>t.add(n)),e.outputs.forEach(n=>r.add(n)),[t,r]}function js(e){return Array.isArray(e)&&e.length===0||e===""||e===0||!e}function Vs(e,t,r,n,i){return t===!1?!1:t===!0?!0:!!(n.has(e)||!i.has(e)&&js(r))}function $s(e,t,r){return t?t.reduce((n,i)=>(n[i]=async(...o)=>(o.length===1&&(o=o[0]),await r.component_server(e,i,o)),n),{}):{}}function xt(e,t,r,n,i){let o=new Map;e==="api"&&(e="state"),e==="dataset"&&i&&i.forEach(a=>{if(o.has(a))return;let c;const u=n.find(l=>l.type===a);u&&(c=cr({api_url:r,name:a,id:u.component_class_id,variant:"example"}),o.set(a,c.component))});const s=cr({api_url:r,name:e,id:t,variant:"component"});return{component:s.component,name:s.name,example_components:o.size>0?o:void 0}}function Gs(e,t,r){const n=r?.selected_tab_id===e.id||r?.selected_tab_id===e.props.id;return t&&n}function Fs(e,t,r){const n=e.props.selected;if(typeof n=="string"||typeof n=="number")return n;if(t.children)for(const i of t.children){const o=r.find(s=>s.id===i.id);if(o?.type==="tabitem"&&o.props.visible!==!1&&o.props.interactive!==!1)return o.id||o.props.id}}function ft(e,t,r){const n=new Set;if(e.children)for(const i of e.children)We(i,t,!0,r).forEach(s=>n.add(s));return n}function We(e,t,r=!0,n){const i=new Set,o=t.find(a=>a.id===e.id);if(!o)return i;const s=r&&(typeof o.props.visible=="boolean"?o.props.visible:!0);if(o.type==="tabitem")return Gs(o,s,n)&&(i.add(o.id),ft(e,t,n).forEach(c=>i.add(c))),i;if(o.type==="tabs"){if(s){i.add(o.id);const a=Fs(o,e,t);ft(e,t,{selected_tab_id:a}).forEach(u=>i.add(u))}return i}return s&&(i.add(o.id),ft(e,t,n).forEach(c=>i.add(c))),i}function mr(e,t,r){let n=new Map;const i=We(t,e);return e.forEach(o=>{if(i.has(o.id)){const{component:s,example_components:a}=xt(o.type,o.component_class_id,r,e);if(n.set(o.component_class_id||o.type,s),a)for(const[c,u]of a)n.set(c,u)}}),n}function nn(e){return typeof e.props.visible=="boolean"&&e.props.visible===!1?!1:e.parent?nn(e.parent):!0}const ca=["red","green","blue","yellow","purple","teal","orange","cyan","lime","pink"],zs=[{color:"red",primary:600,secondary:100},{color:"green",primary:600,secondary:100},{color:"blue",primary:600,secondary:100},{color:"yellow",primary:500,secondary:100},{color:"purple",primary:600,secondary:100},{color:"teal",primary:600,secondary:100},{color:"orange",primary:600,secondary:100},{color:"cyan",primary:600,secondary:100},{color:"lime",primary:500,secondary:100},{color:"pink",primary:600,secondary:100}],gr={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},ha=zs.reduce((e,{color:t,primary:r,secondary:n})=>({...e,[t]:{primary:gr[t][r],secondary:gr[t][n]}}),{});function on(e){if(e==null)return"";const t=String(e),r=Dr(tn);let n=r(t);if(n!==t)return n;const i=t.toLowerCase();for(const o of Zs){const s=o.substring(o.indexOf(".")+1);if(i===s){const a=r(o);if(a!==o)return a;break}}return t}const fa=me(tn,()=>on),br={ar:"جاري التحميل",ca:"S'està carregant",ckb:"بارکردن",de:"Laden",en:"Loading",es:"Cargando",eu:"Kargatzen",fa:"در حال بارگذاری",fi:"Ladataan",fr:"Chargement",he:"טוען",hi:"लोड हो रहा है",ja:"読み込み中",ko:"로딩 중",lt:"Kraunama",nb:"Laster",nl:"Laden",pl:"Ładowanie","pt-BR":"Carregando",pt:"A carregar",ro:"Se încarcă",ru:"Загрузка",sv:"Laddar",ta:"ஏற்றுகிறது",th:"กำลังโหลด",tr:"Yükleniyor",uk:"Завантаження",ur:"لوڈ ہو رہا ہے",uz:"Yuklanmoqda","zh-CN":"加载中","zh-TW":"載入中"},sn="English",an={annotated_image:"Annotated Image"},un={allow_recording_access:"Please allow access to the microphone for recording.",audio:"Audio",drop_to_upload:"Drop an audio file here to upload",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"},ln={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."},cn={edit:"Edit",retry:"Retry",undo:"Undo",submit:"Submit",cancel:"Cancel",like:"Like",dislike:"Dislike",clear:"Clear"},hn={checkbox:"Checkbox",checkbox_group:"Checkbox Group"},fn={code:"Code"},pn={color_picker:"Color Picker"},_n={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",settings:"Settings",share:"Share",submit:"Submit",undo:"Undo",no_devices:"No devices found",language:"Language",display_theme:"Display Theme",pwa:"Progressive Web App",record:"Record",stop_recording:"Stop Recording",screen_studio:"Screen Studio",share_gradio_tab:"[Sharing] Gradio Tab",run:"Run"},dn={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",delete_row:"Delete row",delete_column:"Delete column",add_column_left:"Add column to the left",add_column_right:"Add column to the right",sort_column:"Sort column",sort_ascending:"Sort ascending",sort_descending:"Sort descending",drop_to_upload:"Drop CSV or TSV files here to import data into dataframe",clear_sort:"Clear sort",filter:"Filter",clear_filter:"Clear filters"},mn={dropdown:"Dropdown"},gn={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",use_via_api_or_mcp:"Use via API or MCP"},bn={uploading:"Uploading..."},yn={highlighted_text:"Highlighted Text"},En={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",drop_to_upload:"Drop an image file here to upload"},vn={label:"Label"},wn={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"},xn={number:"Number"},Tn={plot:"Plot"},Sn={radio:"Radio"},An={slider:"Slider"},On={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"},Pn={drop_to_upload:"Drop a video file here to upload"},Ct={_name:sn,"3D_model":{"3d_model":"3D Model",drop_to_upload:"Drop a 3D model (.obj, .glb, .stl, .gltf, .splat, or .ply) file here to upload"},annotated_image:an,audio:un,blocks:ln,chatbot:cn,checkbox:hn,code:fn,color_picker:pn,common:_n,dataframe:dn,dropdown:mn,errors:gn,file:bn,highlighted_text:yn,image:En,label:vn,login:wn,number:xn,plot:Tn,radio:Sn,slider:An,upload_text:On,video:Pn},qs=Object.freeze(Object.defineProperty({__proto__:null,_name:sn,annotated_image:an,audio:un,blocks:ln,chatbot:cn,checkbox:hn,code:fn,color_picker:pn,common:_n,dataframe:dn,default:Ct,dropdown:mn,errors:gn,file:bn,highlighted_text:yn,image:En,label:vn,login:wn,number:xn,plot:Tn,radio:Sn,slider:An,upload_text:On,video:Pn},Symbol.toStringTag,{value:"Module"})),Xs={ar:"العربية",ca:"Català",ckb:"کوردی",de:"Deutsch",en:"English",es:"Español",eu:"Euskara",fa:"فارسی",fi:"Suomi",fr:"Français",he:"עברית",hi:"हिंदी",ja:"日本語",ko:"한국어",lt:"Lietuvių",nb:"Norsk bokmål",nl:"Nederlands",pl:"Polski","pt-B
11R":"Português do Brasil",pt:"Português",ro:"Română",ru:"Русский",sv:"Svenska",ta:"தமிழ்",th:"ภาษาไทย",tr:"Türkçe",uk:"Українська",ur:"اردو",uz:"O'zbek","zh-CN":"简体中文","zh-TW":"繁體中文"},Ws=Object.assign({
11"./lang/ar.json":()=>h(()=>import("./ar-C14WhJAs.js"),[],import.meta.url),
11"./lang/ca.json":()=>h(()=>import("./ca-BawhR5IW.js"),[],import.meta.url),
11"./lang/ckb.json":()=>h(()=>import("./ckb-DJglGH6y.js"),[],import.meta.url),
11"./lang/de.json":()=>h(()=>import("./de-1aCSmaRd.js"),[],import.meta.url),
11"./lang/en.json":()=>h(()=>Promise.resolve().then(()=>qs),void 0,import.meta.url),
11"./lang/es.json":()=>h(()=>import("./es-DnL3K9UL.js"),[],import.meta.url),
11"./lang/eu.json":()=>h(()=>import("./eu-CVD4vzPg.js"),[],import.meta.url),
11"./lang/fa.json":()=>h(()=>import("./fa-EPplD9mS.js"),[],import.meta.url),
11"./lang/fi.json":()=>h(()=>import("./fi-B30SrT2N.js"),[],import.meta.url),
11"./lang/fr.json":()=>h(()=>import("./fr-BtMjEOuI.js"),[],import.meta.url),
11"./lang/he.json":()=>h(()=>import("./he-C03Xfbr8.js"),[],import.meta.url),
11"./lang/hi.json":()=>h(()=>import("./hi-DaWfWT5u.js"),[],import.meta.url),
11"./lang/ja.json":()=>h(()=>import("./ja-BTBiRAkN.js"),[],import.meta.url),
11"./lang/ko.json":()=>h(()=>import("./ko-C9Hiv2KW.js"),[],import.meta.url),
11"./lang/lt.json":()=>h(()=>import("./lt-Z_MxAT26.js"),[],import.meta.url),
11"./lang/nb.json":()=>h(()=>import("./nb-CGxYPyHM.js"),[],import.meta.url),
11"./lang/nl.json":()=>h(()=>import("./nl-Dw1IiFHs.js"),[],import.meta.url),
11"./lang/pl.json":()=>h(()=>import("./pl-CewrFAug.js"),[],import.meta.url),
11"./lang/pt-BR.json":()=>h(()=>import("./pt-BR-DZjK3tkX.js"),[],import.meta.url),
11"./lang/pt.json":()=>h(()=>import("./pt-DH1R3DI2.js"),[],import.meta.url),
11"./lang/ro.json":()=>h(()=>import("./ro-boSZHd3M.js"),[],import.meta.url),
11"./lang/ru.json":()=>h(()=>import("./ru-BgQGKwpu.js"),[],import.meta.url),
11"./lang/sv.json":()=>h(()=>import("./sv-D1nuPeJf.js"),[],import.meta.url),
11"./lang/ta.json":()=>h(()=>import("./ta-Ex4E4CrJ.js"),[],import.meta.url),
11"./lang/th.json":()=>h(()=>import("./th-DGNowuDO.js"),[],import.meta.url),
11"./lang/tr.json":()=>h(()=>import("./tr-Cez09yqM.js"),[],import.meta.url),
11"./lang/uk.json":()=>h(()=>import("./uk-C_6kyB1E.js"),[],import.meta.url),
11"./lang/ur.json":()=>h(()=>import("./ur-1gg1Zkwj.js"),[],import.meta.url),
11"./lang/uz.json":()=>h(()=>import("./uz-CVKNjEjc.js"),[],import.meta.url),
11"./lang/zh-CN.json":()=>h(()=>import("./zh-CN-C4t77Jdq.js"),[],import.meta.url),
11"./lang/zh-TW.json":()=>h(()=>import("./zh-TW-DnQkjK12.js"),[],import.meta.url)
11});function pa(e){return e&&typeof e=="object"&&e.__type__==="translation_metadata"&&typeof e.key=="string"}function _a(e){if(typeof e!="string")return e;const t="__i18n__",r=e.indexOf(t);if(r===-1)return e;try{const n=r>0?e.substring(0,r):"",i=r+t.length,o=e.indexOf("{",i);let s=-1,a=0;for(let l=o;l<e.length;l++)if(e[l]==="{"&&a++,e[l]==="}"&&a--,a===0){s=l+1;break}if(s===-1)return console.error("Could not find end of JSON in i18n string"),e;const c=e.substring(o,s),u=s<e.length?e.substring(s):"";try{const l=JSON.parse(c);if(l&&l.key){const f=on(l.key);return n+f+u}}catch(l){console.error("Error parsing i18n JSON:",l)}return e}catch(n){return console.error("Error processing translation:",n),e}}function Js(){return{...Object.fromEntries(Object.entries(Ws).map(([t,r])=>[t.split("/").pop().split(".")[0],{type:"lazy",data:r}])),en:{type:"static",data:Ct}}}const Bt=Js(),yr=Object.keys(Bt),da=Object.entries(Bt).map(([e])=>[Xs[e]||e,e]);let Zs=new Set,pt=!1,Er;async function ma(e){if(pt&&!(pt&&e!==Er))return;Er=e,Qs({processed_langs:Bt,custom_translations:e??{}});const r=vs();let n=r&&yr.includes(r)?r:null;if(!n){const i=r?.split("-")[0];n=i&&yr.includes(i)?i:"en"}await fs({fallbackLocale:"en",initialLocale:n}),pt=!0}function ga(e){ge.set(e)}function ba(e,t,r="en"){return e&&t.includes(e)?e:r}function Qs(e){if(e){try{for(const t in e.custom_translations)Ge(t,e.custom_translations[t]);for(const t in e.processed_langs)t==="en"&&e.processed_langs[t].type==="static"?Ge(t,Ct):e.processed_langs[t].type==="lazy"&&os(t,e.processed_langs[t].data)}catch(t){console.error("Error loading translations:",t)}for(const t in br)Ge(t,{common:{loading:br[t]}})}}const Ys="./assets/index-CJsBH6a-.css";let Tt;Tt=[];let St,Ln,Ks=new Promise(e=>{Ln=e});async function ea(){St=(await h(()=>import("./Index-BJo1nj4S.js"),__vite__mapDeps([214,87,6,7,8,3,4,5,9,2,10,21,22,215]),import.meta.url)).default,Ln()}function ta(){const e={SvelteComponent:rt.SvelteComponent};for(const r in rt)r!=="SvelteComponent"&&(r==="SvelteComponentDev"?e[r]=e.SvelteComponent:e[r]=rt[r]);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 ea(),this.loading=!0,this.app&&this.app.$destroy(),typeof Tt!="string"&&Tt.forEach(o=>ar(o,document.head)),await ar(Ys,document.head);const n=new CustomEvent("domchange",{bubbles:!0,cancelable:!1,composed:!0});new MutationObserver(o=>{this.dispatchEvent(n)}).observe(this,{childList:!0}),this.app=new St({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-39-0",theme_mode:this.theme_mode,autoscroll:this.autoscroll==="true",control_page_title:this.control_page_title==="true",Client:Fe,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(n,i,o){if(await Ks,(n==="host"||n==="space"||n==="src")&&o!==i){if(this.updating={name:n,value:o},this.loading)return;this.app&&this.app.$destroy(),this.space=null,this.host=null,this.src=null,n==="host"?this.host=o:n==="space"?this.space=o:n==="src"&&(this.src=o),this.app=new St({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-39-0",theme_mode:this.theme_mode,autoscroll:this.autoscroll==="true",control_page_title:this.control_page_title==="true",Client:Fe,app_mode:window.__gradio_mode__==="app"}}),this.updating=!1}}}customElements.get("gradio-app")||customElements.define("gradio-app",t)}ta();export{tn as $,Us as A,ia as B,Dr as C,aa as D,Ze as F,h as _,Js as a,Zs as b,la as c,ga as d,Qs as e,na as f,ba as g,oa as h,pa as i,sa as j,Gi as k,da as l,ar as m,ra as n,ca as o,ua as p,Be as q,ge as r,ma as s,_a as t,we as u,ji as v,fe as w,ha as x,fa as y,cr as z};
12//# sourceMappingURL=index-B7J2Z2jS.js.map

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