@imgly/plugin-ai-video-generation-web 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- var lo=Object.create;var xi=Object.defineProperty;var uo=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var po=Object.getPrototypeOf,fo=Object.prototype.hasOwnProperty;var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ho=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of co(e))!fo.call(t,n)&&n!==i&&xi(t,n,{get:()=>e[n],enumerable:!(r=uo(e,n))||r.enumerable});return t};var go=(t,e,i)=>(i=t!=null?lo(po(t)):{},ho(e||!t||!t.__esModule?xi(i,"default",{value:t,enumerable:!0}):i,t));var Ot=I(U=>{"use strict";var Pl=U&&U.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})};Object.defineProperty(U,"__esModule",{value:!0});U.TARGET_URL_HEADER=void 0;U.withMiddleware=Ml;U.withProxy=Ol;function Ml(...t){let e=i=>typeof i=="function";return i=>Pl(this,void 0,void 0,function*(){let r=Object.assign({},i);for(let n of t.filter(e))r=yield n(r);return r})}U.TARGET_URL_HEADER="x-fal-target-url";function Ol(t){let e=i=>Promise.resolve(i);return typeof window>"u"?e:i=>i.headers&&U.TARGET_URL_HEADER in i?e(i):Promise.resolve(Object.assign(Object.assign({},i),{url:t.targetUrl,headers:Object.assign(Object.assign({},i.headers||{}),{[U.TARGET_URL_HEADER]:i.url})}))}});var K=I(V=>{"use strict";var Qi=V&&V.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})};Object.defineProperty(V,"__esModule",{value:!0});V.ValidationError=V.ApiError=void 0;V.defaultResponseHandler=Wi;V.resultResponseHandler=Dl;var jl="x-fal-request-id",pe=class extends Error{constructor({message:e,status:i,body:r}){super(e),this.name="ApiError",this.status=i,this.body=r}};V.ApiError=pe;var Qe=class extends pe{constructor(e){super(e),this.name="ValidationError"}get fieldErrors(){return typeof this.body.detail=="string"?[{loc:["body"],msg:this.body.detail,type:"value_error"}]:this.body.detail||[]}getFieldErrors(e){return this.fieldErrors.filter(i=>i.loc[i.loc.length-1]===e)}};V.ValidationError=Qe;function Wi(t){return Qi(this,void 0,void 0,function*(){var e;let{status:i,statusText:r}=t,n=(e=t.headers.get("Content-Type"))!==null&&e!==void 0?e:"";if(!t.ok){if(n.includes("application/json")){let o=yield t.json(),s=i===422?Qe:pe;throw new s({message:o.message||r,status:i,body:o})}throw new pe({message:`HTTP ${i}: ${r}`,status:i})}return n.includes("application/json")?t.json():n.includes("text/html")?t.text():n.includes("application/octet-stream")?t.arrayBuffer():t.text()})}function Dl(t){return Qi(this,void 0,void 0,function*(){return{data:yield Wi(t),requestId:t.headers.get(jl)||""}})}});var H=I(D=>{"use strict";var ql=D&&D.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})};Object.defineProperty(D,"__esModule",{value:!0});D.ensureEndpointIdFormat=Yi;D.parseEndpointId=Vl;D.isValidUrl=Ll;D.throttle=Rl;D.isReact=$l;D.isPlainObject=Fl;D.sleep=Nl;function Yi(t){if(t.split("/").length>1)return t;let[,i,r]=/^([0-9]+)-([a-zA-Z0-9-]+)$/.exec(t)||[];if(i&&r)return`${i}/${r}`;throw new Error(`Invalid app id: ${t}. Must be in the format <appOwner>/<appId>`)}var Ul=["workflows","comfy"];function Vl(t){let i=Yi(t).split("/");return Ul.includes(i[0])?{owner:i[1],alias:i[2],path:i.slice(3).join("/")||void 0,namespace:i[0]}:{owner:i[0],alias:i[1],path:i.slice(2).join("/")||void 0}}function Ll(t){try{let{host:e}=new URL(t);return/(fal\.(ai|run))$/.test(e)}catch{return!1}}function Rl(t,e,i=!1){let r,n;return(...o)=>{!n&&i?(t(...o),n=Date.now()):(r&&clearTimeout(r),r=setTimeout(()=>{Date.now()-n>=e&&(t(...o),n=Date.now())},e-(Date.now()-n)))}}var jt;function $l(){if(jt===void 0){let t=new Error().stack;jt=!!t&&(t.includes("node_modules/react-dom/")||t.includes("node_modules/next/"))}return jt}function Fl(t){return!!t&&Object.getPrototypeOf(t)===Object.prototype}function Nl(t){return ql(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}});var Ce=I(M=>{"use strict";var zl=M&&M.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})};Object.defineProperty(M,"__esModule",{value:!0});M.DEFAULT_RETRY_OPTIONS=M.DEFAULT_RETRYABLE_STATUS_CODES=void 0;M.isRetryableError=Zi;M.calculateBackoffDelay=Xi;M.executeWithRetry=Hl;var Bl=K(),Kl=H();M.DEFAULT_RETRYABLE_STATUS_CODES=[429,502,503,504];M.DEFAULT_RETRY_OPTIONS={maxRetries:3,baseDelay:1e3,maxDelay:3e4,backoffMultiplier:2,retryableStatusCodes:M.DEFAULT_RETRYABLE_STATUS_CODES,enableJitter:!0};function Zi(t,e){return t instanceof Bl.ApiError&&e.includes(t.status)}function Xi(t,e,i,r,n){let o=Math.min(e*Math.pow(r,t),i);if(n){let s=.25*o*(Math.random()*2-1);return Math.max(0,o+s)}return o}function Hl(t,e,i){return zl(this,void 0,void 0,function*(){let r={totalAttempts:0,totalDelay:0},n;for(let o=0;o<=e.maxRetries;o++){r.totalAttempts++;try{return{result:yield t(),metrics:r}}catch(s){if(n=s,r.lastError=s,o===e.maxRetries||!Zi(s,e.retryableStatusCodes))throw s;let a=Xi(o,e.baseDelay,e.maxDelay,e.backoffMultiplier,e.enableJitter);r.totalDelay+=a,i&&i(o+1,s,a),yield(0,Kl.sleep)(a)}}throw n})}});var Ji=I((Xh,Gl)=>{Gl.exports={name:"@fal-ai/client",description:"The fal.ai client for JavaScript and TypeScript",version:"1.6.2",license:"MIT",repository:{type:"git",url:"https://github.com/fal-ai/fal-js.git",directory:"libs/client"},keywords:["fal","client","ai","ml","typescript"],exports:{".":"./src/index.js","./endpoints":"./src/types/endpoints.js"},typesVersions:{"*":{endpoints:["src/types/endpoints.d.ts"]}},main:"./src/index.js",types:"./src/index.d.ts",dependencies:{"@msgpack/msgpack":"^3.0.0-beta2","eventsource-parser":"^1.1.2",robot3:"^0.4.1"},engines:{node:">=18.0.0"},type:"commonjs"}});var Ze=I(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.isBrowser=Ql;Ye.getUserAgent=Wl;function Ql(){return typeof window<"u"&&typeof window.document<"u"}var We=null;function Wl(){if(We!==null)return We;let t=Ji();return We=`${t.name}/${t.version}`,We}});var Xe=I(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.credentialsFromEnv=void 0;G.resolveDefaultFetch=ir;G.createConfig=tu;G.getRestApiUrl=iu;var er=Ot(),Yl=K(),tr=Ce(),Zl=Ze();function ir(){if(typeof fetch>"u")throw new Error("Your environment does not support fetch. Please provide your own fetch implementation.");return fetch}function Xl(){return typeof process<"u"&&process.env&&(typeof process.env.FAL_KEY<"u"||typeof process.env.FAL_KEY_ID<"u"&&typeof process.env.FAL_KEY_SECRET<"u")}var Jl=()=>{if(Xl())return typeof process.env.FAL_KEY<"u"?process.env.FAL_KEY:process.env.FAL_KEY_ID?`${process.env.FAL_KEY_ID}:${process.env.FAL_KEY_SECRET}`:void 0};G.credentialsFromEnv=Jl;var eu={credentials:G.credentialsFromEnv,suppressLocalCredentialsWarning:!1,requestMiddleware:t=>Promise.resolve(t),responseHandler:Yl.defaultResponseHandler,retry:tr.DEFAULT_RETRY_OPTIONS};function tu(t){var e;let i=Object.assign(Object.assign(Object.assign({},eu),t),{fetch:(e=t.fetch)!==null&&e!==void 0?e:ir(),retry:Object.assign(Object.assign({},tr.DEFAULT_RETRY_OPTIONS),t.retry||{})});t.proxyUrl&&(i=Object.assign(Object.assign({},i),{requestMiddleware:(0,er.withMiddleware)(i.requestMiddleware,(0,er.withProxy)({targetUrl:t.proxyUrl}))}));let{credentials:r,suppressLocalCredentialsWarning:n}=i,o=typeof r=="function"?r():r;return(0,Zl.isBrowser)()&&o&&!n&&console.warn("The fal credentials are exposed in the browser's environment. That's not recommended for production use cases."),i}function iu(){return"https://rest.alpha.fal.ai"}});var fe=I(Q=>{"use strict";var rr=Q&&Q.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},ru=Q&&Q.__rest||function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i};Object.defineProperty(Q,"__esModule",{value:!0});Q.dispatchRequest=ou;Q.buildUrl=su;var nr=Ce(),or=Ze(),Dt=H(),nu=typeof navigator<"u"&&navigator?.userAgent==="Cloudflare-Workers";function ou(t){return rr(this,void 0,void 0,function*(){var e;let{targetUrl:i,input:r,config:n,options:o={}}=t,{credentials:s,requestMiddleware:a,responseHandler:c,fetch:u}=n,l=Object.assign(Object.assign({},n.retry),o.retry||{}),d=()=>rr(this,void 0,void 0,function*(){var p,g,y;let v=(0,or.isBrowser)()?{}:{"User-Agent":(0,or.getUserAgent)()},f=typeof s=="function"?s():s,{method:m,url:_,headers:x}=yield a({method:((g=(p=t.method)!==null&&p!==void 0?p:o.method)!==null&&g!==void 0?g:"post").toUpperCase(),url:i,headers:t.headers}),P=f?{Authorization:`Key ${f}`}:{},wt=Object.assign(Object.assign(Object.assign(Object.assign({},P),{Accept:"application/json","Content-Type":"application/json"}),v),x??{}),{responseHandler:xt,retry:Th}=o,wi=ru(o,["responseHandler","retry"]),ao=yield u(_,Object.assign(Object.assign(Object.assign(Object.assign({},wi),{method:m,headers:Object.assign(Object.assign({},wt),(y=wi.headers)!==null&&y!==void 0?y:{})}),!nu&&{mode:"cors"}),{signal:o.signal,body:m.toLowerCase()!=="get"&&r?JSON.stringify(r):void 0}));return yield(xt??c)(ao)}),h;for(let p=0;p<=l.maxRetries;p++)try{return yield d()}catch(g){if(h=g,p===l.maxRetries||!(0,nr.isRetryableError)(g,l.retryableStatusCodes)||((e=o.signal)===null||e===void 0?void 0:e.aborted))throw g;let v=(0,nr.calculateBackoffDelay)(p,l.baseDelay,l.maxDelay,l.backoffMultiplier,l.enableJitter);yield(0,Dt.sleep)(v)}throw h})}function su(t,e={}){var i,r;let n=((i=e.method)!==null&&i!==void 0?i:"post").toLowerCase(),o=((r=e.path)!==null&&r!==void 0?r:"").replace(/^\//,"").replace(/\/{2,}/,"/"),s=e.input,a=Object.assign(Object.assign({},e.query||{}),n==="get"?s:{}),c=Object.keys(a).length>0?`?${new URLSearchParams(a).toString()}`:"";if((0,Dt.isValidUrl)(t))return`${t.endsWith("/")?t:`${t}/`}${o}${c}`;let u=(0,Dt.ensureEndpointIdFormat)(t);return`${`https://${e.subdomain?`${e.subdomain}.`:""}fal.run/${u}/${o}`.replace(/\/$/,"")}${c}`}});var ar=I(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});function au(t){let e,i,r,n,o,s,a;return c(),{feed:u,reset:c};function c(){e=!0,i="",r=0,n=-1,o=void 0,s=void 0,a=""}function u(d){i=i?i+d:d,e&&lu(i)&&(i=i.slice(sr.length)),e=!1;let h=i.length,p=0,g=!1;for(;p<h;){g&&(i[p]===`
2
- `&&++p,g=!1);let y=-1,v=n,f;for(let m=r;y<0&&m<h;++m)f=i[m],f===":"&&v<0?v=m-p:f==="\r"?(g=!0,y=m-p):f===`
3
- `&&(y=m-p);if(y<0){r=h-p,n=v;break}else r=0,n=-1;l(i,p,v,y),p+=y+1}p===h?i="":p>0&&(i=i.slice(p))}function l(d,h,p,g){if(g===0){a.length>0&&(t({type:"event",id:o,event:s||void 0,data:a.slice(0,-1)}),a="",o=void 0),s=void 0;return}let y=p<0,v=d.slice(h,h+(y?g:p)),f=0;y?f=g:d[h+p+1]===" "?f=p+2:f=p+1;let m=h+f,_=g-f,x=d.slice(m,m+_).toString();if(v==="data")a+=x?"".concat(x,`
1
+ var So=Object.create;var Ci=Object.defineProperty;var Eo=Object.getOwnPropertyDescriptor;var Ao=Object.getOwnPropertyNames;var Co=Object.getPrototypeOf,ko=Object.prototype.hasOwnProperty;var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Po=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ao(e))!ko.call(t,n)&&n!==i&&Ci(t,n,{get:()=>e[n],enumerable:!(r=Eo(e,n))||r.enumerable});return t};var qo=(t,e,i)=>(i=t!=null?So(Co(t)):{},Po(e||!t||!t.__esModule?Ci(i,"default",{value:t,enumerable:!0}):i,t));var jt=T(O=>{"use strict";var Hl=O&&O.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};Object.defineProperty(O,"__esModule",{value:!0});O.TARGET_URL_HEADER=void 0;O.withMiddleware=Gl;O.withProxy=Ql;function Gl(...t){let e=i=>typeof i=="function";return i=>Hl(this,void 0,void 0,function*(){let r=Object.assign({},i);for(let n of t.filter(e))r=yield n(r);return r})}O.TARGET_URL_HEADER="x-fal-target-url";function Ql(t){let e=i=>Promise.resolve(i);return typeof window>"u"?e:i=>i.headers&&O.TARGET_URL_HEADER in i?e(i):Promise.resolve(Object.assign(Object.assign({},i),{url:t.targetUrl,headers:Object.assign(Object.assign({},i.headers||{}),{[O.TARGET_URL_HEADER]:i.url})}))}});var G=T(R=>{"use strict";var Ji=R&&R.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};Object.defineProperty(R,"__esModule",{value:!0});R.ValidationError=R.ApiError=void 0;R.defaultResponseHandler=er;R.resultResponseHandler=Yl;var Wl="x-fal-request-id",fe=class extends Error{constructor({message:e,status:i,body:r}){super(e),this.name="ApiError",this.status=i,this.body=r}};R.ApiError=fe;var Ze=class extends fe{constructor(e){super(e),this.name="ValidationError"}get fieldErrors(){return typeof this.body.detail=="string"?[{loc:["body"],msg:this.body.detail,type:"value_error"}]:this.body.detail||[]}getFieldErrors(e){return this.fieldErrors.filter(i=>i.loc[i.loc.length-1]===e)}};R.ValidationError=Ze;function er(t){return Ji(this,void 0,void 0,function*(){var e;let{status:i,statusText:r}=t,n=(e=t.headers.get("Content-Type"))!==null&&e!==void 0?e:"";if(!t.ok){if(n.includes("application/json")){let o=yield t.json(),s=i===422?Ze:fe;throw new s({message:o.message||r,status:i,body:o})}throw new fe({message:`HTTP ${i}: ${r}`,status:i})}return n.includes("application/json")?t.json():n.includes("text/html")?t.text():n.includes("application/octet-stream")?t.arrayBuffer():t.text()})}function Yl(t){return Ji(this,void 0,void 0,function*(){return{data:yield er(t),requestId:t.headers.get(Wl)||""}})}});var Q=T(j=>{"use strict";var Zl=j&&j.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};Object.defineProperty(j,"__esModule",{value:!0});j.ensureEndpointIdFormat=tr;j.parseEndpointId=Jl;j.isValidUrl=eu;j.throttle=tu;j.isReact=iu;j.isPlainObject=ru;j.sleep=nu;function tr(t){if(t.split("/").length>1)return t;let[,i,r]=/^([0-9]+)-([a-zA-Z0-9-]+)$/.exec(t)||[];if(i&&r)return`${i}/${r}`;throw new Error(`Invalid app id: ${t}. Must be in the format <appOwner>/<appId>`)}var Xl=["workflows","comfy"];function Jl(t){let i=tr(t).split("/");return Xl.includes(i[0])?{owner:i[1],alias:i[2],path:i.slice(3).join("/")||void 0,namespace:i[0]}:{owner:i[0],alias:i[1],path:i.slice(2).join("/")||void 0}}function eu(t){try{let{host:e}=new URL(t);return/(fal\.(ai|run))$/.test(e)}catch{return!1}}function tu(t,e,i=!1){let r,n;return(...o)=>{!n&&i?(t(...o),n=Date.now()):(r&&clearTimeout(r),r=setTimeout(()=>{Date.now()-n>=e&&(t(...o),n=Date.now())},e-(Date.now()-n)))}}var Ft;function iu(){if(Ft===void 0){let t=new Error().stack;Ft=!!t&&(t.includes("node_modules/react-dom/")||t.includes("node_modules/next/"))}return Ft}function ru(t){return!!t&&Object.getPrototypeOf(t)===Object.prototype}function nu(t){return Zl(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}});var Ve=T(q=>{"use strict";var ou=q&&q.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};Object.defineProperty(q,"__esModule",{value:!0});q.DEFAULT_RETRY_OPTIONS=q.DEFAULT_RETRYABLE_STATUS_CODES=void 0;q.isRetryableError=ir;q.calculateBackoffDelay=rr;q.executeWithRetry=lu;var su=G(),au=Q();q.DEFAULT_RETRYABLE_STATUS_CODES=[429,502,503,504];q.DEFAULT_RETRY_OPTIONS={maxRetries:3,baseDelay:1e3,maxDelay:3e4,backoffMultiplier:2,retryableStatusCodes:q.DEFAULT_RETRYABLE_STATUS_CODES,enableJitter:!0};function ir(t,e){return t instanceof su.ApiError&&e.includes(t.status)}function rr(t,e,i,r,n){let o=Math.min(e*Math.pow(r,t),i);if(n){let s=.25*o*(Math.random()*2-1);return Math.max(0,o+s)}return o}function lu(t,e,i){return ou(this,void 0,void 0,function*(){let r={totalAttempts:0,totalDelay:0},n;for(let o=0;o<=e.maxRetries;o++){r.totalAttempts++;try{return{result:yield t(),metrics:r}}catch(s){if(n=s,r.lastError=s,o===e.maxRetries||!ir(s,e.retryableStatusCodes))throw s;let a=rr(o,e.baseDelay,e.maxDelay,e.backoffMultiplier,e.enableJitter);r.totalDelay+=a,i&&i(o+1,s,a),yield(0,au.sleep)(a)}}throw n})}});var nr=T((Cg,uu)=>{uu.exports={name:"@fal-ai/client",description:"The fal.ai client for JavaScript and TypeScript",version:"1.6.2",license:"MIT",repository:{type:"git",url:"https://github.com/fal-ai/fal-js.git",directory:"libs/client"},keywords:["fal","client","ai","ml","typescript"],exports:{".":"./src/index.js","./endpoints":"./src/types/endpoints.js"},typesVersions:{"*":{endpoints:["src/types/endpoints.d.ts"]}},main:"./src/index.js",types:"./src/index.d.ts",dependencies:{"@msgpack/msgpack":"^3.0.0-beta2","eventsource-parser":"^1.1.2",robot3:"^0.4.1"},engines:{node:">=18.0.0"},type:"commonjs"}});var et=T(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.isBrowser=du;Je.getUserAgent=cu;function du(){return typeof window<"u"&&typeof window.document<"u"}var Xe=null;function cu(){if(Xe!==null)return Xe;let t=nr();return Xe=`${t.name}/${t.version}`,Xe}});var tt=T(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.credentialsFromEnv=void 0;W.resolveDefaultFetch=ar;W.createConfig=yu;W.getRestApiUrl=bu;var or=jt(),pu=G(),sr=Ve(),mu=et();function ar(){if(typeof fetch>"u")throw new Error("Your environment does not support fetch. Please provide your own fetch implementation.");return fetch}function fu(){return typeof process<"u"&&process.env&&(typeof process.env.FAL_KEY<"u"||typeof process.env.FAL_KEY_ID<"u"&&typeof process.env.FAL_KEY_SECRET<"u")}var gu=()=>{if(fu())return typeof process.env.FAL_KEY<"u"?process.env.FAL_KEY:process.env.FAL_KEY_ID?`${process.env.FAL_KEY_ID}:${process.env.FAL_KEY_SECRET}`:void 0};W.credentialsFromEnv=gu;var hu={credentials:W.credentialsFromEnv,suppressLocalCredentialsWarning:!1,requestMiddleware:t=>Promise.resolve(t),responseHandler:pu.defaultResponseHandler,retry:sr.DEFAULT_RETRY_OPTIONS};function yu(t){var e;let i=Object.assign(Object.assign(Object.assign({},hu),t),{fetch:(e=t.fetch)!==null&&e!==void 0?e:ar(),retry:Object.assign(Object.assign({},sr.DEFAULT_RETRY_OPTIONS),t.retry||{})});t.proxyUrl&&(i=Object.assign(Object.assign({},i),{requestMiddleware:(0,or.withMiddleware)(i.requestMiddleware,(0,or.withProxy)({targetUrl:t.proxyUrl}))}));let{credentials:r,suppressLocalCredentialsWarning:n}=i,o=typeof r=="function"?r():r;return(0,mu.isBrowser)()&&o&&!n&&console.warn("The fal credentials are exposed in the browser's environment. That's not recommended for production use cases."),i}function bu(){return"https://rest.alpha.fal.ai"}});var ge=T(Y=>{"use strict";var lr=Y&&Y.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})},vu=Y&&Y.__rest||function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i};Object.defineProperty(Y,"__esModule",{value:!0});Y.dispatchRequest=_u;Y.buildUrl=xu;var ur=Ve(),dr=et(),Ot=Q(),wu=typeof navigator<"u"&&navigator?.userAgent==="Cloudflare-Workers";function _u(t){return lr(this,void 0,void 0,function*(){var e;let{targetUrl:i,input:r,config:n,options:o={}}=t,{credentials:s,requestMiddleware:a,responseHandler:u,fetch:d}=n,l=Object.assign(Object.assign({},n.retry),o.retry||{}),c=()=>lr(this,void 0,void 0,function*(){var p,g,h;let v=(0,dr.isBrowser)()?{}:{"User-Agent":(0,dr.getUserAgent)()},f=typeof s=="function"?s():s,{method:y,url:I,headers:x}=yield a({method:((g=(p=t.method)!==null&&p!==void 0?p:o.method)!==null&&g!==void 0?g:"post").toUpperCase(),url:i,headers:t.headers}),P=f?{Authorization:`Key ${f}`}:{},Tt=Object.assign(Object.assign(Object.assign(Object.assign({},P),{Accept:"application/json","Content-Type":"application/json"}),v),x??{}),{responseHandler:It,retry:eg}=o,Ai=vu(o,["responseHandler","retry"]),Io=yield d(I,Object.assign(Object.assign(Object.assign(Object.assign({},Ai),{method:y,headers:Object.assign(Object.assign({},Tt),(h=Ai.headers)!==null&&h!==void 0?h:{})}),!wu&&{mode:"cors"}),{signal:o.signal,body:y.toLowerCase()!=="get"&&r?JSON.stringify(r):void 0}));return yield(It??u)(Io)}),m;for(let p=0;p<=l.maxRetries;p++)try{return yield c()}catch(g){if(m=g,p===l.maxRetries||!(0,ur.isRetryableError)(g,l.retryableStatusCodes)||((e=o.signal)===null||e===void 0?void 0:e.aborted))throw g;let v=(0,ur.calculateBackoffDelay)(p,l.baseDelay,l.maxDelay,l.backoffMultiplier,l.enableJitter);yield(0,Ot.sleep)(v)}throw m})}function xu(t,e={}){var i,r;let n=((i=e.method)!==null&&i!==void 0?i:"post").toLowerCase(),o=((r=e.path)!==null&&r!==void 0?r:"").replace(/^\//,"").replace(/\/{2,}/,"/"),s=e.input,a=Object.assign(Object.assign({},e.query||{}),n==="get"?s:{}),u=Object.keys(a).length>0?`?${new URLSearchParams(a).toString()}`:"";if((0,Ot.isValidUrl)(t))return`${t.endsWith("/")?t:`${t}/`}${o}${u}`;let d=(0,Ot.ensureEndpointIdFormat)(t);return`${`https://${e.subdomain?`${e.subdomain}.`:""}fal.run/${d}/${o}`.replace(/\/$/,"")}${u}`}});var pr=T(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});function Tu(t){let e,i,r,n,o,s,a;return u(),{feed:d,reset:u};function u(){e=!0,i="",r=0,n=-1,o=void 0,s=void 0,a=""}function d(c){i=i?i+c:c,e&&Iu(i)&&(i=i.slice(cr.length)),e=!1;let m=i.length,p=0,g=!1;for(;p<m;){g&&(i[p]===`
2
+ `&&++p,g=!1);let h=-1,v=n,f;for(let y=r;h<0&&y<m;++y)f=i[y],f===":"&&v<0?v=y-p:f==="\r"?(g=!0,h=y-p):f===`
3
+ `&&(h=y-p);if(h<0){r=m-p,n=v;break}else r=0,n=-1;l(i,p,v,h),p+=h+1}p===m?i="":p>0&&(i=i.slice(p))}function l(c,m,p,g){if(g===0){a.length>0&&(t({type:"event",id:o,event:s||void 0,data:a.slice(0,-1)}),a="",o=void 0),s=void 0;return}let h=p<0,v=c.slice(m,m+(h?g:p)),f=0;h?f=g:c[m+p+1]===" "?f=p+2:f=p+1;let y=m+f,I=g-f,x=c.slice(y,y+I).toString();if(v==="data")a+=x?"".concat(x,`
4
4
  `):`
5
- `;else if(v==="event")s=x;else if(v==="id"&&!x.includes("\0"))o=x;else if(v==="retry"){let P=parseInt(x,10);Number.isNaN(P)||t({type:"reconnect-interval",value:P})}}}var sr=[239,187,191];function lu(t){return sr.every((e,i)=>t.charCodeAt(i)===e)}qt.createParser=au});var Ut=I(W=>{"use strict";var uu=W&&W.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})};Object.defineProperty(W,"__esModule",{value:!0});W.TOKEN_EXPIRATION_SECONDS=void 0;W.getTemporaryAuthToken=fu;var cu=Xe(),du=fe(),pu=H();W.TOKEN_EXPIRATION_SECONDS=120;function fu(t,e){return uu(this,void 0,void 0,function*(){let i=(0,pu.parseEndpointId)(t),r=yield(0,du.dispatchRequest)({method:"POST",targetUrl:`${(0,cu.getRestApiUrl)()}/tokens/`,config:e,input:{allowed_apps:[i.alias],token_expiration:W.TOKEN_EXPIRATION_SECONDS}});return typeof r!="string"&&r.detail?r.detail:r})}});var Lt=I(q=>{"use strict";var ge=q&&q.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},Pe=q&&q.__await||function(t){return this instanceof Pe?(this.v=t,this):new Pe(t)},hu=q&&q.__asyncGenerator||function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,o=[];return n={},a("next"),a("throw"),a("return",s),n[Symbol.asyncIterator]=function(){return this},n;function s(p){return function(g){return Promise.resolve(g).then(p,d)}}function a(p,g){r[p]&&(n[p]=function(y){return new Promise(function(v,f){o.push([p,y,v,f])>1||c(p,y)})},g&&(n[p]=g(n[p])))}function c(p,g){try{u(r[p](g))}catch(y){h(o[0][3],y)}}function u(p){p.value instanceof Pe?Promise.resolve(p.value.v).then(l,d):h(o[0][2],p)}function l(p){c("next",p)}function d(p){c("throw",p)}function h(p,g){p(g),o.shift(),o.length&&c(o[0][0],o[0][1])}};Object.defineProperty(q,"__esModule",{value:!0});q.FalStream=void 0;q.createStreamingClient=bu;var gu=ar(),mu=Ut(),lr=fe(),he=K(),Vt="text/event-stream",yu=15*1e3,Je=class{constructor(e,i,r){var n;this.listeners=new Map,this.buffer=[],this.currentData=void 0,this.lastEventTimestamp=0,this.streamClosed=!1,this._requestId=null,this.abortController=new AbortController,this.start=()=>ge(this,void 0,void 0,function*(){var o,s;let{endpointId:a,options:c}=this,{input:u,method:l="post",connectionMode:d="server"}=c;try{if(d==="client"){let h=yield(0,mu.getTemporaryAuthToken)(a,this.config),{fetch:p}=this.config,g=new URL(this.url);g.searchParams.set("fal_jwt_token",h);let y=yield p(g.toString(),{method:l.toUpperCase(),headers:{accept:(o=c.accept)!==null&&o!==void 0?o:Vt,"content-type":"application/json"},body:u&&l!=="get"?JSON.stringify(u):void 0,signal:this.abortController.signal});return this._requestId=y.headers.get("x-fal-request-id"),yield this.handleResponse(y)}return yield(0,lr.dispatchRequest)({method:l.toUpperCase(),targetUrl:this.url,input:u,config:this.config,options:{headers:{accept:(s=c.accept)!==null&&s!==void 0?s:Vt},responseHandler:h=>ge(this,void 0,void 0,function*(){return this._requestId=h.headers.get("x-fal-request-id"),yield this.handleResponse(h)}),signal:this.abortController.signal}})}catch(h){this.handleError(h)}}),this.handleResponse=o=>ge(this,void 0,void 0,function*(){var s,a;if(!o.ok){try{yield(0,he.defaultResponseHandler)(o)}catch(y){this.emit("error",y)}return}let c=o.body;if(!c){this.emit("error",new he.ApiError({message:"Response body is empty.",status:400,body:void 0}));return}if(!((s=o.headers.get("content-type"))!==null&&s!==void 0?s:"").startsWith(Vt)){let y=c.getReader(),v=()=>{y.read().then(({done:f,value:m})=>{if(f){this.emit("done",this.currentData);return}this.currentData=m,this.emit("data",m),v()})};v();return}let l=new TextDecoder("utf-8"),d=o.body.getReader(),h=(0,gu.createParser)(y=>{if(y.type==="event"){let v=y.data;try{let f=JSON.parse(v);this.buffer.push(f),this.currentData=f,this.emit("data",f),this.emit("message",f)}catch(f){this.emit("error",f)}}}),p=(a=this.options.timeout)!==null&&a!==void 0?a:yu,g=()=>ge(this,void 0,void 0,function*(){let{value:y,done:v}=yield d.read();this.lastEventTimestamp=Date.now(),h.feed(l.decode(y)),Date.now()-this.lastEventTimestamp>p&&this.emit("error",new he.ApiError({message:`Event stream timed out after ${(p/1e3).toFixed(0)} seconds with no messages.`,status:408})),v?this.emit("done",this.currentData):g().catch(this.handleError)});g().catch(this.handleError)}),this.handleError=o=>{var s;if(o.name==="AbortError"||this.signal.aborted)return;let a=o instanceof he.ApiError?o:new he.ApiError({message:(s=o.message)!==null&&s!==void 0?s:"An unknown error occurred",status:500});this.emit("error",a)},this.on=(o,s)=>{var a;this.listeners.has(o)||this.listeners.set(o,[]),(a=this.listeners.get(o))===null||a===void 0||a.push(s)},this.emit=(o,s)=>{let a=this.listeners.get(o)||[];for(let c of a)c(s)},this.done=()=>ge(this,void 0,void 0,function*(){return this.donePromise}),this.abort=o=>{this.streamClosed||this.abortController.abort(o)},this.endpointId=e,this.config=i,this.url=(n=r.url)!==null&&n!==void 0?n:(0,lr.buildUrl)(e,{path:"/stream",query:r.queryParams}),this.options=r,this.donePromise=new Promise((o,s)=>{this.streamClosed&&s(new he.ApiError({message:"Streaming connection is already closed.",status:400,body:void 0})),this.signal.addEventListener("abort",()=>{var a;o((a=this.currentData)!==null&&a!==void 0?a:{})}),this.on("done",a=>{this.streamClosed=!0,o(a)}),this.on("error",a=>{this.streamClosed=!0,s(a)})}),r.signal&&r.signal.addEventListener("abort",()=>{this.abortController.abort()}),this.start().catch(this.handleError)}[Symbol.asyncIterator](){return hu(this,arguments,function*(){let i=!0,r=()=>i=!1;for(this.on("error",r),this.on("done",r);i||this.buffer.length>0;){let n=this.buffer.shift();n&&(yield yield Pe(n)),yield Pe(new Promise(o=>setTimeout(o,16)))}})}get signal(){return this.abortController.signal}get requestId(){return this._requestId}};q.FalStream=Je;function bu({config:t,storage:e}){return{stream(i,r){return ge(this,void 0,void 0,function*(){let n=r.input?yield e.transformInput(r.input):void 0;return new Je(i,t,Object.assign(Object.assign({},r),{input:n}))})}}}});var pr=I(Y=>{"use strict";var te=Y&&Y.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},vu=Y&&Y.__rest||function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i};Object.defineProperty(Y,"__esModule",{value:!0});Y.createQueueClient=void 0;var $=fe(),wu=K(),dr=Ce(),xu=Lt(),et=H(),ur=500,cr={maxRetries:3,baseDelay:1e3,maxDelay:6e4,retryableStatusCodes:dr.DEFAULT_RETRYABLE_STATUS_CODES},Iu={maxRetries:5,baseDelay:1e3,maxDelay:3e4,retryableStatusCodes:[...dr.DEFAULT_RETRYABLE_STATUS_CODES,500]},_u=({config:t,storage:e})=>{let i={submit(r,n){return te(this,void 0,void 0,function*(){let{webhookUrl:o,priority:s,hint:a}=n,c=vu(n,["webhookUrl","priority","hint"]),u=n.input?yield e.transformInput(n.input):void 0;return(0,$.dispatchRequest)({method:n.method,targetUrl:(0,$.buildUrl)(r,Object.assign(Object.assign({},c),{subdomain:"queue",query:o?{fal_webhook:o}:void 0})),headers:Object.assign({"x-fal-queue-priority":s??"normal"},a&&{"x-fal-runner-hint":a}),input:u,config:t,options:{signal:n.abortSignal,retry:cr}})})},status(r,n){return te(this,arguments,void 0,function*(o,{requestId:s,logs:a=!1,abortSignal:c}){let u=(0,et.parseEndpointId)(o),l=u.namespace?`${u.namespace}/`:"";return(0,$.dispatchRequest)({method:"get",targetUrl:(0,$.buildUrl)(`${l}${u.owner}/${u.alias}`,{subdomain:"queue",query:{logs:a?"1":"0"},path:`/requests/${s}/status`}),config:t,options:{signal:c,retry:Iu}})})},streamStatus(r,n){return te(this,arguments,void 0,function*(o,{requestId:s,logs:a=!1,connectionMode:c}){let u=(0,et.parseEndpointId)(o),l=u.namespace?`${u.namespace}/`:"",d={logs:a?"1":"0"},h=(0,$.buildUrl)(`${l}${u.owner}/${u.alias}`,{subdomain:"queue",path:`/requests/${s}/status/stream`,query:d});return new xu.FalStream(o,t,{url:h,method:"get",connectionMode:c,queryParams:d})})},subscribeToStatus(r,n){return te(this,void 0,void 0,function*(){let o=n.requestId,s=n.timeout,a,c=()=>{};if(n.mode==="streaming"){let u=yield i.streamStatus(r,{requestId:o,logs:n.logs,connectionMode:"connectionMode"in n?n.connectionMode:void 0}),l=[];s&&(a=setTimeout(()=>{throw u.abort(),i.cancel(r,{requestId:o}).catch(c),new Error(`Client timed out waiting for the request to complete after ${s}ms`)},s)),u.on("data",h=>{n.onQueueUpdate&&("logs"in h&&Array.isArray(h.logs)&&h.logs.length>0&&l.push(...h.logs),n.onQueueUpdate("logs"in h?Object.assign(Object.assign({},h),{logs:l}):h))});let d=yield u.done();return a&&clearTimeout(a),d}return new Promise((u,l)=>{var d;let h,p="pollInterval"in n&&typeof n.pollInterval=="number"&&(d=n.pollInterval)!==null&&d!==void 0?d:ur,g=()=>{a&&clearTimeout(a),h&&clearTimeout(h)};s&&(a=setTimeout(()=>{g(),i.cancel(r,{requestId:o}).catch(c),l(new Error(`Client timed out waiting for the request to complete after ${s}ms`))},s));let y=()=>te(this,void 0,void 0,function*(){var v;try{let f=yield i.status(r,{requestId:o,logs:(v=n.logs)!==null&&v!==void 0?v:!1,abortSignal:n.abortSignal});if(n.onQueueUpdate&&n.onQueueUpdate(f),f.status==="COMPLETED"){g(),u(f);return}h=setTimeout(y,p)}catch(f){g(),l(f)}});y().catch(l)})})},result(r,n){return te(this,arguments,void 0,function*(o,{requestId:s,abortSignal:a}){let c=(0,et.parseEndpointId)(o),u=c.namespace?`${c.namespace}/`:"";return(0,$.dispatchRequest)({method:"get",targetUrl:(0,$.buildUrl)(`${u}${c.owner}/${c.alias}`,{subdomain:"queue",path:`/requests/${s}`}),config:Object.assign(Object.assign({},t),{responseHandler:wu.resultResponseHandler}),options:{signal:a,retry:cr}})})},cancel(r,n){return te(this,arguments,void 0,function*(o,{requestId:s,abortSignal:a}){let c=(0,et.parseEndpointId)(o),u=c.namespace?`${c.namespace}/`:"";yield(0,$.dispatchRequest)({method:"put",targetUrl:(0,$.buildUrl)(`${u}${c.owner}/${c.alias}`,{subdomain:"queue",path:`/requests/${s}/cancel`}),config:t,options:{signal:a}})})}};return i};Y.createQueueClient=_u});var tt=I(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.utf8Count=Tu;F.utf8EncodeJs=fr;F.utf8EncodeTE=hr;F.utf8Encode=Au;F.utf8DecodeJs=gr;F.utf8DecodeTD=mr;F.utf8Decode=Mu;function Tu(t){let e=t.length,i=0,r=0;for(;r<e;){let n=t.charCodeAt(r++);if(n&4294967168)if(!(n&4294965248))i+=2;else{if(n>=55296&&n<=56319&&r<e){let o=t.charCodeAt(r);(o&64512)===56320&&(++r,n=((n&1023)<<10)+(o&1023)+65536)}n&4294901760?i+=4:i+=3}else{i++;continue}}return i}function fr(t,e,i){let r=t.length,n=i,o=0;for(;o<r;){let s=t.charCodeAt(o++);if(s&4294967168)if(!(s&4294965248))e[n++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&o<r){let a=t.charCodeAt(o);(a&64512)===56320&&(++o,s=((s&1023)<<10)+(a&1023)+65536)}s&4294901760?(e[n++]=s>>18&7|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128):(e[n++]=s>>12&15|224,e[n++]=s>>6&63|128)}else{e[n++]=s;continue}e[n++]=s&63|128}}var Su=new TextEncoder,Eu=50;function hr(t,e,i){Su.encodeInto(t,e.subarray(i))}function Au(t,e,i){t.length>Eu?hr(t,e,i):fr(t,e,i)}var ku=4096;function gr(t,e,i){let r=e,n=r+i,o=[],s="";for(;r<n;){let a=t[r++];if(!(a&128))o.push(a);else if((a&224)===192){let c=t[r++]&63;o.push((a&31)<<6|c)}else if((a&240)===224){let c=t[r++]&63,u=t[r++]&63;o.push((a&31)<<12|c<<6|u)}else if((a&248)===240){let c=t[r++]&63,u=t[r++]&63,l=t[r++]&63,d=(a&7)<<18|c<<12|u<<6|l;d>65535&&(d-=65536,o.push(d>>>10&1023|55296),d=56320|d&1023),o.push(d)}else o.push(a);o.length>=ku&&(s+=String.fromCharCode(...o),o.length=0)}return o.length>0&&(s+=String.fromCharCode(...o)),s}var Cu=new TextDecoder,Pu=200;function mr(t,e,i){let r=t.subarray(e,e+i);return Cu.decode(r)}function Mu(t,e,i){return i>Pu?mr(t,e,i):gr(t,e,i)}});var $t=I(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.ExtData=void 0;var Rt=class{constructor(e,i){this.type=e,this.data=i}};it.ExtData=Rt});var nt=I(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.DecodeError=void 0;var Ft=class t extends Error{constructor(e){super(e);let i=Object.create(t.prototype);Object.setPrototypeOf(this,i),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:t.name})}};rt.DecodeError=Ft});var ot=I(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.UINT32_MAX=void 0;Z.setUint64=Ou;Z.setInt64=ju;Z.getInt64=Du;Z.getUint64=qu;Z.UINT32_MAX=4294967295;function Ou(t,e,i){let r=i/4294967296,n=i;t.setUint32(e,r),t.setUint32(e+4,n)}function ju(t,e,i){let r=Math.floor(i/4294967296),n=i;t.setUint32(e,r),t.setUint32(e+4,n)}function Du(t,e){let i=t.getInt32(e),r=t.getUint32(e+4);return i*4294967296+r}function qu(t,e){let i=t.getUint32(e),r=t.getUint32(e+4);return i*4294967296+r}});var Nt=I(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.timestampExtension=O.EXT_TIMESTAMP=void 0;O.encodeTimeSpecToTimestamp=br;O.encodeDateToTimeSpec=vr;O.encodeTimestampExtension=wr;O.decodeTimestampToTimeSpec=xr;O.decodeTimestampExtension=Ir;var Uu=nt(),yr=ot();O.EXT_TIMESTAMP=-1;var Vu=4294967296-1,Lu=17179869184-1;function br({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Lu)if(e===0&&t<=Vu){let i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,t),i}else{let i=t/4294967296,r=t&4294967295,n=new Uint8Array(8),o=new DataView(n.buffer);return o.setUint32(0,e<<2|i&3),o.setUint32(4,r),n}else{let i=new Uint8Array(12),r=new DataView(i.buffer);return r.setUint32(0,e),(0,yr.setInt64)(r,4,t),i}}function vr(t){let e=t.getTime(),i=Math.floor(e/1e3),r=(e-i*1e3)*1e6,n=Math.floor(r/1e9);return{sec:i+n,nsec:r-n*1e9}}function wr(t){if(t instanceof Date){let e=vr(t);return br(e)}else return null}function xr(t){let e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{let i=e.getUint32(0),r=e.getUint32(4),n=(i&3)*4294967296+r,o=i>>>2;return{sec:n,nsec:o}}case 12:{let i=(0,yr.getInt64)(e,4),r=e.getUint32(0);return{sec:i,nsec:r}}default:throw new Uu.DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Ir(t){let e=xr(t);return new Date(e.sec*1e3+e.nsec/1e6)}O.timestampExtension={type:O.EXT_TIMESTAMP,encode:wr,decode:Ir}});var lt=I(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.ExtensionCodec=void 0;var st=$t(),Ru=Nt(),Me=class{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Ru.timestampExtension)}register({type:e,encode:i,decode:r}){if(e>=0)this.encoders[e]=i,this.decoders[e]=r;else{let n=-1-e;this.builtInEncoders[n]=i,this.builtInDecoders[n]=r}}tryToEncode(e,i){for(let r=0;r<this.builtInEncoders.length;r++){let n=this.builtInEncoders[r];if(n!=null){let o=n(e,i);if(o!=null){let s=-1-r;return new st.ExtData(s,o)}}}for(let r=0;r<this.encoders.length;r++){let n=this.encoders[r];if(n!=null){let o=n(e,i);if(o!=null){let s=r;return new st.ExtData(s,o)}}}return e instanceof st.ExtData?e:null}decode(e,i,r){let n=i<0?this.builtInDecoders[-1-i]:this.decoders[i];return n?n(e,i,r):new st.ExtData(i,e)}};at.ExtensionCodec=Me;Me.defaultCodec=new Me});var Bt=I(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.ensureUint8Array=Fu;function $u(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function Fu(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):$u(t)?new Uint8Array(t):Uint8Array.from(t)}});var Ht=I(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.Encoder=L.DEFAULT_INITIAL_BUFFER_SIZE=L.DEFAULT_MAX_DEPTH=void 0;var _r=tt(),Nu=lt(),Tr=ot(),zu=Bt();L.DEFAULT_MAX_DEPTH=100;L.DEFAULT_INITIAL_BUFFER_SIZE=2048;var Kt=class t{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??Nu.ExtensionCodec.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??L.DEFAULT_MAX_DEPTH,this.initialBufferSize=e?.initialBufferSize??L.DEFAULT_INITIAL_BUFFER_SIZE,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,i){if(i>this.maxDepth)throw new Error(`Too deep objects in depth ${i}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,i)}ensureBufferSizeToWrite(e){let i=this.pos+e;this.view.byteLength<i&&this.resizeBuffer(i*2)}resizeBuffer(e){let i=new ArrayBuffer(e),r=new Uint8Array(i),n=new DataView(i);r.set(this.bytes),this.view=n,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let r=(0,_r.utf8Count)(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),(0,_r.utf8Encode)(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,i){let r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,i);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,i);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let i=e.byteLength;if(i<256)this.writeU8(196),this.writeU8(i);else if(i<65536)this.writeU8(197),this.writeU16(i);else if(i<4294967296)this.writeU8(198),this.writeU32(i);else throw new Error(`Too large binary: ${i}`);let r=(0,zu.ensureUint8Array)(e);this.writeU8a(r)}encodeArray(e,i){let r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(let n of e)this.doEncode(n,i+1)}countWithoutUndefined(e,i){let r=0;for(let n of i)e[n]!==void 0&&r++;return r}encodeMap(e,i){let r=Object.keys(e);this.sortKeys&&r.sort();let n=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(n<16)this.writeU8(128+n);else if(n<65536)this.writeU8(222),this.writeU16(n);else if(n<4294967296)this.writeU8(223),this.writeU32(n);else throw new Error(`Too large map object: ${n}`);for(let o of r){let s=e[o];this.ignoreUndefined&&s===void 0||(this.encodeString(o),this.doEncode(s,i+1))}}encodeExtension(e){if(typeof e.data=="function"){let r=e.data(this.pos+6),n=r.length;if(n>=4294967296)throw new Error(`Too large extension object: ${n}`);this.writeU8(201),this.writeU32(n),this.writeI8(e.type),this.writeU8a(r);return}let i=e.data.length;if(i===1)this.writeU8(212);else if(i===2)this.writeU8(213);else if(i===4)this.writeU8(214);else if(i===8)this.writeU8(215);else if(i===16)this.writeU8(216);else if(i<256)this.writeU8(199),this.writeU8(i);else if(i<65536)this.writeU8(200),this.writeU16(i);else if(i<4294967296)this.writeU8(201),this.writeU32(i);else throw new Error(`Too large extension object: ${i}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let i=e.length;this.ensureBufferSizeToWrite(i),this.bytes.set(e,this.pos),this.pos+=i}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),(0,Tr.setUint64)(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),(0,Tr.setInt64)(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};L.Encoder=Kt});var Sr=I(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.encode=Ku;var Bu=Ht();function Ku(t,e){return new Bu.Encoder(e).encodeSharedRef(t)}});var Er=I(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.prettyByte=Hu;function Hu(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}});var Ar=I(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.CachedKeyDecoder=void 0;var Gu=tt(),Qu=16,Wu=16,Wt=class{constructor(e=Qu,i=Wu){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=i,this.caches=[];for(let r=0;r<this.maxKeyLength;r++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,i,r){let n=this.caches[r-1];e:for(let o of n){let s=o.bytes;for(let a=0;a<r;a++)if(s[a]!==e[i+a])continue e;return o.str}return null}store(e,i){let r=this.caches[e.length-1],n={bytes:e,str:i};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=n:r.push(n)}decode(e,i,r){let n=this.find(e,i,r);if(n!=null)return this.hit++,n;this.miss++;let o=(0,Gu.utf8DecodeJs)(e,i,r),s=Uint8Array.prototype.slice.call(e,i,i+r);return this.store(s,o),o}};ut.CachedKeyDecoder=Wt});var dt=I(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.Decoder=void 0;var Yt=Er(),Yu=lt(),ie=ot(),Zu=tt(),kr=Bt(),Xu=Ar(),N=nt(),Zt="array",je="map_key",Pr="map_value",Ju=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new N.DecodeError("The type of key must be string or number but "+typeof t)},Xt=class{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let i=this.getUninitializedStateFromPool();i.type=Zt,i.position=0,i.size=e,i.array=new Array(e)}pushMapState(e){let i=this.getUninitializedStateFromPool();i.type=je,i.readCount=0,i.size=e,i.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===Zt){let r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===je||e.type===Pr){let r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},Oe=-1,ei=new DataView(new ArrayBuffer(0)),ec=new Uint8Array(ei.buffer);try{ei.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var Cr=new RangeError("Insufficient data"),tc=new Xu.CachedKeyDecoder,Jt=class t{constructor(e){this.totalPos=0,this.pos=0,this.view=ei,this.bytes=ec,this.headByte=Oe,this.stack=new Xt,this.entered=!1,this.extensionCodec=e?.extensionCodec??Yu.ExtensionCodec.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??ie.UINT32_MAX,this.maxBinLength=e?.maxBinLength??ie.UINT32_MAX,this.maxArrayLength=e?.maxArrayLength??ie.UINT32_MAX,this.maxMapLength=e?.maxMapLength??ie.UINT32_MAX,this.maxExtLength=e?.maxExtLength??ie.UINT32_MAX,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:tc,this.mapKeyConverter=e?.mapKeyConverter??Ju}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=Oe,this.stack.reset()}setBuffer(e){let i=(0,kr.ensureUint8Array)(e);this.bytes=i,this.view=new DataView(i.buffer,i.byteOffset,i.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===Oe&&!this.hasRemaining(1))this.setBuffer(e);else{let i=this.bytes.subarray(this.pos),r=(0,kr.ensureUint8Array)(e),n=new Uint8Array(i.length+r.length);n.set(i),n.set(r,i.length),this.setBuffer(n)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:i,pos:r}=this;return new RangeError(`Extra ${i.byteLength-r} of ${i.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let i=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return i}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let i=!1,r;for await(let a of e){if(i)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{r=this.doDecodeSync(),i=!0}catch(c){if(!(c instanceof RangeError))throw c}this.totalPos+=this.pos}if(i){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return r}let{headByte:n,pos:o,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${(0,Yt.prettyByte)(n)} at ${s} (${o} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,i){if(this.entered){yield*this.clone().decodeMultiAsync(e,i);return}try{this.entered=!0;let r=i,n=-1;for await(let o of e){if(i&&n===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(o),r&&(n=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),--n!==0;);}catch(s){if(!(s instanceof RangeError))throw s}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let e=this.readHeadByte(),i;if(e>=224)i=e-256;else if(e<192)if(e<128)i=e;else if(e<144){let n=e-128;if(n!==0){this.pushMapState(n),this.complete();continue e}else i={}}else if(e<160){let n=e-144;if(n!==0){this.pushArrayState(n),this.complete();continue e}else i=[]}else{let n=e-160;i=this.decodeString(n,0)}else if(e===192)i=null;else if(e===194)i=!1;else if(e===195)i=!0;else if(e===202)i=this.readF32();else if(e===203)i=this.readF64();else if(e===204)i=this.readU8();else if(e===205)i=this.readU16();else if(e===206)i=this.readU32();else if(e===207)this.useBigInt64?i=this.readU64AsBigInt():i=this.readU64();else if(e===208)i=this.readI8();else if(e===209)i=this.readI16();else if(e===210)i=this.readI32();else if(e===211)this.useBigInt64?i=this.readI64AsBigInt():i=this.readI64();else if(e===217){let n=this.lookU8();i=this.decodeString(n,1)}else if(e===218){let n=this.lookU16();i=this.decodeString(n,2)}else if(e===219){let n=this.lookU32();i=this.decodeString(n,4)}else if(e===220){let n=this.readU16();if(n!==0){this.pushArrayState(n),this.complete();continue e}else i=[]}else if(e===221){let n=this.readU32();if(n!==0){this.pushArrayState(n),this.complete();continue e}else i=[]}else if(e===222){let n=this.readU16();if(n!==0){this.pushMapState(n),this.complete();continue e}else i={}}else if(e===223){let n=this.readU32();if(n!==0){this.pushMapState(n),this.complete();continue e}else i={}}else if(e===196){let n=this.lookU8();i=this.decodeBinary(n,1)}else if(e===197){let n=this.lookU16();i=this.decodeBinary(n,2)}else if(e===198){let n=this.lookU32();i=this.decodeBinary(n,4)}else if(e===212)i=this.decodeExtension(1,0);else if(e===213)i=this.decodeExtension(2,0);else if(e===214)i=this.decodeExtension(4,0);else if(e===215)i=this.decodeExtension(8,0);else if(e===216)i=this.decodeExtension(16,0);else if(e===199){let n=this.lookU8();i=this.decodeExtension(n,1)}else if(e===200){let n=this.lookU16();i=this.decodeExtension(n,2)}else if(e===201){let n=this.lookU32();i=this.decodeExtension(n,4)}else throw new N.DecodeError(`Unrecognized type byte: ${(0,Yt.prettyByte)(e)}`);this.complete();let r=this.stack;for(;r.length>0;){let n=r.top();if(n.type===Zt)if(n.array[n.position]=i,n.position++,n.position===n.size)i=n.array,r.release(n);else continue e;else if(n.type===je){if(i==="__proto__")throw new N.DecodeError("The key __proto__ is not allowed");n.key=this.mapKeyConverter(i),n.type=Pr;continue e}else if(n.map[n.key]=i,n.readCount++,n.readCount===n.size)i=n.map,r.release(n);else{n.key=null,n.type=je;continue e}}return i}}readHeadByte(){return this.headByte===Oe&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=Oe}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new N.DecodeError(`Unrecognized array type byte: ${(0,Yt.prettyByte)(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new N.DecodeError(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new N.DecodeError(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,i){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,i):this.decodeBinary(e,i)}decodeUtf8String(e,i){if(e>this.maxStrLength)throw new N.DecodeError(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+i+e)throw Cr;let r=this.pos+i,n;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?n=this.keyDecoder.decode(this.bytes,r,e):n=(0,Zu.utf8Decode)(this.bytes,r,e),this.pos+=i+e,n}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===je:!1}decodeBinary(e,i){if(e>this.maxBinLength)throw new N.DecodeError(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+i))throw Cr;let r=this.pos+i,n=this.bytes.subarray(r,r+e);return this.pos+=i+e,n}decodeExtension(e,i){if(e>this.maxExtLength)throw new N.DecodeError(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let r=this.view.getInt8(this.pos+i),n=this.decodeBinary(e,i+1);return this.extensionCodec.decode(n,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=(0,ie.getUint64)(this.view,this.pos);return this.pos+=8,e}readI64(){let e=(0,ie.getInt64)(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};ct.Decoder=Jt});var Or=I(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.decode=ic;pt.decodeMulti=rc;var Mr=dt();function ic(t,e){return new Mr.Decoder(e).decode(t)}function rc(t,e){return new Mr.Decoder(e).decodeMulti(t)}});var qr=I(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.isAsyncIterable=jr;De.asyncIterableFromStream=Dr;De.ensureAsyncIterable=nc;function jr(t){return t[Symbol.asyncIterator]!=null}async function*Dr(t){let e=t.getReader();try{for(;;){let{done:i,value:r}=await e.read();if(i)return;yield r}}finally{e.releaseLock()}}function nc(t){return jr(t)?t:Dr(t)}});var Ur=I(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.decodeAsync=oc;qe.decodeArrayStream=sc;qe.decodeMultiStream=ac;var ti=dt(),ii=qr();async function oc(t,e){let i=(0,ii.ensureAsyncIterable)(t);return new ti.Decoder(e).decodeAsync(i)}function sc(t,e){let i=(0,ii.ensureAsyncIterable)(t);return new ti.Decoder(e).decodeArrayStream(i)}function ac(t,e){let i=(0,ii.ensureAsyncIterable)(t);return new ti.Decoder(e).decodeStream(i)}});var Lr=I(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.decodeTimestampExtension=w.encodeTimestampExtension=w.decodeTimestampToTimeSpec=w.encodeTimeSpecToTimestamp=w.encodeDateToTimeSpec=w.EXT_TIMESTAMP=w.ExtData=w.ExtensionCodec=w.Encoder=w.DecodeError=w.Decoder=w.decodeMultiStream=w.decodeArrayStream=w.decodeAsync=w.decodeMulti=w.decode=w.encode=void 0;var lc=Sr();Object.defineProperty(w,"encode",{enumerable:!0,get:function(){return lc.encode}});var Vr=Or();Object.defineProperty(w,"decode",{enumerable:!0,get:function(){return Vr.decode}});Object.defineProperty(w,"decodeMulti",{enumerable:!0,get:function(){return Vr.decodeMulti}});var ri=Ur();Object.defineProperty(w,"decodeAsync",{enumerable:!0,get:function(){return ri.decodeAsync}});Object.defineProperty(w,"decodeArrayStream",{enumerable:!0,get:function(){return ri.decodeArrayStream}});Object.defineProperty(w,"decodeMultiStream",{enumerable:!0,get:function(){return ri.decodeMultiStream}});var uc=dt();Object.defineProperty(w,"Decoder",{enumerable:!0,get:function(){return uc.Decoder}});var cc=nt();Object.defineProperty(w,"DecodeError",{enumerable:!0,get:function(){return cc.DecodeError}});var dc=Ht();Object.defineProperty(w,"Encoder",{enumerable:!0,get:function(){return dc.Encoder}});var pc=lt();Object.defineProperty(w,"ExtensionCodec",{enumerable:!0,get:function(){return pc.ExtensionCodec}});var fc=$t();Object.defineProperty(w,"ExtData",{enumerable:!0,get:function(){return fc.ExtData}});var me=Nt();Object.defineProperty(w,"EXT_TIMESTAMP",{enumerable:!0,get:function(){return me.EXT_TIMESTAMP}});Object.defineProperty(w,"encodeDateToTimeSpec",{enumerable:!0,get:function(){return me.encodeDateToTimeSpec}});Object.defineProperty(w,"encodeTimeSpecToTimestamp",{enumerable:!0,get:function(){return me.encodeTimeSpecToTimestamp}});Object.defineProperty(w,"decodeTimestampToTimeSpec",{enumerable:!0,get:function(){return me.decodeTimestampToTimeSpec}});Object.defineProperty(w,"encodeTimestampExtension",{enumerable:!0,get:function(){return me.encodeTimestampExtension}});Object.defineProperty(w,"decodeTimestampExtension",{enumerable:!0,get:function(){return me.decodeTimestampExtension}})});var Jr=I(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});function A(t){return{enumerable:!0,value:t}}function Rr(t){return{enumerable:!0,writable:!0,value:t}}var re={},hc=()=>!0,$r=()=>({}),Nr=t=>t,gc=(t,e,i,r)=>t.apply(i,r)&&e.apply(i,r),mc=(t,e,i,[r,n])=>e.call(i,t.call(i,r,n),n),X=(t,e)=>Object.freeze(Object.create(t,e));function Fr(t,e,i){return t.reduce((r,n)=>function(...o){return i(r,n,this,o)},e)}function zr(t){return X(this,{fn:A(t)})}var Br={},Kr=zr.bind(Br),yc=t=>Kr((e,i)=>!!~t(e,i)&&e),Hr={},bc=zr.bind(Hr);function ft(t,e){return e.filter(i=>t.isPrototypeOf(i))}function Gr(t,e,...i){let r=Fr(ft(Hr,i).map(o=>o.fn),hc,gc),n=Fr(ft(Br,i).map(o=>o.fn),Nr,mc);return X(this,{from:A(t),to:A(e),guards:A(r),reducers:A(n)})}var Qr={},Wr={},vc=Gr.bind(Qr),wc=Gr.bind(Wr,null);function xc(t,e,i){return oi(e,t,i,this.immediates)||t}function Yr(t){let e=new Map;for(let i of t)e.has(i.from)||e.set(i.from,[]),e.get(i.from).push(i);return e}var Ic={enter:Nr};function _c(...t){let e=ft(Qr,t),i=ft(Wr,t),r={final:A(t.length===0),transitions:A(Yr(e))};return i.length&&(r.immediates=A(i),r.enter=A(xc)),X(Ic,r)}var Tc={enter(t,e,i){let r=this.fn.call(e,e.context,i);return ni.isPrototypeOf(r)?X(Zr,{machine:A(r),transitions:A(this.transitions)}).enter(t,e,i):(r.then(n=>e.send({type:"done",data:n})).catch(n=>e.send({type:"error",error:n})),t)}},Zr={enter(t,e,i){if(e.child=Xr(this.machine,r=>{e.onChange(r),e.child==r&&r.machine.state.value.final&&(delete e.child,e.send({type:"done",data:r.context}))},e.context,i),e.child.machine.state.value.final){let r=e.child.context;return delete e.child,oi(e,t,{type:"done",data:r},this.transitions.get("done"))}return t}};function Sc(t,...e){let i=A(Yr(e));return ni.isPrototypeOf(t)?X(Zr,{machine:A(t),transitions:i}):X(Tc,{fn:A(t),transitions:i})}var ni={get state(){return{name:this.current,value:this.states[this.current]}}};function Ec(t,e,i=$r){return typeof t!="string"&&(i=e||$r,e=t,t=Object.keys(e)[0]),re._create&&re._create(t,e),X(ni,{context:A(i),current:A(t),states:A(e)})}function oi(t,e,i,r){let{context:n}=t;for(let{to:o,guards:s,reducers:a}of r)if(s(n,i)){t.context=a.call(t,n,i);let c=e.original||e,u=X(c,{current:A(o),original:{value:c}});return re._onEnter&&re._onEnter(e,o,t.context,n,i),u.state.value.enter(u,t,i)}}function Ac(t,e){let i=e.type||e,{machine:r}=t,{value:n,name:o}=r.state;return n.transitions.has(i)?oi(t,r,e,n.transitions.get(i))||r:(re._send&&re._send(i,o),r)}var kc={send(t){this.machine=Ac(this,t),this.onChange(this)}};function Xr(t,e,i,r){let n=Object.create(kc,{machine:Rr(t),context:Rr(t.context(i,r)),onChange:A(e)});return n.send=n.send.bind(n),n.machine=n.machine.state.value.enter(n.machine,n,r),n}j.action=yc;j.createMachine=Ec;j.d=re;j.guard=bc;j.immediate=wc;j.interpret=Xr;j.invoke=Sc;j.reduce=Kr;j.state=_c;j.transition=vc});var on=I(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.createRealtimeClient=zc;var gt=Lr(),b=Jr(),en=Ut(),si=K(),tn=Ze(),ui=H(),Cc=()=>({enqueuedMessage:void 0});function Pc(t){return t.token!==void 0}function Mc(t){return!Pc(t)}function ht(t,e){return Object.assign(Object.assign({},t),{enqueuedMessage:e.message})}function z(t){return t.websocket&&t.websocket.readyState===WebSocket.OPEN&&t.websocket.close(),Object.assign(Object.assign({},t),{websocket:void 0})}function Oc(t,e){return t.websocket&&t.websocket.readyState===WebSocket.OPEN?(e.message instanceof Uint8Array?t.websocket.send(e.message):t.websocket.send((0,gt.encode)(e.message)),Object.assign(Object.assign({},t),{enqueuedMessage:void 0})):Object.assign(Object.assign({},t),{enqueuedMessage:e.message})}function ai(t){return Object.assign(Object.assign({},t),{token:void 0})}function jc(t,e){return Object.assign(Object.assign({},t),{token:e.token})}function Dc(t,e){return Object.assign(Object.assign({},t),{websocket:e.websocket})}var qc=(0,b.createMachine)("idle",{idle:(0,b.state)((0,b.transition)("send","connecting",(0,b.reduce)(ht)),(0,b.transition)("expireToken","idle",(0,b.reduce)(ai)),(0,b.transition)("close","idle",(0,b.reduce)(z))),connecting:(0,b.state)((0,b.transition)("connecting","connecting"),(0,b.transition)("connected","active",(0,b.reduce)(Dc)),(0,b.transition)("connectionClosed","idle",(0,b.reduce)(z)),(0,b.transition)("send","connecting",(0,b.reduce)(ht)),(0,b.transition)("close","idle",(0,b.reduce)(z)),(0,b.immediate)("authRequired",(0,b.guard)(Mc))),authRequired:(0,b.state)((0,b.transition)("initiateAuth","authInProgress"),(0,b.transition)("send","authRequired",(0,b.reduce)(ht)),(0,b.transition)("close","idle",(0,b.reduce)(z))),authInProgress:(0,b.state)((0,b.transition)("authenticated","connecting",(0,b.reduce)(jc)),(0,b.transition)("unauthorized","idle",(0,b.reduce)(ai),(0,b.reduce)(z)),(0,b.transition)("send","authInProgress",(0,b.reduce)(ht)),(0,b.transition)("close","idle",(0,b.reduce)(z))),active:(0,b.state)((0,b.transition)("send","active",(0,b.reduce)(Oc)),(0,b.transition)("unauthorized","idle",(0,b.reduce)(ai)),(0,b.transition)("connectionClosed","idle",(0,b.reduce)(z)),(0,b.transition)("close","idle",(0,b.reduce)(z))),failed:(0,b.state)((0,b.transition)("send","failed"),(0,b.transition)("close","idle",(0,b.reduce)(z)))},Cc);function Uc(t,{token:e,maxBuffering:i}){if(i!==void 0&&(i<1||i>60))throw new Error("The `maxBuffering` must be between 1 and 60 (inclusive)");let r=new URLSearchParams({fal_jwt_token:e});return i!==void 0&&r.set("max_buffering",i.toFixed(0)),`wss://fal.run/${(0,ui.ensureEndpointIdFormat)(t)}/realtime?${r.toString()}`}var Vc=128;function Lc(t){return t.status==="error"&&t.error==="Unauthorized"}var Rc={NORMAL_CLOSURE:1e3,GOING_AWAY:1001},li=new Map,rn=new Map;function $c(t,e,i){if(!li.has(t)){let r=(0,b.interpret)(qc,i);li.set(t,Object.assign(Object.assign({},r),{throttledSend:e>0?(0,ui.throttle)(r.send,e,!0):r.send}))}return li.get(t)}var Ue=()=>{},Fc={send:Ue,close:Ue};function Nc(t){return t.status!=="error"&&t.type!=="x-fal-message"&&!nn(t)}function nn(t){return t.type==="x-fal-error"}function zc({config:t}){return{connect(e,i){let{clientOnly:r=(0,ui.isReact)()&&!(0,tn.isBrowser)(),connectionKey:n=crypto.randomUUID(),maxBuffering:o,throttleInterval:s=Vc}=i;if(r&&!(0,tn.isBrowser)())return Fc;let a;rn.set(n,{onError:i.onError,onResult:i.onResult});let c=()=>rn.get(n),u=$c(n,s,({context:h,machine:p,send:g})=>{let{enqueuedMessage:y,token:v}=h;if(p.current==="active"&&y&&g({type:"send",message:y}),p.current==="authRequired"&&v===void 0&&a!==p.current&&(g({type:"initiateAuth"}),(0,en.getTemporaryAuthToken)(e,t).then(f=>{g({type:"authenticated",token:f});let m=Math.round(en.TOKEN_EXPIRATION_SECONDS*.9*1e3);setTimeout(()=>{g({type:"expireToken"})},m)}).catch(f=>{g({type:"unauthorized",error:f})})),p.current==="connecting"&&a!==p.current&&v!==void 0){let f=new WebSocket(Uc(e,{token:v,maxBuffering:o}));f.onopen=()=>{g({type:"connected",websocket:f})},f.onclose=m=>{if(m.code!==Rc.NORMAL_CLOSURE){let{onError:_=Ue}=c();_(new si.ApiError({message:`Error closing the connection: ${m.reason}`,status:m.code}))}g({type:"connectionClosed",code:m.code})},f.onerror=m=>{let{onError:_=Ue}=c();_(new si.ApiError({message:"Unknown error",status:500}))},f.onmessage=m=>{let{onResult:_}=c();if(m.data instanceof ArrayBuffer){let P=(0,gt.decode)(new Uint8Array(m.data));_(P);return}if(m.data instanceof Uint8Array){let P=(0,gt.decode)(m.data);_(P);return}if(m.data instanceof Blob){m.data.arrayBuffer().then(P=>{let wt=(0,gt.decode)(new Uint8Array(P));_(wt)});return}let x=JSON.parse(m.data);if(Lc(x)){g({type:"unauthorized",error:new Error("Unauthorized")});return}if(Nc(x)){_(x);return}if(nn(x)){if(x.error==="TIMEOUT")return;let{onError:P=Ue}=c();P(new si.ApiError({message:`${x.error}: ${x.reason}`,status:400,body:x}));return}}}a=p.current});return{send:h=>{u.throttledSend({type:"send",message:h})},close:()=>{u.send({type:"close"})}}}}}});var cn=I(Ve=>{"use strict";var ne=Ve&&Ve.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createStorageClient=Qc;var sn=Xe(),an=fe(),Bc=H();function ln(t){var e;let[i,r]=t.split("/");return(e=r.split(/[-;]/)[0])!==null&&e!==void 0?e:"bin"}function Kc(t,e,i){return ne(this,void 0,void 0,function*(){let r=t.name||`${Date.now()}.${ln(i)}`;return yield(0,an.dispatchRequest)({method:"POST",targetUrl:`${(0,sn.getRestApiUrl)()}/storage/upload/initiate?storage_type=fal-cdn-v3`,input:{content_type:i,file_name:r},config:e})})}function Hc(t,e,i){return ne(this,void 0,void 0,function*(){let r=t.name||`${Date.now()}.${ln(i)}`;return yield(0,an.dispatchRequest)({method:"POST",targetUrl:`${(0,sn.getRestApiUrl)()}/storage/upload/initiate-multipart?storage_type=fal-cdn-v3`,input:{content_type:i,file_name:r},config:e})})}function un(t,e,i){return ne(this,arguments,void 0,function*(r,n,o,s=3){if(s===0)throw new Error("Part upload failed, retries exhausted");let{fetch:a,responseHandler:c}=o;try{let u=yield a(r,{method:"PUT",body:n});return yield c(u)}catch{return yield un(r,n,o,s-1)}})}function Gc(t,e){return ne(this,void 0,void 0,function*(){let{fetch:i,responseHandler:r}=e,n=t.type||"application/octet-stream",{upload_url:o,file_url:s}=yield Hc(t,e,n),a=10*1024*1024,c=Math.ceil(t.size/a),u=new URL(o),l=[];for(let p=0;p<c;p++){let g=p*a,y=Math.min(g+a,t.size),v=t.slice(g,y),f=p+1,m=`${u.origin}${u.pathname}/${f}${u.search}`;l.push(yield un(m,v,e))}let d=`${u.origin}${u.pathname}/complete${u.search}`,h=yield i(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parts:l.map(p=>({partNumber:p.partNumber,etag:p.etag}))})});return yield r(h),s})}function Qc({config:t}){let e={upload:i=>ne(this,void 0,void 0,function*(){if(i.size>94371840)return yield Gc(i,t);let r=i.type||"application/octet-stream",{fetch:n,responseHandler:o}=t,{upload_url:s,file_url:a}=yield Kc(i,t,r),c=yield n(s,{method:"PUT",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}});return yield o(c),a}),transformInput:i=>ne(this,void 0,void 0,function*(){if(Array.isArray(i))return Promise.all(i.map(r=>e.transformInput(r)));if(i instanceof Blob)return yield e.upload(i);if((0,Bc.isPlainObject)(i)){let n=Object.entries(i).map(s=>ne(this,[s],void 0,function*([a,c]){return[a,yield e.transformInput(c)]})),o=yield Promise.all(n);return Object.fromEntries(o)}return i})};return e}});var di=I(Le=>{"use strict";var dn=Le&&Le.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):n(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})};Object.defineProperty(Le,"__esModule",{value:!0});Le.createFalClient=td;var Wc=Xe(),Yc=pr(),Zc=on(),pn=fe(),Xc=K(),Jc=cn(),ed=Lt();function td(t={}){let e=(0,Wc.createConfig)(t),i=(0,Jc.createStorageClient)({config:e}),r=(0,Yc.createQueueClient)({config:e,storage:i}),n=(0,ed.createStreamingClient)({config:e,storage:i}),o=(0,Zc.createRealtimeClient)({config:e});return{queue:r,realtime:o,storage:i,streaming:n,stream:n.stream,run(s){return dn(this,arguments,void 0,function*(a,c={}){let u=c.input?yield i.transformInput(c.input):void 0;return(0,pn.dispatchRequest)({method:c.method,targetUrl:(0,pn.buildUrl)(a,c),input:u,config:Object.assign(Object.assign({},e),{responseHandler:Xc.resultResponseHandler}),options:{signal:c.abortSignal,retry:{maxRetries:3,baseDelay:500,maxDelay:15e3}}})})},subscribe:(s,a)=>dn(this,void 0,void 0,function*(){let{request_id:c}=yield r.submit(s,a);return a.onEnqueue&&a.onEnqueue(c),yield r.subscribeToStatus(s,Object.assign({requestId:c},a)),r.result(s,{requestId:c})})}}});var hn=I(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.isQueueStatus=fn;mt.isCompletedQueueStatus=id;function fn(t){return t&&t.status&&t.response_url}function id(t){return fn(t)&&t.status==="COMPLETED"}});var bn=I(E=>{"use strict";var rd=E&&E.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),nd=E&&E.__exportStar||function(t,e){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&rd(e,t,i)};Object.defineProperty(E,"__esModule",{value:!0});E.fal=E.parseEndpointId=E.isRetryableError=E.ValidationError=E.ApiError=E.withProxy=E.withMiddleware=E.createFalClient=void 0;var gn=di(),od=di();Object.defineProperty(E,"createFalClient",{enumerable:!0,get:function(){return od.createFalClient}});var mn=Ot();Object.defineProperty(E,"withMiddleware",{enumerable:!0,get:function(){return mn.withMiddleware}});Object.defineProperty(E,"withProxy",{enumerable:!0,get:function(){return mn.withProxy}});var yn=K();Object.defineProperty(E,"ApiError",{enumerable:!0,get:function(){return yn.ApiError}});Object.defineProperty(E,"ValidationError",{enumerable:!0,get:function(){return yn.ValidationError}});var sd=Ce();Object.defineProperty(E,"isRetryableError",{enumerable:!0,get:function(){return sd.isRetryableError}});nd(hn(),E);var ad=H();Object.defineProperty(E,"parseEndpointId",{enumerable:!0,get:function(){return ad.parseEndpointId}});E.fal=function(){let e=(0,gn.createFalClient)();return{config(i){e=(0,gn.createFalClient)(i)},get queue(){return e.queue},get realtime(){return e.realtime},get storage(){return e.storage},get streaming(){return e.streaming},run(i,r){return e.run(i,r)},subscribe(i,r){return e.subscribe(i,r)},stream(i,r){return e.stream(i,r)}}}()});var Ii={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},MinimaxVideo01LiveInput:{title:"TextToVideoLiveRequest",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},prompt_optimizer:{title:"Prompt Optimizer",type:"boolean",description:"Whether to use the model's prompt optimizer",default:!0}},"x-fal-order-properties":["prompt"],required:["prompt"]},MinimaxVideo01LiveOutput:{title:"T2VLiveOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/minimax/video-01-live/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/video-01-live/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/minimax/video-01-live":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxVideo01LiveInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/video-01-live/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxVideo01LiveOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};async function _i(t,e,i){if(e!=null){if(e.startsWith("blob:")){let n=await(await fetch(e)).blob(),o=new File([n],"image.png",{type:"image/png"});return t.storage.upload(o)}if(i!=null&&e.startsWith("buffer:")){let r=await i.engine.editor.getMimeType(e),n=i.engine.editor.getBufferLength(e),o=i.engine.editor.getBufferData(e,0,n),s=new Uint8Array(o),a=new File([s],"image.png",{type:r});return t.storage.upload(a)}return e}}function yo(t,e){let{cesdk:i}=e,r=e.propertyKey??"image_url",n=St(t);return i.i18n.setTranslations({en:{[`panel.${n}`]:"Select Image To Change","ly.img.ai.imageSelection.selectImage.label":"Select Image","ly.img.ai.imageSelection.error.svg":"SVG images are not supported. Please choose a different image.","ly.img.ai.imageSelection.error.invalidType":"Only images are supported. Found '{mimeType}'. Please choose a different image."}}),bo(t,i),{[r]:(o,s)=>{let{builder:a,experimental:{global:c},payload:u}=o,l,d=o.providerConfig,h=o.config,p=d?.properties?.[s.id]??h?.properties?.[s.id];p?.default&&(typeof p.default=="function"?l=p.default({}):l=p.default);let g=l??u?.url??e.defaultUrl,y=c(`${t}.${s.id}`,g);return a.MediaPreview(s.id,{preview:{type:"image",uri:y.value},action:{label:"ly.img.ai.imageSelection.selectImage.label",onClick:()=>{i?.ui.openPanel(n,{payload:{onSelect:v=>{v.meta?.uri!=null&&y.setValue(v.meta?.uri)}}})}}}),()=>({id:s.id,type:"string",value:y.value})}}}function bo(t,e){e?.ui.registerPanel(St(t),({builder:i,payload:r})=>{i.Library(`${t}.library.image`,{entries:["ly.img.image"],onSelect:async n=>{let o=n?.meta?.uri;if(o==null)return;let s=await e.engine.editor.getMimeType(o);s==="image/svg+xml"?e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.svg"}):s.startsWith("image/")?(r?.onSelect(n),e?.ui.closePanel(St(t))):e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})})}function St(t){return`ly.img.ai.${t}.imageSelection`}var vo=yo,wo=class{constructor(t,e=[],i){this.id=t,this.translateLabel=i?.translateLabel,this.assets=e.map(r=>{if(typeof r.label=="string"&&!(r.label&&typeof r.label=="object")){let n=r;return{id:n.id,label:{en:n.label},meta:n.thumbUri?{...n.meta??{},thumbUri:n.thumbUri}:n.meta}}return r}),this.activeAssetIds=new Set,this.assets.length>0&&this.activeAssetIds.add(this.assets[0].id)}async findAssets(t){let{page:e,perPage:i,locale:r="en",sortActiveFirst:n,query:o,tags:s,groups:a,excludeGroups:c,sortingOrder:u,sortKey:l}=t,d=[...this.assets];if(a&&a.length>0&&(d=d.filter(f=>f.groups&&a.some(m=>f.groups?.includes(m)))),c&&c.length>0&&(d=d.filter(f=>!f.groups||!c.some(m=>f.groups?.includes(m)))),o){let f=o.toLowerCase();d=d.filter(m=>{let _=m.label?.[r]?.toLowerCase(),x=m.tags?.[r]||[];return _&&_.includes(f)||x.some(P=>P.toLowerCase().includes(f))})}if(s&&s.length>0){let f=Array.isArray(s)?s:[s];d=d.filter(m=>{let _=m.tags?.[r]||[];return f.some(x=>_.includes(x))})}n&&d.sort((f,m)=>{let _=this.activeAssetIds.has(f.id),x=this.activeAssetIds.has(m.id);return _&&!x?-1:!_&&x?1:0}),l&&l!=="id"?d.sort((f,m)=>{let _=f.meta?.[l],x=m.meta?.[l];return _===void 0?1:x===void 0?-1:typeof _=="string"&&typeof x=="string"?u==="Descending"?x.localeCompare(_):_.localeCompare(x):typeof _=="number"&&typeof x=="number"?u==="Descending"?x-_:_-x:0}):l==="id"&&d.sort((f,m)=>u==="Descending"?m.id.localeCompare(f.id):f.id.localeCompare(m.id));let h=d.length,p=e*i,g=p+i,y=d.slice(p,g).map(f=>{let m=f.label?.[r]||"",_=this.translateLabel?this.translateLabel(f.id,m,r):m;return{id:f.id,groups:f.groups,meta:f.meta,payload:f.payload,locale:r,label:_,tags:f.tags?.[r],active:this.activeAssetIds.has(f.id)}}),v=g<h?e+1:void 0;return{assets:y,currentPage:e,nextPage:v,total:h}}updateLabel(t,e,i){this.assets.forEach(r=>{r.id===t&&(r.label=r.label||{},r.label[i]=e)})}getAssetSelectValue(t){let e=this.assets.find(({id:i})=>i===t);if(e){let i=this.translateLabel?this.translateLabel(e.id,e.label?.en||"",""):e.label?.en||"";return{id:e.id,label:i,thumbUri:e.meta?.thumbUri}}}getActiveSelectValue(){let t=this.getActiveAssetIds();if(t.length>0){let e=this.assets.find(({id:i})=>i===t[0]);if(e){let i=this.translateLabel?this.translateLabel(e.id,e.label?.en||"",""):e.label?.en||"";return{id:e.id,label:i,thumbUri:e.meta?.thumbUri}}}}getTranslatedLabel(t){let e=this.assets.find(({id:i})=>i===t);if(e)return this.translateLabel?this.translateLabel(e.id,e.label?.en||"",""):e.label?.en||""}getAsset(t){return this.assets.find(e=>e.id===t)}setAssetActive(t){this.activeAssetIds.add(t)}getActiveAssetIds(){return Array.from(this.activeAssetIds)}setAssetsActive(t){t.forEach(e=>this.activeAssetIds.add(e))}setAssetInactive(t){this.activeAssetIds.delete(t)}clearActiveAssets(){this.activeAssetIds.clear()}isAssetActive(t){return this.activeAssetIds.has(t)}addAsset(t){let e=this.assets.findIndex(i=>i.id===t.id);e>=0?this.assets[e]=t:this.assets.push(t)}removeAsset(t){let e=this.assets.findIndex(i=>i.id===t);e!==-1&&(this.assets.splice(e,1),this.activeAssetIds.delete(t))}async getGroups(){let t=new Set;return this.assets.forEach(e=>{e.groups&&e.groups.forEach(i=>t.add(i))}),Array.from(t)}getSupportedMimeTypes(){return["image/jpeg","image/png","image/svg+xml","image/webp","video/mp4","audio/mpeg"]}};var xo=typeof global=="object"&&global&&global.Object===Object&&global,Ri=xo,Io=typeof self=="object"&&self&&self.Object===Object&&self,_o=Ri||Io||Function("return this")(),R=_o,To=R.Symbol,ae=To,$i=Object.prototype,So=$i.hasOwnProperty,Eo=$i.toString,_e=ae?ae.toStringTag:void 0;function Ao(t){var e=So.call(t,_e),i=t[_e];try{t[_e]=void 0;var r=!0}catch{}var n=Eo.call(t);return r&&(e?t[_e]=i:delete t[_e]),n}var ko=Ao,Co=Object.prototype,Po=Co.toString;function Mo(t){return Po.call(t)}var Oo=Mo,jo="[object Null]",Do="[object Undefined]",Ti=ae?ae.toStringTag:void 0;function qo(t){return t==null?t===void 0?Do:jo:Ti&&Ti in Object(t)?ko(t):Oo(t)}var Ae=qo;function Uo(t){return t!=null&&typeof t=="object"}var Mt=Uo,Ch=Array.isArray;function Vo(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Fi=Vo,Lo="[object AsyncFunction]",Ro="[object Function]",$o="[object GeneratorFunction]",Fo="[object Proxy]";function No(t){if(!Fi(t))return!1;var e=Ae(t);return e==Ro||e==$o||e==Lo||e==Fo}var zo=No,Bo=R["__core-js_shared__"],It=Bo,Si=function(){var t=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ko(t){return!!Si&&Si in t}var Ho=Ko,Go=Function.prototype,Qo=Go.toString;function Wo(t){if(t!=null){try{return Qo.call(t)}catch{}try{return t+""}catch{}}return""}var ee=Wo,Yo=/[\\^$.*+?()[\]{}|]/g,Zo=/^\[object .+?Constructor\]$/,Xo=Function.prototype,Jo=Object.prototype,es=Xo.toString,ts=Jo.hasOwnProperty,is=RegExp("^"+es.call(ts).replace(Yo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rs(t){if(!Fi(t)||Ho(t))return!1;var e=zo(t)?is:Zo;return e.test(ee(t))}var ns=rs;function os(t,e){return t?.[e]}var ss=os;function as(t,e){var i=ss(t,e);return ns(i)?i:void 0}var le=as,ls=le(R,"WeakMap"),Et=ls;function us(t,e){return t===e||t!==t&&e!==e}var cs=us,ds=9007199254740991;function ps(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ds}var fs=ps,Ph=Object.prototype,hs="[object Arguments]";function gs(t){return Mt(t)&&Ae(t)==hs}var Ei=gs,Ni=Object.prototype,ms=Ni.hasOwnProperty,ys=Ni.propertyIsEnumerable,Mh=Ei(function(){return arguments}())?Ei:function(t){return Mt(t)&&ms.call(t,"callee")&&!ys.call(t,"callee")},zi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ai=zi&&typeof module=="object"&&module&&!module.nodeType&&module,bs=Ai&&Ai.exports===zi,ki=bs?R.Buffer:void 0,Oh=ki?ki.isBuffer:void 0,vs="[object Arguments]",ws="[object Array]",xs="[object Boolean]",Is="[object Date]",_s="[object Error]",Ts="[object Function]",Ss="[object Map]",Es="[object Number]",As="[object Object]",ks="[object RegExp]",Cs="[object Set]",Ps="[object String]",Ms="[object WeakMap]",Os="[object ArrayBuffer]",js="[object DataView]",Ds="[object Float32Array]",qs="[object Float64Array]",Us="[object Int8Array]",Vs="[object Int16Array]",Ls="[object Int32Array]",Rs="[object Uint8Array]",$s="[object Uint8ClampedArray]",Fs="[object Uint16Array]",Ns="[object Uint32Array]",T={};T[Ds]=T[qs]=T[Us]=T[Vs]=T[Ls]=T[Rs]=T[$s]=T[Fs]=T[Ns]=!0;T[vs]=T[ws]=T[Os]=T[xs]=T[js]=T[Is]=T[_s]=T[Ts]=T[Ss]=T[Es]=T[As]=T[ks]=T[Cs]=T[Ps]=T[Ms]=!1;function zs(t){return Mt(t)&&fs(t.length)&&!!T[Ae(t)]}var Bs=zs;function Ks(t){return function(e){return t(e)}}var Hs=Ks,Bi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Te=Bi&&typeof module=="object"&&module&&!module.nodeType&&module,Gs=Te&&Te.exports===Bi,_t=Gs&&Ri.process,Qs=function(){try{var t=Te&&Te.require&&Te.require("util").types;return t||_t&&_t.binding&&_t.binding("util")}catch{}}(),Ci=Qs,Pi=Ci&&Ci.isTypedArray,jh=Pi?Hs(Pi):Bs,Ws=Object.prototype,Dh=Ws.hasOwnProperty;function Ys(t,e){return function(i){return t(e(i))}}var Zs=Ys,qh=Zs(Object.keys,Object),Xs=Object.prototype,Uh=Xs.hasOwnProperty,Js=le(Object,"create"),Se=Js;function ea(){this.__data__=Se?Se(null):{},this.size=0}var ta=ea;function ia(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ra=ia,na="__lodash_hash_undefined__",oa=Object.prototype,sa=oa.hasOwnProperty;function aa(t){var e=this.__data__;if(Se){var i=e[t];return i===na?void 0:i}return sa.call(e,t)?e[t]:void 0}var la=aa,ua=Object.prototype,ca=ua.hasOwnProperty;function da(t){var e=this.__data__;return Se?e[t]!==void 0:ca.call(e,t)}var pa=da,fa="__lodash_hash_undefined__";function ha(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Se&&e===void 0?fa:e,this}var ga=ha;function ue(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}ue.prototype.clear=ta;ue.prototype.delete=ra;ue.prototype.get=la;ue.prototype.has=pa;ue.prototype.set=ga;var Mi=ue;function ma(){this.__data__=[],this.size=0}var ya=ma;function ba(t,e){for(var i=t.length;i--;)if(cs(t[i][0],e))return i;return-1}var Ke=ba,va=Array.prototype,wa=va.splice;function xa(t){var e=this.__data__,i=Ke(e,t);if(i<0)return!1;var r=e.length-1;return i==r?e.pop():wa.call(e,i,1),--this.size,!0}var Ia=xa;function _a(t){var e=this.__data__,i=Ke(e,t);return i<0?void 0:e[i][1]}var Ta=_a;function Sa(t){return Ke(this.__data__,t)>-1}var Ea=Sa;function Aa(t,e){var i=this.__data__,r=Ke(i,t);return r<0?(++this.size,i.push([t,e])):i[r][1]=e,this}var ka=Aa;function ce(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}ce.prototype.clear=ya;ce.prototype.delete=Ia;ce.prototype.get=Ta;ce.prototype.has=Ea;ce.prototype.set=ka;var He=ce,Ca=le(R,"Map"),Ee=Ca;function Pa(){this.size=0,this.__data__={hash:new Mi,map:new(Ee||He),string:new Mi}}var Ma=Pa;function Oa(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ja=Oa;function Da(t,e){var i=t.__data__;return ja(e)?i[typeof e=="string"?"string":"hash"]:i.map}var Ge=Da;function qa(t){var e=Ge(this,t).delete(t);return this.size-=e?1:0,e}var Ua=qa;function Va(t){return Ge(this,t).get(t)}var La=Va;function Ra(t){return Ge(this,t).has(t)}var $a=Ra;function Fa(t,e){var i=Ge(this,t),r=i.size;return i.set(t,e),this.size+=i.size==r?0:1,this}var Na=Fa;function de(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}de.prototype.clear=Ma;de.prototype.delete=Ua;de.prototype.get=La;de.prototype.has=$a;de.prototype.set=Na;var Ki=de;function za(){this.__data__=new He,this.size=0}var Ba=za;function Ka(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}var Ha=Ka;function Ga(t){return this.__data__.get(t)}var Qa=Ga;function Wa(t){return this.__data__.has(t)}var Ya=Wa,Za=200;function Xa(t,e){var i=this.__data__;if(i instanceof He){var r=i.__data__;if(!Ee||r.length<Za-1)return r.push([t,e]),this.size=++i.size,this;i=this.__data__=new Ki(r)}return i.set(t,e),this.size=i.size,this}var Ja=Xa;function ke(t){var e=this.__data__=new He(t);this.size=e.size}ke.prototype.clear=Ba;ke.prototype.delete=Ha;ke.prototype.get=Qa;ke.prototype.has=Ya;ke.prototype.set=Ja;var el=Object.prototype,Vh=el.propertyIsEnumerable,tl=le(R,"DataView"),At=tl,il=le(R,"Promise"),kt=il,rl=le(R,"Set"),Ct=rl,Oi="[object Map]",nl="[object Object]",ji="[object Promise]",Di="[object Set]",qi="[object WeakMap]",Ui="[object DataView]",ol=ee(At),sl=ee(Ee),al=ee(kt),ll=ee(Ct),ul=ee(Et),se=Ae;(At&&se(new At(new ArrayBuffer(1)))!=Ui||Ee&&se(new Ee)!=Oi||kt&&se(kt.resolve())!=ji||Ct&&se(new Ct)!=Di||Et&&se(new Et)!=qi)&&(se=function(t){var e=Ae(t),i=e==nl?t.constructor:void 0,r=i?ee(i):"";if(r)switch(r){case ol:return Ui;case sl:return Oi;case al:return ji;case ll:return Di;case ul:return qi}return e});var Lh=R.Uint8Array,cl="__lodash_hash_undefined__";function dl(t){return this.__data__.set(t,cl),this}var pl=dl;function fl(t){return this.__data__.has(t)}var hl=fl;function Pt(t){var e=-1,i=t==null?0:t.length;for(this.__data__=new Ki;++e<i;)this.add(t[e])}Pt.prototype.add=Pt.prototype.push=pl;Pt.prototype.has=hl;var Vi=ae?ae.prototype:void 0,Rh=Vi?Vi.valueOf:void 0,gl=Object.prototype,$h=gl.hasOwnProperty,ml=Object.prototype,Fh=ml.hasOwnProperty,Nh=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),zh=new RegExp(/[A-Fa-f0-9]{1}/,"g"),Bh=new RegExp(/[A-Fa-f0-9]{2}/,"g");function yl(t){return t!==void 0}var bl=yl;function vl(t){return t?.version?t.version.localeCompare("1.59.0",void 0,{numeric:!0,sensitivity:"base"})>=0&&typeof t.i18n?.translate=="function":!1}function wl(t){return typeof t?.translate=="function"}function Li(t,e,i){return t&&vl(t)&&wl(t.i18n)?t.i18n.translate(e):i}function xl(t,e){let{cesdk:i}=e;if(i==null)return{};let r=e.propertyKey??"style",n=_l(t);i.i18n.setTranslations({en:{[`panel.${n}`]:"Select Style",[`${t}.${r}`]:"Style","ly.img.ai.styleTransfer.none":"None","ly.img.ai.styleTransfer.anime":"Anime","ly.img.ai.styleTransfer.cyberpunk":"Cyberpunk","ly.img.ai.styleTransfer.kodak400":"Kodak 400","ly.img.ai.styleTransfer.watercolor":"Watercolor","ly.img.ai.styleTransfer.darkFantasy":"Dark Fantasy","ly.img.ai.styleTransfer.vaporwave":"Vaporwave","ly.img.ai.styleTransfer.vectorFlat":"Vector Flat","ly.img.ai.styleTransfer.3dAnimation":"3D Animation","ly.img.ai.styleTransfer.ukiyoe":"Ukiyo\u2011e","ly.img.ai.styleTransfer.surreal":"Surreal","ly.img.ai.styleTransfer.steampunk":"Steampunk","ly.img.ai.styleTransfer.nightBokeh":"Night Bokeh","ly.img.ai.styleTransfer.popArt":"Pop Art"}});let o=Sl({baseURL:e.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-image-generation-web/v1/gpt-image-1/",includeNone:!0,cesdk:i}),s=o;e.styles!=null&&(Array.isArray(e.styles)?s=e.styles:typeof e.styles=="function"&&(s=e.styles(o)));let a=El({cesdk:i,providerId:t,styles:s}),c=a.id;return Al(a,{cesdk:i}),Il({providerId:t,cesdk:i,panelId:n,entryId:c}),{[e.propertyKeyForPrompt??"prompt"]:(u,l)=>{let d=u.state("prompt","");return u.builder.TextArea(`${l.id}`,{inputLabel:e.i18n?.prompt?.inputLabel??e.propertyKeyForPrompt??"prompt",placeholder:e.i18n?.prompt?.placeholder,...d}),()=>{let[h]=a.getActiveAssetIds(),p=a.getAsset(h);return{id:l.id,type:"string",value:p?.meta?.prompt==null?d.value:`${d.value}; ${p.meta.prompt}`}}},[r]:(u,l)=>{let{builder:d,state:h}=u;if(s.length>0){let p=h("style",s[0]);return d.Button(`${l.id}`,{inputLabel:`${t}.${l.id}`,icon:"@imgly/Appearance",isDisabled:s.length===0,trailingIcon:"@imgly/ChevronRight",label:p.value.label,labelAlignment:"left",onClick:()=>{let g={onSelect:async y=>{a.clearActiveAssets(),a.setAssetActive(y.id),p.setValue({id:y.id,label:y.label??y.id}),i.ui.closePanel(n)}};i.ui.openPanel(n,{payload:g})}}),()=>({id:l.id,type:"string",value:p.value.id})}return()=>({id:l.id,type:"string",value:"none"})}}}function Il(t){let{providerId:e,cesdk:i,panelId:r,entryId:n}=t;i?.ui.registerPanel(r,({builder:o,payload:s})=>{s?.onSelect==null&&o.Section(`${e}.error`,{children:()=>{o.Text("error",{content:"No onSelect function provided for the style selection panel."})}}),o.Library(`${e}.library.image`,{entries:[n],onSelect:async a=>{s?.onSelect?.(a)}})})}function _l(t){return`ly.img.ai.${t}.styleSelection`}var Tl=[{id:"none",labelKey:"ly.img.ai.styleTransfer.none",prompt:""},{id:"anime-celshaded",labelKey:"ly.img.ai.styleTransfer.anime",prompt:"anime cel\u2011shaded, bright pastel palette, expressive eyes, clean line art "},{id:"cyberpunk-neon",labelKey:"ly.img.ai.styleTransfer.cyberpunk",prompt:"cyberpunk cityscape, glowing neon signage, reflective puddles, dark atmosphere"},{id:"kodak-portra-400",labelKey:"ly.img.ai.styleTransfer.kodak400",prompt:"shot on Kodak Portra 400, soft grain, golden\u2011hour warmth, 35 mm photo"},{id:"watercolor-storybook",labelKey:"ly.img.ai.styleTransfer.watercolor",prompt:"loose watercolor washes, gentle gradients, dreamy storybook feel"},{id:"dark-fantasy-realism",labelKey:"ly.img.ai.styleTransfer.darkFantasy",prompt:"dark fantasy realm, moody chiaroscuro lighting, hyper\u2011real textures"},{id:"vaporwave-retrofuturism",labelKey:"ly.img.ai.styleTransfer.vaporwave",prompt:"retro\u2011futuristic vaporwave, pastel sunset gradient, chrome text, VHS scanlines"},{id:"minimal-vector-flat",labelKey:"ly.img.ai.styleTransfer.vectorFlat",prompt:"minimalist flat vector illustration, bold geometry, two\u2011tone palette"},{id:"pixarstyle-3d-render",labelKey:"ly.img.ai.styleTransfer.3dAnimation",prompt:"Pixar\u2011style 3D render, oversized eyes, subtle subsurface scattering, cinematic lighting"},{id:"ukiyoe-woodblock",labelKey:"ly.img.ai.styleTransfer.ukiyoe",prompt:"ukiyo\u2011e woodblock print, Edo\u2011period style, visible washi texture, limited color ink"},{id:"surreal-dreamscape",labelKey:"ly.img.ai.styleTransfer.surreal",prompt:"surreal dreamscape, floating objects, impossible architecture, vivid clouds"},{id:"steampunk-victorian",labelKey:"ly.img.ai.styleTransfer.steampunk",prompt:"Victorian steampunk world, ornate brass gears, leather attire, atmospheric fog"},{id:"nightstreet-photo-bokeh",labelKey:"ly.img.ai.styleTransfer.nightBokeh",prompt:"night\u2011time street shot, large aperture bokeh lights, candid urban mood"},{id:"comicbook-pop-art",labelKey:"ly.img.ai.styleTransfer.popArt",prompt:"classic comic\u2011book panel, halftone shading, exaggerated action lines, CMYK pop colors"}];function Sl(t){return Tl.map(e=>e.id==="none"?t.includeNone?{id:e.id,label:Li(t.cesdk,e.labelKey,e.labelKey),prompt:e.prompt,thumbUri:`${t.baseURL}/thumbnails/None.svg`}:void 0:{id:e.id,label:Li(t.cesdk,e.labelKey,e.labelKey),prompt:e.prompt,thumbUri:`${t.baseURL}/thumbnails/${e.id}.jpeg`}).filter(bl)}var El=t=>{let e=t.styles.map(s=>({...s,meta:{prompt:s.prompt}})),i=t.cesdk.engine.asset.findAllSources(),r=`${t.providerId}/styles`;for(;i.includes(r);)r+=`-${Math.random().toString(36).substring(2,5)}`;let n=new wo(r,e),o=t.styles[0];return n.setAssetActive(o.id),n},Al=(t,e)=>{e.cesdk.engine.asset.addSource(t),e.cesdk.ui.addAssetLibraryEntry({id:t.id,sourceIds:[t.id],gridItemHeight:"square",gridBackgroundType:"cover",cardLabel:({label:i})=>i,cardLabelPosition:()=>"below"})},kl=xl;var Cl="ly.img.ai";function C(t){return`${Cl}.${t}`}function Hi(t,e){let i={...t};if(!e)return i;for(let[r,n]of Object.entries(e))n===!1||n===null||n===void 0?delete i[r]:n===!0?r in t||(i[r]=!0):i[r]=n;return i}var Tt="@imgly/plugin-ai-generation",Kh=`
5
+ `;else if(v==="event")s=x;else if(v==="id"&&!x.includes("\0"))o=x;else if(v==="retry"){let P=parseInt(x,10);Number.isNaN(P)||t({type:"reconnect-interval",value:P})}}}var cr=[239,187,191];function Iu(t){return cr.every((e,i)=>t.charCodeAt(i)===e)}Rt.createParser=Tu});var Ut=T(Z=>{"use strict";var Su=Z&&Z.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};Object.defineProperty(Z,"__esModule",{value:!0});Z.TOKEN_EXPIRATION_SECONDS=void 0;Z.getTemporaryAuthToken=ku;var Eu=tt(),Au=ge(),Cu=Q();Z.TOKEN_EXPIRATION_SECONDS=120;function ku(t,e){return Su(this,void 0,void 0,function*(){let i=(0,Cu.parseEndpointId)(t),r=yield(0,Au.dispatchRequest)({method:"POST",targetUrl:`${(0,Eu.getRestApiUrl)()}/tokens/`,config:e,input:{allowed_apps:[i.alias],token_expiration:Z.TOKEN_EXPIRATION_SECONDS}});return typeof r!="string"&&r.detail?r.detail:r})}});var $t=T(F=>{"use strict";var ye=F&&F.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})},Me=F&&F.__await||function(t){return this instanceof Me?(this.v=t,this):new Me(t)},Pu=F&&F.__asyncGenerator||function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,o=[];return n={},a("next"),a("throw"),a("return",s),n[Symbol.asyncIterator]=function(){return this},n;function s(p){return function(g){return Promise.resolve(g).then(p,c)}}function a(p,g){r[p]&&(n[p]=function(h){return new Promise(function(v,f){o.push([p,h,v,f])>1||u(p,h)})},g&&(n[p]=g(n[p])))}function u(p,g){try{d(r[p](g))}catch(h){m(o[0][3],h)}}function d(p){p.value instanceof Me?Promise.resolve(p.value.v).then(l,c):m(o[0][2],p)}function l(p){u("next",p)}function c(p){u("throw",p)}function m(p,g){p(g),o.shift(),o.length&&u(o[0][0],o[0][1])}};Object.defineProperty(F,"__esModule",{value:!0});F.FalStream=void 0;F.createStreamingClient=Du;var qu=pr(),Vu=Ut(),mr=ge(),he=G(),Lt="text/event-stream",Mu=15*1e3,it=class{constructor(e,i,r){var n;this.listeners=new Map,this.buffer=[],this.currentData=void 0,this.lastEventTimestamp=0,this.streamClosed=!1,this._requestId=null,this.abortController=new AbortController,this.start=()=>ye(this,void 0,void 0,function*(){var o,s;let{endpointId:a,options:u}=this,{input:d,method:l="post",connectionMode:c="server"}=u;try{if(c==="client"){let m=yield(0,Vu.getTemporaryAuthToken)(a,this.config),{fetch:p}=this.config,g=new URL(this.url);g.searchParams.set("fal_jwt_token",m);let h=yield p(g.toString(),{method:l.toUpperCase(),headers:{accept:(o=u.accept)!==null&&o!==void 0?o:Lt,"content-type":"application/json"},body:d&&l!=="get"?JSON.stringify(d):void 0,signal:this.abortController.signal});return this._requestId=h.headers.get("x-fal-request-id"),yield this.handleResponse(h)}return yield(0,mr.dispatchRequest)({method:l.toUpperCase(),targetUrl:this.url,input:d,config:this.config,options:{headers:{accept:(s=u.accept)!==null&&s!==void 0?s:Lt},responseHandler:m=>ye(this,void 0,void 0,function*(){return this._requestId=m.headers.get("x-fal-request-id"),yield this.handleResponse(m)}),signal:this.abortController.signal}})}catch(m){this.handleError(m)}}),this.handleResponse=o=>ye(this,void 0,void 0,function*(){var s,a;if(!o.ok){try{yield(0,he.defaultResponseHandler)(o)}catch(h){this.emit("error",h)}return}let u=o.body;if(!u){this.emit("error",new he.ApiError({message:"Response body is empty.",status:400,body:void 0}));return}if(!((s=o.headers.get("content-type"))!==null&&s!==void 0?s:"").startsWith(Lt)){let h=u.getReader(),v=()=>{h.read().then(({done:f,value:y})=>{if(f){this.emit("done",this.currentData);return}this.currentData=y,this.emit("data",y),v()})};v();return}let l=new TextDecoder("utf-8"),c=o.body.getReader(),m=(0,qu.createParser)(h=>{if(h.type==="event"){let v=h.data;try{let f=JSON.parse(v);this.buffer.push(f),this.currentData=f,this.emit("data",f),this.emit("message",f)}catch(f){this.emit("error",f)}}}),p=(a=this.options.timeout)!==null&&a!==void 0?a:Mu,g=()=>ye(this,void 0,void 0,function*(){let{value:h,done:v}=yield c.read();this.lastEventTimestamp=Date.now(),m.feed(l.decode(h)),Date.now()-this.lastEventTimestamp>p&&this.emit("error",new he.ApiError({message:`Event stream timed out after ${(p/1e3).toFixed(0)} seconds with no messages.`,status:408})),v?this.emit("done",this.currentData):g().catch(this.handleError)});g().catch(this.handleError)}),this.handleError=o=>{var s;if(o.name==="AbortError"||this.signal.aborted)return;let a=o instanceof he.ApiError?o:new he.ApiError({message:(s=o.message)!==null&&s!==void 0?s:"An unknown error occurred",status:500});this.emit("error",a)},this.on=(o,s)=>{var a;this.listeners.has(o)||this.listeners.set(o,[]),(a=this.listeners.get(o))===null||a===void 0||a.push(s)},this.emit=(o,s)=>{let a=this.listeners.get(o)||[];for(let u of a)u(s)},this.done=()=>ye(this,void 0,void 0,function*(){return this.donePromise}),this.abort=o=>{this.streamClosed||this.abortController.abort(o)},this.endpointId=e,this.config=i,this.url=(n=r.url)!==null&&n!==void 0?n:(0,mr.buildUrl)(e,{path:"/stream",query:r.queryParams}),this.options=r,this.donePromise=new Promise((o,s)=>{this.streamClosed&&s(new he.ApiError({message:"Streaming connection is already closed.",status:400,body:void 0})),this.signal.addEventListener("abort",()=>{var a;o((a=this.currentData)!==null&&a!==void 0?a:{})}),this.on("done",a=>{this.streamClosed=!0,o(a)}),this.on("error",a=>{this.streamClosed=!0,s(a)})}),r.signal&&r.signal.addEventListener("abort",()=>{this.abortController.abort()}),this.start().catch(this.handleError)}[Symbol.asyncIterator](){return Pu(this,arguments,function*(){let i=!0,r=()=>i=!1;for(this.on("error",r),this.on("done",r);i||this.buffer.length>0;){let n=this.buffer.shift();n&&(yield yield Me(n)),yield Me(new Promise(o=>setTimeout(o,16)))}})}get signal(){return this.abortController.signal}get requestId(){return this._requestId}};F.FalStream=it;function Du({config:t,storage:e}){return{stream(i,r){return ye(this,void 0,void 0,function*(){let n=r.input?yield e.transformInput(r.input):void 0;return new it(i,t,Object.assign(Object.assign({},r),{input:n}))})}}}});var yr=T(X=>{"use strict";var ie=X&&X.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})},ju=X&&X.__rest||function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i};Object.defineProperty(X,"__esModule",{value:!0});X.createQueueClient=void 0;var $=ge(),Fu=G(),hr=Ve(),Ou=$t(),rt=Q(),fr=500,gr={maxRetries:3,baseDelay:1e3,maxDelay:6e4,retryableStatusCodes:hr.DEFAULT_RETRYABLE_STATUS_CODES},Ru={maxRetries:5,baseDelay:1e3,maxDelay:3e4,retryableStatusCodes:[...hr.DEFAULT_RETRYABLE_STATUS_CODES,500]},Uu=({config:t,storage:e})=>{let i={submit(r,n){return ie(this,void 0,void 0,function*(){let{webhookUrl:o,priority:s,hint:a}=n,u=ju(n,["webhookUrl","priority","hint"]),d=n.input?yield e.transformInput(n.input):void 0;return(0,$.dispatchRequest)({method:n.method,targetUrl:(0,$.buildUrl)(r,Object.assign(Object.assign({},u),{subdomain:"queue",query:o?{fal_webhook:o}:void 0})),headers:Object.assign({"x-fal-queue-priority":s??"normal"},a&&{"x-fal-runner-hint":a}),input:d,config:t,options:{signal:n.abortSignal,retry:gr}})})},status(r,n){return ie(this,arguments,void 0,function*(o,{requestId:s,logs:a=!1,abortSignal:u}){let d=(0,rt.parseEndpointId)(o),l=d.namespace?`${d.namespace}/`:"";return(0,$.dispatchRequest)({method:"get",targetUrl:(0,$.buildUrl)(`${l}${d.owner}/${d.alias}`,{subdomain:"queue",query:{logs:a?"1":"0"},path:`/requests/${s}/status`}),config:t,options:{signal:u,retry:Ru}})})},streamStatus(r,n){return ie(this,arguments,void 0,function*(o,{requestId:s,logs:a=!1,connectionMode:u}){let d=(0,rt.parseEndpointId)(o),l=d.namespace?`${d.namespace}/`:"",c={logs:a?"1":"0"},m=(0,$.buildUrl)(`${l}${d.owner}/${d.alias}`,{subdomain:"queue",path:`/requests/${s}/status/stream`,query:c});return new Ou.FalStream(o,t,{url:m,method:"get",connectionMode:u,queryParams:c})})},subscribeToStatus(r,n){return ie(this,void 0,void 0,function*(){let o=n.requestId,s=n.timeout,a,u=()=>{};if(n.mode==="streaming"){let d=yield i.streamStatus(r,{requestId:o,logs:n.logs,connectionMode:"connectionMode"in n?n.connectionMode:void 0}),l=[];s&&(a=setTimeout(()=>{throw d.abort(),i.cancel(r,{requestId:o}).catch(u),new Error(`Client timed out waiting for the request to complete after ${s}ms`)},s)),d.on("data",m=>{n.onQueueUpdate&&("logs"in m&&Array.isArray(m.logs)&&m.logs.length>0&&l.push(...m.logs),n.onQueueUpdate("logs"in m?Object.assign(Object.assign({},m),{logs:l}):m))});let c=yield d.done();return a&&clearTimeout(a),c}return new Promise((d,l)=>{var c;let m,p="pollInterval"in n&&typeof n.pollInterval=="number"&&(c=n.pollInterval)!==null&&c!==void 0?c:fr,g=()=>{a&&clearTimeout(a),m&&clearTimeout(m)};s&&(a=setTimeout(()=>{g(),i.cancel(r,{requestId:o}).catch(u),l(new Error(`Client timed out waiting for the request to complete after ${s}ms`))},s));let h=()=>ie(this,void 0,void 0,function*(){var v;try{let f=yield i.status(r,{requestId:o,logs:(v=n.logs)!==null&&v!==void 0?v:!1,abortSignal:n.abortSignal});if(n.onQueueUpdate&&n.onQueueUpdate(f),f.status==="COMPLETED"){g(),d(f);return}m=setTimeout(h,p)}catch(f){g(),l(f)}});h().catch(l)})})},result(r,n){return ie(this,arguments,void 0,function*(o,{requestId:s,abortSignal:a}){let u=(0,rt.parseEndpointId)(o),d=u.namespace?`${u.namespace}/`:"";return(0,$.dispatchRequest)({method:"get",targetUrl:(0,$.buildUrl)(`${d}${u.owner}/${u.alias}`,{subdomain:"queue",path:`/requests/${s}`}),config:Object.assign(Object.assign({},t),{responseHandler:Fu.resultResponseHandler}),options:{signal:a,retry:gr}})})},cancel(r,n){return ie(this,arguments,void 0,function*(o,{requestId:s,abortSignal:a}){let u=(0,rt.parseEndpointId)(o),d=u.namespace?`${u.namespace}/`:"";yield(0,$.dispatchRequest)({method:"put",targetUrl:(0,$.buildUrl)(`${d}${u.owner}/${u.alias}`,{subdomain:"queue",path:`/requests/${s}/cancel`}),config:t,options:{signal:a}})})}};return i};X.createQueueClient=Uu});var nt=T(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.utf8Count=Lu;N.utf8EncodeJs=br;N.utf8EncodeTE=vr;N.utf8Encode=zu;N.utf8DecodeJs=wr;N.utf8DecodeTD=_r;N.utf8Decode=Gu;function Lu(t){let e=t.length,i=0,r=0;for(;r<e;){let n=t.charCodeAt(r++);if(n&4294967168)if(!(n&4294965248))i+=2;else{if(n>=55296&&n<=56319&&r<e){let o=t.charCodeAt(r);(o&64512)===56320&&(++r,n=((n&1023)<<10)+(o&1023)+65536)}n&4294901760?i+=4:i+=3}else{i++;continue}}return i}function br(t,e,i){let r=t.length,n=i,o=0;for(;o<r;){let s=t.charCodeAt(o++);if(s&4294967168)if(!(s&4294965248))e[n++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&o<r){let a=t.charCodeAt(o);(a&64512)===56320&&(++o,s=((s&1023)<<10)+(a&1023)+65536)}s&4294901760?(e[n++]=s>>18&7|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128):(e[n++]=s>>12&15|224,e[n++]=s>>6&63|128)}else{e[n++]=s;continue}e[n++]=s&63|128}}var $u=new TextEncoder,Nu=50;function vr(t,e,i){$u.encodeInto(t,e.subarray(i))}function zu(t,e,i){t.length>Nu?vr(t,e,i):br(t,e,i)}var Bu=4096;function wr(t,e,i){let r=e,n=r+i,o=[],s="";for(;r<n;){let a=t[r++];if(!(a&128))o.push(a);else if((a&224)===192){let u=t[r++]&63;o.push((a&31)<<6|u)}else if((a&240)===224){let u=t[r++]&63,d=t[r++]&63;o.push((a&31)<<12|u<<6|d)}else if((a&248)===240){let u=t[r++]&63,d=t[r++]&63,l=t[r++]&63,c=(a&7)<<18|u<<12|d<<6|l;c>65535&&(c-=65536,o.push(c>>>10&1023|55296),c=56320|c&1023),o.push(c)}else o.push(a);o.length>=Bu&&(s+=String.fromCharCode(...o),o.length=0)}return o.length>0&&(s+=String.fromCharCode(...o)),s}var Ku=new TextDecoder,Hu=200;function _r(t,e,i){let r=t.subarray(e,e+i);return Ku.decode(r)}function Gu(t,e,i){return i>Hu?_r(t,e,i):wr(t,e,i)}});var zt=T(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.ExtData=void 0;var Nt=class{constructor(e,i){this.type=e,this.data=i}};ot.ExtData=Nt});var at=T(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.DecodeError=void 0;var Bt=class t extends Error{constructor(e){super(e);let i=Object.create(t.prototype);Object.setPrototypeOf(this,i),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:t.name})}};st.DecodeError=Bt});var lt=T(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.UINT32_MAX=void 0;J.setUint64=Qu;J.setInt64=Wu;J.getInt64=Yu;J.getUint64=Zu;J.UINT32_MAX=4294967295;function Qu(t,e,i){let r=i/4294967296,n=i;t.setUint32(e,r),t.setUint32(e+4,n)}function Wu(t,e,i){let r=Math.floor(i/4294967296),n=i;t.setUint32(e,r),t.setUint32(e+4,n)}function Yu(t,e){let i=t.getInt32(e),r=t.getUint32(e+4);return i*4294967296+r}function Zu(t,e){let i=t.getUint32(e),r=t.getUint32(e+4);return i*4294967296+r}});var Kt=T(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.timestampExtension=V.EXT_TIMESTAMP=void 0;V.encodeTimeSpecToTimestamp=Tr;V.encodeDateToTimeSpec=Ir;V.encodeTimestampExtension=Sr;V.decodeTimestampToTimeSpec=Er;V.decodeTimestampExtension=Ar;var Xu=at(),xr=lt();V.EXT_TIMESTAMP=-1;var Ju=4294967296-1,ed=17179869184-1;function Tr({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=ed)if(e===0&&t<=Ju){let i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,t),i}else{let i=t/4294967296,r=t&4294967295,n=new Uint8Array(8),o=new DataView(n.buffer);return o.setUint32(0,e<<2|i&3),o.setUint32(4,r),n}else{let i=new Uint8Array(12),r=new DataView(i.buffer);return r.setUint32(0,e),(0,xr.setInt64)(r,4,t),i}}function Ir(t){let e=t.getTime(),i=Math.floor(e/1e3),r=(e-i*1e3)*1e6,n=Math.floor(r/1e9);return{sec:i+n,nsec:r-n*1e9}}function Sr(t){if(t instanceof Date){let e=Ir(t);return Tr(e)}else return null}function Er(t){let e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{let i=e.getUint32(0),r=e.getUint32(4),n=(i&3)*4294967296+r,o=i>>>2;return{sec:n,nsec:o}}case 12:{let i=(0,xr.getInt64)(e,4),r=e.getUint32(0);return{sec:i,nsec:r}}default:throw new Xu.DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Ar(t){let e=Er(t);return new Date(e.sec*1e3+e.nsec/1e6)}V.timestampExtension={type:V.EXT_TIMESTAMP,encode:Sr,decode:Ar}});var ct=T(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.ExtensionCodec=void 0;var ut=zt(),td=Kt(),De=class{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(td.timestampExtension)}register({type:e,encode:i,decode:r}){if(e>=0)this.encoders[e]=i,this.decoders[e]=r;else{let n=-1-e;this.builtInEncoders[n]=i,this.builtInDecoders[n]=r}}tryToEncode(e,i){for(let r=0;r<this.builtInEncoders.length;r++){let n=this.builtInEncoders[r];if(n!=null){let o=n(e,i);if(o!=null){let s=-1-r;return new ut.ExtData(s,o)}}}for(let r=0;r<this.encoders.length;r++){let n=this.encoders[r];if(n!=null){let o=n(e,i);if(o!=null){let s=r;return new ut.ExtData(s,o)}}}return e instanceof ut.ExtData?e:null}decode(e,i,r){let n=i<0?this.builtInDecoders[-1-i]:this.decoders[i];return n?n(e,i,r):new ut.ExtData(i,e)}};dt.ExtensionCodec=De;De.defaultCodec=new De});var Gt=T(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ensureUint8Array=rd;function id(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function rd(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):id(t)?new Uint8Array(t):Uint8Array.from(t)}});var Wt=T(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.Encoder=U.DEFAULT_INITIAL_BUFFER_SIZE=U.DEFAULT_MAX_DEPTH=void 0;var Cr=nt(),nd=ct(),kr=lt(),od=Gt();U.DEFAULT_MAX_DEPTH=100;U.DEFAULT_INITIAL_BUFFER_SIZE=2048;var Qt=class t{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??nd.ExtensionCodec.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??U.DEFAULT_MAX_DEPTH,this.initialBufferSize=e?.initialBufferSize??U.DEFAULT_INITIAL_BUFFER_SIZE,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,i){if(i>this.maxDepth)throw new Error(`Too deep objects in depth ${i}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,i)}ensureBufferSizeToWrite(e){let i=this.pos+e;this.view.byteLength<i&&this.resizeBuffer(i*2)}resizeBuffer(e){let i=new ArrayBuffer(e),r=new Uint8Array(i),n=new DataView(i);r.set(this.bytes),this.view=n,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let r=(0,Cr.utf8Count)(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),(0,Cr.utf8Encode)(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,i){let r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,i);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,i);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let i=e.byteLength;if(i<256)this.writeU8(196),this.writeU8(i);else if(i<65536)this.writeU8(197),this.writeU16(i);else if(i<4294967296)this.writeU8(198),this.writeU32(i);else throw new Error(`Too large binary: ${i}`);let r=(0,od.ensureUint8Array)(e);this.writeU8a(r)}encodeArray(e,i){let r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(let n of e)this.doEncode(n,i+1)}countWithoutUndefined(e,i){let r=0;for(let n of i)e[n]!==void 0&&r++;return r}encodeMap(e,i){let r=Object.keys(e);this.sortKeys&&r.sort();let n=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(n<16)this.writeU8(128+n);else if(n<65536)this.writeU8(222),this.writeU16(n);else if(n<4294967296)this.writeU8(223),this.writeU32(n);else throw new Error(`Too large map object: ${n}`);for(let o of r){let s=e[o];this.ignoreUndefined&&s===void 0||(this.encodeString(o),this.doEncode(s,i+1))}}encodeExtension(e){if(typeof e.data=="function"){let r=e.data(this.pos+6),n=r.length;if(n>=4294967296)throw new Error(`Too large extension object: ${n}`);this.writeU8(201),this.writeU32(n),this.writeI8(e.type),this.writeU8a(r);return}let i=e.data.length;if(i===1)this.writeU8(212);else if(i===2)this.writeU8(213);else if(i===4)this.writeU8(214);else if(i===8)this.writeU8(215);else if(i===16)this.writeU8(216);else if(i<256)this.writeU8(199),this.writeU8(i);else if(i<65536)this.writeU8(200),this.writeU16(i);else if(i<4294967296)this.writeU8(201),this.writeU32(i);else throw new Error(`Too large extension object: ${i}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let i=e.length;this.ensureBufferSizeToWrite(i),this.bytes.set(e,this.pos),this.pos+=i}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),(0,kr.setUint64)(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),(0,kr.setInt64)(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};U.Encoder=Qt});var Pr=T(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.encode=ad;var sd=Wt();function ad(t,e){return new sd.Encoder(e).encodeSharedRef(t)}});var qr=T(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.prettyByte=ld;function ld(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}});var Vr=T(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.CachedKeyDecoder=void 0;var ud=nt(),dd=16,cd=16,Xt=class{constructor(e=dd,i=cd){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=i,this.caches=[];for(let r=0;r<this.maxKeyLength;r++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,i,r){let n=this.caches[r-1];e:for(let o of n){let s=o.bytes;for(let a=0;a<r;a++)if(s[a]!==e[i+a])continue e;return o.str}return null}store(e,i){let r=this.caches[e.length-1],n={bytes:e,str:i};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=n:r.push(n)}decode(e,i,r){let n=this.find(e,i,r);if(n!=null)return this.hit++,n;this.miss++;let o=(0,ud.utf8DecodeJs)(e,i,r),s=Uint8Array.prototype.slice.call(e,i,i+r);return this.store(s,o),o}};pt.CachedKeyDecoder=Xt});var ft=T(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.Decoder=void 0;var Jt=qr(),pd=ct(),re=lt(),md=nt(),Mr=Gt(),fd=Vr(),z=at(),ei="array",Fe="map_key",jr="map_value",gd=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new z.DecodeError("The type of key must be string or number but "+typeof t)},ti=class{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let i=this.getUninitializedStateFromPool();i.type=ei,i.position=0,i.size=e,i.array=new Array(e)}pushMapState(e){let i=this.getUninitializedStateFromPool();i.type=Fe,i.readCount=0,i.size=e,i.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===ei){let r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===Fe||e.type===jr){let r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},je=-1,ri=new DataView(new ArrayBuffer(0)),hd=new Uint8Array(ri.buffer);try{ri.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var Dr=new RangeError("Insufficient data"),yd=new fd.CachedKeyDecoder,ii=class t{constructor(e){this.totalPos=0,this.pos=0,this.view=ri,this.bytes=hd,this.headByte=je,this.stack=new ti,this.entered=!1,this.extensionCodec=e?.extensionCodec??pd.ExtensionCodec.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??re.UINT32_MAX,this.maxBinLength=e?.maxBinLength??re.UINT32_MAX,this.maxArrayLength=e?.maxArrayLength??re.UINT32_MAX,this.maxMapLength=e?.maxMapLength??re.UINT32_MAX,this.maxExtLength=e?.maxExtLength??re.UINT32_MAX,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:yd,this.mapKeyConverter=e?.mapKeyConverter??gd}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=je,this.stack.reset()}setBuffer(e){let i=(0,Mr.ensureUint8Array)(e);this.bytes=i,this.view=new DataView(i.buffer,i.byteOffset,i.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===je&&!this.hasRemaining(1))this.setBuffer(e);else{let i=this.bytes.subarray(this.pos),r=(0,Mr.ensureUint8Array)(e),n=new Uint8Array(i.length+r.length);n.set(i),n.set(r,i.length),this.setBuffer(n)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:i,pos:r}=this;return new RangeError(`Extra ${i.byteLength-r} of ${i.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let i=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return i}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let i=!1,r;for await(let a of e){if(i)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{r=this.doDecodeSync(),i=!0}catch(u){if(!(u instanceof RangeError))throw u}this.totalPos+=this.pos}if(i){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return r}let{headByte:n,pos:o,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${(0,Jt.prettyByte)(n)} at ${s} (${o} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,i){if(this.entered){yield*this.clone().decodeMultiAsync(e,i);return}try{this.entered=!0;let r=i,n=-1;for await(let o of e){if(i&&n===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(o),r&&(n=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),--n!==0;);}catch(s){if(!(s instanceof RangeError))throw s}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let e=this.readHeadByte(),i;if(e>=224)i=e-256;else if(e<192)if(e<128)i=e;else if(e<144){let n=e-128;if(n!==0){this.pushMapState(n),this.complete();continue e}else i={}}else if(e<160){let n=e-144;if(n!==0){this.pushArrayState(n),this.complete();continue e}else i=[]}else{let n=e-160;i=this.decodeString(n,0)}else if(e===192)i=null;else if(e===194)i=!1;else if(e===195)i=!0;else if(e===202)i=this.readF32();else if(e===203)i=this.readF64();else if(e===204)i=this.readU8();else if(e===205)i=this.readU16();else if(e===206)i=this.readU32();else if(e===207)this.useBigInt64?i=this.readU64AsBigInt():i=this.readU64();else if(e===208)i=this.readI8();else if(e===209)i=this.readI16();else if(e===210)i=this.readI32();else if(e===211)this.useBigInt64?i=this.readI64AsBigInt():i=this.readI64();else if(e===217){let n=this.lookU8();i=this.decodeString(n,1)}else if(e===218){let n=this.lookU16();i=this.decodeString(n,2)}else if(e===219){let n=this.lookU32();i=this.decodeString(n,4)}else if(e===220){let n=this.readU16();if(n!==0){this.pushArrayState(n),this.complete();continue e}else i=[]}else if(e===221){let n=this.readU32();if(n!==0){this.pushArrayState(n),this.complete();continue e}else i=[]}else if(e===222){let n=this.readU16();if(n!==0){this.pushMapState(n),this.complete();continue e}else i={}}else if(e===223){let n=this.readU32();if(n!==0){this.pushMapState(n),this.complete();continue e}else i={}}else if(e===196){let n=this.lookU8();i=this.decodeBinary(n,1)}else if(e===197){let n=this.lookU16();i=this.decodeBinary(n,2)}else if(e===198){let n=this.lookU32();i=this.decodeBinary(n,4)}else if(e===212)i=this.decodeExtension(1,0);else if(e===213)i=this.decodeExtension(2,0);else if(e===214)i=this.decodeExtension(4,0);else if(e===215)i=this.decodeExtension(8,0);else if(e===216)i=this.decodeExtension(16,0);else if(e===199){let n=this.lookU8();i=this.decodeExtension(n,1)}else if(e===200){let n=this.lookU16();i=this.decodeExtension(n,2)}else if(e===201){let n=this.lookU32();i=this.decodeExtension(n,4)}else throw new z.DecodeError(`Unrecognized type byte: ${(0,Jt.prettyByte)(e)}`);this.complete();let r=this.stack;for(;r.length>0;){let n=r.top();if(n.type===ei)if(n.array[n.position]=i,n.position++,n.position===n.size)i=n.array,r.release(n);else continue e;else if(n.type===Fe){if(i==="__proto__")throw new z.DecodeError("The key __proto__ is not allowed");n.key=this.mapKeyConverter(i),n.type=jr;continue e}else if(n.map[n.key]=i,n.readCount++,n.readCount===n.size)i=n.map,r.release(n);else{n.key=null,n.type=Fe;continue e}}return i}}readHeadByte(){return this.headByte===je&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=je}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new z.DecodeError(`Unrecognized array type byte: ${(0,Jt.prettyByte)(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new z.DecodeError(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new z.DecodeError(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,i){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,i):this.decodeBinary(e,i)}decodeUtf8String(e,i){if(e>this.maxStrLength)throw new z.DecodeError(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+i+e)throw Dr;let r=this.pos+i,n;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?n=this.keyDecoder.decode(this.bytes,r,e):n=(0,md.utf8Decode)(this.bytes,r,e),this.pos+=i+e,n}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Fe:!1}decodeBinary(e,i){if(e>this.maxBinLength)throw new z.DecodeError(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+i))throw Dr;let r=this.pos+i,n=this.bytes.subarray(r,r+e);return this.pos+=i+e,n}decodeExtension(e,i){if(e>this.maxExtLength)throw new z.DecodeError(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let r=this.view.getInt8(this.pos+i),n=this.decodeBinary(e,i+1);return this.extensionCodec.decode(n,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=(0,re.getUint64)(this.view,this.pos);return this.pos+=8,e}readI64(){let e=(0,re.getInt64)(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};mt.Decoder=ii});var Or=T(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.decode=bd;gt.decodeMulti=vd;var Fr=ft();function bd(t,e){return new Fr.Decoder(e).decode(t)}function vd(t,e){return new Fr.Decoder(e).decodeMulti(t)}});var Lr=T(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.isAsyncIterable=Rr;Oe.asyncIterableFromStream=Ur;Oe.ensureAsyncIterable=wd;function Rr(t){return t[Symbol.asyncIterator]!=null}async function*Ur(t){let e=t.getReader();try{for(;;){let{done:i,value:r}=await e.read();if(i)return;yield r}}finally{e.releaseLock()}}function wd(t){return Rr(t)?t:Ur(t)}});var $r=T(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.decodeAsync=_d;Re.decodeArrayStream=xd;Re.decodeMultiStream=Td;var ni=ft(),oi=Lr();async function _d(t,e){let i=(0,oi.ensureAsyncIterable)(t);return new ni.Decoder(e).decodeAsync(i)}function xd(t,e){let i=(0,oi.ensureAsyncIterable)(t);return new ni.Decoder(e).decodeArrayStream(i)}function Td(t,e){let i=(0,oi.ensureAsyncIterable)(t);return new ni.Decoder(e).decodeStream(i)}});var zr=T(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.decodeTimestampExtension=w.encodeTimestampExtension=w.decodeTimestampToTimeSpec=w.encodeTimeSpecToTimestamp=w.encodeDateToTimeSpec=w.EXT_TIMESTAMP=w.ExtData=w.ExtensionCodec=w.Encoder=w.DecodeError=w.Decoder=w.decodeMultiStream=w.decodeArrayStream=w.decodeAsync=w.decodeMulti=w.decode=w.encode=void 0;var Id=Pr();Object.defineProperty(w,"encode",{enumerable:!0,get:function(){return Id.encode}});var Nr=Or();Object.defineProperty(w,"decode",{enumerable:!0,get:function(){return Nr.decode}});Object.defineProperty(w,"decodeMulti",{enumerable:!0,get:function(){return Nr.decodeMulti}});var si=$r();Object.defineProperty(w,"decodeAsync",{enumerable:!0,get:function(){return si.decodeAsync}});Object.defineProperty(w,"decodeArrayStream",{enumerable:!0,get:function(){return si.decodeArrayStream}});Object.defineProperty(w,"decodeMultiStream",{enumerable:!0,get:function(){return si.decodeMultiStream}});var Sd=ft();Object.defineProperty(w,"Decoder",{enumerable:!0,get:function(){return Sd.Decoder}});var Ed=at();Object.defineProperty(w,"DecodeError",{enumerable:!0,get:function(){return Ed.DecodeError}});var Ad=Wt();Object.defineProperty(w,"Encoder",{enumerable:!0,get:function(){return Ad.Encoder}});var Cd=ct();Object.defineProperty(w,"ExtensionCodec",{enumerable:!0,get:function(){return Cd.ExtensionCodec}});var kd=zt();Object.defineProperty(w,"ExtData",{enumerable:!0,get:function(){return kd.ExtData}});var be=Kt();Object.defineProperty(w,"EXT_TIMESTAMP",{enumerable:!0,get:function(){return be.EXT_TIMESTAMP}});Object.defineProperty(w,"encodeDateToTimeSpec",{enumerable:!0,get:function(){return be.encodeDateToTimeSpec}});Object.defineProperty(w,"encodeTimeSpecToTimestamp",{enumerable:!0,get:function(){return be.encodeTimeSpecToTimestamp}});Object.defineProperty(w,"decodeTimestampToTimeSpec",{enumerable:!0,get:function(){return be.decodeTimestampToTimeSpec}});Object.defineProperty(w,"encodeTimestampExtension",{enumerable:!0,get:function(){return be.encodeTimestampExtension}});Object.defineProperty(w,"decodeTimestampExtension",{enumerable:!0,get:function(){return be.decodeTimestampExtension}})});var on=T(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});function k(t){return{enumerable:!0,value:t}}function Br(t){return{enumerable:!0,writable:!0,value:t}}var ne={},Pd=()=>!0,Kr=()=>({}),Gr=t=>t,qd=(t,e,i,r)=>t.apply(i,r)&&e.apply(i,r),Vd=(t,e,i,[r,n])=>e.call(i,t.call(i,r,n),n),ee=(t,e)=>Object.freeze(Object.create(t,e));function Hr(t,e,i){return t.reduce((r,n)=>function(...o){return i(r,n,this,o)},e)}function Qr(t){return ee(this,{fn:k(t)})}var Wr={},Yr=Qr.bind(Wr),Md=t=>Yr((e,i)=>!!~t(e,i)&&e),Zr={},Dd=Qr.bind(Zr);function ht(t,e){return e.filter(i=>t.isPrototypeOf(i))}function Xr(t,e,...i){let r=Hr(ht(Zr,i).map(o=>o.fn),Pd,qd),n=Hr(ht(Wr,i).map(o=>o.fn),Gr,Vd);return ee(this,{from:k(t),to:k(e),guards:k(r),reducers:k(n)})}var Jr={},en={},jd=Xr.bind(Jr),Fd=Xr.bind(en,null);function Od(t,e,i){return li(e,t,i,this.immediates)||t}function tn(t){let e=new Map;for(let i of t)e.has(i.from)||e.set(i.from,[]),e.get(i.from).push(i);return e}var Rd={enter:Gr};function Ud(...t){let e=ht(Jr,t),i=ht(en,t),r={final:k(t.length===0),transitions:k(tn(e))};return i.length&&(r.immediates=k(i),r.enter=k(Od)),ee(Rd,r)}var Ld={enter(t,e,i){let r=this.fn.call(e,e.context,i);return ai.isPrototypeOf(r)?ee(rn,{machine:k(r),transitions:k(this.transitions)}).enter(t,e,i):(r.then(n=>e.send({type:"done",data:n})).catch(n=>e.send({type:"error",error:n})),t)}},rn={enter(t,e,i){if(e.child=nn(this.machine,r=>{e.onChange(r),e.child==r&&r.machine.state.value.final&&(delete e.child,e.send({type:"done",data:r.context}))},e.context,i),e.child.machine.state.value.final){let r=e.child.context;return delete e.child,li(e,t,{type:"done",data:r},this.transitions.get("done"))}return t}};function $d(t,...e){let i=k(tn(e));return ai.isPrototypeOf(t)?ee(rn,{machine:k(t),transitions:i}):ee(Ld,{fn:k(t),transitions:i})}var ai={get state(){return{name:this.current,value:this.states[this.current]}}};function Nd(t,e,i=Kr){return typeof t!="string"&&(i=e||Kr,e=t,t=Object.keys(e)[0]),ne._create&&ne._create(t,e),ee(ai,{context:k(i),current:k(t),states:k(e)})}function li(t,e,i,r){let{context:n}=t;for(let{to:o,guards:s,reducers:a}of r)if(s(n,i)){t.context=a.call(t,n,i);let u=e.original||e,d=ee(u,{current:k(o),original:{value:u}});return ne._onEnter&&ne._onEnter(e,o,t.context,n,i),d.state.value.enter(d,t,i)}}function zd(t,e){let i=e.type||e,{machine:r}=t,{value:n,name:o}=r.state;return n.transitions.has(i)?li(t,r,e,n.transitions.get(i))||r:(ne._send&&ne._send(i,o),r)}var Bd={send(t){this.machine=zd(this,t),this.onChange(this)}};function nn(t,e,i,r){let n=Object.create(Bd,{machine:Br(t),context:Br(t.context(i,r)),onChange:k(e)});return n.send=n.send.bind(n),n.machine=n.machine.state.value.enter(n.machine,n,r),n}M.action=Md;M.createMachine=Nd;M.d=ne;M.guard=Dd;M.immediate=Fd;M.interpret=nn;M.invoke=$d;M.reduce=Yr;M.state=Ud;M.transition=jd});var dn=T(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.createRealtimeClient=oc;var bt=zr(),b=on(),sn=Ut(),ui=G(),an=et(),pi=Q(),Kd=()=>({enqueuedMessage:void 0});function Hd(t){return t.token!==void 0}function Gd(t){return!Hd(t)}function yt(t,e){return Object.assign(Object.assign({},t),{enqueuedMessage:e.message})}function B(t){return t.websocket&&t.websocket.readyState===WebSocket.OPEN&&t.websocket.close(),Object.assign(Object.assign({},t),{websocket:void 0})}function Qd(t,e){return t.websocket&&t.websocket.readyState===WebSocket.OPEN?(e.message instanceof Uint8Array?t.websocket.send(e.message):t.websocket.send((0,bt.encode)(e.message)),Object.assign(Object.assign({},t),{enqueuedMessage:void 0})):Object.assign(Object.assign({},t),{enqueuedMessage:e.message})}function di(t){return Object.assign(Object.assign({},t),{token:void 0})}function Wd(t,e){return Object.assign(Object.assign({},t),{token:e.token})}function Yd(t,e){return Object.assign(Object.assign({},t),{websocket:e.websocket})}var Zd=(0,b.createMachine)("idle",{idle:(0,b.state)((0,b.transition)("send","connecting",(0,b.reduce)(yt)),(0,b.transition)("expireToken","idle",(0,b.reduce)(di)),(0,b.transition)("close","idle",(0,b.reduce)(B))),connecting:(0,b.state)((0,b.transition)("connecting","connecting"),(0,b.transition)("connected","active",(0,b.reduce)(Yd)),(0,b.transition)("connectionClosed","idle",(0,b.reduce)(B)),(0,b.transition)("send","connecting",(0,b.reduce)(yt)),(0,b.transition)("close","idle",(0,b.reduce)(B)),(0,b.immediate)("authRequired",(0,b.guard)(Gd))),authRequired:(0,b.state)((0,b.transition)("initiateAuth","authInProgress"),(0,b.transition)("send","authRequired",(0,b.reduce)(yt)),(0,b.transition)("close","idle",(0,b.reduce)(B))),authInProgress:(0,b.state)((0,b.transition)("authenticated","connecting",(0,b.reduce)(Wd)),(0,b.transition)("unauthorized","idle",(0,b.reduce)(di),(0,b.reduce)(B)),(0,b.transition)("send","authInProgress",(0,b.reduce)(yt)),(0,b.transition)("close","idle",(0,b.reduce)(B))),active:(0,b.state)((0,b.transition)("send","active",(0,b.reduce)(Qd)),(0,b.transition)("unauthorized","idle",(0,b.reduce)(di)),(0,b.transition)("connectionClosed","idle",(0,b.reduce)(B)),(0,b.transition)("close","idle",(0,b.reduce)(B))),failed:(0,b.state)((0,b.transition)("send","failed"),(0,b.transition)("close","idle",(0,b.reduce)(B)))},Kd);function Xd(t,{token:e,maxBuffering:i}){if(i!==void 0&&(i<1||i>60))throw new Error("The `maxBuffering` must be between 1 and 60 (inclusive)");let r=new URLSearchParams({fal_jwt_token:e});return i!==void 0&&r.set("max_buffering",i.toFixed(0)),`wss://fal.run/${(0,pi.ensureEndpointIdFormat)(t)}/realtime?${r.toString()}`}var Jd=128;function ec(t){return t.status==="error"&&t.error==="Unauthorized"}var tc={NORMAL_CLOSURE:1e3,GOING_AWAY:1001},ci=new Map,ln=new Map;function ic(t,e,i){if(!ci.has(t)){let r=(0,b.interpret)(Zd,i);ci.set(t,Object.assign(Object.assign({},r),{throttledSend:e>0?(0,pi.throttle)(r.send,e,!0):r.send}))}return ci.get(t)}var Ue=()=>{},rc={send:Ue,close:Ue};function nc(t){return t.status!=="error"&&t.type!=="x-fal-message"&&!un(t)}function un(t){return t.type==="x-fal-error"}function oc({config:t}){return{connect(e,i){let{clientOnly:r=(0,pi.isReact)()&&!(0,an.isBrowser)(),connectionKey:n=crypto.randomUUID(),maxBuffering:o,throttleInterval:s=Jd}=i;if(r&&!(0,an.isBrowser)())return rc;let a;ln.set(n,{onError:i.onError,onResult:i.onResult});let u=()=>ln.get(n),d=ic(n,s,({context:m,machine:p,send:g})=>{let{enqueuedMessage:h,token:v}=m;if(p.current==="active"&&h&&g({type:"send",message:h}),p.current==="authRequired"&&v===void 0&&a!==p.current&&(g({type:"initiateAuth"}),(0,sn.getTemporaryAuthToken)(e,t).then(f=>{g({type:"authenticated",token:f});let y=Math.round(sn.TOKEN_EXPIRATION_SECONDS*.9*1e3);setTimeout(()=>{g({type:"expireToken"})},y)}).catch(f=>{g({type:"unauthorized",error:f})})),p.current==="connecting"&&a!==p.current&&v!==void 0){let f=new WebSocket(Xd(e,{token:v,maxBuffering:o}));f.onopen=()=>{g({type:"connected",websocket:f})},f.onclose=y=>{if(y.code!==tc.NORMAL_CLOSURE){let{onError:I=Ue}=u();I(new ui.ApiError({message:`Error closing the connection: ${y.reason}`,status:y.code}))}g({type:"connectionClosed",code:y.code})},f.onerror=y=>{let{onError:I=Ue}=u();I(new ui.ApiError({message:"Unknown error",status:500}))},f.onmessage=y=>{let{onResult:I}=u();if(y.data instanceof ArrayBuffer){let P=(0,bt.decode)(new Uint8Array(y.data));I(P);return}if(y.data instanceof Uint8Array){let P=(0,bt.decode)(y.data);I(P);return}if(y.data instanceof Blob){y.data.arrayBuffer().then(P=>{let Tt=(0,bt.decode)(new Uint8Array(P));I(Tt)});return}let x=JSON.parse(y.data);if(ec(x)){g({type:"unauthorized",error:new Error("Unauthorized")});return}if(nc(x)){I(x);return}if(un(x)){if(x.error==="TIMEOUT")return;let{onError:P=Ue}=u();P(new ui.ApiError({message:`${x.error}: ${x.reason}`,status:400,body:x}));return}}}a=p.current});return{send:m=>{d.throttledSend({type:"send",message:m})},close:()=>{d.send({type:"close"})}}}}}});var gn=T(Le=>{"use strict";var oe=Le&&Le.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};Object.defineProperty(Le,"__esModule",{value:!0});Le.createStorageClient=dc;var cn=tt(),pn=ge(),sc=Q();function mn(t){var e;let[i,r]=t.split("/");return(e=r.split(/[-;]/)[0])!==null&&e!==void 0?e:"bin"}function ac(t,e,i){return oe(this,void 0,void 0,function*(){let r=t.name||`${Date.now()}.${mn(i)}`;return yield(0,pn.dispatchRequest)({method:"POST",targetUrl:`${(0,cn.getRestApiUrl)()}/storage/upload/initiate?storage_type=fal-cdn-v3`,input:{content_type:i,file_name:r},config:e})})}function lc(t,e,i){return oe(this,void 0,void 0,function*(){let r=t.name||`${Date.now()}.${mn(i)}`;return yield(0,pn.dispatchRequest)({method:"POST",targetUrl:`${(0,cn.getRestApiUrl)()}/storage/upload/initiate-multipart?storage_type=fal-cdn-v3`,input:{content_type:i,file_name:r},config:e})})}function fn(t,e,i){return oe(this,arguments,void 0,function*(r,n,o,s=3){if(s===0)throw new Error("Part upload failed, retries exhausted");let{fetch:a,responseHandler:u}=o;try{let d=yield a(r,{method:"PUT",body:n});return yield u(d)}catch{return yield fn(r,n,o,s-1)}})}function uc(t,e){return oe(this,void 0,void 0,function*(){let{fetch:i,responseHandler:r}=e,n=t.type||"application/octet-stream",{upload_url:o,file_url:s}=yield lc(t,e,n),a=10*1024*1024,u=Math.ceil(t.size/a),d=new URL(o),l=[];for(let p=0;p<u;p++){let g=p*a,h=Math.min(g+a,t.size),v=t.slice(g,h),f=p+1,y=`${d.origin}${d.pathname}/${f}${d.search}`;l.push(yield fn(y,v,e))}let c=`${d.origin}${d.pathname}/complete${d.search}`,m=yield i(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parts:l.map(p=>({partNumber:p.partNumber,etag:p.etag}))})});return yield r(m),s})}function dc({config:t}){let e={upload:i=>oe(this,void 0,void 0,function*(){if(i.size>94371840)return yield uc(i,t);let r=i.type||"application/octet-stream",{fetch:n,responseHandler:o}=t,{upload_url:s,file_url:a}=yield ac(i,t,r),u=yield n(s,{method:"PUT",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}});return yield o(u),a}),transformInput:i=>oe(this,void 0,void 0,function*(){if(Array.isArray(i))return Promise.all(i.map(r=>e.transformInput(r)));if(i instanceof Blob)return yield e.upload(i);if((0,sc.isPlainObject)(i)){let n=Object.entries(i).map(s=>oe(this,[s],void 0,function*([a,u]){return[a,yield e.transformInput(u)]})),o=yield Promise.all(n);return Object.fromEntries(o)}return i})};return e}});var fi=T($e=>{"use strict";var hn=$e&&$e.__awaiter||function(t,e,i,r){function n(o){return o instanceof i?o:new i(function(s){s(o)})}return new(i||(i=Promise))(function(o,s){function a(l){try{d(r.next(l))}catch(c){s(c)}}function u(l){try{d(r.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};Object.defineProperty($e,"__esModule",{value:!0});$e.createFalClient=yc;var cc=tt(),pc=yr(),mc=dn(),yn=ge(),fc=G(),gc=gn(),hc=$t();function yc(t={}){let e=(0,cc.createConfig)(t),i=(0,gc.createStorageClient)({config:e}),r=(0,pc.createQueueClient)({config:e,storage:i}),n=(0,hc.createStreamingClient)({config:e,storage:i}),o=(0,mc.createRealtimeClient)({config:e});return{queue:r,realtime:o,storage:i,streaming:n,stream:n.stream,run(s){return hn(this,arguments,void 0,function*(a,u={}){let d=u.input?yield i.transformInput(u.input):void 0;return(0,yn.dispatchRequest)({method:u.method,targetUrl:(0,yn.buildUrl)(a,u),input:d,config:Object.assign(Object.assign({},e),{responseHandler:fc.resultResponseHandler}),options:{signal:u.abortSignal,retry:{maxRetries:3,baseDelay:500,maxDelay:15e3}}})})},subscribe:(s,a)=>hn(this,void 0,void 0,function*(){let{request_id:u}=yield r.submit(s,a);return a.onEnqueue&&a.onEnqueue(u),yield r.subscribeToStatus(s,Object.assign({requestId:u},a)),r.result(s,{requestId:u})})}}});var vn=T(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.isQueueStatus=bn;vt.isCompletedQueueStatus=bc;function bn(t){return t&&t.status&&t.response_url}function bc(t){return bn(t)&&t.status==="COMPLETED"}});var Tn=T(C=>{"use strict";var vc=C&&C.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),wc=C&&C.__exportStar||function(t,e){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&vc(e,t,i)};Object.defineProperty(C,"__esModule",{value:!0});C.fal=C.parseEndpointId=C.isRetryableError=C.ValidationError=C.ApiError=C.withProxy=C.withMiddleware=C.createFalClient=void 0;var wn=fi(),_c=fi();Object.defineProperty(C,"createFalClient",{enumerable:!0,get:function(){return _c.createFalClient}});var _n=jt();Object.defineProperty(C,"withMiddleware",{enumerable:!0,get:function(){return _n.withMiddleware}});Object.defineProperty(C,"withProxy",{enumerable:!0,get:function(){return _n.withProxy}});var xn=G();Object.defineProperty(C,"ApiError",{enumerable:!0,get:function(){return xn.ApiError}});Object.defineProperty(C,"ValidationError",{enumerable:!0,get:function(){return xn.ValidationError}});var xc=Ve();Object.defineProperty(C,"isRetryableError",{enumerable:!0,get:function(){return xc.isRetryableError}});wc(vn(),C);var Tc=Q();Object.defineProperty(C,"parseEndpointId",{enumerable:!0,get:function(){return Tc.parseEndpointId}});C.fal=function(){let e=(0,wn.createFalClient)();return{config(i){e=(0,wn.createFalClient)(i)},get queue(){return e.queue},get realtime(){return e.realtime},get storage(){return e.storage},get streaming(){return e.streaming},run(i,r){return e.run(i,r)},subscribe(i,r){return e.subscribe(i,r)},stream(i,r){return e.stream(i,r)}}}()});var ki={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},MinimaxVideo01LiveInput:{title:"TextToVideoLiveRequest",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},prompt_optimizer:{title:"Prompt Optimizer",type:"boolean",description:"Whether to use the model's prompt optimizer",default:!0}},"x-fal-order-properties":["prompt"],required:["prompt"]},MinimaxVideo01LiveOutput:{title:"T2VLiveOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/minimax/video-01-live/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/video-01-live/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/minimax/video-01-live":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxVideo01LiveInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/video-01-live/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxVideo01LiveOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};async function H(t,e,i){if(e!=null){if(e.startsWith("blob:")){let n=await(await fetch(e)).blob(),o=new File([n],"image.png",{type:"image/png"});return t.storage.upload(o)}if(i!=null&&e.startsWith("buffer:")){let r=await i.engine.editor.getMimeType(e),n=i.engine.editor.getBufferLength(e),o=i.engine.editor.getBufferData(e,0,n),s=new Uint8Array(o),a=new File([s],"image.png",{type:r});return t.storage.upload(a)}return e}}function Mo(t,e){let{cesdk:i}=e,r=e.propertyKey??"image_url",n=Ct(t);return i.i18n.setTranslations({en:{[`panel.${n}`]:"Select Image To Change","ly.img.ai.imageSelection.selectImage.label":"Select Image","ly.img.ai.imageSelection.error.svg":"SVG images are not supported. Please choose a different image.","ly.img.ai.imageSelection.error.invalidType":"Only images are supported. Found '{mimeType}'. Please choose a different image."}}),Do(t,i),{[r]:(o,s)=>{let{builder:a,experimental:{global:u},payload:d}=o,l,c=o.providerConfig,m=o.config,p=c?.properties?.[s.id]??m?.properties?.[s.id];p?.default&&(typeof p.default=="function"?l=p.default({}):l=p.default);let g=l??d?.url??e.defaultUrl,h=u(`${t}.${s.id}`,g);return a.MediaPreview(s.id,{preview:{type:"image",uri:h.value},action:{label:"ly.img.ai.imageSelection.selectImage.label",onClick:()=>{i?.ui.openPanel(n,{payload:{onSelect:v=>{v.meta?.uri!=null&&h.setValue(v.meta?.uri)}}})}}}),()=>({id:s.id,type:"string",value:h.value})}}}function Do(t,e){e?.ui.registerPanel(Ct(t),({builder:i,payload:r})=>{i.Library(`${t}.library.image`,{entries:["ly.img.image"],onSelect:async n=>{let o=n?.meta?.uri;if(o==null)return;let s=await e.engine.editor.getMimeType(o);s==="image/svg+xml"?e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.svg"}):s.startsWith("image/")?(r?.onSelect(n),e?.ui.closePanel(Ct(t))):e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})})}function Ct(t){return`ly.img.ai.${t}.imageSelection`}var jo=Mo,Fo=class{constructor(t,e=[],i){this.id=t,this.translateLabel=i?.translateLabel,this.assets=e.map(r=>{if(typeof r.label=="string"&&!(r.label&&typeof r.label=="object")){let n=r;return{id:n.id,label:{en:n.label},meta:n.thumbUri?{...n.meta??{},thumbUri:n.thumbUri}:n.meta}}return r}),this.activeAssetIds=new Set,this.assets.length>0&&this.activeAssetIds.add(this.assets[0].id)}async findAssets(t){let{page:e,perPage:i,locale:r="en",sortActiveFirst:n,query:o,tags:s,groups:a,excludeGroups:u,sortingOrder:d,sortKey:l}=t,c=[...this.assets];if(a&&a.length>0&&(c=c.filter(f=>f.groups&&a.some(y=>f.groups?.includes(y)))),u&&u.length>0&&(c=c.filter(f=>!f.groups||!u.some(y=>f.groups?.includes(y)))),o){let f=o.toLowerCase();c=c.filter(y=>{let I=y.label?.[r]?.toLowerCase(),x=y.tags?.[r]||[];return I&&I.includes(f)||x.some(P=>P.toLowerCase().includes(f))})}if(s&&s.length>0){let f=Array.isArray(s)?s:[s];c=c.filter(y=>{let I=y.tags?.[r]||[];return f.some(x=>I.includes(x))})}n&&c.sort((f,y)=>{let I=this.activeAssetIds.has(f.id),x=this.activeAssetIds.has(y.id);return I&&!x?-1:!I&&x?1:0}),l&&l!=="id"?c.sort((f,y)=>{let I=f.meta?.[l],x=y.meta?.[l];return I===void 0?1:x===void 0?-1:typeof I=="string"&&typeof x=="string"?d==="Descending"?x.localeCompare(I):I.localeCompare(x):typeof I=="number"&&typeof x=="number"?d==="Descending"?x-I:I-x:0}):l==="id"&&c.sort((f,y)=>d==="Descending"?y.id.localeCompare(f.id):f.id.localeCompare(y.id));let m=c.length,p=e*i,g=p+i,h=c.slice(p,g).map(f=>{let y=f.label?.[r]||"",I=this.translateLabel?this.translateLabel(f.id,y,r):y;return{id:f.id,groups:f.groups,meta:f.meta,payload:f.payload,locale:r,label:I,tags:f.tags?.[r],active:this.activeAssetIds.has(f.id)}}),v=g<m?e+1:void 0;return{assets:h,currentPage:e,nextPage:v,total:m}}updateLabel(t,e,i){this.assets.forEach(r=>{r.id===t&&(r.label=r.label||{},r.label[i]=e)})}getAssetSelectValue(t){let e=this.assets.find(({id:i})=>i===t);if(e){let i=this.translateLabel?this.translateLabel(e.id,e.label?.en||"",""):e.label?.en||"";return{id:e.id,label:i,thumbUri:e.meta?.thumbUri}}}getActiveSelectValue(){let t=this.getActiveAssetIds();if(t.length>0){let e=this.assets.find(({id:i})=>i===t[0]);if(e){let i=this.translateLabel?this.translateLabel(e.id,e.label?.en||"",""):e.label?.en||"";return{id:e.id,label:i,thumbUri:e.meta?.thumbUri}}}}getTranslatedLabel(t){let e=this.assets.find(({id:i})=>i===t);if(e)return this.translateLabel?this.translateLabel(e.id,e.label?.en||"",""):e.label?.en||""}getAsset(t){return this.assets.find(e=>e.id===t)}setAssetActive(t){this.activeAssetIds.add(t)}getActiveAssetIds(){return Array.from(this.activeAssetIds)}setAssetsActive(t){t.forEach(e=>this.activeAssetIds.add(e))}setAssetInactive(t){this.activeAssetIds.delete(t)}clearActiveAssets(){this.activeAssetIds.clear()}isAssetActive(t){return this.activeAssetIds.has(t)}addAsset(t){let e=this.assets.findIndex(i=>i.id===t.id);e>=0?this.assets[e]=t:this.assets.push(t)}removeAsset(t){let e=this.assets.findIndex(i=>i.id===t);e!==-1&&(this.assets.splice(e,1),this.activeAssetIds.delete(t))}async getGroups(){let t=new Set;return this.assets.forEach(e=>{e.groups&&e.groups.forEach(i=>t.add(i))}),Array.from(t)}getSupportedMimeTypes(){return["image/jpeg","image/png","image/svg+xml","image/webp","video/mp4","audio/mpeg"]}};var Oo=typeof global=="object"&&global&&global.Object===Object&&global,Ki=Oo,Ro=typeof self=="object"&&self&&self.Object===Object&&self,Uo=Ki||Ro||Function("return this")(),L=Uo,Lo=L.Symbol,le=Lo,Hi=Object.prototype,$o=Hi.hasOwnProperty,No=Hi.toString,Ee=le?le.toStringTag:void 0;function zo(t){var e=$o.call(t,Ee),i=t[Ee];try{t[Ee]=void 0;var r=!0}catch{}var n=No.call(t);return r&&(e?t[Ee]=i:delete t[Ee]),n}var Bo=zo,Ko=Object.prototype,Ho=Ko.toString;function Go(t){return Ho.call(t)}var Qo=Go,Wo="[object Null]",Yo="[object Undefined]",Pi=le?le.toStringTag:void 0;function Zo(t){return t==null?t===void 0?Yo:Wo:Pi&&Pi in Object(t)?Bo(t):Qo(t)}var Pe=Zo;function Xo(t){return t!=null&&typeof t=="object"}var Dt=Xo,og=Array.isArray;function Jo(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Gi=Jo,es="[object AsyncFunction]",ts="[object Function]",is="[object GeneratorFunction]",rs="[object Proxy]";function ns(t){if(!Gi(t))return!1;var e=Pe(t);return e==ts||e==is||e==es||e==rs}var os=ns,ss=L["__core-js_shared__"],St=ss,qi=function(){var t=/[^.]+$/.exec(St&&St.keys&&St.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function as(t){return!!qi&&qi in t}var ls=as,us=Function.prototype,ds=us.toString;function cs(t){if(t!=null){try{return ds.call(t)}catch{}try{return t+""}catch{}}return""}var te=cs,ps=/[\\^$.*+?()[\]{}|]/g,ms=/^\[object .+?Constructor\]$/,fs=Function.prototype,gs=Object.prototype,hs=fs.toString,ys=gs.hasOwnProperty,bs=RegExp("^"+hs.call(ys).replace(ps,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vs(t){if(!Gi(t)||ls(t))return!1;var e=os(t)?bs:ms;return e.test(te(t))}var ws=vs;function _s(t,e){return t?.[e]}var xs=_s;function Ts(t,e){var i=xs(t,e);return ws(i)?i:void 0}var ue=Ts,Is=ue(L,"WeakMap"),kt=Is;function Ss(t,e){return t===e||t!==t&&e!==e}var Es=Ss,As=9007199254740991;function Cs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=As}var ks=Cs,sg=Object.prototype,Ps="[object Arguments]";function qs(t){return Dt(t)&&Pe(t)==Ps}var Vi=qs,Qi=Object.prototype,Vs=Qi.hasOwnProperty,Ms=Qi.propertyIsEnumerable,ag=Vi(function(){return arguments}())?Vi:function(t){return Dt(t)&&Vs.call(t,"callee")&&!Ms.call(t,"callee")},Wi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mi=Wi&&typeof module=="object"&&module&&!module.nodeType&&module,Ds=Mi&&Mi.exports===Wi,Di=Ds?L.Buffer:void 0,lg=Di?Di.isBuffer:void 0,js="[object Arguments]",Fs="[object Array]",Os="[object Boolean]",Rs="[object Date]",Us="[object Error]",Ls="[object Function]",$s="[object Map]",Ns="[object Number]",zs="[object Object]",Bs="[object RegExp]",Ks="[object Set]",Hs="[object String]",Gs="[object WeakMap]",Qs="[object ArrayBuffer]",Ws="[object DataView]",Ys="[object Float32Array]",Zs="[object Float64Array]",Xs="[object Int8Array]",Js="[object Int16Array]",ea="[object Int32Array]",ta="[object Uint8Array]",ia="[object Uint8ClampedArray]",ra="[object Uint16Array]",na="[object Uint32Array]",E={};E[Ys]=E[Zs]=E[Xs]=E[Js]=E[ea]=E[ta]=E[ia]=E[ra]=E[na]=!0;E[js]=E[Fs]=E[Qs]=E[Os]=E[Ws]=E[Rs]=E[Us]=E[Ls]=E[$s]=E[Ns]=E[zs]=E[Bs]=E[Ks]=E[Hs]=E[Gs]=!1;function oa(t){return Dt(t)&&ks(t.length)&&!!E[Pe(t)]}var sa=oa;function aa(t){return function(e){return t(e)}}var la=aa,Yi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ae=Yi&&typeof module=="object"&&module&&!module.nodeType&&module,ua=Ae&&Ae.exports===Yi,Et=ua&&Ki.process,da=function(){try{var t=Ae&&Ae.require&&Ae.require("util").types;return t||Et&&Et.binding&&Et.binding("util")}catch{}}(),ji=da,Fi=ji&&ji.isTypedArray,ug=Fi?la(Fi):sa,ca=Object.prototype,dg=ca.hasOwnProperty;function pa(t,e){return function(i){return t(e(i))}}var ma=pa,cg=ma(Object.keys,Object),fa=Object.prototype,pg=fa.hasOwnProperty,ga=ue(Object,"create"),Ce=ga;function ha(){this.__data__=Ce?Ce(null):{},this.size=0}var ya=ha;function ba(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var va=ba,wa="__lodash_hash_undefined__",_a=Object.prototype,xa=_a.hasOwnProperty;function Ta(t){var e=this.__data__;if(Ce){var i=e[t];return i===wa?void 0:i}return xa.call(e,t)?e[t]:void 0}var Ia=Ta,Sa=Object.prototype,Ea=Sa.hasOwnProperty;function Aa(t){var e=this.__data__;return Ce?e[t]!==void 0:Ea.call(e,t)}var Ca=Aa,ka="__lodash_hash_undefined__";function Pa(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Ce&&e===void 0?ka:e,this}var qa=Pa;function de(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}de.prototype.clear=ya;de.prototype.delete=va;de.prototype.get=Ia;de.prototype.has=Ca;de.prototype.set=qa;var Oi=de;function Va(){this.__data__=[],this.size=0}var Ma=Va;function Da(t,e){for(var i=t.length;i--;)if(Es(t[i][0],e))return i;return-1}var Qe=Da,ja=Array.prototype,Fa=ja.splice;function Oa(t){var e=this.__data__,i=Qe(e,t);if(i<0)return!1;var r=e.length-1;return i==r?e.pop():Fa.call(e,i,1),--this.size,!0}var Ra=Oa;function Ua(t){var e=this.__data__,i=Qe(e,t);return i<0?void 0:e[i][1]}var La=Ua;function $a(t){return Qe(this.__data__,t)>-1}var Na=$a;function za(t,e){var i=this.__data__,r=Qe(i,t);return r<0?(++this.size,i.push([t,e])):i[r][1]=e,this}var Ba=za;function ce(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}ce.prototype.clear=Ma;ce.prototype.delete=Ra;ce.prototype.get=La;ce.prototype.has=Na;ce.prototype.set=Ba;var We=ce,Ka=ue(L,"Map"),ke=Ka;function Ha(){this.size=0,this.__data__={hash:new Oi,map:new(ke||We),string:new Oi}}var Ga=Ha;function Qa(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Wa=Qa;function Ya(t,e){var i=t.__data__;return Wa(e)?i[typeof e=="string"?"string":"hash"]:i.map}var Ye=Ya;function Za(t){var e=Ye(this,t).delete(t);return this.size-=e?1:0,e}var Xa=Za;function Ja(t){return Ye(this,t).get(t)}var el=Ja;function tl(t){return Ye(this,t).has(t)}var il=tl;function rl(t,e){var i=Ye(this,t),r=i.size;return i.set(t,e),this.size+=i.size==r?0:1,this}var nl=rl;function pe(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}pe.prototype.clear=Ga;pe.prototype.delete=Xa;pe.prototype.get=el;pe.prototype.has=il;pe.prototype.set=nl;var Zi=pe;function ol(){this.__data__=new We,this.size=0}var sl=ol;function al(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}var ll=al;function ul(t){return this.__data__.get(t)}var dl=ul;function cl(t){return this.__data__.has(t)}var pl=cl,ml=200;function fl(t,e){var i=this.__data__;if(i instanceof We){var r=i.__data__;if(!ke||r.length<ml-1)return r.push([t,e]),this.size=++i.size,this;i=this.__data__=new Zi(r)}return i.set(t,e),this.size=i.size,this}var gl=fl;function qe(t){var e=this.__data__=new We(t);this.size=e.size}qe.prototype.clear=sl;qe.prototype.delete=ll;qe.prototype.get=dl;qe.prototype.has=pl;qe.prototype.set=gl;var hl=Object.prototype,mg=hl.propertyIsEnumerable,yl=ue(L,"DataView"),Pt=yl,bl=ue(L,"Promise"),qt=bl,vl=ue(L,"Set"),Vt=vl,Ri="[object Map]",wl="[object Object]",Ui="[object Promise]",Li="[object Set]",$i="[object WeakMap]",Ni="[object DataView]",_l=te(Pt),xl=te(ke),Tl=te(qt),Il=te(Vt),Sl=te(kt),ae=Pe;(Pt&&ae(new Pt(new ArrayBuffer(1)))!=Ni||ke&&ae(new ke)!=Ri||qt&&ae(qt.resolve())!=Ui||Vt&&ae(new Vt)!=Li||kt&&ae(new kt)!=$i)&&(ae=function(t){var e=Pe(t),i=e==wl?t.constructor:void 0,r=i?te(i):"";if(r)switch(r){case _l:return Ni;case xl:return Ri;case Tl:return Ui;case Il:return Li;case Sl:return $i}return e});var fg=L.Uint8Array,El="__lodash_hash_undefined__";function Al(t){return this.__data__.set(t,El),this}var Cl=Al;function kl(t){return this.__data__.has(t)}var Pl=kl;function Mt(t){var e=-1,i=t==null?0:t.length;for(this.__data__=new Zi;++e<i;)this.add(t[e])}Mt.prototype.add=Mt.prototype.push=Cl;Mt.prototype.has=Pl;var zi=le?le.prototype:void 0,gg=zi?zi.valueOf:void 0,ql=Object.prototype,hg=ql.hasOwnProperty,Vl=Object.prototype,yg=Vl.hasOwnProperty,bg=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),vg=new RegExp(/[A-Fa-f0-9]{1}/,"g"),wg=new RegExp(/[A-Fa-f0-9]{2}/,"g");function Ml(t){return t!==void 0}var Dl=Ml;function jl(t){return t?.version?t.version.localeCompare("1.59.0",void 0,{numeric:!0,sensitivity:"base"})>=0&&typeof t.i18n?.translate=="function":!1}function Fl(t){return typeof t?.translate=="function"}function Bi(t,e,i){return t&&jl(t)&&Fl(t.i18n)?t.i18n.translate(e):i}function Ol(t,e){let{cesdk:i}=e;if(i==null)return{};let r=e.propertyKey??"style",n=Ul(t);i.i18n.setTranslations({en:{[`panel.${n}`]:"Select Style",[`${t}.${r}`]:"Style","ly.img.ai.styleTransfer.none":"None","ly.img.ai.styleTransfer.anime":"Anime","ly.img.ai.styleTransfer.cyberpunk":"Cyberpunk","ly.img.ai.styleTransfer.kodak400":"Kodak 400","ly.img.ai.styleTransfer.watercolor":"Watercolor","ly.img.ai.styleTransfer.darkFantasy":"Dark Fantasy","ly.img.ai.styleTransfer.vaporwave":"Vaporwave","ly.img.ai.styleTransfer.vectorFlat":"Vector Flat","ly.img.ai.styleTransfer.3dAnimation":"3D Animation","ly.img.ai.styleTransfer.ukiyoe":"Ukiyo\u2011e","ly.img.ai.styleTransfer.surreal":"Surreal","ly.img.ai.styleTransfer.steampunk":"Steampunk","ly.img.ai.styleTransfer.nightBokeh":"Night Bokeh","ly.img.ai.styleTransfer.popArt":"Pop Art"}});let o=$l({baseURL:e.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-image-generation-web/v1/gpt-image-1/",includeNone:!0,cesdk:i}),s=o;e.styles!=null&&(Array.isArray(e.styles)?s=e.styles:typeof e.styles=="function"&&(s=e.styles(o)));let a=Nl({cesdk:i,providerId:t,styles:s}),u=a.id;return zl(a,{cesdk:i}),Rl({providerId:t,cesdk:i,panelId:n,entryId:u}),{[e.propertyKeyForPrompt??"prompt"]:(d,l)=>{let c=d.state("prompt","");return d.builder.TextArea(`${l.id}`,{inputLabel:e.i18n?.prompt?.inputLabel??e.propertyKeyForPrompt??"prompt",placeholder:e.i18n?.prompt?.placeholder,...c}),()=>{let[m]=a.getActiveAssetIds(),p=a.getAsset(m);return{id:l.id,type:"string",value:p?.meta?.prompt==null?c.value:`${c.value}; ${p.meta.prompt}`}}},[r]:(d,l)=>{let{builder:c,state:m}=d;if(s.length>0){let p=m("style",s[0]);return c.Button(`${l.id}`,{inputLabel:`${t}.${l.id}`,icon:"@imgly/Appearance",isDisabled:s.length===0,trailingIcon:"@imgly/ChevronRight",label:p.value.label,labelAlignment:"left",onClick:()=>{let g={onSelect:async h=>{a.clearActiveAssets(),a.setAssetActive(h.id),p.setValue({id:h.id,label:h.label??h.id}),i.ui.closePanel(n)}};i.ui.openPanel(n,{payload:g})}}),()=>({id:l.id,type:"string",value:p.value.id})}return()=>({id:l.id,type:"string",value:"none"})}}}function Rl(t){let{providerId:e,cesdk:i,panelId:r,entryId:n}=t;i?.ui.registerPanel(r,({builder:o,payload:s})=>{s?.onSelect==null&&o.Section(`${e}.error`,{children:()=>{o.Text("error",{content:"No onSelect function provided for the style selection panel."})}}),o.Library(`${e}.library.image`,{entries:[n],onSelect:async a=>{s?.onSelect?.(a)}})})}function Ul(t){return`ly.img.ai.${t}.styleSelection`}var Ll=[{id:"none",labelKey:"ly.img.ai.styleTransfer.none",prompt:""},{id:"anime-celshaded",labelKey:"ly.img.ai.styleTransfer.anime",prompt:"anime cel\u2011shaded, bright pastel palette, expressive eyes, clean line art "},{id:"cyberpunk-neon",labelKey:"ly.img.ai.styleTransfer.cyberpunk",prompt:"cyberpunk cityscape, glowing neon signage, reflective puddles, dark atmosphere"},{id:"kodak-portra-400",labelKey:"ly.img.ai.styleTransfer.kodak400",prompt:"shot on Kodak Portra 400, soft grain, golden\u2011hour warmth, 35 mm photo"},{id:"watercolor-storybook",labelKey:"ly.img.ai.styleTransfer.watercolor",prompt:"loose watercolor washes, gentle gradients, dreamy storybook feel"},{id:"dark-fantasy-realism",labelKey:"ly.img.ai.styleTransfer.darkFantasy",prompt:"dark fantasy realm, moody chiaroscuro lighting, hyper\u2011real textures"},{id:"vaporwave-retrofuturism",labelKey:"ly.img.ai.styleTransfer.vaporwave",prompt:"retro\u2011futuristic vaporwave, pastel sunset gradient, chrome text, VHS scanlines"},{id:"minimal-vector-flat",labelKey:"ly.img.ai.styleTransfer.vectorFlat",prompt:"minimalist flat vector illustration, bold geometry, two\u2011tone palette"},{id:"pixarstyle-3d-render",labelKey:"ly.img.ai.styleTransfer.3dAnimation",prompt:"Pixar\u2011style 3D render, oversized eyes, subtle subsurface scattering, cinematic lighting"},{id:"ukiyoe-woodblock",labelKey:"ly.img.ai.styleTransfer.ukiyoe",prompt:"ukiyo\u2011e woodblock print, Edo\u2011period style, visible washi texture, limited color ink"},{id:"surreal-dreamscape",labelKey:"ly.img.ai.styleTransfer.surreal",prompt:"surreal dreamscape, floating objects, impossible architecture, vivid clouds"},{id:"steampunk-victorian",labelKey:"ly.img.ai.styleTransfer.steampunk",prompt:"Victorian steampunk world, ornate brass gears, leather attire, atmospheric fog"},{id:"nightstreet-photo-bokeh",labelKey:"ly.img.ai.styleTransfer.nightBokeh",prompt:"night\u2011time street shot, large aperture bokeh lights, candid urban mood"},{id:"comicbook-pop-art",labelKey:"ly.img.ai.styleTransfer.popArt",prompt:"classic comic\u2011book panel, halftone shading, exaggerated action lines, CMYK pop colors"}];function $l(t){return Ll.map(e=>e.id==="none"?t.includeNone?{id:e.id,label:Bi(t.cesdk,e.labelKey,e.labelKey),prompt:e.prompt,thumbUri:`${t.baseURL}/thumbnails/None.svg`}:void 0:{id:e.id,label:Bi(t.cesdk,e.labelKey,e.labelKey),prompt:e.prompt,thumbUri:`${t.baseURL}/thumbnails/${e.id}.jpeg`}).filter(Dl)}var Nl=t=>{let e=t.styles.map(s=>({...s,meta:{prompt:s.prompt}})),i=t.cesdk.engine.asset.findAllSources(),r=`${t.providerId}/styles`;for(;i.includes(r);)r+=`-${Math.random().toString(36).substring(2,5)}`;let n=new Fo(r,e),o=t.styles[0];return n.setAssetActive(o.id),n},zl=(t,e)=>{e.cesdk.engine.asset.addSource(t),e.cesdk.ui.addAssetLibraryEntry({id:t.id,sourceIds:[t.id],gridItemHeight:"square",gridBackgroundType:"cover",cardLabel:({label:i})=>i,cardLabelPosition:()=>"below"})},Bl=Ol;var Kl="ly.img.ai";function _(t){return`${Kl}.${t}`}function me(t,e){let i={...t};if(!e)return i;for(let[r,n]of Object.entries(e))n===!1||n===null||n===void 0?delete i[r]:n===!0?r in t||(i[r]=!0):i[r]=n;return i}var At="@imgly/plugin-ai-generation",_g=`
6
6
  <svg>
7
7
  <symbol
8
8
  fill="none"
@@ -20,7 +20,7 @@ var lo=Object.create;var xi=Object.defineProperty;var uo=Object.getOwnPropertyDe
20
20
  fill="none"
21
21
  xmlns="http://www.w3.org/2000/svg"
22
22
  viewBox="0 0 24 24"
23
- id="${Tt}/image"
23
+ id="${At}/image"
24
24
  >
25
25
  <path d="M3 16.5V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V6C21 4.34315 19.6569 3 18 3L17.999 5C18.5513 5 19 5.44772 19 6V18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18V16.5H3Z" fill="currentColor"/>
26
26
  <path d="M13.0982 0.884877C12.9734 0.568323 12.5254 0.568322 12.4005 0.884876L11.7485 2.53819C11.7104 2.63483 11.6339 2.71134 11.5372 2.74945L9.8839 3.40151C9.56735 3.52636 9.56734 3.97436 9.8839 4.09921L11.5372 4.75126C11.6339 4.78938 11.7104 4.86588 11.7485 4.96253L12.4005 6.61584C12.5254 6.93239 12.9734 6.9324 13.0982 6.61584L13.7503 4.96253C13.7884 4.86588 13.8649 4.78938 13.9616 4.75126L15.6149 4.09921C15.9314 3.97436 15.9314 3.52636 15.6149 3.40151L13.9616 2.74945C13.8649 2.71134 13.7884 2.63483 13.7503 2.53819L13.0982 0.884877Z" fill="currentColor"/>
@@ -32,7 +32,7 @@ var lo=Object.create;var xi=Object.defineProperty;var uo=Object.getOwnPropertyDe
32
32
  fill="none"
33
33
  xmlns="http://www.w3.org/2000/svg"
34
34
  viewBox="0 0 24 24"
35
- id="${Tt}/video"
35
+ id="${At}/video"
36
36
  >
37
37
  <path d="M6 3C4.34315 3 3 4.34315 3 6V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V16.5H19V18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18V6C5 5.44772 5.44772 5 6 5V3Z" fill="currentColor"/>
38
38
  <path d="M10.9025 0.8839C11.0273 0.567345 11.4753 0.567346 11.6002 0.883901L12.2522 2.53721C12.2904 2.63386 12.3669 2.71036 12.4635 2.74848L14.1168 3.40053C14.4334 3.52538 14.4334 3.97338 14.1168 4.09823L12.4635 4.75029C12.3669 4.7884 12.2904 4.86491 12.2522 4.96155L11.6002 6.61486C11.4753 6.93142 11.0273 6.93142 10.9025 6.61486L10.2504 4.96155C10.2123 4.86491 10.1358 4.7884 10.0392 4.75029L8.38585 4.09823C8.0693 3.97338 8.0693 3.52538 8.38585 3.40053L10.0392 2.74848C10.1358 2.71036 10.2123 2.63386 10.2504 2.53721L10.9025 0.8839Z" fill="currentColor"/>
@@ -43,7 +43,7 @@ var lo=Object.create;var xi=Object.defineProperty;var uo=Object.getOwnPropertyDe
43
43
  fill="none"
44
44
  xmlns="http://www.w3.org/2000/svg"
45
45
  viewBox="0 0 24 24"
46
- id="${Tt}/audio"
46
+ id="${At}/audio"
47
47
  >
48
48
  <path d="M6 3.80273C4.2066 4.84016 3 6.77919 3 9.00004V12.8153C3 15.931 5.39501 18.4873 8.44444 18.7436V20.9645C8.44444 22.2198 9.89427 22.9198 10.8773 22.1392L15.1265 18.7647H15.5C17.8285 18.7647 19.8472 17.4384 20.8417 15.5H18.4187C17.6889 16.2784 16.6512 16.7647 15.5 16.7647H14.9522C14.6134 16.7647 14.2846 16.8794 14.0193 17.0901L10.4444 19.929V18.2597C10.4444 17.4341 9.77513 16.7647 8.9495 16.7647C7.80494 16.7647 6.77409 16.2779 6.05276 15.5H6V15.4419C5.37798 14.7439 5 13.8237 5 12.8153V9.00004C5 7.98559 5.37764 7.05935 6 6.35422V3.80273Z" fill="currentColor"/>
49
49
  <path d="M11.6002 1.8839C11.4753 1.56735 11.0273 1.56735 10.9025 1.8839L10.2504 3.53721C10.2123 3.63386 10.1358 3.71036 10.0392 3.74848L8.38585 4.40053C8.0693 4.52538 8.0693 4.97338 8.38585 5.09823L10.0392 5.75029C10.1358 5.7884 10.2123 5.86491 10.2504 5.96155L10.9025 7.61486C11.0273 7.93142 11.4753 7.93142 11.6002 7.61486L12.2522 5.96155C12.2904 5.86491 12.3669 5.7884 12.4635 5.75029L14.1168 5.09823C14.4334 4.97338 14.4334 4.52538 14.1168 4.40053L12.4635 3.74848C12.3669 3.71036 12.2904 3.63386 12.2522 3.53721L11.6002 1.8839Z" fill="currentColor"/>
@@ -63,13 +63,13 @@ var lo=Object.create;var xi=Object.defineProperty;var uo=Object.getOwnPropertyDe
63
63
 
64
64
  </symbol>
65
65
  </svg>
66
- `;var Gi={ImageUrl:vo,StyleTransfer:kl};var vn=go(bn());function wn(t,e){return(0,vn.createFalClient)({proxyUrl:t,requestMiddleware:async r=>({...r,headers:{...r.headers,...e??{}}})})}function ld(t,e){let i=t.middleware??e.middlewares??e.middleware??[],r=null,n={id:t.modelKey,name:t.name??t.modelKey,kind:"video",initialize:async o=>{r=wn(e.proxyUrl,t.headers),t.initialize?.(o)},input:{quickActions:{supported:Hi(t.supportedQuickActions??{},e.supportedQuickActions)},panel:{type:"schema",document:t.schema,inputReference:t.inputReference,includeHistoryLibrary:!0,orderExtensionKeyword:"x-fal-order-properties",renderCustomProperty:{...t.cesdk!=null?Gi.ImageUrl(t.modelKey,{cesdk:t.cesdk}):{},...t.renderCustomProperty},getBlockInput:t.getBlockInput,userFlow:t.useFlow??"placeholder"}},output:{abortable:!0,history:e.history??"@imgly/indexedDB",middleware:i,generate:async(o,{abortSignal:s})=>{if(!r)throw new Error("Provider not initialized");let a=await _i(r,o.image_url,t.cesdk),c=await r.subscribe(t.modelKey,{abortSignal:s,input:a!=null?{...o,image_url:a}:o,logs:!0}),u=c?.data?.video;if(u!=null){let l=u?.url;if(l!=null)return{kind:"video",url:l}}throw console.error("Cannot extract generated video from response:",c),new Error("Cannot find generated video")},generationHintText:"ly.img.ai.video.generation.hint"}};return e.debug&&console.log("Created Provider:",n),n}var k=ld;function xn(t){return async({cesdk:e})=>ud(e,t)}function ud(t,e){return k({modelKey:"fal-ai/minimax/video-01-live",name:"Minimax Video 01 Live",schema:Ii,inputReference:"#/components/schemas/MinimaxVideo01LiveInput",headers:e.headers,middleware:e.middlewares??e.middleware??[],cesdk:t,getBlockInput:()=>Promise.resolve({video:{width:1280,height:720,duration:5}})},e)}var cd=typeof global=="object"&&global&&global.Object===Object&&global,Un=cd,dd=typeof self=="object"&&self&&self.Object===Object&&self,pd=Un||dd||Function("return this")(),B=pd,fd=B.Symbol,be=fd,Vn=Object.prototype,hd=Vn.hasOwnProperty,gd=Vn.toString,Re=be?be.toStringTag:void 0;function md(t){var e=hd.call(t,Re),i=t[Re];try{t[Re]=void 0;var r=!0}catch{}var n=gd.call(t);return r&&(e?t[Re]=i:delete t[Re]),n}var yd=md,bd=Object.prototype,vd=bd.toString;function wd(t){return vd.call(t)}var xd=wd,Id="[object Null]",_d="[object Undefined]",In=be?be.toStringTag:void 0;function Td(t){return t==null?t===void 0?_d:Id:In&&In in Object(t)?yd(t):xd(t)}var ze=Td;function Sd(t){return t!=null&&typeof t=="object"}var vi=Sd,Ng=Array.isArray;function Ed(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ln=Ed,Ad="[object AsyncFunction]",kd="[object Function]",Cd="[object GeneratorFunction]",Pd="[object Proxy]";function Md(t){if(!Ln(t))return!1;var e=ze(t);return e==kd||e==Cd||e==Ad||e==Pd}var Od=Md,jd=B["__core-js_shared__"],pi=jd,_n=function(){var t=/[^.]+$/.exec(pi&&pi.keys&&pi.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Dd(t){return!!_n&&_n in t}var qd=Dd,Ud=Function.prototype,Vd=Ud.toString;function Ld(t){if(t!=null){try{return Vd.call(t)}catch{}try{return t+""}catch{}}return""}var oe=Ld,Rd=/[\\^$.*+?()[\]{}|]/g,$d=/^\[object .+?Constructor\]$/,Fd=Function.prototype,Nd=Object.prototype,zd=Fd.toString,Bd=Nd.hasOwnProperty,Kd=RegExp("^"+zd.call(Bd).replace(Rd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Hd(t){if(!Ln(t)||qd(t))return!1;var e=Od(t)?Kd:$d;return e.test(oe(t))}var Gd=Hd;function Qd(t,e){return t?.[e]}var Wd=Qd;function Yd(t,e){var i=Wd(t,e);return Gd(i)?i:void 0}var ve=Yd,Zd=ve(B,"WeakMap"),hi=Zd;function Xd(t,e){return t===e||t!==t&&e!==e}var Jd=Xd,ep=9007199254740991;function tp(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ep}var ip=tp;var zg=Object.prototype;var rp="[object Arguments]";function np(t){return vi(t)&&ze(t)==rp}var Tn=np,Rn=Object.prototype,op=Rn.hasOwnProperty,sp=Rn.propertyIsEnumerable,Bg=Tn(function(){return arguments}())?Tn:function(t){return vi(t)&&op.call(t,"callee")&&!sp.call(t,"callee")};var $n=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Sn=$n&&typeof module=="object"&&module&&!module.nodeType&&module,ap=Sn&&Sn.exports===$n,En=ap?B.Buffer:void 0,Kg=En?En.isBuffer:void 0;var lp="[object Arguments]",up="[object Array]",cp="[object Boolean]",dp="[object Date]",pp="[object Error]",fp="[object Function]",hp="[object Map]",gp="[object Number]",mp="[object Object]",yp="[object RegExp]",bp="[object Set]",vp="[object String]",wp="[object WeakMap]",xp="[object ArrayBuffer]",Ip="[object DataView]",_p="[object Float32Array]",Tp="[object Float64Array]",Sp="[object Int8Array]",Ep="[object Int16Array]",Ap="[object Int32Array]",kp="[object Uint8Array]",Cp="[object Uint8ClampedArray]",Pp="[object Uint16Array]",Mp="[object Uint32Array]",S={};S[_p]=S[Tp]=S[Sp]=S[Ep]=S[Ap]=S[kp]=S[Cp]=S[Pp]=S[Mp]=!0;S[lp]=S[up]=S[xp]=S[cp]=S[Ip]=S[dp]=S[pp]=S[fp]=S[hp]=S[gp]=S[mp]=S[yp]=S[bp]=S[vp]=S[wp]=!1;function Op(t){return vi(t)&&ip(t.length)&&!!S[ze(t)]}var jp=Op;function Dp(t){return function(e){return t(e)}}var qp=Dp,Fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$e=Fn&&typeof module=="object"&&module&&!module.nodeType&&module,Up=$e&&$e.exports===Fn,fi=Up&&Un.process,Vp=function(){try{var t=$e&&$e.require&&$e.require("util").types;return t||fi&&fi.binding&&fi.binding("util")}catch{}}(),An=Vp,kn=An&&An.isTypedArray,Hg=kn?qp(kn):jp;var Lp=Object.prototype,Gg=Lp.hasOwnProperty;function Rp(t,e){return function(i){return t(e(i))}}var $p=Rp,Qg=$p(Object.keys,Object);var Fp=Object.prototype,Wg=Fp.hasOwnProperty;var Np=ve(Object,"create"),Fe=Np;function zp(){this.__data__=Fe?Fe(null):{},this.size=0}var Bp=zp;function Kp(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Hp=Kp,Gp="__lodash_hash_undefined__",Qp=Object.prototype,Wp=Qp.hasOwnProperty;function Yp(t){var e=this.__data__;if(Fe){var i=e[t];return i===Gp?void 0:i}return Wp.call(e,t)?e[t]:void 0}var Zp=Yp,Xp=Object.prototype,Jp=Xp.hasOwnProperty;function ef(t){var e=this.__data__;return Fe?e[t]!==void 0:Jp.call(e,t)}var tf=ef,rf="__lodash_hash_undefined__";function nf(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Fe&&e===void 0?rf:e,this}var of=nf;function we(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}we.prototype.clear=Bp;we.prototype.delete=Hp;we.prototype.get=Zp;we.prototype.has=tf;we.prototype.set=of;var Cn=we;function sf(){this.__data__=[],this.size=0}var af=sf;function lf(t,e){for(var i=t.length;i--;)if(Jd(t[i][0],e))return i;return-1}var yt=lf,uf=Array.prototype,cf=uf.splice;function df(t){var e=this.__data__,i=yt(e,t);if(i<0)return!1;var r=e.length-1;return i==r?e.pop():cf.call(e,i,1),--this.size,!0}var pf=df;function ff(t){var e=this.__data__,i=yt(e,t);return i<0?void 0:e[i][1]}var hf=ff;function gf(t){return yt(this.__data__,t)>-1}var mf=gf;function yf(t,e){var i=this.__data__,r=yt(i,t);return r<0?(++this.size,i.push([t,e])):i[r][1]=e,this}var bf=yf;function xe(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}xe.prototype.clear=af;xe.prototype.delete=pf;xe.prototype.get=hf;xe.prototype.has=mf;xe.prototype.set=bf;var bt=xe,vf=ve(B,"Map"),Ne=vf;function wf(){this.size=0,this.__data__={hash:new Cn,map:new(Ne||bt),string:new Cn}}var xf=wf;function If(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var _f=If;function Tf(t,e){var i=t.__data__;return _f(e)?i[typeof e=="string"?"string":"hash"]:i.map}var vt=Tf;function Sf(t){var e=vt(this,t).delete(t);return this.size-=e?1:0,e}var Ef=Sf;function Af(t){return vt(this,t).get(t)}var kf=Af;function Cf(t){return vt(this,t).has(t)}var Pf=Cf;function Mf(t,e){var i=vt(this,t),r=i.size;return i.set(t,e),this.size+=i.size==r?0:1,this}var Of=Mf;function Ie(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}Ie.prototype.clear=xf;Ie.prototype.delete=Ef;Ie.prototype.get=kf;Ie.prototype.has=Pf;Ie.prototype.set=Of;var Nn=Ie;function jf(){this.__data__=new bt,this.size=0}var Df=jf;function qf(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}var Uf=qf;function Vf(t){return this.__data__.get(t)}var Lf=Vf;function Rf(t){return this.__data__.has(t)}var $f=Rf,Ff=200;function Nf(t,e){var i=this.__data__;if(i instanceof bt){var r=i.__data__;if(!Ne||r.length<Ff-1)return r.push([t,e]),this.size=++i.size,this;i=this.__data__=new Nn(r)}return i.set(t,e),this.size=i.size,this}var zf=Nf;function Be(t){var e=this.__data__=new bt(t);this.size=e.size}Be.prototype.clear=Df;Be.prototype.delete=Uf;Be.prototype.get=Lf;Be.prototype.has=$f;Be.prototype.set=zf;var Bf=Object.prototype,Yg=Bf.propertyIsEnumerable;var Kf=ve(B,"DataView"),gi=Kf,Hf=ve(B,"Promise"),mi=Hf,Gf=ve(B,"Set"),yi=Gf,Pn="[object Map]",Qf="[object Object]",Mn="[object Promise]",On="[object Set]",jn="[object WeakMap]",Dn="[object DataView]",Wf=oe(gi),Yf=oe(Ne),Zf=oe(mi),Xf=oe(yi),Jf=oe(hi),ye=ze;(gi&&ye(new gi(new ArrayBuffer(1)))!=Dn||Ne&&ye(new Ne)!=Pn||mi&&ye(mi.resolve())!=Mn||yi&&ye(new yi)!=On||hi&&ye(new hi)!=jn)&&(ye=function(t){var e=ze(t),i=e==Qf?t.constructor:void 0,r=i?oe(i):"";if(r)switch(r){case Wf:return Dn;case Yf:return Pn;case Zf:return Mn;case Xf:return On;case Jf:return jn}return e});var Zg=B.Uint8Array;var eh="__lodash_hash_undefined__";function th(t){return this.__data__.set(t,eh),this}var ih=th;function rh(t){return this.__data__.has(t)}var nh=rh;function bi(t){var e=-1,i=t==null?0:t.length;for(this.__data__=new Nn;++e<i;)this.add(t[e])}bi.prototype.add=bi.prototype.push=ih;bi.prototype.has=nh;var qn=be?be.prototype:void 0,Xg=qn?qn.valueOf:void 0;var oh=Object.prototype,Jg=oh.hasOwnProperty;var sh=Object.prototype,em=sh.hasOwnProperty;var tm=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),im=new RegExp(/[A-Fa-f0-9]{1}/,"g"),rm=new RegExp(/[A-Fa-f0-9]{2}/,"g");async function zn(t,e){if(t.startsWith("buffer:")){let i=await e.editor.getMimeType(t),r=e.editor.getBufferLength(t),n=e.editor.getBufferData(t,0,r),o=new Uint8Array(n),s=new Blob([o],{type:i});return URL.createObjectURL(s)}else return t}async function J(t,e){let i=await zn(t,e);return new Promise((r,n)=>{let o=new Image;o.onload=()=>{r({width:o.width,height:o.height})},o.onerror=n,o.src=i})}async function Bn(t,e,i){let r,n=e.block.getFill(t),o=e.block.getSourceSet(n,"fill/image/sourceSet"),[s]=o;if(s==null){if(r=e.block.getString(n,"fill/image/imageFileURI"),r==null)throw new Error("No image source/uri found")}else r=s.uri;if(i?.throwErrorIfSvg&&await e.editor.getMimeType(r)==="image/svg+xml")throw new Error("SVG images are not supported");return zn(r,e)}var Kn={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},MinimaxVideo01LiveImageToVideoInput:{title:"ImageToVideoRequest",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},prompt_optimizer:{title:"Prompt Optimizer",type:"boolean",description:"Whether to use the model's prompt optimizer",default:!0},image_url:{title:"Image Url",type:"string",description:"URL of the image to use as the first frame"}},"x-fal-order-properties":["image_url","prompt"],required:["prompt","image_url"]},MinimaxVideo01LiveImageToVideoOutput:{title:"I2VLiveOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/minimax/video-01-live/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/video-01-live/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/minimax/video-01-live/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxVideo01LiveImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/video-01-live/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxVideo01LiveImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function Hn(t){return async({cesdk:e})=>{let i="fal-ai/minimax/video-01-live/image-to-video";return e.i18n.setTranslations({en:{[`panel.${C(i)}.imageSelection`]:"Select Image To Generate",[`panel.${i}.imageSelection`]:"Select Image To Generate",[`libraries.${C(i)}.history.label`]:"Generated From Image"}}),lh(e,t)}}function lh(t,e){return k({modelKey:"fal-ai/minimax/video-01-live/image-to-video",name:"Minimax Video 01 Live",schema:Kn,inputReference:"#/components/schemas/MinimaxVideo01LiveImageToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??e.middleware??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:()=>{throw new Error("This generation should not be triggered by this quick action")}}},getBlockInput:async i=>{let r=await J(i.image_url,t.engine);return Promise.resolve({video:{width:r.width??1280,height:r.height??720,duration:5}})}},e)}var Gn={openapi:"3.0.4",info:{title:"Queue OpenAPI for fal-ai/minimax/hailuo-02/standard/image-to-video",version:"1.0.0",description:"The OpenAPI schema for the fal-ai/minimax/hailuo-02/standard/image-to-video queue.","x-fal-metadata":{endpointId:"fal-ai/minimax/hailuo-02/standard/image-to-video",category:"image-to-video",thumbnailUrl:"https://storage.googleapis.com/fal_cdn/fal/Upscale.jpg",playgroundUrl:"https://fal.ai/models/fal-ai/minimax/hailuo-02/standard/image-to-video",documentationUrl:"https://fal.ai/models/fal-ai/minimax/hailuo-02/standard/image-to-video/api"}},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},MinimaxHailuo02StandardImageToVideoInput:{title:"StandardImageToVideoHailuo02Input",type:"object",properties:{prompt_optimizer:{title:"Prompt Optimizer",type:"boolean",description:"Whether to use the model's prompt optimizer",default:!0},duration:{enum:["6","10"],title:"Duration",type:"string",description:"The duration of the video in seconds. 10 seconds videos are not supported for 1080p resolution.",default:"6","x-imgly-builder":{component:"Select"}},prompt:{examples:["Man walked into winter cave with polar bear"],title:"Prompt",type:"string",maxLength:2e3,"x-imgly-builder":{component:"TextArea"}},resolution:{enum:["512P","768P"],title:"Resolution",type:"string",description:"The resolution of the generated video.",default:"768P","x-imgly-builder":{component:"Select"}},image_url:{examples:["https://storage.googleapis.com/falserverless/model_tests/minimax/1749891352437225630-389852416840474630_1749891352.png"],title:"Image Url",type:"string",description:"URL of the image to use as the first frame"}},"x-fal-order-properties":["image_url","prompt","duration","resolution"],required:["prompt","image_url"]},MinimaxHailuo02StandardImageToVideoOutput:{title:"ImageToVideoHailuo02Output",type:"object",properties:{video:{examples:[{url:"https://v3.fal.media/files/monkey/xF9OsLwGjjNURyAxD8RM1_output.mp4"}],title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{examples:[4404019],title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{examples:["z9RV14K95DvU.png"],title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{examples:["image/png"],title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/minimax/hailuo-02/standard/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/hailuo-02/standard/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/minimax/hailuo-02/standard/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxHailuo02StandardImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/hailuo-02/standard/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxHailuo02StandardImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function Qn(t){return async({cesdk:e})=>{let i="fal-ai/minimax/hailuo-02/standard/image-to-video";return e.i18n.setTranslations({en:{[`panel.${C(i)}.imageSelection`]:"Select Image To Generate",[`panel.${i}.imageSelection`]:"Select Image To Generate",[`libraries.${C(i)}.history.label`]:"Generated From Image"}}),ch(e,t)}}function ch(t,e){return k({modelKey:"fal-ai/minimax/hailuo-02/standard/image-to-video",name:"Minimax Hailuo 02 Standard",schema:Gn,inputReference:"#/components/schemas/MinimaxHailuo02StandardImageToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:()=>{throw new Error("This generation should not be triggered by this quick action")}}},getBlockInput:async i=>{let r=await J(i.image_url,t.engine),n=i.duration==="10"?10:6,o=i.resolution==="512P"?912:1280,s=i.resolution==="512P"?512:720;return Promise.resolve({video:{width:r.width??o,height:r.height??s,duration:n}})}},e)}var Wn={openapi:"3.0.4",info:{title:"Queue OpenAPI for fal-ai/kling-video/v2.1/master/image-to-video",version:"1.0.0",description:"Automatically generated schema for Kling 2.1 Master \u2013 Image to Video model"},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},KlingVideoV21MasterImageToVideoInput:{title:"ImageToVideoV21MasterRequest",type:"object",properties:{prompt:{maxLength:2500,type:"string",title:"Prompt","x-imgly-builder":{component:"TextArea"}},duration:{enum:["5","10"],title:"Duration",type:"string",description:"The duration of the generated video in seconds",default:"5"},cfg_scale:{minimum:0,maximum:1,type:"number",title:"Cfg Scale",description:`
66
+ `;var Xi={ImageUrl:jo,StyleTransfer:Bl};var In=qo(Tn());function ve(t,e){return(0,In.createFalClient)({proxyUrl:t,requestMiddleware:async r=>({...r,headers:{...r.headers,...e??{}}})})}function Ic(t,e){let i=t.middleware??e.middlewares??e.middleware??[],r=null,n={id:t.modelKey,name:t.name??t.modelKey,kind:"video",initialize:async o=>{r=ve(e.proxyUrl,t.headers),t.initialize?.(o)},input:{quickActions:{supported:me(t.supportedQuickActions??{},e.supportedQuickActions)},panel:{type:"schema",document:t.schema,inputReference:t.inputReference,includeHistoryLibrary:!0,orderExtensionKeyword:"x-fal-order-properties",renderCustomProperty:{...t.cesdk!=null?Xi.ImageUrl(t.modelKey,{cesdk:t.cesdk}):{},...t.renderCustomProperty},getBlockInput:t.getBlockInput,userFlow:t.useFlow??"placeholder"}},output:{abortable:!0,history:e.history??"@imgly/indexedDB",middleware:i,generate:async(o,{abortSignal:s})=>{if(!r)throw new Error("Provider not initialized");let a=await H(r,o.image_url,t.cesdk),u=await r.subscribe(t.modelKey,{abortSignal:s,input:a!=null?{...o,image_url:a}:o,logs:!0}),d=u?.data?.video;if(d!=null){let l=d?.url;if(l!=null)return{kind:"video",url:l}}throw console.error("Cannot extract generated video from response:",u),new Error("Cannot find generated video")},generationHintText:"ly.img.ai.video.generation.hint"}};return e.debug&&console.log("Created Provider:",n),n}var S=Ic;function Sn(t){return async({cesdk:e})=>Sc(e,t)}function Sc(t,e){return S({modelKey:"fal-ai/minimax/video-01-live",name:"Minimax Video 01 Live",schema:ki,inputReference:"#/components/schemas/MinimaxVideo01LiveInput",headers:e.headers,middleware:e.middlewares??e.middleware??[],cesdk:t,getBlockInput:()=>Promise.resolve({video:{width:1280,height:720,duration:5}})},e)}var Ec=typeof global=="object"&&global&&global.Object===Object&&global,Ln=Ec,Ac=typeof self=="object"&&self&&self.Object===Object&&self,Cc=Ln||Ac||Function("return this")(),K=Cc,kc=K.Symbol,_e=kc,$n=Object.prototype,Pc=$n.hasOwnProperty,qc=$n.toString,Ne=_e?_e.toStringTag:void 0;function Vc(t){var e=Pc.call(t,Ne),i=t[Ne];try{t[Ne]=void 0;var r=!0}catch{}var n=qc.call(t);return r&&(e?t[Ne]=i:delete t[Ne]),n}var Mc=Vc,Dc=Object.prototype,jc=Dc.toString;function Fc(t){return jc.call(t)}var Oc=Fc,Rc="[object Null]",Uc="[object Undefined]",En=_e?_e.toStringTag:void 0;function Lc(t){return t==null?t===void 0?Uc:Rc:En&&En in Object(t)?Mc(t):Oc(t)}var He=Lc;function $c(t){return t!=null&&typeof t=="object"}var xi=$c,bh=Array.isArray;function Nc(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Nn=Nc,zc="[object AsyncFunction]",Bc="[object Function]",Kc="[object GeneratorFunction]",Hc="[object Proxy]";function Gc(t){if(!Nn(t))return!1;var e=He(t);return e==Bc||e==Kc||e==zc||e==Hc}var Qc=Gc,Wc=K["__core-js_shared__"],gi=Wc,An=function(){var t=/[^.]+$/.exec(gi&&gi.keys&&gi.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Yc(t){return!!An&&An in t}var Zc=Yc,Xc=Function.prototype,Jc=Xc.toString;function ep(t){if(t!=null){try{return Jc.call(t)}catch{}try{return t+""}catch{}}return""}var se=ep,tp=/[\\^$.*+?()[\]{}|]/g,ip=/^\[object .+?Constructor\]$/,rp=Function.prototype,np=Object.prototype,op=rp.toString,sp=np.hasOwnProperty,ap=RegExp("^"+op.call(sp).replace(tp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lp(t){if(!Nn(t)||Zc(t))return!1;var e=Qc(t)?ap:ip;return e.test(se(t))}var up=lp;function dp(t,e){return t?.[e]}var cp=dp;function pp(t,e){var i=cp(t,e);return up(i)?i:void 0}var xe=pp,mp=xe(K,"WeakMap"),yi=mp;function fp(t,e){return t===e||t!==t&&e!==e}var gp=fp,hp=9007199254740991;function yp(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=hp}var bp=yp;var vh=Object.prototype;var vp="[object Arguments]";function wp(t){return xi(t)&&He(t)==vp}var Cn=wp,zn=Object.prototype,_p=zn.hasOwnProperty,xp=zn.propertyIsEnumerable,wh=Cn(function(){return arguments}())?Cn:function(t){return xi(t)&&_p.call(t,"callee")&&!xp.call(t,"callee")};var Bn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kn=Bn&&typeof module=="object"&&module&&!module.nodeType&&module,Tp=kn&&kn.exports===Bn,Pn=Tp?K.Buffer:void 0,_h=Pn?Pn.isBuffer:void 0;var Ip="[object Arguments]",Sp="[object Array]",Ep="[object Boolean]",Ap="[object Date]",Cp="[object Error]",kp="[object Function]",Pp="[object Map]",qp="[object Number]",Vp="[object Object]",Mp="[object RegExp]",Dp="[object Set]",jp="[object String]",Fp="[object WeakMap]",Op="[object ArrayBuffer]",Rp="[object DataView]",Up="[object Float32Array]",Lp="[object Float64Array]",$p="[object Int8Array]",Np="[object Int16Array]",zp="[object Int32Array]",Bp="[object Uint8Array]",Kp="[object Uint8ClampedArray]",Hp="[object Uint16Array]",Gp="[object Uint32Array]",A={};A[Up]=A[Lp]=A[$p]=A[Np]=A[zp]=A[Bp]=A[Kp]=A[Hp]=A[Gp]=!0;A[Ip]=A[Sp]=A[Op]=A[Ep]=A[Rp]=A[Ap]=A[Cp]=A[kp]=A[Pp]=A[qp]=A[Vp]=A[Mp]=A[Dp]=A[jp]=A[Fp]=!1;function Qp(t){return xi(t)&&bp(t.length)&&!!A[He(t)]}var Wp=Qp;function Yp(t){return function(e){return t(e)}}var Zp=Yp,Kn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ze=Kn&&typeof module=="object"&&module&&!module.nodeType&&module,Xp=ze&&ze.exports===Kn,hi=Xp&&Ln.process,Jp=function(){try{var t=ze&&ze.require&&ze.require("util").types;return t||hi&&hi.binding&&hi.binding("util")}catch{}}(),qn=Jp,Vn=qn&&qn.isTypedArray,xh=Vn?Zp(Vn):Wp;var em=Object.prototype,Th=em.hasOwnProperty;function tm(t,e){return function(i){return t(e(i))}}var im=tm,Ih=im(Object.keys,Object);var rm=Object.prototype,Sh=rm.hasOwnProperty;var nm=xe(Object,"create"),Be=nm;function om(){this.__data__=Be?Be(null):{},this.size=0}var sm=om;function am(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var lm=am,um="__lodash_hash_undefined__",dm=Object.prototype,cm=dm.hasOwnProperty;function pm(t){var e=this.__data__;if(Be){var i=e[t];return i===um?void 0:i}return cm.call(e,t)?e[t]:void 0}var mm=pm,fm=Object.prototype,gm=fm.hasOwnProperty;function hm(t){var e=this.__data__;return Be?e[t]!==void 0:gm.call(e,t)}var ym=hm,bm="__lodash_hash_undefined__";function vm(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Be&&e===void 0?bm:e,this}var wm=vm;function Te(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}Te.prototype.clear=sm;Te.prototype.delete=lm;Te.prototype.get=mm;Te.prototype.has=ym;Te.prototype.set=wm;var Mn=Te;function _m(){this.__data__=[],this.size=0}var xm=_m;function Tm(t,e){for(var i=t.length;i--;)if(gp(t[i][0],e))return i;return-1}var wt=Tm,Im=Array.prototype,Sm=Im.splice;function Em(t){var e=this.__data__,i=wt(e,t);if(i<0)return!1;var r=e.length-1;return i==r?e.pop():Sm.call(e,i,1),--this.size,!0}var Am=Em;function Cm(t){var e=this.__data__,i=wt(e,t);return i<0?void 0:e[i][1]}var km=Cm;function Pm(t){return wt(this.__data__,t)>-1}var qm=Pm;function Vm(t,e){var i=this.__data__,r=wt(i,t);return r<0?(++this.size,i.push([t,e])):i[r][1]=e,this}var Mm=Vm;function Ie(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}Ie.prototype.clear=xm;Ie.prototype.delete=Am;Ie.prototype.get=km;Ie.prototype.has=qm;Ie.prototype.set=Mm;var _t=Ie,Dm=xe(K,"Map"),Ke=Dm;function jm(){this.size=0,this.__data__={hash:new Mn,map:new(Ke||_t),string:new Mn}}var Fm=jm;function Om(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Rm=Om;function Um(t,e){var i=t.__data__;return Rm(e)?i[typeof e=="string"?"string":"hash"]:i.map}var xt=Um;function Lm(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e}var $m=Lm;function Nm(t){return xt(this,t).get(t)}var zm=Nm;function Bm(t){return xt(this,t).has(t)}var Km=Bm;function Hm(t,e){var i=xt(this,t),r=i.size;return i.set(t,e),this.size+=i.size==r?0:1,this}var Gm=Hm;function Se(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}Se.prototype.clear=Fm;Se.prototype.delete=$m;Se.prototype.get=zm;Se.prototype.has=Km;Se.prototype.set=Gm;var Hn=Se;function Qm(){this.__data__=new _t,this.size=0}var Wm=Qm;function Ym(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}var Zm=Ym;function Xm(t){return this.__data__.get(t)}var Jm=Xm;function ef(t){return this.__data__.has(t)}var tf=ef,rf=200;function nf(t,e){var i=this.__data__;if(i instanceof _t){var r=i.__data__;if(!Ke||r.length<rf-1)return r.push([t,e]),this.size=++i.size,this;i=this.__data__=new Hn(r)}return i.set(t,e),this.size=i.size,this}var of=nf;function Ge(t){var e=this.__data__=new _t(t);this.size=e.size}Ge.prototype.clear=Wm;Ge.prototype.delete=Zm;Ge.prototype.get=Jm;Ge.prototype.has=tf;Ge.prototype.set=of;var sf=Object.prototype,Eh=sf.propertyIsEnumerable;var af=xe(K,"DataView"),bi=af,lf=xe(K,"Promise"),vi=lf,uf=xe(K,"Set"),wi=uf,Dn="[object Map]",df="[object Object]",jn="[object Promise]",Fn="[object Set]",On="[object WeakMap]",Rn="[object DataView]",cf=se(bi),pf=se(Ke),mf=se(vi),ff=se(wi),gf=se(yi),we=He;(bi&&we(new bi(new ArrayBuffer(1)))!=Rn||Ke&&we(new Ke)!=Dn||vi&&we(vi.resolve())!=jn||wi&&we(new wi)!=Fn||yi&&we(new yi)!=On)&&(we=function(t){var e=He(t),i=e==df?t.constructor:void 0,r=i?se(i):"";if(r)switch(r){case cf:return Rn;case pf:return Dn;case mf:return jn;case ff:return Fn;case gf:return On}return e});var Ah=K.Uint8Array;var hf="__lodash_hash_undefined__";function yf(t){return this.__data__.set(t,hf),this}var bf=yf;function vf(t){return this.__data__.has(t)}var wf=vf;function _i(t){var e=-1,i=t==null?0:t.length;for(this.__data__=new Hn;++e<i;)this.add(t[e])}_i.prototype.add=_i.prototype.push=bf;_i.prototype.has=wf;var Un=_e?_e.prototype:void 0,Ch=Un?Un.valueOf:void 0;var _f=Object.prototype,kh=_f.hasOwnProperty;var xf=Object.prototype,Ph=xf.hasOwnProperty;var qh=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),Vh=new RegExp(/[A-Fa-f0-9]{1}/,"g"),Mh=new RegExp(/[A-Fa-f0-9]{2}/,"g");async function Gn(t,e){if(t.startsWith("buffer:")){let i=await e.editor.getMimeType(t),r=e.editor.getBufferLength(t),n=e.editor.getBufferData(t,0,r),o=new Uint8Array(n),s=new Blob([o],{type:i});return URL.createObjectURL(s)}else return t}async function D(t,e){let i=await Gn(t,e);return new Promise((r,n)=>{let o=new Image;o.onload=()=>{r({width:o.width,height:o.height})},o.onerror=n,o.src=i})}async function Qn(t,e,i){let r,n=e.block.getFill(t),o=e.block.getSourceSet(n,"fill/image/sourceSet"),[s]=o;if(s==null){if(r=e.block.getString(n,"fill/image/imageFileURI"),r==null)throw new Error("No image source/uri found")}else r=s.uri;if(i?.throwErrorIfSvg&&await e.editor.getMimeType(r)==="image/svg+xml")throw new Error("SVG images are not supported");return Gn(r,e)}var Wn={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},MinimaxVideo01LiveImageToVideoInput:{title:"ImageToVideoRequest",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},prompt_optimizer:{title:"Prompt Optimizer",type:"boolean",description:"Whether to use the model's prompt optimizer",default:!0},image_url:{title:"Image Url",type:"string",description:"URL of the image to use as the first frame"}},"x-fal-order-properties":["image_url","prompt"],required:["prompt","image_url"]},MinimaxVideo01LiveImageToVideoOutput:{title:"I2VLiveOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/minimax/video-01-live/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/video-01-live/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/minimax/video-01-live/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxVideo01LiveImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/video-01-live/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxVideo01LiveImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function Yn(t){return async({cesdk:e})=>{let i="fal-ai/minimax/video-01-live/image-to-video";return e.i18n.setTranslations({en:{[`panel.${_(i)}.imageSelection`]:"Select Image To Generate",[`panel.${i}.imageSelection`]:"Select Image To Generate",[`libraries.${_(i)}.history.label`]:"Generated From Image"}}),If(e,t)}}function If(t,e){return S({modelKey:"fal-ai/minimax/video-01-live/image-to-video",name:"Minimax Video 01 Live",schema:Wn,inputReference:"#/components/schemas/MinimaxVideo01LiveImageToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??e.middleware??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:()=>{throw new Error("This generation should not be triggered by this quick action")}}},getBlockInput:async i=>{let r=await D(i.image_url,t.engine);return Promise.resolve({video:{width:r.width??1280,height:r.height??720,duration:5}})}},e)}var Zn={openapi:"3.0.4",info:{title:"Queue OpenAPI for fal-ai/minimax/hailuo-02/standard/image-to-video",version:"1.0.0",description:"The OpenAPI schema for the fal-ai/minimax/hailuo-02/standard/image-to-video queue.","x-fal-metadata":{endpointId:"fal-ai/minimax/hailuo-02/standard/image-to-video",category:"image-to-video",thumbnailUrl:"https://storage.googleapis.com/fal_cdn/fal/Upscale.jpg",playgroundUrl:"https://fal.ai/models/fal-ai/minimax/hailuo-02/standard/image-to-video",documentationUrl:"https://fal.ai/models/fal-ai/minimax/hailuo-02/standard/image-to-video/api"}},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},MinimaxHailuo02StandardImageToVideoInput:{title:"StandardImageToVideoHailuo02Input",type:"object",properties:{prompt_optimizer:{title:"Prompt Optimizer",type:"boolean",description:"Whether to use the model's prompt optimizer",default:!0},duration:{enum:["6","10"],title:"Duration",type:"string",description:"The duration of the video in seconds. 10 seconds videos are not supported for 1080p resolution.",default:"6","x-imgly-builder":{component:"Select"}},prompt:{examples:["Man walked into winter cave with polar bear"],title:"Prompt",type:"string",maxLength:2e3,"x-imgly-builder":{component:"TextArea"}},resolution:{enum:["512P","768P"],title:"Resolution",type:"string",description:"The resolution of the generated video.",default:"768P","x-imgly-builder":{component:"Select"}},image_url:{examples:["https://storage.googleapis.com/falserverless/model_tests/minimax/1749891352437225630-389852416840474630_1749891352.png"],title:"Image Url",type:"string",description:"URL of the image to use as the first frame"}},"x-fal-order-properties":["image_url","prompt","duration","resolution"],required:["prompt","image_url"]},MinimaxHailuo02StandardImageToVideoOutput:{title:"ImageToVideoHailuo02Output",type:"object",properties:{video:{examples:[{url:"https://v3.fal.media/files/monkey/xF9OsLwGjjNURyAxD8RM1_output.mp4"}],title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{examples:[4404019],title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{examples:["z9RV14K95DvU.png"],title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{examples:["image/png"],title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/minimax/hailuo-02/standard/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/hailuo-02/standard/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/minimax/hailuo-02/standard/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxHailuo02StandardImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/minimax/hailuo-02/standard/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/MinimaxHailuo02StandardImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function Xn(t){return async({cesdk:e})=>{let i="fal-ai/minimax/hailuo-02/standard/image-to-video";return e.i18n.setTranslations({en:{[`panel.${_(i)}.imageSelection`]:"Select Image To Generate",[`panel.${i}.imageSelection`]:"Select Image To Generate",[`libraries.${_(i)}.history.label`]:"Generated From Image"}}),Ef(e,t)}}function Ef(t,e){return S({modelKey:"fal-ai/minimax/hailuo-02/standard/image-to-video",name:"Minimax Hailuo 02 Standard",schema:Zn,inputReference:"#/components/schemas/MinimaxHailuo02StandardImageToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:()=>{throw new Error("This generation should not be triggered by this quick action")}}},getBlockInput:async i=>{let r=await D(i.image_url,t.engine),n=i.duration==="10"?10:6,o=i.resolution==="512P"?912:1280,s=i.resolution==="512P"?512:720;return Promise.resolve({video:{width:r.width??o,height:r.height??s,duration:n}})}},e)}var Jn={openapi:"3.0.4",info:{title:"Queue OpenAPI for fal-ai/kling-video/v2.1/master/image-to-video",version:"1.0.0",description:"Automatically generated schema for Kling 2.1 Master \u2013 Image to Video model"},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},KlingVideoV21MasterImageToVideoInput:{title:"ImageToVideoV21MasterRequest",type:"object",properties:{prompt:{maxLength:2500,type:"string",title:"Prompt","x-imgly-builder":{component:"TextArea"}},duration:{enum:["5","10"],title:"Duration",type:"string",description:"The duration of the generated video in seconds",default:"5"},cfg_scale:{minimum:0,maximum:1,type:"number",title:"Cfg Scale",description:`
67
67
  The CFG (Classifier Free Guidance) scale is a measure of how close you want
68
68
  the model to stick to your prompt.
69
- `,default:.5},negative_prompt:{maxLength:2500,type:"string",title:"Negative Prompt",default:"blur, distort, and low quality"},image_url:{format:"uri",description:"URL of the image to be used for the video",type:"string",examples:["https://v3.fal.media/files/rabbit/NEvlE6DqEks4afmShK9tY_image.webp"],maxLength:2083,minLength:1,title:"Image Url"}},"x-fal-order-properties":["image_url","prompt","duration"],required:["prompt","image_url"]},KlingVideoV21MasterImageToVideoOutput:{title:"ImageToVideoV21MasterOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/kling-video/v2.1/master/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/kling-video/v2.1/master/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/kling-video/v2.1/master/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/KlingVideoV21MasterImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/kling-video/v2.1/master/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/KlingVideoV21MasterImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function Yn(t){return async({cesdk:e})=>{let i="fal-ai/kling-video/v2.1/master/image-to-video";return e.i18n.setTranslations({en:{"ly.img.ai.quickAction.createVideoKling":"Create Video (Kling)...",[`panel.${C(i)}.imageSelection`]:"Select Image To Generate",[`panel.${i}.imageSelection`]:"Select Image To Generate",[`libraries.${C(i)}.history.label`]:"Generated From Image"}}),ph(e,t)}}function ph(t,e){return k({modelKey:"fal-ai/kling-video/v2.1/master/image-to-video",name:"Kling Video V2.1 Master",schema:Wn,inputReference:"#/components/schemas/KlingVideoV21MasterImageToVideoInput",cesdk:t,headers:e.headers,middlewares:e.middlewares,supportedQuickActions:{createVideoKling:{mapInput:async i=>{let[r]=t.engine.block.findAllSelected(),n=await Bn(r,t.engine,{throwErrorIfSvg:!0});return t.ui.openPanel("ly.img.ai/video-generation"),t.ui.experimental.setGlobalStateValue("ly.img.ai.video-generation.fromType","fromImage"),t.ui.experimental.setGlobalStateValue("fal-ai/kling-video/v2.1/master/image-to-video.image_url",n),{prompt:i.prompt,image_url:n,duration:i.duration,negative_prompt:i.negative_prompt,cfg_scale:i.cfg_scale}}}},getBlockInput:async i=>{let r=await J(i.image_url,t.engine);return Promise.resolve({video:{width:r.width??1280,height:r.height??720,duration:parseInt(i.duration??"5",10)}})}},e)}var Zn={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},PixverseV35TextToVideoInput:{title:"TextToVideoRequest",type:"object",properties:{prompt:{maxLength:2048,type:"string",title:"Prompt","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{enum:["16:9","4:3","1:1","3:4","9:16"],title:"Aspect Ratio",type:"string",description:"The aspect ratio of the generated video",default:"16:9"},resolution:{enum:["360p","540p","720p","1080p"],title:"Resolution",type:"string",description:"The resolution of the generated video",default:"720p"},style:{enum:["anime","3d_animation","clay","comic","cyberpunk"],title:"Style",type:"string",description:"The style of the generated video"},duration:{enum:["5","8"],title:"Duration",type:"string",description:"The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds",default:5},seed:{title:"Seed",type:"integer",description:`
69
+ `,default:.5},negative_prompt:{maxLength:2500,type:"string",title:"Negative Prompt",default:"blur, distort, and low quality"},image_url:{format:"uri",description:"URL of the image to be used for the video",type:"string",examples:["https://v3.fal.media/files/rabbit/NEvlE6DqEks4afmShK9tY_image.webp"],maxLength:2083,minLength:1,title:"Image Url"}},"x-fal-order-properties":["image_url","prompt","duration"],required:["prompt","image_url"]},KlingVideoV21MasterImageToVideoOutput:{title:"ImageToVideoV21MasterOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/kling-video/v2.1/master/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/kling-video/v2.1/master/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/kling-video/v2.1/master/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/KlingVideoV21MasterImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/kling-video/v2.1/master/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/KlingVideoV21MasterImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function eo(t){return async({cesdk:e})=>{let i="fal-ai/kling-video/v2.1/master/image-to-video";return e.i18n.setTranslations({en:{"ly.img.ai.quickAction.createVideoKling":"Create Video (Kling)...",[`panel.${_(i)}.imageSelection`]:"Select Image To Generate",[`panel.${i}.imageSelection`]:"Select Image To Generate",[`libraries.${_(i)}.history.label`]:"Generated From Image"}}),Cf(e,t)}}function Cf(t,e){return S({modelKey:"fal-ai/kling-video/v2.1/master/image-to-video",name:"Kling Video V2.1 Master",schema:Jn,inputReference:"#/components/schemas/KlingVideoV21MasterImageToVideoInput",cesdk:t,headers:e.headers,middlewares:e.middlewares,supportedQuickActions:{createVideoKling:{mapInput:async i=>{let[r]=t.engine.block.findAllSelected(),n=await Qn(r,t.engine,{throwErrorIfSvg:!0});return t.ui.openPanel("ly.img.ai/video-generation"),t.ui.experimental.setGlobalStateValue("ly.img.ai.video-generation.fromType","fromImage"),t.ui.experimental.setGlobalStateValue("fal-ai/kling-video/v2.1/master/image-to-video.image_url",n),{prompt:i.prompt,image_url:n,duration:i.duration,negative_prompt:i.negative_prompt,cfg_scale:i.cfg_scale}}}},getBlockInput:async i=>{let r=await D(i.image_url,t.engine);return Promise.resolve({video:{width:r.width??1280,height:r.height??720,duration:parseInt(i.duration??"5",10)}})}},e)}var to={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},PixverseV35TextToVideoInput:{title:"TextToVideoRequest",type:"object",properties:{prompt:{maxLength:2048,type:"string",title:"Prompt","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{enum:["16:9","4:3","1:1","3:4","9:16"],title:"Aspect Ratio",type:"string",description:"The aspect ratio of the generated video",default:"16:9"},resolution:{enum:["360p","540p","720p","1080p"],title:"Resolution",type:"string",description:"The resolution of the generated video",default:"720p"},style:{enum:["anime","3d_animation","clay","comic","cyberpunk"],title:"Style",type:"string",description:"The style of the generated video"},duration:{enum:["5","8"],title:"Duration",type:"string",description:"The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds",default:5},seed:{title:"Seed",type:"integer",description:`
70
70
  The same seed and the same prompt given to the same version of the model
71
71
  will output the same video every time.
72
- `},negative_prompt:{maxLength:2048,type:"string",title:"Negative Prompt",description:"Negative prompt to be used for the generation",default:""}},"x-fal-order-properties":["prompt","aspect_ratio","resolution","style","duration"],required:["prompt"]},PixverseV35TextToVideoOutput:{title:"VideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/pixverse/v3.5/text-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/pixverse/v3.5/text-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/pixverse/v3.5/text-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/PixverseV35TextToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/pixverse/v3.5/text-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/PixverseV35TextToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function Xn(t){return async({cesdk:e})=>(e.i18n.setTranslations({en:{[`libraries.${C("fal-ai/pixverse/v3.5/text-to-video")}.history.label`]:"Generated From Text"}}),hh(e,t))}function hh(t,e){return k({modelKey:"fal-ai/pixverse/v3.5/text-to-video",name:"Pixverse V3.5",schema:Zn,inputReference:"#/components/schemas/PixverseV35TextToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??e.middleware??[],getBlockInput:i=>{if(i.aspect_ratio!=null&&i.resolution!=null){let[r,n]=i.aspect_ratio.split(":").map(Number),o=parseInt(i.resolution,10),s=Math.round(o*r/n);if(i.duration!=null){let a=typeof i.duration=="string"?parseInt(i.duration,10):i.duration;return Promise.resolve({video:{width:s,height:o,duration:a}})}throw new Error("Cannot determine video duration")}else throw new Error("Cannot determine video dimensions \u2013 aspect ratio and resolution must be set")}},e)}var Jn={openapi:"3.0.4",info:{title:"Queue OpenAPI for fal-ai/kling-video/v2.1/master/text-to-video",version:"1.0.0",description:"Automatically generated schema for Kling 2.1 Master \u2013 Text to Video model"},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},KlingVideoV21MasterTextToVideoInput:{title:"TextToVideoV21MasterRequest",type:"object",properties:{prompt:{type:"string",maxLength:2500,title:"Prompt","x-imgly-builder":{component:"TextArea"}},duration:{type:"string",enum:["5","10"],title:"Duration",description:"The duration of the generated video in seconds",default:"5"},aspect_ratio:{type:"string",enum:["16:9","9:16","1:1"],title:"Aspect Ratio",description:"The aspect ratio of the generated video frame",default:"16:9"},negative_prompt:{type:"string",maxLength:2500,title:"Negative Prompt",default:"blur, distort, and low quality"},cfg_scale:{type:"number",minimum:0,maximum:1,title:"Cfg Scale",description:"The CFG scale determines adherence to the prompt",default:.5}},"x-fal-order-properties":["prompt","duration","aspect_ratio"],required:["prompt"]},KlingVideoV21MasterTextToVideoOutput:{title:"TextToVideoV21MasterOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{type:"integer",title:"File Size",description:"The size of the file in bytes."},file_name:{type:"string",title:"File Name",description:"The name of the file."},content_type:{type:"string",title:"Content Type",description:"The mime type of the file."},url:{type:"string",title:"Url",description:"The URL where the file can be downloaded from."},file_data:{type:"string",format:"binary",title:"File Data",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function eo(t){return async({cesdk:e})=>mh(e,t)}function mh(t,e){return k({modelKey:"fal-ai/kling-video/v2.1/master/text-to-video",name:"Kling Video V2.1 Master",schema:Jn,inputReference:"#/components/schemas/KlingVideoV21MasterTextToVideoInput",cesdk:t,headers:e.headers,middleware:e.middleware,getBlockInput:i=>{let r=i.aspect_ratio??"16:9",[n,o]=r.split(":").map(Number),s=720,a=Math.round(s*n/o),c=i.duration!=null?parseInt(i.duration,10):5;return Promise.resolve({video:{width:a,height:s,duration:c}})}},e)}var to={openapi:"3.0.4",info:{title:"Queue OpenAPI for fal-ai/veo3",version:"1.0.0",description:"","x-fal-metadata":{endpointId:"fal-ai/veo3",category:"text-to-video",thumbnailUrl:"https://storage.googleapis.com/fal_cdn/fal/Sound-2.jpg",playgroundUrl:"https://fal.ai/models/fal-ai/veo3",documentationUrl:"https://fal.ai/models/fal-ai/veo3/api"}},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},Veo3Input:{title:"TextToVideoPreviewInput",type:"object",properties:{prompt:{examples:["A casual street interview on a busy New York City sidewalk in the afternoon. The interviewer holds a plain, unbranded microphone and asks: Have you seen Google's new Veo3 model It is a super good model. Person replies: Yeah I saw it, it's already available on fal. It's crazy good."],title:"Prompt",type:"string",minLength:1,description:"The text prompt describing the video you want to generate","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{enum:["16:9","9:16","1:1"],title:"Aspect Ratio",type:"string",description:"The aspect ratio of the generated video",default:"16:9","x-imgly-builder":{component:"Select"}},duration:{enum:["8s"],title:"Duration",type:"string",description:"The duration of the generated video in seconds",default:"8s","x-imgly-builder":{component:"Select"}},generate_audio:{title:"Generate Audio",type:"boolean",description:"Whether to generate audio for the video. If false, %33 less credits will be used.",default:!0,"x-imgly-builder":{component:"Switch"}}},"x-fal-order-properties":["prompt","aspect_ratio","duration","negative_prompt","enhance_prompt","seed","generate_audio"],required:["prompt"]},Veo3Output:{title:"TextToVideoPreviewOutput",type:"object",properties:{video:{examples:[{url:"https://v3.fal.media/files/penguin/Q-2dpcjIoQOldJRL3grsc_output.mp4"}],title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{examples:[4404019],title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{examples:["z9RV14K95DvU.png"],title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{examples:["image/png"],title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/veo3/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/veo3":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Veo3Input"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/Veo3Output"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function io(t){return async({cesdk:e})=>{let i="fal-ai/veo3";return e.i18n.setTranslations({en:{[`panel.${C(i)}.prompt`]:"Enter your prompt",[`panel.${i}.prompt`]:"Enter your prompt",[`libraries.${C(i)}.history.label`]:"Generated Videos"}}),bh(e,t)}}function bh(t,e){return k({modelKey:"fal-ai/veo3",name:"Veo3",schema:to,inputReference:"#/components/schemas/Veo3Input",cesdk:t,headers:e.headers,middlewares:e.middlewares,getBlockInput:i=>{if(i.aspect_ratio!=null){let[r,n]=i.aspect_ratio.split(":").map(Number),o=720,s=Math.round(o*r/n);return Promise.resolve({video:{width:s,height:o,duration:8}})}else return Promise.resolve({video:{width:1280,height:720,duration:8}})}},e)}var ro={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},ByteDanceSeedanceV1ProImageToVideoInput:{title:"SeedanceImageToVideoRequest",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for the video generation","x-imgly-builder":{component:"TextArea"}},image_url:{title:"Image Url",type:"string",description:"URL of the image to use as the first frame"},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["21:9","16:9","4:3","1:1","3:4","9:16","auto"],default:"auto",description:"Aspect ratio for the generated video","x-imgly-enum-labels":{"21:9":"21:9 (Ultra Wide)","16:9":"16:9 (Landscape)","4:3":"4:3 (Standard)","1:1":"1:1 (Square)","3:4":"3:4 (Portrait)","9:16":"9:16 (Vertical)",auto:"Auto (From Image)"}},duration:{title:"Duration",type:"integer",minimum:3,maximum:12,default:5,description:"Duration of the generated video in seconds"}},"x-fal-order-properties":["image_url","prompt","aspect_ratio","duration"],required:["prompt","image_url"]},ByteDanceSeedanceV1ProImageToVideoOutput:{title:"SeedanceImageToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]},seed:{title:"Seed",type:"integer",description:"The seed used for generation"}},"x-fal-order-properties":["video","seed"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/bytedance/seedance/v1/pro/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ByteDanceSeedanceV1ProImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/ByteDanceSeedanceV1ProImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function no(t){return async({cesdk:e})=>{let i="fal-ai/bytedance/seedance/v1/pro/image-to-video";return e.i18n.setTranslations({en:{[`panel.${C(i)}.imageSelection`]:"Select Image To Generate",[`panel.${i}.imageSelection`]:"Select Image To Generate",[`libraries.${C(i)}.history.label`]:"Generated From Image"}}),wh(e,t)}}function wh(t,e){return k({modelKey:"fal-ai/bytedance/seedance/v1/pro/image-to-video",name:"ByteDance Seedance v1 Pro",schema:ro,inputReference:"#/components/schemas/ByteDanceSeedanceV1ProImageToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??e.middleware??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:()=>{throw new Error("This generation should not be triggered by this quick action")}}},getBlockInput:async i=>{let r,n,o={"480p":{height:480},"720p":{height:720},"1080p":{height:1080}},s=i.resolution??"1080p",a=o[s].height;if(i.aspect_ratio&&i.aspect_ratio!=="auto"){let[c,u]=i.aspect_ratio.split(":").map(Number);n=a,r=Math.round(n*c/u)}else{let c=await J(i.image_url,t.engine),u=c.width??1920,l=c.height??1080,d=u/l;n=a,r=Math.round(n*d)}return Promise.resolve({video:{width:r,height:n,duration:i.duration??5}})}},e)}var oo={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},ByteDanceSeedanceV1ProTextToVideoInput:{title:"SeedanceTextToVideoRequest",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for the video generation","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["21:9","16:9","4:3","1:1","3:4","9:16"],default:"16:9",description:"Aspect ratio for the generated video","x-imgly-enum-labels":{"21:9":"21:9 (Ultra Wide)","16:9":"16:9 (Landscape)","4:3":"4:3 (Standard)","1:1":"1:1 (Square)","3:4":"3:4 (Portrait)","9:16":"9:16 (Vertical)"}},resolution:{title:"Resolution",type:"string",enum:["480p","720p","1080p"],default:"1080p",description:"Resolution for the generated video"},duration:{title:"Duration",type:"integer",minimum:3,maximum:12,default:5,description:"Duration of the generated video in seconds"},camera_fixed:{title:"Camera Fixed",type:"boolean",default:!1,description:"Whether to fix the camera position"},seed:{title:"Seed",type:"integer",default:-1,description:"Seed for reproducible generation (-1 for random)"},enable_safety_checker:{title:"Enable Safety Checker",type:"boolean",default:!0,description:"Whether to enable safety checking"}},"x-fal-order-properties":["prompt","aspect_ratio","duration"],required:["prompt"]},ByteDanceSeedanceV1ProTextToVideoOutput:{title:"SeedanceTextToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]},seed:{title:"Seed",type:"integer",description:"The seed used for generation"}},"x-fal-order-properties":["video","seed"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/bytedance/seedance/v1/pro/text-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/text-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/text-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ByteDanceSeedanceV1ProTextToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/text-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/ByteDanceSeedanceV1ProTextToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function so(t){return async({cesdk:e})=>Ih(e,t)}function Ih(t,e){return k({modelKey:"fal-ai/bytedance/seedance/v1/pro/text-to-video",name:"ByteDance Seedance v1 Pro",schema:oo,inputReference:"#/components/schemas/ByteDanceSeedanceV1ProTextToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??e.middleware??[],getBlockInput:async i=>{let r,n,o={"480p":{height:480},"720p":{height:720},"1080p":{height:1080}},s=i.resolution??"1080p",a=o[s].height;if(i.aspect_ratio){let[c,u]=i.aspect_ratio.split(":").map(Number);n=a,r=Math.round(n*c/u)}else n=a,r=Math.round(n*16/9);return Promise.resolve({video:{width:r,height:n,duration:i.duration??5}})}},e)}var _h={MinimaxVideo01Live:xn,MinimaxVideo01LiveImageToVideo:Hn,MinimaxHailuo02StandardImageToVideo:Qn,KlingVideoV21MasterImageToVideo:Yn,PixverseV35TextToVideo:Xn,KlingVideoV21MasterTextToVideo:eo,Veo3TextToVideo:io,ByteDanceSeedanceV1ProImageToVideo:no,ByteDanceSeedanceV1ProTextToVideo:so},hy=_h;export{hy as default};
72
+ `},negative_prompt:{maxLength:2048,type:"string",title:"Negative Prompt",description:"Negative prompt to be used for the generation",default:""}},"x-fal-order-properties":["prompt","aspect_ratio","resolution","style","duration"],required:["prompt"]},PixverseV35TextToVideoOutput:{title:"VideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/pixverse/v3.5/text-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/pixverse/v3.5/text-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/pixverse/v3.5/text-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/PixverseV35TextToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/pixverse/v3.5/text-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/PixverseV35TextToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function io(t){return async({cesdk:e})=>(e.i18n.setTranslations({en:{[`libraries.${_("fal-ai/pixverse/v3.5/text-to-video")}.history.label`]:"Generated From Text"}}),Pf(e,t))}function Pf(t,e){return S({modelKey:"fal-ai/pixverse/v3.5/text-to-video",name:"Pixverse V3.5",schema:to,inputReference:"#/components/schemas/PixverseV35TextToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??e.middleware??[],getBlockInput:i=>{if(i.aspect_ratio!=null&&i.resolution!=null){let[r,n]=i.aspect_ratio.split(":").map(Number),o=parseInt(i.resolution,10),s=Math.round(o*r/n);if(i.duration!=null){let a=typeof i.duration=="string"?parseInt(i.duration,10):i.duration;return Promise.resolve({video:{width:s,height:o,duration:a}})}throw new Error("Cannot determine video duration")}else throw new Error("Cannot determine video dimensions \u2013 aspect ratio and resolution must be set")}},e)}var ro={openapi:"3.0.4",info:{title:"Queue OpenAPI for fal-ai/kling-video/v2.1/master/text-to-video",version:"1.0.0",description:"Automatically generated schema for Kling 2.1 Master \u2013 Text to Video model"},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},KlingVideoV21MasterTextToVideoInput:{title:"TextToVideoV21MasterRequest",type:"object",properties:{prompt:{type:"string",maxLength:2500,title:"Prompt","x-imgly-builder":{component:"TextArea"}},duration:{type:"string",enum:["5","10"],title:"Duration",description:"The duration of the generated video in seconds",default:"5"},aspect_ratio:{type:"string",enum:["16:9","9:16","1:1"],title:"Aspect Ratio",description:"The aspect ratio of the generated video frame",default:"16:9"},negative_prompt:{type:"string",maxLength:2500,title:"Negative Prompt",default:"blur, distort, and low quality"},cfg_scale:{type:"number",minimum:0,maximum:1,title:"Cfg Scale",description:"The CFG scale determines adherence to the prompt",default:.5}},"x-fal-order-properties":["prompt","duration","aspect_ratio"],required:["prompt"]},KlingVideoV21MasterTextToVideoOutput:{title:"TextToVideoV21MasterOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{type:"integer",title:"File Size",description:"The size of the file in bytes."},file_name:{type:"string",title:"File Name",description:"The name of the file."},content_type:{type:"string",title:"Content Type",description:"The mime type of the file."},url:{type:"string",title:"Url",description:"The URL where the file can be downloaded from."},file_data:{type:"string",format:"binary",title:"File Data",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function no(t){return async({cesdk:e})=>Vf(e,t)}function Vf(t,e){return S({modelKey:"fal-ai/kling-video/v2.1/master/text-to-video",name:"Kling Video V2.1 Master",schema:ro,inputReference:"#/components/schemas/KlingVideoV21MasterTextToVideoInput",cesdk:t,headers:e.headers,middleware:e.middleware,getBlockInput:i=>{let r=i.aspect_ratio??"16:9",[n,o]=r.split(":").map(Number),s=720,a=Math.round(s*n/o),u=i.duration!=null?parseInt(i.duration,10):5;return Promise.resolve({video:{width:a,height:s,duration:u}})}},e)}var oo={openapi:"3.0.4",info:{title:"Queue OpenAPI for fal-ai/veo3",version:"1.0.0",description:"","x-fal-metadata":{endpointId:"fal-ai/veo3",category:"text-to-video",thumbnailUrl:"https://storage.googleapis.com/fal_cdn/fal/Sound-2.jpg",playgroundUrl:"https://fal.ai/models/fal-ai/veo3",documentationUrl:"https://fal.ai/models/fal-ai/veo3/api"}},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},Veo3Input:{title:"TextToVideoPreviewInput",type:"object",properties:{prompt:{examples:["A casual street interview on a busy New York City sidewalk in the afternoon. The interviewer holds a plain, unbranded microphone and asks: Have you seen Google's new Veo3 model It is a super good model. Person replies: Yeah I saw it, it's already available on fal. It's crazy good."],title:"Prompt",type:"string",minLength:1,description:"The text prompt describing the video you want to generate","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{enum:["16:9","9:16","1:1"],title:"Aspect Ratio",type:"string",description:"The aspect ratio of the generated video",default:"16:9","x-imgly-builder":{component:"Select"}},duration:{enum:["8s"],title:"Duration",type:"string",description:"The duration of the generated video in seconds",default:"8s","x-imgly-builder":{component:"Select"}},generate_audio:{title:"Generate Audio",type:"boolean",description:"Whether to generate audio for the video. If false, %33 less credits will be used.",default:!0,"x-imgly-builder":{component:"Switch"}}},"x-fal-order-properties":["prompt","aspect_ratio","duration","negative_prompt","enhance_prompt","seed","generate_audio"],required:["prompt"]},Veo3Output:{title:"TextToVideoPreviewOutput",type:"object",properties:{video:{examples:[{url:"https://v3.fal.media/files/penguin/Q-2dpcjIoQOldJRL3grsc_output.mp4"}],title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{examples:[4404019],title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{examples:["z9RV14K95DvU.png"],title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{examples:["image/png"],title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/veo3/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/veo3":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Veo3Input"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/Veo3Output"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function so(t){return async({cesdk:e})=>{let i="fal-ai/veo3";return e.i18n.setTranslations({en:{[`panel.${_(i)}.prompt`]:"Enter your prompt",[`panel.${i}.prompt`]:"Enter your prompt",[`libraries.${_(i)}.history.label`]:"Generated Videos"}}),Df(e,t)}}function Df(t,e){return S({modelKey:"fal-ai/veo3",name:"Veo3",schema:oo,inputReference:"#/components/schemas/Veo3Input",cesdk:t,headers:e.headers,middlewares:e.middlewares,getBlockInput:i=>{if(i.aspect_ratio!=null){let[r,n]=i.aspect_ratio.split(":").map(Number),o=720,s=Math.round(o*r/n);return Promise.resolve({video:{width:s,height:o,duration:8}})}else return Promise.resolve({video:{width:1280,height:720,duration:8}})}},e)}var ao={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API for fal-ai/veo3.1"},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},Veo31TextToVideoInput:{title:"Veo31TextToVideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",minLength:1,description:"The text prompt describing the video you want to generate","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["9:16","16:9","1:1"],default:"16:9",description:"The aspect ratio of the generated video","x-imgly-enum-labels":{"9:16":"9:16 (Vertical)","16:9":"16:9 (Landscape)","1:1":"1:1 (Square)"},"x-imgly-builder":{component:"Select"}},duration:{title:"Duration",type:"string",enum:["4s","6s","8s"],default:"8s",description:"The duration of the generated video","x-imgly-enum-labels":{"4s":"4 seconds","6s":"6 seconds","8s":"8 seconds"},"x-imgly-builder":{component:"Select"}},resolution:{title:"Resolution",type:"string",enum:["720p","1080p"],default:"720p",description:"The resolution of the generated video","x-imgly-enum-labels":{"720p":"720p (HD)","1080p":"1080p (Full HD)"},"x-imgly-builder":{component:"Select"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Whether to generate audio for the video","x-imgly-builder":{component:"Switch"}},negative_prompt:{title:"Negative Prompt",type:"string",description:"Content to avoid in the generated video","x-imgly-builder":{component:"TextArea"}},enhance_prompt:{title:"Enhance Prompt",type:"boolean",default:!0,description:"Enhance the prompt for better generation quality","x-imgly-builder":{component:"Switch"}},auto_fix:{title:"Auto Fix",type:"boolean",default:!0,description:"Automatically fix prompts that fail content policy","x-imgly-builder":{component:"Switch"}},seed:{title:"Seed",type:"integer",description:"Seed for reproducible generation","x-imgly-builder":{component:"Number"}}},"x-fal-order-properties":["prompt","aspect_ratio","duration","resolution","generate_audio"],required:["prompt"]},Veo31TextToVideoOutput:{title:"Veo31TextToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/veo3.1/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/veo3.1":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31TextToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31TextToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function lo(t){return async({cesdk:e})=>{let i="fal-ai/veo3.1";return e.i18n.setTranslations({en:{[`panel.${_(i)}.prompt`]:"Enter your prompt",[`panel.${i}.prompt`]:"Enter your prompt",[`libraries.${_(i)}.history.label`]:"Generated Videos"}}),Ff(e,t)}}function Ff(t,e){return S({modelKey:"fal-ai/veo3.1",name:"Veo 3.1",schema:ao,inputReference:"#/components/schemas/Veo31TextToVideoInput",cesdk:t,headers:e.headers,middlewares:e.middlewares,getBlockInput:i=>{let r=i.aspect_ratio??"16:9",[n,o]=r.split(":").map(Number),s=i.resolution??"720p",u={"720p":720,"1080p":1080}[s],d=Math.round(u*n/o),l=i.duration??"8s",c=parseInt(l.replace("s",""),10);return Promise.resolve({video:{width:d,height:u,duration:c}})}},e)}var uo={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API for fal-ai/veo3.1/fast"},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},Veo31FastTextToVideoInput:{title:"Veo31FastTextToVideoInput",type:"object",properties:{prompt:{title:"Prompt",type:"string",minLength:1,description:"The text prompt describing the video you want to generate","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["9:16","16:9","1:1"],default:"16:9",description:"The aspect ratio of the generated video","x-imgly-enum-labels":{"9:16":"9:16 (Vertical)","16:9":"16:9 (Landscape)","1:1":"1:1 (Square)"},"x-imgly-builder":{component:"Select"}},duration:{title:"Duration",type:"string",enum:["4s","6s","8s"],default:"8s",description:"The duration of the generated video","x-imgly-enum-labels":{"4s":"4 seconds","6s":"6 seconds","8s":"8 seconds"},"x-imgly-builder":{component:"Select"}},resolution:{title:"Resolution",type:"string",enum:["720p","1080p"],default:"720p",description:"The resolution of the generated video","x-imgly-enum-labels":{"720p":"720p (HD)","1080p":"1080p (Full HD)"},"x-imgly-builder":{component:"Select"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Whether to generate audio for the video","x-imgly-builder":{component:"Switch"}},negative_prompt:{title:"Negative Prompt",type:"string",description:"Content to avoid in the generated video","x-imgly-builder":{component:"TextArea"}},enhance_prompt:{title:"Enhance Prompt",type:"boolean",default:!0,description:"Enhance the prompt for better generation quality","x-imgly-builder":{component:"Switch"}},auto_fix:{title:"Auto Fix",type:"boolean",default:!0,description:"Automatically fix prompts that fail content policy","x-imgly-builder":{component:"Switch"}},seed:{title:"Seed",type:"integer",description:"Seed for reproducible generation","x-imgly-builder":{component:"Number"}}},"x-fal-order-properties":["prompt","aspect_ratio","duration","resolution","generate_audio"],required:["prompt"]},Veo31FastTextToVideoOutput:{title:"Veo31FastTextToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/veo3.1/fast/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/fast/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/veo3.1/fast":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31FastTextToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/fast/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31FastTextToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function co(t){return async({cesdk:e})=>{let i="fal-ai/veo3.1/fast";return e.i18n.setTranslations({en:{[`panel.${_(i)}.prompt`]:"Enter your prompt",[`panel.${i}.prompt`]:"Enter your prompt",[`libraries.${_(i)}.history.label`]:"Generated Videos"}}),Rf(e,t)}}function Rf(t,e){return S({modelKey:"fal-ai/veo3.1/fast",name:"Veo 3.1 Fast",schema:uo,inputReference:"#/components/schemas/Veo31FastTextToVideoInput",cesdk:t,headers:e.headers,middlewares:e.middlewares,getBlockInput:i=>{let r=i.aspect_ratio??"16:9",[n,o]=r.split(":").map(Number),s=i.resolution??"720p",u={"720p":720,"1080p":1080}[s],d=Math.round(u*n/o),l=i.duration??"8s",c=parseInt(l.replace("s",""),10);return Promise.resolve({video:{width:d,height:u,duration:c}})}},e)}var po={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},ByteDanceSeedanceV1ProImageToVideoInput:{title:"SeedanceImageToVideoRequest",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for the video generation","x-imgly-builder":{component:"TextArea"}},image_url:{title:"Image Url",type:"string",description:"URL of the image to use as the first frame"},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["21:9","16:9","4:3","1:1","3:4","9:16","auto"],default:"auto",description:"Aspect ratio for the generated video","x-imgly-enum-labels":{"21:9":"21:9 (Ultra Wide)","16:9":"16:9 (Landscape)","4:3":"4:3 (Standard)","1:1":"1:1 (Square)","3:4":"3:4 (Portrait)","9:16":"9:16 (Vertical)",auto:"Auto (From Image)"}},duration:{title:"Duration",type:"integer",minimum:3,maximum:12,default:5,description:"Duration of the generated video in seconds"}},"x-fal-order-properties":["image_url","prompt","aspect_ratio","duration"],required:["prompt","image_url"]},ByteDanceSeedanceV1ProImageToVideoOutput:{title:"SeedanceImageToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]},seed:{title:"Seed",type:"integer",description:"The seed used for generation"}},"x-fal-order-properties":["video","seed"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/bytedance/seedance/v1/pro/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ByteDanceSeedanceV1ProImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/ByteDanceSeedanceV1ProImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function mo(t){return async({cesdk:e})=>{let i="fal-ai/bytedance/seedance/v1/pro/image-to-video";return e.i18n.setTranslations({en:{[`panel.${_(i)}.imageSelection`]:"Select Image To Generate",[`panel.${i}.imageSelection`]:"Select Image To Generate",[`libraries.${_(i)}.history.label`]:"Generated From Image"}}),Lf(e,t)}}function Lf(t,e){return S({modelKey:"fal-ai/bytedance/seedance/v1/pro/image-to-video",name:"ByteDance Seedance v1 Pro",schema:po,inputReference:"#/components/schemas/ByteDanceSeedanceV1ProImageToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??e.middleware??[],supportedQuickActions:{"ly.img.createVideo":{mapInput:()=>{throw new Error("This generation should not be triggered by this quick action")}}},getBlockInput:async i=>{let r,n,o={"480p":{height:480},"720p":{height:720},"1080p":{height:1080}},s=i.resolution??"1080p",a=o[s].height;if(i.aspect_ratio&&i.aspect_ratio!=="auto"){let[u,d]=i.aspect_ratio.split(":").map(Number);n=a,r=Math.round(n*u/d)}else{let u=await D(i.image_url,t.engine),d=u.width??1920,l=u.height??1080,c=d/l;n=a,r=Math.round(n*c)}return Promise.resolve({video:{width:r,height:n,duration:i.duration??5}})}},e)}var fo={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},ByteDanceSeedanceV1ProTextToVideoInput:{title:"SeedanceTextToVideoRequest",type:"object",properties:{prompt:{title:"Prompt",type:"string",description:"Text description for the video generation","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["21:9","16:9","4:3","1:1","3:4","9:16"],default:"16:9",description:"Aspect ratio for the generated video","x-imgly-enum-labels":{"21:9":"21:9 (Ultra Wide)","16:9":"16:9 (Landscape)","4:3":"4:3 (Standard)","1:1":"1:1 (Square)","3:4":"3:4 (Portrait)","9:16":"9:16 (Vertical)"}},resolution:{title:"Resolution",type:"string",enum:["480p","720p","1080p"],default:"1080p",description:"Resolution for the generated video"},duration:{title:"Duration",type:"integer",minimum:3,maximum:12,default:5,description:"Duration of the generated video in seconds"},camera_fixed:{title:"Camera Fixed",type:"boolean",default:!1,description:"Whether to fix the camera position"},seed:{title:"Seed",type:"integer",default:-1,description:"Seed for reproducible generation (-1 for random)"},enable_safety_checker:{title:"Enable Safety Checker",type:"boolean",default:!0,description:"Whether to enable safety checking"}},"x-fal-order-properties":["prompt","aspect_ratio","duration"],required:["prompt"]},ByteDanceSeedanceV1ProTextToVideoOutput:{title:"SeedanceTextToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]},seed:{title:"Seed",type:"integer",description:"The seed used for generation"}},"x-fal-order-properties":["video","seed"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/bytedance/seedance/v1/pro/text-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/text-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/text-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ByteDanceSeedanceV1ProTextToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/bytedance/seedance/v1/pro/text-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/ByteDanceSeedanceV1ProTextToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function go(t){return async({cesdk:e})=>Nf(e,t)}function Nf(t,e){return S({modelKey:"fal-ai/bytedance/seedance/v1/pro/text-to-video",name:"ByteDance Seedance v1 Pro",schema:fo,inputReference:"#/components/schemas/ByteDanceSeedanceV1ProTextToVideoInput",cesdk:t,headers:e.headers,middleware:e.middlewares??e.middleware??[],getBlockInput:async i=>{let r,n,o={"480p":{height:480},"720p":{height:720},"1080p":{height:1080}},s=i.resolution??"1080p",a=o[s].height;if(i.aspect_ratio){let[u,d]=i.aspect_ratio.split(":").map(Number);n=a,r=Math.round(n*u/d)}else n=a,r=Math.round(n*16/9);return Promise.resolve({video:{width:r,height:n,duration:i.duration??5}})}},e)}var ho={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},Veo31FastFirstLastFrameToVideoInput:{title:"Veo31FastFirstLastFrameToVideoRequest",type:"object",properties:{first_frame_url:{title:"First Frame",type:"string",description:"URL of the image to use as the first frame"},last_frame_url:{title:"Last Frame",type:"string",description:"URL of the image to use as the last frame"},prompt:{title:"Prompt",type:"string",description:"Text description for the video generation","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["auto","9:16","16:9","1:1"],default:"auto",description:"Aspect ratio for the generated video","x-imgly-enum-labels":{auto:"Auto (From Images)","9:16":"9:16 (Vertical)","16:9":"16:9 (Landscape)","1:1":"1:1 (Square)"}},resolution:{title:"Resolution",type:"string",enum:["720p","1080p"],default:"720p",description:"Video resolution quality","x-imgly-enum-labels":{"720p":"720p (HD)","1080p":"1080p (Full HD)"}},duration:{title:"Duration",type:"string",enum:["8s"],default:"8s",description:"Duration of the generated video","x-imgly-enum-labels":{"8s":"8 seconds"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!1,description:"Whether to generate audio for the video"}},"x-fal-order-properties":["first_frame_url","last_frame_url","prompt","aspect_ratio","resolution","generate_audio"],required:["prompt","first_frame_url","last_frame_url"]},Veo31FastFirstLastFrameToVideoOutput:{title:"Veo31FastFirstLastFrameToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]},seed:{title:"Seed",type:"integer",description:"The seed used for generation"}},"x-fal-order-properties":["video","seed"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/veo3.1/fast/first-last-frame-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/fast/first-last-frame-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/veo3.1/fast/first-last-frame-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31FastFirstLastFrameToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/fast/first-last-frame-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31FastFirstLastFrameToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function yo(t){return async({cesdk:e})=>{let i="fal-ai/veo3.1/fast/first-last-frame-to-video";return e.i18n.setTranslations({en:{[`panel.${_(i)}.imageSelection`]:"Select Images To Generate",[`panel.${i}.imageSelection`]:"Select Images To Generate",[`libraries.${_(i)}.history.label`]:"Generated From Images","ly.img.ai.veo31.firstFrame.label":"First Frame","ly.img.ai.veo31.lastFrame.label":"Last Frame","ly.img.ai.veo31.swapFrames.label":"Swap First and Last Frame","ly.img.ai.imageSelection.selectImage.label":"Select Image"}}),Kf(i,e),Bf(e,t)}}function Bf(t,e){let i="fal-ai/veo3.1/fast/first-last-frame-to-video",r=e.middlewares??e.middleware??[],n=null;return{id:i,name:"Veo 3.1 Fast (First/Last Frame)",kind:"video",initialize:async()=>{n=ve(e.proxyUrl,e.headers)},input:{quickActions:{supported:me({"ly.img.createVideo":{mapInput:()=>{throw new Error("This generation should not be triggered by this quick action")}},"ly.img.animateBetweenImages":{mapInput:s=>({prompt:"",first_frame_url:s.firstFrameUri,last_frame_url:s.lastFrameUri})}},e.supportedQuickActions)},panel:{type:"schema",document:ho,inputReference:"#/components/schemas/Veo31FastFirstLastFrameToVideoInput",includeHistoryLibrary:!0,orderExtensionKeyword:"x-fal-order-properties",renderCustomProperty:{first_frame_url:(s,a)=>{let{builder:u,experimental:{global:d}}=s,l=d(`${i}.first_frame_url`,""),c=d(`${i}.last_frame_url`,"");return u.MediaPreview(a.id,{preview:{type:"image",uri:l.value},action:{label:"ly.img.ai.imageSelection.selectImage.label",onClick:()=>{t.ui.openPanel(Ti(i),{payload:{onSelect:m=>{let p=m.meta?.uri;p!=null&&l.setValue(p)}}})}}}),u.Button(`${a.id}.swap`,{label:"ly.img.ai.veo31.swapFrames.label",icon:"@imgly/Replace",labelAlignment:"center",variant:"regular",onClick:()=>{let m=l.value;l.setValue(c.value),c.setValue(m)}}),()=>({id:a.id,type:"string",value:l.value})},last_frame_url:(s,a)=>{let{builder:u,experimental:{global:d}}=s,l=d(`${i}.last_frame_url`,"");return u.MediaPreview(a.id,{preview:{type:"image",uri:l.value},action:{label:"ly.img.ai.imageSelection.selectImage.label",onClick:()=>{t.ui.openPanel(Ii(i),{payload:{onSelect:c=>{let m=c.meta?.uri;m!=null&&l.setValue(m)}}})}}}),()=>({id:a.id,type:"string",value:l.value})}},getBlockInput:async s=>{let a,u,d={"720p":{height:720},"1080p":{height:1080}},l=s.resolution??"720p",c=d[l].height;if(s.aspect_ratio&&s.aspect_ratio!=="auto"){let[p,g]=s.aspect_ratio.split(":").map(Number);u=c,a=Math.round(u*p/g)}else try{let p=await D(s.first_frame_url,t.engine),g=p.width??1920,h=p.height??1080,v=g/h;u=c,a=Math.round(u*v)}catch{u=c,a=Math.round(u*16/9)}let m=s.duration?parseInt(s.duration.replace("s",""),10):8;return Promise.resolve({video:{width:a,height:u,duration:m}})},userFlow:"placeholder"}},output:{abortable:!0,history:e.history??"@imgly/indexedDB",middleware:r,generate:async(s,{abortSignal:a})=>{if(!n)throw new Error("Provider not initialized");let u=await H(n,s.first_frame_url,t),d=await H(n,s.last_frame_url,t),l=await n.subscribe(i,{abortSignal:a,input:{...s,first_frame_url:u??s.first_frame_url,last_frame_url:d??s.last_frame_url},logs:!0}),c=l?.data?.video;if(c!=null){let m=c?.url;if(m!=null)return{kind:"video",url:m}}throw console.error("Cannot extract generated video from response:",l),new Error("Cannot find generated video")},generationHintText:"ly.img.ai.video.generation.hint"}}}function Kf(t,e){e.ui.registerPanel(Ti(t),({builder:i,payload:r})=>{i.Section("first_frame_section",{children:()=>{i.Text("first_frame_title",{content:"ly.img.ai.veo31.firstFrame.label"}),i.Library(`${t}.library.first_frame`,{entries:["ly.img.image"],onSelect:async n=>{let o=n?.meta?.uri;if(o==null)return;let s=await e.engine.editor.getMimeType(o);s==="image/svg+xml"?e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.svg"}):s.startsWith("image/")?(r?.onSelect(n),e?.ui.closePanel(Ti(t))):e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})}})}),e.ui.registerPanel(Ii(t),({builder:i,payload:r})=>{i.Section("last_frame_section",{children:()=>{i.Text("last_frame_title",{content:"ly.img.ai.veo31.lastFrame.label"}),i.Library(`${t}.library.last_frame`,{entries:["ly.img.image"],onSelect:async n=>{let o=n?.meta?.uri;if(o==null)return;let s=await e.engine.editor.getMimeType(o);s==="image/svg+xml"?e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.svg"}):s.startsWith("image/")?(r?.onSelect(n),e?.ui.closePanel(Ii(t))):e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})}})})}function Ti(t){return`ly.img.ai.${t}.firstFrameSelection`}function Ii(t){return`ly.img.ai.${t}.lastFrameSelection`}var bo={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API."},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},Veo31FirstLastFrameToVideoInput:{title:"Veo31FirstLastFrameToVideoRequest",type:"object",properties:{first_frame_url:{title:"First Frame",type:"string",description:"URL of the image to use as the first frame"},last_frame_url:{title:"Last Frame",type:"string",description:"URL of the image to use as the last frame"},prompt:{title:"Prompt",type:"string",description:"Text description for the video generation","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["auto","9:16","16:9","1:1"],default:"auto",description:"Aspect ratio for the generated video","x-imgly-enum-labels":{auto:"Auto (From Images)","9:16":"9:16 (Vertical)","16:9":"16:9 (Landscape)","1:1":"1:1 (Square)"}},resolution:{title:"Resolution",type:"string",enum:["720p","1080p"],default:"720p",description:"Video resolution quality","x-imgly-enum-labels":{"720p":"720p (HD)","1080p":"1080p (Full HD)"}},duration:{title:"Duration",type:"string",enum:["8s","16s"],default:"8s",description:"Duration of the generated video","x-imgly-enum-labels":{"8s":"8 seconds","16s":"16 seconds"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!1,description:"Whether to generate audio for the video"}},"x-fal-order-properties":["first_frame_url","last_frame_url","prompt","aspect_ratio","resolution","generate_audio"],required:["prompt","first_frame_url","last_frame_url"]},Veo31FirstLastFrameToVideoOutput:{title:"Veo31FirstLastFrameToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]},seed:{title:"Seed",type:"integer",description:"The seed used for generation"}},"x-fal-order-properties":["video","seed"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/veo3.1/first-last-frame-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/first-last-frame-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/veo3.1/first-last-frame-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31FirstLastFrameToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/first-last-frame-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31FirstLastFrameToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function vo(t){return async({cesdk:e})=>{let i="fal-ai/veo3.1/first-last-frame-to-video";return e.i18n.setTranslations({en:{[`panel.${_(i)}.imageSelection`]:"Select Images To Generate",[`panel.${i}.imageSelection`]:"Select Images To Generate",[`libraries.${_(i)}.history.label`]:"Generated From Images","ly.img.ai.veo31.firstFrame.label":"First Frame","ly.img.ai.veo31.lastFrame.label":"Last Frame","ly.img.ai.veo31.swapFrames.label":"Swap First and Last Frame","ly.img.ai.imageSelection.selectImage.label":"Select Image"}}),Qf(i,e),Gf(e,t)}}function Gf(t,e){let i="fal-ai/veo3.1/first-last-frame-to-video",r=e.middlewares??e.middleware??[],n=null;return{id:i,name:"Veo 3.1 (First/Last Frame)",kind:"video",initialize:async()=>{n=ve(e.proxyUrl,e.headers)},input:{quickActions:{supported:me({"ly.img.createVideo":{mapInput:()=>{throw new Error("This generation should not be triggered by this quick action")}},"ly.img.animateBetweenImages":{mapInput:s=>({prompt:"",first_frame_url:s.firstFrameUri,last_frame_url:s.lastFrameUri})}},e.supportedQuickActions)},panel:{type:"schema",document:bo,inputReference:"#/components/schemas/Veo31FirstLastFrameToVideoInput",includeHistoryLibrary:!0,orderExtensionKeyword:"x-fal-order-properties",renderCustomProperty:{first_frame_url:(s,a)=>{let{builder:u,experimental:{global:d}}=s,l=d(`${i}.first_frame_url`,""),c=d(`${i}.last_frame_url`,"");return u.MediaPreview(a.id,{preview:{type:"image",uri:l.value},action:{label:"ly.img.ai.imageSelection.selectImage.label",onClick:()=>{t.ui.openPanel(Si(i),{payload:{onSelect:m=>{let p=m.meta?.uri;p!=null&&l.setValue(p)}}})}}}),u.Button(`${a.id}.swap`,{label:"ly.img.ai.veo31.swapFrames.label",icon:"@imgly/Replace",labelAlignment:"center",variant:"regular",onClick:()=>{let m=l.value;l.setValue(c.value),c.setValue(m)}}),()=>({id:a.id,type:"string",value:l.value})},last_frame_url:(s,a)=>{let{builder:u,experimental:{global:d}}=s,l=d(`${i}.last_frame_url`,"");return u.MediaPreview(a.id,{preview:{type:"image",uri:l.value},action:{label:"ly.img.ai.imageSelection.selectImage.label",onClick:()=>{t.ui.openPanel(Ei(i),{payload:{onSelect:c=>{let m=c.meta?.uri;m!=null&&l.setValue(m)}}})}}}),()=>({id:a.id,type:"string",value:l.value})}},getBlockInput:async s=>{let a,u,d={"720p":{height:720},"1080p":{height:1080}},l=s.resolution??"720p",c=d[l].height;if(s.aspect_ratio&&s.aspect_ratio!=="auto"){let[p,g]=s.aspect_ratio.split(":").map(Number);u=c,a=Math.round(u*p/g)}else try{let p=await D(s.first_frame_url,t.engine),g=p.width??1920,h=p.height??1080,v=g/h;u=c,a=Math.round(u*v)}catch{u=c,a=Math.round(u*16/9)}let m=s.duration?parseInt(s.duration.replace("s",""),10):8;return Promise.resolve({video:{width:a,height:u,duration:m}})},userFlow:"placeholder"}},output:{abortable:!0,history:e.history??"@imgly/indexedDB",middleware:r,generate:async(s,{abortSignal:a})=>{if(!n)throw new Error("Provider not initialized");let u=await H(n,s.first_frame_url,t),d=await H(n,s.last_frame_url,t),l=await n.subscribe(i,{abortSignal:a,input:{...s,first_frame_url:u??s.first_frame_url,last_frame_url:d??s.last_frame_url},logs:!0}),c=l?.data?.video;if(c!=null){let m=c?.url;if(m!=null)return{kind:"video",url:m}}throw console.error("Cannot extract generated video from response:",l),new Error("Cannot find generated video")},generationHintText:"ly.img.ai.video.generation.hint"}}}function Qf(t,e){e.ui.registerPanel(Si(t),({builder:i,payload:r})=>{i.Section("first_frame_section",{children:()=>{i.Text("first_frame_title",{content:"ly.img.ai.veo31.firstFrame.label"}),i.Library(`${t}.library.first_frame`,{entries:["ly.img.image"],onSelect:async n=>{let o=n?.meta?.uri;if(o==null)return;let s=await e.engine.editor.getMimeType(o);s==="image/svg+xml"?e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.svg"}):s.startsWith("image/")?(r?.onSelect(n),e?.ui.closePanel(Si(t))):e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})}})}),e.ui.registerPanel(Ei(t),({builder:i,payload:r})=>{i.Section("last_frame_section",{children:()=>{i.Text("last_frame_title",{content:"ly.img.ai.veo31.lastFrame.label"}),i.Library(`${t}.library.last_frame`,{entries:["ly.img.image"],onSelect:async n=>{let o=n?.meta?.uri;if(o==null)return;let s=await e.engine.editor.getMimeType(o);s==="image/svg+xml"?e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.svg"}):s.startsWith("image/")?(r?.onSelect(n),e?.ui.closePanel(Ei(t))):e.ui.showNotification({type:"warning",message:"ly.img.ai.imageSelection.error.invalidType"})}})}})})}function Si(t){return`ly.img.ai.${t}.firstFrameSelection`}function Ei(t){return`ly.img.ai.${t}.lastFrameSelection`}var wo={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API for fal-ai/veo3.1/image-to-video"},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},Veo31ImageToVideoInput:{title:"Veo31ImageToVideoInput",type:"object",properties:{image_url:{format:"uri",description:"URL of the image to animate",type:"string",examples:["https://v3.fal.media/files/rabbit/NEvlE6DqEks4afmShK9tY_image.webp"],maxLength:2083,minLength:1,title:"Source Image"},prompt:{title:"Prompt",type:"string",minLength:1,description:"The text prompt describing the desired video motion and content","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["9:16","16:9","1:1"],default:"16:9",description:"The aspect ratio of the generated video","x-imgly-enum-labels":{"9:16":"9:16 (Vertical)","16:9":"16:9 (Landscape)","1:1":"1:1 (Square)"},"x-imgly-builder":{component:"Select"}},resolution:{title:"Resolution",type:"string",enum:["720p","1080p"],default:"720p",description:"The resolution of the generated video","x-imgly-enum-labels":{"720p":"720p (HD)","1080p":"1080p (Full HD)"},"x-imgly-builder":{component:"Select"}},duration:{title:"Duration",type:"string",enum:["8s"],default:"8s",description:"The duration of the generated video (fixed at 8 seconds for Veo 3.1)","x-imgly-enum-labels":{"8s":"8 seconds"},"x-imgly-builder":{component:"Select"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Whether to generate audio for the video","x-imgly-builder":{component:"Switch"}}},"x-fal-order-properties":["image_url","prompt","aspect_ratio","resolution","generate_audio"],required:["prompt","image_url"]},Veo31ImageToVideoOutput:{title:"Veo31ImageToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/veo3.1/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/veo3.1/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31ImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31ImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function _o(t){return async({cesdk:e})=>{let i="fal-ai/veo3.1/image-to-video";return e.i18n.setTranslations({en:{[`panel.${_(i)}.imageSelection`]:"Select Image To Animate",[`panel.${i}.imageSelection`]:"Select Image To Animate",[`libraries.${_(i)}.history.label`]:"Generated From Image"}}),Yf(e,t)}}function Yf(t,e){return S({modelKey:"fal-ai/veo3.1/image-to-video",name:"Veo 3.1",schema:wo,inputReference:"#/components/schemas/Veo31ImageToVideoInput",cesdk:t,headers:e.headers,middlewares:e.middlewares,supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({prompt:"",image_url:i.uri})}},getBlockInput:async i=>{let r=i.resolution??"720p",o={"720p":720,"1080p":1080}[r],s=i.aspect_ratio??"16:9",[a,u]=s.split(":").map(Number),d=o,l=Math.round(d*a/u),c=i.duration??"8s",m=parseInt(c.replace("s",""),10);return Promise.resolve({video:{width:l,height:d,duration:m}})}},e)}var xo={openapi:"3.0.0",info:{title:"Fal Queue API",version:"1.0.0",description:"The Fal Queue API for fal-ai/veo3.1/fast/image-to-video"},components:{securitySchemes:{apiKeyAuth:{type:"apiKey",in:"header",name:"Authorization",description:"Fal Key"}},schemas:{QueueStatus:{type:"object",properties:{status:{type:"string",enum:["IN_QUEUE","IN_PROGRESS","COMPLETED"]},request_id:{type:"string",description:"The request id."},response_url:{type:"string",description:"The response url."},status_url:{type:"string",description:"The status url."},cancel_url:{type:"string",description:"The cancel url."},logs:{type:"object",description:"The logs.",additionalProperties:!0},metrics:{type:"object",description:"The metrics.",additionalProperties:!0},queue_position:{type:"integer",description:"The queue position."}},required:["status","request_id"]},Veo31FastImageToVideoInput:{title:"Veo31FastImageToVideoInput",type:"object",properties:{image_url:{format:"uri",description:"URL of the image to be animated",type:"string",maxLength:2083,minLength:1,title:"Image URL"},prompt:{title:"Prompt",type:"string",minLength:1,description:"The text prompt describing how to animate the image","x-imgly-builder":{component:"TextArea"}},aspect_ratio:{title:"Aspect Ratio",type:"string",enum:["9:16","16:9","1:1"],default:"16:9",description:"The aspect ratio of the generated video","x-imgly-enum-labels":{"9:16":"9:16 (Vertical)","16:9":"16:9 (Landscape)","1:1":"1:1 (Square)"},"x-imgly-builder":{component:"Select"}},resolution:{title:"Resolution",type:"string",enum:["720p","1080p"],default:"720p",description:"The resolution of the generated video","x-imgly-enum-labels":{"720p":"720p (HD)","1080p":"1080p (Full HD)"},"x-imgly-builder":{component:"Select"}},duration:{title:"Duration",type:"string",enum:["8s"],default:"8s",description:"The duration of the generated video (fixed at 8 seconds)","x-imgly-enum-labels":{"8s":"8 seconds"},"x-imgly-builder":{component:"Select"}},generate_audio:{title:"Generate Audio",type:"boolean",default:!0,description:"Whether to generate audio for the video","x-imgly-builder":{component:"Switch"}},negative_prompt:{title:"Negative Prompt",type:"string",description:"Content to avoid in the generated video","x-imgly-builder":{component:"TextArea"}},enhance_prompt:{title:"Enhance Prompt",type:"boolean",default:!0,description:"Enhance the prompt for better generation quality","x-imgly-builder":{component:"Switch"}},auto_fix:{title:"Auto Fix",type:"boolean",default:!0,description:"Automatically fix prompts that fail content policy","x-imgly-builder":{component:"Switch"}},seed:{title:"Seed",type:"integer",description:"Seed for reproducible generation","x-imgly-builder":{component:"Number"}}},"x-fal-order-properties":["image_url","prompt","aspect_ratio","resolution","generate_audio"],required:["prompt","image_url"]},Veo31FastImageToVideoOutput:{title:"Veo31FastImageToVideoOutput",type:"object",properties:{video:{title:"Video",description:"The generated video",allOf:[{$ref:"#/components/schemas/File"}]}},"x-fal-order-properties":["video"],required:["video"]},File:{title:"File",type:"object",properties:{file_size:{title:"File Size",type:"integer",description:"The size of the file in bytes."},file_name:{title:"File Name",type:"string",description:"The name of the file. It will be auto-generated if not provided."},content_type:{title:"Content Type",type:"string",description:"The mime type of the file."},url:{title:"Url",type:"string",description:"The URL where the file can be downloaded from."},file_data:{format:"binary",title:"File Data",type:"string",description:"File data"}},"x-fal-order-properties":["url","content_type","file_name","file_size","file_data"],required:["url"]}}},paths:{"/fal-ai/veo3.1/fast/image-to-video/requests/{request_id}/status":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}},{name:"logs",in:"query",required:!1,schema:{type:"number",description:"Whether to include logs (`1`) in the response or not (`0`)."}}],responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/fast/image-to-video/requests/{request_id}/cancel":{put:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"The request was cancelled.",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean",description:"Whether the request was cancelled successfully."}}}}}}}}},"/fal-ai/veo3.1/fast/image-to-video":{post:{requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31FastImageToVideoInput"}}}},responses:{"200":{description:"The request status.",content:{"application/json":{schema:{$ref:"#/components/schemas/QueueStatus"}}}}}}},"/fal-ai/veo3.1/fast/image-to-video/requests/{request_id}":{get:{parameters:[{name:"request_id",in:"path",required:!0,schema:{type:"string",description:"Request ID"}}],responses:{"200":{description:"Result of the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/Veo31FastImageToVideoOutput"}}}}}}}},servers:[{url:"https://queue.fal.run"}],security:[{apiKeyAuth:[]}]};function To(t){return async({cesdk:e})=>{let i="fal-ai/veo3.1/fast/image-to-video";return e.i18n.setTranslations({en:{[`panel.${_(i)}.imageSelection`]:"Select Image To Animate",[`panel.${i}.imageSelection`]:"Select Image To Animate",[`libraries.${_(i)}.history.label`]:"Generated From Image"}}),Xf(e,t)}}function Xf(t,e){return S({modelKey:"fal-ai/veo3.1/fast/image-to-video",name:"Veo 3.1 Fast",schema:xo,inputReference:"#/components/schemas/Veo31FastImageToVideoInput",cesdk:t,headers:e.headers,middlewares:e.middlewares,supportedQuickActions:{"ly.img.createVideo":{mapInput:i=>({prompt:"",image_url:i.uri})}},getBlockInput:async i=>{let r=i.resolution??"720p",o={"720p":720,"1080p":1080}[r],s=i.aspect_ratio??"16:9",[a,u]=s.split(":").map(Number),d=o,l=Math.round(d*a/u),c=i.duration??"8s",m=parseInt(c.replace("s",""),10);return Promise.resolve({video:{width:l,height:d,duration:m}})}},e)}var Jf={MinimaxVideo01Live:Sn,MinimaxVideo01LiveImageToVideo:Yn,MinimaxHailuo02StandardImageToVideo:Xn,KlingVideoV21MasterImageToVideo:eo,PixverseV35TextToVideo:io,KlingVideoV21MasterTextToVideo:no,Veo3TextToVideo:so,Veo31TextToVideo:lo,Veo31FastTextToVideo:co,ByteDanceSeedanceV1ProImageToVideo:mo,ByteDanceSeedanceV1ProTextToVideo:go,Veo31FastFirstLastFrameToVideo:yo,Veo31FirstLastFrameToVideo:vo,Veo31ImageToVideo:_o,Veo31FastImageToVideo:To},B1=Jf;export{B1 as default};
73
73
  /*! Bundled license information:
74
74
 
75
75
  lodash-es/lodash.js: