GitHub Action
commited on
Commit
Β·
cb5b92f
1
Parent(s):
fd0d2b7
Sync from GitHub: 4ba992d4e2a1045e715ae27b529776cd8cd059fd
Browse files- .gitattributes +6 -0
- frontend/src/routes/voice-cloning/+page.svelte +3 -3
- hfstudio/static/_app/immutable/chunks/BwrmP8Nl.js +3 -0
- hfstudio/static/_app/immutable/chunks/HisAIUfC.js +1 -0
- hfstudio/static/_app/immutable/entry/app.DfdrJ3in.js +2 -0
- hfstudio/static/_app/immutable/entry/start.wgrpqMnA.js +1 -0
- hfstudio/static/_app/immutable/nodes/0.Lw11L6A1.js +4 -0
- hfstudio/static/_app/immutable/nodes/1.CRvpTlke.js +1 -0
- hfstudio/static/_app/immutable/nodes/4.C6kWolZc.js +14 -0
- hfstudio/static/_app/version.json +1 -1
- hfstudio/static/index.html +6 -6
.gitattributes
CHANGED
|
@@ -7,3 +7,9 @@
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
hfstudio/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
hfstudio/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
frontend/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
frontend/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
hfstudio/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
frontend/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
|
frontend/src/routes/voice-cloning/+page.svelte
CHANGED
|
@@ -60,7 +60,7 @@
|
|
| 60 |
|
| 61 |
// Validation helper functions
|
| 62 |
function isRecordingLongEnough(recording) {
|
| 63 |
-
return recording && recording.duration >=
|
| 64 |
}
|
| 65 |
|
| 66 |
function hasConsent(recording) {
|
|
@@ -543,7 +543,7 @@
|
|
| 543 |
<div class="mb-6">
|
| 544 |
<p class="text-center">
|
| 545 |
<em
|
| 546 |
-
>Record your voice for at least
|
| 547 |
unauthorized voice cloning, you must start by clearly saying "I consent to cloning my
|
| 548 |
voice" β the rest of the text is arbitrary. Try reading the sample above.</em
|
| 549 |
>
|
|
@@ -674,7 +674,7 @@
|
|
| 674 |
{:else}
|
| 675 |
β
|
| 676 |
{/if}
|
| 677 |
-
at least
|
| 678 |
</span>
|
| 679 |
<span
|
| 680 |
class="flex items-center gap-1 {selectedRecording
|
|
|
|
| 60 |
|
| 61 |
// Validation helper functions
|
| 62 |
function isRecordingLongEnough(recording) {
|
| 63 |
+
return recording && recording.duration >= 15;
|
| 64 |
}
|
| 65 |
|
| 66 |
function hasConsent(recording) {
|
|
|
|
| 543 |
<div class="mb-6">
|
| 544 |
<p class="text-center">
|
| 545 |
<em
|
| 546 |
+
>Record your voice for at least 15 seconds to create a voice clone. To prevent
|
| 547 |
unauthorized voice cloning, you must start by clearly saying "I consent to cloning my
|
| 548 |
voice" β the rest of the text is arbitrary. Try reading the sample above.</em
|
| 549 |
>
|
|
|
|
| 674 |
{:else}
|
| 675 |
β
|
| 676 |
{/if}
|
| 677 |
+
at least 15 seconds
|
| 678 |
</span>
|
| 679 |
<span
|
| 680 |
class="flex items-center gap-1 {selectedRecording
|
hfstudio/static/_app/immutable/chunks/BwrmP8Nl.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var kt=Object.defineProperty;var St=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>St(e,typeof t!="symbol"?t+"":t,n);import{S as Et,U as At,$ as Rt,a0 as Tt,a1 as It,a2 as Ut,a3 as Lt,a4 as $t,G as ve,a5 as xt,V as be,n as ge,s as Ct}from"./TRxHAhOH.js";class Ze extends Et{constructor(n){if(!n||!n.target&&!n.$$inline)throw new Error("'target' is a required option");super();R(this,"$$prop_def");R(this,"$$events_def");R(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}class Pt extends Ze{}const Ot=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:Ze,SvelteComponentTyped:Pt,afterUpdate:At,beforeUpdate:Rt,createEventDispatcher:Tt,getAllContexts:It,getContext:Ut,hasContext:Lt,onDestroy:$t,onMount:ve,setContext:xt,tick:be},Symbol.toStringTag,{value:"Module"}));class ie{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Nt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function jt(e){return e.split("%25").map(decodeURI).join("%25")}function Dt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function Bt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return l=>(n(l),i[o](l));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function Ft(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const Vt=new TextDecoder;function Mt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const qt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&Y.delete(Ie(e)),qt(e,t));const Y=new Map;function Gt(e,t){const n=Ie(e,t),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&Y.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=Mt(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Yt(e,t,n){if(Y.size>0){const r=Ie(e,n),a=Y.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(a.body,a.init);Y.delete(r)}}return window.fetch(t,n)}function Ie(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t!=null&&t.headers||t!=null&&t.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Ft(...a)}"]`}return r}const Ht=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Kt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Wt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(u=>parseInt(u,16))));const d=Ht.exec(c),[,h,y,f,p]=d;return t.push({name:f,matcher:p,optional:!!h,rest:!!y,chained:y?l===1&&i[0]==="":!1}),y?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function zt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Wt(e){return e.slice(1).split("/").filter(zt)}function Jt(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let l=a[o-i];if(c.chained&&c.rest&&i&&(l=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=t[o+1],h=a[o+1];d&&!d.rest&&d.optional&&h&&c.chained&&(i=0),!d&&!h&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Xt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,l,d]])=>{const{pattern:h,params:y}=Kt(o),f={id:o,exec:p=>{const u=h.exec(p);if(u)return Jt(u,y,r)},errors:[1,...d||[]].map(p=>e[p]),layouts:[0,...l||[]].map(i),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Fe(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const D=[];function Ue(e,t=ge){let n;const r=new Set;function a(o){if(Ct(e,o)&&(e=o,n)){const c=!D.length;for(const l of r)l[1](),D.push(l,e);if(c){for(let l=0;l<D.length;l+=2)D[l][0](D[l+1]);D.length=0}}}function s(o){a(o(e))}function i(o,c=ge){const l=[o,c];return r.add(l),r.size===1&&(n=t(a,s)||ge),o(e),()=>{r.delete(l),r.size===0&&n&&(n(),n=null)}}return{set:a,update:s,subscribe:i}}var Je;const $=((Je=globalThis.__sveltekit_wy8kgr)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_wy8kgr)==null?void 0:Xe.assets)??$??"",Qt="1761298566786",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",F="sveltekit:history",z="sveltekit:navigation",O={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ce=location.origin;function at(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function le(){return{x:pageXOffset,y:pageYOffset}}function B(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...O,"":O.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function ot(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function ke(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||fe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(r==null?void 0:r.origin)===ce&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function Q(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=B(o,"preload-code")),a===null&&(a=B(o,"preload-data")),t===null&&(t=B(o,"keepfocus")),n===null&&(n=B(o,"noscroll")),s===null&&(s=B(o,"reload")),i===null&&(i=B(o,"replacestate")),o=rt(o);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Me(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const st={v:()=>{}};function tn(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Zt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Qt;return i&&(e(!0),st.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function fe(e,t,n){return e.origin!==ce||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function qn(e){}function nn(e){const t=rn(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const an="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rn(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=an.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const on=-1,sn=-2,cn=-3,ln=-4,fn=-5,un=-6;function dn(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===on)return;if(s===cn)return NaN;if(s===ln)return 1/0;if(s===fn)return-1/0;if(s===un)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],l=t==null?void 0:t[c];if(l)return r[s]=l(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let f=1;f<o.length;f+=1)d.add(a(o[f]));break;case"Map":const h=new Map;r[s]=h;for(let f=1;f<o.length;f+=2)h.set(a(o[f]),a(o[f+1]));break;case"RegExp":r[s]=new RegExp(o[1],o[2]);break;case"Object":r[s]=Object(o[1]);break;case"BigInt":r[s]=BigInt(o[1]);break;case"null":const y=Object.create(null);r[s]=y;for(let f=1;f<o.length;f+=2)y[o[f]]=a(o[f+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const f=globalThis[c],p=new f(a(o[1]));r[s]=o[2]!==void 0?p.subarray(o[2],o[3]):p;break}case"ArrayBuffer":{const f=o[1],p=nn(f);r[s]=p;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=c.slice(9);r[s]=Temporal[f].from(o[1]);break}case"URL":{const f=new URL(o[1]);r[s]=f;break}case"URLSearchParams":{const f=new URLSearchParams(o[1]);r[s]=f;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);r[s]=c;for(let l=0;l<o.length;l+=1){const d=o[l];d!==sn&&(c[l]=a(d))}}else{const c={};r[s]=c;for(const l in o){if(l==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=o[l];c[l]=a(d)}}return r[s]}return a(0)}const it=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...it];const hn=new Set([...it]);[...hn];function pn(e){return e.filter(t=>t!=null)}const gn="x-sveltekit-invalidated",mn="x-sveltekit-trailing-slash";function ee(e){return e instanceof ie||e instanceof Te?e.status:500}function _n(e){return e instanceof Te?e.text:"Internal Error"}let T,W,we;const wn=ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(ve.toString());wn?(T={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},we={current:!1}):(T=new class{constructor(){R(this,"data",$state.raw({}));R(this,"form",$state.raw(null));R(this,"error",$state.raw(null));R(this,"params",$state.raw({}));R(this,"route",$state.raw({id:null}));R(this,"state",$state.raw({}));R(this,"status",$state.raw(-1));R(this,"url",$state.raw(new URL("https://example.com")))}},W=new class{constructor(){R(this,"current",$state.raw(null))}},we=new class{constructor(){R(this,"current",$state.raw(!1))}},st.v=()=>we.current=!0);function yn(e){Object.assign(T,e)}const vn="/__data.json",bn=".html__data.json";function kn(e){return e.endsWith(".html")?e.replace(/\.html$/,bn):e.replace(/\/$/,"")+vn}const qe={spanContext(){return Sn},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Sn={traceId:"",spanId:"",traceFlags:0},{tick:En}=Ot,An=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Qe(tt)??{},J=Qe(et)??{},C={url:Me({}),page:Me({}),navigating:Ue(null),updated:tn()};function Le(e){j[e]=le()}function Rn(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ct(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration($||"/");e&&await e.update()}}function Ge(){}let $e,Se,te,x,Ee,S;const ne=[],ae=[];let U=null;const Z=new Map,lt=new Set,Tn=new Set,H=new Set;let b={branch:[],error:null,url:null},xe=!1,re=!1,Ye=!0,X=!1,G=!1,ft=!1,Ce=!1,ut,A,L,N;const K=new Set,He=new Map;async function Kn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_wy8kgr)!=null&&s.data&&globalThis.__sveltekit_wy8kgr.data,document.URL!==location.href&&(location.href=location.href),S=e,await((o=(i=e.hooks).init)==null?void 0:o.call(i)),$e=Xt(e),x=document.documentElement,Ee=t,Se=e.nodes[0],te=e.nodes[1],Se(),te(),A=(c=history.state)==null?void 0:c[F],L=(l=history.state)==null?void 0:l[z],A||(A=L=Date.now(),history.replaceState({...history.state,[F]:A,[z]:L},""));const r=j[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await V({type:"enter",url:at(S.hash?Fn(new URL(location.href)):location.href),replace_state:!0}),a()),jn()}function In(){ne.length=0,Ce=!1}function dt(e){ae.some(t=>t==null?void 0:t.snapshot)&&(J[e]=ae.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function ht(e){var t;(t=J[e])==null||t.forEach((n,r)=>{var a,s;(s=(a=ae[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function Ke(){Le(A),Fe(tt,j),dt(L),Fe(et,J)}async function Un(e,t,n,r){let a;t.invalidateAll&&(U=null),await V({type:"goto",url:at(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ce=!0,a=[...He.keys()]),t.invalidate&&t.invalidate.forEach(Nn)}}),t.invalidateAll&&be().then(be).then(()=>{He.forEach(({resource:s},i)=>{var o;a!=null&&a.includes(i)&&((o=s.refresh)==null||o.call(s))})})}async function Ln(e){if(e.id!==(U==null?void 0:U.id)){const t={};K.add(t),U={id:e.id,token:t,promise:mt({...e,preload:t}).then(n=>(K.delete(t),n.type==="loaded"&&n.state.error&&(U=null),n))}}return U.promise}async function ye(e){var n;const t=(n=await de(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].map(r=>r==null?void 0:r[1]()))}function pt(e,t,n){var a;b=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(T,e.props.page),ut=new S.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),ht(L),n){const s={from:null,to:{params:b.params,route:{id:((a=b.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(i=>i(s))}re=!0}function oe({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if($&&(e.pathname===$||e.pathname===$+"/"))o="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(o=f.slash);e.pathname=Nt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:pn(n).map(f=>f.node.component),page:je(T)}};i!==void 0&&(c.props.form=i);let l={},d=!T,h=0;for(let f=0;f<Math.max(n.length,b.branch.length);f+=1){const p=n[f],u=b.branch[f];(p==null?void 0:p.data)!==(u==null?void 0:u.data)&&(d=!0),p&&(l={...l,...p.data},d&&(c.props[`data_${h}`]=l),h+=1)}return(!b.url||e.href!==b.url.href||b.error!==a||i!==void 0&&i!==T.form||d)&&(c.props.page={error:a,params:t,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:i??null,data:d?l:T.data}),c}async function Pe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){var d,h,y;let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if((d=l.universal)!=null&&d.load){let f=function(...u){for(const g of u){const{href:_}=new URL(g,n);c.dependencies.add(_)}};const p={tracing:{enabled:!1,root:qe,current:qe},route:new Proxy(a,{get:(u,g)=>(o&&(c.route=!0),u[g])}),params:new Proxy(r,{get:(u,g)=>(o&&c.params.add(g),u[g])}),data:(s==null?void 0:s.data)??null,url:Bt(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},S.hash),async fetch(u,g){u instanceof Request&&(g={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u==null?void 0:u.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...g});const{resolved:_,promise:I}=gt(u,g,n);return o&&f(_.href),I},setHeaders:()=>{},depends:f,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await l.universal.load.call(null,p)??null}return{node:l,loader:e,server:s,universal:(h=l.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(s==null?void 0:s.data)??null,slash:((y=l.universal)==null?void 0:y.trailingSlash)??(s==null?void 0:s.slash)}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=re?Yt(r,a.href,t):Gt(r,t);return{resolved:a,promise:s}}function ze(e,t,n,r,a,s){if(Ce)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==b.params[i])return!0;for(const i of a.dependencies)if(ne.some(o=>o(new URL(i))))return!0;return!1}function Oe(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function $n(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function We({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:je(T),constructors:[]}}}async function mt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return K.delete(U.token),U.promise;const{errors:i,layouts:o,leaf:c}=a,l=[...o,c];i.forEach(w=>w==null?void 0:w().catch(()=>{})),l.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let d=null;const h=b.url?e!==se(b.url):!1,y=b.route?a.id!==b.route.id:!1,f=$n(b.url,n);let p=!1;const u=l.map((w,m)=>{var P;const v=b.branch[m],k=!!(w!=null&&w[0])&&((v==null?void 0:v.loader)!==w[1]||ze(p,y,h,f,(P=v.server)==null?void 0:P.uses,r));return k&&(p=!0),k});if(u.some(Boolean)){try{d=await yt(n,u)}catch(w){const m=await M(w,{url:n,params:r,route:{id:e}});return K.has(s)?We({error:m,url:n,params:r,route:a}):ue({status:ee(w),error:m,url:n,route:a})}if(d.type==="redirect")return d}const g=d==null?void 0:d.nodes;let _=!1;const I=l.map(async(w,m)=>{var he;if(!w)return;const v=b.branch[m],k=g==null?void 0:g[m];if((!k||k.type==="skip")&&w[1]===(v==null?void 0:v.loader)&&!ze(_,y,h,f,(he=v.universal)==null?void 0:he.uses,r))return v;if(_=!0,(k==null?void 0:k.type)==="error")throw k;return Pe({loader:w[1],url:n,params:r,route:a,parent:async()=>{var Be;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(Be=await I[pe])==null?void 0:Be.data);return De},server_data_node:Oe(k===void 0&&w[0]?{type:"skip"}:k??null,w[0]?v==null?void 0:v.server:void 0)})});for(const w of I)w.catch(()=>{});const E=[];for(let w=0;w<l.length;w+=1)if(l[w])try{E.push(await I[w])}catch(m){if(m instanceof Re)return{type:"redirect",location:m.location};if(K.has(s))return We({error:await M(m,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let v=ee(m),k;if(g!=null&&g.includes(m))v=m.status??v,k=m.error;else if(m instanceof ie)k=m.body;else{if(await C.updated.check())return await ct(),await q(n);k=await M(m,{params:r,url:n,route:{id:a.id}})}const P=await xn(w,E,i);return P?oe({url:n,params:r,branch:E.slice(0,P.idx).concat(P.node),status:v,error:k,route:a}):await wt(n,{id:a.id},k,v)}else E.push(void 0);return oe({url:n,params:r,branch:E,status:200,error:null,route:a,form:t?void 0:null})}async function xn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ue({status:e,error:t,url:n,route:r}){const a={};let s=null;if(S.server_loads[0]===0)try{const o=await yt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==ce||n.pathname!==location.pathname||xe)&&await q(n)}try{const o=await Pe({loader:Se,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Oe(s)}),c={node:await te(),loader:te,universal:null,server:null,data:null};return oe({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Re)return Un(new URL(o.location,location.href),{},0);throw o}}async function Cn(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const r=(async()=>{let a=await S.hooks.reroute({url:new URL(e),fetch:async(s,i)=>gt(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);S.hash?s.hash=a:s.pathname=a,a=s}return a})();Z.set(t,r),n=await r}catch{Z.delete(t);return}return n}async function de(e,t){if(e&&!fe(e,$,S.hash)){const n=await Cn(e);if(!n)return;const r=Pn(n);for(const a of $e){const s=a.exec(r);if(s)return{id:se(e),invalidating:t,route:a,params:Dt(s),url:e}}}}function Pn(e){return jt(S.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice($.length))||"/"}function se(e){return(S.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Ne(b,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||lt.forEach(c=>c(o)),s?null:i}async function V({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:l=Ge,block:d=Ge,event:h}){const y=N;N=c;const f=await de(t,!1),p=e==="enter"?Ne(b,f,t,e):_t({url:t,type:e,delta:n==null?void 0:n.delta,intent:f,event:h});if(!p){d(),N===c&&(N=y);return}const u=A,g=L;l(),X=!0,re&&p.navigation.type!=="enter"&&C.navigating.set(W.current=p.navigation);let _=f&&await mt(f);if(!_){if(fe(t,$,S.hash))return await q(t,s);_=await wt(t,{id:null},await M(new Te(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=(f==null?void 0:f.url)||t,N!==c)return p.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(o<20){await V({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),p.fulfil(void 0);return}_=await ue({status:500,error:await M(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await C.updated.check()&&(await ct(),await q(t,s));if(In(),Le(u),dt(g),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=n?n.state:i,!n){const m=s?0:1,v={[F]:A+=m,[z]:L+=m,[nt]:i};(s?history.replaceState:history.pushState).call(history,v,"",t),s||Rn(A,L)}if(U=null,_.props.page.state=i,re){const m=(await Promise.all(Array.from(Tn,v=>v(p.navigation)))).filter(v=>typeof v=="function");if(m.length>0){let v=function(){m.forEach(k=>{H.delete(k)})};m.push(v),m.forEach(k=>{H.add(k)})}b=_.state,_.props.page&&(_.props.page.url=t),ut.$set(_.props),yn(_.props.page),ft=!0}else pt(_,Ee,!1);const{activeElement:I}=document;await En();let E=n?n.scroll:a?le():null;if(Ye){const m=t.hash&&document.getElementById(bt(t));if(E)scrollTo(E.x,E.y);else if(m){m.scrollIntoView();const{top:v,left:k}=m.getBoundingClientRect();E={x:pageXOffset+k,y:pageYOffset+v}}else scrollTo(0,0)}const w=document.activeElement!==I&&document.activeElement!==document.body;!r&&!w&&Bn(t,E),Ye=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),H.forEach(m=>m(p.navigation)),C.navigating.set(W.current=null)}async function wt(e,t,n,r,a){return e.origin===ce&&e.pathname===location.pathname&&!xe?await ue({status:r,error:n,url:e,route:t}):await q(e,a)}function On(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,O.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],O.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(ye(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const l=ot(o,x),d=l===t&&c>=n;if(!l||d)return;const{url:h,external:y,download:f}=ke(l,$,S.hash);if(y||f)return;const p=Q(l),u=h&&se(b.url)===se(h);if(!(p.reload||u))if(c<=p.preload_data){t=l,n=O.tap;const g=await de(h,!1);if(!g)return;Ln(g)}else c<=p.preload_code&&(t=l,n=c,ye(h))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:l,download:d}=ke(o,$,S.hash);if(l||d)continue;const h=Q(o);h.reload||(h.preload_code===O.viewport&&a.observe(o),h.preload_code===O.eager&&ye(c))}}H.add(i),i()}function M(e,t){if(e instanceof ie)return e.body;const n=ee(e),r=_n(e);return S.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Nn(e){if(typeof e=="function")ne.push(e);else{const{href:t}=new URL(e,location.href);ne.push(n=>n.href===t)}}function jn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(Ke(),!X){const a=Ne(b,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};lt.forEach(i=>i(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ke()}),(t=navigator.connection)!=null&&t.saveData||On(),x.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=ot(n.composedPath()[0],x);if(!r)return;const{url:a,external:s,target:i,download:o}=ke(r,$,S.hash);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Q(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||o)return;const[d,h]=(S.hash?a.hash.replace(/^#/,""):a.href).split("#"),y=d===me(location);if(s||c.reload&&(!y||!h)){_t({url:a,type:"link",event:n})?X=!0:n.preventDefault();return}if(h!==void 0&&y){const[,f]=b.url.href.split("#");if(f===h){if(n.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const p=r.ownerDocument.getElementById(decodeURIComponent(h));p&&(p.scrollIntoView(),p.focus())}return}if(G=!0,Le(A),e(a),!c.replace_state)return;G=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await V({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:n})}),x.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const o=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(fe(o,$,!1))return;const c=n.target,l=Q(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c,a);o.search=new URLSearchParams(d).toString(),V({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ae){if((r=n.state)!=null&&r[F]){const a=n.state[F];if(N={},a===A)return;const s=j[a],i=n.state[nt]??{},o=new URL(n.state[en]??location.href),c=n.state[z],l=b.url?me(location)===me(b.url):!1;if(c===L&&(ft||l)){i!==T.state&&(T.state=i),e(o),j[A]=le(),s&&scrollTo(s.x,s.y),A=a;return}const h=a-A;await V({type:"popstate",url:o,popped:{state:i,scroll:s,delta:h},accept:()=>{A=a,L=c},block:()=>{history.go(-h)},nav_token:N,event:n})}else if(!G){const a=new URL(location.href);e(a),S.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[F]:++A,[z]:L},"",location.href))});for(const n of document.querySelectorAll("link"))An.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(W.current=null)});function e(n){b.url=T.url=n,C.page.set(je(T)),C.page.notify()}}async function Dn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){xe=!0;const l=new URL(location.href);let d;({params:a={},route:s={id:null}}=await de(l,!1)||{}),d=$e.find(({id:f})=>f===s.id);let h,y=!0;try{const f=r.map(async(u,g)=>{const _=o[g];return _!=null&&_.uses&&(_.uses=vt(_.uses)),Pe({loader:S.nodes[u],url:l,params:a,route:s,parent:async()=>{const I={};for(let E=0;E<g;E+=1)Object.assign(I,(await f[E]).data);return I},server_data_node:Oe(_)})}),p=await Promise.all(f);if(d){const u=d.layouts;for(let g=0;g<u.length;g++)u[g]||p.splice(g,0,void 0)}h=oe({url:l,params:a,branch:p,status:t,error:n,form:c,route:d??null})}catch(f){if(f instanceof Re){await q(new URL(f.location,location.href));return}h=await ue({status:ee(f),error:await M(f,{url:l,params:a,route:s}),url:l,route:s}),e.textContent="",y=!1}h.props.page&&(h.props.page.state={}),pt(h,e,y)}async function yt(e,t){var s;const n=new URL(e);n.pathname=kn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(mn,"1"),n.searchParams.append(gn,t.map(i=>i?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let i;throw(s=a.headers.get("content-type"))!=null&&s.includes("application/json")?i=await a.json():a.status===404?i="Not Found":a.status===500&&(i="Internal Error"),new ie(a.status,i)}return new Promise(async i=>{var h;const o=new Map,c=a.body.getReader();function l(y){return dn(y,{...S.decoders,Promise:f=>new Promise((p,u)=>{o.set(f,{fulfil:p,reject:u})})})}let d="";for(;;){const{done:y,value:f}=await c.read();if(y&&!d)break;for(d+=!f&&d?`
|
| 2 |
+
`:Vt.decode(f,{stream:!0});;){const p=d.indexOf(`
|
| 3 |
+
`);if(p===-1)break;const u=JSON.parse(d.slice(0,p));if(d=d.slice(p+1),u.type==="redirect")return i(u);if(u.type==="data")(h=u.nodes)==null||h.forEach(g=>{(g==null?void 0:g.type)==="data"&&(g.uses=vt(g.uses),g.data=l(g.data))}),i(u);else if(u.type==="chunk"){const{id:g,data:_,error:I}=u,E=o.get(g);o.delete(g),I?E.reject(l(I)):E.fulfil(l(_))}}}})}function vt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Ae=!1;function Bn(e,t=null){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=bt(e);if(r&&document.getElementById(r)){const{x:s,y:i}=t??le();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(`#${r}`),S.hash&&location.replace(e.hash),history.replaceState(o,"",e.hash),scrollTo(s,i),Ae=!1})}else{const s=document.body,i=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),i!==null?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let i=0;i<a.rangeCount;i+=1)s.push(a.getRangeAt(i));setTimeout(()=>{if(a.rangeCount===s.length){for(let i=0;i<a.rangeCount;i+=1){const o=s[i],c=a.getRangeAt(i);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}a.removeAllRanges()}})}}}function Ne(e,t,n,r){var c,l;let a,s;const i=new Promise((d,h)=>{a=d,s=h});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((l=t==null?void 0:t.route)==null?void 0:l.id)??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function je(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Fn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function bt(e){let t;if(S.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Kn as a,qn as l,C as s};
|
hfstudio/static/_app/immutable/chunks/HisAIUfC.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{s as e}from"./BwrmP8Nl.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
|
hfstudio/static/_app/immutable/entry/app.DfdrJ3in.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Lw11L6A1.js","../chunks/TRxHAhOH.js","../chunks/IHki7fMi.js","../chunks/HisAIUfC.js","../chunks/BwrmP8Nl.js","../chunks/Bv5vELPx.js","../chunks/nn-QVLrM.js","../chunks/BhRpzVYR.js","../assets/0.B_i4o2sT.css","../nodes/1.CRvpTlke.js","../nodes/2.1j9YdqU7.js","../chunks/DUd0gdPo.js","../chunks/BNlacN_j.js","../chunks/gtFtmmyB.js","../assets/2.CdRym-eY.css","../nodes/3.CLzJht-f.js","../assets/3.BNkL3CE9.css","../nodes/4.C6kWolZc.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{S as C,i as U,s as q,d,w as h,x as g,N as O,K as S,b as v,h as B,M as w,k as W,U as z,G,V as K,W as y,v as P,A as R,y as L,z as D,p as T,Q as p,e as Q,f as F,j as H,T as V,a as J,g as X,t as Y}from"../chunks/TRxHAhOH.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},I={},A=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(f=>{if(f=M(f,i),f in I)return;I[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const E=t[k];if(E.href===f&&(!l||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${_}`))return;const m=document.createElement("link");if(m.rel=l?"stylesheet":Z,l||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),l)return new Promise((k,E)=>{m.addEventListener("load",k),m.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${f}`)))})}))}function u(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return r.then(t=>{for(const s of t||[])s.status==="rejected"&&u(s.reason);return e().catch(u)})},ae={};function $(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[12](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}r?(e=y(r,u(t)),t[12](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[12](null),e&&P(e,t)}}}function x(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],params:t[1].params,$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=y(r,u(o)),o[11](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}r?(e=y(r,u(t)),t[11](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&2&&(a.params=t[1].params),s&8239&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[11](null),e&&P(e,t)}}}function ee(o){let e,n,i;var r=o[2][1];function u(t,s){return{props:{data:t[5],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[10](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][1])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}r?(e=y(r,u(t)),t[10](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&32&&(a.data=t[5]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[10](null),e&&P(e,t)}}}function N(o){let e,n=o[7]&&j(o);return{c(){e=H("div"),n&&n.c(),this.h()},l(i){e=Q(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=F(e);n&&n.l(r),r.forEach(d),this.h()},h(){T(e,"id","svelte-announcer"),T(e,"aria-live","assertive"),T(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(i,r){v(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=j(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function j(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){v(n,e,i)},p(n,i){i&256&&J(e,n[8])},d(n){n&&d(e)}}}function te(o){let e,n,i,r,u;const t=[x,$],s=[];function a(l,_){return l[2][1]?0:1}e=a(o),n=s[e]=t[e](o);let f=o[6]&&N(o);return{c(){n.c(),i=W(),f&&f.c(),r=w()},l(l){n.l(l),i=B(l),f&&f.l(l),r=w()},m(l,_){s[e].m(l,_),v(l,i,_),f&&f.m(l,_),v(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(O(),h(s[b],1,1,()=>{s[b]=null}),S(),n=s[e],n?n.p(l,_):(n=s[e]=t[e](l),n.c()),g(n,1),n.m(i.parentNode,i)),l[6]?f?f.p(l,_):(f=N(l),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},i(l){u||(g(n),u=!0)},o(l){h(n),u=!1},d(l){l&&(d(i),d(r)),s[e].d(l),f&&f.d(l)}}}function ne(o,e,n){let{stores:i}=e,{page:r}=e,{constructors:u}=e,{components:t=[]}=e,{form:s}=e,{data_0:a=null}=e,{data_1:f=null}=e;z(i.page.notify);let l=!1,_=!1,b=null;G(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),K().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){V[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){V[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function E(c){V[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return o.$$set=c=>{"stores"in c&&n(9,i=c.stores),"page"in c&&n(1,r=c.page),"constructors"in c&&n(2,u=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(3,s=c.form),"data_0"in c&&n(4,a=c.data_0),"data_1"in c&&n(5,f=c.data_1)},o.$$.update=()=>{o.$$.dirty&514&&i.page.set(r)},[t,r,u,s,a,f,l,_,b,i,m,k,E]}class le extends C{constructor(e){super(),U(this,e,ne,te,q,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>A(()=>import("../nodes/0.Lw11L6A1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),()=>A(()=>import("../nodes/1.CRvpTlke.js"),__vite__mapDeps([9,1,2,3,4]),import.meta.url),()=>A(()=>import("../nodes/2.1j9YdqU7.js"),__vite__mapDeps([10,1,11,7,2,12,13,14]),import.meta.url),()=>A(()=>import("../nodes/3.CLzJht-f.js"),__vite__mapDeps([15,1,11,7,2,5,13,16]),import.meta.url),()=>A(()=>import("../nodes/4.C6kWolZc.js"),__vite__mapDeps([17,1,7,2,12,6,13]),import.meta.url)],ce=[],ue={"/":[2],"/code-recorder":[3],"/voice-cloning":[4]},se={handleError:({error:o})=>{console.error(o)},reroute:()=>{},transport:{}},ie=Object.fromEntries(Object.entries(se.transport).map(([o,e])=>[o,e.decode])),_e=!1,me=(o,e)=>ie[o](e);export{me as decode,ie as decoders,ue as dictionary,_e as hash,se as hooks,ae as matchers,fe as nodes,le as root,ce as server_loads};
|
hfstudio/static/_app/immutable/entry/start.wgrpqMnA.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{l as o,a as r}from"../chunks/BwrmP8Nl.js";export{o as load_css,r as start};
|
hfstudio/static/_app/immutable/nodes/0.Lw11L6A1.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as at,i as ot,s as rt,C as it,d as E,v as Qe,w as Be,x as Pe,p as s,D as ut,E as ct,F as dt,b as _e,c as e,y as Xe,e as a,f as R,r as p,h as u,z as Ze,j as o,k as c,A as $e,l as ft,G as pt,H as ht,I as et,m as xe,a as mt,g as gt,t as xt}from"../chunks/TRxHAhOH.js";import"../chunks/IHki7fMi.js";import{p as _t}from"../chunks/HisAIUfC.js";import{N as bt}from"../chunks/Bv5vELPx.js";import{M as vt}from"../chunks/nn-QVLrM.js";function tt(f){let r,n,d,H="Sign In with HuggingFace Token",z,t,g,A="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",q,_,C=`1. Go to <a href="https://huggingface.co/settings/tokens" target="_blank" class="underline text-blue-600">HuggingFace Settings</a><br/>
|
| 2 |
+
2. Create a new token with "Inference API" permissions<br/>
|
| 3 |
+
3. Copy and paste it below`,M,Y,b,B,K="HuggingFace Token",G,x,P,D,I,O,l="Cancel",w,h,S="Sign In",V,L,T=f[5]&&nt(),y=f[4]&&st(f);return{c(){r=o("div"),n=o("div"),d=o("h2"),d.textContent=H,z=c(),t=o("div"),g=o("p"),g.innerHTML=A,q=c(),_=o("p"),_.innerHTML=C,M=c(),T&&T.c(),Y=c(),b=o("div"),B=o("label"),B.textContent=K,G=c(),x=o("input"),P=c(),y&&y.c(),D=c(),I=o("div"),O=o("button"),O.textContent=l,w=c(),h=o("button"),h.textContent=S,this.h()},l(v){r=a(v,"DIV",{class:!0});var J=R(r);n=a(J,"DIV",{class:!0});var F=R(n);d=a(F,"H2",{class:!0,"data-svelte-h":!0}),p(d)!=="svelte-1t0ehet"&&(d.textContent=H),z=u(F),t=a(F,"DIV",{class:!0});var U=R(t);g=a(U,"P",{class:!0,"data-svelte-h":!0}),p(g)!=="svelte-344vn4"&&(g.innerHTML=A),q=u(U),_=a(U,"P",{class:!0,"data-svelte-h":!0}),p(_)!=="svelte-orsfwv"&&(_.innerHTML=C),M=u(U),T&&T.l(U),U.forEach(E),Y=u(F),b=a(F,"DIV",{class:!0});var Q=R(b);B=a(Q,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),p(B)!=="svelte-vtbmxo"&&(B.textContent=K),G=u(Q),x=a(Q,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),P=u(Q),y&&y.l(Q),Q.forEach(E),D=u(F),I=a(F,"DIV",{class:!0});var X=R(I);O=a(X,"BUTTON",{class:!0,"data-svelte-h":!0}),p(O)!=="svelte-csk0rj"&&(O.textContent=l),w=u(X),h=a(X,"BUTTON",{class:!0,"data-svelte-h":!0}),p(h)!=="svelte-1nxas5u"&&(h.textContent=S),X.forEach(E),F.forEach(E),J.forEach(E),this.h()},h(){s(d,"class","text-xl font-semibold mb-4"),s(g,"class","text-blue-800 mb-2"),s(_,"class","text-blue-700"),s(t,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),s(B,"for","token"),s(B,"class","block text-sm font-medium text-gray-700 mb-2"),s(x,"id","token"),s(x,"type","password"),s(x,"placeholder","hf_..."),s(x,"class","w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent"),s(b,"class","mb-4"),s(O,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),s(h,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),s(I,"class","flex justify-end gap-3"),s(n,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),s(r,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(v,J){_e(v,r,J),e(r,n),e(n,d),e(n,z),e(n,t),e(t,g),e(t,q),e(t,_),e(t,M),T&&T.m(t,null),e(n,Y),e(n,b),e(b,B),e(b,G),e(b,x),et(x,f[3]),e(b,P),y&&y.m(b,null),e(n,D),e(n,I),e(I,O),e(I,w),e(I,h),V||(L=[xe(x,"input",f[13]),xe(x,"keydown",f[14]),xe(O,"click",f[9]),xe(h,"click",f[10])],V=!0)},p(v,J){v[5]?T||(T=nt(),T.c(),T.m(t,null)):T&&(T.d(1),T=null),J&8&&x.value!==v[3]&&et(x,v[3]),v[4]?y?y.p(v,J):(y=st(v),y.c(),y.m(b,null)):y&&(y.d(1),y=null)},d(v){v&&E(r),T&&T.d(),y&&y.d(),V=!1,ht(L)}}}function nt(f){let r,n=`<strong>Tip:</strong> You can also run <code>huggingface-cli login</code> in your terminal
|
| 4 |
+
to automatically use your local token.`;return{c(){r=o("p"),r.innerHTML=n,this.h()},l(d){r=a(d,"P",{class:!0,"data-svelte-h":!0}),p(r)!=="svelte-xrut8w"&&(r.innerHTML=n),this.h()},h(){s(r,"class","text-blue-600 mt-2")},m(d,H){_e(d,r,H)},d(d){d&&E(r)}}}function st(f){let r,n;return{c(){r=o("p"),n=xt(f[4]),this.h()},l(d){r=a(d,"P",{class:!0});var H=R(r);n=gt(H,f[4]),H.forEach(E),this.h()},h(){s(r,"class","text-red-600 text-sm mt-1")},m(d,H){_e(d,r,H),e(r,n)},p(d,H){H&16&&mt(n,d[4])},d(d){d&&E(r)}}}function wt(f){let r,n,d,H='<div class="flex items-center gap-3"><img src="/assets/hf-studio-logo.png" alt="HF Logo" class="w-8 h-8"/> <h1 class="text-xl font-semibold">HFStudio<sup class="text-xs text-gray-500 ml-1">BETA</sup></h1></div>',z,t,g,A="Audio",q,_,C,M="ποΈ",Y,b,B="Text to Speech",K,G,x,P,D,I,O="Voice Cloning",l,w,h,S="<span>π§</span> <span>Speech to Text</span>",V,L,T="<span>πΌ</span> <span>Sound Effects</span>",y,v,J="<span>πΈ</span> <span>Music Generation</span>",F,U,Q="<span>π</span> <span>Audio Enhancement</span>",X,fe,Oe="Image",be,Z,Ve="<span>π¨</span> <span>Text to Image</span>",ve,$,je="<span>πΌοΈ</span> <span>Image to Image</span>",we,ee,Fe="<span>βοΈ</span> <span>Remove Background</span>",Te,te,Re="<span>π</span> <span>Upscale Image</span>",ye,ne,ze="<span>π</span> <span>Face Swap</span>",Ce,se,qe="<span>π</span> <span>Image to Text</span>",Le,pe,Ge="Video",ke,le,De="<span>π¬</span> <span>Text to Video</span>",Ie,ae,Je="<span>ποΈ</span> <span>Image to Video</span>",He,oe,We="<span>β¨</span> <span>Video Enhancement</span>",Me,re,Ye="<span>π€</span> <span>Lip Sync</span>",Ne,ie,Ke="<span>π£οΈ</span> <span>Video Dubbing</span>",Ee,ue,ce,Se,Ue,de;P=new vt({props:{size:16}}),ce=new bt({props:{isLoggedIn:f[0],username:f[1],handleAuthAction:f[8],flashButton:f[6],pageTitle:lt(f[7].url.pathname)}});const Ae=f[12].default,j=it(Ae,f,f[11],null);let N=f[2]&&tt(f);return{c(){r=o("div"),n=o("aside"),d=o("div"),d.innerHTML=H,z=c(),t=o("nav"),g=o("div"),g.textContent=A,q=c(),_=o("a"),C=o("span"),C.textContent=M,Y=c(),b=o("span"),b.textContent=B,G=c(),x=o("a"),$e(P.$$.fragment),D=c(),I=o("span"),I.textContent=O,w=c(),h=o("button"),h.innerHTML=S,V=c(),L=o("button"),L.innerHTML=T,y=c(),v=o("button"),v.innerHTML=J,F=c(),U=o("button"),U.innerHTML=Q,X=c(),fe=o("div"),fe.textContent=Oe,be=c(),Z=o("button"),Z.innerHTML=Ve,ve=c(),$=o("button"),$.innerHTML=je,we=c(),ee=o("button"),ee.innerHTML=Fe,Te=c(),te=o("button"),te.innerHTML=Re,ye=c(),ne=o("button"),ne.innerHTML=ze,Ce=c(),se=o("button"),se.innerHTML=qe,Le=c(),pe=o("div"),pe.textContent=Ge,ke=c(),le=o("button"),le.innerHTML=De,Ie=c(),ae=o("button"),ae.innerHTML=Je,He=c(),oe=o("button"),oe.innerHTML=We,Me=c(),re=o("button"),re.innerHTML=Ye,Ne=c(),ie=o("button"),ie.innerHTML=Ke,Ee=c(),ue=o("main"),$e(ce.$$.fragment),Se=c(),j&&j.c(),Ue=c(),N&&N.c(),this.h()},l(m){r=a(m,"DIV",{class:!0});var k=R(r);n=a(k,"ASIDE",{class:!0});var W=R(n);d=a(W,"DIV",{class:!0,"data-svelte-h":!0}),p(d)!=="svelte-xzbt87"&&(d.innerHTML=H),z=u(W),t=a(W,"NAV",{class:!0});var i=R(t);g=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(g)!=="svelte-52jqai"&&(g.textContent=A),q=u(i),_=a(i,"A",{href:!0,class:!0});var he=R(_);C=a(he,"SPAN",{"data-svelte-h":!0}),p(C)!=="svelte-1yx42xi"&&(C.textContent=M),Y=u(he),b=a(he,"SPAN",{"data-svelte-h":!0}),p(b)!=="svelte-2j89jk"&&(b.textContent=B),he.forEach(E),G=u(i),x=a(i,"A",{href:!0,class:!0});var me=R(x);Ze(P.$$.fragment,me),D=u(me),I=a(me,"SPAN",{"data-svelte-h":!0}),p(I)!=="svelte-10pmll2"&&(I.textContent=O),me.forEach(E),w=u(i),h=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(h)!=="svelte-wf0x5d"&&(h.innerHTML=S),V=u(i),L=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(L)!=="svelte-x7bha3"&&(L.innerHTML=T),y=u(i),v=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(v)!=="svelte-1tyblmt"&&(v.innerHTML=J),F=u(i),U=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(U)!=="svelte-1emrjb3"&&(U.innerHTML=Q),X=u(i),fe=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(fe)!=="svelte-1pmjg3x"&&(fe.textContent=Oe),be=u(i),Z=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(Z)!=="svelte-11wbuiv"&&(Z.innerHTML=Ve),ve=u(i),$=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p($)!=="svelte-ol2yvl"&&($.innerHTML=je),we=u(i),ee=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ee)!=="svelte-ttigif"&&(ee.innerHTML=Fe),Te=u(i),te=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(te)!=="svelte-ixgtu4"&&(te.innerHTML=Re),ye=u(i),ne=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ne)!=="svelte-r2ax5z"&&(ne.innerHTML=ze),Ce=u(i),se=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(se)!=="svelte-n9rt3x"&&(se.innerHTML=qe),Le=u(i),pe=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(pe)!=="svelte-1gfxetb"&&(pe.textContent=Ge),ke=u(i),le=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(le)!=="svelte-gox1rd"&&(le.innerHTML=De),Ie=u(i),ae=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ae)!=="svelte-13pimzy"&&(ae.innerHTML=Je),He=u(i),oe=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(oe)!=="svelte-c86wph"&&(oe.innerHTML=We),Me=u(i),re=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(re)!=="svelte-wkify0"&&(re.innerHTML=Ye),Ne=u(i),ie=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ie)!=="svelte-10ou061"&&(ie.innerHTML=Ke),i.forEach(E),W.forEach(E),Ee=u(k),ue=a(k,"MAIN",{class:!0});var ge=R(ue);Ze(ce.$$.fragment,ge),Se=u(ge),j&&j.l(ge),ge.forEach(E),Ue=u(k),N&&N.l(k),k.forEach(E),this.h()},h(){s(d,"class","px-4 py-4 border-b border-gray-200 min-h-[73px] flex items-center"),s(g,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(_,"href","/"),s(_,"class",K="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(f[7].url.pathname==="/"?"bg-gray-100":"")),s(x,"href","/voice-cloning"),s(x,"class",l="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(f[7].url.pathname==="/voice-cloning"?"bg-gray-100":"")),s(h,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),h.disabled=!0,s(L,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),L.disabled=!0,s(v,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),v.disabled=!0,s(U,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),U.disabled=!0,s(fe,"class","mt-4 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(Z,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),Z.disabled=!0,s($,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),$.disabled=!0,s(ee,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ee.disabled=!0,s(te,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),te.disabled=!0,s(ne,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ne.disabled=!0,s(se,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),se.disabled=!0,s(pe,"class","mt-4 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(le,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),le.disabled=!0,s(ae,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ae.disabled=!0,s(oe,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),oe.disabled=!0,s(re,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),re.disabled=!0,s(ie,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ie.disabled=!0,s(t,"class","p-2 text-sm flex-1"),s(n,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full relative "),s(ue,"class","flex-1 overflow-auto"),s(r,"class","flex h-screen bg-white")},m(m,k){_e(m,r,k),e(r,n),e(n,d),e(n,z),e(n,t),e(t,g),e(t,q),e(t,_),e(_,C),e(_,Y),e(_,b),e(t,G),e(t,x),Xe(P,x,null),e(x,D),e(x,I),e(t,w),e(t,h),e(t,V),e(t,L),e(t,y),e(t,v),e(t,F),e(t,U),e(t,X),e(t,fe),e(t,be),e(t,Z),e(t,ve),e(t,$),e(t,we),e(t,ee),e(t,Te),e(t,te),e(t,ye),e(t,ne),e(t,Ce),e(t,se),e(t,Le),e(t,pe),e(t,ke),e(t,le),e(t,Ie),e(t,ae),e(t,He),e(t,oe),e(t,Me),e(t,re),e(t,Ne),e(t,ie),e(r,Ee),e(r,ue),Xe(ce,ue,null),e(ue,Se),j&&j.m(ue,null),e(r,Ue),N&&N.m(r,null),de=!0},p(m,[k]){(!de||k&128&&K!==(K="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(m[7].url.pathname==="/"?"bg-gray-100":"")))&&s(_,"class",K),(!de||k&128&&l!==(l="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(m[7].url.pathname==="/voice-cloning"?"bg-gray-100":"")))&&s(x,"class",l);const W={};k&1&&(W.isLoggedIn=m[0]),k&2&&(W.username=m[1]),k&64&&(W.flashButton=m[6]),k&128&&(W.pageTitle=lt(m[7].url.pathname)),ce.$set(W),j&&j.p&&(!de||k&2048)&&ut(j,Ae,m,m[11],de?dt(Ae,m[11],k,null):ct(m[11]),null),m[2]?N?N.p(m,k):(N=tt(m),N.c(),N.m(r,null)):N&&(N.d(1),N=null)},i(m){de||(Pe(P.$$.fragment,m),Pe(ce.$$.fragment,m),Pe(j,m),de=!0)},o(m){Be(P.$$.fragment,m),Be(ce.$$.fragment,m),Be(j,m),de=!1},d(m){m&&E(r),Qe(P),Qe(ce),j&&j.d(m),N&&N.d()}}}function lt(f){switch(f){case"/":return"Text to Speech Playground";case"/voice-cloning":return"Voice Cloning Playground";default:return"HFStudio"}}function Tt(f,r,n){let d;ft(f,_t,l=>n(7,d=l));let{$$slots:H={},$$scope:z}=r,t={authenticated:!1},g=!1,A="";function q(l){if(t=l,n(0,g=(l==null?void 0:l.authenticated)||!1),l!=null&&l.authenticated&&(l!=null&&l.user_info)){const w=l.user_info,h=w.name||w.fullname||w.login||w.username||"User";n(1,A=h.split(" ")[0])}}typeof window<"u"&&(window.__INITIAL_USER__?(console.log("Found initial user data:",window.__INITIAL_USER__),q(window.__INITIAL_USER__)):(console.log("No initial user data found, listening for event"),window.addEventListener("initial-user-loaded",l=>{console.log("Received initial user event:",l.detail),q(l.detail)})));let _=!1,C="",M="",Y=!1,b=!1,B=!1;pt(()=>(window.addEventListener("show-login-prompt",()=>{g||(n(6,b=!0),setTimeout(()=>{n(6,b=!1)},1600))}),K().then(()=>{!window.__INITIAL_USER__&&!(t!=null&&t.authenticated)&&(console.log("No server data available, checking auth status via API"),G())}),document.addEventListener("visibilitychange",()=>{document.hidden||G()}),()=>{}));async function K(){try{B=(await(await fetch("/api/status")).json()).is_spaces||!1}catch(l){console.error("Error checking Spaces status:",l),B=!1}}async function G(){if(!(t!=null&&t.authenticated&&g))try{const l=await fetch("/api/auth/user",{credentials:"include"});if(l.ok){const w=await l.json();if(w.authenticated){n(0,g=!0);const h=w.user_info,S=h.name||h.fullname||h.login||h.username||"User";n(1,A=S.split(" ")[0])}else n(0,g=!1),n(1,A="")}else n(0,g=!1),n(1,A="")}catch{n(0,g=!1),n(1,A="")}}async function x(){if(g){try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch(l){console.error("Logout error:",l)}sessionStorage.removeItem("oauth_state"),n(0,g=!1),n(1,A=""),window.location.reload()}else try{const w=await(await fetch("/api/auth/oauth-config")).json(),h=w.scopes||"inference-api";let S=window.location.origin+"/auth/callback";window.location.hostname==="localhost"&&window.location.port==="11111"&&(S="http://localhost:7860/auth/callback");const V=window.location.pathname,L=`https://huggingface.co/oauth/authorize?client_id=${w.client_id}&redirect_uri=${encodeURIComponent(S)}&scope=${encodeURIComponent(h)}&response_type=code&state=${encodeURIComponent(V)}`;window.location.href=L}catch{n(2,_=!0),n(3,C=""),n(4,M="")}}function P(){n(2,_=!1),n(3,C=""),n(4,M="")}async function D(){if(!C.trim()){n(4,M="Please enter a token");return}if(!C.startsWith("hf_")){n(4,M='Token should start with "hf_"');return}try{const l=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${C.trim()}`}});if(l.ok){const w=await l.json(),h=C.trim();try{const S=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:h})});if(S.ok){const V=await S.json();n(0,g=!0);const L=V.user_info,T=L.name||L.fullname||L.login||L.username||"User";n(1,A=T.split(" ")[0]),P()}else{const V=await S.json();n(4,M=V.detail||"Token validation failed")}}catch{n(4,M="Failed to validate token. Please try again.")}}else n(4,M=`Invalid token (${l.status}). Please check your token and try again.`)}catch{n(4,M="Error validating token. Please try again.")}}function I(){C=this.value,n(3,C)}const O=l=>l.key==="Enter"&&D();return f.$$set=l=>{"$$scope"in l&&n(11,z=l.$$scope)},[g,A,_,C,M,Y,b,d,x,P,D,z,H,I,O]}class Ht extends at{constructor(r){super(),ot(this,r,Tt,wt,rt,{})}}export{Ht as component};
|
hfstudio/static/_app/immutable/nodes/1.CRvpTlke.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as x,i as S,s as j,n as u,d as c,a as h,b as _,c as d,e as v,f as g,g as b,h as k,j as E,t as $,k as q,l as y}from"../chunks/TRxHAhOH.js";import"../chunks/IHki7fMi.js";import{p as C}from"../chunks/HisAIUfC.js";function H(p){var f;let a,s=p[0].status+"",r,n,o,i=((f=p[0].error)==null?void 0:f.message)+"",m;return{c(){a=E("h1"),r=$(s),n=q(),o=E("p"),m=$(i)},l(e){a=v(e,"H1",{});var t=g(a);r=b(t,s),t.forEach(c),n=k(e),o=v(e,"P",{});var l=g(o);m=b(l,i),l.forEach(c)},m(e,t){_(e,a,t),d(a,r),_(e,n,t),_(e,o,t),d(o,m)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&h(r,s),t&1&&i!==(i=((l=e[0].error)==null?void 0:l.message)+"")&&h(m,i)},i:u,o:u,d(e){e&&(c(a),c(n),c(o))}}}function P(p,a,s){let r;return y(p,C,n=>s(0,r=n)),[r]}class B extends x{constructor(a){super(),S(this,a,P,H,j,{})}}export{B as component};
|
hfstudio/static/_app/immutable/nodes/4.C6kWolZc.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as dt,i as _t,s as ht,u as Je,v as _e,w as C,x as D,y as he,z as pe,A as me,B as nt,C as Bt,D as Ht,E as Ot,F as qt,d as u,H as ct,a as Ce,K as xe,p as d,b as G,c,m as $e,L as Xt,h as x,e as h,f as b,r as we,g as O,M as Ke,k as V,j as p,t as q,G as Zt,Q as le,n as Be,J as Ft,N as Ve}from"../chunks/TRxHAhOH.js";import{I as Yt,g as Gt,a as Jt,e as at}from"../chunks/BhRpzVYR.js";import"../chunks/IHki7fMi.js";import{S as er,L as pt,A as tr,X as rr}from"../chunks/BNlacN_j.js";import{M as Kt}from"../chunks/nn-QVLrM.js";import{a as Qt,P as Wt}from"../chunks/gtFtmmyB.js";function lr(s){let e;const t=s[2].default,r=Bt(t,s,s[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,o){r&&r.m(l,o),e=!0},p(l,o){r&&r.p&&(!e||o&8)&&Ht(r,t,l,l[3],e?qt(t,l[3],o,null):Ot(l[3]),null)},i(l){e||(D(r,l),e=!0)},o(l){C(r,l),e=!1},d(l){r&&r.d(l)}}}function sr(s){let e,t;const r=[{name:"square"},s[1],{iconNode:s[0]}];let l={$$slots:{default:[lr]},$$scope:{ctx:s}};for(let o=0;o<r.length;o+=1)l=Je(l,r[o]);return e=new Yt({props:l}),{c(){me(e.$$.fragment)},l(o){pe(e.$$.fragment,o)},m(o,n){he(e,o,n),t=!0},p(o,[n]){const i=n&3?Gt(r,[r[0],n&2&&Jt(o[1]),n&1&&{iconNode:o[0]}]):{};n&8&&(i.$$scope={dirty:n,ctx:o}),e.$set(i)},i(o){t||(D(e.$$.fragment,o),t=!0)},o(o){C(e.$$.fragment,o),t=!1},d(o){_e(e,o)}}}function or(s,e,t){let{$$slots:r={},$$scope:l}=e;const o=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];return s.$$set=n=>{t(1,e=Je(Je({},e),nt(n))),"$$scope"in n&&t(3,l=n.$$scope)},e=nt(e),[o,e,r,l]}class nr extends dt{constructor(e){super(),_t(this,e,or,sr,ht,{})}}function ar(s){let e;const t=s[2].default,r=Bt(t,s,s[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,o){r&&r.m(l,o),e=!0},p(l,o){r&&r.p&&(!e||o&8)&&Ht(r,t,l,l[3],e?qt(t,l[3],o,null):Ot(l[3]),null)},i(l){e||(D(r,l),e=!0)},o(l){C(r,l),e=!1},d(l){r&&r.d(l)}}}function ir(s){let e,t;const r=[{name:"trash-2"},s[1],{iconNode:s[0]}];let l={$$slots:{default:[ar]},$$scope:{ctx:s}};for(let o=0;o<r.length;o+=1)l=Je(l,r[o]);return e=new Yt({props:l}),{c(){me(e.$$.fragment)},l(o){pe(e.$$.fragment,o)},m(o,n){he(e,o,n),t=!0},p(o,[n]){const i=n&3?Gt(r,[r[0],n&2&&Jt(o[1]),n&1&&{iconNode:o[0]}]):{};n&8&&(i.$$scope={dirty:n,ctx:o}),e.$set(i)},i(o){t||(D(e.$$.fragment,o),t=!0)},o(o){C(e.$$.fragment,o),t=!1},d(o){_e(e,o)}}}function cr(s,e,t){let{$$slots:r={},$$scope:l}=e;const o=[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17"}]];return s.$$set=n=>{t(1,e=Je(Je({},e),nt(n))),"$$scope"in n&&t(3,l=n.$$scope)},e=nt(e),[o,e,r,l]}class ur extends dt{constructor(e){super(),_t(this,e,cr,ir,ht,{})}}function St(s,e,t){const r=s.slice();return r[47]=e[t],r}function Pt(s,e,t){const r=s.slice();return r[50]=e[t],r[52]=t,r}function Lt(s){let e,t,r,l,o,n;return{c(){e=p("div"),t=p("div"),r=V(),l=p("div"),o=V(),n=p("div"),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=b(e);t=h(a,"DIV",{class:!0,style:!0}),b(t).forEach(u),r=x(a),l=h(a,"DIV",{class:!0,style:!0}),b(l).forEach(u),o=x(a),n=h(a,"DIV",{class:!0,style:!0}),b(n).forEach(u),a.forEach(u),this.h()},h(){d(t,"class","absolute rounded-full border-2 border-orange-300 transition-all duration-75"),le(t,"width",120+s[7]*120+"px"),le(t,"height",120+s[7]*120+"px"),le(t,"opacity",.4+s[7]*.6),d(l,"class","absolute rounded-full border-2 border-orange-200 transition-all duration-100"),le(l,"width",150+s[7]*150+"px"),le(l,"height",150+s[7]*150+"px"),le(l,"opacity",.3+s[7]*.5),d(n,"class","absolute rounded-full border-1 border-orange-100 transition-all duration-125"),le(n,"width",180+s[7]*180+"px"),le(n,"height",180+s[7]*180+"px"),le(n,"opacity",.2+s[7]*.4),d(e,"class","absolute inset-0 flex items-center justify-center")},m(i,a){G(i,e,a),c(e,t),c(e,r),c(e,l),c(e,o),c(e,n)},p(i,a){a[0]&128&&le(t,"width",120+i[7]*120+"px"),a[0]&128&&le(t,"height",120+i[7]*120+"px"),a[0]&128&&le(t,"opacity",.4+i[7]*.6),a[0]&128&&le(l,"width",150+i[7]*150+"px"),a[0]&128&&le(l,"height",150+i[7]*150+"px"),a[0]&128&&le(l,"opacity",.3+i[7]*.5),a[0]&128&&le(n,"width",180+i[7]*180+"px"),a[0]&128&&le(n,"height",180+i[7]*180+"px"),a[0]&128&&le(n,"opacity",.2+i[7]*.4)},d(i){i&&u(e)}}}function fr(s){let e,t;return e=new Kt({props:{size:36,class:"text-white"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},p:Be,i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function dr(s){let e,t,r,l;return r=new nr({props:{size:36,class:(s[6]>=100?"text-white":"text-orange-700")+" relative z-10"}}),{c(){e=p("div"),t=V(),me(r.$$.fragment),this.h()},l(o){e=h(o,"DIV",{class:!0,style:!0}),b(e).forEach(u),t=x(o),pe(r.$$.fragment,o),this.h()},h(){d(e,"class","absolute bottom-0 left-0 right-0 bg-orange-500 transition-all duration-100 ease-linear rounded-full"),le(e,"height",s[6]+"%")},m(o,n){G(o,e,n),G(o,t,n),he(r,o,n),l=!0},p(o,n){(!l||n[0]&64)&&le(e,"height",o[6]+"%");const i={};n[0]&64&&(i.class=(o[6]>=100?"text-white":"text-orange-700")+" relative z-10"),r.$set(i)},i(o){l||(D(r.$$.fragment,o),l=!0)},o(o){C(r.$$.fragment,o),l=!1},d(o){o&&(u(e),u(t)),_e(r,o)}}}function Mt(s){let e,t,r='<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>',l,o,n='Hugging Face <span class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold">PRO</span>',i,a,g=`Sign in to with your Hugging Face <a href="https://huggingface.co/pro" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">PRO account</a> to get started with $2 of free API credits per month. You can add a billing method for
|
| 2 |
+
additional pay-as-you-go usage ‴`,_,v;return{c(){e=p("div"),t=p("button"),t.innerHTML=r,l=V(),o=p("p"),o.innerHTML=n,i=V(),a=p("p"),a.innerHTML=g,this.h()},l(m){e=h(m,"DIV",{class:!0});var k=b(e);t=h(k,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),we(t)!=="svelte-9gdgq5"&&(t.innerHTML=r),l=x(k),o=h(k,"P",{class:!0,"data-svelte-h":!0}),we(o)!=="svelte-1q58z3k"&&(o.innerHTML=n),i=x(k),a=h(k,"P",{class:!0,"data-svelte-h":!0}),we(a)!=="svelte-dysk74"&&(a.innerHTML=g),k.forEach(u),this.h()},h(){d(t,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),d(t,"aria-label","Dismiss"),d(o,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),d(a,"class","text-sm text-gray-600 pr-4"),d(e,"class","mb-3 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative")},m(m,k){G(m,e,k),c(e,t),c(e,l),c(e,o),c(e,i),c(e,a),_||(v=$e(t,"click",s[29]),_=!0)},p:Be,d(m){m&&u(e),_=!1,v()}}}function _r(s){let e,t,r=at(s[1]),l=[];for(let n=0;n<r.length;n+=1)l[n]=Nt(Pt(s,r,n));const o=n=>C(l[n],1,1,()=>{l[n]=null});return{c(){e=p("div");for(let n=0;n<l.length;n+=1)l[n].c();this.h()},l(n){e=h(n,"DIV",{class:!0});var i=b(e);for(let a=0;a<l.length;a+=1)l[a].l(i);i.forEach(u),this.h()},h(){d(e,"class","space-y-2")},m(n,i){G(n,e,i);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);t=!0},p(n,i){if(i[0]&100664070){r=at(n[1]);let a;for(a=0;a<r.length;a+=1){const g=Pt(n,r,a);l[a]?(l[a].p(g,i),D(l[a],1)):(l[a]=Nt(g),l[a].c(),D(l[a],1),l[a].m(e,null))}for(Ve(),a=r.length;a<l.length;a+=1)o(a);xe()}},i(n){if(!t){for(let i=0;i<r.length;i+=1)D(l[i]);t=!0}},o(n){l=l.filter(Boolean);for(let i=0;i<l.length;i+=1)C(l[i]);t=!1},d(n){n&&u(e),Ft(l,n)}}}function hr(s){let e,t,r,l,o="Pick a recording to clone",n,i,a="No recordings yet",g;return t=new Kt({props:{size:32,class:"mx-auto mb-2 opacity-30"}}),{c(){e=p("div"),me(t.$$.fragment),r=V(),l=p("p"),l.textContent=o,n=V(),i=p("p"),i.textContent=a,this.h()},l(_){e=h(_,"DIV",{class:!0});var v=b(e);pe(t.$$.fragment,v),r=x(v),l=h(v,"P",{class:!0,"data-svelte-h":!0}),we(l)!=="svelte-faot34"&&(l.textContent=o),n=x(v),i=h(v,"P",{class:!0,"data-svelte-h":!0}),we(i)!=="svelte-kwlxsz"&&(i.textContent=a),v.forEach(u),this.h()},h(){d(l,"class","text-sm"),d(i,"class","text-xs text-gray-400"),d(e,"class","text-center py-8 text-gray-500")},m(_,v){G(_,e,v),he(t,e,null),c(e,r),c(e,l),c(e,n),c(e,i),g=!0},p:Be,i(_){g||(D(t.$$.fragment,_),g=!0)},o(_){C(t.$$.fragment,_),g=!1},d(_){_&&u(e),_e(t)}}}function pr(s){let e,t;return e=new Wt({props:{size:14,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function mr(s){let e,t;return e=new Qt({props:{size:14,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Nt(s){var ie;let e,t,r,l,o=s[52]+1+"",n,i,a,g,_,v,m,k=s[50].timestamp.toLocaleTimeString()+"",L,F,T,X=((ie=s[2])==null?void 0:ie.id)===s[50].id?"Selected":"Select for cloning",R,S,K,J,z,W,U;const A=[mr,pr],E=[];function H(j,w){var $;return(($=j[8])==null?void 0:$.id)===j[50].id&&j[9]&&!j[9].paused?0:1}g=H(s),_=E[g]=A[g](s);function Q(){return s[30](s[50])}function Y(){return s[31](s[50])}return{c(){e=p("div"),t=p("div"),r=p("span"),l=q("Recording "),n=q(o),i=V(),a=p("button"),_.c(),v=V(),m=p("div"),L=q(k),F=V(),T=p("button"),R=q(X),K=V(),this.h()},l(j){e=h(j,"DIV",{class:!0});var w=b(e);t=h(w,"DIV",{class:!0});var $=b(t);r=h($,"SPAN",{class:!0});var oe=b(r);l=O(oe,"Recording "),n=O(oe,o),oe.forEach(u),i=x($),a=h($,"BUTTON",{class:!0});var P=b(a);_.l(P),P.forEach(u),$.forEach(u),v=x(w),m=h(w,"DIV",{class:!0});var I=b(m);L=O(I,k),I.forEach(u),F=x(w),T=h(w,"BUTTON",{class:!0});var M=b(T);R=O(M,X),M.forEach(u),K=x(w),w.forEach(u),this.h()},h(){var j,w;d(r,"class","text-sm font-medium text-gray-900"),d(a,"class","p-1 hover:bg-gray-100 rounded transition-colors"),d(t,"class","flex items-center justify-between mb-2"),d(m,"class","text-xs text-gray-500 mb-2"),d(T,"class",S="w-full text-xs px-2 py-1 rounded "+(((j=s[2])==null?void 0:j.id)===s[50].id?"bg-amber-200 text-amber-800":"bg-gray-100 text-gray-700 hover:bg-gray-200")+" transition-colors"),d(e,"class",J="border rounded-lg p-3 "+(((w=s[2])==null?void 0:w.id)===s[50].id?"border-amber-300 bg-amber-50":"border-gray-200 hover:border-gray-300")+" transition-colors")},m(j,w){G(j,e,w),c(e,t),c(t,r),c(r,l),c(r,n),c(t,i),c(t,a),E[g].m(a,null),c(e,v),c(e,m),c(m,L),c(e,F),c(e,T),c(T,R),c(e,K),z=!0,W||(U=[$e(a,"click",Q),$e(T,"click",Y)],W=!0)},p(j,w){var oe,P,I;s=j;let $=g;g=H(s),g!==$&&(Ve(),C(E[$],1,1,()=>{E[$]=null}),xe(),_=E[g],_||(_=E[g]=A[g](s),_.c()),D(_,1),_.m(a,null)),(!z||w[0]&2)&&k!==(k=s[50].timestamp.toLocaleTimeString()+"")&&Ce(L,k),(!z||w[0]&6)&&X!==(X=((oe=s[2])==null?void 0:oe.id)===s[50].id?"Selected":"Select for cloning")&&Ce(R,X),(!z||w[0]&6&&S!==(S="w-full text-xs px-2 py-1 rounded "+(((P=s[2])==null?void 0:P.id)===s[50].id?"bg-amber-200 text-amber-800":"bg-gray-100 text-gray-700 hover:bg-gray-200")+" transition-colors"))&&d(T,"class",S),(!z||w[0]&6&&J!==(J="border rounded-lg p-3 "+(((I=s[2])==null?void 0:I.id)===s[50].id?"border-amber-300 bg-amber-50":"border-gray-200 hover:border-gray-300")+" transition-colors"))&&d(e,"class",J)},i(j){z||(D(_),z=!0)},o(j){C(_),z=!1},d(j){j&&u(e),E[g].d(),W=!1,ct(U)}}}function gr(s){let e;return{c(){e=q("Clone")},l(t){e=O(t,"Clone")},m(t,r){G(t,e,r)},i:Be,o:Be,d(t){t&&u(e)}}}function br(s){let e,t,r;return e=new pt({props:{size:16,class:"animate-spin"}}),{c(){me(e.$$.fragment),t=q(`
|
| 3 |
+
Uploading...`)},l(l){pe(e.$$.fragment,l),t=O(l,`
|
| 4 |
+
Uploading...`)},m(l,o){he(e,l,o),G(l,t,o),r=!0},i(l){r||(D(e.$$.fragment,l),r=!0)},o(l){C(e.$$.fragment,l),r=!1},d(l){l&&u(t),_e(e,l)}}}function vr(s){let e,t,r;return e=new pt({props:{size:16,class:"animate-spin"}}),{c(){me(e.$$.fragment),t=q(`
|
| 5 |
+
Transcribing...`)},l(l){pe(e.$$.fragment,l),t=O(l,`
|
| 6 |
+
Transcribing...`)},m(l,o){he(e,l,o),G(l,t,o),r=!0},i(l){r||(D(e.$$.fragment,l),r=!0)},o(l){C(e.$$.fragment,l),r=!1},d(l){l&&u(t),_e(e,l)}}}function yr(s){let e;return{c(){e=q("β")},l(t){e=O(t,"β")},m(t,r){G(t,e,r)},p:Be,d(t){t&&u(e)}}}function kr(s){let e,t;function r(n,i){return i[0]&4&&(e=null),e==null&&(e=!!it(n[2])),e?Er:wr}let l=r(s,[-1,-1]),o=l(s);return{c(){o.c(),t=Ke()},l(n){o.l(n),t=Ke()},m(n,i){o.m(n,i),G(n,t,i)},p(n,i){l!==(l=r(n,i))&&(o.d(1),o=l(n),o&&(o.c(),o.m(t.parentNode,t)))},d(n){n&&u(t),o.d(n)}}}function wr(s){let e;return{c(){e=q("β")},l(t){e=O(t,"β")},m(t,r){G(t,e,r)},d(t){t&&u(e)}}}function Er(s){let e;return{c(){e=q("β")},l(t){e=O(t,"β")},m(t,r){G(t,e,r)},d(t){t&&u(e)}}}function Dr(s){let e;return{c(){e=q("β")},l(t){e=O(t,"β")},m(t,r){G(t,e,r)},p:Be,d(t){t&&u(e)}}}function Tr(s){let e,t;function r(n,i){return i[0]&4&&(e=null),e==null&&(e=!!n[21](n[2])),e?xr:Ir}let l=r(s,[-1,-1]),o=l(s);return{c(){o.c(),t=Ke()},l(n){o.l(n),t=Ke()},m(n,i){o.m(n,i),G(n,t,i)},p(n,i){l!==(l=r(n,i))&&(o.d(1),o=l(n),o&&(o.c(),o.m(t.parentNode,t)))},d(n){n&&u(t),o.d(n)}}}function Ir(s){let e;return{c(){e=q("β")},l(t){e=O(t,"β")},m(t,r){G(t,e,r)},d(t){t&&u(e)}}}function xr(s){let e;return{c(){e=q("β")},l(t){e=O(t,"β")},m(t,r){G(t,e,r)},d(t){t&&u(e)}}}function Rt(s){let e,t,r,l=s[10][s[2].id].first_words+"",o,n;return{c(){e=p("div"),t=p("p"),r=q('"'),o=q(l),n=q('..."'),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=b(e);t=h(a,"P",{class:!0});var g=b(t);r=O(g,'"'),o=O(g,l),n=O(g,'..."'),g.forEach(u),a.forEach(u),this.h()},h(){d(t,"class","text-sm text-gray-600 italic"),d(e,"class","mt-3 p-3 bg-gray-50 rounded-lg border")},m(i,a){G(i,e,a),c(e,t),c(t,r),c(t,o),c(t,n)},p(i,a){a[0]&1028&&l!==(l=i[10][i[2].id].first_words+"")&&Ce(o,l)},d(i){i&&u(e)}}}function Vr(s){let e,t,r;return{c(){e=p("div"),t=p("p"),r=q(s[14]),this.h()},l(l){e=h(l,"DIV",{class:!0});var o=b(e);t=h(o,"P",{class:!0});var n=b(t);r=O(n,s[14]),n.forEach(u),o.forEach(u),this.h()},h(){d(t,"class","text-sm text-green-700"),d(e,"class","mt-3 p-3 bg-green-50 rounded-lg border border-green-200")},m(l,o){G(l,e,o),c(e,t),c(t,r)},p(l,o){o[0]&16384&&Ce(r,l[14])},d(l){l&&u(e)}}}function Cr(s){let e,t,r,l,o,n,i;return{c(){e=p("div"),t=p("p"),r=q("Your voice has been saved to a "),l=p("a"),o=q("temporary URL"),i=q(` for 24 hours and will be automatically deleted. You can now use it for text-to-speech
|
| 7 |
+
generation.`),this.h()},l(a){e=h(a,"DIV",{class:!0});var g=b(e);t=h(g,"P",{class:!0});var _=b(t);r=O(_,"Your voice has been saved to a "),l=h(_,"A",{href:!0,target:!0,class:!0});var v=b(l);o=O(v,"temporary URL"),v.forEach(u),i=O(_,` for 24 hours and will be automatically deleted. You can now use it for text-to-speech
|
| 8 |
+
generation.`),_.forEach(u),g.forEach(u),this.h()},h(){d(l,"href",n=s[13][s[2].id].voice_url),d(l,"target","_blank"),d(l,"class","text-green-800 underline hover:text-green-900"),d(t,"class","text-sm text-green-700"),d(e,"class","mt-3 p-3 bg-green-50 rounded-lg border border-green-200")},m(a,g){G(a,e,g),c(e,t),c(t,r),c(t,l),c(l,o),c(t,i)},p(a,g){g[0]&8196&&n!==(n=a[13][a[2].id].voice_url)&&d(l,"href",n)},d(a){a&&u(e)}}}function zt(s){let e,t,r="Your existing voice clone",l,o,n,i=at(s[15]),a=[];for(let _=0;_<i.length;_+=1)a[_]=Ut(St(s,i,_));const g=_=>C(a[_],1,1,()=>{a[_]=null});return{c(){e=p("div"),t=p("h3"),t.textContent=r,l=V(),o=p("div");for(let _=0;_<a.length;_+=1)a[_].c();this.h()},l(_){e=h(_,"DIV",{class:!0});var v=b(e);t=h(v,"H3",{class:!0,"data-svelte-h":!0}),we(t)!=="svelte-5uh5wl"&&(t.textContent=r),l=x(v),o=h(v,"DIV",{class:!0});var m=b(o);for(let k=0;k<a.length;k+=1)a[k].l(m);m.forEach(u),v.forEach(u),this.h()},h(){d(t,"class","text-sm font-medium text-gray-700 mb-3"),d(o,"class","space-y-2"),d(e,"class","mt-6 pt-4 border-t border-gray-200")},m(_,v){G(_,e,v),c(e,t),c(e,l),c(e,o);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(o,null);n=!0},p(_,v){if(v[0]&335643392){i=at(_[15]);let m;for(m=0;m<i.length;m+=1){const k=St(_,i,m);a[m]?(a[m].p(k,v),D(a[m],1)):(a[m]=Ut(k),a[m].c(),D(a[m],1),a[m].m(o,null))}for(Ve(),m=i.length;m<a.length;m+=1)g(m);xe()}},i(_){if(!n){for(let v=0;v<i.length;v+=1)D(a[v]);n=!0}},o(_){a=a.filter(Boolean);for(let v=0;v<a.length;v+=1)C(a[v]);n=!1},d(_){_&&u(e),Ft(a,_)}}}function $r(s){let e,t;return e=new Wt({props:{size:14,class:"text-blue-600"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Sr(s){let e,t;return e=new Qt({props:{size:14,class:"text-blue-600"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Pr(s){let e,t;return e=new ur({props:{size:14}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Lr(s){let e,t;return e=new pt({props:{size:14,class:"animate-spin"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Ut(s){let e,t,r,l=s[47].voice_name+"",o,n,i,a,g,_,v,m,k,L,F,T,X,R=new Date(s[47].expires_at).toLocaleDateString()+"",S,K,J=new Date(s[47].expires_at).toLocaleTimeString()+"",z,W,U,A,E;const H=[Sr,$r],Q=[];function Y(P,I){var M;return((M=P[8])==null?void 0:M.id)===P[47].id&&P[9]&&!P[9].paused?0:1}g=Y(s),_=Q[g]=H[g](s);function ie(){return s[32](s[47])}const j=[Lr,Pr],w=[];function $(P,I){return P[16]?0:1}k=$(s),L=w[k]=j[k](s);function oe(){return s[33](s[47])}return{c(){e=p("div"),t=p("div"),r=p("span"),o=q(l),n=V(),i=p("div"),a=p("button"),_.c(),v=V(),m=p("button"),L.c(),F=V(),T=p("div"),X=q("Expires: "),S=q(R),K=q(" at "),z=q(J),W=V(),this.h()},l(P){e=h(P,"DIV",{class:!0});var I=b(e);t=h(I,"DIV",{class:!0});var M=b(t);r=h(M,"SPAN",{class:!0});var ke=b(r);o=O(ke,l),ke.forEach(u),n=x(M),i=h(M,"DIV",{class:!0});var Z=b(i);a=h(Z,"BUTTON",{class:!0,title:!0});var ae=b(a);_.l(ae),ae.forEach(u),v=x(Z),m=h(Z,"BUTTON",{class:!0,title:!0});var ce=b(m);L.l(ce),ce.forEach(u),Z.forEach(u),M.forEach(u),F=x(I),T=h(I,"DIV",{class:!0});var se=b(T);X=O(se,"Expires: "),S=O(se,R),K=O(se," at "),z=O(se,J),se.forEach(u),W=x(I),I.forEach(u),this.h()},h(){d(r,"class","text-sm font-medium text-blue-900"),d(a,"class","p-1 hover:bg-blue-100 rounded transition-colors"),d(a,"title","Play voice sample"),m.disabled=s[16],d(m,"class","p-1 text-red-600 hover:text-red-800 hover:bg-red-100 rounded transition-colors disabled:opacity-50"),d(m,"title","Delete voice"),d(i,"class","flex items-center gap-2"),d(t,"class","flex items-center justify-between mb-2"),d(T,"class","text-xs text-blue-600"),d(e,"class","border rounded-lg p-3 bg-blue-50 border-blue-200")},m(P,I){G(P,e,I),c(e,t),c(t,r),c(r,o),c(t,n),c(t,i),c(i,a),Q[g].m(a,null),c(i,v),c(i,m),w[k].m(m,null),c(e,F),c(e,T),c(T,X),c(T,S),c(T,K),c(T,z),c(e,W),U=!0,A||(E=[$e(a,"click",ie),$e(m,"click",oe)],A=!0)},p(P,I){s=P,(!U||I[0]&32768)&&l!==(l=s[47].voice_name+"")&&Ce(o,l);let M=g;g=Y(s),g!==M&&(Ve(),C(Q[M],1,1,()=>{Q[M]=null}),xe(),_=Q[g],_||(_=Q[g]=H[g](s),_.c()),D(_,1),_.m(a,null));let ke=k;k=$(s),k!==ke&&(Ve(),C(w[ke],1,1,()=>{w[ke]=null}),xe(),L=w[k],L||(L=w[k]=j[k](s),L.c()),D(L,1),L.m(m,null)),(!U||I[0]&65536)&&(m.disabled=s[16]),(!U||I[0]&32768)&&R!==(R=new Date(s[47].expires_at).toLocaleDateString()+"")&&Ce(S,R),(!U||I[0]&32768)&&J!==(J=new Date(s[47].expires_at).toLocaleTimeString()+"")&&Ce(z,J)},i(P){U||(D(_),D(L),U=!0)},o(P){C(_),C(L),U=!1},d(P){P&&u(e),Q[g].d(),w[k].d(),A=!1,ct(E)}}}function At(s){let e,t,r,l,o,n,i,a,g,_,v,m,k="An error occurred while processing your request",L,F,T,X,R,S,K,J,z="Close",W,U,A;n=new tr({props:{size:20,class:"text-red-600"}}),T=new rr({props:{size:20,class:"text-gray-500"}});let E=s[5]&&jt(s);return{c(){e=p("div"),t=p("div"),r=p("div"),l=p("div"),o=p("div"),me(n.$$.fragment),i=V(),a=p("div"),g=p("h3"),_=q(s[4]),v=V(),m=p("p"),m.textContent=k,L=V(),F=p("button"),me(T.$$.fragment),X=V(),R=p("div"),E&&E.c(),S=V(),K=p("div"),J=p("button"),J.textContent=z,this.h()},l(H){e=h(H,"DIV",{class:!0});var Q=b(e);t=h(Q,"DIV",{class:!0});var Y=b(t);r=h(Y,"DIV",{class:!0});var ie=b(r);l=h(ie,"DIV",{class:!0});var j=b(l);o=h(j,"DIV",{class:!0});var w=b(o);pe(n.$$.fragment,w),w.forEach(u),i=x(j),a=h(j,"DIV",{class:!0});var $=b(a);g=h($,"H3",{class:!0});var oe=b(g);_=O(oe,s[4]),oe.forEach(u),v=x($),m=h($,"P",{class:!0,"data-svelte-h":!0}),we(m)!=="svelte-1l3zl3"&&(m.textContent=k),$.forEach(u),j.forEach(u),L=x(ie),F=h(ie,"BUTTON",{class:!0,title:!0});var P=b(F);pe(T.$$.fragment,P),P.forEach(u),ie.forEach(u),X=x(Y),R=h(Y,"DIV",{class:!0});var I=b(R);E&&E.l(I),I.forEach(u),S=x(Y),K=h(Y,"DIV",{class:!0});var M=b(K);J=h(M,"BUTTON",{class:!0,"data-svelte-h":!0}),we(J)!=="svelte-4sxk6g"&&(J.textContent=z),M.forEach(u),Y.forEach(u),Q.forEach(u),this.h()},h(){d(o,"class","w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"),d(g,"class","text-lg font-semibold text-gray-900 truncate"),d(m,"class","text-sm text-gray-600"),d(a,"class","min-w-0"),d(l,"class","flex items-center gap-3 min-w-0"),d(F,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),d(F,"title","Close"),d(r,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),d(R,"class","p-6 overflow-y-auto flex-1 min-h-0"),d(J,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),d(K,"class","flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"),d(t,"class","bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col"),d(e,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4")},m(H,Q){G(H,e,Q),c(e,t),c(t,r),c(r,l),c(l,o),he(n,o,null),c(l,i),c(l,a),c(a,g),c(g,_),c(a,v),c(a,m),c(r,L),c(r,F),he(T,F,null),c(t,X),c(t,R),E&&E.m(R,null),c(t,S),c(t,K),c(K,J),W=!0,U||(A=[$e(F,"click",s[22]),$e(J,"click",s[22])],U=!0)},p(H,Q){(!W||Q[0]&16)&&Ce(_,H[4]),H[5]?E?E.p(H,Q):(E=jt(H),E.c(),E.m(R,null)):E&&(E.d(1),E=null)},i(H){W||(D(n.$$.fragment,H),D(T.$$.fragment,H),W=!0)},o(H){C(n.$$.fragment,H),C(T.$$.fragment,H),W=!1},d(H){H&&u(e),_e(n),_e(T),E&&E.d(),U=!1,ct(A)}}}function jt(s){let e,t,r="Error Details:",l,o,n;return{c(){e=p("div"),t=p("h4"),t.textContent=r,l=V(),o=p("pre"),n=q(s[5]),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=b(e);t=h(a,"H4",{class:!0,"data-svelte-h":!0}),we(t)!=="svelte-3lmggt"&&(t.textContent=r),l=x(a),o=h(a,"PRE",{class:!0});var g=b(o);n=O(g,s[5]),g.forEach(u),a.forEach(u),this.h()},h(){d(t,"class","text-sm font-medium text-gray-900 mb-2"),d(o,"class","text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words"),d(e,"class","bg-gray-50 rounded-lg p-4 border")},m(i,a){G(i,e,a),c(e,t),c(e,l),c(e,o),c(o,n)},p(i,a){a[0]&32&&Ce(n,i[5])},d(i){i&&u(e)}}}function Mr(s){let e,t,r,l,o,n,i,a,g="Sample script to read",_,v,m,k,L,F,T,X="I consent to cloning my voice.",R,S=s[20][s[17]]+"",K,J,z,W,U,A,E,H,Q,Y,ie=`<p class="text-center"><em>Record your voice for at least 15 seconds to create a voice clone. To prevent
|
| 9 |
+
unauthorized voice cloning, you must start by clearly saying "I consent to cloning my
|
| 10 |
+
voice" β the rest of the text is arbitrary. Try reading the sample above.</em></p>`,j,w,$,oe,P,I,M,ke,Z,ae,ce,se,Me,He,Se,Ie,Qe,We,Xe,y,B,ee,ve,Pe,Ee,ge,be,ye,Le,Oe;m=new er({props:{size:16}});let ne=s[0]&&Lt(s);const mt=[dr,fr],Ne=[];function gt(f,N){return f[0]?0:1}A=gt(s),E=Ne[A]=mt[A](s);let ue=!s[18]&&s[19]&&Mt(s);const bt=[hr,_r],Re=[];function vt(f,N){return f[1].length===0?0:1}I=vt(s),M=Re[I]=bt[I](s);const yt=[vr,br,gr],je=[];function kt(f,N){return f[11]?0:f[12]?1:2}ce=kt(s),se=je[ce]=yt[ce](s);function wt(f,N){return f[2]?kr:yr}let Ze=wt(s),De=Ze(s);function Et(f,N){return f[2]&&f[10][f[2].id]?Tr:Dr}let et=Et(s),Te=et(s),fe=s[2]&&s[10][s[2].id]&&Rt(s);function Dt(f,N){if(f[14]&&f[2]&&f[13][f[2].id])return Cr;if(f[14])return Vr}let qe=Dt(s),de=qe&&qe(s),te=s[18]&&s[15].length>0&&zt(s),re=s[3]&&At(s);return{c(){e=V(),t=p("div"),r=p("div"),l=p("div"),o=p("div"),n=p("div"),i=p("div"),a=p("span"),a.textContent=g,_=V(),v=p("button"),me(m.$$.fragment),k=V(),L=p("div"),F=p("p"),T=p("span"),T.textContent=X,R=V(),K=q(S),J=V(),z=p("div"),ne&&ne.c(),W=V(),U=p("button"),E.c(),Q=V(),Y=p("div"),Y.innerHTML=ie,j=V(),w=p("div"),$=p("div"),ue&&ue.c(),oe=V(),P=p("div"),M.c(),ke=V(),Z=p("div"),ae=p("button"),se.c(),He=V(),Se=p("div"),Ie=p("span"),De.c(),Qe=q(`
|
| 11 |
+
at least 15 seconds`),Xe=V(),y=p("span"),Te.c(),B=q(`
|
| 12 |
+
includes consent`),ve=V(),fe&&fe.c(),Pe=V(),de&&de.c(),Ee=V(),te&&te.c(),ge=V(),re&&re.c(),be=Ke(),this.h()},l(f){Xt("svelte-ymar42",document.head).forEach(u),e=x(f),t=h(f,"DIV",{class:!0});var Fe=b(t);r=h(Fe,"DIV",{class:!0});var ze=b(r);l=h(ze,"DIV",{class:!0});var Ye=b(l);o=h(Ye,"DIV",{class:!0});var Ge=b(o);n=h(Ge,"DIV",{class:!0});var tt=b(n);i=h(tt,"DIV",{class:!0});var rt=b(i);a=h(rt,"SPAN",{class:!0,"data-svelte-h":!0}),we(a)!=="svelte-i2qskl"&&(a.textContent=g),_=x(rt),v=h(rt,"BUTTON",{class:!0,title:!0});var Tt=b(v);pe(m.$$.fragment,Tt),Tt.forEach(u),rt.forEach(u),k=x(tt),L=h(tt,"DIV",{class:!0});var It=b(L);F=h(It,"P",{});var lt=b(F);T=h(lt,"SPAN",{class:!0,"data-svelte-h":!0}),we(T)!=="svelte-teyhel"&&(T.textContent=X),R=x(lt),K=O(lt,S),lt.forEach(u),It.forEach(u),tt.forEach(u),J=x(Ge),z=h(Ge,"DIV",{class:!0});var st=b(z);ne&&ne.l(st),W=x(st),U=h(st,"BUTTON",{class:!0});var xt=b(U);E.l(xt),xt.forEach(u),st.forEach(u),Q=x(Ge),Y=h(Ge,"DIV",{class:!0,"data-svelte-h":!0}),we(Y)!=="svelte-ohxuow"&&(Y.innerHTML=ie),Ge.forEach(u),Ye.forEach(u),j=x(ze),w=h(ze,"DIV",{class:!0});var Vt=b(w);$=h(Vt,"DIV",{class:!0});var Ue=b($);ue&&ue.l(Ue),oe=x(Ue),P=h(Ue,"DIV",{class:!0});var Ct=b(P);M.l(Ct),Ct.forEach(u),ke=x(Ue),Z=h(Ue,"DIV",{class:!0});var Ae=b(Z);ae=h(Ae,"BUTTON",{class:!0});var $t=b(ae);se.l($t),$t.forEach(u),He=x(Ae),Se=h(Ae,"DIV",{class:!0});var ot=b(Se);Ie=h(ot,"SPAN",{class:!0});var ut=b(Ie);De.l(ut),Qe=O(ut,`
|
| 13 |
+
at least 15 seconds`),ut.forEach(u),Xe=x(ot),y=h(ot,"SPAN",{class:!0});var ft=b(y);Te.l(ft),B=O(ft,`
|
| 14 |
+
includes consent`),ft.forEach(u),ot.forEach(u),ve=x(Ae),fe&&fe.l(Ae),Pe=x(Ae),de&&de.l(Ae),Ae.forEach(u),Ee=x(Ue),te&&te.l(Ue),Ue.forEach(u),Vt.forEach(u),ze.forEach(u),Fe.forEach(u),ge=x(f),re&&re.l(f),be=Ke(),this.h()},h(){document.title="Voice Cloning - HFStudio",d(a,"class","text-sm text-gray-400"),d(v,"class","p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"),d(v,"title","Try a different sample text"),d(i,"class","absolute top-3 left-3 flex items-center gap-2 z-10"),d(T,"class","bg-yellow-50 px-2 py-1 rounded border border-amber-200"),d(L,"class","w-full h-80 pt-12 px-6 pb-6 bg-white border-2 border-amber-400 rounded-lg text-gray-900 text-lg leading-relaxed overflow-y-auto"),d(n,"class","relative mb-4"),d(U,"class",H="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 cursor-pointer "+(s[0]?"border-4 border-orange-500 bg-transparent":"bg-orange-500 hover:bg-orange-600")),d(z,"class","flex justify-center items-center flex-1 relative"),d(Y,"class","mb-6"),d(o,"class","flex-1 pb-24 relative flex flex-col"),d(l,"class","flex-1 flex flex-col p-6"),d(P,"class","mb-4"),ae.disabled=Me=!s[2]||s[11]||s[12],d(ae,"class","w-full px-4 py-2 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg font-medium hover:from-amber-500 hover:to-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2"),d(Ie,"class",We="flex items-center gap-1 "+(s[2]?it(s[2])?"text-green-600":"text-red-600":"text-gray-400")),d(y,"class",ee="flex items-center gap-1 "+(s[2]?s[21](s[2])?"text-green-600":s[10][s[2].id]?"text-red-600":"text-gray-400":"text-gray-400")),d(Se,"class","mt-3 text-sm flex items-center gap-4"),d(Z,"class","mt-6 pt-4 border-t border-gray-200"),d($,"class","p-3 h-full overflow-y-auto"),d(w,"class","w-80 border-l border-gray-200 bg-white h-full overflow-hidden"),d(r,"class","flex-1 flex"),d(t,"class","flex flex-col h-full")},m(f,N){G(f,e,N),G(f,t,N),c(t,r),c(r,l),c(l,o),c(o,n),c(n,i),c(i,a),c(i,_),c(i,v),he(m,v,null),c(n,k),c(n,L),c(L,F),c(F,T),c(F,R),c(F,K),c(o,J),c(o,z),ne&&ne.m(z,null),c(z,W),c(z,U),Ne[A].m(U,null),c(o,Q),c(o,Y),c(r,j),c(r,w),c(w,$),ue&&ue.m($,null),c($,oe),c($,P),Re[I].m(P,null),c($,ke),c($,Z),c(Z,ae),je[ce].m(ae,null),c(Z,He),c(Z,Se),c(Se,Ie),De.m(Ie,null),c(Ie,Qe),c(Se,Xe),c(Se,y),Te.m(y,null),c(y,B),c(Z,ve),fe&&fe.m(Z,null),c(Z,Pe),de&&de.m(Z,null),c($,Ee),te&&te.m($,null),G(f,ge,N),re&&re.m(f,N),G(f,be,N),ye=!0,Le||(Oe=[$e(v,"click",s[23]),$e(U,"click",s[24]),$e(ae,"click",s[27])],Le=!0)},p(f,N){(!ye||N[0]&131072)&&S!==(S=f[20][f[17]]+"")&&Ce(K,S),f[0]?ne?ne.p(f,N):(ne=Lt(f),ne.c(),ne.m(z,W)):ne&&(ne.d(1),ne=null);let Fe=A;A=gt(f),A===Fe?Ne[A].p(f,N):(Ve(),C(Ne[Fe],1,1,()=>{Ne[Fe]=null}),xe(),E=Ne[A],E?E.p(f,N):(E=Ne[A]=mt[A](f),E.c()),D(E,1),E.m(U,null)),(!ye||N[0]&1&&H!==(H="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 cursor-pointer "+(f[0]?"border-4 border-orange-500 bg-transparent":"bg-orange-500 hover:bg-orange-600")))&&d(U,"class",H),!f[18]&&f[19]?ue?ue.p(f,N):(ue=Mt(f),ue.c(),ue.m($,oe)):ue&&(ue.d(1),ue=null);let ze=I;I=vt(f),I===ze?Re[I].p(f,N):(Ve(),C(Re[ze],1,1,()=>{Re[ze]=null}),xe(),M=Re[I],M?M.p(f,N):(M=Re[I]=bt[I](f),M.c()),D(M,1),M.m(P,null));let Ye=ce;ce=kt(f),ce!==Ye&&(Ve(),C(je[Ye],1,1,()=>{je[Ye]=null}),xe(),se=je[ce],se||(se=je[ce]=yt[ce](f),se.c()),D(se,1),se.m(ae,null)),(!ye||N[0]&6148&&Me!==(Me=!f[2]||f[11]||f[12]))&&(ae.disabled=Me),Ze===(Ze=wt(f))&&De?De.p(f,N):(De.d(1),De=Ze(f),De&&(De.c(),De.m(Ie,Qe))),(!ye||N[0]&4&&We!==(We="flex items-center gap-1 "+(f[2]?it(f[2])?"text-green-600":"text-red-600":"text-gray-400")))&&d(Ie,"class",We),et===(et=Et(f))&&Te?Te.p(f,N):(Te.d(1),Te=et(f),Te&&(Te.c(),Te.m(y,B))),(!ye||N[0]&1028&&ee!==(ee="flex items-center gap-1 "+(f[2]?f[21](f[2])?"text-green-600":f[10][f[2].id]?"text-red-600":"text-gray-400":"text-gray-400")))&&d(y,"class",ee),f[2]&&f[10][f[2].id]?fe?fe.p(f,N):(fe=Rt(f),fe.c(),fe.m(Z,Pe)):fe&&(fe.d(1),fe=null),qe===(qe=Dt(f))&&de?de.p(f,N):(de&&de.d(1),de=qe&&qe(f),de&&(de.c(),de.m(Z,null))),f[18]&&f[15].length>0?te?(te.p(f,N),N[0]&294912&&D(te,1)):(te=zt(f),te.c(),D(te,1),te.m($,null)):te&&(Ve(),C(te,1,1,()=>{te=null}),xe()),f[3]?re?(re.p(f,N),N[0]&8&&D(re,1)):(re=At(f),re.c(),D(re,1),re.m(be.parentNode,be)):re&&(Ve(),C(re,1,1,()=>{re=null}),xe())},i(f){ye||(D(m.$$.fragment,f),D(E),D(M),D(se),D(te),D(re),ye=!0)},o(f){C(m.$$.fragment,f),C(E),C(M),C(se),C(te),C(re),ye=!1},d(f){f&&(u(e),u(t),u(ge),u(be)),_e(m),ne&&ne.d(),Ne[A].d(),ue&&ue.d(),Re[I].d(),je[ce].d(),De.d(),Te.d(),fe&&fe.d(),de&&de.d(),te&&te.d(),re&&re.d(f),Le=!1,ct(Oe)}}}function it(s){return s&&s.duration>=15}function Nr(s,e,t){let r=!1,l=[],o=null,n=[],i=null,a=[],g=!1,_="",v="",m=0,k=0,L=null,F=0,T=null,X=null,R=null,S=null,K={},J=!1,z=!1,W={},U="",A=[],E=!1;const H=["There's a quiet kind of magic in the early hours of the morning, when the world is still half-asleep and the air feels crisp with possibility. The hum of the refrigerator becomes a rhythm, the ticking of the clock a heartbeat, and for a brief moment, everything feels perfectly in sync.","The aroma of fresh coffee dances through the kitchen as sunlight streams through translucent curtains, casting golden patterns on weathered wooden floors. Steam rises from the ceramic mug like incense, creating a small sanctuary of warmth and comfort in the midst of a busy day.","Ocean waves crash against weathered cliffs with relentless determination, their white foam reaching toward the endless sky. Seabirds call out across the salt-scented breeze, their cries echoing off ancient stone formations that have stood witness to countless storms and seasons."];let Q=0,Y=!1,ie=!1;function j(y){if(!y)return!1;const B=K[y.id];return B&&B.consent_detected}function w(y,B=""){t(4,_=y),t(5,v=B),t(3,g=!0)}function $(){t(3,g=!1),t(4,_=""),t(5,v="")}function oe(){t(17,Q=(Q+1)%H.length)}async function P(){try{const y=await fetch("/api/auth/user",{credentials:"include"});if(y.ok){const B=await y.json(),ee=Y;t(18,Y=B.authenticated),Y&&!ee?await Me():!Y&&ee&&t(15,A=[])}else t(18,Y=!1),t(15,A=[])}catch{t(18,Y=!1),t(15,A=[])}}async function I(){if(!Y){t(19,ie=!0);return}try{let Ee=function(){if(!r||!X)return;X.getByteFrequencyData(Pe);let ge=0;for(let be=0;be<ve;be++)ge+=Pe[be];t(7,F=ge/ve/255),requestAnimationFrame(Ee)};const y=await navigator.mediaDevices.getUserMedia({audio:!0});let B={};MediaRecorder.isTypeSupported("audio/mp3")?B.mimeType="audio/mp3":MediaRecorder.isTypeSupported("audio/mpeg")?B.mimeType="audio/mpeg":MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?B.mimeType="audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/webm")&&(B.mimeType="audio/webm"),i=new MediaRecorder(y,B),a=[],n=[],t(6,k=0),t(7,F=0),T=new(window.AudioContext||window.webkitAudioContext),X=T.createAnalyser(),T.createMediaStreamSource(y).connect(X),X.fftSize=256;const ve=X.frequencyBinCount,Pe=new Uint8Array(ve);i.ondataavailable=ge=>{a.push(ge.data)},i.onstop=()=>{const ge=new Blob(a,{type:B.mimeType||"audio/webm"}),be=URL.createObjectURL(ge),ye={id:Date.now(),url:be,blob:ge,timestamp:new Date,duration:k/100*15};t(1,l=[...l,ye]),y.getTracks().forEach(Le=>Le.stop()),T&&(T.close(),T=null),t(6,k=0),t(7,F=0)},i.start(),t(0,r=!0),Ee(),L=setInterval(()=>{if(!r){clearInterval(L);return}t(6,k+=100/15/10),k>=100&&t(6,k=100)},100)}catch(y){console.error("Error accessing microphone:",y),w("Microphone Error","Could not access microphone. Please check permissions.")}}function M(){i&&i.state==="recording"&&(i.stop(),t(0,r=!1),n=[],L&&(clearInterval(L),L=null))}function ke(){r?M():I()}function Z(y){t(2,o=y)}function ae(y){if((R==null?void 0:R.id)===y.id&&S&&!S.paused){S.pause(),t(8,R=null);return}S&&(S.pause(),t(9,S=null)),t(9,S=new Audio(y.url)),t(8,R=y),S.addEventListener("ended",()=>{t(8,R=null),t(9,S=null)}),S.addEventListener("pause",()=>{S&&S.ended&&(t(8,R=null),t(9,S=null))}),S.play()}async function ce(){if(!o){w("Clone Error","Please select a recording.");return}t(11,J=!0),t(14,U="");try{const y=new FormData;y.append("audio_file",o.blob,"recording.mp3");const B=await fetch("/api/voice/transcribe",{method:"POST",credentials:"include",body:y});if(!B.ok){const ve=await B.text();throw new Error(`HTTP error! status: ${B.status}, response: ${ve}`)}const ee=await B.json();if(ee.success){t(10,K[o.id]={transcript:ee.transcript,first_words:ee.first_words,consent_detected:ee.consent_detected},K),t(10,K={...K});const ve=it(o),Pe=ee.consent_detected;if(ve&&Pe){t(11,J=!1),t(12,z=!0);try{const Ee=new FormData;Ee.append("audio_file",o.blob,"recording.mp3");const ge=`Voice_${Date.now()}`,be=encodeURIComponent(ee.transcript),ye=Math.floor(o.duration),Le=await fetch(`/api/voice/upload?voice_name=${ge}&transcript=${be}&duration=${ye}`,{method:"POST",credentials:"include",body:Ee});if(!Le.ok){const ne=await Le.text();throw new Error(`Upload failed: ${ne}`)}const Oe=await Le.json();Oe.success?(t(13,W[o.id]=Oe,W),t(13,W={...W}),t(14,U="Your voice has been saved to a temporary URL for 24 hours and will be automatically deleted. You can now use it for text-to-speech generation."),await Me()):w("Upload Error",Oe.error||"Failed to upload voice")}catch(Ee){w("Upload Error",`Failed to upload voice: ${Ee.message}`)}finally{t(12,z=!1)}}}else w("Transcription Error",ee.error||"Failed to transcribe audio")}catch(y){w("Network Error",`Failed to process recording: ${y.message}`)}finally{z||t(11,J=!1)}}async function se(){try{const y=await fetch("/api/history/load",{method:"GET",credentials:"include"});y.ok&&(m=(await y.json()).entries.filter(ve=>ve.entry_type==="generation").length)}catch(y){console.error("Error loading history count:",y),m=0}}async function Me(){if(Y)try{const y=await fetch("/api/voice/user-voices",{method:"GET",credentials:"include"});if(y.ok){const B=await y.json();t(15,A=B.voices)}}catch(y){console.error("Error loading user voices:",y),t(15,A=[])}}async function He(y){t(16,E=!0);try{const B=await fetch(`/api/voice/${y}`,{method:"DELETE",credentials:"include"});if(B.ok)t(15,A=A.filter(ee=>ee.id!==y)),t(14,U="Voice deleted successfully"),setTimeout(()=>{t(14,U="")},3e3);else{const ee=await B.json();w("Delete Error",ee.detail||"Failed to delete voice")}}catch(B){w("Delete Error",`Failed to delete voice: ${B.message}`)}finally{t(16,E=!1)}}return Zt(async()=>{await P(),await se(),await Me()}),[r,l,o,g,_,v,k,F,R,S,K,J,z,W,U,A,E,Q,Y,ie,H,j,$,oe,ke,Z,ae,ce,He,()=>t(19,ie=!1),y=>ae(y),y=>Z(y),y=>ae({url:y.voice_url,id:y.id}),y=>He(y.id)]}class Hr extends dt{constructor(e){super(),_t(this,e,Nr,Mr,ht,{},null,[-1,-1])}}export{Hr as component};
|
hfstudio/static/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":"
|
|
|
|
| 1 |
+
{"version":"1761298566786"}
|
hfstudio/static/index.html
CHANGED
|
@@ -6,25 +6,25 @@
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<title>HFStudio - Text to Speech</title>
|
| 8 |
|
| 9 |
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
| 10 |
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
| 11 |
<link rel="modulepreload" href="/_app/immutable/chunks/TRxHAhOH.js">
|
| 12 |
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
| 13 |
<link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
|
| 14 |
</head>
|
| 15 |
<body data-sveltekit-preload-data="hover">
|
| 16 |
<div style="display: contents">
|
| 17 |
<script>
|
| 18 |
{
|
| 19 |
-
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
-
import("/_app/immutable/entry/start.
|
| 27 |
-
import("/_app/immutable/entry/app.
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|
|
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<title>HFStudio - Text to Speech</title>
|
| 8 |
|
| 9 |
+
<link rel="modulepreload" href="/_app/immutable/entry/start.wgrpqMnA.js">
|
| 10 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/BwrmP8Nl.js">
|
| 11 |
<link rel="modulepreload" href="/_app/immutable/chunks/TRxHAhOH.js">
|
| 12 |
+
<link rel="modulepreload" href="/_app/immutable/entry/app.DfdrJ3in.js">
|
| 13 |
<link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
|
| 14 |
</head>
|
| 15 |
<body data-sveltekit-preload-data="hover">
|
| 16 |
<div style="display: contents">
|
| 17 |
<script>
|
| 18 |
{
|
| 19 |
+
__sveltekit_wy8kgr = {
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
+
import("/_app/immutable/entry/start.wgrpqMnA.js"),
|
| 27 |
+
import("/_app/immutable/entry/app.DfdrJ3in.js")
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|