conformtools 0.6.13 → 0.6.15
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.
- package/README.md +6 -1
- package/dist/account-W7Z2MYZU.js +3 -0
- package/dist/{agent-hook-setup-RTQT5JEN.js → agent-hook-setup-JCIZG3Q3.js} +1 -1
- package/dist/{analysis-engine-UWIK7AYB.js → analysis-engine-DCHJHZ7W.js} +1 -1
- package/dist/{bridge-PWYOJ7E7.js → bridge-RH3JRSBN.js} +1 -1
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-LZRCXSUJ.js → chunk-4RA57LTJ.js} +1 -1
- package/dist/chunk-63WQRYTJ.js +159 -0
- package/dist/chunk-6KEFHHS6.js +10 -0
- package/dist/{chunk-4VFDGL4E.js → chunk-7NGS2BN7.js} +1 -1
- package/dist/{chunk-BYMCZJBQ.js → chunk-B2KCENY6.js} +1 -1
- package/dist/chunk-DLF5AKXT.js +10 -0
- package/dist/chunk-FLLB6UZJ.js +7 -0
- package/dist/chunk-G7CVRPVA.js +5 -0
- package/dist/chunk-HTRW5GX4.js +510 -0
- package/dist/chunk-IBIAW6IW.js +6 -0
- package/dist/{chunk-G3HBKJ5L.js → chunk-IDJIOKXA.js} +1 -1
- package/dist/chunk-OWWXUNJF.js +7 -0
- package/dist/{chunk-NZLL44HU.js → chunk-QH5DTYSE.js} +1 -1
- package/dist/{chunk-PHAMF4JF.js → chunk-ROGMKTND.js} +2 -2
- package/dist/{chunk-H4BU5WA6.js → chunk-TBU2XWFD.js} +1 -1
- package/dist/{chunk-6WLSIH2N.js → chunk-UAURERD3.js} +1 -1
- package/dist/{chunk-7W5AFZYX.js → chunk-UKXSKFL3.js} +1 -1
- package/dist/{chunk-L3HRAIDR.js → chunk-VERTA23P.js} +1 -1
- package/dist/{chunk-EP4L2BWV.js → chunk-VETHR2O7.js} +1 -1
- package/dist/chunk-X527E5VI.js +3 -0
- package/dist/{chunk-4BTTR6U3.js → chunk-XVZ7KJRI.js} +5 -5
- package/dist/{claude-setup-NGZ5NDYH.js → claude-setup-CM7G2YSG.js} +8 -8
- package/dist/cli.js +2 -2
- package/dist/demo-engine-WXNT4Y7S.js +3 -0
- package/dist/engine-HXZCA42S.js +5 -0
- package/dist/framing-HVUDKTZG.js +3 -0
- package/dist/gfx-worker.js +1 -1
- package/dist/{h264-JI62TU4W.js → h264-MAUVJTR4.js} +1 -1
- package/dist/{h264-mxf-J2QPZO4U.js → h264-mxf-2O4SAUTA.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/{host-relink-76CFY32O.js → host-relink-RI3JEY4M.js} +1 -1
- package/dist/hosted-2XACQY7J.js +3 -0
- package/dist/hosts-QW64CIJU.js +3 -0
- package/dist/http.js +3 -3
- package/dist/{inspect-U656APGR.js → inspect-NUS3XAJH.js} +2 -2
- package/dist/isobmff-MTMGQKLK.js +3 -0
- package/dist/{mc-video-LSTKUKNL.js → mc-video-HRZC7HGH.js} +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{media-XBNKYKB7.js → media-WC4ZVKIL.js} +1 -1
- package/dist/{mxf-ZL57VJ3C.js → mxf-J5QHA3VY.js} +1 -1
- package/dist/{ops-ZQEQXW2N.js → ops-XIUVNJE2.js} +1 -1
- package/dist/probe-GIAKRPFV.js +3 -0
- package/dist/{r3d-R4TLYJVE.js → r3d-2PCOFR2Z.js} +1 -1
- package/dist/resolve-bridge.py +116 -146
- package/dist/{sequence-patch-C2QRIT5V.js → sequence-patch-DFGEAJGB.js} +1 -1
- package/dist/{store-JNWELX35.js → store-WZHNO43A.js} +1 -1
- package/dist/timeline-NOTHRTAT.js +3 -0
- package/package.json +5 -5
- package/dist/account-F54SG45Q.js +0 -3
- package/dist/chunk-B54TEGMG.js +0 -5
- package/dist/chunk-BTS3DFPD.js +0 -7
- package/dist/chunk-ERUN634Q.js +0 -6
- package/dist/chunk-I2Y2P5NH.js +0 -7
- package/dist/chunk-J43UCJ6G.js +0 -4
- package/dist/chunk-LKQTE6T5.js +0 -158
- package/dist/chunk-LRGA6QJQ.js +0 -514
- package/dist/chunk-OD445COC.js +0 -7
- package/dist/chunk-XI6XF7FQ.js +0 -3
- package/dist/chunk-Y455Y6V4.js +0 -10
- package/dist/engine-6ACEWA4S.js +0 -5
- package/dist/framing-P5RGN5V3.js +0 -3
- package/dist/hosted-L26AGRIY.js +0 -3
- package/dist/hosts-TBHEPV6A.js +0 -3
- package/dist/isobmff-UISATYUR.js +0 -3
- package/dist/nuke/panel/python/Startup/conformtools_nuke_startup.py +0 -44
- package/dist/nuke/panel/python/conformtools_nuke/__init__.py +0 -10
- package/dist/nuke/panel/python/conformtools_nuke/panel.py +0 -217
- package/dist/nuke/panel/python/conformtools_nuke/verbs.py +0 -837
- package/dist/probe-ZDX6XNRF.js +0 -3
- package/dist/resolve-presets/conform.tools.xml +0 -127
- package/dist/timeline-JONFBIA3.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a as Js}from"./chunk-G3HBKJ5L.js";import"./chunk-IN6XVTUS.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-LZRCXSUJ.js";import{a as Br,b as zs,d as Gs}from"./chunk-LVGGCRDW.js";import"./chunk-C2ESM27Z.js";import{b as fu,c as $,d as Ks,e as k,f as ze,g as Se}from"./chunk-PSANHDZM.js";var _e={};Ks(_e,{__addDisposableResource:()=>Ei,__assign:()=>Ft,__asyncDelegator:()=>pi,__asyncGenerator:()=>fi,__asyncValues:()=>mi,__await:()=>Ge,__awaiter:()=>ai,__classPrivateFieldGet:()=>vi,__classPrivateFieldIn:()=>bi,__classPrivateFieldSet:()=>wi,__createBinding:()=>qt,__decorate:()=>ei,__disposeResources:()=>Si,__esDecorate:()=>ri,__exportStar:()=>li,__extends:()=>Qs,__generator:()=>ui,__importDefault:()=>yi,__importStar:()=>gi,__makeTemplateObject:()=>_i,__metadata:()=>oi,__param:()=>ti,__propKey:()=>si,__read:()=>Vr,__rest:()=>Zs,__rewriteRelativeImportExtension:()=>Ti,__runInitializers:()=>ni,__setFunctionName:()=>ii,__spread:()=>ci,__spreadArray:()=>di,__spreadArrays:()=>hi,__values:()=>Bt,default:()=>yu});function Qs(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Mr(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Zs(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function ei(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,r,i):o(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i}function ti(t,e){return function(r,n){e(r,n,t)}}function ri(t,e,r,n,s,i){function o(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=n.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,d=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),m,_=!1,f=r.length-1;f>=0;f--){var y={};for(var v in n)y[v]=v==="access"?{}:n[v];for(var v in n.access)y.access[v]=n.access[v];y.addInitializer=function(T){if(_)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(T||null))};var w=(0,r[f])(a==="accessor"?{get:d.get,set:d.set}:d[l],y);if(a==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(m=o(w.get))&&(d.get=m),(m=o(w.set))&&(d.set=m),(m=o(w.init))&&s.unshift(m)}else(m=o(w))&&(a==="field"?s.unshift(m):d[l]=m)}c&&Object.defineProperty(c,n.name,d),_=!0}function ni(t,e,r){for(var n=arguments.length>2,s=0;s<e.length;s++)r=n?e[s].call(t,r):e[s].call(t);return n?r:void 0}function si(t){return typeof t=="symbol"?t:"".concat(t)}function ii(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function oi(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ai(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(d){try{c(n.next(d))}catch(m){o(m)}}function l(d){try{c(n.throw(d))}catch(m){o(m)}}function c(d){d.done?i(d.value):s(d.value).then(a,l)}c((n=n.apply(t,e||[])).next())})}function ui(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,s&&(i=c[0]&2?s.return:c[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,c[1])).done)return i;switch(s=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,s=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],s=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function li(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qt(e,t,r)}function Bt(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function ci(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Vr(arguments[e]));return t}function hi(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function di(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function Ge(t){return this instanceof Ge?(this.v=t,this):new Ge(t)}function fi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(f){return function(y){return Promise.resolve(y).then(f,m)}}function a(f,y){n[f]&&(s[f]=function(v){return new Promise(function(w,T){i.push([f,v,w,T])>1||l(f,v)})},y&&(s[f]=y(s[f])))}function l(f,y){try{c(n[f](y))}catch(v){_(i[0][3],v)}}function c(f){f.value instanceof Ge?Promise.resolve(f.value.v).then(d,m):_(i[0][2],f)}function d(f){l("next",f)}function m(f){l("throw",f)}function _(f,y){f(y),i.shift(),i.length&&l(i[0][0],i[0][1])}}function pi(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=t[s]?function(o){return(r=!r)?{value:Ge(t[s](o)),done:!1}:i?i(o):o}:i}}function mi(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Bt=="function"?Bt(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(o){return new Promise(function(a,l){o=t[i](o),s(a,l,o.done,o.value)})}}function s(i,o,a,l){Promise.resolve(l).then(function(c){i({value:c,done:a})},o)}}function _i(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function gi(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Wr(t),n=0;n<r.length;n++)r[n]!=="default"&&qt(e,t,r[n]);return _u(e,t),e}function yi(t){return t&&t.__esModule?t:{default:t}}function vi(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function wi(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}function bi(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Ei(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function Si(t){function e(i){t.error=t.hasError?new gu(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var r,n=0;function s(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(s);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(s,function(o){return e(o),s()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return s()}function Ti(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,i,o){return n?e?".jsx":".js":s&&(!i||!o)?r:s+i+"."+o.toLowerCase()+"js"}):t}var Mr,Ft,qt,_u,Wr,gu,yu,ge=fu(()=>{Mr=function(t,e){return Mr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},Mr(t,e)};Ft=function(){return Ft=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ft.apply(this,arguments)};qt=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]});_u=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},Wr=function(t){return Wr=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Wr(t)};gu=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};yu={__extends:Qs,__assign:Ft,__rest:Zs,__decorate:ei,__param:ti,__esDecorate:ri,__runInitializers:ni,__propKey:si,__setFunctionName:ii,__metadata:oi,__awaiter:ai,__generator:ui,__createBinding:qt,__exportStar:li,__values:Bt,__read:Vr,__spread:ci,__spreadArrays:hi,__spreadArray:di,__await:Ge,__asyncGenerator:fi,__asyncDelegator:pi,__asyncValues:mi,__makeTemplateObject:_i,__importStar:gi,__importDefault:yi,__classPrivateFieldGet:vi,__classPrivateFieldSet:wi,__classPrivateFieldIn:bi,__addDisposableResource:Ei,__disposeResources:Si,__rewriteRelativeImportExtension:Ti}});var Ai=$(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.resolveFetch=void 0;var vu=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);Mt.resolveFetch=vu});var Gr=$(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.FunctionRegion=ye.FunctionsHttpError=ye.FunctionsRelayError=ye.FunctionsFetchError=ye.FunctionsError=void 0;var Je=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};ye.FunctionsError=Je;var Hr=class extends Je{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};ye.FunctionsFetchError=Hr;var Kr=class extends Je{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};ye.FunctionsRelayError=Kr;var zr=class extends Je{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};ye.FunctionsHttpError=zr;var Ri;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Ri||(ye.FunctionRegion=Ri={}))});var ki=$(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.FunctionsClient=void 0;var wu=(ge(),Se(_e)),bu=Ai(),Ye=Gr(),Jr=class{constructor(e,{headers:r={},customFetch:n,region:s=Ye.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=(0,bu.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return wu.__awaiter(this,arguments,void 0,function*(r,n={}){var s;let i,o;try{let{headers:a,method:l,body:c,signal:d,timeout:m}=n,_={},{region:f}=n;f||(f=this.region);let y=new URL(`${this.url}/${r}`);f&&f!=="any"&&(_["x-region"]=f,y.searchParams.set("forceFunctionRegion",f));let v;c&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(_["Content-Type"]="application/octet-stream",v=c):typeof c=="string"?(_["Content-Type"]="text/plain",v=c):typeof FormData<"u"&&c instanceof FormData?v=c:(_["Content-Type"]="application/json",v=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?v=JSON.stringify(c):v=c;let w=d;m&&(o=new AbortController,i=setTimeout(()=>o.abort(),m),d?(w=o.signal,d.addEventListener("abort",()=>o.abort())):w=o.signal);let T=yield this.fetch(y.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},_),this.headers),a),body:v,signal:w}).catch(Z=>{throw new Ye.FunctionsFetchError(Z)}),O=T.headers.get("x-relay-error");if(O&&O==="true")throw new Ye.FunctionsRelayError(T);if(!T.ok)throw new Ye.FunctionsHttpError(T);let E=((s=T.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),x;return E==="application/json"?x=yield T.json():E==="application/octet-stream"||E==="application/pdf"?x=yield T.blob():E==="text/event-stream"?x=T:E==="multipart/form-data"?x=yield T.formData():x=yield T.text(),{data:x,error:null,response:T}}catch(a){return{data:null,error:a,response:a instanceof Ye.FunctionsHttpError||a instanceof Ye.FunctionsRelayError?a.context:void 0}}finally{i&&clearTimeout(i)}})}};Wt.FunctionsClient=Jr});var Oi=$(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.FunctionRegion=fe.FunctionsRelayError=fe.FunctionsHttpError=fe.FunctionsFetchError=fe.FunctionsError=fe.FunctionsClient=void 0;var Eu=ki();Object.defineProperty(fe,"FunctionsClient",{enumerable:!0,get:function(){return Eu.FunctionsClient}});var lt=Gr();Object.defineProperty(fe,"FunctionsError",{enumerable:!0,get:function(){return lt.FunctionsError}});Object.defineProperty(fe,"FunctionsFetchError",{enumerable:!0,get:function(){return lt.FunctionsFetchError}});Object.defineProperty(fe,"FunctionsHttpError",{enumerable:!0,get:function(){return lt.FunctionsHttpError}});Object.defineProperty(fe,"FunctionsRelayError",{enumerable:!0,get:function(){return lt.FunctionsRelayError}});Object.defineProperty(fe,"FunctionRegion",{enumerable:!0,get:function(){return lt.FunctionRegion}})});var Xr=$(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.WebSocketFactory=void 0;var Ht=class{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let r=globalThis.process;if(r){let n=r.versions;if(n&&n.node){let s=n.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
3
|
+
import{a as Js}from"./chunk-IDJIOKXA.js";import"./chunk-IN6XVTUS.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-4RA57LTJ.js";import{a as Br,b as zs,d as Gs}from"./chunk-LVGGCRDW.js";import"./chunk-C2ESM27Z.js";import{b as fu,c as $,d as Ks,e as k,f as ze,g as Se}from"./chunk-PSANHDZM.js";var _e={};Ks(_e,{__addDisposableResource:()=>Ei,__assign:()=>Ft,__asyncDelegator:()=>pi,__asyncGenerator:()=>fi,__asyncValues:()=>mi,__await:()=>Ge,__awaiter:()=>ai,__classPrivateFieldGet:()=>vi,__classPrivateFieldIn:()=>bi,__classPrivateFieldSet:()=>wi,__createBinding:()=>qt,__decorate:()=>ei,__disposeResources:()=>Si,__esDecorate:()=>ri,__exportStar:()=>li,__extends:()=>Qs,__generator:()=>ui,__importDefault:()=>yi,__importStar:()=>gi,__makeTemplateObject:()=>_i,__metadata:()=>oi,__param:()=>ti,__propKey:()=>si,__read:()=>Vr,__rest:()=>Zs,__rewriteRelativeImportExtension:()=>Ti,__runInitializers:()=>ni,__setFunctionName:()=>ii,__spread:()=>ci,__spreadArray:()=>di,__spreadArrays:()=>hi,__values:()=>Bt,default:()=>yu});function Qs(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Mr(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Zs(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function ei(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,r,i):o(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i}function ti(t,e){return function(r,n){e(r,n,t)}}function ri(t,e,r,n,s,i){function o(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=n.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,d=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),m,_=!1,f=r.length-1;f>=0;f--){var y={};for(var v in n)y[v]=v==="access"?{}:n[v];for(var v in n.access)y.access[v]=n.access[v];y.addInitializer=function(T){if(_)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(T||null))};var w=(0,r[f])(a==="accessor"?{get:d.get,set:d.set}:d[l],y);if(a==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(m=o(w.get))&&(d.get=m),(m=o(w.set))&&(d.set=m),(m=o(w.init))&&s.unshift(m)}else(m=o(w))&&(a==="field"?s.unshift(m):d[l]=m)}c&&Object.defineProperty(c,n.name,d),_=!0}function ni(t,e,r){for(var n=arguments.length>2,s=0;s<e.length;s++)r=n?e[s].call(t,r):e[s].call(t);return n?r:void 0}function si(t){return typeof t=="symbol"?t:"".concat(t)}function ii(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function oi(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ai(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(d){try{c(n.next(d))}catch(m){o(m)}}function l(d){try{c(n.throw(d))}catch(m){o(m)}}function c(d){d.done?i(d.value):s(d.value).then(a,l)}c((n=n.apply(t,e||[])).next())})}function ui(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,s&&(i=c[0]&2?s.return:c[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,c[1])).done)return i;switch(s=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,s=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],s=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function li(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qt(e,t,r)}function Bt(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function ci(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Vr(arguments[e]));return t}function hi(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function di(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function Ge(t){return this instanceof Ge?(this.v=t,this):new Ge(t)}function fi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(f){return function(y){return Promise.resolve(y).then(f,m)}}function a(f,y){n[f]&&(s[f]=function(v){return new Promise(function(w,T){i.push([f,v,w,T])>1||l(f,v)})},y&&(s[f]=y(s[f])))}function l(f,y){try{c(n[f](y))}catch(v){_(i[0][3],v)}}function c(f){f.value instanceof Ge?Promise.resolve(f.value.v).then(d,m):_(i[0][2],f)}function d(f){l("next",f)}function m(f){l("throw",f)}function _(f,y){f(y),i.shift(),i.length&&l(i[0][0],i[0][1])}}function pi(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=t[s]?function(o){return(r=!r)?{value:Ge(t[s](o)),done:!1}:i?i(o):o}:i}}function mi(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Bt=="function"?Bt(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(o){return new Promise(function(a,l){o=t[i](o),s(a,l,o.done,o.value)})}}function s(i,o,a,l){Promise.resolve(l).then(function(c){i({value:c,done:a})},o)}}function _i(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function gi(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Wr(t),n=0;n<r.length;n++)r[n]!=="default"&&qt(e,t,r[n]);return _u(e,t),e}function yi(t){return t&&t.__esModule?t:{default:t}}function vi(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function wi(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}function bi(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Ei(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function Si(t){function e(i){t.error=t.hasError?new gu(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var r,n=0;function s(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(s);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(s,function(o){return e(o),s()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return s()}function Ti(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,i,o){return n?e?".jsx":".js":s&&(!i||!o)?r:s+i+"."+o.toLowerCase()+"js"}):t}var Mr,Ft,qt,_u,Wr,gu,yu,ge=fu(()=>{Mr=function(t,e){return Mr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},Mr(t,e)};Ft=function(){return Ft=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ft.apply(this,arguments)};qt=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]});_u=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},Wr=function(t){return Wr=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Wr(t)};gu=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};yu={__extends:Qs,__assign:Ft,__rest:Zs,__decorate:ei,__param:ti,__esDecorate:ri,__runInitializers:ni,__propKey:si,__setFunctionName:ii,__metadata:oi,__awaiter:ai,__generator:ui,__createBinding:qt,__exportStar:li,__values:Bt,__read:Vr,__spread:ci,__spreadArrays:hi,__spreadArray:di,__await:Ge,__asyncGenerator:fi,__asyncDelegator:pi,__asyncValues:mi,__makeTemplateObject:_i,__importStar:gi,__importDefault:yi,__classPrivateFieldGet:vi,__classPrivateFieldSet:wi,__classPrivateFieldIn:bi,__addDisposableResource:Ei,__disposeResources:Si,__rewriteRelativeImportExtension:Ti}});var Ai=$(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.resolveFetch=void 0;var vu=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);Mt.resolveFetch=vu});var Gr=$(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.FunctionRegion=ye.FunctionsHttpError=ye.FunctionsRelayError=ye.FunctionsFetchError=ye.FunctionsError=void 0;var Je=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};ye.FunctionsError=Je;var Hr=class extends Je{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};ye.FunctionsFetchError=Hr;var Kr=class extends Je{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};ye.FunctionsRelayError=Kr;var zr=class extends Je{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};ye.FunctionsHttpError=zr;var Ri;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Ri||(ye.FunctionRegion=Ri={}))});var ki=$(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.FunctionsClient=void 0;var wu=(ge(),Se(_e)),bu=Ai(),Ye=Gr(),Jr=class{constructor(e,{headers:r={},customFetch:n,region:s=Ye.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=(0,bu.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return wu.__awaiter(this,arguments,void 0,function*(r,n={}){var s;let i,o;try{let{headers:a,method:l,body:c,signal:d,timeout:m}=n,_={},{region:f}=n;f||(f=this.region);let y=new URL(`${this.url}/${r}`);f&&f!=="any"&&(_["x-region"]=f,y.searchParams.set("forceFunctionRegion",f));let v;c&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(_["Content-Type"]="application/octet-stream",v=c):typeof c=="string"?(_["Content-Type"]="text/plain",v=c):typeof FormData<"u"&&c instanceof FormData?v=c:(_["Content-Type"]="application/json",v=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?v=JSON.stringify(c):v=c;let w=d;m&&(o=new AbortController,i=setTimeout(()=>o.abort(),m),d?(w=o.signal,d.addEventListener("abort",()=>o.abort())):w=o.signal);let T=yield this.fetch(y.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},_),this.headers),a),body:v,signal:w}).catch(Z=>{throw new Ye.FunctionsFetchError(Z)}),O=T.headers.get("x-relay-error");if(O&&O==="true")throw new Ye.FunctionsRelayError(T);if(!T.ok)throw new Ye.FunctionsHttpError(T);let E=((s=T.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),x;return E==="application/json"?x=yield T.json():E==="application/octet-stream"||E==="application/pdf"?x=yield T.blob():E==="text/event-stream"?x=T:E==="multipart/form-data"?x=yield T.formData():x=yield T.text(),{data:x,error:null,response:T}}catch(a){return{data:null,error:a,response:a instanceof Ye.FunctionsHttpError||a instanceof Ye.FunctionsRelayError?a.context:void 0}}finally{i&&clearTimeout(i)}})}};Wt.FunctionsClient=Jr});var Oi=$(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.FunctionRegion=fe.FunctionsRelayError=fe.FunctionsHttpError=fe.FunctionsFetchError=fe.FunctionsError=fe.FunctionsClient=void 0;var Eu=ki();Object.defineProperty(fe,"FunctionsClient",{enumerable:!0,get:function(){return Eu.FunctionsClient}});var lt=Gr();Object.defineProperty(fe,"FunctionsError",{enumerable:!0,get:function(){return lt.FunctionsError}});Object.defineProperty(fe,"FunctionsFetchError",{enumerable:!0,get:function(){return lt.FunctionsFetchError}});Object.defineProperty(fe,"FunctionsHttpError",{enumerable:!0,get:function(){return lt.FunctionsHttpError}});Object.defineProperty(fe,"FunctionsRelayError",{enumerable:!0,get:function(){return lt.FunctionsRelayError}});Object.defineProperty(fe,"FunctionRegion",{enumerable:!0,get:function(){return lt.FunctionRegion}})});var Xr=$(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.WebSocketFactory=void 0;var Ht=class{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let r=globalThis.process;if(r){let n=r.versions;if(n&&n.node){let s=n.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
4
4
|
import ws from "ws"
|
|
5
5
|
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
|
|
6
6
|
|
|
@@ -65,4 +65,4 @@ Check the top-level render call using <`+p+">.")}return h}function Us(u,h){if(!(
|
|
|
65
65
|
|
|
66
66
|
Caused by: ${(y=d?.name)!==null&&y!==void 0?y:"Error"}: ${T}`,O&&(a+=` (${O})`),d?.stack&&(a+=`
|
|
67
67
|
${d.stack}`)}else{var v;a=(v=i?.stack)!==null&&v!==void 0?v:""}let w=this.url.toString().length;return i?.name==="AbortError"||i?.code==="ABORT_ERR"?(c="",l="Request was aborted (timeout or manual cancellation)",w>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${w} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(d?.name==="HeadersOverflowError"||d?.code==="UND_ERR_HEADERS_OVERFLOW")&&(c="",l="HTTP headers exceeded server limits (typically 16KB)",w>this.urlLengthLimit&&(l+=`. Your request URL is ${w} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(o=i?.name)!==null&&o!==void 0?o:"FetchError"}: ${i?.message}`,details:a,hint:l,code:c},data:null,count:null,status:0,statusText:""}})),s.then(t,e)}returns(){return this}overrideTypes(){return this}},Tu=class extends Su{select(t){let e=!1,r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){let i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){let n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){let s=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(i,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var o;let a=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}},Ci=new RegExp("[,()]"),Xe=class extends Tu{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){let r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Ci.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){let r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Ci.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");let i=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${i}.${e}`),this}match(t){return Object.entries(t).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){let n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},Au=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:s=8e3}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){let{head:r=!1,count:n}=e??{},s=r?"HEAD":"GET",i=!1,o=(t??"*").split("").map(c=>/\s/.test(c)&&!i?"":(c==='"'&&(i=!i),c)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),n&&l.append("Prefer",`count=${n}`),new Xe({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;let s="POST",{url:i,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),r||o.append("Prefer","missing=default"),Array.isArray(t)){let a=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(a.length>0){let l=[...new Set(a)].map(c=>`"${c}"`);i.searchParams.set("columns",l.join(","))}}return new Xe({method:s,url:i,headers:o,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;let o="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(t)){let c=t.reduce((d,m)=>d.concat(Object.keys(m)),[]);if(c.length>0){let d=[...new Set(c)].map(m=>`"${m}"`);a.searchParams.set("columns",d.join(","))}}return new Xe({method:o,url:a,headers:l,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit})}update(t,{count:e}={}){var r;let n="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Xe({method:n,url:s,headers:i,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:t}={}){var e;let r="DELETE",{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Xe({method:r,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit})}};function ct(t){"@babel/helpers - typeof";return ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ct(t)}function Ru(t,e){if(ct(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ct(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ku(t){var e=Ru(t,"string");return ct(e)=="symbol"?e:e+""}function Ou(t,e,r){return(e=ku(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Vt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pi(Object(r),!0).forEach(function(n){Ou(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Ii=class xi{constructor(e,{headers:r={},schema:n,fetch:s,timeout:i,urlLengthLimit:o=8e3}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;let a=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(l,c)=>{let d=new AbortController,m=setTimeout(()=>d.abort(),i),_=c?.signal;if(_){if(_.aborted)return clearTimeout(m),a(l,c);let f=()=>{clearTimeout(m),d.abort()};return _.addEventListener("abort",f,{once:!0}),a(l,Vt(Vt({},c),{},{signal:d.signal})).finally(()=>{clearTimeout(m),_.removeEventListener("abort",f)})}return a(l,Vt(Vt({},c),{},{signal:d.signal})).finally(()=>clearTimeout(m))}:this.fetch=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new Au(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(e){return new xi(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(e,r={},{head:n=!1,get:s=!1,count:i}={}){var o;let a,l=new URL(`${this.url}/rpc/${e}`),c,d=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(d)),m=n&&Object.values(r).some(d);m?(a="POST",c=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([f,y])=>y!==void 0).map(([f,y])=>[f,Array.isArray(y)?`{${y.join(",")}}`:`${y}`]).forEach(([f,y])=>{l.searchParams.append(f,y)})):(a="POST",c=r);let _=new Headers(this.headers);return m?_.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&_.set("Prefer",`count=${i}`),new Xe({method:a,url:l,headers:_,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit})}};var Po=ze(mn(),1);var mt=class extends Error{constructor(t,e){super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&e.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Qu(t,e,r){let n=new URL(e,t);if(r)for(let[s,i]of Object.entries(r))i!==void 0&&n.searchParams.set(s,i);return n.toString()}async function Zu(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function el(t){let e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:o}){let a=Qu(t.baseUrl,n,s),l=await Zu(t.auth),c=await e(a,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):void 0}),d=await c.text(),m=(c.headers.get("content-type")||"").includes("application/json"),_=m&&d?JSON.parse(d):d;if(!c.ok){let f=m?_:void 0,y=f?.error;throw new mt(y?.message??`Request failed with status ${c.status}`,{status:c.status,icebergType:y?.type,icebergCode:y?.code,details:f})}return{status:c.status,headers:c.headers,data:_}}}}function Zt(t){return t.join("")}var tl=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){let e=t?{parent:Zt(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){let r={namespace:t.namespace,properties:e?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Zt(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Zt(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Zt(t.namespace)}`}),!0}catch(e){if(e instanceof mt&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof mt&&r.status===409)return;throw r}}};function Qe(t){return t.join("")}var rl=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Qe(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Qe(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Qe(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Qe(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String(e?.purge??!1)}})}async loadTable(t){let e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Qe(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){let e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Qe(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof mt&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof mt&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},zi=class{constructor(t){let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);let r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=el({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=t.accessDelegation?.join(","),this.namespaceOps=new tl(this.client,e),this.tableOps=new rl(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};var tr=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function rr(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var er=class extends tr{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Xi=class extends tr{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};var nl=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),sl=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},_n=t=>{if(Array.isArray(t))return t.map(r=>_n(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let s=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=_n(n)}),e},il=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function gt(t){"@babel/helpers - typeof";return gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gt(t)}function ol(t,e){if(gt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(gt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function al(t){var e=ol(t,"string");return gt(e)=="symbol"?e:e+""}function ul(t,e,r){return(e=al(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Gi(Object(r),!0).forEach(function(n){ul(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Ji=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},ll=async(t,e,r,n)=>{if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!r?.noResolveJson){let s=t,i=s.status||500;if(typeof s.json=="function")s.json().then(o=>{let a=o?.statusCode||o?.code||i+"";e(new er(Ji(o),i,a,n))}).catch(()=>{if(n==="vectors"){let o=i+"";e(new er(s.statusText||`HTTP ${i} error`,i,o,n))}else{let o=i+"";e(new er(s.statusText||`HTTP ${i} error`,i,o,n))}});else{let o=i+"";e(new er(s.statusText||`HTTP ${i} error`,i,o,n))}}else e(new Xi(Ji(t),t,n))},cl=(t,e,r,n)=>{let s={method:t,headers:e?.headers||{}};return t==="GET"||t==="HEAD"||!n?P(P({},s),r):(sl(n)?(s.headers=P({"Content-Type":"application/json"},e?.headers),s.body=JSON.stringify(n)):s.body=n,e?.duplex&&(s.duplex=e.duplex),P(P({},s),r))};async function _t(t,e,r,n,s,i,o){return new Promise((a,l)=>{t(r,cl(e,n,s,i)).then(c=>{if(!c.ok)throw c;if(n?.noResolveJson)return c;if(o==="vectors"){let d=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!d||!d.includes("application/json"))return{}}return c.json()}).then(c=>a(c)).catch(c=>ll(c,l,n,o))})}function Qi(t="storage"){return{get:async(e,r,n,s)=>_t(e,"GET",r,n,s,void 0,t),post:async(e,r,n,s,i)=>_t(e,"POST",r,s,i,n,t),put:async(e,r,n,s,i)=>_t(e,"PUT",r,s,i,n,t),head:async(e,r,n,s)=>_t(e,"HEAD",r,P(P({},n),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,r,n,s,i)=>_t(e,"DELETE",r,s,i,n,t)}}var hl=Qi("storage"),{get:yt,post:Ae,put:gn,head:dl,remove:yn}=hl,me=Qi("vectors"),Ze=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=e,this.fetch=nl(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=P(P({},this.headers),{},{[t]:e}),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}},fl=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(rr(e))return{data:null,error:e};throw e}}},Zi;Zi=Symbol.toStringTag;var pl=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[Zi]="BlobDownloadBuilder",this.promise=null}asStream(){return new fl(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(rr(e))return{data:null,error:e};throw e}}},ml={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Yi={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},_l=class extends Ze{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var s=this;return s.handleOperation(async()=>{let i,o=P(P({},Yi),n),a=P(P({},s.headers),t==="POST"&&{"x-upsert":String(o.upsert)}),l=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),n?.headers&&(a=P(P({},a),n.headers));let c=s._removeEmptyFolders(e),d=s._getFinalPath(c),m=await(t=="PUT"?gn:Ae)(s.fetch,`${s.url}/object/${d}`,i,P({headers:a},o?.duplex?{duplex:o.duplex}:{}));return{path:c,id:m.Id,fullPath:m.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var s=this;let i=s._removeEmptyFolders(t),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",e),s.handleOperation(async()=>{let l,c=P({upsert:Yi.upsert},n),d=P(P({},s.headers),{"x-upsert":String(c.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",c.cacheControl)):(l=r,d["cache-control"]=`max-age=${c.cacheControl}`,d["content-type"]=c.contentType),{path:i,fullPath:(await gn(s.fetch,a.toString(),l,{headers:d})).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t),s=P({},r.headers);e?.upsert&&(s["x-upsert"]="true");let i=await Ae(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(r.url+i.url),a=o.searchParams.get("token");if(!a)throw new tr("No token returned by API");return{signedUrl:o.toString(),path:t,token:a}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await Ae(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r?.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await Ae(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r?.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(t),i=await Ae(n.fetch,`${n.url}/object/sign/${s}`,P({expiresIn:e},r?.transform?{transform:r.transform}:{}),{headers:n.headers}),o=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{signedUrl:encodeURI(`${n.url}${i.signedURL}${o}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{let s=await Ae(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),i=r?.download?`&download=${r.download===!0?"":r.download}`:"";return s.map(o=>P(P({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${i}`):null}))})}download(t,e,r){let n=typeof e?.transform<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString(e?.transform||{}),i=s?`?${s}`:"",o=this._getFinalPath(t),a=()=>yt(this.fetch,`${this.url}/${n}/${o}${i}`,{headers:this.headers,noResolveJson:!0},r);return new pl(a,this.shouldThrowOnError)}async info(t){var e=this;let r=e._getFinalPath(t);return e.handleOperation(async()=>_n(await yt(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;let r=e._getFinalPath(t);try{return await dl(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(rr(n)&&n instanceof Xi){let s=n.originalError;if([400,404].includes(s?.status))return{data:!1,error:n}}throw n}}getPublicUrl(t,e){let r=this._getFinalPath(t),n=[],s=e?.download?`download=${e.download===!0?"":e.download}`:"";s!==""&&n.push(s);let i=typeof e?.transform<"u"?"render/image":"object",o=this.transformOptsToQueryString(e?.transform||{});o!==""&&n.push(o);let a=n.join("&");return a!==""&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}${a}`)}}}async remove(t){var e=this;return e.handleOperation(async()=>await yn(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{let s=P(P(P({},ml),e),{},{prefix:t||""});return await Ae(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{let n=P({},t);return await Ae(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){let e=[];return t.width&&e.push(`width=${t.width}`),t.height&&e.push(`height=${t.height}`),t.resize&&e.push(`resize=${t.resize}`),t.format&&e.push(`format=${t.format}`),t.quality&&e.push(`quality=${t.quality}`),e.join("&")}},gl="2.97.0",vt={"X-Client-Info":`storage-js/${gl}`},yl=class extends Ze{constructor(t,e={},r,n){let s=new URL(t);n?.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));let i=s.href.replace(/\/$/,""),o=P(P({},vt),e);super(i,o,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{let r=e.listBucketOptionsToQueryString(t);return await yt(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await yt(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Ae(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await gn(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Ae(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await yn(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){let e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},vl=class extends Ze{constructor(t,e={},r){let n=t.replace(/\/$/,""),s=P(P({},vt),e);super(n,s,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Ae(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{let r=new URLSearchParams;t?.limit!==void 0&&r.set("limit",t.limit.toString()),t?.offset!==void 0&&r.set("offset",t.offset.toString()),t?.sortColumn&&r.set("sortColumn",t.sortColumn),t?.sortOrder&&r.set("sortOrder",t.sortOrder),t?.search&&r.set("search",t.search);let n=r.toString(),s=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await yt(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await yn(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!il(t))throw new tr("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new zi({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,i){let o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},wl=class extends Ze{constructor(t,e={},r){let n=t.replace(/\/$/,""),s=P(P({},vt),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await me.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await me.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},bl=class extends Ze{constructor(t,e={},r){let n=t.replace(/\/$/,""),s=P(P({},vt),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},El=class extends Ze{constructor(t,e={},r){let n=t.replace(/\/$/,""),s=P(P({},vt),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await me.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},Sl=class extends El{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new Tl(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},Tl=class extends wl{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,P(P({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,P(P({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new Al(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},Al=class extends bl{constructor(t,e,r,n,s){super(t,e,s),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,P(P({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,P(P({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,P(P({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,P(P({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,P(P({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},eo=class extends yl{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new _l(this.url,this.headers,t,this.fetch)}get vectors(){return new Sl(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new vl(this.url+"/iceberg",this.headers,this.fetch)}};var Io=ze(Xn(),1);k(R,ze(mn(),1));k(R,ze(Xn(),1));var eh="2.97.0",Tt="";typeof Deno<"u"?Tt="deno":typeof document<"u"?Tt="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Tt="react-native":Tt="node";var th={"X-Client-Info":`supabase-js-${Tt}/${eh}`},rh={headers:th},nh={schema:"public"},sh={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ih={};function At(t){"@babel/helpers - typeof";return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(t)}function oh(t,e){if(At(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(At(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ah(t){var e=oh(t,"string");return At(e)=="symbol"?e:e+""}function uh(t,e,r){return(e=ah(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Co(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(r),!0).forEach(function(n){uh(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Co(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var lh=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),ch=()=>Headers,hh=(t,e,r)=>{let n=lh(r),s=ch();return async(i,o)=>{var a;let l=(a=await e())!==null&&a!==void 0?a:t,c=new s(o?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),n(i,se(se({},o),{},{headers:c}))}};function dh(t){return t.endsWith("/")?t:t+"/"}function fh(t,e){var r,n;let{db:s,auth:i,realtime:o,global:a}=t,{db:l,auth:c,realtime:d,global:m}=e,_={db:se(se({},l),s),auth:se(se({},c),i),realtime:se(se({},d),o),storage:{},global:se(se(se({},m),a),{},{headers:se(se({},(r=m?.headers)!==null&&r!==void 0?r:{}),(n=a?.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?_.accessToken=t.accessToken:delete _.accessToken,_}function ph(t){let e=t?.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(dh(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var mh=class extends Io.AuthClient{constructor(t){super(t)}},xo=class{constructor(t,e,r){var n,s;this.supabaseUrl=t,this.supabaseKey=e;let i=ph(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);let o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:nh,realtime:ih,auth:se(se({},sh),{},{storageKey:o}),global:rh},l=fh(r??{},a);if(this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(d,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=l.auth)!==null&&c!==void 0?c:{},this.headers,l.global.fetch)}this.fetch=hh(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(se({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new Ii(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new eo(this.storageUrl.href,this.headers,this.fetch,r?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new be.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();let{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:o,lock:a,debug:l,throwOnError:c},d,m){let _={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new mh({url:this.authUrl.href,headers:se(se({},_),d),storageKey:i,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:c,fetch:m,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new Po.RealtimeClient(this.realtimeUrl.href,se(se({},t),{},{params:se(se({},{apikey:this.supabaseKey}),t?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e?.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}},Qn=(t,e,r)=>new xo(t,e,r);function _h(){if(typeof window<"u")return!1;let t=globalThis.process;if(!t)return!1;let e=t.version;if(e==null)return!1;let r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}_h()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");var Rt=typeof window<"u"&&!!window.__CONFORM_ENGINE__,No=Rt?"http://127.0.0.1:9":import.meta.env.VITE_SUPABASE_URL,jo=Rt?"offline":import.meta.env.VITE_SUPABASE_ANON_KEY;if(!No)throw console.error("Missing VITE_SUPABASE_URL environment variable"),new Error("Missing Supabase URL environment variable");if(!jo)throw console.error("Missing VITE_SUPABASE_ANON_KEY environment variable"),new Error("Missing Supabase anon key environment variable");var Uo=Qn(No,jo,{auth:{autoRefreshToken:!Rt,persistSession:!Rt,detectSessionInUrl:!Rt}});var gh=`${import.meta.env.VITE_SUPABASE_URL}/functions/v1`;async function Lo(t){let{data:{session:e}}=await Uo.auth.getSession(),r=e?.access_token??import.meta.env.VITE_SUPABASE_ANON_KEY,n=JSON.stringify({format:t.format,source_filename:t.sourceFilename,persist:t.persist,session_id:t.sessionId,selected_sequence_names:t.selectedSequenceNames,previously_selected_names:t.previouslySelectedNames}),s=typeof t.extract=="string"?t.extract:JSON.stringify(t.extract),i=n+`
|
|
68
|
-
`+s,o=new Set([502,503,504,529,546]),a=null;for(let l=0;;l++){try{a=await fetch(`${gh}/v1-timeline-canonicalize/v1/timeline-canonicalize`,{method:"POST",headers:{"Content-Type":"application/x-ct-canonicalize-v1",Authorization:`Bearer ${r}`},body:i})}catch(c){if(l>=2)throw c;a=null}if(a&&(a.ok||!o.has(a.status)))break;if(l>=2)throw a?.status===546?new Error("Our conversion server stopped this timeline three times in a row. That is a limit on our side, not a problem with your file. Please try again later; if it keeps failing, converting fewer sequences at a time gets it through, and we'd like to hear about it."):new Error(`The processing server timed out (${a?.status??"network error"}) \u2014 a server hiccup, not a problem with your file. Please try again in a minute.`);await new Promise(c=>setTimeout(c,1500*(l+1)))}if(!a.ok){let l=await a.json().catch(()=>({}));throw new Error(l?.error?.message??`canonicalize failed (${a.status})`)}return await a.json()}var yh=[{ext:"mov",name:"QuickTime",container:"mov",codec:"prores",frameType:"intra",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0},{ext:"mp4",name:"MPEG-4",container:"mov",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0},{ext:"m4v",name:"MPEG-4 Video",container:"mov",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0},{ext:"m4a",name:"MPEG-4 Audio",container:"mov",codec:"aac",frameType:"intra",sparseStrategy:"full-file",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"mxf",name:"MXF",container:"mxf",codec:"varies",frameType:"intra",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0,notes:"Verified Resolve playback for XAVC-I NDF/DF. Coordinated 45-patch metadata rewrite (index entries + Duration fields). DNxHD foundation works; mid-clip trim works structurally; awaiting more corpus."},{ext:"r3d",name:"RED RAW",container:"r3d",codec:"r3d",frameType:"intra",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0,notes:"Verified Resolve playback (V-Raptor 6K). Trim/prepare/inspect run client-side as opaque WASM (mediaOp) \u2014 browser sees no algorithm; WS bridge retired. DRAGON era + Komodo + 8K need corpus expansion. Run oracle/i2o/cli/r3d-corpus.ts on new fixtures."},{ext:"braw",name:"Blackmagic RAW",container:"mov",codec:"braw",frameType:"intra",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0,notes:'Verified Resolve playback. Standard MP4 container with BRAW codec; reuses structure-preserving MOV walker. The "secret sauce" was knowing BRAW = MP4.'},{ext:"crm",name:"Canon Cinema RAW Light",container:"crm",codec:"crm",frameType:"intra",sparseStrategy:"byte-range",support:"planned",needsStructuralBytes:!1,trimSupported:!1,notes:"Frame-indexed single file. Canon SDK available."},{ext:"rmf",name:"Canon RAW (legacy)",container:"crm",codec:"crm",frameType:"intra",sparseStrategy:"byte-range",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"ari",name:"ARRIRAW",container:"frame-seq",codec:"arriraw",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1,notes:"8KB header + raw Bayer per frame. Sparse = select which .ari files to include."},{ext:"arx",name:"ARRIRAW HDE",container:"frame-seq",codec:"arriraw",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"dpx",name:"DPX",container:"frame-seq",codec:"dpx",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1,notes:"SMPTE 268M. Image data offset at byte 4. ~25MB per 4K frame."},{ext:"exr",name:"OpenEXR",container:"frame-seq",codec:"exr",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"tif",name:"TIFF",container:"frame-seq",codec:"tiff",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"tiff",name:"TIFF",container:"frame-seq",codec:"tiff",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"png",name:"PNG",container:"frame-seq",codec:"png",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"jpg",name:"JPEG",container:"frame-seq",codec:"jpeg",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"jpeg",name:"JPEG",container:"frame-seq",codec:"jpeg",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"psd",name:"Photoshop",container:"still",codec:"psd",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"tga",name:"Targa",container:"still",codec:"tga",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"bmp",name:"Bitmap",container:"still",codec:"bmp",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"gif",name:"GIF",container:"still",codec:"gif",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"webp",name:"WebP",container:"still",codec:"webp",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"avif",name:"AVIF",container:"still",codec:"avif",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"wav",name:"WAV",container:"audio",codec:"pcm",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!0,notes:"RIFF/WAV trim decoder ships. Poly WAV (8-24ch) could benefit from time-axis chunking."},{ext:"bwf",name:"Broadcast WAV",container:"audio",codec:"pcm",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!0,notes:"WAV + bext chunk (~602+ bytes) with timecode reference. Same trim decoder as WAV."},{ext:"aif",name:"AIFF",container:"audio",codec:"pcm",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1},{ext:"aiff",name:"AIFF",container:"audio",codec:"pcm",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1},{ext:"mp3",name:"MP3",container:"audio",codec:"mp3",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1},{ext:"aac",name:"AAC",container:"audio",codec:"aac",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1},{ext:"avi",name:"AVI",container:"avi",codec:"varies",frameType:"intra",sparseStrategy:"byte-range",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"mkv",name:"Matroska",container:"mkv",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"mts",name:"AVCHD",container:"mov",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"m2ts",name:"AVCHD",container:"mov",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"webm",name:"WebM",container:"mkv",codec:"vp9",frameType:"inter",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1}],$o=new Map;for(let t of yh)$o.set(t.ext,t);function vh(t){let e=t.split(".").pop()?.toLowerCase();return e?$o.get(e)??null:null}function Do(t){return vh(t)!==null}var Lh=ze(Qo());var Uh=typeof __BUILD_SHA__<"u"?__BUILD_SHA__:"dev",br=class extends Error{constructor(e,r){super(r??"A new version of Conform was released while this page was open, so part of the app could no longer be loaded. Reload the page to continue \u2014 nothing has been sent yet."),this.name="StaleBuildError",this.chunk=e,this.buildSha=Uh}};var Zo=typeof __BUILD_SHA__<"u"?__BUILD_SHA__:"dev",Af=900*1e3;async function $h(t=fetch,e=Zo){if(!e||e==="dev"||e==="unknown")return!1;try{let r=await t(`/build-info.json?t=${Date.now()}`,{cache:"no-store"});if(!r.ok)return!1;let n=await r.json();return typeof n.sha=="string"&&n.sha!==""&&n.sha!=="unknown"&&n.sha!==e}catch{return!1}}async function ea(t=fetch,e=Zo){if(await $h(t,e))throw new br("timeline-read","A new version of Conform was released while this page was open. Reload the page and drop the file again \u2014 nothing has been read or sent yet.")}function ta(){return typeof window<"u"&&!!window.__CONFORM_ENGINE__}async function Uf(t){if(Do(t.name))return await Dh(t);let e=await qr(t);if(e.format!=="unknown"&&Br(e.format)){let{names:r}=await zs(t,e.format);return{kind:"timeline",format:e.format,name:t.name,observed_bytes:t.size,total_size:t.size,session:{id:null,inline:{timelines:r.map(n=>({name:n}))}},warnings:[],inspector:{layer:"timeline-core/wasm-inspect",version:"1",duration_ms:0}}}return{kind:"unknown",format:"unknown",name:t.name,observed_bytes:0,total_size:t.size,session:null,warnings:[{code:"container_corruption",message:`Unrecognized file: ${t.name}`}],inspector:{layer:"inspect/unknown",version:"1",duration_ms:0}}}async function Dh(t){let e=Date.now(),r=await Js(t);if(!r)return{kind:"unknown",format:"unknown",name:t.name,observed_bytes:0,total_size:t.size,session:null,warnings:[{code:"container_corruption",message:"No browser-side probe available (proprietary format or unsupported extension)"}],inspector:{layer:"probe-media/local",version:"1",duration_ms:Date.now()-e}};let n=r.container??"media",s={metadata:{id:t.name,user_id:"",source_format:n,source_filename:t.name,source_file_sha256:null,source_file_bytes:t.size,parser_name:`media:${n}`,parser_version:"1",status:"ready",error_message:null,metadata:{},created_at:new Date().toISOString()},timelines:[],media_references:[r]};return{kind:"media",format:n,name:t.name,observed_bytes:0,total_size:t.size,session:{id:null,inline:s},warnings:[],inspector:{layer:"probe-media/local",version:"1",duration_ms:Date.now()-e}}}var ra=new Map,Fh=t=>t.replace(/^[a-z]\d+:/,""),Lf=t=>ra.get(Fh(t));async function $f(t,e={}){if(ta()){let{engine:o}=await import("./engine-6ACEWA4S.js"),a=await o.canonicalize(t,e.selectedSequenceNames,e.previouslySelectedNames);for(let l of a.session.timelines??[])ra.set(l.id,a.session_id);return{session:a.session,sessionId:a.session_id,persistError:null}}let{format:r}=await qr(t);if(!Br(r))throw new Error(`No Rust timeline engine for format '${r}' (${t.name})`);await ea();let{fmt:n,extract:s}=await Gs(t,r,e.selectedSequenceNames),i=await Lo({format:n,extract:s,sourceFilename:t.name,persist:e.persist,sessionId:e.sessionId,selectedSequenceNames:e.selectedSequenceNames,previouslySelectedNames:e.previouslySelectedNames});return{session:i.session,sessionId:i.session_id??i.session?.id??null,persistError:i.persist_error??null}}export{$f as canonicalizeTimelineFile,Lf as engineSessionFor,Fh as engineTimelineId,Uf as inspectFile};
|
|
68
|
+
`+s,o=new Set([502,503,504,529,546]),a=null;for(let l=0;;l++){try{a=await fetch(`${gh}/v1-timeline-canonicalize/v1/timeline-canonicalize`,{method:"POST",headers:{"Content-Type":"application/x-ct-canonicalize-v1",Authorization:`Bearer ${r}`},body:i})}catch(c){if(l>=2)throw c;a=null}if(a&&(a.ok||!o.has(a.status)))break;if(l>=2)throw a?.status===546?new Error("Our conversion server stopped this timeline three times in a row. That is a limit on our side, not a problem with your file. Please try again later; if it keeps failing, converting fewer sequences at a time gets it through, and we'd like to hear about it."):new Error(`The processing server timed out (${a?.status??"network error"}) \u2014 a server hiccup, not a problem with your file. Please try again in a minute.`);await new Promise(c=>setTimeout(c,1500*(l+1)))}if(!a.ok){let l=await a.json().catch(()=>({}));throw new Error(l?.error?.message??`canonicalize failed (${a.status})`)}return await a.json()}var yh=[{ext:"mov",name:"QuickTime",container:"mov",codec:"prores",frameType:"intra",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0},{ext:"mp4",name:"MPEG-4",container:"mov",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0},{ext:"m4v",name:"MPEG-4 Video",container:"mov",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0},{ext:"m4a",name:"MPEG-4 Audio",container:"mov",codec:"aac",frameType:"intra",sparseStrategy:"full-file",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"mxf",name:"MXF",container:"mxf",codec:"varies",frameType:"intra",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0,notes:"Verified Resolve playback for XAVC-I NDF/DF. Coordinated 45-patch metadata rewrite (index entries + Duration fields). DNxHD foundation works; mid-clip trim works structurally; awaiting more corpus."},{ext:"r3d",name:"RED RAW",container:"r3d",codec:"r3d",frameType:"intra",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0,notes:"Verified Resolve playback (V-Raptor 6K). Trim/prepare/inspect run client-side as opaque WASM (mediaOp) \u2014 browser sees no algorithm; WS bridge retired. DRAGON era + Komodo + 8K need corpus expansion. Run oracle/i2o/cli/r3d-corpus.ts on new fixtures."},{ext:"braw",name:"Blackmagic RAW",container:"mov",codec:"braw",frameType:"intra",sparseStrategy:"byte-range",support:"dedicated",needsStructuralBytes:!1,trimSupported:!0,notes:'Verified Resolve playback. Standard MP4 container with BRAW codec; reuses structure-preserving MOV walker. The "secret sauce" was knowing BRAW = MP4.'},{ext:"crm",name:"Canon Cinema RAW Light",container:"crm",codec:"crm",frameType:"intra",sparseStrategy:"byte-range",support:"planned",needsStructuralBytes:!1,trimSupported:!1,notes:"Frame-indexed single file. Canon SDK available."},{ext:"rmf",name:"Canon RAW (legacy)",container:"crm",codec:"crm",frameType:"intra",sparseStrategy:"byte-range",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"ari",name:"ARRIRAW",container:"frame-seq",codec:"arriraw",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1,notes:"8KB header + raw Bayer per frame. Sparse = select which .ari files to include."},{ext:"arx",name:"ARRIRAW HDE",container:"frame-seq",codec:"arriraw",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"dpx",name:"DPX",container:"frame-seq",codec:"dpx",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1,notes:"SMPTE 268M. Image data offset at byte 4. ~25MB per 4K frame."},{ext:"exr",name:"OpenEXR",container:"frame-seq",codec:"exr",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"tif",name:"TIFF",container:"frame-seq",codec:"tiff",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"tiff",name:"TIFF",container:"frame-seq",codec:"tiff",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"png",name:"PNG",container:"frame-seq",codec:"png",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"jpg",name:"JPEG",container:"frame-seq",codec:"jpeg",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"jpeg",name:"JPEG",container:"frame-seq",codec:"jpeg",frameType:"intra",sparseStrategy:"file-select",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"psd",name:"Photoshop",container:"still",codec:"psd",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"tga",name:"Targa",container:"still",codec:"tga",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"bmp",name:"Bitmap",container:"still",codec:"bmp",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"gif",name:"GIF",container:"still",codec:"gif",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"webp",name:"WebP",container:"still",codec:"webp",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"avif",name:"AVIF",container:"still",codec:"avif",frameType:"intra",sparseStrategy:"full-file",support:"planned",needsStructuralBytes:!1,trimSupported:!1},{ext:"wav",name:"WAV",container:"audio",codec:"pcm",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!0,notes:"RIFF/WAV trim decoder ships. Poly WAV (8-24ch) could benefit from time-axis chunking."},{ext:"bwf",name:"Broadcast WAV",container:"audio",codec:"pcm",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!0,notes:"WAV + bext chunk (~602+ bytes) with timecode reference. Same trim decoder as WAV."},{ext:"aif",name:"AIFF",container:"audio",codec:"pcm",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1},{ext:"aiff",name:"AIFF",container:"audio",codec:"pcm",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1},{ext:"mp3",name:"MP3",container:"audio",codec:"mp3",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1},{ext:"aac",name:"AAC",container:"audio",codec:"aac",frameType:"intra",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1},{ext:"avi",name:"AVI",container:"avi",codec:"varies",frameType:"intra",sparseStrategy:"byte-range",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"mkv",name:"Matroska",container:"mkv",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"mts",name:"AVCHD",container:"mov",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"m2ts",name:"AVCHD",container:"mov",codec:"h264",frameType:"inter",sparseStrategy:"byte-range",support:"container",needsStructuralBytes:!1,trimSupported:!1},{ext:"webm",name:"WebM",container:"mkv",codec:"vp9",frameType:"inter",sparseStrategy:"full-file",support:"full-file",needsStructuralBytes:!1,trimSupported:!1}],$o=new Map;for(let t of yh)$o.set(t.ext,t);function vh(t){let e=t.split(".").pop()?.toLowerCase();return e?$o.get(e)??null:null}function Do(t){return vh(t)!==null}var Lh=ze(Qo());var Uh=typeof __BUILD_SHA__<"u"?__BUILD_SHA__:"dev",br=class extends Error{constructor(e,r){super(r??"A new version of Conform was released while this page was open, so part of the app could no longer be loaded. Reload the page to continue \u2014 nothing has been sent yet."),this.name="StaleBuildError",this.chunk=e,this.buildSha=Uh}};var Zo=typeof __BUILD_SHA__<"u"?__BUILD_SHA__:"dev",Af=900*1e3;async function $h(t=fetch,e=Zo){if(!e||e==="dev"||e==="unknown")return!1;try{let r=await t(`/build-info.json?t=${Date.now()}`,{cache:"no-store"});if(!r.ok)return!1;let n=await r.json();return typeof n.sha=="string"&&n.sha!==""&&n.sha!=="unknown"&&n.sha!==e}catch{return!1}}async function ea(t=fetch,e=Zo){if(await $h(t,e))throw new br("timeline-read","A new version of Conform was released while this page was open. Reload the page and drop the file again \u2014 nothing has been read or sent yet.")}function ta(){return typeof window<"u"&&!!window.__CONFORM_ENGINE__}async function Uf(t){if(Do(t.name))return await Dh(t);let e=await qr(t);if(e.format!=="unknown"&&Br(e.format)){let{names:r}=await zs(t,e.format);return{kind:"timeline",format:e.format,name:t.name,observed_bytes:t.size,total_size:t.size,session:{id:null,inline:{timelines:r.map(n=>({name:n}))}},warnings:[],inspector:{layer:"timeline-core/wasm-inspect",version:"1",duration_ms:0}}}return{kind:"unknown",format:"unknown",name:t.name,observed_bytes:0,total_size:t.size,session:null,warnings:[{code:"container_corruption",message:`Unrecognized file: ${t.name}`}],inspector:{layer:"inspect/unknown",version:"1",duration_ms:0}}}async function Dh(t){let e=Date.now(),r=await Js(t);if(!r)return{kind:"unknown",format:"unknown",name:t.name,observed_bytes:0,total_size:t.size,session:null,warnings:[{code:"container_corruption",message:"No browser-side probe available (proprietary format or unsupported extension)"}],inspector:{layer:"probe-media/local",version:"1",duration_ms:Date.now()-e}};let n=r.container??"media",s={metadata:{id:t.name,user_id:"",source_format:n,source_filename:t.name,source_file_sha256:null,source_file_bytes:t.size,parser_name:`media:${n}`,parser_version:"1",status:"ready",error_message:null,metadata:{},created_at:new Date().toISOString()},timelines:[],media_references:[r]};return{kind:"media",format:n,name:t.name,observed_bytes:0,total_size:t.size,session:{id:null,inline:s},warnings:[],inspector:{layer:"probe-media/local",version:"1",duration_ms:Date.now()-e}}}var ra=new Map,Fh=t=>t.replace(/^[a-z]\d+:/,""),Lf=t=>ra.get(Fh(t));async function $f(t,e={}){if(ta()){let{engine:o}=await import("./engine-HXZCA42S.js"),a=await o.canonicalize(t,e.selectedSequenceNames,e.previouslySelectedNames);for(let l of a.session.timelines??[])ra.set(l.id,a.session_id);return{session:a.session,sessionId:a.session_id,persistError:null}}let{format:r}=await qr(t);if(!Br(r))throw new Error(`No Rust timeline engine for format '${r}' (${t.name})`);await ea();let{fmt:n,extract:s}=await Gs(t,r,e.selectedSequenceNames),i=await Lo({format:n,extract:s,sourceFilename:t.name,persist:e.persist,sessionId:e.sessionId,selectedSequenceNames:e.selectedSequenceNames,previouslySelectedNames:e.previouslySelectedNames});return{session:i.session,sessionId:i.session_id??i.session?.id??null,persistError:i.persist_error??null}}export{$f as canonicalizeTimelineFile,Lf as engineSessionFor,Fh as engineTimelineId,Uf as inspectFile};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{a as N}from"./chunk-TK55FA56.js";import{a as T,b as L}from"./chunk-AACY2V3L.js";import{b as p,c as O,g as J}from"./chunk-XDI6CPPV.js";import{b as V}from"./chunk-UKXSKFL3.js";import{b as $,c as _}from"./chunk-4RA57LTJ.js";import{$ as f,A as P,B as x,C as F,D as A,Da as k,Ga as C,Ha as U,Ia as d,N as D,O as z,ha as E,k as w,m as v,n as y,p as R,qa as H,ta as I,x as S,y as M}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";function m(e){return(t,n)=>e.read(t,n)}function B(e){let t=e.toLowerCase().trim();return t==="aprn"||t==="aprh"?"prores_raw":t==="apch"||t==="apcn"||t==="apcs"||t==="apco"||t==="ap4h"||t==="ap4x"?"prores":t==="avdn"?"dnxhd":t==="dnxh"?"dnxhr":t==="avc1"||t==="avc3"?"h264":t==="hev1"||t==="hvc1"?"h265":t==="braw"?"braw":e}var h={apco:"Proxy",apcs:"LT",apcn:"422",apch:"HQ",ap4h:"4444",ap4x:"4444 XQ"},Z={1:"bt709",2:"unknown",4:"bt470m",5:"bt470bg",6:"smpte170m",7:"smpte240m",8:"film",9:"bt2020",10:"smpte428",11:"smpte431",12:"smpte432",22:"jedec-p22"},ee={1:"bt709",2:"unknown",4:"gamma22",5:"gamma28",6:"smpte170m",7:"smpte240m",8:"linear",9:"log100",10:"log316",11:"iec61966-2-4",12:"bt1361e",13:"iec61966-2-1",14:"bt2020-10",15:"bt2020-12",16:"smpte2084",17:"smpte428",18:"arib-std-b67"},re={0:"gbr",1:"bt709",2:"unknown",4:"fcc",5:"bt470bg",6:"smpte170m",7:"smpte240m",8:"ycgco",9:"bt2020nc",10:"bt2020c",14:"ictcp"};function te(e,t){return e==="ap4h"||e==="ap4x"?t===32?"yuva444p12le":"yuv444p12le":e in h?"yuv422p10le":void 0}var Q={66:"Baseline",77:"Main",88:"Extended",100:"High",110:"High 10",122:"High 4:2:2",244:"High 4:4:4"},j={1:"Main",2:"Main 10",3:"Main Still",4:"Rext"},ne={1270:"DNxHR 444",1271:"DNxHR HQX",1272:"DNxHR HQ",1273:"DNxHR SQ",1274:"DNxHR LB"};function oe(e,t){if(h[e.codec_fourcc])return`ProRes ${h[e.codec_fourcc]}`;if(e.vc3_cid)return ne[e.vc3_cid]??`DNxHD ${e.vc3_cid}`;if(e.video_profile!=null){if(t==="h264"&&Q[e.video_profile])return`H.264 ${Q[e.video_profile]}`;if(t==="h265"&&j[e.video_profile])return`HEVC ${j[e.video_profile]}`}}function ie(e,t){let n=e.video_chroma,r=e.video_bit_depth;if(n==null&&t==="h264"&&[66,77,88].includes(e.video_profile??-1)&&([n,r]=[1,8]),n==null&&e.vc3_cid&&(n=e.vc3_cid===1270||e.vc3_cid===1256?3:2),n==null||r==null)return;let i=["gray","yuv420p","yuv422p","yuv444p"][n];return r>8?`${i}${r}le`:i}function G(e,t){let n=[];for(let r of e){if(r.kind!=="clip"||!r.source_range)continue;let i=r.source_range.start.value,o=r.source_range.duration.value,c=Math.max(0,Math.floor(i)-t),a=Math.floor(i+o-1)+t;a>=c&&n.push({first_frame:c,last_frame:a})}return n}var be={async inspect(e){await d();let t=e.parts[0],n=await f(m(t),t.fileSize,e.format),r=JSON.parse(n);if(!r)return null;let i=r.timecode&&r.timecode.fps_denominator>0?r.timecode.fps_numerator/r.timecode.fps_denominator:null,o=B(r.codec_fourcc),c=[{kind:"video",codec:o,width:r.width??void 0,height:r.height??void 0,rate:i??void 0,bit_depth:p(r.codec_fourcc)??p(o)??O(o,r.video_profile)??r.video_bit_depth??void 0,codec_specific:{fourcc:r.codec_fourcc,profile:oe(r,o),pixel_format:te(r.codec_fourcc,r.video_depth)??ie(r,o),colr:r.colr?{primaries:Z[r.colr.primaries]??r.colr.primaries,transfer:ee[r.colr.transfer]??r.colr.transfer,matrix:re[r.colr.matrix]??r.colr.matrix}:void 0}}];for(let a of r.audio_tracks??(r.audio?[r.audio]:[]))c.push({kind:"audio",codec:a.codec_fourcc,channels:a.channels??void 0,rate:a.sample_rate??void 0,bit_depth:a.bit_depth??void 0,codec_specific:{fourcc:a.codec_fourcc,channel_layout:a.channel_layout??void 0}});return{id:t.filename,kind:"external",target_url:t.filename,available_range:i&&r.duration_seconds?{start:{value:0,rate:i},duration:{value:Math.round(r.duration_seconds*i),rate:i}}:null,reel_name:null,source_timecode:r.timecode?.display??null,container:e.format==="mov"?"mov":e.format,codec:o,size_bytes:t.fileSize,source_fps:i,source_resolution_w:r.width??null,source_resolution_h:r.height??null,streams:c,decode_provenance:r.decode_provenance??null,vendor_metadata:r.timecode?{drop_frame:r.timecode.drop_frame}:{},binding_state:"unbound",raw_extraction:{mov_probe:r},metadata:{}}},async extract(e){await d();let t=e.parts[0],n=JSON.parse(await E(m(t),t.fileSize,e.format));if(n.length===0)return null;let r=JSON.parse(await f(m(t),t.fileSize,e.format)),i=r?B(r.codec_fourcc):e.format,o=r?.timecode&&r.timecode.fps_denominator>0?r.timecode.fps_numerator/r.timecode.fps_denominator:void 0;return{v:1,container:e.format==="mov"?"mov":e.format,codec:i,width:r?.width??void 0,height:r?.height??void 0,fps:o,frame_count:T(n),timecode:r?.timecode?.display??void 0,granularity:L(n),segments:n}},async sparsify(e,t){await d();let n=e.parts[0],r=G(t.items,t.handles),i=await I(m(n),n.fileSize,JSON.stringify(r),e.format),o=JSON.parse(i);return[{filename:n.filename,fileSize:o.fileSize,structuralRanges:o.structuralRanges,essenceRanges:o.essenceRanges,trimInputs:o.trimInputs}]},async trim(e,t){await d();let n=e.parts[0],r=G(t.items,0);if(r.length===0)throw new Error("isobmff trim: no usable trim ranges in items");let i=await V(r,t.handles,(o,c)=>H(m(n),n.fileSize,o,c,e.format));return i.map((o,c)=>{let a=JSON.parse(o);return i.length>1&&(a.output_clip_number=c+1,a.output_clip_count=i.length,a.output_part_number=1),a})},async decode(e,t,n){await d();let r=n.detail==="coarse",i=e.parts[0];if(e.format==="crm"){let l=await R(m(i),i.fileSize,t,r?"preview":"full");return s(l)}let o=await Y(e);if(t<0||t>=o.length)throw new _(t,o.length);let c=o[t],a=await i.read(c.offset,c.size);if(e.format==="braw")return s(r?v(a,0):y(a));if(b(a)){let l=await q(e);return s(l?u.decode_prores_raw_tier(a,r?"preview":"full",l):r?P(a,0):x(a))}if(W(a))return s(r?D(a,0):z(a));if(r)return s(S(a,0));let g=await ae(a);return g||s(A(a))},async decode16(e,t){await d();let n=e.parts[0];if(e.format==="crm")throw new Error("crm: no 16-bit decoder");let r=await Y(e);if(t<0||t>=r.length)throw new _(t,r.length);let i=r[t],o=await n.read(i.offset,i.size),c=b(o)?await q(e):null,a=e.format==="braw"?w(o):b(o)?c?u.decode_prores_raw_tier(o,"rgb16",c):M(o):W(o)?(()=>{throw new Error("vc3: no 16-bit decoder")})():F(o);return $(a)}};async function ae(e){if(!U)return null;try{let t=await import("./prores-RIG37OIH.js");if(!await t.proresGpuAvailable())return null;let n=await t.decodeProResRgbaGpu(e);return n?{width:n.width,height:n.height,rgba:n.rgba}:null}catch{return null}}function W(e){return e.length>=4&&e[0]===0&&e[1]===0&&e[2]===2&&e[3]===128}function b(e){return e.length>=8&&e[4]===112&&e[5]===114&&e[6]===114&&e[7]===102}function s(e){let t=new DataView(e.buffer,e.byteOffset,8);return{width:t.getUint32(0,!0),height:t.getUint32(4,!0),rgba:e.slice(8)}}var u=C,X=new WeakMap;function q(e){let t=X.get(e);if(!t){let n=e.parts[0];t=u.prores_raw_container_color&&u.decode_prores_raw_tier?N({fileSize:n.fileSize,read:n.read}).then(r=>{let i=u.prores_raw_container_color(r);return i.length?i:null}):Promise.resolve(null),X.set(e,t)}return t}var K=new WeakMap;async function Y(e){let t=K.get(e);if(!t){let n=e.parts[0],r=J(await k(m(n),n.fileSize,e.format));if(!r.w||!r.h)throw new Error("could not find a video sample table");t=r.offs,K.set(e,t)}return t}export{be as isobmffFormat};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{c as b}from"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import{c as w,g as y}from"./chunk-
|
|
3
|
+
import{c as b}from"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import{c as w,g as y}from"./chunk-4RA57LTJ.js";import{Ca as l,Ga as p,Ia as h}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";var F=72*1024*1024,S=16,m=p;function L(){return typeof m.video_open=="function"&&typeof m.video_decode=="function"}async function P(r,e){if(await h(),!L())return null;try{return JSON.parse(await m.video_open(r,e))}catch{return null}}function k(r){l?.(r)}var u=new WeakMap;function v(r){let e=u.get(r);if(!e){let t=r.parts[0];e=P((n,a)=>t.read(n,a),t.fileSize).then(n=>{if(!n)throw new Error(`mcvideo: media-core has no video decoder for ${t.filename}`);return{info:n,cache:new Map,cacheCoarse:!1,frameBytes:0,queue:Promise.resolve()}}),e.catch(()=>u.delete(r)),u.set(r,e)}return e}async function B(r){try{return(await v(r)).info.frames}catch{return 0}}function _(r){let e=new DataView(r.buffer,r.byteOffset,r.byteLength),t=new Map,n=4;for(let a=e.getUint32(0,!0);a>0&&n+12<=r.length;a--){let s=e.getUint32(n,!0),c=e.getUint32(n+4,!0),i=e.getUint32(n+8,!0),o=c*i*4;if(n+=12,n+o>r.length)break;t.set(s,{width:c,height:i,rgba:r.slice(n,n+o)}),n+=o}return t}async function C(r,e,t){let n=await v(r),{info:a}=n;if(e<0||e>=a.frames)throw new w(e,a.frames);let s=async()=>{let i=t&&a.codec==="dv";n.cacheCoarse!==i&&(n.cache.clear(),n.cacheCoarse=i);let o=n.cache.get(e);if(!o){let g=a.inter?Math.max(1,Math.min(S,n.frameBytes?Math.floor(F/n.frameBytes):4)):1,d=_(await m.video_decode(a.handle,e,Math.min(a.frames,e+g),i));n.cache=d,o=d.get(e),o&&(n.frameBytes=o.rgba.length)}if(!o)throw new Error(`mcvideo: ${a.codec} frame ${e} did not decode`);return n.cache.delete(e),o},c=n.queue.then(s,s);return n.queue=c.catch(()=>{}),c}async function f(r){let e=b(r.parts[0]?.filename??""),t=e?await y(e):null;return t&&e?[t,{...r,format:e}]:null}async function M(r){let e=await f(r);if(!e)throw new Error(`mcvideo: no container module for ${r.parts[0]?.filename} \u2014 ships whole`);return e}var I={async inspect(r){let e=await f(r);return e?e[0].inspect(e[1]):null},async extract(r){let e=await f(r);return e?e[0].extract(e[1]):null},async sparsify(r,e){let[t,n]=await M(r);return t.sparsify(n,e)},async trim(r,e){let[t,n]=await M(r);return t.trim(n,e)},async decode(r,e,{detail:t}){return C(r,e,t==="coarse")}};export{k as closeVideoLane,L as hasVideoLane,I as mcVideoFormat,P as openVideoLane,_ as unpackWindow,B as videoLaneFrames};
|
package/dist/mcp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{b as la}from"./chunk-BYMCZJBQ.js";import{f as na,g as sa,h as ia,j as aa,k as ca,l as tn}from"./chunk-LRGA6QJQ.js";import"./chunk-B54TEGMG.js";import"./chunk-I2Y2P5NH.js";import"./chunk-ERUN634Q.js";import"./chunk-J43UCJ6G.js";import"./chunk-NZLL44HU.js";import"./chunk-YU3SUSK3.js";import"./chunk-QTFFVLVJ.js";import"./chunk-5YULBQJX.js";import"./chunk-G3HBKJ5L.js";import{A as S,B as Li,Bc as Wi,C as K,Cc as Dt,D as Fi,Dc as Xi,E as en,Ec as Qi,F as Hi,Fc as Yi,G as dt,Gc as ea,H as Ui,Mc as ta,Nc as ra,Vc as oa,a as qi,b as Go,c as Ni,d as ji,e as Oi,f as Bo,g as Jo,h as Wo,i as Ot,j as At,k as Ai,l as Di,m as Xo,n as f,o as D,p as W,q as Zi,r as G,s as q,t as v,u as se,v as V,w as Qo,x as Yo,y as F,z as pe}from"./chunk-LKQTE6T5.js";import"./chunk-IN6XVTUS.js";import"./chunk-Y455Y6V4.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-4VFDGL4E.js";import{a as zr,b as Ii,c as Ci,d as Mi}from"./chunk-H4BU5WA6.js";import"./chunk-ISKNIQVO.js";import"./chunk-JKOB3U54.js";import"./chunk-EEDLRRKU.js";import"./chunk-WJ5EWXP2.js";import"./chunk-YUO3UWPH.js";import"./chunk-DKGGJM6Z.js";import"./chunk-JV7TZDKJ.js";import"./chunk-RGMTLNMF.js";import"./chunk-XDI6CPPV.js";import"./chunk-7W5AFZYX.js";import"./chunk-LZRCXSUJ.js";import{a as Gi,e as Bi,k as Ji}from"./chunk-BTS3DFPD.js";import"./chunk-6WLSIH2N.js";import"./chunk-LVGGCRDW.js";import"./chunk-C2ESM27Z.js";import"./chunk-D6YDLKSA.js";import"./chunk-4BTTR6U3.js";import"./chunk-N34DQ6MH.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-L3HRAIDR.js";import"./chunk-OD445COC.js";import"./chunk-EP4L2BWV.js";import{e as Vi,f as Ki}from"./chunk-PHAMF4JF.js";import"./chunk-XI6XF7FQ.js";import{c as $,f as Ri}from"./chunk-PSANHDZM.js";var Qt=$(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.regexpCode=A.getEsmExportName=A.getProperty=A.safeStringify=A.stringify=A.strConcat=A.addCodeArg=A.str=A._=A.nil=A._Code=A.Name=A.IDENTIFIER=A._CodeOrName=void 0;var Wt=class{};A._CodeOrName=Wt;A.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ye=class extends Wt{constructor(e){if(super(),!A.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};A.Name=Ye;var ye=class extends Wt{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,o)=>`${r}${o}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,o)=>(o instanceof Ye&&(r[o.str]=(r[o.str]||0)+1),r),{})}};A._Code=ye;A.nil=new ye("");function Ca(t,...e){let r=[t[0]],o=0;for(;o<e.length;)En(r,e[o]),r.push(t[++o]);return new ye(r)}A._=Ca;var xn=new ye("+");function Ma(t,...e){let r=[Xt(t[0])],o=0;for(;o<e.length;)r.push(xn),En(r,e[o]),r.push(xn,Xt(t[++o]));return Tf(r),new ye(r)}A.str=Ma;function En(t,e){e instanceof ye?t.push(...e._items):e instanceof Ye?t.push(e):t.push(Cf(e))}A.addCodeArg=En;function Tf(t){let e=1;for(;e<t.length-1;){if(t[e]===xn){let r=Rf(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Rf(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ye||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ye))return`"${t}${e.slice(1)}`}function If(t,e){return e.emptyStr()?t:t.emptyStr()?e:Ma`${t}${e}`}A.strConcat=If;function Cf(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Xt(Array.isArray(t)?t.join(","):t)}function Mf(t){return new ye(Xt(t))}A.stringify=Mf;function Xt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}A.safeStringify=Xt;function qf(t){return typeof t=="string"&&A.IDENTIFIER.test(t)?new ye(`.${t}`):Ca`[${t}]`}A.getProperty=qf;function Nf(t){if(typeof t=="string"&&A.IDENTIFIER.test(t))return new ye(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}A.getEsmExportName=Nf;function jf(t){return new ye(t.toString())}A.regexpCode=jf});var Pn=$(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.ValueScope=le.ValueScopeName=le.Scope=le.varKinds=le.UsedValueState=void 0;var ce=Qt(),kn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Qr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Qr||(le.UsedValueState=Qr={}));le.varKinds={const:new ce.Name("const"),let:new ce.Name("let"),var:new ce.Name("var")};var Yr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ce.Name?e:this.name(e)}name(e){return new ce.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,o;if(!((o=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||o===void 0)&&o.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};le.Scope=Yr;var eo=class extends ce.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,ce._)`.${new ce.Name(r)}[${o}]`}};le.ValueScopeName=eo;var Of=(0,ce._)`\n`,zn=class extends Yr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Of:ce.nil}}get(){return this._scope}name(e){return new eo(e,this._newName(e))}value(e,r){var o;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,i=(o=r.key)!==null&&o!==void 0?o:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,n);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,n.setValue(r,{property:s,itemIndex:u}),n}getValue(e,r){let o=this._values[e];if(o)return o.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,o=>{if(o.scopePath===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return(0,ce._)`${e}${o.scopePath}`})}scopeCode(e=this._values,r,o){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,o)}_reduceValues(e,r,o={},n){let s=ce.nil;for(let i in e){let a=e[i];if(!a)continue;let c=o[i]=o[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Qr.Started);let l=r(u);if(l){let d=this.opts.es5?le.varKinds.var:le.varKinds.const;s=(0,ce._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=n?.(u))s=(0,ce._)`${s}${l}${this.opts._n}`;else throw new kn(u);c.set(u,Qr.Completed)})}return s}};le.ValueScope=zn});var R=$(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.or=I.and=I.not=I.CodeGen=I.operators=I.varKinds=I.ValueScopeName=I.ValueScope=I.Scope=I.Name=I.regexpCode=I.stringify=I.getProperty=I.nil=I.strConcat=I.str=I._=void 0;var M=Qt(),we=Pn(),He=Qt();Object.defineProperty(I,"_",{enumerable:!0,get:function(){return He._}});Object.defineProperty(I,"str",{enumerable:!0,get:function(){return He.str}});Object.defineProperty(I,"strConcat",{enumerable:!0,get:function(){return He.strConcat}});Object.defineProperty(I,"nil",{enumerable:!0,get:function(){return He.nil}});Object.defineProperty(I,"getProperty",{enumerable:!0,get:function(){return He.getProperty}});Object.defineProperty(I,"stringify",{enumerable:!0,get:function(){return He.stringify}});Object.defineProperty(I,"regexpCode",{enumerable:!0,get:function(){return He.regexpCode}});Object.defineProperty(I,"Name",{enumerable:!0,get:function(){return He.Name}});var no=Pn();Object.defineProperty(I,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(I,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(I,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(I,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});I.operators={GT:new M._Code(">"),GTE:new M._Code(">="),LT:new M._Code("<"),LTE:new M._Code("<="),EQ:new M._Code("==="),NEQ:new M._Code("!=="),NOT:new M._Code("!"),OR:new M._Code("||"),AND:new M._Code("&&"),ADD:new M._Code("+")};var Ne=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Tn=class extends Ne{constructor(e,r,o){super(),this.varKind=e,this.name=r,this.rhs=o}render({es5:e,_n:r}){let o=e?we.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=vt(this.rhs,e,r)),this}get names(){return this.rhs instanceof M._CodeOrName?this.rhs.names:{}}},to=class extends Ne{constructor(e,r,o){super(),this.lhs=e,this.rhs=r,this.sideEffects=o}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof M.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=vt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof M.Name?{}:{...this.lhs.names};return oo(e,this.rhs)}},Rn=class extends to{constructor(e,r,o,n){super(e,o,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},In=class extends Ne{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Cn=class extends Ne{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Mn=class extends Ne{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},qn=class extends Ne{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=vt(this.code,e,r),this}get names(){return this.code instanceof M._CodeOrName?this.code.names:{}}},Yt=class extends Ne{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,o)=>r+o.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let o=e[r].optimizeNodes();Array.isArray(o)?e.splice(r,1,...o):o?e[r]=o:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:o}=this,n=o.length;for(;n--;){let s=o[n];s.optimizeNames(e,r)||(Af(e,s.names),o.splice(n,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>rt(e,r.names),{})}},je=class extends Yt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Nn=class extends Yt{},$t=class extends je{};$t.kind="else";var et=class t extends je{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let o=r.optimizeNodes();r=this.else=Array.isArray(o)?new $t(o):o}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(qa(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=vt(this.condition,e,r),this}get names(){let e=super.names;return oo(e,this.condition),this.else&&rt(e,this.else.names),e}};et.kind="if";var tt=class extends je{};tt.kind="for";var jn=class extends tt{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=vt(this.iteration,e,r),this}get names(){return rt(super.names,this.iteration.names)}},On=class extends tt{constructor(e,r,o,n){super(),this.varKind=e,this.name=r,this.from=o,this.to=n}render(e){let r=e.es5?we.varKinds.var:this.varKind,{name:o,from:n,to:s}=this;return`for(${r} ${o}=${n}; ${o}<${s}; ${o}++)`+super.render(e)}get names(){let e=oo(super.names,this.from);return oo(e,this.to)}},ro=class extends tt{constructor(e,r,o,n){super(),this.loop=e,this.varKind=r,this.name=o,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=vt(this.iterable,e,r),this}get names(){return rt(super.names,this.iterable.names)}},er=class extends je{constructor(e,r,o){super(),this.name=e,this.args=r,this.async=o}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};er.kind="func";var tr=class extends Yt{render(e){return"return "+super.render(e)}};tr.kind="return";var An=class extends je{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var o,n;return super.optimizeNames(e,r),(o=this.catch)===null||o===void 0||o.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&rt(e,this.catch.names),this.finally&&rt(e,this.finally.names),e}},rr=class extends je{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};rr.kind="catch";var or=class extends je{render(e){return"finally"+super.render(e)}};or.kind="finally";var Dn=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
+
import{b as la}from"./chunk-B2KCENY6.js";import{h as na,i as sa,j as ia,l as aa,m as ca,n as tn}from"./chunk-HTRW5GX4.js";import"./chunk-IDJIOKXA.js";import"./chunk-G7CVRPVA.js";import"./chunk-6KEFHHS6.js";import"./chunk-IBIAW6IW.js";import"./chunk-QH5DTYSE.js";import"./chunk-YU3SUSK3.js";import"./chunk-QTFFVLVJ.js";import"./chunk-5YULBQJX.js";import{A as S,Ac as Dt,B as Li,Bc as Xi,C as K,Cc as Qi,D as Fi,Dc as Yi,E as en,Ec as ea,F as Hi,G as dt,H as Ui,Kc as ta,Lc as ra,Tc as oa,a as qi,b as Go,c as Ni,d as ji,e as Oi,f as Bo,g as Jo,h as Wo,i as Ot,j as At,k as Ai,l as Di,m as Xo,n as f,o as D,p as W,q as Zi,r as G,s as q,t as v,u as se,v as V,w as Qo,x as Yo,y as F,z as pe,zc as Wi}from"./chunk-63WQRYTJ.js";import"./chunk-IN6XVTUS.js";import"./chunk-DLF5AKXT.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-7NGS2BN7.js";import{a as zr,b as Ii,c as Ci,d as Mi}from"./chunk-TBU2XWFD.js";import"./chunk-ISKNIQVO.js";import"./chunk-JKOB3U54.js";import"./chunk-EEDLRRKU.js";import"./chunk-WJ5EWXP2.js";import"./chunk-YUO3UWPH.js";import"./chunk-DKGGJM6Z.js";import"./chunk-JV7TZDKJ.js";import"./chunk-RGMTLNMF.js";import"./chunk-XDI6CPPV.js";import"./chunk-UKXSKFL3.js";import"./chunk-4RA57LTJ.js";import{a as Gi,e as Bi,k as Ji}from"./chunk-FLLB6UZJ.js";import"./chunk-UAURERD3.js";import"./chunk-LVGGCRDW.js";import"./chunk-C2ESM27Z.js";import"./chunk-D6YDLKSA.js";import"./chunk-XVZ7KJRI.js";import"./chunk-N34DQ6MH.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-VERTA23P.js";import"./chunk-OWWXUNJF.js";import"./chunk-VETHR2O7.js";import{e as Vi,f as Ki}from"./chunk-ROGMKTND.js";import"./chunk-X527E5VI.js";import{c as $,f as Ri}from"./chunk-PSANHDZM.js";var Qt=$(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.regexpCode=A.getEsmExportName=A.getProperty=A.safeStringify=A.stringify=A.strConcat=A.addCodeArg=A.str=A._=A.nil=A._Code=A.Name=A.IDENTIFIER=A._CodeOrName=void 0;var Wt=class{};A._CodeOrName=Wt;A.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ye=class extends Wt{constructor(e){if(super(),!A.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};A.Name=Ye;var ye=class extends Wt{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,o)=>`${r}${o}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,o)=>(o instanceof Ye&&(r[o.str]=(r[o.str]||0)+1),r),{})}};A._Code=ye;A.nil=new ye("");function Ca(t,...e){let r=[t[0]],o=0;for(;o<e.length;)En(r,e[o]),r.push(t[++o]);return new ye(r)}A._=Ca;var xn=new ye("+");function Ma(t,...e){let r=[Xt(t[0])],o=0;for(;o<e.length;)r.push(xn),En(r,e[o]),r.push(xn,Xt(t[++o]));return Tf(r),new ye(r)}A.str=Ma;function En(t,e){e instanceof ye?t.push(...e._items):e instanceof Ye?t.push(e):t.push(Cf(e))}A.addCodeArg=En;function Tf(t){let e=1;for(;e<t.length-1;){if(t[e]===xn){let r=Rf(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Rf(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ye||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ye))return`"${t}${e.slice(1)}`}function If(t,e){return e.emptyStr()?t:t.emptyStr()?e:Ma`${t}${e}`}A.strConcat=If;function Cf(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Xt(Array.isArray(t)?t.join(","):t)}function Mf(t){return new ye(Xt(t))}A.stringify=Mf;function Xt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}A.safeStringify=Xt;function qf(t){return typeof t=="string"&&A.IDENTIFIER.test(t)?new ye(`.${t}`):Ca`[${t}]`}A.getProperty=qf;function Nf(t){if(typeof t=="string"&&A.IDENTIFIER.test(t))return new ye(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}A.getEsmExportName=Nf;function jf(t){return new ye(t.toString())}A.regexpCode=jf});var Pn=$(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.ValueScope=le.ValueScopeName=le.Scope=le.varKinds=le.UsedValueState=void 0;var ce=Qt(),kn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Qr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Qr||(le.UsedValueState=Qr={}));le.varKinds={const:new ce.Name("const"),let:new ce.Name("let"),var:new ce.Name("var")};var Yr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ce.Name?e:this.name(e)}name(e){return new ce.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,o;if(!((o=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||o===void 0)&&o.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};le.Scope=Yr;var eo=class extends ce.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,ce._)`.${new ce.Name(r)}[${o}]`}};le.ValueScopeName=eo;var Of=(0,ce._)`\n`,zn=class extends Yr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Of:ce.nil}}get(){return this._scope}name(e){return new eo(e,this._newName(e))}value(e,r){var o;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,i=(o=r.key)!==null&&o!==void 0?o:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,n);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,n.setValue(r,{property:s,itemIndex:u}),n}getValue(e,r){let o=this._values[e];if(o)return o.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,o=>{if(o.scopePath===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return(0,ce._)`${e}${o.scopePath}`})}scopeCode(e=this._values,r,o){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,o)}_reduceValues(e,r,o={},n){let s=ce.nil;for(let i in e){let a=e[i];if(!a)continue;let c=o[i]=o[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Qr.Started);let l=r(u);if(l){let d=this.opts.es5?le.varKinds.var:le.varKinds.const;s=(0,ce._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=n?.(u))s=(0,ce._)`${s}${l}${this.opts._n}`;else throw new kn(u);c.set(u,Qr.Completed)})}return s}};le.ValueScope=zn});var R=$(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.or=I.and=I.not=I.CodeGen=I.operators=I.varKinds=I.ValueScopeName=I.ValueScope=I.Scope=I.Name=I.regexpCode=I.stringify=I.getProperty=I.nil=I.strConcat=I.str=I._=void 0;var M=Qt(),we=Pn(),He=Qt();Object.defineProperty(I,"_",{enumerable:!0,get:function(){return He._}});Object.defineProperty(I,"str",{enumerable:!0,get:function(){return He.str}});Object.defineProperty(I,"strConcat",{enumerable:!0,get:function(){return He.strConcat}});Object.defineProperty(I,"nil",{enumerable:!0,get:function(){return He.nil}});Object.defineProperty(I,"getProperty",{enumerable:!0,get:function(){return He.getProperty}});Object.defineProperty(I,"stringify",{enumerable:!0,get:function(){return He.stringify}});Object.defineProperty(I,"regexpCode",{enumerable:!0,get:function(){return He.regexpCode}});Object.defineProperty(I,"Name",{enumerable:!0,get:function(){return He.Name}});var no=Pn();Object.defineProperty(I,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(I,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(I,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(I,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});I.operators={GT:new M._Code(">"),GTE:new M._Code(">="),LT:new M._Code("<"),LTE:new M._Code("<="),EQ:new M._Code("==="),NEQ:new M._Code("!=="),NOT:new M._Code("!"),OR:new M._Code("||"),AND:new M._Code("&&"),ADD:new M._Code("+")};var Ne=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Tn=class extends Ne{constructor(e,r,o){super(),this.varKind=e,this.name=r,this.rhs=o}render({es5:e,_n:r}){let o=e?we.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=vt(this.rhs,e,r)),this}get names(){return this.rhs instanceof M._CodeOrName?this.rhs.names:{}}},to=class extends Ne{constructor(e,r,o){super(),this.lhs=e,this.rhs=r,this.sideEffects=o}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof M.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=vt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof M.Name?{}:{...this.lhs.names};return oo(e,this.rhs)}},Rn=class extends to{constructor(e,r,o,n){super(e,o,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},In=class extends Ne{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Cn=class extends Ne{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Mn=class extends Ne{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},qn=class extends Ne{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=vt(this.code,e,r),this}get names(){return this.code instanceof M._CodeOrName?this.code.names:{}}},Yt=class extends Ne{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,o)=>r+o.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let o=e[r].optimizeNodes();Array.isArray(o)?e.splice(r,1,...o):o?e[r]=o:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:o}=this,n=o.length;for(;n--;){let s=o[n];s.optimizeNames(e,r)||(Af(e,s.names),o.splice(n,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>rt(e,r.names),{})}},je=class extends Yt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Nn=class extends Yt{},$t=class extends je{};$t.kind="else";var et=class t extends je{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let o=r.optimizeNodes();r=this.else=Array.isArray(o)?new $t(o):o}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(qa(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=vt(this.condition,e,r),this}get names(){let e=super.names;return oo(e,this.condition),this.else&&rt(e,this.else.names),e}};et.kind="if";var tt=class extends je{};tt.kind="for";var jn=class extends tt{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=vt(this.iteration,e,r),this}get names(){return rt(super.names,this.iteration.names)}},On=class extends tt{constructor(e,r,o,n){super(),this.varKind=e,this.name=r,this.from=o,this.to=n}render(e){let r=e.es5?we.varKinds.var:this.varKind,{name:o,from:n,to:s}=this;return`for(${r} ${o}=${n}; ${o}<${s}; ${o}++)`+super.render(e)}get names(){let e=oo(super.names,this.from);return oo(e,this.to)}},ro=class extends tt{constructor(e,r,o,n){super(),this.loop=e,this.varKind=r,this.name=o,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=vt(this.iterable,e,r),this}get names(){return rt(super.names,this.iterable.names)}},er=class extends je{constructor(e,r,o){super(),this.name=e,this.args=r,this.async=o}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};er.kind="func";var tr=class extends Yt{render(e){return"return "+super.render(e)}};tr.kind="return";var An=class extends je{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var o,n;return super.optimizeNames(e,r),(o=this.catch)===null||o===void 0||o.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&rt(e,this.catch.names),this.finally&&rt(e,this.finally.names),e}},rr=class extends je{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};rr.kind="catch";var or=class extends je{render(e){return"finally"+super.render(e)}};or.kind="finally";var Dn=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
4
4
|
`:""},this._extScope=e,this._scope=new we.Scope({parent:e}),this._nodes=[new Nn]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let o=this._extScope.value(e,r);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,o,n){let s=this._scope.toName(r);return o!==void 0&&n&&(this._constants[s.str]=o),this._leafNode(new Tn(e,s,o)),s}const(e,r,o){return this._def(we.varKinds.const,e,r,o)}let(e,r,o){return this._def(we.varKinds.let,e,r,o)}var(e,r,o){return this._def(we.varKinds.var,e,r,o)}assign(e,r,o){return this._leafNode(new to(e,r,o))}add(e,r){return this._leafNode(new Rn(e,I.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==M.nil&&this._leafNode(new qn(e)),this}object(...e){let r=["{"];for(let[o,n]of e)r.length>1&&r.push(","),r.push(o),(o!==n||this.opts.es5)&&(r.push(":"),(0,M.addCodeArg)(r,n));return r.push("}"),new M._Code(r)}if(e,r,o){if(this._blockNode(new et(e)),r&&o)this.code(r).else().code(o).endIf();else if(r)this.code(r).endIf();else if(o)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new et(e))}else(){return this._elseNode(new $t)}endIf(){return this._endBlockNode(et,$t)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new jn(e),r)}forRange(e,r,o,n,s=this.opts.es5?we.varKinds.var:we.varKinds.let){let i=this._scope.toName(e);return this._for(new On(s,i,r,o),()=>n(i))}forOf(e,r,o,n=we.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof M.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,M._)`${i}.length`,a=>{this.var(s,(0,M._)`${i}[${a}]`),o(s)})}return this._for(new ro("of",n,s,r),()=>o(s))}forIn(e,r,o,n=this.opts.es5?we.varKinds.var:we.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,M._)`Object.keys(${r})`,o);let s=this._scope.toName(e);return this._for(new ro("in",n,s,r),()=>o(s))}endFor(){return this._endBlockNode(tt)}label(e){return this._leafNode(new In(e))}break(e){return this._leafNode(new Cn(e))}return(e){let r=new tr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(tr)}try(e,r,o){if(!r&&!o)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new An;if(this._blockNode(n),this.code(e),r){let s=this.name("e");this._currNode=n.catch=new rr(s),r(s)}return o&&(this._currNode=n.finally=new or,this.code(o)),this._endBlockNode(rr,or)}throw(e){return this._leafNode(new Mn(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let o=this._nodes.length-r;if(o<0||e!==void 0&&o!==e)throw new Error(`CodeGen: wrong number of nodes: ${o} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=M.nil,o,n){return this._blockNode(new er(e,r,o)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(er)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let o=this._currNode;if(o instanceof e||r&&o instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof et))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};I.CodeGen=Dn;function rt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function oo(t,e){return e instanceof M._CodeOrName?rt(t,e.names):t}function vt(t,e,r){if(t instanceof M.Name)return o(t);if(!n(t))return t;return new M._Code(t._items.reduce((s,i)=>(i instanceof M.Name&&(i=o(i)),i instanceof M._Code?s.push(...i._items):s.push(i),s),[]));function o(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function n(s){return s instanceof M._Code&&s._items.some(i=>i instanceof M.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function Af(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function qa(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,M._)`!${Zn(t)}`}I.not=qa;var Df=Na(I.operators.AND);function Zf(...t){return t.reduce(Df)}I.and=Zf;var Lf=Na(I.operators.OR);function Ff(...t){return t.reduce(Lf)}I.or=Ff;function Na(t){return(e,r)=>e===M.nil?r:r===M.nil?e:(0,M._)`${Zn(e)} ${t} ${Zn(r)}`}function Zn(t){return t instanceof M.Name?t:(0,M._)`(${t})`}});var N=$(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.checkStrictMode=C.getErrorPath=C.Type=C.useFunc=C.setEvaluated=C.evaluatedPropsToName=C.mergeEvaluated=C.eachItem=C.unescapeJsonPointer=C.escapeJsonPointer=C.escapeFragment=C.unescapeFragment=C.schemaRefOrVal=C.schemaHasRulesButRef=C.schemaHasRules=C.checkUnknownRules=C.alwaysValidSchema=C.toHash=void 0;var L=R(),Hf=Qt();function Uf(t){let e={};for(let r of t)e[r]=!0;return e}C.toHash=Uf;function Vf(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Aa(t,e),!Da(e,t.self.RULES.all))}C.alwaysValidSchema=Vf;function Aa(t,e=t.schema){let{opts:r,self:o}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=o.RULES.keywords;for(let s in e)n[s]||Fa(t,`unknown keyword: "${s}"`)}C.checkUnknownRules=Aa;function Da(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}C.schemaHasRules=Da;function Kf(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}C.schemaHasRulesButRef=Kf;function Gf({topSchemaRef:t,schemaPath:e},r,o,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,L._)`${r}`}return(0,L._)`${t}${e}${(0,L.getProperty)(o)}`}C.schemaRefOrVal=Gf;function Bf(t){return Za(decodeURIComponent(t))}C.unescapeFragment=Bf;function Jf(t){return encodeURIComponent(Fn(t))}C.escapeFragment=Jf;function Fn(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}C.escapeJsonPointer=Fn;function Za(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}C.unescapeJsonPointer=Za;function Wf(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}C.eachItem=Wf;function ja({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:o}){return(n,s,i,a)=>{let c=i===void 0?s:i instanceof L.Name?(s instanceof L.Name?t(n,s,i):e(n,s,i),i):s instanceof L.Name?(e(n,i,s),s):r(s,i);return a===L.Name&&!(c instanceof L.Name)?o(n,c):c}}C.mergeEvaluated={props:ja({mergeNames:(t,e,r)=>t.if((0,L._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,L._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,L._)`${r} || {}`).code((0,L._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,L._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,L._)`${r} || {}`),Hn(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:La}),items:ja({mergeNames:(t,e,r)=>t.if((0,L._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,L._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,L._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,L._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function La(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,L._)`{}`);return e!==void 0&&Hn(t,r,e),r}C.evaluatedPropsToName=La;function Hn(t,e,r){Object.keys(r).forEach(o=>t.assign((0,L._)`${e}${(0,L.getProperty)(o)}`,!0))}C.setEvaluated=Hn;var Oa={};function Xf(t,e){return t.scopeValue("func",{ref:e,code:Oa[e.code]||(Oa[e.code]=new Hf._Code(e.code))})}C.useFunc=Xf;var Ln;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Ln||(C.Type=Ln={}));function Qf(t,e,r){if(t instanceof L.Name){let o=e===Ln.Num;return r?o?(0,L._)`"[" + ${t} + "]"`:(0,L._)`"['" + ${t} + "']"`:o?(0,L._)`"/" + ${t}`:(0,L._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,L.getProperty)(t).toString():"/"+Fn(t)}C.getErrorPath=Qf;function Fa(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}C.checkStrictMode=Fa});var Oe=$(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});var te=R(),Yf={data:new te.Name("data"),valCxt:new te.Name("valCxt"),instancePath:new te.Name("instancePath"),parentData:new te.Name("parentData"),parentDataProperty:new te.Name("parentDataProperty"),rootData:new te.Name("rootData"),dynamicAnchors:new te.Name("dynamicAnchors"),vErrors:new te.Name("vErrors"),errors:new te.Name("errors"),this:new te.Name("this"),self:new te.Name("self"),scope:new te.Name("scope"),json:new te.Name("json"),jsonPos:new te.Name("jsonPos"),jsonLen:new te.Name("jsonLen"),jsonPart:new te.Name("jsonPart")};Un.default=Yf});var nr=$(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.extendErrors=re.resetErrorsCount=re.reportExtraError=re.reportError=re.keyword$DataError=re.keywordError=void 0;var j=R(),so=N(),ie=Oe();re.keywordError={message:({keyword:t})=>(0,j.str)`must pass "${t}" keyword validation`};re.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,j.str)`"${t}" keyword must be ${e} ($data)`:(0,j.str)`"${t}" keyword is invalid ($data)`};function ep(t,e=re.keywordError,r,o){let{it:n}=t,{gen:s,compositeRule:i,allErrors:a}=n,c=Va(t,e,r);o??(i||a)?Ha(s,c):Ua(n,(0,j._)`[${c}]`)}re.reportError=ep;function tp(t,e=re.keywordError,r){let{it:o}=t,{gen:n,compositeRule:s,allErrors:i}=o,a=Va(t,e,r);Ha(n,a),s||i||Ua(o,ie.default.vErrors)}re.reportExtraError=tp;function rp(t,e){t.assign(ie.default.errors,e),t.if((0,j._)`${ie.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,j._)`${ie.default.vErrors}.length`,e),()=>t.assign(ie.default.vErrors,null)))}re.resetErrorsCount=rp;function op({gen:t,keyword:e,schemaValue:r,data:o,errsCount:n,it:s}){if(n===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",n,ie.default.errors,a=>{t.const(i,(0,j._)`${ie.default.vErrors}[${a}]`),t.if((0,j._)`${i}.instancePath === undefined`,()=>t.assign((0,j._)`${i}.instancePath`,(0,j.strConcat)(ie.default.instancePath,s.errorPath))),t.assign((0,j._)`${i}.schemaPath`,(0,j.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,j._)`${i}.schema`,r),t.assign((0,j._)`${i}.data`,o))})}re.extendErrors=op;function Ha(t,e){let r=t.const("err",e);t.if((0,j._)`${ie.default.vErrors} === null`,()=>t.assign(ie.default.vErrors,(0,j._)`[${r}]`),(0,j._)`${ie.default.vErrors}.push(${r})`),t.code((0,j._)`${ie.default.errors}++`)}function Ua(t,e){let{gen:r,validateName:o,schemaEnv:n}=t;n.$async?r.throw((0,j._)`new ${t.ValidationError}(${e})`):(r.assign((0,j._)`${o}.errors`,e),r.return(!1))}var ot={keyword:new j.Name("keyword"),schemaPath:new j.Name("schemaPath"),params:new j.Name("params"),propertyName:new j.Name("propertyName"),message:new j.Name("message"),schema:new j.Name("schema"),parentSchema:new j.Name("parentSchema")};function Va(t,e,r){let{createErrors:o}=t.it;return o===!1?(0,j._)`{}`:np(t,e,r)}function np(t,e,r={}){let{gen:o,it:n}=t,s=[sp(n,r),ip(t,r)];return ap(t,e,s),o.object(...s)}function sp({errorPath:t},{instancePath:e}){let r=e?(0,j.str)`${t}${(0,so.getErrorPath)(e,so.Type.Str)}`:t;return[ie.default.instancePath,(0,j.strConcat)(ie.default.instancePath,r)]}function ip({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:o}){let n=o?e:(0,j.str)`${e}/${t}`;return r&&(n=(0,j.str)`${n}${(0,so.getErrorPath)(r,so.Type.Str)}`),[ot.schemaPath,n]}function ap(t,{params:e,message:r},o){let{keyword:n,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;o.push([ot.keyword,n],[ot.params,typeof e=="function"?e(t):e||(0,j._)`{}`]),c.messages&&o.push([ot.message,typeof r=="function"?r(t):r]),c.verbose&&o.push([ot.schema,i],[ot.parentSchema,(0,j._)`${l}${d}`],[ie.default.data,s]),u&&o.push([ot.propertyName,u])}});var Ga=$(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.boolOrEmptySchema=wt.topBoolOrEmptySchema=void 0;var cp=nr(),lp=R(),up=Oe(),dp={message:"boolean schema is false"};function fp(t){let{gen:e,schema:r,validateName:o}=t;r===!1?Ka(t,!1):typeof r=="object"&&r.$async===!0?e.return(up.default.data):(e.assign((0,lp._)`${o}.errors`,null),e.return(!0))}wt.topBoolOrEmptySchema=fp;function pp(t,e){let{gen:r,schema:o}=t;o===!1?(r.var(e,!1),Ka(t)):r.var(e,!0)}wt.boolOrEmptySchema=pp;function Ka(t,e){let{gen:r,data:o}=t,n={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,cp.reportError)(n,dp,void 0,e)}});var Vn=$(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.getRules=bt.isJSONType=void 0;var mp=["string","number","integer","boolean","null","object","array"],hp=new Set(mp);function gp(t){return typeof t=="string"&&hp.has(t)}bt.isJSONType=gp;function yp(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}bt.getRules=yp});var Kn=$(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.shouldUseRule=Ue.shouldUseGroup=Ue.schemaHasRulesForType=void 0;function _p({schema:t,self:e},r){let o=e.RULES.types[r];return o&&o!==!0&&Ba(t,o)}Ue.schemaHasRulesForType=_p;function Ba(t,e){return e.rules.some(r=>Ja(t,r))}Ue.shouldUseGroup=Ba;function Ja(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(o=>t[o]!==void 0))}Ue.shouldUseRule=Ja});var sr=$(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.reportTypeError=oe.checkDataTypes=oe.checkDataType=oe.coerceAndCheckDataType=oe.getJSONTypes=oe.getSchemaTypes=oe.DataType=void 0;var $p=Vn(),vp=Kn(),wp=nr(),T=R(),Wa=N(),St;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(St||(oe.DataType=St={}));function bp(t){let e=Xa(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}oe.getSchemaTypes=bp;function Xa(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every($p.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}oe.getJSONTypes=Xa;function Sp(t,e){let{gen:r,data:o,opts:n}=t,s=xp(e,n.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,vp.schemaHasRulesForType)(t,e[0]));if(i){let a=Bn(e,o,n.strictNumbers,St.Wrong);r.if(a,()=>{s.length?Ep(t,e,s):Jn(t)})}return i}oe.coerceAndCheckDataType=Sp;var Qa=new Set(["string","number","integer","boolean","null"]);function xp(t,e){return e?t.filter(r=>Qa.has(r)||e==="array"&&r==="array"):[]}function Ep(t,e,r){let{gen:o,data:n,opts:s}=t,i=o.let("dataType",(0,T._)`typeof ${n}`),a=o.let("coerced",(0,T._)`undefined`);s.coerceTypes==="array"&&o.if((0,T._)`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,(0,T._)`${n}[0]`).assign(i,(0,T._)`typeof ${n}`).if(Bn(e,n,s.strictNumbers),()=>o.assign(a,n))),o.if((0,T._)`${a} !== undefined`);for(let u of r)(Qa.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);o.else(),Jn(t),o.endIf(),o.if((0,T._)`${a} !== undefined`,()=>{o.assign(n,a),kp(t,a)});function c(u){switch(u){case"string":o.elseIf((0,T._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,T._)`"" + ${n}`).elseIf((0,T._)`${n} === null`).assign(a,(0,T._)`""`);return;case"number":o.elseIf((0,T._)`${i} == "boolean" || ${n} === null
|
|
5
5
|
|| (${i} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,T._)`+${n}`);return;case"integer":o.elseIf((0,T._)`${i} === "boolean" || ${n} === null
|
|
6
6
|
|| (${i} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,T._)`+${n}`);return;case"boolean":o.elseIf((0,T._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,T._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":o.elseIf((0,T._)`${n} === "" || ${n} === 0 || ${n} === false`),o.assign(a,null);return;case"array":o.elseIf((0,T._)`${i} === "string" || ${i} === "number"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n,t as o,u as p,v as q}from"./chunk-
|
|
3
|
+
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n,t as o,u as p,v as q}from"./chunk-DLF5AKXT.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-XDI6CPPV.js";import"./chunk-UKXSKFL3.js";import"./chunk-4RA57LTJ.js";import"./chunk-NU3X7P4N.js";import"./chunk-DPA26AOI.js";import"./chunk-ROGMKTND.js";import"./chunk-X527E5VI.js";import"./chunk-PSANHDZM.js";export{a as MEDIA_EXTS,g as bwfAt,q as coverage,e as decodeFrameRgb16,d as decodeFrameRgba,o as factsLine,h as factsText,n as findMedia,p as findText,i as islandsFor,m as nameMatch,l as normName,c as openSource,f as probeMedia,b as siblingParts,k as trimMedia,j as trimSource};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a as $}from"./chunk-AACY2V3L.js";import{b as J}from"./chunk-
|
|
3
|
+
import{a as $}from"./chunk-AACY2V3L.js";import{b as J}from"./chunk-UKXSKFL3.js";import{b as j}from"./chunk-4RA57LTJ.js";import{Ha as N,Ia as l,M,R as P,b as B,ca as D,da as T,e as I,ea as C,fa as E,g as S,ga as L,ia as O,ra as V,ua as W,w as k,wa as G}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";var z=new Uint8Array([6,14,43,52,2,5,1,1,13,1,2,1,1,17,1,0]);function se(t){e:for(let r=t.length-z.length;r>=0;r--){for(let e=0;e<z.length;e++)if(t[r+e]!==z[e])continue e;return r}return-1}function Z(t,r){if(r>=t.byteLength)return[null,0];let e=t.getUint8(r);if(e<128)return[e,1];let n=e&127;if(n===0||n>8||r+1+n>t.byteLength)return[null,1];let a=0;for(let i=0;i<n;i++)a=a*256+t.getUint8(r+1+i);return[a,1+n]}function b(t,r){let e=t.getUint32(r,!1),n=t.getUint32(r+4,!1);return e*4294967296+n}async function H(t){let r=t.fileSize,e=[];if(r<1024)return e;let a=Math.max(0,r-65536),i=r-a,o=await t.read(a,i);e.push({offset:a,length:i});let s=se(o);if(s<0)return e;let c=new DataView(o.buffer,o.byteOffset,o.byteLength),[f,te]=Z(c,s+16);if(f===null||f<16||f>65536)return e;let F=s+16+te;if(F+f>o.length)return e;let A=[],ne=new DataView(o.buffer,o.byteOffset+F,f),g=Math.floor((f-4)/12);if(g<1||g>4096)return e;for(let u=0;u<g;u++){let d=b(ne,u*12+4);d>=0&&d<r&&A.push(d)}for(let u of A){let d=Math.min(256,r-u),p=await t.read(u,d);if(p.length<80)continue;let y=new DataView(p.buffer,p.byteOffset,p.byteLength),[R,v]=Z(y,16);if(R===null)continue;let m=16+v,_,x;if(p.length<m+64){let oe=Math.min(m+64,r-u),h=await t.read(u,oe);if(h.length<m+64)continue;let U=new DataView(h.buffer,h.byteOffset,h.byteLength);_=b(U,m+32),x=b(U,m+40)}else _=b(y,m+32),x=b(y,m+40);let ae=u+16+v+R+_+x,ie=Math.min(ae+65536,r)-u;e.push({offset:u,length:ie})}return e}function q(t,r){let e=[];for(let n of t){if(n.kind!=="clip"||!n.source_range)continue;let a=n.source_range.start.value,i=n.source_range.duration.value,o=Math.max(0,Math.floor(a)-r),s=Math.floor(a+i-1)+r;s>=o&&e.push({first_frame:o,last_frame:s})}return e}function ce(t,r){let e=[...t].sort((i,o)=>i.offset-o.offset),n=[],a=0;for(let i of e)i.offset>a&&n.push({offset:a,length:i.offset-a}),a=Math.max(a,i.offset+i.length);return a<r&&n.push({offset:a,length:r-a}),n}async function K(t,r,e){let n=q(r,0);if(n.length===0)throw new Error("planMxfTrimsFromItems: no usable trim ranges in items");await l();let a=(o,s)=>t.read(o,s),i=await J(n,e,(o,s)=>V(a,t.fileSize,o,s));return i.map((o,s)=>{let c=JSON.parse(o);return i.length>1&&(c.output_clip_number=s+1,c.output_clip_count=i.length,c.output_part_number=1),c})}async function Q(t,r,e){await l();let n=q(r,e),i=await W((s,c)=>t.read(s,c),t.fileSize,JSON.stringify(n));if(i!=="null")return JSON.parse(i);console.warn(`[mxf] no parseable index \u2014 shipping the WHOLE file (${t.fileSize} bytes). The cut's ${n.length} range(s) cannot be addressed; nothing is trimmed.`);let o=(await H(t)).map(s=>({offset:s.offset,length:s.length}));return{fileSize:t.fileSize,structuralRanges:o,essenceRanges:ce(o,t.fileSize),trimInputs:n,wholeFileFallback:!0}}async function X(t){await l();let e=await G((n,a)=>t.read(n,a),t.fileSize);return JSON.parse(e)}function w(t){return(r,e)=>t.read(r,e)}var Me={async inspect(t){let r=t.parts[0],e=await X(r);if(!e)return null;let n=e.timecode??null,a=n&&n.fps_denominator>0?n.fps_numerator/n.fps_denominator:null,i=e.width??null,o=e.height??null,s=e.inner_codec==="mpeg2"||e.inner_codec==="dv"?e.inner_codec:null;return{id:r.filename,kind:"external",target_url:r.filename,available_range:a&&e.frame_count?{start:{value:0,rate:a},duration:{value:e.frame_count,rate:a}}:null,reel_name:null,source_timecode:n?.display??null,source_fps:a,source_resolution_w:i,source_resolution_h:o,container:"mxf",codec:s,size_bytes:r.fileSize,streams:[...i||o||a?[{kind:"video",codec:s,width:i??void 0,height:o??void 0,rate:a??void 0,codec_specific:null}]:[],...e.audio?[{kind:"audio",codec:e.audio.codec_fourcc,channels:e.audio.channels??void 0,rate:e.audio.sample_rate??void 0,bit_depth:e.audio.bit_depth??void 0,codec_specific:{fourcc:e.audio.codec_fourcc}}]:[]],decode_provenance:e.decode_provenance??null,vendor_metadata:{frame_count:e.frame_count,...n?{drop_frame:n.drop_frame}:{},...e.inner_codec?{inner_codec:e.inner_codec}:{},...e.truncated?{truncated:!0}:{}},binding_state:"unbound",raw_extraction:{mxf_probe:e},metadata:{}}},async extract(t){await l();let r=t.parts[0],e=JSON.parse(await O(w(r),r.fileSize));return e.length===0?null:{v:1,container:"mxf",codec:"mxf",frame_count:$(e),granularity:"frame",segments:e}},async sparsify(t,r){let e=t.parts[0],n=await Q(e,r.items,r.handles);return[{filename:e.filename,fileSize:n.fileSize,structuralRanges:n.structuralRanges,essenceRanges:n.essenceRanges,trimInputs:n.trimInputs,wholeFileFallback:n.wholeFileFallback}]},async trim(t,r){let e=t.parts[0];return K(e,r.items,r.handles)},async decode(t,r,e){await l();let n=t.parts[0],a=w(n),i=await re(t),o=e.detail==="coarse",s;if(i==="arriraw")s=await S(a,n.fileSize,r,o?"preview:4":"full");else if(i==="arriraw-alev3")s=await I(a,n.fileSize,r,o?"preview:4":"full");else if(i==="dnxhr")s=await M(a,n.fileSize,r,o?"preview":"full");else if(i==="xocn")s=await P(a,n.fileSize,r,o?"preview":"full");else if(i==="prores")s=await k(a,n.fileSize,r,o?"preview":"full");else throw new Error(`mxf decode: no decoder for inner codec '${i}'`);let c=new DataView(s.buffer,s.byteOffset,8);return{width:c.getUint32(0,!0),height:c.getUint32(4,!0),rgba:s.slice(8)}},async decode16(t,r){await l();let e=t.parts[0],n=w(e),a=await re(t),i;try{if(a==="arriraw"){let o=await ue(t,r);if(o)return o;i=await S(n,e.fileSize,r,"rgb16")}else if(a==="dnxhr")i=await M(n,e.fileSize,r,"rgb16");else if(a==="xocn")i=await P(n,e.fileSize,r,"rgb16");else throw new Error(`mxf decode16: no decoder for inner codec '${a}'`)}catch(o){throw fe(o,a)}return j(i)}};function fe(t,r){let e=typeof t=="string"?t:t instanceof Error?t.message:"";return/has no 16-bit decoder|no rgb16 tier/.test(e)?new Error(`mxf ${r}: has no 16-bit decoder \u2014 ${e}`):t}var Y=new WeakMap;async function ue(t,r){if(!N)return null;try{let e=await import("./arriraw-YIJ3BYNN.js");if(!await e.arrirawGpuAvailable())return null;let{parseArrirawGpuPayload:n,arrirawFrameToRgb16:a}=await import("./clip-state-B6JOX3JE.js"),i=t.parts[0],o=Y.get(t)??null,s=await B(w(i),i.fileSize,r,o?.key),c=n(s,o);if(!c)return null;Y.set(t,{key:c.key,state:c.state});let f=await e.decodeArrirawFrameGpu(c.essence,c.state);return f?{width:f.width,height:f.height,rgb16:a(f)}:null}catch{return null}}var ee=new WeakMap;async function re(t){let r=ee.get(t);if(r)return r;await l();let e=t.parts[0],n=w(e),a="mxf";return await T(n,e.fileSize)?a="arriraw":await D(n,e.fileSize)?a="arriraw-alev3":await E(n,e.fileSize)?a="dnxhr":await L(n,e.fileSize)?a="xocn":await C(n,e.fileSize)&&(a="prores"),ee.set(t,a),a}export{Me as mxfFormat};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e,f,g,h,i}from"./chunk-4RA57LTJ.js";import"./chunk-PSANHDZM.js";export{c as CoverageMissError,e as DeliveryCoverageMissError,a as INTENTS,f as asDeliveryCoverageMiss,h as extract,i as mediaOp,d as parseDeliveryCoverageMiss,g as resolveFormat,b as unpackFrame16};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{H as b,P as $,b as m,ba as o,g as c,j as p,o as f,u as d}from"./chunk-X527E5VI.js";import"./chunk-PSANHDZM.js";import{dirname as g}from"node:path";import{fileURLToPath as P}from"node:url";import x from"node:process";var a="ColorMatchProbe.ofx.bundle",R="http://127.0.0.1:9876",u="/Library/OFX/Plugins";async function v(){let r=x.execPath;for(let t of[m("CONFORM_RESOLVE_PROBE"),o(g(r),"..","Resources","resolve-probe",a),o(g(P(import.meta.url)),"..","..","..","resolve_hook","build",a)])if(t&&await d(o(t,"Contents","MacOS","ColorMatchProbe.ofx")))return t;return null}async function k(){let r=c()==="darwin"&&p()==="arm64",t=await d(o(u,a)),n=await fetch(R+"/",{signal:AbortSignal.timeout(500)}).then(i=>i.ok).catch(()=>!1),s=!!await v();return{installed:t,loaded:n,shipped:s,supported:r,next:r?n?"running: the Color page selection and the selected node are read live":t?"installed; restart Resolve to load it":s?"host_setup host=resolve action=install_probe (asks for an administrator), then restart Resolve":"not in this build":"the probe runs on Apple silicon Macs only"}}async function C(){if(c()!=="darwin"||p()!=="arm64")throw new Error("the probe runs on Apple silicon Macs only");let r=await v();if(!r)throw new Error("this build does not carry the probe (resolve_hook/build.sh makes it)");return await O(r,u,a),await b(o(f(),"Library","Application Support","Blackmagic Design","DaVinci Resolve","OFXPluginCacheV2.xml")).catch(()=>{}),{path:o(u,a),restart_required:!0}}var e=r=>`'${r.replace(/'/g,"'\\''")}'`;async function O(r,t,n){let s=o(t,n),l=o(t,`.${n}.staging`),i=o(t,`.${n}.previous`),w=[`mkdir -p ${e(t)}`,`rm -rf ${e(l)} ${e(i)}`,`cp -R ${e(r)} ${e(l)}`,`if [ -e ${e(s)} ]; then mv ${e(s)} ${e(i)}; fi`,`mv ${e(l)} ${e(s)} || { [ -e ${e(i)} ] && mv ${e(i)} ${e(s)}; exit 1; }`,`rm -rf ${e(i)}`].join(" && "),h=await $("osascript",["-e",`do shell script ${JSON.stringify(w)} with administrator privileges`]);if(!h.success)throw new Error(`installing into ${t} needs an administrator, and that was refused or failed: ${h.stderr.trim()}`)}export{a as PROBE_BUNDLE,R as PROBE_URL,C as installProbe,k as probeStatus};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{c as l}from"./chunk-
|
|
3
|
+
import{c as l}from"./chunk-4RA57LTJ.js";import{Aa as v,Ba as F,H as _,Ha as O,I as S,Ia as f,J as P,ja as b,ka as R,xa as w}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";var g=class{constructor(e=[]){this.ranges=[];for(let[r,n]of e)this.add(r,n)}add(e,r){if(r<=e)return;let n=[],[s,o]=[e,r];for(let[i,a]of this.ranges)a<s||i>o?n.push([i,a]):(s=Math.min(s,i),o=Math.max(o,a));n.push([s,o]),n.sort((i,a)=>i[0]-a[0]),this.ranges=n}has(e,r){return r<=e?!0:this.ranges.some(([n,s])=>n<=e&&s>=r)}missing(e,r){if(r<=e)return[];let n=[],s=e;for(let[o,i]of this.ranges)if(!(i<=s)&&(o>=r||(o>s&&n.push([s,Math.min(o,r)]),s=Math.max(s,i),s>=r)))break;return s<r&&n.push([s,r]),n}count(){return this.ranges.reduce((e,[r,n])=>e+(n-r),0)}toJSON(){return this.ranges.map(([e,r])=>[e,r])}};function U(t,e){let r=new g;for(let n of t){if(n.kind!=="clip"||!n.source_range)continue;let s=n.source_range.start.value,o=n.source_range.duration.value,i=Math.max(0,Math.max(0,Math.floor(s))-e),a=Math.floor(s+o)+e;a>i&&r.add(i,a)}return r.toJSON()}function J(t,e,r){let n=U(e,r),s=a=>n.some(([c,u])=>a>=c&&a<u),o=new Map,i=a=>{let c=o.get(a);return c||(c={part:a,structuralRanges:[],essenceRanges:[]},o.set(a,c)),c};for(let a of t.segments){let c=a.part??0;a.kind==="structural"?i(c).structuralRanges.push({offset:a.offset,length:a.length}):(a.kind==="frame"||a.kind==="gop")&&a.frame_in!=null&&s(a.frame_in)&&i(c).essenceRanges.push({offset:a.offset,length:a.length})}return[...o.values()].sort((a,c)=>a.part-c.part)}async function A(t,e){if(!O)return null;try{let n=await(await import("./r3d-I6EYEYX7.js")).decodeR3dRgbaGpu(t,e);return n?{width:n.width,height:n.height,rgba:n.rgba}:null}catch{return null}}function p(t){return(e,r,n)=>t.parts[e].read(r,n)}function d(t){return JSON.stringify(t.parts.map(e=>({name:e.filename,size:e.fileSize})))}function L(t,e){let r=[];for(let n of t){if(n.kind!=="clip"||!n.source_range)continue;let s=n.source_range.start.value,o=n.source_range.duration.value;r.push({frame_in:Math.max(0,Math.floor(s)),frame_out:Math.floor(s+o),handles:e})}return JSON.stringify(r)}var k=16,h=new WeakMap,D=new WeakMap;function x(t){let e=D.get(t);return e||(e=t.parts[0].read(0,Math.min(16*1024,t.parts[0].fileSize)),D.set(t,e)),e}async function N(t){let e=h.get(t);return e||(await f(),e=JSON.parse(await b(p(t),d(t))),h.set(t,e)),e}async function G(t){await f();let e=await b(p(t),d(t));return h.set(t,JSON.parse(e)),e}function B(t,e){h.set(t,JSON.parse(e))}async function C(t,e){let r=JSON.parse(await R(p(t),d(t)));return{v:1,container:"r3d",codec:"redcode",frame_count:e.frame_count,granularity:"frame",...t.parts.length>1?{part_names:t.parts.map(n=>n.filename.split(/[/\\]/).pop()??n.filename)}:{},segments:r}}var V={async inspect(t){await f();let e=await w(p(t),d(t)),r=JSON.parse(e);if(!r||r.frame_count===0)return null;let n=t.parts[0],s=r.timecode??null,o=s&&s.fps_denominator>0?s.fps_numerator/s.fps_denominator:null,i=r.width??null,a=r.height??null;return{id:n.filename,kind:"external",target_url:n.filename,available_range:o&&r.frame_count?{start:{value:0,rate:o},duration:{value:r.frame_count,rate:o}}:null,reel_name:r.reel??null,source_timecode:s?.display??null,source_fps:o,source_resolution_w:i,source_resolution_h:a,container:"r3d",codec:"redcode",size_bytes:r.file_size,streams:[{kind:"video",codec:"redcode",width:i??void 0,height:a??void 0,rate:o??void 0,bit_depth:k,codec_specific:{fourcc:r.codec_fourcc??"REDCODE"}}],decode_provenance:r.decode_provenance??null,vendor_metadata:{frame_count:r.frame_count,...s?{drop_frame:s.drop_frame}:{}},binding_state:"unbound",raw_extraction:{r3d_probe:r},metadata:{}}},async extract(t){await f();let e=JSON.parse(await w(p(t),d(t)));return!e||e.frame_count===0?null:C(t,e)},async sparsify(t,e){await f();let r=JSON.parse(await R(p(t),d(t))),n={v:1,container:"r3d",codec:"redcode",frame_count:r.filter(o=>o.kind==="frame").length,granularity:"frame",segments:r},s=new Map;for(let o of r)o.kind==="frame"&&s.set(o.part??0,(s.get(o.part??0)??0)+1);return J(n,e.items,e.handles).map(o=>({filename:t.parts[o.part].filename,fileSize:t.parts[o.part].fileSize,structuralRanges:o.structuralRanges,essenceRanges:o.essenceRanges,frameCount:s.get(o.part)??0,keptFrames:o.essenceRanges.length}))},async trim(t,e){await f();let r=t.parts.some(a=>a.dataRanges!==void 0),n=r?JSON.stringify(t.parts.map(a=>a.dataRanges??[])):"[]",s=r?"[]":L(e.items,e.handles),o=await F(p(t),d(t),s,n);return JSON.parse(o).parts.map(a=>a.trim_plan)},async decode(t,e,r){await f();let n=await N(t);if(e<0||e>=n.length)throw new l(e,n.length);let s=n[e],o=s.part??0,i=t.parts[o];if(!i)throw new l(e,n.length);let a=await i.read(s.essenceOffset,s.essenceLength),c=2,u=await x(t),m;if(r.detail==="coarse")m=_(a,u,0);else if(v(a))m=_(a,u,c);else{let y=await A(a,u);if(y)return y;m=P(a,u)}let M=new DataView(m.buffer,m.byteOffset,8);return{width:M.getUint32(0,!0),height:M.getUint32(4,!0),rgba:m.slice(8)}},async decode16(t,e){await f();let r=await N(t);if(e<0||e>=r.length)throw new l(e,r.length);let n=r[e],s=t.parts[n.part??0];if(!s)throw new l(e,r.length);let o=await s.read(n.essenceOffset,n.essenceLength),i=S(o),a=new DataView(i.buffer,i.byteOffset,8),c=a.getUint32(0,!0),u=a.getUint32(4,!0),m=i.slice(8);return{width:c,height:u,rgb16:new Uint16Array(m.buffer,m.byteOffset,c*u*3)}}};export{G as listR3dFramesJson,V as r3dFormat,B as seedR3dFramesJson};
|