conformtools 0.6.26 → 0.6.28

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.
Files changed (58) hide show
  1. package/dist/{bridge-GMBZ2C5T.js → bridge-I6VDW7YC.js} +1 -1
  2. package/dist/{chunk-V6MI7VE3.js → chunk-5JIFRR7U.js} +1 -1
  3. package/dist/{chunk-LBROV5JN.js → chunk-6QB4DV22.js} +1 -1
  4. package/dist/{chunk-DVPU4AYU.js → chunk-7CASAJU4.js} +1 -1
  5. package/dist/{chunk-3K2XVUJZ.js → chunk-7GEOQ4N6.js} +6 -6
  6. package/dist/chunk-7Z65WW4I.js +3 -0
  7. package/dist/{chunk-NQDVV2PX.js → chunk-ASFUV3PB.js} +1 -1
  8. package/dist/{chunk-ZNUIZEPF.js → chunk-BIX5ETBY.js} +1 -1
  9. package/dist/{chunk-IUW3BFGE.js → chunk-CSH2RRI6.js} +1 -1
  10. package/dist/{chunk-JFEOLU4H.js → chunk-CV7OBWOX.js} +1 -1
  11. package/dist/{chunk-XX7QQIBI.js → chunk-NRURUPLU.js} +1 -1
  12. package/dist/{chunk-KDNIWB5V.js → chunk-PGJMKUUP.js} +1 -1
  13. package/dist/{chunk-FDUFUJXI.js → chunk-QY4QDBIN.js} +3 -3
  14. package/dist/{chunk-5JDF2IUF.js → chunk-TGLH2JDW.js} +1 -1
  15. package/dist/chunk-TIZC6IEH.js +10 -0
  16. package/dist/{chunk-XIFURVIB.js → chunk-TNCXZIOX.js} +1 -1
  17. package/dist/{chunk-SW6SUAP3.js → chunk-UE76WJ3Y.js} +1 -1
  18. package/dist/{chunk-3AR7KSPH.js → chunk-UXEL636C.js} +1 -1
  19. package/dist/{chunk-L6ERTJHZ.js → chunk-WG75XXKG.js} +2 -2
  20. package/dist/{chunk-EZYCCYY7.js → chunk-WRDA44QF.js} +1 -1
  21. package/dist/{chunk-SMYDU75N.js → chunk-X76IIWBH.js} +1 -1
  22. package/dist/cli.js +1 -1
  23. package/dist/{cr3-wasm-CQ5YEFUF.js → cr3-wasm-I3MVBOT3.js} +1 -1
  24. package/dist/{dng-wasm-K6PWOV4P.js → dng-wasm-JX2PZ5CY.js} +1 -1
  25. package/dist/{dpx-wasm-RJZANW6N.js → dpx-wasm-SIM6VRGD.js} +1 -1
  26. package/dist/{exr-wasm-EZY3GZ2L.js → exr-wasm-EEY5CU2U.js} +1 -1
  27. package/dist/{framing-OPXDRT3I.js → framing-QC7Z2GRK.js} +1 -1
  28. package/dist/gfx-worker.js +1 -1
  29. package/dist/{h264-KMDAFD3Q.js → h264-TVMYQ7EB.js} +1 -1
  30. package/dist/{h264-mxf-IJYHBYKB.js → h264-mxf-PKSTGNGH.js} +1 -1
  31. package/dist/{host-relink-R2I74NWX.js → host-relink-B3M3B3VF.js} +1 -1
  32. package/dist/hosts-LVKUUVG7.js +3 -0
  33. package/dist/http.js +2 -2
  34. package/dist/{inspect-6PAE2CSO.js → inspect-RT36GEVU.js} +1 -1
  35. package/dist/isobmff-65LRNCQH.js +3 -0
  36. package/dist/{mc-video-DTMHUECT.js → mc-video-2PCAX65A.js} +1 -1
  37. package/dist/mcp.js +1 -1
  38. package/dist/{media-3XXQBZNW.js → media-NCUTSVJ4.js} +1 -1
  39. package/dist/media_core-YNYOS4L3.js +9 -0
  40. package/dist/mxf-WFJNAX7D.js +3 -0
  41. package/dist/{ops-QAML7C35.js → ops-SH3IUU2Z.js} +1 -1
  42. package/dist/{r3d-AWQQHTQC.js → r3d-AKUA77ZG.js} +1 -1
  43. package/dist/{r3d-OL6DVR3C.js → r3d-X2O5LUAB.js} +1 -1
  44. package/dist/{still-CDF26BQZ.js → still-LQOFV74F.js} +1 -1
  45. package/dist/{still-wasm-3EBYMLVL.js → still-wasm-PQJ4OARF.js} +1 -1
  46. package/dist/{tiff-wasm-JIBA5AI4.js → tiff-wasm-JH6DUOML.js} +1 -1
  47. package/dist/{timeline-FE2DA3ZK.js → timeline-33MJ3HOK.js} +1 -1
  48. package/dist/wasm/media_core_bg.wasm +0 -0
  49. package/dist/wasm-threads/media_core_bg.wasm +0 -0
  50. package/dist/wav-GTQMRIR3.js +3 -0
  51. package/package.json +5 -5
  52. package/dist/chunk-BHBBS26Z.js +0 -10
  53. package/dist/chunk-DCO5D65W.js +0 -3
  54. package/dist/hosts-3YODY7SA.js +0 -3
  55. package/dist/isobmff-4FUKPUL3.js +0 -3
  56. package/dist/media_core-KHSB6EFN.js +0 -9
  57. package/dist/mxf-LGRSWF7S.js +0 -3
  58. package/dist/wav-N6EWJR2P.js +0 -3
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import"./chunk-PSANHDZM.js";function wt(r,n){return new Promise(e=>{r.addEventListener("message",function _({data:a}){a?.type===n&&(r.removeEventListener("message",_),e(a))})})}wt(self,"wasm_bindgen_worker_init").then(async({init:r,receiver:n})=>{let e=await import("./media_core-YNYOS4L3.js");await e.default(r),postMessage({type:"wasm_bindgen_worker_ready"}),e.wbg_rayon_start_worker(n)});var Tt;async function bt(r,n,e){if(e.numThreads()===0)throw new Error("num_threads must be > 0.");let _={type:"wasm_bindgen_worker_init",init:{module_or_path:r,memory:n},receiver:e.receiver()};Tt=await Promise.all(Array.from({length:e.numThreads()},async()=>{let a=new Worker(new URL("./workerHelpers.js",import.meta.url),{type:"module"});return a.postMessage(_),await wt(a,"wasm_bindgen_worker_ready"),a})),e.build()}var et=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,ft.unregister(this),n}free(){let n=this.__destroy_into_raw();t.__wbg_exrbench_free(n,0)}block_rows(){return t.exrbench_block_rows(this.__wbg_ptr)>>>0}f32_to_half_block(){return t.exrbench_f32_to_half_block(this.__wbg_ptr)}n_blocks(){return t.exrbench_n_blocks(this.__wbg_ptr)>>>0}constructor(n,e,_,a){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=I(a,t.__wbindgen_export4,t.__wbindgen_export5),w=p;t.exrbench_new(s,n,e,_,g,w);var c=o().getInt32(s+0,!0),i=o().getInt32(s+4,!0),d=o().getInt32(s+8,!0);if(d)throw u(i);return this.__wbg_ptr=c,ft.register(this,this.__wbg_ptr,this),this}finally{t.__wbindgen_add_to_stack_pointer(16)}}piz_stage_block(n){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.exrbench_piz_stage_block(c,this.__wbg_ptr,n);var e=o().getFloat64(c+0,!0),_=o().getInt32(c+8,!0),a=o().getInt32(c+12,!0);if(a)throw u(_);return e}finally{t.__wbindgen_add_to_stack_pointer(16)}}staging_f32_ptr(){return t.exrbench_staging_f32_ptr(this.__wbg_ptr)>>>0}staging_f32_samples(){return t.exrbench_staging_f32_samples(this.__wbg_ptr)>>>0}staging_half_len(){return t.exrbench_staging_half_len(this.__wbg_ptr)>>>0}staging_half_ptr(){return t.exrbench_staging_half_ptr(this.__wbg_ptr)>>>0}zip_stage_block(n){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.exrbench_zip_stage_block(c,this.__wbg_ptr,n);var e=o().getFloat64(c+0,!0),_=o().getInt32(c+8,!0),a=o().getInt32(c+12,!0);if(a)throw u(_);return e}finally{t.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(et.prototype[Symbol.dispose]=et.prototype.free);var nt=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,vt.unregister(this),n}free(){let n=this.__destroy_into_raw();t.__wbg_exrstreamencoder_free(n,0)}block_rows(){return t.exrstreamencoder_block_rows(this.__wbg_ptr)>>>0}finish(){try{let i=t.__wbindgen_add_to_stack_pointer(-16);t.exrstreamencoder_finish(i,this.__wbg_ptr);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}header(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.exrstreamencoder_header(a,this.__wbg_ptr);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}n_blocks(){return t.exrstreamencoder_n_blocks(this.__wbg_ptr)>>>0}constructor(n,e,_,a,c,i,d,s,g,w){try{let y=t.__wbindgen_add_to_stack_pointer(-16),k=I(_,t.__wbindgen_export4,t.__wbindgen_export5),A=p,F=I(a,t.__wbindgen_export4,t.__wbindgen_export5),R=p,z=I(c,t.__wbindgen_export4,t.__wbindgen_export5),M=p,T=I(i,t.__wbindgen_export4,t.__wbindgen_export5),U=p,O=I(s,t.__wbindgen_export4,t.__wbindgen_export5),q=p;t.exrstreamencoder_new(y,n,e,k,A,F,R,z,M,T,U,d,O,q,g,w);var b=o().getInt32(y+0,!0),x=o().getInt32(y+4,!0),m=o().getInt32(y+8,!0);if(m)throw u(x);return this.__wbg_ptr=b,vt.register(this,this.__wbg_ptr,this),this}finally{t.__wbindgen_add_to_stack_pointer(16)}}push_block(n){try{let d=t.__wbindgen_add_to_stack_pointer(-16);t.exrstreamencoder_push_block(d,this.__wbg_ptr,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}rows_remaining(){return t.exrstreamencoder_rows_remaining(this.__wbg_ptr)>>>0}staging_ptr(){return t.exrstreamencoder_staging_ptr(this.__wbg_ptr)>>>0}staging_samples(){return t.exrstreamencoder_staging_samples(this.__wbg_ptr)>>>0}};Symbol.dispose&&(nt.prototype[Symbol.dispose]=nt.prototype.free);var rt=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,xt.unregister(this),n}free(){let n=this.__destroy_into_raw();t.__wbg_proresbench_free(n,0)}constructor(n,e,_,a){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=I(_,t.__wbindgen_export4,t.__wbindgen_export5),w=p;t.proresbench_new(s,n,e,g,w,a);var c=o().getInt32(s+0,!0),i=o().getInt32(s+4,!0),d=o().getInt32(s+8,!0);if(d)throw u(i);return this.__wbg_ptr=c,xt.register(this,this.__wbg_ptr,this),this}finally{t.__wbindgen_add_to_stack_pointer(16)}}stage(n){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.proresbench_stage(c,this.__wbg_ptr,n);var e=o().getFloat64(c+0,!0),_=o().getInt32(c+8,!0),a=o().getInt32(c+12,!0);if(a)throw u(_);return e}finally{t.__wbindgen_add_to_stack_pointer(16)}}staging_len(){return t.proresbench_staging_len(this.__wbg_ptr)>>>0}staging_ptr(){return t.proresbench_staging_ptr(this.__wbg_ptr)>>>0}};Symbol.dispose&&(rt.prototype[Symbol.dispose]=rt.prototype.free);var _t=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,It.unregister(this),n}free(){let n=this.__destroy_into_raw();t.__wbg_proresmovencoder_free(n,0)}add_frame_rgba(n){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(n,t.__wbindgen_export4),i=p;t.proresmovencoder_add_frame_rgba(a,this.__wbg_ptr,c,i);var e=o().getInt32(a+0,!0),_=o().getInt32(a+4,!0);if(_)throw u(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}finish(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovencoder_finish(a,this.__wbg_ptr);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}frame_count(){return t.proresmovencoder_frame_count(this.__wbg_ptr)>>>0}constructor(n,e,_,a){let c=t.proresmovencoder_new(n,e,_,a);return this.__wbg_ptr=c,It.register(this,this.__wbg_ptr,this),this}set_alpha(n){t.proresmovencoder_set_alpha(this.__wbg_ptr,n)}set_bitrate_mbps(n){t.proresmovencoder_set_bitrate_mbps(this.__wbg_ptr,n)}set_qscale(n){t.proresmovencoder_set_qscale(this.__wbg_ptr,n)}};Symbol.dispose&&(_t.prototype[Symbol.dispose]=_t.prototype.free);var ot=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,yt.unregister(this),n}free(){let n=this.__destroy_into_raw();t.__wbg_proresmovwriter_free(n,0)}finish(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_finish(a,this.__wbg_ptr);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}frame_count(){return t.proresmovwriter_frame_count(this.__wbg_ptr)>>>0}header(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_header(a,this.__wbg_ptr);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}mdat_box_header(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_mdat_box_header(a,this.__wbg_ptr);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}mdat_box_offset(){return t.proresmovwriter_mdat_box_offset(this.__wbg_ptr)}constructor(n,e,_,a){let c=t.proresmovwriter_new(n,e,_,a);return this.__wbg_ptr=c,yt.register(this,this.__wbg_ptr,this),this}push_frame(){try{let i=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_push_frame(i,this.__wbg_ptr);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}push_sample(n){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(n,t.__wbindgen_export4),i=p;t.proresmovwriter_push_sample(a,this.__wbg_ptr,c,i);var e=o().getInt32(a+0,!0),_=o().getInt32(a+4,!0);if(_)throw u(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}push_sample_len(n){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_push_sample_len(a,this.__wbg_ptr,n);var e=o().getInt32(a+0,!0),_=o().getInt32(a+4,!0);if(_)throw u(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}reserve_large_mdat(n){t.proresmovwriter_reserve_large_mdat(this.__wbg_ptr,n)}set_alpha(n){t.proresmovwriter_set_alpha(this.__wbg_ptr,n)}set_bitrate_mbps(n){t.proresmovwriter_set_bitrate_mbps(this.__wbg_ptr,n)}set_par(n,e){t.proresmovwriter_set_par(this.__wbg_ptr,n,e)}set_profile(n){let e=I(n,t.__wbindgen_export4,t.__wbindgen_export5),_=p;t.proresmovwriter_set_profile(this.__wbg_ptr,e,_)}set_qscale(n){t.proresmovwriter_set_qscale(this.__wbg_ptr,n)}set_start_timecode(n,e){t.proresmovwriter_set_start_timecode(this.__wbg_ptr,n,e)}staging_len(){return t.proresmovwriter_staging_len(this.__wbg_ptr)>>>0}staging_ptr(){return t.proresmovwriter_staging_ptr(this.__wbg_ptr)>>>0}total_len(){return t.proresmovwriter_total_len(this.__wbg_ptr)}};Symbol.dispose&&(ot.prototype[Symbol.dispose]=ot.prototype.free);function Nt(r){let n,e;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.arriraw12_clip_info(c,i,d);var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);return n=_,e=a,j(_,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function Gt(r,n,e,_){var a=E(_)?0:I(_,t.__wbindgen_export4,t.__wbindgen_export5),c=p;let i=t.arriraw_mxf_gpu_frame(v(r),n,e,a,c);return u(i)}function Xt(r,n,e){let _=t.audio_aac_au(v(r),n,e);return u(_)}function Yt(r,n){let e=t.audio_aac_config(v(r),n);return u(e)}function Jt(r,n){let e=t.audio_info(v(r),n);return u(e)}function Kt(r){let n=it(r,t.__wbindgen_export4),e=p;return t.bench_f32_boundary(n,e)}function Qt(r,n,e,_){let a=it(r,t.__wbindgen_export4),c=p;return t.bench_piz_no_huffman(a,c,n,e,_)}function Zt(r,n){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=I(r,t.__wbindgen_export4,t.__wbindgen_export5),s=p;var e=it(n,t.__wbindgen_export4),_=p;t.color_cst(i,d,s,e,_,v(n));var a=o().getInt32(i+0,!0),c=o().getInt32(i+4,!0);if(c)throw u(a)}finally{t.__wbindgen_add_to_stack_pointer(16)}}function $t(r,n,e){let _=W(r,t.__wbindgen_export4),a=p;return t.dci_code_full_depth(_,a,n,e)}function te(r,n,e){return t.dci_frame_cap(r,n,e)>>>0}function ee(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p,w=I(n,t.__wbindgen_export4,t.__wbindgen_export5),b=p;t.dci_gpu_colour_patch(d,s,g,w,b);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=ut(e,_).slice();return t.__wbindgen_export3(e,_*2,2),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ne(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=I(r,t.__wbindgen_export4,t.__wbindgen_export5),s=p;t.dci_gpu_colour_tables(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function re(){try{let _=t.__wbindgen_add_to_stack_pointer(-16);t.dci_last_pass_caps(_);var r=o().getInt32(_+0,!0),n=o().getInt32(_+4,!0),e=$(r,n).slice();return t.__wbindgen_export3(r,n*4,4),e}finally{t.__wbindgen_add_to_stack_pointer(16)}}function _e(r,n){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.dci_legal_rates(c,r,n);var e=o().getInt32(c+0,!0),_=o().getInt32(c+4,!0),a=$(e,_).slice();return t.__wbindgen_export3(e,_*4,4),a}finally{t.__wbindgen_add_to_stack_pointer(16)}}function oe(r){return t.dci_mq_bench(r)>>>0}function ie(r,n,e,_,a,c,i,d,s,g,w){try{let A=t.__wbindgen_add_to_stack_pointer(-16),F=S(r,t.__wbindgen_export4),R=p,z=l(n,t.__wbindgen_export4),M=p,T=S(e,t.__wbindgen_export4),U=p,O=S(_,t.__wbindgen_export4),q=p,P=S(a,t.__wbindgen_export4),B=p,at=S(c,t.__wbindgen_export4),ct=p,dt=S(i,t.__wbindgen_export4),st=p,zt=S(d,t.__wbindgen_export4),Wt=p;t.dci_pack_tier1(A,F,R,z,M,T,U,O,q,P,B,at,ct,dt,st,zt,Wt,s,g,w);var b=o().getInt32(A+0,!0),x=o().getInt32(A+4,!0),m=o().getInt32(A+8,!0),y=o().getInt32(A+12,!0);if(y)throw u(m);var k=f(b,x).slice();return t.__wbindgen_export3(b,x*1,1),k}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ae(r,n){let e=t.dci_stage_rgba8(r,n);return u(e)}function ce(r,n,e){let _=W(r,t.__wbindgen_export4),a=p;return t.dci_transform_only(_,a,n,e)}function de(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p,w=l(n,t.__wbindgen_export4),b=p;t.decode_arriraw12_luma(d,s,g,w,b);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function se(r,n,e,_){let a=I(_,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_arriraw12_mxf(v(r),n,e,a,c);return u(i)}function pe(r,n,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),w=p,b=l(n,t.__wbindgen_export4),x=p;t.decode_arriraw12_preview(s,g,w,b,x,e);var _=o().getInt32(s+0,!0),a=o().getInt32(s+4,!0),c=o().getInt32(s+8,!0),i=o().getInt32(s+12,!0);if(i)throw u(c);var d=f(_,a).slice();return t.__wbindgen_export3(_,a*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ge(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p,w=l(n,t.__wbindgen_export4),b=p;t.decode_arriraw12_rgba(d,s,g,w,b);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ue(r,n,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),w=p;t.decode_arriraw_luma(s,g,w,n,e);var _=o().getInt32(s+0,!0),a=o().getInt32(s+4,!0),c=o().getInt32(s+8,!0),i=o().getInt32(s+12,!0);if(i)throw u(c);var d=f(_,a).slice();return t.__wbindgen_export3(_,a*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function we(r,n,e,_){let a=I(_,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_arriraw_mxf(v(r),n,e,a,c);return u(i)}function be(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.decode_arriraw_preview(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function le(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.decode_arriraw_preview_gray(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function fe(r,n,e,_,a,c,i,d,s){try{let A=t.__wbindgen_add_to_stack_pointer(-16),F=l(r,t.__wbindgen_export4),R=p;var g=E(s)?0:J(s,t.__wbindgen_export4),w=p;t.decode_arriraw_preview_meta(A,F,R,n,e,_,a,c,i,d,g,w);var b=o().getInt32(A+0,!0),x=o().getInt32(A+4,!0),m=o().getInt32(A+8,!0),y=o().getInt32(A+12,!0);if(y)throw u(m);var k=f(b,x).slice();return t.__wbindgen_export3(b,x*1,1),k}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ve(r,n,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),w=p;t.decode_arriraw_rgba(s,g,w,n,e);var _=o().getInt32(s+0,!0),a=o().getInt32(s+4,!0),c=o().getInt32(s+8,!0),i=o().getInt32(s+12,!0);if(i)throw u(c);var d=f(_,a).slice();return t.__wbindgen_export3(_,a*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function xe(r,n,e,_,a,c,i,d){try{let k=t.__wbindgen_add_to_stack_pointer(-16),A=l(r,t.__wbindgen_export4),F=p;var s=E(d)?0:J(d,t.__wbindgen_export4),g=p;t.decode_arriraw_rgba_meta(k,A,F,n,e,_,a,c,i,s,g);var w=o().getInt32(k+0,!0),b=o().getInt32(k+4,!0),x=o().getInt32(k+8,!0),m=o().getInt32(k+12,!0);if(m)throw u(x);var y=f(w,b).slice();return t.__wbindgen_export3(w,b*1,1),y}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ie(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_arw_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ye(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_arw_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function me(r,n,e,_){let a=t.decode_audio_pcm(v(r),n,e,_);return u(a)}function he(r,n,e,_,a){let c=t.decode_audio_track_pcm(v(r),n,e,_,a);return u(c)}function ke(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_bmp_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ae(r){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(r,t.__wbindgen_export4),i=p;t.decode_braw_gen5log(a,c,i);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Fe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_braw_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function je(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_braw_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Me(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_braw_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Re(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_cr2_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ze(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_cr2_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function We(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_cr3_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Te(r,n,e,_){let a=I(_,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_crm(v(r),n,e,a,c);return u(i)}function Se(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_dng_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ue(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_dng_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Oe(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_dpx_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Le(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_dpx_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function qe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_dv_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ee(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_dv_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function De(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_dv_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Pe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_exr_linear(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Be(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_exr_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ce(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_exr_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ve(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_gif_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function He(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_heic_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ne(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_j2k_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ge(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_j2k_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Xe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_j2k_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ye(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_jpeg_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Je(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_mpeg2_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ke(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_mpeg2_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Qe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_mpeg2_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ze(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_png_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function $e(r,n,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),w=p;t.decode_prores_band_rgba(s,g,w,n,e);var _=o().getInt32(s+0,!0),a=o().getInt32(s+4,!0),c=o().getInt32(s+8,!0),i=o().getInt32(s+12,!0);if(i)throw u(c);var d=f(_,a).slice();return t.__wbindgen_export3(_,a*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function tn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_prores_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function en(r,n,e,_){let a=I(_,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_prores_mxf(v(r),n,e,a,c);return u(i)}function nn(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_prores_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function rn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_prores_raw_acescct(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function _n(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_prores_raw_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function on(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_prores_raw_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function an(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_prores_raw_rec2020(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function cn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_prores_raw_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function dn(r,n,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),w=p,b=I(n,t.__wbindgen_export4,t.__wbindgen_export5),x=p,m=l(e,t.__wbindgen_export4),y=p;t.decode_prores_raw_tier(s,g,w,b,x,m,y);var _=o().getInt32(s+0,!0),a=o().getInt32(s+4,!0),c=o().getInt32(s+8,!0),i=o().getInt32(s+12,!0);if(i)throw u(c);var d=f(_,a).slice();return t.__wbindgen_export3(_,a*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function sn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_prores_rgb16(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function pn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_prores_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function gn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_prores_thumb_dc32(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function un(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_psd_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function wn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_r3d_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function bn(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_r3d_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ln(r,n,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),w=p,b=l(n,t.__wbindgen_export4),x=p;t.decode_r3d_preview_clip(s,g,w,b,x,e);var _=o().getInt32(s+0,!0),a=o().getInt32(s+4,!0),c=o().getInt32(s+8,!0),i=o().getInt32(s+12,!0);if(i)throw u(c);var d=f(_,a).slice();return t.__wbindgen_export3(_,a*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function fn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_r3d_rgb16(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function vn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_r3d_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function xn(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p,w=l(n,t.__wbindgen_export4),b=p;t.decode_r3d_rgba_clip(d,s,g,w,b);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function In(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_tga_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function yn(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_tiff_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function mn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_tiff_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function hn(r,n,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),w=p;t.decode_vc3_band_rgba(s,g,w,n,e);var _=o().getInt32(s+0,!0),a=o().getInt32(s+4,!0),c=o().getInt32(s+8,!0),i=o().getInt32(s+12,!0);if(i)throw u(c);var d=f(_,a).slice();return t.__wbindgen_export3(_,a*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function kn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_vc3_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function An(r,n,e,_){let a=I(_,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_vc3_mxf(v(r),n,e,a,c);return u(i)}function Fn(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_vc3_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function jn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_vc3_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Mn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_webp_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Rn(r){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(r,t.__wbindgen_export4),i=p;t.decode_xocn_index_luma(a,c,i);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}function zn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_xocn_luma(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Wn(r,n,e,_){let a=I(_,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_xocn_mxf(v(r),n,e,a,c);return u(i)}function Tn(r,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),g=p;t.decode_xocn_preview(d,s,g,n);var e=o().getInt32(d+0,!0),_=o().getInt32(d+4,!0),a=o().getInt32(d+8,!0),c=o().getInt32(d+12,!0);if(c)throw u(a);var i=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Sn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_xocn_preview_rec709(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Un(r){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(r,t.__wbindgen_export4),i=p;t.decode_xocn_rgb16(a,c,i);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}function On(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.decode_xocn_rgba(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ln(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=W(r,t.__wbindgen_export4),b=p;t.encode_dci_j2c(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function qn(r,n,e,_,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=W(r,t.__wbindgen_export4),m=p,y=I(e,t.__wbindgen_export4,t.__wbindgen_export5),k=p;t.encode_dci_j2c_rgb(b,x,m,n,y,k,_,a,c);var i=o().getInt32(b+0,!0),d=o().getInt32(b+4,!0),s=o().getInt32(b+8,!0),g=o().getInt32(b+12,!0);if(g)throw u(s);var w=f(i,d).slice();return t.__wbindgen_export3(i,d*1,1),w}finally{t.__wbindgen_add_to_stack_pointer(16)}}function En(r,n,e,_,a){try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p,m=I(n,t.__wbindgen_export4,t.__wbindgen_export5),y=p;t.encode_dci_j2c_rgba8(w,b,x,m,y,e,_,a);var c=o().getInt32(w+0,!0),i=o().getInt32(w+4,!0),d=o().getInt32(w+8,!0),s=o().getInt32(w+12,!0);if(s)throw u(d);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Dn(r,n,e,_,a){try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=I(_,t.__wbindgen_export4,t.__wbindgen_export5),x=p;t.encode_dci_j2c_staged(w,r,n,e,b,x,a);var c=o().getInt32(w+0,!0),i=o().getInt32(w+4,!0),d=o().getInt32(w+8,!0),s=o().getInt32(w+12,!0);if(s)throw u(d);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Pn(r,n,e,_,a){try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=I(_,t.__wbindgen_export4,t.__wbindgen_export5),x=p;t.encode_dci_j2c_staged_modelled(w,r,n,e,b,x,a);var c=o().getInt32(w+0,!0),i=o().getInt32(w+4,!0),d=o().getInt32(w+8,!0),s=o().getInt32(w+12,!0);if(s)throw u(d);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Bn(r,n,e,_,a,c,i,d,s,g,w,b,x,m,y){try{let M=t.__wbindgen_add_to_stack_pointer(-16),T=it(r,t.__wbindgen_export4),U=p,O=I(a,t.__wbindgen_export4,t.__wbindgen_export5),q=p,P=I(c,t.__wbindgen_export4,t.__wbindgen_export5),B=p,at=I(i,t.__wbindgen_export4,t.__wbindgen_export5),ct=p,dt=I(x,t.__wbindgen_export4,t.__wbindgen_export5),st=p;t.encode_exr(M,T,U,n,e,_,O,q,P,B,at,ct,d,s,g,w,b,dt,st,m,y);var k=o().getInt32(M+0,!0),A=o().getInt32(M+4,!0),F=o().getInt32(M+8,!0),R=o().getInt32(M+12,!0);if(R)throw u(F);var z=f(k,A).slice();return t.__wbindgen_export3(k,A*1,1),z}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Cn(r,n,e,_,a){try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p;t.encode_prores_4444_alpha_mov_rgba(w,b,x,n,e,_,a);var c=o().getInt32(w+0,!0),i=o().getInt32(w+4,!0),d=o().getInt32(w+8,!0),s=o().getInt32(w+12,!0);if(s)throw u(d);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Vn(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.encode_prores_4444_alpha_sample_q(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Hn(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.encode_prores_444_sample_cbr(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Nn(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=W(r,t.__wbindgen_export4),b=p;t.encode_prores_444_sample_cbr_rgb16(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Gn(r,n,e,_,a){try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=W(r,t.__wbindgen_export4),x=p,m=W(a,t.__wbindgen_export4),y=p;t.encode_prores_444_sample_cbr_rgb16_lut(w,b,x,n,e,_,m,y);var c=o().getInt32(w+0,!0),i=o().getInt32(w+4,!0),d=o().getInt32(w+8,!0),s=o().getInt32(w+12,!0);if(s)throw u(d);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Xn(r,n,e,_,a){try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p;t.encode_prores_mov_rgba(w,b,x,n,e,_,a);var c=o().getInt32(w+0,!0),i=o().getInt32(w+4,!0),d=o().getInt32(w+8,!0),s=o().getInt32(w+12,!0);if(s)throw u(d);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Yn(r,n,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),w=p;t.encode_prores_rgba(s,g,w,n,e);var _=o().getInt32(s+0,!0),a=o().getInt32(s+4,!0),c=o().getInt32(s+8,!0),i=o().getInt32(s+12,!0);if(i)throw u(c);var d=f(_,a).slice();return t.__wbindgen_export3(_,a*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Jn(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.encode_prores_sample_cbr(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Kn(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=W(r,t.__wbindgen_export4),b=p;t.encode_prores_sample_cbr_rgb16(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Qn(r,n,e,_,a){try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=W(r,t.__wbindgen_export4),x=p,m=W(a,t.__wbindgen_export4),y=p;t.encode_prores_sample_cbr_rgb16_lut(w,b,x,n,e,_,m,y);var c=o().getInt32(w+0,!0),i=o().getInt32(w+4,!0),d=o().getInt32(w+8,!0),s=o().getInt32(w+12,!0);if(s)throw u(d);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Zn(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.encode_prores_sample_q(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function $n(r,n,e,_){let a,c;try{let x=t.__wbindgen_add_to_stack_pointer(-16),m=I(r,t.__wbindgen_export4,t.__wbindgen_export5),y=p;t.exr_sequence_filename(x,m,y,n,e,_);var i=o().getInt32(x+0,!0),d=o().getInt32(x+4,!0),s=o().getInt32(x+8,!0),g=o().getInt32(x+12,!0),w=i,b=d;if(g)throw w=0,b=0,u(s);return a=w,c=b,j(w,b)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(a,c,1)}}function tr(r,n,e,_,a,c,i,d){let s,g;try{let A=t.__wbindgen_add_to_stack_pointer(-16),F=l(r,t.__wbindgen_export4),R=p,z=l(_,t.__wbindgen_export4),M=p,T=I(d,t.__wbindgen_export4,t.__wbindgen_export5),U=p;t.fit_sizing(A,F,R,n,e,z,M,a,c,i,T,U);var w=o().getInt32(A+0,!0),b=o().getInt32(A+4,!0),x=o().getInt32(A+8,!0),m=o().getInt32(A+12,!0),y=w,k=b;if(m)throw y=0,k=0,u(x);return s=y,g=k,j(y,k)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(s,g,1)}}function er(r){let n=t.initThreadPool(r);return u(n)}function nr(r){let n,e;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.inspect_arw(c,i,d);var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);return n=_,e=a,j(_,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function rr(r){let n,e;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.inspect_cr2(c,i,d);var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);return n=_,e=a,j(_,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function _r(r){let n,e;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.inspect_cr3(c,i,d);var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);return n=_,e=a,j(_,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function or(r){let n,e;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.inspect_dng(c,i,d);var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);return n=_,e=a,j(_,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function ir(r){let n,e;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.inspect_dpx(c,i,d);var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);return n=_,e=a,j(_,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function ar(r){let n,e;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.inspect_exr(c,i,d);var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);return n=_,e=a,j(_,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function cr(r,n,e){let _=I(e,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.inspect_isobmff(v(r),n,_,a);return u(c)}function dr(r){let n,e;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.inspect_tiff(c,i,d);var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);return n=_,e=a,j(_,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function sr(r,n){let e=t.inspect_wav(v(r),n);return u(e)}function pr(r,n){let e=t.is_arriraw12_mxf(v(r),n);return u(e)}function gr(r,n){let e=t.is_arriraw_mxf(v(r),n);return u(e)}function ur(r,n){let e=t.is_crm(v(r),n);return u(e)}function wr(r,n){let e=t.is_prores_mxf(v(r),n);return u(e)}function br(r,n){let e=t.is_vc3_mxf(v(r),n);return u(e)}function lr(r,n){let e=t.is_xavc_mxf(v(r),n);return u(e)}function fr(r,n){let e=t.is_xocn_mxf(v(r),n);return u(e)}function vr(r,n,e,_){let a=I(e,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=I(_,t.__wbindgen_export4,t.__wbindgen_export5),d=p,s=t.isobmff_present_frames(v(r),n,a,c,i,d);return u(s)}function xr(r,n,e){let _=I(e,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.list_isobmff_segments(v(r),n,_,a);return u(c)}function Ir(r,n){let e=t.list_mxf_segments(v(r),n);return u(e)}function yr(r,n){let e=I(n,t.__wbindgen_export4,t.__wbindgen_export5),_=p,a=t.list_r3d_frames(v(r),e,_);return u(a)}function mr(r,n){let e=I(n,t.__wbindgen_export4,t.__wbindgen_export5),_=p,a=t.list_r3d_segments(v(r),e,_);return u(a)}function hr(r,n){let e=t.list_wav_segments(v(r),n);return u(e)}function kr(r,n,e,_,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=l(r,t.__wbindgen_export4),m=p,y=S(n,t.__wbindgen_export4),k=p;t.mux_prores_4444_alpha_samples(b,x,m,y,k,e,_,a,c);var i=o().getInt32(b+0,!0),d=o().getInt32(b+4,!0),s=o().getInt32(b+8,!0),g=o().getInt32(b+12,!0);if(g)throw u(s);var w=f(i,d).slice();return t.__wbindgen_export3(i,d*1,1),w}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ar(r,n,e,_,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=l(r,t.__wbindgen_export4),m=p,y=S(n,t.__wbindgen_export4),k=p;t.mux_prores_samples(b,x,m,y,k,e,_,a,c);var i=o().getInt32(b+0,!0),d=o().getInt32(b+4,!0),s=o().getInt32(b+8,!0),g=o().getInt32(b+12,!0);if(g)throw u(s);var w=f(i,d).slice();return t.__wbindgen_export3(i,d*1,1),w}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Fr(r,n,e,_,a,c,i,d,s,g,w,b){try{let F=t.__wbindgen_add_to_stack_pointer(-16),R=l(r,t.__wbindgen_export4),z=p,M=S(n,t.__wbindgen_export4),T=p,U=I(i,t.__wbindgen_export4,t.__wbindgen_export5),O=p;t.mux_prores_samples_full(F,R,z,M,T,e,_,a,c,U,O,d,s,g,w,b);var x=o().getInt32(F+0,!0),m=o().getInt32(F+4,!0),y=o().getInt32(F+8,!0),k=o().getInt32(F+12,!0);if(k)throw u(y);var A=f(x,m).slice();return t.__wbindgen_export3(x,m*1,1),A}finally{t.__wbindgen_add_to_stack_pointer(16)}}function jr(r,n,e,_){let a=t.mxf_au_run(v(r),n,e,_);return u(a)}function Mr(r,n){let e=t.mxf_frame_index(v(r),n);return u(e)}function Rr(r,n){let e=t.mxf_gop_map(v(r),n);return u(e)}function zr(r,n){let e=t.mxf_h264_kind(v(r),n);return u(e)}function Wr(r,n,e){let _=I(e,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.mxf_present_frames(v(r),n,_,a);return u(c)}function Tr(r,n){let e,_;try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p,m=I(n,t.__wbindgen_export4,t.__wbindgen_export5),y=p;t.plan_isobmff_trim(w,b,x,m,y);var a=o().getInt32(w+0,!0),c=o().getInt32(w+4,!0),i=o().getInt32(w+8,!0),d=o().getInt32(w+12,!0),s=a,g=c;if(d)throw s=0,g=0,u(i);return e=s,_=g,j(s,g)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,_,1)}}function Sr(r,n,e,_,a){let c=I(a,t.__wbindgen_export4,t.__wbindgen_export5),i=p,d=t.plan_isobmff_trim_reader(v(r),n,e,_,c,i);return u(d)}function Ur(r){let n,e;try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=I(r,t.__wbindgen_export4,t.__wbindgen_export5),b=p;t.plan_mxf_compact_trim(g,w,b);var _=o().getInt32(g+0,!0),a=o().getInt32(g+4,!0),c=o().getInt32(g+8,!0),i=o().getInt32(g+12,!0),d=_,s=a;if(i)throw d=0,s=0,u(c);return n=d,e=s,j(d,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function Or(r,n,e,_){let a=t.plan_mxf_trim(v(r),n,e,_);return u(a)}function Lr(r,n,e,_,a,c,i,d){let s,g;try{let x=t.__wbindgen_add_to_stack_pointer(-16),m=l(r,t.__wbindgen_export4),y=p,k=l(n,t.__wbindgen_export4),A=p,F=l(e,t.__wbindgen_export4),R=p,z=l(_,t.__wbindgen_export4),M=p,T=J(a,t.__wbindgen_export4),U=p,O=J(c,t.__wbindgen_export4),q=p,P=J(i,t.__wbindgen_export4),B=p;t.plan_r3d_compact(x,m,y,k,A,F,R,z,M,T,U,O,q,P,B,d);var w=o().getInt32(x+0,!0),b=o().getInt32(x+4,!0);return s=w,g=b,j(w,b)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(s,g,1)}}function qr(r,n,e,_){let a,c;try{let x=t.__wbindgen_add_to_stack_pointer(-16),m=l(r,t.__wbindgen_export4),y=p;t.plan_wav_trim(x,m,y,n,e,_);var i=o().getInt32(x+0,!0),d=o().getInt32(x+4,!0),s=o().getInt32(x+8,!0),g=o().getInt32(x+12,!0),w=i,b=d;if(g)throw w=0,b=0,u(s);return a=w,c=b,j(w,b)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(a,c,1)}}function Er(r,n,e,_,a){let c=t.plan_wav_trim_reader(v(r),n,e,_,a);return u(c)}function Dr(r,n,e,_){let a=I(e,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=I(_,t.__wbindgen_export4,t.__wbindgen_export5),d=p,s=t.prepare_isobmff(v(r),n,a,c,i,d);return u(s)}function Pr(r,n,e){let _=I(e,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.prepare_mxf(v(r),n,_,a);return u(c)}function Br(r,n,e){let _=I(n,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=I(e,t.__wbindgen_export4,t.__wbindgen_export5),i=p,d=t.prepare_r3d(v(r),_,a,c,i);return u(d)}function Cr(r,n,e,_){let a=I(e,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.prepare_wav(v(r),n,a,c,_);return u(i)}function Vr(r){let n,e;try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.probe_mov(g,w,b);var _=o().getInt32(g+0,!0),a=o().getInt32(g+4,!0),c=o().getInt32(g+8,!0),i=o().getInt32(g+12,!0),d=_,s=a;if(i)throw d=0,s=0,u(c);return n=d,e=s,j(d,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function Hr(r,n){let e=t.probe_mxf(v(r),n);return u(e)}function Nr(r,n){let e=I(n,t.__wbindgen_export4,t.__wbindgen_export5),_=p,a=t.probe_r3d(v(r),e,_);return u(a)}function Gr(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.prores_band_info(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=$(n,e).slice();return t.__wbindgen_export3(n,e*4,4),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Xr(r){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(r,t.__wbindgen_export4),i=p;t.prores_raw_container_color(a,c,i);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Yr(){t.prores_reset_rate_control()}function Jr(r){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(r,t.__wbindgen_export4),i=p;t.r3d_gpu_develop_params(a,c,i);var n=o().getInt32(a+0,!0),e=o().getInt32(a+4,!0),_=f(n,e).slice();return t.__wbindgen_export3(n,e*1,1),_}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Kr(r,n,e){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.r3d_index_ranges(i,d,s,n,e);var _=o().getInt32(i+0,!0),a=o().getInt32(i+4,!0),c=$(_,a).slice();return t.__wbindgen_export3(_,a*4,4),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Qr(r){let n=l(r,t.__wbindgen_export4),e=p;return t.r3d_is_helium(n,e)!==0}function Zr(r){let n,e;try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.read_arriraw_fcs(g,w,b);var _=o().getInt32(g+0,!0),a=o().getInt32(g+4,!0),c=o().getInt32(g+8,!0),i=o().getInt32(g+12,!0),d=_,s=a;if(i)throw d=0,s=0,u(c);return n=d,e=s,j(d,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,e,1)}}function $r(r,n){try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),d=p;t.read_arriraw_unit_correction(c,i,d,n);var e=o().getInt32(c+0,!0),_=o().getInt32(c+4,!0),a=qt(e,_).slice();return t.__wbindgen_export3(e,_*8,8),a}finally{t.__wbindgen_add_to_stack_pointer(16)}}function t_(r,n,e,_,a,c,i){let d,s;try{let k=t.__wbindgen_add_to_stack_pointer(-16),A=l(r,t.__wbindgen_export4),F=p,R=l(_,t.__wbindgen_export4),z=p,M=I(i,t.__wbindgen_export4,t.__wbindgen_export5),T=p;t.recover_reframe(k,A,F,n,e,R,z,a,c,M,T);var g=o().getInt32(k+0,!0),w=o().getInt32(k+4,!0),b=o().getInt32(k+8,!0),x=o().getInt32(k+12,!0),m=g,y=w;if(x)throw m=0,y=0,u(b);return d=m,s=y,j(m,y)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(d,s,1)}}function e_(r,n,e,_,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=W(r,t.__wbindgen_export4),m=p,y=I(c,t.__wbindgen_export4,t.__wbindgen_export5),k=p;t.resample_rgba16(b,x,m,n,e,_,a,y,k);var i=o().getInt32(b+0,!0),d=o().getInt32(b+4,!0),s=o().getInt32(b+8,!0),g=o().getInt32(b+12,!0);if(g)throw u(s);var w=ut(i,d).slice();return t.__wbindgen_export3(i,d*2,2),w}finally{t.__wbindgen_add_to_stack_pointer(16)}}function n_(r,n,e,_,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=l(r,t.__wbindgen_export4),m=p,y=I(c,t.__wbindgen_export4,t.__wbindgen_export5),k=p;t.resample_rgba8(b,x,m,n,e,_,a,y,k);var i=o().getInt32(b+0,!0),d=o().getInt32(b+4,!0),s=o().getInt32(b+8,!0),g=o().getInt32(b+12,!0);if(g)throw u(s);var w=f(i,d).slice();return t.__wbindgen_export3(i,d*1,1),w}finally{t.__wbindgen_add_to_stack_pointer(16)}}function r_(){t.reset_dci_rate_state()}function __(r,n,e,_){try{let g=t.__wbindgen_add_to_stack_pointer(-16),w=l(r,t.__wbindgen_export4),b=p;t.resize_luma_area(g,w,b,n,e,_);var a=o().getInt32(g+0,!0),c=o().getInt32(g+4,!0),i=o().getInt32(g+8,!0),d=o().getInt32(g+12,!0);if(d)throw u(i);var s=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function o_(r,n,e,_,a){try{let w=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p,m=I(a,t.__wbindgen_export4,t.__wbindgen_export5),y=p;t.rgba8_to_xyz12(w,b,x,n,e,_,m,y);var c=o().getInt32(w+0,!0),i=o().getInt32(w+4,!0),d=o().getInt32(w+8,!0),s=o().getInt32(w+12,!0);if(s)throw u(d);var g=ut(c,i).slice();return t.__wbindgen_export3(c,i*2,2),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function i_(r,n,e,_){let a,c;try{let x=t.__wbindgen_add_to_stack_pointer(-16),m=W(r,t.__wbindgen_export4),y=p,k=l(n,t.__wbindgen_export4),A=p,F=S(e,t.__wbindgen_export4),R=p,z=I(_,t.__wbindgen_export4,t.__wbindgen_export5),M=p;t.shot_crop(x,m,y,k,A,F,R,z,M);var i=o().getInt32(x+0,!0),d=o().getInt32(x+4,!0),s=o().getInt32(x+8,!0),g=o().getInt32(x+12,!0),w=i,b=d;if(g)throw w=0,b=0,u(s);return a=w,c=b,j(w,b)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(a,c,1)}}function a_(r,n,e){let _,a;try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=W(r,t.__wbindgen_export4),m=p,y=l(n,t.__wbindgen_export4),k=p,A=I(e,t.__wbindgen_export4,t.__wbindgen_export5),F=p;t.shot_ramp(b,x,m,y,k,A,F);var c=o().getInt32(b+0,!0),i=o().getInt32(b+4,!0),d=o().getInt32(b+8,!0),s=o().getInt32(b+12,!0),g=c,w=i;if(s)throw g=0,w=0,u(d);return _=g,a=w,j(g,w)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(_,a,1)}}function c_(r,n,e,_){let a,c;try{let x=t.__wbindgen_add_to_stack_pointer(-16),m=W(r,t.__wbindgen_export4),y=p,k=l(n,t.__wbindgen_export4),A=p,F=S(e,t.__wbindgen_export4),R=p,z=I(_,t.__wbindgen_export4,t.__wbindgen_export5),M=p;t.shot_scan(x,m,y,k,A,F,R,z,M);var i=o().getInt32(x+0,!0),d=o().getInt32(x+4,!0),s=o().getInt32(x+8,!0),g=o().getInt32(x+12,!0),w=i,b=d;if(g)throw w=0,b=0,u(s);return a=w,c=b,j(w,b)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(a,c,1)}}function d_(r,n,e,_){let a=I(n,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=I(e,t.__wbindgen_export4,t.__wbindgen_export5),d=p,s=I(_,t.__wbindgen_export4,t.__wbindgen_export5),g=p,w=t.trim_r3d(v(r),a,c,i,d,s,g);return u(w)}function s_(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),s=p;t.vc3_band_info(i,d,s);var n=o().getInt32(i+0,!0),e=o().getInt32(i+4,!0),_=o().getInt32(i+8,!0),a=o().getInt32(i+12,!0);if(a)throw u(_);var c=$(n,e).slice();return t.__wbindgen_export3(n,e*4,4),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function p_(r){t.video_close(r)}function g_(r,n,e,_){let a=t.video_decode(r,n,e,_);return u(a)}function u_(r,n,e){let _=I(e,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.video_frame_index_isobmff_reader(v(r),n,_,a);return u(c)}function w_(r,n){let e=t.video_open(v(r),n);return u(e)}var Z=class r{static __wrap(n){let e=Object.create(r.prototype);return e.__wbg_ptr=n,mt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,mt.unregister(this),n}free(){let n=this.__destroy_into_raw();t.__wbg_wbg_rayon_poolbuilder_free(n,0)}build(){t.wbg_rayon_poolbuilder_build(this.__wbg_ptr)}numThreads(){return t.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr)>>>0}receiver(){return t.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr)>>>0}};Symbol.dispose&&(Z.prototype[Symbol.dispose]=Z.prototype.free);function b_(r){t.wbg_rayon_start_worker(r)}function l_(r,n,e){let _=t.xavc_au(v(r),n,e);return u(_)}function f_(r,n){let e=t.xavc_frame_count(v(r),n);return u(e)}function v_(r,n){let e=t.xocn_frame_count(v(r),n);return u(e)}function x_(r){let n=l(r,t.__wbindgen_export4),e=p;return t.xocn_index_prefix_len(n,e)>>>0}function I_(r){let n=l(r,t.__wbindgen_export4),e=p;return t.xocn_preview_prefix_len(n,e)>>>0}function kt(r){return{__proto__:null,"./media_core_bg.js":{__proto__:null,__wbg___wbindgen_copy_to_typed_array_c5728021fabd0236:function(e,_,a){new Uint8Array(h(a).buffer,h(a).byteOffset,h(a).byteLength).set(f(e,_))},__wbg___wbindgen_is_function_acc5528be2b923f2:function(e){return typeof h(e)=="function"},__wbg___wbindgen_is_undefined_721f8decd50c87a3:function(e){return h(e)===void 0},__wbg___wbindgen_memory_9751d9a3017e7c25:function(){let e=t.memory;return v(e)},__wbg___wbindgen_module_f86f28f0f85995dd:function(){return v(Mt)},__wbg___wbindgen_rethrow_858623e73c3311dc:function(e){throw u(e)},__wbg___wbindgen_throw_ea4887a5f8f9a9db:function(e,_){throw new Error(j(e,_))},__wbg__wbg_cb_unref_33c39e13d73b25f6:function(e){h(e)._wbg_cb_unref()},__wbg_async_4ec36f08efecafdc:function(e){return h(e).async},__wbg_buffer_49b4f592d8036785:function(e){let _=h(e).buffer;return v(_)},__wbg_call_0e855b388e315e17:function(){return tt(function(e,_,a,c){let i=h(e).call(h(_),h(a),h(c));return v(i)},arguments)},__wbg_call_5575218572ead796:function(){return tt(function(e,_,a){let c=h(e).call(h(_),h(a));return v(c)},arguments)},__wbg_call_dd0f909cbc9405d0:function(){return tt(function(e,_,a,c,i){let d=h(e).call(h(_),h(a),h(c),h(i));return v(d)},arguments)},__wbg_data_23c14f7d1102d077:function(e){let _=h(e).data;return v(_)},__wbg_instanceof_Window_0d356b88a2f77c42:function(e){let _;try{_=h(e)instanceof Window}catch{_=!1}return _},__wbg_length_589238bdcf171f0e:function(e){return h(e).length},__wbg_new_476e05fb84d8e4f3:function(e){let _=new Int32Array(h(e));return v(_)},__wbg_new_81880fb5002cb255:function(e){let _=new Uint8Array(h(e));return v(_)},__wbg_new_f85beb941dc6d8aa:function(e,_){try{var a={a:e,b:_},c=(d,s)=>{let g=a.a;a.a=0;try{return lt(g,a.b,d,s)}finally{a.a=g}};let i=new Promise(c);return v(i)}finally{a.a=0}},__wbg_new_typed_00a409eb4ec4f2d9:function(e,_){try{var a={a:e,b:_},c=(d,s)=>{let g=a.a;a.a=0;try{return lt(g,a.b,d,s)}finally{a.a=g}};let i=new Promise(c);return v(i)}finally{a.a=0}},__wbg_new_worker_e68fc8188cc230b5:function(e,_){let a=new Worker(j(e,_));return v(a)},__wbg_of_8737c43050b5546e:function(e,_,a){let c=Array.of(h(e),h(_),h(a));return v(c)},__wbg_postMessage_0162be6e48cf631e:function(){return tt(function(e,_){h(e).postMessage(h(_))},arguments)},__wbg_prototypesetcall_d721637c7ca66eb8:function(e,_,a){Uint8Array.prototype.set.call(f(e,_),h(a))},__wbg_queueMicrotask_1c9b3800e321a967:function(e){let _=h(e).queueMicrotask;return v(_)},__wbg_queueMicrotask_311744e534a929a3:function(e){queueMicrotask(h(e))},__wbg_resolve_d82363d90af6928a:function(e){let _=Promise.resolve(h(e));return v(_)},__wbg_set_onmessage_d05709471e546dca:function(e,_){h(e).onmessage=h(_)},__wbg_startWorkers_8b582d57e92bd2d4:function(e,_,a){let c=bt(u(e),u(_),Z.__wrap(a));return v(c)},__wbg_static_accessor_GLOBAL_THIS_2fee5048bcca5938:function(){let e=typeof globalThis>"u"?null:globalThis;return E(e)?0:v(e)},__wbg_static_accessor_GLOBAL_ce44e66a4935da8c:function(){let e=typeof global>"u"?null:global;return E(e)?0:v(e)},__wbg_static_accessor_SELF_44f6e0cb5e67cdad:function(){let e=typeof self>"u"?null:self;return E(e)?0:v(e)},__wbg_static_accessor_WINDOW_168f178805d978fe:function(){let e=typeof window>"u"?null:window;return E(e)?0:v(e)},__wbg_then_05edfc8a4fea5106:function(e,_,a){let c=h(e).then(h(_),h(a));return v(c)},__wbg_then_591b6b3a75ee817a:function(e,_){let a=h(e).then(h(_));return v(a)},__wbg_then_c768c7c3e60c20ef:function(e,_){let a=h(e).then(h(_));return v(a)},__wbg_value_2f34afb824ffcd9a:function(e){let _=h(e).value;return v(_)},__wbg_waitAsync_134f0b4abc50f1f2:function(e,_,a){let c=Atomics.waitAsync(h(e),_>>>0,a);return v(c)},__wbg_waitAsync_485a8d512901fd53:function(){let e=Atomics.waitAsync;return v(e)},__wbindgen_cast_0000000000000001:function(e,_){let a=pt(e,_,St);return v(a)},__wbindgen_cast_0000000000000002:function(e,_){let a=pt(e,_,Ot);return v(a)},__wbindgen_cast_0000000000000003:function(e,_){let a=pt(e,_,Ut);return v(a)},__wbindgen_cast_0000000000000004:function(e){return v(e)},__wbindgen_cast_0000000000000005:function(e,_){let a=f(e,_);return v(a)},__wbindgen_cast_0000000000000006:function(e,_){let a=j(e,_);return v(a)},__wbindgen_cast_0000000000000007:function(e,_){var a=f(e,_).slice();return t.__wbindgen_export3(e,_*1,1),v(a)},__wbindgen_link_ec60efd85dcca315:function(e){let _=`onmessage = function (ev) {
4
+ let [ia, index, value] = ev.data;
5
+ ia = new Int32Array(ia.buffer);
6
+ let result = Atomics.wait(ia, index, value);
7
+ postMessage(result);
8
+ };
9
+ `,a=typeof URL.createObjectURL>"u"?"data:application/javascript,"+encodeURIComponent(_):URL.createObjectURL(new Blob([_],{type:"text/javascript"})),c=I(a,t.__wbindgen_export4,t.__wbindgen_export5),i=p;o().setInt32(e+4,i,!0),o().setInt32(e+0,c,!0)},__wbindgen_object_clone_ref:function(e){let _=h(e);return v(_)},__wbindgen_object_drop_ref:function(e){u(e)},memory:r||new WebAssembly.Memory({initial:87,maximum:65536,shared:!0})}}}function St(r,n,e){t.__wasm_bindgen_func_elem_909(r,n,v(e))}function Ut(r,n,e){t.__wasm_bindgen_func_elem_3631(r,n,v(e))}function Ot(r,n,e){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.__wasm_bindgen_func_elem_3629(c,r,n,v(e));var _=o().getInt32(c+0,!0),a=o().getInt32(c+4,!0);if(a)throw u(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}function lt(r,n,e,_){t.__wasm_bindgen_func_elem_3646(r,n,v(e),v(_))}var ft=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_exrbench_free(r,1)),vt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_exrstreamencoder_free(r,1)),xt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_proresbench_free(r,1)),It=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_proresmovencoder_free(r,1)),yt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_proresmovwriter_free(r,1)),mt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_wbg_rayon_poolbuilder_free(r,1));function v(r){Y===L.length&&L.push(L.length+1);let n=Y;return Y=L[n],L[n]=r,n}var ht=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbindgen_export2(r.a,r.b));function Lt(r){r<1028||(L[r]=Y,Y=r)}function qt(r,n){return r=r>>>0,At().subarray(r/8,r/8+n)}function ut(r,n){return r=r>>>0,Ft().subarray(r/2,r/2+n)}function $(r,n){return r=r>>>0,jt().subarray(r/4,r/4+n)}function f(r,n){return r=r>>>0,D().subarray(r/1,r/1+n)}var C=null;function o(){return(C===null||C.buffer!==t.memory.buffer)&&(C=new DataView(t.memory.buffer)),C}var V=null;function Et(){return(V===null||V.buffer!==t.memory.buffer)&&(V=new Float32Array(t.memory.buffer)),V}var H=null;function At(){return(H===null||H.buffer!==t.memory.buffer)&&(H=new Float64Array(t.memory.buffer)),H}function j(r,n){return Pt(r>>>0,n)}var N=null;function Ft(){return(N===null||N.buffer!==t.memory.buffer)&&(N=new Uint16Array(t.memory.buffer)),N}var G=null;function jt(){return(G===null||G.buffer!==t.memory.buffer)&&(G=new Uint32Array(t.memory.buffer)),G}var X=null;function D(){return(X===null||X.buffer!==t.memory.buffer)&&(X=new Uint8Array(t.memory.buffer)),X}function h(r){return L[r]}function tt(r,n){try{return r.apply(this,n)}catch(e){t.__wbindgen_export(v(e))}}var L=new Array(1024).fill(void 0);L.push(void 0,null,!0,!1);var Y=L.length;function E(r){return r==null}function pt(r,n,e){let _={a:r,b:n,cnt:1},a=(...c)=>{_.cnt++;let i=_.a;_.a=0;try{return e(i,_.b,...c)}finally{_.a=i,a._wbg_cb_unref()}};return a._wbg_cb_unref=()=>{--_.cnt===0&&(t.__wbindgen_export2(_.a,_.b),_.a=0,ht.unregister(_))},ht.register(a,_,_),a}function W(r,n){let e=n(r.length*2,2)>>>0;return Ft().set(r,e/2),p=r.length,e}function S(r,n){let e=n(r.length*4,4)>>>0;return jt().set(r,e/4),p=r.length,e}function l(r,n){let e=n(r.length*1,1)>>>0;return D().set(r,e/1),p=r.length,e}function it(r,n){let e=n(r.length*4,4)>>>0;return Et().set(r,e/4),p=r.length,e}function J(r,n){let e=n(r.length*8,8)>>>0;return At().set(r,e/8),p=r.length,e}function I(r,n,e){if(e===void 0){let d=Q.encode(r),s=n(d.length,1)>>>0;return D().subarray(s,s+d.length).set(d),p=d.length,s}let _=r.length,a=n(_,1)>>>0,c=D(),i=0;for(;i<_;i++){let d=r.charCodeAt(i);if(d>127)break;c[a+i]=d}if(i!==_){i!==0&&(r=r.slice(i)),a=e(a,_,_=i+r.length*3,1)>>>0;let d=D().subarray(a+i,a+_),s=Q.encodeInto(r,d);i+=s.written,a=e(a,_,i,1)>>>0}return p=i,a}function u(r){let n=h(r);return Lt(r),n}var K=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):void 0;K&&K.decode();var Dt=2146435072,gt=0;function Pt(r,n){return gt+=n,gt>=Dt&&(K=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),K.decode(),gt=n),K.decode(D().slice(r,r+n))}var Q=typeof TextEncoder<"u"?new TextEncoder:void 0;Q&&(Q.encodeInto=function(r,n){let e=Q.encode(r);return n.set(e),{read:r.length,written:e.length}});var p=0,Mt,Bt,t;function Rt(r,n,e){if(Bt=r,t=r.exports,Mt=n,C=null,V=null,H=null,N=null,G=null,X=null,typeof e<"u"&&(typeof e!="number"||e===0||e%65536!==0))throw new Error("invalid stack size");return t.__wbindgen_start(e),t}async function Ct(r,n){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,n)}catch(a){if(r.ok&&e(r.type)&&r.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",a);else throw a}let _=await r.arrayBuffer();return await WebAssembly.instantiate(_,n)}else{let _=await WebAssembly.instantiate(r,n);return _ instanceof WebAssembly.Instance?{instance:_,module:r}:_}function e(_){switch(_){case"basic":case"cors":case"default":return!0}return!1}}function y_(r,n){if(t!==void 0)return t;let e;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module:r,memory:n,thread_stack_size:e}=r:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let _=kt(n);r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));let a=new WebAssembly.Instance(r,_);return Rt(a,r,e)}async function m_(r,n){if(t!==void 0)return t;let e;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module_or_path:r,memory:n,thread_stack_size:e}=r:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),r===void 0&&(r=new URL("media_core_bg.wasm",import.meta.url));let _=kt(n);(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));let{instance:a,module:c}=await Ct(await r,_);return Rt(a,c,e)}export{et as ExrBench,nt as ExrStreamEncoder,rt as ProResBench,_t as ProResMovEncoder,ot as ProResMovWriter,Nt as arriraw12_clip_info,Gt as arriraw_mxf_gpu_frame,Xt as audio_aac_au,Yt as audio_aac_config,Jt as audio_info,Kt as bench_f32_boundary,Qt as bench_piz_no_huffman,Zt as color_cst,$t as dci_code_full_depth,te as dci_frame_cap,ee as dci_gpu_colour_patch,ne as dci_gpu_colour_tables,re as dci_last_pass_caps,_e as dci_legal_rates,oe as dci_mq_bench,ie as dci_pack_tier1,ae as dci_stage_rgba8,ce as dci_transform_only,de as decode_arriraw12_luma,se as decode_arriraw12_mxf,pe as decode_arriraw12_preview,ge as decode_arriraw12_rgba,ue as decode_arriraw_luma,we as decode_arriraw_mxf,be as decode_arriraw_preview,le as decode_arriraw_preview_gray,fe as decode_arriraw_preview_meta,ve as decode_arriraw_rgba,xe as decode_arriraw_rgba_meta,Ie as decode_arw_preview,ye as decode_arw_rgba,me as decode_audio_pcm,he as decode_audio_track_pcm,ke as decode_bmp_rgba,Ae as decode_braw_gen5log,Fe as decode_braw_luma,je as decode_braw_preview,Me as decode_braw_rgba,Re as decode_cr2_preview,ze as decode_cr2_rgba,We as decode_cr3_rgba,Te as decode_crm,Se as decode_dng_preview,Ue as decode_dng_rgba,Oe as decode_dpx_preview,Le as decode_dpx_rgba,qe as decode_dv_luma,Ee as decode_dv_preview,De as decode_dv_rgba,Pe as decode_exr_linear,Be as decode_exr_preview,Ce as decode_exr_rgba,Ve as decode_gif_rgba,He as decode_heic_rgba,Ne as decode_j2k_luma,Ge as decode_j2k_preview,Xe as decode_j2k_rgba,Ye as decode_jpeg_rgba,Je as decode_mpeg2_luma,Ke as decode_mpeg2_preview,Qe as decode_mpeg2_rgba,Ze as decode_png_rgba,$e as decode_prores_band_rgba,tn as decode_prores_luma,en as decode_prores_mxf,nn as decode_prores_preview,rn as decode_prores_raw_acescct,_n as decode_prores_raw_luma,on as decode_prores_raw_preview,an as decode_prores_raw_rec2020,cn as decode_prores_raw_rgba,dn as decode_prores_raw_tier,sn as decode_prores_rgb16,pn as decode_prores_rgba,gn as decode_prores_thumb_dc32,un as decode_psd_rgba,wn as decode_r3d_luma,bn as decode_r3d_preview,ln as decode_r3d_preview_clip,fn as decode_r3d_rgb16,vn as decode_r3d_rgba,xn as decode_r3d_rgba_clip,In as decode_tga_rgba,yn as decode_tiff_preview,mn as decode_tiff_rgba,hn as decode_vc3_band_rgba,kn as decode_vc3_luma,An as decode_vc3_mxf,Fn as decode_vc3_preview,jn as decode_vc3_rgba,Mn as decode_webp_rgba,Rn as decode_xocn_index_luma,zn as decode_xocn_luma,Wn as decode_xocn_mxf,Tn as decode_xocn_preview,Sn as decode_xocn_preview_rec709,Un as decode_xocn_rgb16,On as decode_xocn_rgba,m_ as default,Ln as encode_dci_j2c,qn as encode_dci_j2c_rgb,En as encode_dci_j2c_rgba8,Dn as encode_dci_j2c_staged,Pn as encode_dci_j2c_staged_modelled,Bn as encode_exr,Cn as encode_prores_4444_alpha_mov_rgba,Vn as encode_prores_4444_alpha_sample_q,Hn as encode_prores_444_sample_cbr,Nn as encode_prores_444_sample_cbr_rgb16,Gn as encode_prores_444_sample_cbr_rgb16_lut,Xn as encode_prores_mov_rgba,Yn as encode_prores_rgba,Jn as encode_prores_sample_cbr,Kn as encode_prores_sample_cbr_rgb16,Qn as encode_prores_sample_cbr_rgb16_lut,Zn as encode_prores_sample_q,$n as exr_sequence_filename,tr as fit_sizing,y_ as initSync,er as initThreadPool,nr as inspect_arw,rr as inspect_cr2,_r as inspect_cr3,or as inspect_dng,ir as inspect_dpx,ar as inspect_exr,cr as inspect_isobmff,dr as inspect_tiff,sr as inspect_wav,pr as is_arriraw12_mxf,gr as is_arriraw_mxf,ur as is_crm,wr as is_prores_mxf,br as is_vc3_mxf,lr as is_xavc_mxf,fr as is_xocn_mxf,vr as isobmff_present_frames,xr as list_isobmff_segments,Ir as list_mxf_segments,yr as list_r3d_frames,mr as list_r3d_segments,hr as list_wav_segments,kr as mux_prores_4444_alpha_samples,Ar as mux_prores_samples,Fr as mux_prores_samples_full,jr as mxf_au_run,Mr as mxf_frame_index,Rr as mxf_gop_map,zr as mxf_h264_kind,Wr as mxf_present_frames,Tr as plan_isobmff_trim,Sr as plan_isobmff_trim_reader,Ur as plan_mxf_compact_trim,Or as plan_mxf_trim,Lr as plan_r3d_compact,qr as plan_wav_trim,Er as plan_wav_trim_reader,Dr as prepare_isobmff,Pr as prepare_mxf,Br as prepare_r3d,Cr as prepare_wav,Vr as probe_mov,Hr as probe_mxf,Nr as probe_r3d,Gr as prores_band_info,Xr as prores_raw_container_color,Yr as prores_reset_rate_control,Jr as r3d_gpu_develop_params,Kr as r3d_index_ranges,Qr as r3d_is_helium,Zr as read_arriraw_fcs,$r as read_arriraw_unit_correction,t_ as recover_reframe,e_ as resample_rgba16,n_ as resample_rgba8,r_ as reset_dci_rate_state,__ as resize_luma_area,o_ as rgba8_to_xyz12,i_ as shot_crop,a_ as shot_ramp,c_ as shot_scan,d_ as trim_r3d,s_ as vc3_band_info,p_ as video_close,g_ as video_decode,u_ as video_frame_index_isobmff_reader,w_ as video_open,Z as wbg_rayon_PoolBuilder,b_ as wbg_rayon_start_worker,l_ as xavc_au,f_ as xavc_frame_count,v_ as xocn_frame_count,x_ as xocn_index_prefix_len,I_ as xocn_preview_prefix_len};
@@ -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 G}from"./chunk-AACY2V3L.js";import{b as $}from"./chunk-NRURUPLU.js";import{b as j}from"./chunk-TGLH2JDW.js";import{Ja as l,M as P,R as z,b as U,ca as T,da as D,e as B,ea as E,fa as C,g as M,ga as L,ja as V,ra as W,ta as g,w as O,wa as N,ya as J}from"./chunk-7Z65WW4I.js";import"./chunk-PSANHDZM.js";var v=new Uint8Array([6,14,43,52,2,5,1,1,13,1,2,1,1,17,1,0]);function se(n){e:for(let r=n.length-v.length;r>=0;r--){for(let e=0;e<v.length;e++)if(n[r+e]!==v[e])continue e;return r}return-1}function Z(n,r){if(r>=n.byteLength)return[null,0];let e=n.getUint8(r);if(e<128)return[e,1];let t=e&127;if(t===0||t>8||r+1+t>n.byteLength)return[null,1];let a=0;for(let i=0;i<t;i++)a=a*256+n.getUint8(r+1+i);return[a,1+t]}function w(n,r){let e=n.getUint32(r,!1),t=n.getUint32(r+4,!1);return e*4294967296+t}async function H(n){let r=n.fileSize,e=[];if(r<1024)return e;let a=Math.max(0,r-65536),i=r-a,o=await n.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 A=s+16+te;if(A+f>o.length)return e;let F=[],ne=new DataView(o.buffer,o.byteOffset+A,f),_=Math.floor((f-4)/12);if(_<1||_>4096)return e;for(let u=0;u<_;u++){let p=w(ne,u*12+4);p>=0&&p<r&&F.push(p)}for(let u of F){let p=Math.min(256,r-u),b=await n.read(u,p);if(b.length<80)continue;let y=new DataView(b.buffer,b.byteOffset,b.byteLength),[R,k]=Z(y,16);if(R===null)continue;let m=16+k,x,S;if(b.length<m+64){let oe=Math.min(m+64,r-u),h=await n.read(u,oe);if(h.length<m+64)continue;let I=new DataView(h.buffer,h.byteOffset,h.byteLength);x=w(I,m+32),S=w(I,m+40)}else x=w(y,m+32),S=w(y,m+40);let ae=u+16+k+R+x+S,ie=Math.min(ae+65536,r)-u;e.push({offset:u,length:ie})}return e}function q(n,r){let e=[];for(let t of n){if(t.kind!=="clip"||!t.source_range)continue;let a=t.source_range.start.value,i=t.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(n,r){let e=[...n].sort((i,o)=>i.offset-o.offset),t=[],a=0;for(let i of e)i.offset>a&&t.push({offset:a,length:i.offset-a}),a=Math.max(a,i.offset+i.length);return a<r&&t.push({offset:a,length:r-a}),t}async function K(n,r,e){let t=q(r,0);if(t.length===0)throw new Error("planMxfTrimsFromItems: no usable trim ranges in items");await l();let a=(o,s)=>n.read(o,s),i=await $(t,e,(o,s)=>g(a,n.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(n,r,e){await l();let t=q(r,e),i=await N((s,c)=>n.read(s,c),n.fileSize,JSON.stringify(t));if(i!=="null")return JSON.parse(i);console.warn(`[mxf] no parseable index \u2014 shipping the WHOLE file (${n.fileSize} bytes). The cut's ${t.length} range(s) cannot be addressed; nothing is trimmed.`);let o=(await H(n)).map(s=>({offset:s.offset,length:s.length}));return{fileSize:n.fileSize,structuralRanges:o,essenceRanges:ce(o,n.fileSize),trimInputs:t,wholeFileFallback:!0}}async function X(n){await l();let e=await J((t,a)=>n.read(t,a),n.fileSize);return JSON.parse(e)}function d(n){return(r,e)=>n.read(r,e)}var Pe={async inspect(n){let r=n.parts[0],e=await X(r);if(!e)return null;let t=e.timecode??null,a=t&&t.fps_denominator>0?t.fps_numerator/t.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:e.avid?.tape_name??null,source_timecode:t?.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,...t?{drop_frame:t.drop_frame}:{},...e.inner_codec?{inner_codec:e.inner_codec}:{},...e.truncated?{truncated:!0}:{},...e.avid?{avid:{...e.avid,kind:i||o?"picture":"sound"}}:{}},binding_state:"unbound",raw_extraction:{mxf_probe:e},metadata:{}}},async extract(n){await l();let r=n.parts[0],e=JSON.parse(await V(d(r),r.fileSize));return e.length===0?null:{v:1,container:"mxf",codec:"mxf",frame_count:G(e),granularity:"frame",segments:e}},async sparsify(n,r){let e=n.parts[0],t=await Q(e,r.items,r.handles);return[{filename:e.filename,fileSize:t.fileSize,structuralRanges:t.structuralRanges,essenceRanges:t.essenceRanges,trimInputs:t.trimInputs,wholeFileFallback:t.wholeFileFallback}]},async trim(n,r){let e=n.parts[0];if(!e.dataRanges)return K(e,r.items,r.handles);await l();let t=JSON.parse(await W(d(e),e.fileSize,JSON.stringify(e.dataRanges)));if(t.length===0)throw new Error("mxf trim: no whole frames present in this sparse file");let a=[];for(let[i,[o,s]]of t.entries()){let c=JSON.parse(await g(d(e),e.fileSize,o,s+1));t.length>1&&Object.assign(c,{output_clip_number:i+1,output_clip_count:t.length,output_part_number:1}),a.push(c)}return a},async decode(n,r,e){await l();let t=n.parts[0],a=d(t),i=await re(n),o=e.detail==="coarse",s;if(i==="arriraw")s=await M(a,t.fileSize,r,o?"preview:4":"full");else if(i==="arriraw-alev3")s=await B(a,t.fileSize,r,o?"preview:4":"full");else if(i==="dnxhr")s=await P(a,t.fileSize,r,o?"preview":"full");else if(i==="xocn")s=await z(a,t.fileSize,r,o?"preview":"full");else if(i==="prores")s=await O(a,t.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(n,r){await l();let e=n.parts[0],t=d(e),a=await re(n),i;try{if(a==="arriraw"){let o=await le(n,r);if(o)return o;i=await M(t,e.fileSize,r,"rgb16")}else if(a==="dnxhr")i=await P(t,e.fileSize,r,"rgb16");else if(a==="xocn")i=await z(t,e.fileSize,r,"rgb16");else throw new Error(`mxf decode16: no decoder for inner codec '${a}'`)}catch(o){throw ue(o,a)}return j(i)}};function ue(n,r){let e=typeof n=="string"?n:n instanceof Error?n.message:"";return/has no 16-bit decoder|no rgb16 tier/.test(e)?new Error(`mxf ${r}: has no 16-bit decoder \u2014 ${e}`):n}var Y=new WeakMap;async function le(n,r){if(!!0)return null;try{let e=await import("./arriraw-PS6V532Y.js");if(!await e.arrirawGpuAvailable())return null;let{parseArrirawGpuPayload:t,arrirawFrameToRgb16:a}=await import("./clip-state-B6JOX3JE.js"),i=n.parts[0],o=Y.get(n)??null,s=await U(d(i),i.fileSize,r,o?.key),c=t(s,o);if(!c)return null;Y.set(n,{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(n){let r=ee.get(n);if(r)return r;await l();let e=n.parts[0],t=d(e),a="mxf";return await D(t,e.fileSize)?a="arriraw":await T(t,e.fileSize)?a="arriraw-alev3":await C(t,e.fileSize)?a="dnxhr":await L(t,e.fileSize)?a="xocn":await E(t,e.fileSize)&&(a="prores"),ee.set(n,a),a}export{Pe 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-5JDF2IUF.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};
3
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-TGLH2JDW.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};
@@ -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 n1}from"./chunk-7D7H6VFW.js";import{Ha as Z,ya as Q}from"./chunk-DCO5D65W.js";import"./chunk-PSANHDZM.js";var r1=new Uint32Array([327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,458759,458759,458759,458759,458759,458759,458759,458759,524296,524296,524296,524296,589839,589839,655376,655377,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,458764,458764,458764,458764,458764,458764,458764,458764,458766,458766,458766,458766,458766,458766,458766,458766,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154]),e1=new Uint32Array([393223,393224,327686,327686,262149,262149,262149,262149,196609,196609,196609,196609,196609,196609,196609,196609,262146,262146,262146,262146,262147,262147,262147,262147,196612,196612,196612,196612,196612,196612,196612,196612,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536]),t1=new Uint32Array([131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,196610,196610,196610,196610,196610,196610,196610,196610,196611,196611,196611,196611,196611,196611,196611,196611,196612,196612,196612,196612,196612,196612,196612,196612,262149,262149,262149,262149,262150,262150,262150,262150,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073]),a1=new Uint32Array([0,1,5,6,14,15,27,28,44,45,65,66,90,91,119,120,2,4,7,13,16,26,29,43,46,64,67,89,92,118,121,150,3,8,12,17,25,30,42,47,63,68,88,93,117,122,149,151,9,11,18,24,31,41,48,62,69,87,94,116,123,148,152,177,10,19,23,32,40,49,61,70,86,95,115,124,147,153,176,178,20,22,33,39,50,60,71,85,96,114,125,146,154,175,179,200,21,34,38,51,59,72,84,97,113,126,145,155,174,180,199,201,35,37,52,58,73,83,98,112,127,144,156,173,181,198,202,219,36,53,57,74,82,99,111,128,143,157,172,182,197,203,218,220,54,56,75,81,100,110,129,142,158,171,183,196,204,217,221,234,55,76,80,101,109,130,141,159,170,184,195,205,216,222,233,235,77,79,102,108,131,140,160,169,185,194,206,215,223,232,236,245,78,103,107,132,139,161,168,186,193,207,214,224,231,237,244,246,104,106,133,138,162,167,187,192,208,213,225,230,238,243,247,252,105,134,137,163,166,188,191,209,212,226,229,239,242,248,251,253,135,136,164,165,189,190,210,211,227,228,240,241,249,250,254,255]),j=new Int32Array([2048,2882,2841,2772,2676,2554,2408,2239,2048,1837,1609,1365,1108,841,565,284,2048,2772,2408,1837,1108,284,-565,-1365,-2048,-2554,-2841,-2882,-2676,-2239,-1609,-841,2048,2554,1609,284,-1108,-2239,-2841,-2772,-2048,-841,565,1837,2676,2882,2408,1365,2048,2239,565,-1365,-2676,-2772,-1609,284,2048,2882,2408,841,-1108,-2554,-2841,-1837,2048,1837,-565,-2554,-2676,-841,1609,2882,2048,-284,-2408,-2772,-1108,1365,2841,2239,2048,1365,-1609,-2882,-1108,1837,2841,841,-2048,-2772,-565,2239,2676,284,-2408,-2554,2048,841,-2408,-2239,1108,2882,565,-2554,-2048,1365,2841,284,-2676,-1837,1609,2772,2048,284,-2841,-841,2676,1365,-2408,-1837,2048,2239,-1609,-2554,1108,2772,-565,-2882,2048,-284,-2841,841,2676,-1365,-2408,1837,2048,-2239,-1609,2554,1108,-2772,-565,2882,2048,-841,-2408,2239,1108,-2882,565,2554,-2048,-1365,2841,-284,-2676,1837,1609,-2772,2048,-1365,-1609,2882,-1108,-1837,2841,-841,-2048,2772,-565,-2239,2676,-284,-2408,2554,2048,-1837,-565,2554,-2676,841,1609,-2882,2048,284,-2408,2772,-1108,-1365,2841,-2239,2048,-2239,565,1365,-2676,2772,-1609,-284,2048,-2882,2408,-841,-1108,2554,-2841,1837,2048,-2554,1609,-284,-1108,2239,-2841,2772,-2048,841,565,-1837,2676,-2882,2408,-1365,2048,-2772,2408,-1837,1108,-284,-565,1365,-2048,2554,-2841,2882,-2676,2239,-1609,841,2048,-2882,2841,-2772,2676,-2554,2408,-2239,2048,-1837,1609,-1365,1108,-841,565,-284]),i1={m16:931135616,lg_a:1098061119,lg_b:1125906863,lg_c:1046850094,lg_pa:1008981770,gc_k:1064554302,gc_p:1101529087,gc_t:1028443341,sd_eps:953267991,inv273:997199617,rr_c13:956301440,rr_c16:931135616,rr_c18:914358400,bil_sg:973078528,bil_srb:975874731,sobel_sc:931135616,bil_t7_0:1032826803,bil_t7_1:1040595071,bil_t7_2:1044597305,bil_t7_3:1046301409,bil_t7_4:1044597305,bil_t7_5:1040595071,bil_t7_6:1032826803,bil_t9_0:1031861895,bil_t9_1:1035879338,bil_t9_2:1039871874,bil_t9_3:1041522383,bil_t9_4:1042077871,bil_t9_5:1041522383,bil_t9_6:1039871874,bil_t9_7:1035879338,bil_t9_8:1031861895,gauss55_00:1065353216,gauss55_01:1082130432,gauss55_02:1088421888,gauss55_03:1082130432,gauss55_04:1065353216,gauss55_10:1082130432,gauss55_11:1098907648,gauss55_12:1104150528,gauss55_13:1098907648,gauss55_14:1082130432,gauss55_20:1088421888,gauss55_21:1104150528,gauss55_22:1109655552,gauss55_23:1104150528,gauss55_24:1088421888,gauss55_30:1082130432,gauss55_31:1098907648,gauss55_32:1104150528,gauss55_33:1098907648,gauss55_34:1082130432,gauss55_40:1065353216,gauss55_41:1082130432,gauss55_42:1088421888,gauss55_43:1082130432,gauss55_44:1065353216};function T(n,r){return(n[r]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3])>>>0}function w(n,r){return n[r]<<8|n[r+1]}function z(n){let r=Math.min(n.length,65536),e=-1;for(let u=16;u+6<=r;u+=2){if(w(n,u)!==259)continue;let g=w(n,u+2),p=w(n,u+4);if(g<256||g>8192||p<128||p>8192)continue;let y=u-16;if(T(n,y+4)!==0||T(n,y+8)!==0)continue;let P=T(n,y);if(!(P<65536||y+P>n.length+8192)){e=y;break}}if(e<0)throw new Error("RED codestream container not found");let i=e,t=i+12,a=[];for(let u=0;u<8;u++)a.push(w(n,t+4+2*u));let o=i+28;if(o+512>n.length)throw new Error("R3D container table truncated");let b=a[1],m=a[2],f=i+540,v=v1(n,f,a[4],b);if(b%2!==0)throw new Error(`odd R3D canvas width ${b}`);return{canvasW:b,canvasH:m,rawFields:a,table512:n.subarray(o,o+512),streamOff:f,segments:v}}function v1(n,r,e,i){let t=Math.ceil(i/128),a=r;for(;(w(n,a)&4095)<256;)if(a+=2,a+2>n.length)throw new Error("R3D segment stream truncated");a+=1;let o=a,b=n[a-1],m=[];for(let f=0;f<e;f++){if(o+8>n.length)throw new Error("R3D segment header past essence end");let v=[w(n,o),w(n,o+2),w(n,o+4),w(n,o+6)],u=v.map(h=>h+7>>3),g=o+8,p=u[0]+u[1]+u[2]+u[3];if(g+p>n.length)throw new Error("R3D segment body past essence end");let y=g,P=v.map((h,x)=>{let C={off:y,bitLength:h,byteLength:u[x]};return y+=u[x],C});m.push({x:f%t*128,y:Math.floor(f/t)*16,quant:b,subbands:P}),b=n[g+p]??0,o=g+p+1}return m}function u1(n){let r=new Uint32Array(n.segments.length*4*8),e=0;for(let i of n.segments)for(let t=0;t<4;t++){let a=i.subbands[t];r[e]=a.off,r[e+1]=a.bitLength,r[e+2]=a.byteLength,r[e+3]=i.x,r[e+4]=i.y,r[e+5]=i.quant,r[e+6]=t,r[e+7]=0,e+=8}return r}function k(n){return x1[0]=n>>>0,h1[0]}var s1=new ArrayBuffer(4),x1=new Uint32Array(s1),h1=new Float32Array(s1),w1=1112556626;function B1(n){if(n.length<140)return null;let r=new DataView(n.buffer,n.byteOffset,n.byteLength);if(r.getUint32(0,!0)!==w1||r.getUint32(4,!0)!==1)return null;let e=r.getUint32(8,!0),i=12,t=[];for(let f=0;f<4;f++,i+=4)t.push(r.getUint32(i,!0));let a=[];for(let f=0;f<26;f++,i+=4)a.push(r.getUint32(i,!0));let o=r.getUint32(i,!0);i+=4;let b=r.getUint32(i,!0);if(i+=4,i+b>n.length)return null;let m=new TextDecoder().decode(n.subarray(i,i+b));return{wbBits:t,smatrixBits:a,exposureBits:o,fixFlashers:(e&2)!==0,model:m}}async function E(n){try{return await Z(),B1(Q(n??new Uint8Array(0)))}catch{return null}}var o1=`// R3D KOMODO entropy decode (kernel 1 of 2). One invocation per (segment, subband) job.
3
+ import{a as n1}from"./chunk-7D7H6VFW.js";import{Aa as Q,Ja as Z}from"./chunk-7Z65WW4I.js";import"./chunk-PSANHDZM.js";var r1=new Uint32Array([327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,458759,458759,458759,458759,458759,458759,458759,458759,524296,524296,524296,524296,589839,589839,655376,655377,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,458764,458764,458764,458764,458764,458764,458764,458764,458766,458766,458766,458766,458766,458766,458766,458766,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154]),e1=new Uint32Array([393223,393224,327686,327686,262149,262149,262149,262149,196609,196609,196609,196609,196609,196609,196609,196609,262146,262146,262146,262146,262147,262147,262147,262147,196612,196612,196612,196612,196612,196612,196612,196612,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536]),t1=new Uint32Array([131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,196610,196610,196610,196610,196610,196610,196610,196610,196611,196611,196611,196611,196611,196611,196611,196611,196612,196612,196612,196612,196612,196612,196612,196612,262149,262149,262149,262149,262150,262150,262150,262150,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073]),a1=new Uint32Array([0,1,5,6,14,15,27,28,44,45,65,66,90,91,119,120,2,4,7,13,16,26,29,43,46,64,67,89,92,118,121,150,3,8,12,17,25,30,42,47,63,68,88,93,117,122,149,151,9,11,18,24,31,41,48,62,69,87,94,116,123,148,152,177,10,19,23,32,40,49,61,70,86,95,115,124,147,153,176,178,20,22,33,39,50,60,71,85,96,114,125,146,154,175,179,200,21,34,38,51,59,72,84,97,113,126,145,155,174,180,199,201,35,37,52,58,73,83,98,112,127,144,156,173,181,198,202,219,36,53,57,74,82,99,111,128,143,157,172,182,197,203,218,220,54,56,75,81,100,110,129,142,158,171,183,196,204,217,221,234,55,76,80,101,109,130,141,159,170,184,195,205,216,222,233,235,77,79,102,108,131,140,160,169,185,194,206,215,223,232,236,245,78,103,107,132,139,161,168,186,193,207,214,224,231,237,244,246,104,106,133,138,162,167,187,192,208,213,225,230,238,243,247,252,105,134,137,163,166,188,191,209,212,226,229,239,242,248,251,253,135,136,164,165,189,190,210,211,227,228,240,241,249,250,254,255]),j=new Int32Array([2048,2882,2841,2772,2676,2554,2408,2239,2048,1837,1609,1365,1108,841,565,284,2048,2772,2408,1837,1108,284,-565,-1365,-2048,-2554,-2841,-2882,-2676,-2239,-1609,-841,2048,2554,1609,284,-1108,-2239,-2841,-2772,-2048,-841,565,1837,2676,2882,2408,1365,2048,2239,565,-1365,-2676,-2772,-1609,284,2048,2882,2408,841,-1108,-2554,-2841,-1837,2048,1837,-565,-2554,-2676,-841,1609,2882,2048,-284,-2408,-2772,-1108,1365,2841,2239,2048,1365,-1609,-2882,-1108,1837,2841,841,-2048,-2772,-565,2239,2676,284,-2408,-2554,2048,841,-2408,-2239,1108,2882,565,-2554,-2048,1365,2841,284,-2676,-1837,1609,2772,2048,284,-2841,-841,2676,1365,-2408,-1837,2048,2239,-1609,-2554,1108,2772,-565,-2882,2048,-284,-2841,841,2676,-1365,-2408,1837,2048,-2239,-1609,2554,1108,-2772,-565,2882,2048,-841,-2408,2239,1108,-2882,565,2554,-2048,-1365,2841,-284,-2676,1837,1609,-2772,2048,-1365,-1609,2882,-1108,-1837,2841,-841,-2048,2772,-565,-2239,2676,-284,-2408,2554,2048,-1837,-565,2554,-2676,841,1609,-2882,2048,284,-2408,2772,-1108,-1365,2841,-2239,2048,-2239,565,1365,-2676,2772,-1609,-284,2048,-2882,2408,-841,-1108,2554,-2841,1837,2048,-2554,1609,-284,-1108,2239,-2841,2772,-2048,841,565,-1837,2676,-2882,2408,-1365,2048,-2772,2408,-1837,1108,-284,-565,1365,-2048,2554,-2841,2882,-2676,2239,-1609,841,2048,-2882,2841,-2772,2676,-2554,2408,-2239,2048,-1837,1609,-1365,1108,-841,565,-284]),i1={m16:931135616,lg_a:1098061119,lg_b:1125906863,lg_c:1046850094,lg_pa:1008981770,gc_k:1064554302,gc_p:1101529087,gc_t:1028443341,sd_eps:953267991,inv273:997199617,rr_c13:956301440,rr_c16:931135616,rr_c18:914358400,bil_sg:973078528,bil_srb:975874731,sobel_sc:931135616,bil_t7_0:1032826803,bil_t7_1:1040595071,bil_t7_2:1044597305,bil_t7_3:1046301409,bil_t7_4:1044597305,bil_t7_5:1040595071,bil_t7_6:1032826803,bil_t9_0:1031861895,bil_t9_1:1035879338,bil_t9_2:1039871874,bil_t9_3:1041522383,bil_t9_4:1042077871,bil_t9_5:1041522383,bil_t9_6:1039871874,bil_t9_7:1035879338,bil_t9_8:1031861895,gauss55_00:1065353216,gauss55_01:1082130432,gauss55_02:1088421888,gauss55_03:1082130432,gauss55_04:1065353216,gauss55_10:1082130432,gauss55_11:1098907648,gauss55_12:1104150528,gauss55_13:1098907648,gauss55_14:1082130432,gauss55_20:1088421888,gauss55_21:1104150528,gauss55_22:1109655552,gauss55_23:1104150528,gauss55_24:1088421888,gauss55_30:1082130432,gauss55_31:1098907648,gauss55_32:1104150528,gauss55_33:1098907648,gauss55_34:1082130432,gauss55_40:1065353216,gauss55_41:1082130432,gauss55_42:1088421888,gauss55_43:1082130432,gauss55_44:1065353216};function T(n,r){return(n[r]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3])>>>0}function w(n,r){return n[r]<<8|n[r+1]}function z(n){let r=Math.min(n.length,65536),e=-1;for(let u=16;u+6<=r;u+=2){if(w(n,u)!==259)continue;let g=w(n,u+2),p=w(n,u+4);if(g<256||g>8192||p<128||p>8192)continue;let y=u-16;if(T(n,y+4)!==0||T(n,y+8)!==0)continue;let P=T(n,y);if(!(P<65536||y+P>n.length+8192)){e=y;break}}if(e<0)throw new Error("RED codestream container not found");let i=e,t=i+12,a=[];for(let u=0;u<8;u++)a.push(w(n,t+4+2*u));let o=i+28;if(o+512>n.length)throw new Error("R3D container table truncated");let b=a[1],m=a[2],f=i+540,v=v1(n,f,a[4],b);if(b%2!==0)throw new Error(`odd R3D canvas width ${b}`);return{canvasW:b,canvasH:m,rawFields:a,table512:n.subarray(o,o+512),streamOff:f,segments:v}}function v1(n,r,e,i){let t=Math.ceil(i/128),a=r;for(;(w(n,a)&4095)<256;)if(a+=2,a+2>n.length)throw new Error("R3D segment stream truncated");a+=1;let o=a,b=n[a-1],m=[];for(let f=0;f<e;f++){if(o+8>n.length)throw new Error("R3D segment header past essence end");let v=[w(n,o),w(n,o+2),w(n,o+4),w(n,o+6)],u=v.map(h=>h+7>>3),g=o+8,p=u[0]+u[1]+u[2]+u[3];if(g+p>n.length)throw new Error("R3D segment body past essence end");let y=g,P=v.map((h,x)=>{let C={off:y,bitLength:h,byteLength:u[x]};return y+=u[x],C});m.push({x:f%t*128,y:Math.floor(f/t)*16,quant:b,subbands:P}),b=n[g+p]??0,o=g+p+1}return m}function u1(n){let r=new Uint32Array(n.segments.length*4*8),e=0;for(let i of n.segments)for(let t=0;t<4;t++){let a=i.subbands[t];r[e]=a.off,r[e+1]=a.bitLength,r[e+2]=a.byteLength,r[e+3]=i.x,r[e+4]=i.y,r[e+5]=i.quant,r[e+6]=t,r[e+7]=0,e+=8}return r}function k(n){return x1[0]=n>>>0,h1[0]}var s1=new ArrayBuffer(4),x1=new Uint32Array(s1),h1=new Float32Array(s1),w1=1112556626;function B1(n){if(n.length<140)return null;let r=new DataView(n.buffer,n.byteOffset,n.byteLength);if(r.getUint32(0,!0)!==w1||r.getUint32(4,!0)!==1)return null;let e=r.getUint32(8,!0),i=12,t=[];for(let f=0;f<4;f++,i+=4)t.push(r.getUint32(i,!0));let a=[];for(let f=0;f<26;f++,i+=4)a.push(r.getUint32(i,!0));let o=r.getUint32(i,!0);i+=4;let b=r.getUint32(i,!0);if(i+=4,i+b>n.length)return null;let m=new TextDecoder().decode(n.subarray(i,i+b));return{wbBits:t,smatrixBits:a,exposureBits:o,fixFlashers:(e&2)!==0,model:m}}async function E(n){try{return await Z(),B1(Q(n??new Uint8Array(0)))}catch{return null}}var o1=`// R3D KOMODO entropy decode (kernel 1 of 2). One invocation per (segment, subband) job.
4
4
  // Faithful port of decode_subband_raw in rust/media-core/src/r3d/entropy.rs.
5
5
  // Writes RAW coefficients (scan order) straight into coeff[job*2048 ..] \u2014 the buffer must be
6
6
  // zero-initialized; only nonzero decoded positions are written (deterministic across reruns).
@@ -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-5JDF2IUF.js";import{Aa as v,Ba as F,H as _,Ha as f,I as S,J as P,ja as b,ka as R,xa as w}from"./chunk-DCO5D65W.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 N(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 O(t,e,r){let n=N(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(!!0)return null;try{let n=await(await import("./r3d-AWQQHTQC.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,J=new WeakMap;function x(t){let e=J.get(t);return e||(e=t.parts[0].read(0,Math.min(16*1024,t.parts[0].fileSize)),J.set(t,e)),e}async function D(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 O(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 D(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 D(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};
3
+ import{c as l}from"./chunk-TGLH2JDW.js";import{Ca as v,Da as F,H as _,I as S,J as P,Ja as f,ka as b,la as R,za as w}from"./chunk-7Z65WW4I.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 N(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 O(t,e,r){let n=N(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(!!0)return null;try{let n=await(await import("./r3d-AKUA77ZG.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,J=new WeakMap;function x(t){let e=J.get(t);return e||(e=t.parts[0].read(0,Math.min(16*1024,t.parts[0].fileSize)),J.set(t,e)),e}async function D(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 O(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 D(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 D(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};
@@ -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 l,f as o,g as m}from"./chunk-JV7TZDKJ.js";import{a as s}from"./chunk-BBCQMZQN.js";import"./chunk-PSANHDZM.js";var h=e=>{let t=e.split(/[/\\]/).pop()??"",i=t.lastIndexOf(".");return i>0?t.slice(i+1).toLowerCase():""};async function f(e,t){try{if(e==="dpx"){let r=await(await import("./dpx-wasm-RJZANW6N.js")).inspectDpxWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="exr"){let r=await(await import("./exr-wasm-EZY3GZ2L.js")).inspectExrWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="dng"){let r=await(await import("./dng-wasm-K6PWOV4P.js")).inspectDngWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="cr3"){let r=await(await import("./cr3-wasm-CQ5YEFUF.js")).inspectCr3Wasm(t);return r?{width:r.width,height:r.height}:null}if(e==="tif"||e==="tiff"){let r=await(await import("./tiff-wasm-JIBA5AI4.js")).inspectTiffWasm(t);return r?{width:r.width,height:r.height}:null}let i=await import("./still-wasm-3EBYMLVL.js"),n=await i.inspectPhotoRawWasm(e,t);if(n)return{width:n.width,height:n.height};let a=await i.decodeStillWasm(e,t);return a?{width:a.width,height:a.height}:null}catch{}return null}async function p(e){if(typeof createImageBitmap!="function"||typeof Blob>"u")return null;try{let t=await createImageBitmap(new Blob([e])),i={width:t.width,height:t.height};return t.close?.(),i.width>0&&i.height>0?i:null}catch{return null}}async function c(e){let t=h(e.filename),i=await m(t,o(e));if(i)return i;let n=s(t);if(n===null||n==="none")return null;let a;try{a=await e.read(0,e.fileSize)}catch{return null}return n==="wasm-decoder"?await f(t,a):await p(a)}function u(e){let t=l(e);return t==="jpg"?"jpeg":t==="tif"?"tiff":t||"still"}var R={async inspect(e){let t=e.parts[0],i=await c(t);return{id:t.filename,kind:"external",content_kind:"still",target_url:t.filename,available_range:null,reel_name:null,source_timecode:null,container:l(t.filename)||"still",codec:u(t.filename),size_bytes:t.fileSize,bitrate_bps:null,source_resolution_w:i?.width??null,source_resolution_h:i?.height??null,source_pixel_aspect:i?1:null,streams:[],vendor_metadata:{},binding_state:"unbound",raw_extraction:{},metadata:{}}},async extract(e){let t=e.parts.map((i,n)=>({kind:"frame",part:n,offset:0,length:i.fileSize,frame_in:n,frame_out:n}));return t.length===0?null:{v:1,container:l(e.parts[0].filename)||"still",codec:u(e.parts[0].filename),frame_count:t.length,granularity:"frame",segments:t,...e.parts.length>1?{part_names:e.parts.map(i=>i.filename)}:{}}},async sparsify(){throw new Error("stillFormat.sparsify: stills ship whole \u2014 no sparse plan exists")},async trim(){throw new Error("stillFormat.trim: stills ship whole \u2014 no trim plan exists")}};export{R as stillFormat};
3
+ import{a as l,f as o,g as m}from"./chunk-JV7TZDKJ.js";import{a as s}from"./chunk-BBCQMZQN.js";import"./chunk-PSANHDZM.js";var h=e=>{let t=e.split(/[/\\]/).pop()??"",i=t.lastIndexOf(".");return i>0?t.slice(i+1).toLowerCase():""};async function f(e,t){try{if(e==="dpx"){let r=await(await import("./dpx-wasm-SIM6VRGD.js")).inspectDpxWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="exr"){let r=await(await import("./exr-wasm-EEY5CU2U.js")).inspectExrWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="dng"){let r=await(await import("./dng-wasm-JX2PZ5CY.js")).inspectDngWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="cr3"){let r=await(await import("./cr3-wasm-I3MVBOT3.js")).inspectCr3Wasm(t);return r?{width:r.width,height:r.height}:null}if(e==="tif"||e==="tiff"){let r=await(await import("./tiff-wasm-JH6DUOML.js")).inspectTiffWasm(t);return r?{width:r.width,height:r.height}:null}let i=await import("./still-wasm-PQJ4OARF.js"),n=await i.inspectPhotoRawWasm(e,t);if(n)return{width:n.width,height:n.height};let a=await i.decodeStillWasm(e,t);return a?{width:a.width,height:a.height}:null}catch{}return null}async function p(e){if(typeof createImageBitmap!="function"||typeof Blob>"u")return null;try{let t=await createImageBitmap(new Blob([e])),i={width:t.width,height:t.height};return t.close?.(),i.width>0&&i.height>0?i:null}catch{return null}}async function c(e){let t=h(e.filename),i=await m(t,o(e));if(i)return i;let n=s(t);if(n===null||n==="none")return null;let a;try{a=await e.read(0,e.fileSize)}catch{return null}return n==="wasm-decoder"?await f(t,a):await p(a)}function u(e){let t=l(e);return t==="jpg"?"jpeg":t==="tif"?"tiff":t||"still"}var R={async inspect(e){let t=e.parts[0],i=await c(t);return{id:t.filename,kind:"external",content_kind:"still",target_url:t.filename,available_range:null,reel_name:null,source_timecode:null,container:l(t.filename)||"still",codec:u(t.filename),size_bytes:t.fileSize,bitrate_bps:null,source_resolution_w:i?.width??null,source_resolution_h:i?.height??null,source_pixel_aspect:i?1:null,streams:[],vendor_metadata:{},binding_state:"unbound",raw_extraction:{},metadata:{}}},async extract(e){let t=e.parts.map((i,n)=>({kind:"frame",part:n,offset:0,length:i.fileSize,frame_in:n,frame_out:n}));return t.length===0?null:{v:1,container:l(e.parts[0].filename)||"still",codec:u(e.parts[0].filename),frame_count:t.length,granularity:"frame",segments:t,...e.parts.length>1?{part_names:e.parts.map(i=>i.filename)}:{}}},async sparsify(){throw new Error("stillFormat.sparsify: stills ship whole \u2014 no sparse plan exists")},async trim(){throw new Error("stillFormat.trim: stills ship whole \u2014 no trim plan exists")}};export{R as stillFormat};
@@ -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 s}from"./chunk-OSUIS4JU.js";import{Ga as i,Ha as a}from"./chunk-DCO5D65W.js";import"./chunk-PSANHDZM.js";var u={dpx:"dpx",tif:"tiff",tiff:"tiff",exr:"exr",j2c:"j2k",j2k:"j2k",jp2:"j2k",jph:"j2k",dng:"dng",cr3:"cr3",cr2:"cr2",arw:"arw",psd:"psd",tga:"tga",heic:"heic",heif:"heic",png:"png",jpg:"jpeg",jpeg:"jpeg",gif:"gif",bmp:"bmp",webp:"webp"};function l(e){return Object.prototype.hasOwnProperty.call(u,(e??"").toLowerCase())}var d=e=>{let n=i[e];return typeof n=="function"?n:void 0};async function g(e,n){let r=e.toLowerCase();if(r!=="arw"&&r!=="cr2")return null;await a();let t=i[`inspect_${r}`];if(typeof t!="function")return null;let o=t(n);return o==="null"?null:JSON.parse(o)}async function m(e,n,r=1){let t=u[e.toLowerCase()];if(!t)return null;await a();try{let o=r>1?d(`decode_${t}_preview`):void 0;if(o)return s(o(n,r));let c=d(`decode_${t}_rgba`);return c?s(c(n)):null}catch{return null}}export{u as STILL_WASM_BASE,m as decodeStillWasm,l as hasStillWasm,g as inspectPhotoRawWasm};
3
+ import{a as s}from"./chunk-OSUIS4JU.js";import{Ia as i,Ja as a}from"./chunk-7Z65WW4I.js";import"./chunk-PSANHDZM.js";var u={dpx:"dpx",tif:"tiff",tiff:"tiff",exr:"exr",j2c:"j2k",j2k:"j2k",jp2:"j2k",jph:"j2k",dng:"dng",cr3:"cr3",cr2:"cr2",arw:"arw",psd:"psd",tga:"tga",heic:"heic",heif:"heic",png:"png",jpg:"jpeg",jpeg:"jpeg",gif:"gif",bmp:"bmp",webp:"webp"};function l(e){return Object.prototype.hasOwnProperty.call(u,(e??"").toLowerCase())}var d=e=>{let n=i[e];return typeof n=="function"?n:void 0};async function g(e,n){let r=e.toLowerCase();if(r!=="arw"&&r!=="cr2")return null;await a();let t=i[`inspect_${r}`];if(typeof t!="function")return null;let o=t(n);return o==="null"?null:JSON.parse(o)}async function m(e,n,r=1){let t=u[e.toLowerCase()];if(!t)return null;await a();try{let o=r>1?d(`decode_${t}_preview`):void 0;if(o)return s(o(n,r));let c=d(`decode_${t}_rgba`);return c?s(c(n)):null}catch{return null}}export{u as STILL_WASM_BASE,m as decodeStillWasm,l as hasStillWasm,g as inspectPhotoRawWasm};
@@ -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}from"./chunk-LBROV5JN.js";import"./chunk-DCO5D65W.js";import"./chunk-PSANHDZM.js";export{b as decodeTiffWasm,a as inspectTiffWasm};
3
+ import{a,b}from"./chunk-6QB4DV22.js";import"./chunk-7Z65WW4I.js";import"./chunk-PSANHDZM.js";export{b as decodeTiffWasm,a as inspectTiffWasm};
@@ -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{$b as p,Mb as a,Nb as b,Ob as c,Pb as d,Qb as e,Rb as f,Sb as g,Tb as h,Ub as i,Vb as j,Wb as k,Xb as l,Yb as m,Zb as n,_b as o,ac as q,bc as r,cc as s,dc as t}from"./chunk-FDUFUJXI.js";import"./chunk-IN6XVTUS.js";import"./chunk-BHBBS26Z.js";import"./chunk-3PVQ5QP4.js";import"./chunk-VFXMP7IF.js";import"./chunk-JFEOLU4H.js";import"./chunk-XIFURVIB.js";import"./chunk-V6MI7VE3.js";import"./chunk-EZYCCYY7.js";import"./chunk-KDNIWB5V.js";import"./chunk-LBROV5JN.js";import"./chunk-OSUIS4JU.js";import"./chunk-JV7TZDKJ.js";import"./chunk-BBCQMZQN.js";import"./chunk-NQDVV2PX.js";import"./chunk-XX7QQIBI.js";import"./chunk-5JDF2IUF.js";import"./chunk-RL5XRG6O.js";import"./chunk-IDADYIY6.js";import"./chunk-N34DQ6MH.js";import"./chunk-NU3X7P4N.js";import"./chunk-DCO5D65W.js";import"./chunk-AR5BTVBM.js";import"./chunk-VZ3XYHK4.js";import"./chunk-HNEKQMQG.js";import"./chunk-E75BCWXY.js";import"./chunk-ZPIY5DOU.js";import"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";export{j as OPERATION_KINDS,a as READ_FORMATS,k as applyOperation,m as applyOperationWithSources,s as consolidate,b as detectFormat,d as detectTimelineFormat,t as judge,r as linkText,g as listClips,i as listFlags,h as listMedia,e as readTimeline,n as resolveTarget,q as routesText,c as sniffFormat,f as summarize,l as trackIndex,p as writeDestination,o as writeTimeline};
3
+ import{$b as p,Mb as a,Nb as b,Ob as c,Pb as d,Qb as e,Rb as f,Sb as g,Tb as h,Ub as i,Vb as j,Wb as k,Xb as l,Yb as m,Zb as n,_b as o,ac as q,bc as r,cc as s,dc as t}from"./chunk-QY4QDBIN.js";import"./chunk-IN6XVTUS.js";import"./chunk-TIZC6IEH.js";import"./chunk-3PVQ5QP4.js";import"./chunk-VFXMP7IF.js";import"./chunk-CV7OBWOX.js";import"./chunk-TNCXZIOX.js";import"./chunk-5JIFRR7U.js";import"./chunk-WRDA44QF.js";import"./chunk-PGJMKUUP.js";import"./chunk-6QB4DV22.js";import"./chunk-OSUIS4JU.js";import"./chunk-JV7TZDKJ.js";import"./chunk-BBCQMZQN.js";import"./chunk-ASFUV3PB.js";import"./chunk-NRURUPLU.js";import"./chunk-TGLH2JDW.js";import"./chunk-RL5XRG6O.js";import"./chunk-IDADYIY6.js";import"./chunk-N34DQ6MH.js";import"./chunk-NU3X7P4N.js";import"./chunk-7Z65WW4I.js";import"./chunk-AR5BTVBM.js";import"./chunk-VZ3XYHK4.js";import"./chunk-HNEKQMQG.js";import"./chunk-E75BCWXY.js";import"./chunk-ZPIY5DOU.js";import"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";export{j as OPERATION_KINDS,a as READ_FORMATS,k as applyOperation,m as applyOperationWithSources,s as consolidate,b as detectFormat,d as detectTimelineFormat,t as judge,r as linkText,g as listClips,i as listFlags,h as listMedia,e as readTimeline,n as resolveTarget,q as routesText,c as sniffFormat,f as summarize,l as trackIndex,p as writeDestination,o as writeTimeline};
Binary file
@@ -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 b}from"./chunk-AACY2V3L.js";import{Ja as u,ba as f,ma as _,ua as d,xa as g}from"./chunk-7Z65WW4I.js";import"./chunk-PSANHDZM.js";function l(i){return(r,a)=>i.read(r,a)}function v(i){let r=[];for(let a of i)a.kind!=="clip"||!a.source_range||r.push({start_frame:a.source_range.start.value,dur_frames:a.source_range.duration.value,fps:a.source_range.start.rate??1});return r}var R={async inspect(i){await u();let r=i.parts[0],a=await f(l(r),r.fileSize),t=JSON.parse(a);if(!t||!t.sample_rate)return null;let n=t.byte_rate>0?t.data_length/t.byte_rate:null,p=n?Math.round(n*t.sample_rate):0,e=[{kind:"audio",codec:"pcm",rate:t.sample_rate,channels:t.channels,bit_depth:t.bits_per_sample,codec_specific:{bits_per_sample:t.bits_per_sample}}];return{id:r.filename,kind:"external",content_kind:"audio",target_url:r.filename,available_range:n?{start:{value:0,rate:t.sample_rate},duration:{value:p,rate:t.sample_rate}}:null,reel_name:null,source_timecode:t.source_timecode??null,container:"wav",codec:"pcm",size_bytes:r.fileSize,bitrate_bps:t.byte_rate*8,streams:e,vendor_metadata:t.bext?{bext:t.bext}:{},binding_state:"unbound",raw_extraction:{wav_meta:t},metadata:{}}},async extract(i){await u();let r=i.parts[0],a=JSON.parse(await _(l(r),r.fileSize));return a.length===0?null:{v:1,container:"wav",codec:"pcm",frame_count:b(a),granularity:"second",segments:a}},async sparsify(i,r){await u();let a=i.parts[0],t=await g(l(a),a.fileSize,JSON.stringify(v(r.items)),r.handles),n=JSON.parse(t);return[{filename:a.filename,fileSize:n.fileSize,structuralRanges:n.structuralRanges,essenceRanges:n.essenceRanges,trimInputs:n.trimInputs}]},async trim(i,r){await u();let a=i.parts[0],t=[];if(a.dataRanges){let e=JSON.parse(await f(l(a),a.fileSize));if(!e?.sample_rate||!e.block_align)throw new Error("wav trim: a sparse part with no readable fmt/data chunk");let o=e.data_offset+e.data_length;for(let s of a.dataRanges){let m=Math.max(s.offset,e.data_offset),c=Math.min(s.offset+s.length,o);if(c<=m)continue;let h=Math.floor((m-e.data_offset)/e.block_align),S=Math.ceil((c-e.data_offset)/e.block_align);t.push([h/e.sample_rate,S/e.sample_rate])}}for(let e of a.dataRanges?[]:r.items){if(e.kind!=="clip"||!e.source_range)continue;let o=e.source_range.start.rate??1,s=Math.max(0,(e.source_range.start.value-r.handles)/o),m=(e.source_range.start.value+e.source_range.duration.value+r.handles)/o;m>s&&t.push([s,m])}if(t.length===0)throw new Error(a.dataRanges?"wav trim: no audio samples present in this sparse file":"wav trim: no usable trim ranges in items");t.sort((e,o)=>e[0]-o[0]);let n=[];for(let[e,o]of t){let s=n[n.length-1];s&&e<=s[1]?s[1]=Math.max(s[1],o):n.push([e,o])}let p=[];for(let[e,[o,s]]of n.entries()){let m=await d(l(a),a.fileSize,o,s,1),c=JSON.parse(m);n.length>1&&(c.output_clip_number=e+1,c.output_clip_count=n.length,c.output_part_number=1),p.push(c)}return p}};export{R as wavFormat};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conformtools",
3
- "version": "0.6.26",
3
+ "version": "0.6.28",
4
4
  "description": "conform.tools on your machine: timeline exchange, relink, media trim, delivery and auto conform, as MCP tools for Claude and other AI apps, a CLI and a local HTTP API",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -44,9 +44,9 @@
44
44
  "access": "public"
45
45
  },
46
46
  "optionalDependencies": {
47
- "conformtools-darwin-arm64": "0.6.26",
48
- "conformtools-darwin-x64": "0.6.26",
49
- "conformtools-linux-x64": "0.6.26",
50
- "conformtools-windows-x64": "0.6.26"
47
+ "conformtools-darwin-arm64": "0.6.27",
48
+ "conformtools-darwin-x64": "0.6.27",
49
+ "conformtools-linux-x64": "0.6.27",
50
+ "conformtools-windows-x64": "0.6.27"
51
51
  }
52
52
  }
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a as F}from"./chunk-3PVQ5QP4.js";import{b as ge,c as we,f as _e}from"./chunk-VFXMP7IF.js";import{f as X,h as he}from"./chunk-NQDVV2PX.js";import{a as be}from"./chunk-XX7QQIBI.js";import{i as N}from"./chunk-5JDF2IUF.js";import{b as P,d as T,f as E}from"./chunk-NU3X7P4N.js";import{Ha as pe,ea as ce,fa as le,ja as ue,oa as me,wa as de,xa as fe}from"./chunk-DCO5D65W.js";import{a as ae}from"./chunk-E75BCWXY.js";import{A as J,C as K,H as V,O as v,P as z,Q as se,T as ie,aa as b,b as D,ba as x,ca as k,d as ee,da as y,e as re,h as te,l as ne,m as j,t as W,u as L,w as oe,x as R}from"./chunk-ZPIY5DOU.js";var G=!1,O=8,Ae=0,De=3,U=2;async function ze(e){let t=new Uint8Array(await e.slice(0,16).arrayBuffer()),n=i=>String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3]);if(t[0]===6&&t[1]===14&&t[2]===43&&t[3]===52)return"mxf";if(n(4)==="RED1"||n(4)==="RED2")return"r3d";let r=t[0]<<24|t[1]<<16|t[2]<<8|t[3],s=n(4);return/^[A-Za-z0-9 ]{4}$/.test(s)&&(r>=8||r===1)&&r<=e.size?"isobmff":null}function ke(e){let t=e.toLowerCase();return t.endsWith(".braw")?"braw":t.endsWith(".crm")?"crm":"mov"}function Ne(e){return async(t,n)=>new Uint8Array(await e.slice(t,Math.min(t+n,e.size)).arrayBuffer())}function ye(e){let t=e.timecode;return!t||!t.fps_denominator?null:t.fps_numerator/t.fps_denominator}async function ir(e){return await pe(),xe?xe.clip(e,G?"rec709":"",()=>$e(e)):$e(e)}var xe=null;async function $e(e){let t=await ze(e),n=[];if(t==="r3d"){let r=e,s=r.parts&&r.bases?r.parts:[{name:e.name,size:e.size}],o=r.bases??[0],i=async(u,d,f)=>{let p=o[u]+d;return new Uint8Array(await e.slice(p,Math.min(p+f,o[u]+s[u].size)).arrayBuffer())},c=JSON.stringify(s.map(u=>({name:u.name,size:u.size}))),a=JSON.parse(await fe(i,c)),l=JSON.parse(await ue(i,c));return s.length===1&&/_\d{3}\.r3d$/i.test(e.name)&&!/_001\.r3d$/i.test(e.name)&&n.push("spanned R3D part \u2014 only this part's frames are indexed"),{frames:l.map(u=>({offset:o[u.part??0]+u.essenceOffset,size:u.essenceLength})),w:a.width??0,h:a.height??0,fps:ye(a),startFrame:a.timecode?.start_frame??0,dropFrame:a.timecode?.drop_frame??!1,label:"R3D",spec:{codec:"r3d",subbands:Ae},geometrySpec:{codec:"r3d",subbands:De},index:null,warnings:n}}if(t==="mxf"){let r=Ne(e),s=JSON.parse(await de(r,e.size));if(!s)throw new Error(`${e.name}: MXF index unreadable`);let o=JSON.parse(await me(r,e.size)),i=[];for(let p=0;p<o.frame_count;p++)i.push({offset:o.frames[p*2],size:o.frames[p*2+1]});let c=i.filter(p=>p.size===0).length;c&&n.push(`${c} frame(s) had no locatable picture KLV`);let a=s.width??0,l=s.height??0,u=(s.inner_codec??"").toLowerCase(),d=null,f="MXF";return u==="arriraw"?(d={codec:"arriraw",w:a,h:l,scale:O},f="ARRIRAW"):u==="xocn"?(d={codec:"xocn",scale:O,...G?{display:"rec709"}:{}},f="X-OCN"):await le(r,e.size)?(d={codec:"vc3",scale:O},f="DNxHR"):await ce(r,e.size)?(d={codec:"prores"},f="ProRes"):n.push(`MXF inner codec ${u||"unknown"} not wired to the fingerprint pool`),{frames:d?i:[],w:a,h:l,fps:ye(s),startFrame:s.timecode?.start_frame??0,dropFrame:s.timecode?.drop_frame??!1,label:f,spec:d,geometrySpec:d&&d.codec==="arriraw"?{...d,scale:U}:d&&d.codec==="xocn"?{codec:"xocn",scale:U,...G?{display:"rec709"}:{}}:d&&d.codec==="vc3"?{codec:"vc3",scale:U}:null,index:null,warnings:n}}if(t==="isobmff"){let r=await he(e),s=ke(e.name);if(r.kind==="prores")return{frames:r.offs,w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:X(r.kind),spec:{codec:"prores"},geometrySpec:null,index:r,warnings:n};if(r.kind==="h264"||r.kind==="hevc")return{frames:r.offs,w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:X(r.kind),spec:null,geometrySpec:null,index:r,warnings:n};let o=s==="braw"?{codec:"braw",scale:O}:r.codec==="aprh"||r.codec==="aprn"?{codec:"proresraw",scale:O}:null;return o||n.push(`codec ${r.codec} not wired to the fingerprint pool`),{frames:o?r.offs:[],w:r.w,h:r.h,fps:r.fps,startFrame:r.startFrame,dropFrame:r.dropFrame,label:o?s==="braw"?"BRAW":"ProRes RAW":`unsupported (${r.codec})`,spec:o,geometrySpec:o?{...o,scale:U}:null,index:r,warnings:n}}throw new Error(`${e.name}: unrecognised container`)}var Y=null;var Te=Number(D("CONFORM_DECODERS")??0)||Math.max(2,Math.min(Math.floor(re()/2),Math.floor(ee()/2**31))),Z=0,ve=[],Me=async(...e)=>{Z>=Te?await new Promise(t=>ve.push(t)):Z++;try{return await ie(...e)}finally{let t=ve.shift();t?t():Z--}};async function Re(){let e=te()==="win32"?"conformtools-decode.exe":"conformtools-decode",t=[D("CONFORM_NATIVE_DECODE"),ne(e),W(new URL(`./${e}`,import.meta.url)),W(new URL(`../../rust/target/release/${e}`,import.meta.url))].filter(Boolean);for(let n of t)if(await oe(n))return n;return null}var S=class extends Error{constructor(n,r){super(r);this.why=n}};function Pr(e){let t=null;try{t=JSON.parse(e.trim().split(`
4
- `).pop())}catch{}if(t?.why==="not_entitled")throw new ae("not_entitled",t.detail??"this machine is not licensed");return t?.detail??e.trim()}function Fe(e,t){try{let n=JSON.parse(e.trim().split(`
5
- `).pop()??"");return new S(n.why,n.detail)}catch{return new S("decoder",`the native decoder exited ${t}: ${e.trim().slice(-300)}`)}}function Er(e){return Y?.owns(e)?Y.meta(`probe|${e}`,()=>Se(e)):Se(e)}async function Se(e){let t=await Re();if(!t)throw new S("missing",j("the native decoder (conformtools-decode)"));let n=[],r=await Me(t,["probe",e],s=>n.push(s));if(r.code!==0)throw Fe(r.stderr,r.code);return JSON.parse(new TextDecoder().decode(Pe(n)))}function Pe(e){let t=e.reduce((s,o)=>s+o.length,0),n=new Uint8Array(t),r=0;for(let s of e)n.set(s,r),r+=s.length;return n}async function Ue(e,t,n,r,s){let o=await Re();if(!o)throw new S("missing",j("the native decoder (conformtools-decode)"));let i=null,c=[],a=0,l=f=>{let p=new Uint8Array(f),m=0;for(;m<f;){let h=c[0],g=Math.min(h.length,f-m);p.set(h.subarray(0,g),m),m+=g,g===h.length?c.shift():c[0]=h.subarray(g)}return a-=f,p},u=[e,t,"--width",String(s.width??32768)];s.from!=null&&u.push("--from",String(s.from)),s.count!=null&&u.push("--count",String(s.count)),s.range&&u.push("--range",s.range);let d=await Me(o,u,f=>{if(c.push(f),a+=f.length,!i){let m=Pe(c.splice(0));c.push(m);let h=m.indexOf(10);if(h<0)return;i=JSON.parse(new TextDecoder().decode(m.subarray(0,h))),l(h+1),n(i)}let p=4+i.w*i.h*(i.bpp??(e==="rgb16"?6:4));for(;a>=p;){let m=l(p);r(new DataView(m.buffer).getUint32(0,!0),m.subarray(4))}},{signal:s.signal});if(d.code!==0||!i)throw Fe(d.stderr,d.code)}function Ee(e,t,n,r={}){return Ue("bgra",e,t,n,r)}var Ie=["none","rle","zips","zip","piz","pxr24","b44","b44a","dwaa","dwab","htj2k"],I=e=>(e>>4)*10+(e&15);function He(e){let t=I(e&63),n=I(e>>>8&127),r=I(e>>>16&127),s=I(e>>>24&63),o=i=>String(i).padStart(2,"0");return`${o(s)}:${o(r)}:${o(n)}${e&64?";":":"}${o(t)}`}function Be(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.length<8||t.getUint32(0,!0)!==20000630)return null;let n={fps:null,timecode:null,width:0,height:0,display:null,compression:null,attributes:[]},r=8,s=()=>{let i=r;for(;r<e.length&&e[r]!==0;)r++;let c=new TextDecoder().decode(e.subarray(i,r));return r++,c},o=i=>({width:t.getInt32(i+8,!0)-t.getInt32(i,!0)+1,height:t.getInt32(i+12,!0)-t.getInt32(i+4,!0)+1});for(;r<e.length;){let i=s();if(!i)break;let c=s();if(r+4>e.length)return null;let a=t.getInt32(r,!0);if(r+=4,a<0||r+a>e.length)return null;if(n.attributes.push(`${i}:${c}`),i==="framesPerSecond"&&c==="rational"&&a>=8){let l=t.getInt32(r,!0),u=t.getUint32(r+4,!0);n.fps=u?l/u:null}else i==="timeCode"&&c==="timecode"&&a>=8?n.timecode=He(t.getUint32(r,!0)):i==="dataWindow"&&c==="box2i"&&a>=16?{width:n.width,height:n.height}=o(r):i==="displayWindow"&&c==="box2i"&&a>=16?n.display=o(r):i==="compression"&&a>=1&&(n.compression=Ie[e[r]]??`type ${e[r]}`);r+=a}return n}async function je(e){let t=e,n=null,r=/^(.*?)\[(\d+)-(\d+)\](.*)$/.exec(b(e));if(await R(e))n=/^(.*?)(\d+)(\.exr)$/i;else{t=x(e);let o=r?[null,r[1],r[2],r[4]]:/^(.*?)(\d+)(\.exr)$/i.exec(b(e));if(!o)return{frames:[e],numbers:[]};let i=c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=new RegExp(`^${i(o[1])}(\\d{${o[2].length}})${i(o[3])}$`,"i")}let s=[];for await(let o of v(t)){let i=o.isFile?n.exec(o.name):null;i&&s.push({n:Number(i[i.length===4?2:1]),f:y(t,o.name)})}return s.sort((o,i)=>o.n-i.n),{frames:s.map(o=>o.f),numbers:s.map(o=>o.n)}}async function Q(e){let t=await je(e),n=t.frames[0];if(!n)throw new Error(`no .exr frames for '${b(e)}'`);let r=await z(n),s;try{s=Be(await r.readAt(0,Math.min(r.size,1<<20)))}finally{await r.close()}if(!s)throw new Error(`'${b(n)}' is not an OpenEXR file`);let o=Math.max(1,t.frames.length),i=t.numbers.length>1?t.numbers[t.numbers.length-1]-t.numbers[0]+1-t.numbers.length:0,c=s.fps??0;return{id:b(n),kind:"external",target_url:n,local_path:n,content_kind:o>1?"video":"still",source_fps:s.fps??void 0,source_timecode:s.timecode??void 0,source_resolution_w:s.width,source_resolution_h:s.height,available_range:{start:{value:0,rate:c},duration:{value:o,rate:c}},streams:[{kind:"video",codec:"exr",width:s.width,height:s.height,rate:s.fps??void 0,codec_specific:{compression:s.compression}}],vendor_metadata:{exr:{frames:o,first_frame:t.numbers[0]??null,last_frame:t.numbers[t.numbers.length-1]??null,missing_frames:i,display_window:s.display,attributes:s.attributes,fps_source:s.fps!=null?"header framesPerSecond":"not in the header",timecode_source:s.timecode?"header timeCode (first frame)":"not in the header"}}}}var C=new Set([".mov",".mp4",".m4v",".mxf",".wav",".braw",".crm",".r3d",".aif",".aiff"]);async function We(e){let t=await z(e);return{path:e,file:t,size:t.size}}function Le(e){return(t,n)=>e.file.readAt(t,n)}async function Je(e){let t=F(b(e));if(!t)return[e];let n=x(e),r=[];for await(let s of v(n)){if(!s.isFile)continue;let o=F(s.name);o&&o.clipBase===t.clipBase&&r.push({n:o.partNumber,p:y(n,s.name)})}return r.sort((s,o)=>s.n-o.n).map(s=>s.p)}async function Ke(e){let t=[],n=[];for await(let r of v(e))!r.isFile||r.name.startsWith(".")||(F(r.name)?t.push(r.name):C.has(k(r.name).toLowerCase())&&n.push(r.name));if(t.length)return y(e,t.sort()[0]);if(n.length===1)return y(e,n[0]);throw n.length?(n.sort(),new Error(`'${b(e)}' is a folder of ${n.length} clips (${n.slice(0,3).join(", ")}${n.length>3?", \u2026":""}): probe one of them, or media_find to list them all`)):new Error(`'${b(e)}' is a folder with no media file in it (looked for ${[...C].join(" ")}, and RED parts)`)}async function q(e){await R(e)&&(e=await Ke(e));let t=we(b(e));if(!t)throw new Error(`unsupported media file '${b(e)}' (supported: ${[...C].join(" ")})`);let n=await Je(e),r=await Promise.all(n.map(We));return{source:_e(t,r.map(o=>ge(b(o.path),{fileSize:o.size,read:Le(o)}))),parts:r,format:t,anchor:n[0],close:()=>r.forEach(o=>o.file.close())}}async function Br(e,t,n,r){if(!/h264|avc|hevc|h265/.test(n)){let s=null,o=await q(e);try{return await N(o.source,{verb:"decode",index:t,intent:"park"})}catch(i){s=i}finally{o.close()}try{return await Oe(e,t,r)}catch(i){throw/no decoder/.test(String(s))?i:s instanceof Error?s:new Error(String(s))}}return Oe(e,t,r)}async function Oe(e,t,n){t=Math.round(t);let r=0,s=0,o=null;if(await Ee(e,c=>{r=c.w,s=c.h},(c,a)=>{c===t&&(o=a)},{from:t,count:1,width:n}),!o)throw new Error(`the OS decoder returned no frame ${t} of ${b(e)}`);let i=o;for(let c=0;c<i.length;c+=4){let a=i[c];i[c]=i[c+2],i[c+2]=a}return{rgba:i,width:r,height:s}}async function A(e){if(await R(e)){let n=[];for await(let r of v(e))r.isFile&&/\.exr$/i.test(r.name)&&!r.name.startsWith(".")&&n.push(r.name);if(n.length)return Q(y(e,n.sort()[0]))}if(/\.exr$/i.test(e))return Q(e);let t=await q(e);try{let n=await N(t.source,{verb:"inspect"});if(!n)throw new Error(`could not read '${b(e)}' as ${t.format}`);return n.target_url=t.anchor,n.local_path=t.anchor,n.id=n.id||b(t.anchor),t.parts.length>1&&((n.vendor_metadata??={}).spanned_parts=t.parts.map(r=>b(r.path))),n.size_bytes=t.parts.reduce((r,s)=>r+s.size,0),n}finally{t.close()}}function Ve(e,t,n,r){let s=Math.abs(r*1001-Math.round(r*1001/1e3)*1e3)<1?Math.round(r)*1e3/1001:r,o=Math.floor(e*s/t+1e-6);return{tc:P(o,r),frames:Math.round(n*s/t)}}var Xe=e=>String(Math.round(e*1e3)/1e3);function jr(e,t){let n=e.streams?.find(m=>m.kind==="video"),r=e.streams?.filter(m=>m.kind==="audio")??[],s=e.vendor_metadata?.bext;if(!n&&e.available_range&&r[0]?.rate){let m=r[0].rate,h=e.available_range.duration.value,_=(t?[t]:[24e3/1001,24]).map(w=>{let $=Ve(s?.time_reference??0,s?.sample_rate||m,h,w);return`${s?`start TC ${$.tc}, `:""}${$.frames} frames @ ${Xe(w)} fps`});return[e.target_url??"",`audio only; ${h} samples (${(h/m).toFixed(3)} s)${s?`; BWF time_reference ${s.time_reference}`:"; no BWF timecode"}`,..._,...t?[]:["(pass fps for the project's rate)"],...r.map((w,$)=>`audio ${r.length>1?`${$+1}: `:""}${w.codec??"pcm"} ${w.channels??"?"}ch ${w.rate} Hz ${w.bit_depth??"?"}-bit`)].join(`
6
- `)}let o=e.available_range?.duration?.value??e.declared_duration?.value??null,i=e.source_fps??n?.rate??null,c=e.size_bytes,a=e.vendor_metadata?.spanned_parts,l=n?.codec_specific??{},u=[l.profile?`${l.profile} (${l.fourcc})`:l.fourcc,l.pixel_format,n?.bit_depth?`${n.bit_depth}-bit`:null,l.colr?`color ${l.colr.primaries}/${l.colr.transfer}/${l.colr.matrix} (primaries/transfer/matrix)`:null].filter(Boolean).join(", "),d=e.source_pixel_aspect&&Math.abs(e.source_pixel_aspect-1)>.001?e.source_pixel_aspect:null,f=d&&n?.width&&n?.height?`pixel aspect ${Math.round(d*1e3)/1e3}: stored ${n.width}x${n.height}, shown ${(n.width*d/n.height).toFixed(2)}:1 (squeezed; a trim keeps it, a square-pixel copy is a new render)`:null,p=e.raw_extraction?.mov_probe?.every_sample_is_keyframe===!1&&n?"long-GOP (not every frame is a keyframe): media_trim starts on the keyframe at or before the frame asked for":null;return[e.target_url??"",n?`${n.codec??"?"} ${n.width??"?"}x${n.height??"?"}${i?` @ ${Math.round(i*1e3)/1e3} fps`:""}${u?`; ${u}`:""}`:"no video track",...[f,p].filter(m=>!!m),`start TC ${e.source_timecode??"none"}; ${o!=null?`${o} frames`:"length unknown"}${o!=null&&i?` (${(o/i).toFixed(2)} s)`:""}`,r.length?r.map((m,h)=>{let g=m.codec_specific?.channel_layout;return`audio ${r.length>1?`${h+1}: `:""}${m.codec??"pcm"} ${m.channels??"?"}ch${g?` (${g})`:""} ${m.rate??"?"} Hz ${m.bit_depth??"?"}-bit`}).join(`
7
- `):"no audio",`${e.reel_name?`reel ${e.reel_name}; `:""}${c!=null?`${(c/1e6).toFixed(1)} MB`:""}${a?`; spanned ${a.length} parts`:""}`].join(`
8
- `)}var Ge=8*1024*1024,H=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0));async function Ye(e,t,n){if(e.executable_locally===!1)throw new Error("this trim plan is server-side only");let r=new Map(t.parts.map(o=>[b(o.path),o]));await K(x(n));let s=await se(n);try{await s.truncate(e.total_size),await s.writeAt(0,H(e.dest_header_bytes_base64));for(let o of e.src_byte_ranges){let i=o.src_file_name?r.get(b(o.src_file_name)):t.parts[0];if(!i)throw new Error(`plan references unknown source part '${o.src_file_name}'`);let c=0;for(;c<o.length;){let a=Math.min(Ge,o.length-c),l=await i.file.readAt(o.offset+c,a);if(l.length<a)throw new Error(`short read in ${b(i.path)} at ${o.offset+c}`);await s.writeAt(o.write_to_dest_offset+c,l),c+=a}}e.dest_footer_bytes_base64&&e.dest_footer_offset!=null&&await s.writeAt(e.dest_footer_offset,H(e.dest_footer_bytes_base64));for(let o of e.dest_patches??[])await s.writeAt(o.offset,H(o.bytes_base64))}finally{await s.close()}for(let o of e.dest_sidecar_writes??[])await J(y(x(n),o.name),H(o.bytes_base64))}function Ze(e,t){let n=[];for(let r of e){if(r.kind!=="clip"||!r.source_range)continue;let s=r.source_range.start.value,o=r.source_range.duration.value,i=Math.max(0,Math.floor(s)-t),c=Math.floor(s+o-1)+t;c>=i&&n.push({first_frame:i,last_frame:c})}return be(n)}async function Qe(e,t,n,r,s){let o=await q(e);try{let i=Ze(t,n);if(!i.length)throw new Error("no usable frame ranges (items need kind=clip with source_range)");let c=await N(o.source,{verb:"trim",selection:{items:t,handles:n}}),a=k(o.anchor),l=o.format==="r3d",u=l?F(b(o.anchor))?.clipBase??b(o.anchor,a):b(o.anchor,a),d=[];for(let[f,p]of c.entries()){let m=p.output_clip_number??(i.length>1?f+1:void 0),h=i[(m??1)-1]??i[0],g=m&&(p.output_clip_count??i.length)>1?`_S${String(m).padStart(3,"0")}`:"",_;if(l){let w=p.output_part_number??f+1;_=y(r,`${u}${g}.RDC`,`${u}_${String(w).padStart(3,"0")}.R3D`),d.push({path:_,bytes:p.total_size,island:h,part:w,clip:m})}else{let w=s&&c.length===1?s:`${u}${g||`_trim_${h.first_frame}-${h.last_frame}`}${a}`;_=y(r,w),d.push({path:_,bytes:p.total_size,island:h,clip:m})}await Ye(p,o,_)}return l||await qe(e,d,!!s&&c.length===1),{outputs:d,islands:i,format:o.format}}finally{o.close()}}async function qe(e,t,n){let r=await A(e).catch(()=>null),s=r?.source_fps??r?.streams?.find(o=>o.kind==="video")?.rate??null;if(!(!r?.source_timecode||!s))for(let o of t){if(!o.island)continue;let i=await A(o.path).catch(()=>null),c=i?.available_range?.duration?.value??i?.declared_duration?.value;if(!i?.source_timecode||!c)continue;let a=E(i.source_timecode,s,r.source_timecode);if(a===o.island.first_frame&&a+c-1===o.island.last_frame||(o.island={first_frame:a,last_frame:a+c-1},n))continue;let l=o.path.replace(/_trim_\d+-\d+(\.[^./\\]+)$/,`_trim_${a}-${a+c-1}$1`);l!==o.path&&(await V(o.path,l),o.path=l)}}async function Wr(e){let t=await A(e.path),n=t.source_fps??t.streams?.find(g=>g.kind==="video")?.rate??null,r=t.available_range?.duration?.value??t.declared_duration?.value??null;if(!n)throw new Error("cannot trim: no frame rate / timecode track on this file");let s=E(e.in,n,t.source_timecode??null),o=E(e.out,n,t.source_timecode??null);e.out_exclusive&&(o-=1);let i=t.source_timecode??"00:00:00:00",c=r!=null?P((T(i,n)??0)+r-1,n,!!t.vendor_metadata?.drop_frame):null;if(o<s)throw new Error(`out ${e.out} is before in ${e.in}`);if(s<0)throw new Error(`in ${e.in} is before the file starts (${i}, frame 0)`);if(r!=null&&o>r-1)throw new Error(`out ${e.out} is past the end of the file (last frame ${c}, frame ${r-1})`);let a={id:"trim",kind:"clip",source_range:{start:{value:s,rate:n},duration:{value:o-s+1,rate:n}}},l=x(e.path),u;if(e.out_path)try{(await L(e.out_path)).isDirectory?l=e.out_path:(l=x(e.out_path),u=b(e.out_path))}catch{l=x(e.out_path),u=b(e.out_path)}let d=await Qe(e.path,[a],Math.max(0,Math.floor(e.handles??0)),l,u),f=d.islands[0],p=d.outputs.length===1&&d.outputs[0].island?d.outputs[0].island:f,m=p.first_frame,h=p.last_frame;return{outputs:d.outputs,first_frame:m,last_frame:h,frames:h-m+1,fps:n,facts:t,...m!==f.first_frame||h!==f.last_frame?{asked:{first_frame:f.first_frame,last_frame:f.last_frame}}:{}}}function Ce(e){let t=[...C].map(n=>n.slice(1)).join("|");return e.toLowerCase().replace(new RegExp(`\\.(${t})(?=[._\\s-]|$)`,"g"),"").replace(/[^a-z0-9]/g,"")}function er(e,t){let n=Ce(e),r=Ce(t);if(r&&n.includes(r))return"name";let s=t.toLowerCase().split(/[^a-z0-9]+/).filter(o=>/\d/.test(o)&&o.length>=3);return s.length&&s.every(o=>n.includes(o))?"id":null}async function Lr(e,t,n){let r=[],s=0,o=null,i=Date.now()+n.time_limit_s*1e3,c=async(a,l)=>{try{for await(let u of v(a)){if(o&&!o.startsWith("folders"))return;if(++s>n.max_entries){o=`stopped after ${n.max_entries} entries (max_entries)`;return}if(Date.now()>i){o=`stopped after ${n.time_limit_s} s (time_limit_s)`;return}if(u.name.startsWith("."))continue;let d=y(a,u.name);if(u.isDirectory)l<n.max_depth?await c(d,l+1):o??=`folders deeper than max_depth=${n.max_depth} not searched (e.g. ${d})`;else if(u.isFile&&C.has(k(u.name).toLowerCase())){let f=er(u.name,t);f&&r.push({path:d,match:f,size:(await L(d).catch(()=>({size:0}))).size})}}}catch{}};if(await c(e,0),n.probe)for(let a=0;a<r.length;a+=8)await Promise.all(r.slice(a,a+8).map(async l=>{try{l.facts=await A(l.path)}catch(u){l.error=u.message}}));return r.sort((a,l)=>a.path.localeCompare(l.path)),{hits:r,scanned:s,truncated:o}}function rr(e){let t=e.streams?.find(c=>c.kind==="video"),n=e.source_fps??t?.rate??null,r=e.available_range?.duration?.value??e.declared_duration?.value??null,s=t?.codec_specific??{},o=e.source_timecode&&n?T(e.source_timecode,n):null,i=o!=null&&r!=null&&n?P((o+r)%(Math.round(n)*86400),n,e.source_timecode.includes(";")):null;return`${t?`${t.codec??"?"}${s.profile?` ${s.profile}`:""} ${t.width??"?"}x${t.height??"?"}`:"no video"}${n?` @ ${Math.round(n*1e3)/1e3} fps`:""}; TC ${e.source_timecode??"none"}${i?`\u2013${i}`:""}; ${r??"?"} fr${r!=null&&n?` (${(r/n).toFixed(2)} s)`:""}`}function Jr(e,t,n,r){let s=e.hits.slice(0,r),o=[];e.truncated&&o.push(`TRUNCATED: ${e.truncated} \u2014 the search did NOT cover all of ${t}; the matches below may be incomplete.`),e.hits.length>s.length&&o.push(`TRUNCATED: showing ${s.length} of ${e.hits.length} matches. Pass limit=${e.hits.length} or narrow the query.`),o.push(`${e.hits.length} file${e.hits.length===1?"":"s"} match "${n}" under ${t} (${e.scanned} entries scanned)`);let i=new Map;for(let a of e.hits)i.set(b(a.path).toLowerCase(),(i.get(b(a.path).toLowerCase())??0)+1);let c=[...i].filter(([,a])=>a>1);c.length&&o.push(`same name in several folders: ${c.map(([a,l])=>`${a} \xD7${l}`).join(", ")} \u2014 they can be DIFFERENT clips; match by TC + duration, never by name alone`);for(let a of s)o.push(`- ${a.path}${a.match==="id"?" (id match)":""}
9
- ${a.facts?rr(a.facts):a.error?`probe failed: ${a.error}`:`${(a.size/1e6).toFixed(1)} MB`}`);return o.join(`
10
- `)}async function Kr(e,t,n=0){let r=await A(e),s=r.source_fps??r.streams?.find(f=>f.kind==="video")?.rate??null,o=r.available_range?.duration?.value??r.declared_duration?.value??null;if(!s||o==null)throw new Error(`cannot check coverage: ${b(e)} has no frame rate or length`);let i=Math.round(s)*86400,c=r.source_timecode?T(r.source_timecode,s)??0:0,a=!!r.source_timecode?.includes(";"),l=f=>{let p=E(f,s,r.source_timecode??null);return typeof f=="number"||/^\d+$/.test(f.trim())?p:p<-i/2?p+i:p>i/2?p-i:p},u=f=>P(((c+f)%i+i)%i,s,a),d=t.map((f,p)=>{let m=l(f.in),h=l(f.out),g=m,_=o-h,w=g>=0&&_>=0&&h>m,$=Math.max(0,-g),B=Math.max(0,-_),M=[];return h<=m?M.push("out is not after in"):w?M.push(`covered; handles head ${g} / tail ${_} fr`):M.push(`NOT covered: short ${[$?`${$} fr at head`:"",B?`${B} fr at tail`:""].filter(Boolean).join(", ")}`),w&&n&&(g<n||_<n)&&M.push(`handles short of ${n}: ${[g<n?`head by ${n-g}`:"",_<n?`tail by ${n-_}`:""].filter(Boolean).join(", ")}`),{label:f.label??`range ${p+1}`,in_tc:u(m),out_tc:u(h),frames:h-m,covered:w,head:g,tail:_,short_head:$,short_tail:B,note:M.join("; ")}});return{facts:r,rows:d}}export{ir as a,Re as b,Pr as c,Er as d,Ee as e,je as f,C as g,Je as h,Ke as i,q as j,Br as k,A as l,Ve as m,jr as n,Ze as o,Qe as p,Wr as q,Ce as r,er as s,Lr as t,rr as u,Jr as v,Kr as w};