PageSourceSearch

https://bablostudios.lovable.app/assets/portal-rjGn25YO.js

js bablostudios.lovable.app collected 2026-10-03 03:23:48 UTC 99,315 bytes, 8 lines download raw bytes

1import{a as ar,r as j,i as et,j as o,d as ir,c as te,b as re,e as tt,g as sr,s as B,u as lr,L as ur}from"./index-BBi5vAI3.js";import{c as cr,a as dr,B as G,t as q,I as J,L as X}from"./index-DtizdyU3.js";import{T as Ge}from"./textarea-CZB1ETxO.js";import{c as Q}from"./createLucideIcon-Dkc2N5JM.js";import{A as fr}from"./arrow-left-8EEYgDH3.js";import{E as Ut}from"./external-link-CjcnZm_U.js";import{C as Et}from"./check-Bz28Z3ps.js";import{X as Ot}from"./x-BqOrh5tF.js";function ee(e){const t=ar();return j.useCallback(async(...r)=>{try{const n=await e(...r);if(et(n))throw n;return n}catch(n){if(et(n))return n.options._fromLocation=t.stores.location.get(),t.navigate(t.resolveRedirect(n).options);throw n}},[t,e])}const pr=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],hr=Q("bell",pr);const mr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],yr=Q("circle-check",mr);const vr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],gr=Q("circle",vr);const br=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],xr=Q("download",br);const _r=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],rt=Q("lock",_r);const wr=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],jr=Q("message-square",wr);const Sr=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Nr=Q("tag",Sr);const Pr=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],kr=Q("trash-2",Pr);const Ur=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Er=Q("upload",Ur);function Or(e,t=[]){let r=[];function n(i,l){const p=j.createContext(l);p.displayName=i+"Context";const f=r.length;r=[...r,l];const m=E=>{const{scope:C,children:T,...y}=E,k=C?.[e]?.[f]||p,P=j.useMemo(()=>y,Object.values(y));return o.jsx(k.Provider,{value:P,children:T})};m.displayName=i+"Provider";function v(E,C){const T=C?.[e]?.[f]||p,y=j.useContext(T);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${E}\` must be used within \`${i}\``)}return[m,v]}const a=()=>{const i=r.map(l=>j.createContext(l));return function(p){const f=p?.[e]||i;return j.useMemo(()=>({[`__scope${e}`]:{...p,[e]:f}}),[p,f])}};return a.scopeName=e,[n,Cr(a,...t)]}function Cr(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=n.reduce((p,{useScope:f,scopeName:m})=>{const E=f(i)[`__scope${m}`];return{...p,...E}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}var Rr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ct=Rr.reduce((e,t)=>{const r=cr(`Primitive.${t}`),n=j.forwardRef((a,i)=>{const{asChild:l,...p}=a,f=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...p,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ve="Progress",Ke=100,[Lr]=Or(Ve),[Ar,Tr]=Lr(Ve),Rt=j.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:a,getValueLabel:i=Dr,...l}=e;(a||a===0)&&!nt(a)&&console.error($r(`${a}`,"Progress"));const p=nt(a)?a:Ke;n!==null&&!ot(n,p)&&console.error(Ir(`${n}`,"Progress"));const f=ot(n,p)?n:null,m=Ue(f)?i(f,p):void 0;return o.jsx(Ar,{scope:r,value:f,max:p,children:o.jsx(Ct.div,{"aria-valuemax":p,"aria-valuemin":0,"aria-valuenow":Ue(f)?f:void 0,"aria-valuetext":m,role:"progressbar","data-state":Tt(f,p),"data-value":f??void 0,"data-max":p,...l,ref:t})})});Rt.displayName=Ve;var Lt="ProgressIndicator",At=j.forwardRef((e,t)=>
1{const{__scopeProgress:r,...n}=e,a=Tr(Lt,r);return o.jsx(Ct.div,{"data-state":Tt(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:t})});At.displayName=Lt;function Dr(e,t){return`${Math.round(e/t*100)}%`}function Tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Ue(e){return typeof e=="number"}function nt(e){return Ue(e)&&!isNaN(e)&&e>0}function ot(e,t){return Ue(e)&&!isNaN(e)&&e<=t&&e>=0}function $r(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ke}\`.`}function Ir(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2  - a positive number
3  - less than the value passed to \`max\` (or ${Ke} if no \`max\` prop is set)
4  - \`null\` or \`undefined\` if the progress is indeterminate.
5
6Defaulting to \`null\`.`}var Dt=Rt,Fr=At;const $t=j.forwardRef(({className:e,value:t,...r},n)=>o.jsx(Dt,{ref:n,className:dr("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...r,children:o.jsx(Fr,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));$t.displayName=Dt.displayName;const ne=ir({type:"function"}),qr=te({method:"POST"}).middleware([ne]).handler(re("8a44a0c286f6746ce9a1041a2f04951a77a9ecee71d7287d3ccf79a992d638e4"));function De(e){"@babel/helpers - typeof";return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(e)}function Br(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function zr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mr(e,t,r){return t=me(t),Hr(e,Ye()?Reflect.construct(t,r||[],me(e).constructor):t.apply(e,r))}function Hr(e,t){if(t&&(De(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gr(e)}function Gr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&he(e,t)}function $e(e){var t=typeof Map=="function"?new Map:void 0;return $e=function(n){if(n===null||!Yr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,a)}function a(){return Kr(n,arguments,me(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),he(a,n)},$e(e)}function Kr(e,t,r){if(Ye())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var a=new(e.bind.apply(e,n));return r&&he(a,r.prototype),a}function Ye(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ye=function(){return!!e})()}function Yr(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},he(e,t)}function me(e){return me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},me(e)}var _e=(function(e){function t(r){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(zr(this,t),n=Mr(this,t,[r]),n.originalRequest=i,n.originalResponse=l,n.causingError=a,a!=null&&(r+=", caused by ".concat(a.toString())),i!=null){var p=i.getHeader("X-Request-ID")||"n/a",f=i.getMethod(),m=i.getURL(),v=l?l.getStatus():"n/a",E=l?l.getBody()||"":"n/a";r+=", originated from request (method: ".concat(f,", url: ").concat(m,", response code: ").concat(v,", response text: ").concat(E,", request id: ").concat(p,")")}return n.message=r,n}return Vr(t,e),Br(t)})($e(Error));function ye(e){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function Wr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qr(n.key),n)}}function Zr(e,t,r){return t&&Xr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qr(e){var t=Jr(e,"string");return ye(t)=="symbol"?t:t+""}function Jr(e,t){if(ye(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ye(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var en=(function(){function e(){Wr(this,e)}return Zr(e,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])})();const It="3.8.0",tn=It,de=typeof Buffer=="function",at=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,it=typeof TextEncoder=="function"?new TextEncoder:void 0,rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
6+/=",fe=Array.prototype.slice.call(rn),we=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(fe),nn=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,H=String.fromCharCode.bind(String),st=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Ft=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),qt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Bt=e=>{let t,r,n,a,i="";const l=e.length%3;for(let p=0;p<e.length;){if((r=e.charCodeAt(p++))>255||(n=e.charCodeAt(p++))>255||(a=e.charCodeAt(p++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|a,i+=fe[t>>18&63]+fe[t>>12&63]+fe[t>>6&63]+fe[t&63]}return l?i.slice(0,l-3)+"===".substring(l):i},We=typeof btoa=="function"?e=>btoa(e):de?e=>Buffer.from(e,"binary").toString("base64"):Bt,Ie=de?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,a=e.length;n<a;n+=4096)r.push(H.apply(null,e.subarray(n,n+4096)));return We(r.join(""))},Se=(e,t=!1)=>t?Ft(Ie(e)):Ie(e),on=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?H(192|t>>>6)+H(128|t&63):H(224|t>>>12&15)+H(128|t>>>6&63)+H(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return H(240|t>>>18&7)+H(128|t>>>12&63)+H(128|t>>>6&63)+H(128|t&63)}},an=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,zt=e=>e.replace(an,on),lt=de?e=>Buffer.from(e,"utf8").toString("base64"):it?e=>Ie(it.encode(e)):e=>We(zt(e)),ue=(e,t=!1)=>t?Ft(lt(e)):lt(e),ut=e=>ue(e,!0),sn=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ln=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return H((r>>>10)+55296)+H((r&1023)+56320);case 3:return H((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return H((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Mt=e=>e.replace(sn,ln),Ht=e=>{if(e=e.replace(/\s+/g,""),!nn.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,a=[];for(let i=0;i<e.length;)t=we[e.charAt(i++)]<<18|we[e.charAt(i++)]<<12|(r=we[e.charAt(i++)])<<6|(n=we[e.charAt(i++)]),r===64?a.push(H(t>>16&255)):n===64?a.push(H(t>>16&255,t>>8&255)):a.push(H(t>>16&255,t>>8&255,t&255));return a.join("")},Xe=typeof atob=="function"?e=>atob(qt(e)):de?e=>Buffer.from(e,"base64").toString("binary"):Ht,Gt=de?e=>st(Buffer.from(e,"base64")):e=>st(Xe(e).split("").map(t=>t.charCodeAt(0))),Vt=e=>Gt(Kt(e)),un=de?e=>Buffer.from(e,"base64").toString("utf8"):at?e=>at.decode(Gt(e)):e=>Mt(Xe(e)),Kt=e=>qt(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Fe=e=>un(Kt(e)),cn=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Yt=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Wt=function(){const e=(t,r)=>Object.defineProperty(String.prototype,t,Yt(r));e("fromBase64",function(){return Fe(this)}),e("toBase64",function(t){return ue(this,t)}),e("toBase64URI",function(){return ue(this,!0)}),e("toBase64URL",function(){return ue(this,!0)}),e("toUint8Array",function(){return Vt(this)})},Xt=function(){const e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Yt(r));e("toBase64",function(t){return Se(this,t)}),e("toBase64URI",function(){return Se(this,!0)}),e("toBase64URL",function(){return Se(this,!0)})},dn=()=>{Wt(),Xt()},fn={version:It,VERSION:tn,atob:Xe,atobPolyfill:Ht,btoa:We,btoaPolyfill:Bt,fromBase64:Fe,toBase64:ue,encode:ue,encodeURI:ut,encodeURL:ut,utob:zt,btou:Mt,decode:Fe,isValid:cn,fromUint8Array:Se,toUint8Array:Vt,extendString:Wt,extendUint8Array:Xt,extendBuiltins:dn};var Le,ct;function pn(){return ct||(ct=1,Le=function(t,r){if(r=r.split(":")[0],t=+t,!t)return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}),Le}var je={},dt;function hn(){if(dt)return je;dt=1;var e=Object.prototype.hasOwnProperty,t;function r(l){try{return decodeURIComponent(l.replace(/\+/g," "))}catch{return null}}function n(l){try{return encodeURIComponent(l)}catch{return null}}function a(l){for(var p=/([^=?#&]+)=?([^&]*)/g,f={},m;m=p.exec(l);){var v=r(m[1]),E=r(m[2]);v===null||E===null||v in f||(f[v]=E)}return f}function i(l,p){p=p||"";var f=[],m,v;typeof p!="string"&&(p="?");for(v in l)if(e.call(l,v)){if(m=l[v],!m&&(m===null||m===t||isNaN(m))&&(m=""),v=n(v),m=n(m),v===null||m===null)continue;f.push(v+"="+m)}return f.length?p+f.join("&"):""}return je.stringify=i,je.parse=a,je}var Ae,ft;function mn(){if(ft)return Ae;ft=1;var e=pn(),t=hn(),r=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,n=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,i=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,p=/^[a-zA-Z]:/;function f(b){return(b||"").toString().replace(r,"")}var m=[["#","hash"],["?","query"],function(h,_){return C(_.protocol)?h.replace(/\\/g,"/"):h},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],v={hash:1,query:1};function E(b){var h;typeof window<"u"?h=window:typeof tt<"u"?h=tt:typeof self<"u"?h=self:h={};var _=h.location||{};b=b||_;var x={},R=typeof b,U;if(b.protocol==="blob:")x=new k(unescape(b.pathname),{});
vendor: 6,688 bytes, line 6
6else if(R==="string"){x=new k(b,{});for(U in v)delete x[U]}else if(R==="object"){for(U in b)U in v||(x[U]=b[U]);x.slashes===void 0&&(x.slashes=a.test(b.href))}return x}function C(b){return b==="file:"||b==="ftp:"||b==="http:"||b==="https:"||b==="ws:"||b==="wss:"}function T(b,h){b=f(b),b=b.replace(n,""),h=h||{};var _=l.exec(b),x=_[1]?_[1].toLowerCase():"",R=!!_[2],U=!!_[3],D=0,O;return R?U?(O=_[2]+_[3]+_[4],D=_[2].length+_[3].length):(O=_[2]+_[4],D=_[2].length):U?(O=_[3]+_[4],D=_[3].length):O=_[4],x==="file:"?D>=2&&(O=O.slice(2)):C(x)?O=_[4]:x?R&&(O=O.slice(2)):D>=2&&C(h.protocol)&&(O=_[4]),{protocol:x,slashes:R||C(x),slashesCount:D,rest:O}}function y(b,h){if(b==="")return h;for(var _=(h||"/").split("/").slice(0,-1).concat(b.split("/")),x=_.length,R=_[x-1],U=!1,D=0;x--;)_[x]==="."?_.splice(x,1):_[x]===".."?(_.splice(x,1),D++):D&&(x===0&&(U=!0),_.splice(x,1),D--);return U&&_.unshift(""),(R==="."||R==="..")&&_.push(""),_.join("/")}function k(b,h,_){if(b=f(b),b=b.replace(n,""),!(this instanceof k))return new k(b,h,_);var x,R,U,D,O,F,K=m.slice(),W=typeof h,N=this,V=0;for(W!=="object"&&W!=="string"&&(_=h,h=null),_&&typeof _!="function"&&(_=t.parse),h=E(h),R=T(b||"",h),x=!R.protocol&&!R.slashes,N.slashes=R.slashes||x&&h.slashes,N.protocol=R.protocol||h.protocol||"",b=R.rest,(R.protocol==="file:"&&(R.slashesCount!==2||p.test(b))||!R.slashes&&(R.protocol||R.slashesCount<2||!C(N.protocol)))&&(K[3]=[/(.*)/,"pathname"]);V<K.length;V++){if(D=K[V],typeof D=="function"){b=D(b,N);continue}U=D[0],F=D[1],U!==U?N[F]=b:typeof U=="string"?(O=U==="@"?b.lastIndexOf(U):b.indexOf(U),~O&&(typeof D[2]=="number"?(N[F]=b.slice(0,O),b=b.slice(O+D[2])):(N[F]=b.slice(O),b=b.slice(0,O)))):(O=U.exec(b))&&(N[F]=O[1],b=b.slice(0,O.index)),N[F]=N[F]||x&&D[3]&&h[F]||"",D[4]&&(N[F]=N[F].toLowerCase())}_&&(N.query=_(N.query)),x&&h.slashes&&N.pathname.charAt(0)!=="/"&&(N.pathname!==""||h.pathname!=="")&&(N.pathname=y(N.pathname,h.pathname)),N.pathname.charAt(0)!=="/"&&C(N.protocol)&&(N.pathname="/"+N.pathname),e(N.port,N.protocol)||(N.host=N.hostname,N.port=""),N.username=N.password="",N.auth&&(O=N.auth.indexOf(":"),~O?(N.username=N.auth.slice(0,O),N.username=encodeURIComponent(decodeURIComponent(N.username)),N.password=N.auth.slice(O+1),N.password=encodeURIComponent(decodeURIComponent(N.password))):N.username=encodeURIComponent(decodeURIComponent(N.auth)),N.auth=N.password?N.username+":"+N.password:N.username),N.origin=N.protocol!=="file:"&&C(N.protocol)&&N.host?N.protocol+"//"+N.host:"null",N.href=N.toString()}function P(b,h,_){var x=this;switch(b){case"query":typeof h=="string"&&h.length&&(h=(_||t.parse)(h)),x[b]=h;break;case"port":x[b]=h,e(h,x.protocol)?h&&(x.host=x.hostname+":"+h):(x.host=x.hostname,x[b]="");break;case"hostname":x[b]=h,x.port&&(h+=":"+x.port),x.host=h;break;case"host":x[b]=h,i.test(h)?(h=h.split(":"),x.port=h.pop(),x.hostname=h.join(":")):(x.hostname=h,x.port="");break;case"protocol":x.protocol=h.toLowerCase(),x.slashes=!_;break;case"pathname":case"hash":if(h){var R=b==="pathname"?"/":"#";x[b]=h.charAt(0)!==R?R+h:h}else x[b]=h;break;case"username":case"password":x[b]=encodeURIComponent(h);break;case"auth":var U=h.indexOf(":");~U?(x.username=h.slice(0,U),x.username=encodeURIComponent(decodeURIComponent(x.username)),x.password=h.slice(U+1),x.password=encodeURIComponent(decodeURIComponent(x.password))):x.username=encodeURIComponent(decodeURIComponent(h))}for(var D=0;D<m.length;D++){var O=m[D];O[4]&&(x[O[1]]=x[O[1]].toLowerCase())}return x.auth=x.password?x.username+":"+x.password:x.username,x.origin=x.protocol!=="file:"&&C(x.protocol)&&x.host?x.protocol+"//"+x.host:"null",x.href=x.toString(),x}function A(b){(!b||typeof b!="function")&&(b=t.stringify);var h,_=this,x=_.host,R=_.protocol;R&&R.charAt(R.length-1)!==":"&&(R+=":");var U=R+(_.protocol&&_.slashes||C(_.protocol)?"//":"");return _.username?(U+=_.username,_.password&&(U+=":"+_.password),U+="@"):_.password?(U+=":"+_.password,U+="@"):_.protocol!=="file:"&&C(_.protocol)&&!x&&_.pathname!=="/"&&(U+="@"),(x[x.length-1]===":"||i.test(_.hostname)&&!_.port)&&(x+=":"),U+=x+_.pathname,h=typeof _.query=="object"?b(_.query):_.query,h&&(U+=h.charAt(0)!=="?"?"?"+h:h),_.hash&&(U+=_.hash),U}return k.prototype={set:P,toString:A},k.extractProtocol=T,k.location=E,k.trimLeft=f,k.qs=t,Ae=k,Ae}var yn=mn();const vn=sr(yn);function gn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}function qe(){qe=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(d,s,u){d[s]=u.value},i=typeof Symbol=="function"?Symbol:{},l=i.iterator||"@@iterator",p=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function m(d,s,u){return Object.defineProperty(d,s,{value:u,enumerable:!0,configurable:!0,writable:!0}),d[s]}try{m({},"")}catch{m=function(u,g,w){return u[g]=w}}function v(d,s,u,g){var w=s&&s.prototype instanceof A?s:A,c=Object.create(w.prototype),S=new V(g||[]);return a(c,"_invoke",{value:F(d,u,S)}),c}function E(d,s,u){try{return{type:"normal",arg:d.call(s,u)}}catch(g){return{type:"throw",arg:g}}}t.wrap=v;var C="suspendedStart",T="suspendedYield",y="executing",k="completed",P={};function A(){}function b(){}function h(){}var _={};m(_,l,function(){return this});var x=Object.getPrototypeOf,R=x&&x(x(Z([])));R&&R!==r&&n.call(R,l)&&(_=R);var U=h.prototype=A.prototype=Object.create(_);function D(d){["next","throw","return"].forEach(function(s){m(d,s,function(u){return this._invoke(s,u)})})}function O(d,s){function u(w,c,S,L){var $=E(d[w],d,c);if($.type!=="throw"){var z=$.arg,I=z.value;return I&&oe(I)=="object"&&n.call(I,"__await")?s.resolve(I.__await).then(function(M){u("next",M,S,L)},function(M){u("throw",M,S,L)}):s.resolve(I).then(function(M){z.value=M,S(z)},function(M){return u("throw",M,S,L)})}L($.arg)}var g;a(this,"_invoke",{value:function(c,S){function L(){return new s(function($,z){u(c,S,$,z)})}return g=g?g.then(L,L):L()}})}function F(d,s,u){var g=C;return function(w,c){if(g===y)throw Error("Generator is already running");if(g===k){if(w==="throw")throw c;return{value:e,done:!0}}for(u.method=w,u.arg=c;;){var S=u.delegate;if(S){var L=K(S,u);if(L){if(L===P)continue;return L}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(g===C)throw g=k,u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);g=y;var $=E(d,s,u);if($.type==="normal"){if(g=u.done?k:T,$.arg===P)continue;return{value:$.arg,done:u.done}}$.type==="throw"&&(g=k,u.method="throw",u.arg=$.arg)}}}function K(d,s){var u=s.method,g=d.iterator[u];if(g===e)return s.delegate=null,u==="throw"&&d.iterator.return&&
vendor: 4,327 bytes, line 6
6(s.method="return",s.arg=e,K(d,s),s.method==="throw")||u!=="return"&&(s.method="throw",s.arg=new TypeError("The iterator does not provide a '"+u+"' method")),P;var w=E(g,d.iterator,s.arg);if(w.type==="throw")return s.method="throw",s.arg=w.arg,s.delegate=null,P;var c=w.arg;return c?c.done?(s[d.resultName]=c.value,s.next=d.nextLoc,s.method!=="return"&&(s.method="next",s.arg=e),s.delegate=null,P):c:(s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,P)}function W(d){var s={tryLoc:d[0]};1 in d&&(s.catchLoc=d[1]),2 in d&&(s.finallyLoc=d[2],s.afterLoc=d[3]),this.tryEntries.push(s)}function N(d){var s=d.completion||{};s.type="normal",delete s.arg,d.completion=s}function V(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(W,this),this.reset(!0)}function Z(d){if(d||d===""){var s=d[l];if(s)return s.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var u=-1,g=function w(){for(;++u<d.length;)if(n.call(d,u))return w.value=d[u],w.done=!1,w;return w.value=e,w.done=!0,w};return g.next=g}}throw new TypeError(oe(d)+" is not iterable")}return b.prototype=h,a(U,"constructor",{value:h,configurable:!0}),a(h,"constructor",{value:b,configurable:!0}),b.displayName=m(h,f,"GeneratorFunction"),t.isGeneratorFunction=function(d){var s=typeof d=="function"&&d.constructor;return!!s&&(s===b||(s.displayName||s.name)==="GeneratorFunction")},t.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,h):(d.__proto__=h,m(d,f,"GeneratorFunction")),d.prototype=Object.create(U),d},t.awrap=function(d){return{__await:d}},D(O.prototype),m(O.prototype,p,function(){return this}),t.AsyncIterator=O,t.async=function(d,s,u,g,w){w===void 0&&(w=Promise);var c=new O(v(d,s,u,g),w);return t.isGeneratorFunction(s)?c:c.next().then(function(S){return S.done?S.value:c.next()})},D(U),m(U,f,"Generator"),m(U,l,function(){return this}),m(U,"toString",function(){return"[object Generator]"}),t.keys=function(d){var s=Object(d),u=[];for(var g in s)u.push(g);return u.reverse(),function w(){for(;u.length;){var c=u.pop();if(c in s)return w.value=c,w.done=!1,w}return w.done=!0,w}},t.values=Z,V.prototype={constructor:V,reset:function(s){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!s)for(var u in this)u.charAt(0)==="t"&&n.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=e)},stop:function(){this.done=!0;var s=this.tryEntries[0].completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(s){if(this.done)throw s;var u=this;function g(z,I){return S.type="throw",S.arg=s,u.next=z,I&&(u.method="next",u.arg=e),!!I}for(var w=this.tryEntries.length-1;w>=0;--w){var c=this.tryEntries[w],S=c.completion;if(c.tryLoc==="root")return g("end");if(c.tryLoc<=this.prev){var L=n.call(c,"catchLoc"),$=n.call(c,"finallyLoc");if(L&&$){if(this.prev<c.catchLoc)return g(c.catchLoc,!0);if(this.prev<c.finallyLoc)return g(c.finallyLoc)}else if(L){if(this.prev<c.catchLoc)return g(c.catchLoc,!0)}else{if(!$)throw Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return g(c.finallyLoc)}}}},abrupt:function(s,u){for(var g=this.tryEntries.length-1;g>=0;--g){var w=this.tryEntries[g];if(w.tryLoc<=this.prev&&n.call(w,"finallyLoc")&&this.prev<w.finallyLoc){var c=w;break}}c&&(s==="break"||s==="continue")&&c.tryLoc<=u&&u<=c.finallyLoc&&(c=null);var S=c?c.completion:{};return S.type=s,S.arg=u,c?(this.method="next",this.next=c.finallyLoc,P):this.complete(S)},complete:function(s,u){if(s.type==="throw")throw s.arg;return s.type==="break"||s.type==="continue"?this.next=s.arg:s.type==="return"?(this.rval=this.arg=s.arg,this.method="return",this.next="end"):s.type==="normal"&&u&&(this.next=u),P},finish:function(s){for(var u=this.tryEntries.length-1;u>=0;--u){var g=this.tryEntries[u];if(g.finallyLoc===s)return this.complete(g.completion,g.afterLoc),N(g),P}},catch:function(s){for(var u=this.tryEntries.length-1;u>=0;--u){var g=this.tryEntries[u];if(g.tryLoc===s){var w=g.completion;if(w.type==="throw"){var c=w.arg;N(g)}return c}}throw Error("illegal catch attempt")},delegateYield:function(s,u,g){return this.delegate={iterator:Z(s),resultName:u,nextLoc:g},this.method==="next"&&(this.arg=e),P}},t}function pt(e,t,r,n,a,i,l){try{var p=e[i](l),f=p.value}catch(m){r(m);return}
6p.done?t(f):Promise.resolve(f).then(n,a)}function bn(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function l(f){pt(i,n,a,l,p,"next",f)}function p(f){pt(i,n,a,l,p,"throw",f)}l(void 0)})}}function Zt(e,t){return wn(e)||_n(e,t)||Qt(e,t)||xn()}function xn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,l,p=[],f=!0,m=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(p.push(n.value),p.length!==t);f=!0);}catch(v){m=!0,a=v}finally{try{if(!f&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw a}}return p}}function wn(e){if(Array.isArray(e))return e}function oe(e){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oe(e)}function jn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Qt(e))||t){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(m){throw m},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
8In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,l=!1,p;return{s:function(){r=r.call(e)},n:function(){var m=r.next();return i=m.done,m},e:function(m){l=!0,p=m},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(l)throw p}}}}function Qt(e,t){if(e){if(typeof e=="string")return ht(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ht(e,t)}}function ht(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mt(Object(r),!0).forEach(function(n){Sn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sn(e,t,r){return t=Jt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jt(n.key),n)}}function Pn(e,t,r){return t&&yt(e.prototype,t),r&&yt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jt(e){var t=kn(e,"string");return oe(t)=="symbol"?t:t+""}function kn(e,t){if(oe(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(oe(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ne="tus-v1",Pe="ietf-draft-03",pe="ietf-draft-05",Un={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:er,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Ne},Ee=(function(){function e(t,r){Nn(this,e),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return Pn(e,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![Ne,Pe,pe].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var a=this.options.retryDelays;if(a!=null&&Object.prototype.toString.call(a)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var i=0,l=["uploadUrl","uploadSize","uploadLengthDeferred"];i<l.length;i++){var p=l[i];if(this.options[p]){this._emitError(new Error("tus: cannot use the ".concat(p," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(f){return r._fingerprint=f,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(f){if(r._source=f,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(f){r._emitError(f)})}},{key:"_startParallelUpload",value:function(){var r,n=this,a=this._size,i=0;this._parallelUploads=[];var l=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,p=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:On(this._source.size,l);this._parallelUploadUrls&&p.forEach(function(v,E){v.uploadUrl=n._parallelUploadUrls[E]||null}),this._parallelUploadUrls=new Array(p.length);var f=p.map(function(v,E){var C=0;return n._source.slice(v.start,v.end).then(function(T){var y=T.value;return new Promise(function(k,P){var A=ie(ie({},n.options),{},{uploadUrl:v.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ie(ie({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:k,onError:P,onProgress:function(_){i=i-C+_,C=_,n._emitProgress(i,a)},onUploadUrlAvailable:function(){n._parallelUploadUrls[E]=b.url,n._parallelUploadUrls.filter(function(_){return!!_}).length===p.length&&n._saveUploadInUrlStorage()}}),b=new e(y,A);b.start(),n._parallelUploads.push(b)})})}),m;Promise.all(f).then(function(){m=n._openRequest("POST",n.options.endpoint),m.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var v=vt(n.options.metadata);return v!==""&&m.setHeader("Upload-Metadata",v),n._sendRequest(m,null)}).then(function(v){if(!se(v.getStatus(),200)){n._emitHttpError(m,v,"tus: unexpected response while creating upload");return}var E=v.getHeader("Location");
8if(E==null){n._emitHttpError(m,v,"tus: invalid or missing Location header");return}n.url=_t(n.options.endpoint,E),"Created upload at ".concat(n.url),n._emitSuccess(v)}).catch(function(v){n._emitError(v)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){"Resuming upload from previous URL: ".concat(this.url),this._resumeUpload();return}if(this.options.uploadUrl!=null){"Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var a=jn(this._parallelUploads),i;try{for(a.s();!(i=a.n()).done;){var l=i.value;l.abort(r)}}catch(p){a.e(p)}finally{a.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():e.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,a,i){this._emitError(new _e(a,i,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var a=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(a&&(this._retryAttempt=0),xt(r,this._retryAttempt,this.options)){var i=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},i);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,a){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,a)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var a=vt(this.options.metadata);a!==""&&n.setHeader("Upload-Metadata",a);var i;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,i=this._addChunkToRequest(n)):((this.options.protocol===Pe||this.options.protocol===pe)&&n.setHeader("Upload-Complete","?0"),i=this._sendRequest(n,null)),i.then(function(l){if(!se(l.getStatus(),200)){r._emitHttpError(n,l,"tus: unexpected response while creating upload");return}var p=l.getHeader("Location");if(p==null){r._emitHttpError(n,l,"tus: invalid or missing Location header");return}if(r.url=_t(r.options.endpoint,p),"Created upload at ".concat(r.url),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(l),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,l):(r._offset=0,r._performUpload())})}).catch(function(l){r._emitHttpError(n,null,"tus: failed to create upload",l)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),a=this._sendRequest(n,null);a.then(function(i){var l=i.getStatus();if(!se(l,200)){if(l===423){r._emitHttpError(n,i,"tus: upload is currently locked; retry later");return}if(se(l,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,i,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var p=Number.parseInt(i.getHeader("Upload-Offset"),10);if(Number.isNaN(p)){r._emitHttpError(n,i,"tus: invalid or missing offset value");return}var f=Number.parseInt(i.getHeader("Upload-Length"),10);if(Number.isNaN(f)&&!r.options.uploadLengthDeferred&&r.options.protocol===Ne){r._emitHttpError(n,i,"tus: invali
8d or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(p===f){r._emitProgress(f,f),r._emitSuccess(i);return}r._offset=p,r._performUpload()})}).catch(function(i){r._emitHttpError(n,null,"tus: failed to resume upload",i)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var a=this._addChunkToRequest(n);a.then(function(i){if(!se(i.getStatus(),200)){r._emitHttpError(n,i,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,i)}).catch(function(i){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),i)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,a=this._offset,i=this._offset+this.options.chunkSize;return r.setProgressHandler(function(l){n._emitProgress(a+l,n._size)}),this.options.protocol===Ne?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===pe&&r.setHeader("Content-Type","application/partial-upload"),(i===Number.POSITIVE_INFINITY||i>this._size)&&!this.options.uploadLengthDeferred&&(i=this._size),this._source.slice(a,i).then(function(l){var p=l.value,f=l.done,m=p!=null&&p.size?p.size:0;n.options.uploadLengthDeferred&&f&&(n._size=n._offset+m,r.setHeader("Upload-Length","".concat(n._size)));var v=n._offset+m;return!n.options.uploadLengthDeferred&&f&&v!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(v," bytes"))):p===null?n._sendRequest(r):((n.options.protocol===Pe||n.options.protocol===pe)&&r.setHeader("Upload-Complete",f?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,p))})}},{key:"_handleUploadResponse",value:function(r,n){var a=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(a,this._size),this._emitChunkComplete(a-this._offset,a,this._size),this._offset=a,a===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var a=gt(r,n,this.options);return this._req=a,a}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(a){r._urlStorageKey=a})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return bt(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=gt("DELETE",r,n);return bt(a,null,n).then(function(i){if(i.getStatus()!==204)throw new _e("tus: unexpected response while terminating upload",null,a,i)}).catch(function(i){if(i instanceof _e||(i=new _e("tus: failed to terminate upload",i,a,null)),!xt(i,0,n))throw i;var l=n.retryDelays[0],p=n.retryDelays.slice(1),f=ie(ie({},n),{},{retryDelays:p});return new Promise(function(m){return setTimeout(m,l)}).then(function(){return e.terminate(r,f)})})}}])})();function vt(e){return Object.entries(e).map(function(t){var r=Zt(t,2),n=r[0],a=r[1];return"".concat(n," ").concat(fn.encode(String(a)))}).join(",")}function se(e,t){return e>=t&&e<t+100}function gt(e,t,r){var n=r.httpStack.createRequest(e,t);r.protocol===Pe?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===pe?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var a=r.headers||{},i=0,l=Object.entries(a);i<l.length;
8i++){var p=Zt(l[i],2),f=p[0],m=p[1];n.setHeader(f,m)}if(r.addRequestId){var v=gn();n.setHeader("X-Request-ID",v)}return n}function bt(e,t,r){return Be.apply(this,arguments)}function Be(){return Be=bn(qe().mark(function e(t,r,n){var a;return qe().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(typeof n.onBeforeRequest!="function"){l.next=3;break}return l.next=3,n.onBeforeRequest(t);case 3:return l.next=5,t.send(r);case 5:if(a=l.sent,typeof n.onAfterResponse!="function"){l.next=9;break}return l.next=9,n.onAfterResponse(t,a);case 9:return l.abrupt("return",a);case 10:case"end":return l.stop()}},e)})),Be.apply(this,arguments)}function En(){var e=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(e=!1),e}function xt(e,t,r){return r.retryDelays==null||t>=r.retryDelays.length||e.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(e,t,r):er(e)}function er(e){var t=e.originalResponse?e.originalResponse.getStatus():0;return(!se(t,400)||t===409||t===423)&&En()}function _t(e,t){return new vn(t,e).toString()}function On(e,t){for(var r=Math.floor(e/t),n=[],a=0;a<t;a++)n.push({start:r*a,end:r*(a+1)});return n[t-1].end=e,n}Ee.defaultOptions=Un;var tr=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"};function Cn(e){return new Promise(function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var a=n.response;t(a)},n.onerror=function(a){r(a)},n.open("GET",e),n.send()})}var Rn=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")};function Ln(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){var a=new Uint8Array(n.result);t({value:a})},n.onerror=function(a){r(a)},n.readAsArrayBuffer(e)})}function ve(e){"@babel/helpers - typeof";return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(e)}function An(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$n(n.key),n)}}function Dn(e,t,r){return t&&Tn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $n(e){var t=In(e,"string");return ve(t)=="symbol"?t:t+""}function In(e,t){if(ve(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ve(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wt=(function(){function e(t){An(this,e),this._file=t,this.size=t.size}return Dn(e,[{key:"slice",value:function(r,n){if(Rn())return Ln(this._file.slice(r,n));var a=this._file.slice(r,n),i=n>=this.size;return Promise.resolve({value:a,done:i})}},{key:"close",value:function(){}}])})();function ge(e){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(e)}function Fn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zn(n.key),n)}}function Bn(e,t,r){return t&&qn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zn(e){var t=Mn(e,"string");return ge(t)=="symbol"?t:t+""}function Mn(e,t){if(ge(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ge(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function jt(e){return e===void 0?0:e.size!==void 0?e.size:e.length}function Hn(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}var Gn=(function(){function e(t){Fn(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=!1}return Bn(e,[{key:"slice",value:function(r,n){return r<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(r,n)}},{key:"_readUntilEnoughDataOrDone",value:function(r,n){var a=this,i=n<=this._bufferOffset+jt(this._buffer);if(this._done||i){var l=this._getDataFromBuffer(r,n),p=l==null?this._done:!1;return Promise.resolve({value:l,done:p})}return this._reader.read().then(function(f){var m=f.value,v=f.done;return v?a._done=!0:a._buffer===void 0?a._buffer=m:a._buffer=Hn(a._buffer,m),a._readUntilEnoughDataOrDone(r,n)})}},{key:"_getDataFromBuffer",value:function(r,n){r>this._bufferOffset&&(this._buffer=this._buffer.slice(r-this._bufferOffset),this._bufferOffset=r);var a=jt(this._buffer)===0;return this._done&&a?null:this._buffer.slice(0,n-r)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])})();function ae(e){"@babel/helpers - typeof";return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(e)}function ze(){ze=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(d,s,u){d[s]=u.value},i=typeof Symbol=="function"?Symbol:{},l=i.iterator||"@@iterator",p=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function m(d,s,u){return Object.defineProperty(d,s,{value:u,enumerable:!0,configurable:!0,writable:!0}),d[s]}try{m({},"")}catch{m=function(u,g,w){return u[g]=w}}function v(d,s,u,g){var w=s&&s.prototype instanceof A?s:A,c=Object.create(w.prototype),S=new V(g||[]);return a(c,"_invoke",{value:F(d,u,S)}),c}function E(d,s,u){try{return{type:"normal",arg:d.call(s,u)}}catch(g){return{type:"throw",arg:g}}}t.wrap=v;var C="suspendedStart",T="suspendedYield",y="executing",k="completed",P={};function A(){}function b(){}function h(){}var _={};m(_,l,function(){return this});var x=Object.getPrototypeOf,R=x&&x(x(Z([])));R&&R!==r&&n.call(R,l)&&(_=R);var U=h.prototype=A.prototype=Object.create(_);function D(d){["next","throw","return"].forEach(function(s){m(d,s,function(u){return this._invoke(s,u)})})}function O(d,s){function u(w,c,S,L){var $=E(d[w],d,c);if($.type!=="throw"){var z=$.arg,I=z.value;return I&&ae(I)=="object"&&n.call(I,"__await")?s.resolve(I.__await).then(function(M){u("next",M,S,L)},function(M){u("throw",M,S,L)}):s.resolve(I).then(function(M){z.value=M,S(z)},function(M){return u("throw",M,S,L)})}L($.arg)}var g;a(this,"_invoke",{value:function(c,S){function L(){return new s(function($,z){u(c,S,$,z)})}return g=g?g.then(L,L):L()}})}function F(d,s,u){var g=C;return function(w,c){if(g===y)throw Error("Generator is already running");if(g===k){if(w==="throw")throw c;return{value:e,done:!0}}for(u.method=w,u.arg=c;;){var S=u.delegate;if(S){var L=K(S,u);if(L){if(L===P)continue;return L}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(g===C)throw g=k,u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);g=y;var $=E(d,s,u);if($.type==="normal"){if(g=u.done?k:T,$.arg===P)continue;return{value:$.arg,done:u.done}}$.type==="throw"&&(g=k,u.method="throw",u.arg=$.arg)}}}function K(d,s){var u=s.method,g=d.iterator[u];if(g===e)return s.delegate=null,u==="throw"&&d.iterator.return&&
vendor: 4,327 bytes, line 8
8(s.method="return",s.arg=e,K(d,s),s.method==="throw")||u!=="return"&&(s.method="throw",s.arg=new TypeError("The iterator does not provide a '"+u+"' method")),P;var w=E(g,d.iterator,s.arg);if(w.type==="throw")return s.method="throw",s.arg=w.arg,s.delegate=null,P;var c=w.arg;return c?c.done?(s[d.resultName]=c.value,s.next=d.nextLoc,s.method!=="return"&&(s.method="next",s.arg=e),s.delegate=null,P):c:(s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,P)}function W(d){var s={tryLoc:d[0]};1 in d&&(s.catchLoc=d[1]),2 in d&&(s.finallyLoc=d[2],s.afterLoc=d[3]),this.tryEntries.push(s)}function N(d){var s=d.completion||{};s.type="normal",delete s.arg,d.completion=s}function V(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(W,this),this.reset(!0)}function Z(d){if(d||d===""){var s=d[l];if(s)return s.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var u=-1,g=function w(){for(;++u<d.length;)if(n.call(d,u))return w.value=d[u],w.done=!1,w;return w.value=e,w.done=!0,w};return g.next=g}}throw new TypeError(ae(d)+" is not iterable")}return b.prototype=h,a(U,"constructor",{value:h,configurable:!0}),a(h,"constructor",{value:b,configurable:!0}),b.displayName=m(h,f,"GeneratorFunction"),t.isGeneratorFunction=function(d){var s=typeof d=="function"&&d.constructor;return!!s&&(s===b||(s.displayName||s.name)==="GeneratorFunction")},t.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,h):(d.__proto__=h,m(d,f,"GeneratorFunction")),d.prototype=Object.create(U),d},t.awrap=function(d){return{__await:d}},D(O.prototype),m(O.prototype,p,function(){return this}),t.AsyncIterator=O,t.async=function(d,s,u,g,w){w===void 0&&(w=Promise);var c=new O(v(d,s,u,g),w);return t.isGeneratorFunction(s)?c:c.next().then(function(S){return S.done?S.value:c.next()})},D(U),m(U,f,"Generator"),m(U,l,function(){return this}),m(U,"toString",function(){return"[object Generator]"}),t.keys=function(d){var s=Object(d),u=[];for(var g in s)u.push(g);return u.reverse(),function w(){for(;u.length;){var c=u.pop();if(c in s)return w.value=c,w.done=!1,w}return w.done=!0,w}},t.values=Z,V.prototype={constructor:V,reset:function(s){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!s)for(var u in this)u.charAt(0)==="t"&&n.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=e)},stop:function(){this.done=!0;var s=this.tryEntries[0].completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(s){if(this.done)throw s;var u=this;function g(z,I){return S.type="throw",S.arg=s,u.next=z,I&&(u.method="next",u.arg=e),!!I}for(var w=this.tryEntries.length-1;w>=0;--w){var c=this.tryEntries[w],S=c.completion;if(c.tryLoc==="root")return g("end");if(c.tryLoc<=this.prev){var L=n.call(c,"catchLoc"),$=n.call(c,"finallyLoc");if(L&&$){if(this.prev<c.catchLoc)return g(c.catchLoc,!0);if(this.prev<c.finallyLoc)return g(c.finallyLoc)}else if(L){if(this.prev<c.catchLoc)return g(c.catchLoc,!0)}else{if(!$)throw Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return g(c.finallyLoc)}}}},abrupt:function(s,u){for(var g=this.tryEntries.length-1;g>=0;--g){var w=this.tryEntries[g];if(w.tryLoc<=this.prev&&n.call(w,"finallyLoc")&&this.prev<w.finallyLoc){var c=w;break}}c&&(s==="break"||s==="continue")&&c.tryLoc<=u&&u<=c.finallyLoc&&(c=null);var S=c?c.completion:{};return S.type=s,S.arg=u,c?(this.method="next",this.next=c.finallyLoc,P):this.complete(S)},complete:function(s,u){if(s.type==="throw")throw s.arg;return s.type==="break"||s.type==="continue"?this.next=s.arg:s.type==="return"?(this.rval=this.arg=s.arg,this.method="return",this.next="end"):s.type==="normal"&&u&&(this.next=u),P},finish:function(s){for(var u=this.tryEntries.length-1;u>=0;--u){var g=this.tryEntries[u];if(g.finallyLoc===s)return this.complete(g.completion,g.afterLoc),N(g),P}},catch:function(s){for(var u=this.tryEntries.length-1;u>=0;--u){var g=this.tryEntries[u];if(g.tryLoc===s){var w=g.completion;if(w.type==="throw"){var c=w.arg;N(g)}return c}}throw Error("illegal catch attempt")},delegateYield:function(s,u,g){return this.delegate={iterator:Z(s),resultName:u,nextLoc:g},this.method==="next"&&(this.arg=e),P}},t}function St(e,t,r,n,a,i,l){try{var p=e[i](l),f=p.value}catch(m){r(m);return}
8p.done?t(f):Promise.resolve(f).then(n,a)}function Vn(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function l(f){St(i,n,a,l,p,"next",f)}function p(f){St(i,n,a,l,p,"throw",f)}l(void 0)})}}function Kn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xn(n.key),n)}}function Wn(e,t,r){return t&&Yn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xn(e){var t=Zn(e,"string");return ae(t)=="symbol"?t:t+""}function Zn(e,t){if(ae(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ae(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qn=(function(){function e(){Kn(this,e)}return Wn(e,[{key:"openFile",value:(function(){var t=Vn(ze().mark(function n(a,i){var l;return ze().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(!(tr()&&a&&typeof a.uri<"u")){f.next=11;break}return f.prev=1,f.next=4,Cn(a.uri);case 4:return l=f.sent,f.abrupt("return",new wt(l));case 8:throw f.prev=8,f.t0=f.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(f.t0));case 11:if(!(typeof a.slice=="function"&&typeof a.size<"u")){f.next=13;break}return f.abrupt("return",Promise.resolve(new wt(a)));case 13:if(typeof a.read!="function"){f.next=18;break}if(i=Number(i),Number.isFinite(i)){f.next=17;break}return f.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return f.abrupt("return",Promise.resolve(new Gn(a,i)));case 18:return f.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return f.stop()}},n,null,[[1,8]])}));function r(n,a){return t.apply(this,arguments)}return r})()}])})();function Jn(e,t){return tr()?Promise.resolve(eo(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}function eo(e,t){var r=e.exif?to(JSON.stringify(e.exif)):"noexif";return["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}function to(e){var t=0;if(e.length===0)return t;for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);t=(t<<5)-t+n,t&=t}return t}function be(e){"@babel/helpers - typeof";return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},be(e)}function Ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ro(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,no(n.key),n)}}function Qe(e,t,r){return t&&ro(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function no(e){var t=oo(e,"string");return be(t)=="symbol"?t:t+""}function oo(e,t){if(be(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(be(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ao=(function(){function e(){Ze(this,e)}return Qe(e,[{key:"createRequest",value:function(r,n){return new io(r,n)}},{key:"getName",value:function(){return"XHRHttpStack"}}])})(),io=(function(){function e(t,r){Ze(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,!0),this._method=t,this._url=r,this._headers={}}return Qe(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._xhr.setRequestHeader(r,n),this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(n){n.lengthComputable&&r(n.loaded)})}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(a,i){r._xhr.onload=function(){a(new so(r._xhr))},r._xhr.onerror=function(l){i(l)},r._xhr.send(n)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})(),so=(function(){function e(t){Ze(this,e),this._xhr=t}return Qe(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(r){return this._xhr.getResponseHeader(r)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})();function xe(e){"@babel/helpers - typeof";return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(e)}function lo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fo(n.key),n)}}function co(e,t,r){return t&&uo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fo(e){var t=po(e,"string");return xe(t)=="symbol"?t:t+""}function po(e,t){if(xe(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xe(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Me=!1;try{Me="localStorage"in window;var Te="tusSupport",Nt=localStorage.getItem(Te);localStorage.setItem(Te,Nt),Nt===null&&localStorage.removeItem(Te)}catch(e){if(e.code===e.SECURITY_ERR||e.code===e.QUOTA_EXCEEDED_ERR)Me=!1;else throw e}var ho=Me,mo=(function(){function e(){lo(this,e)}return co(e,[{key:"findAllUploads",value:function(){var r=this._findEntries("tus::");return Promise.resolve(r)}},{key:"findUploadsByFingerprint",value:function(r){var n=this._findEntries("tus::".concat(r,"::"));return Promise.resolve(n)}},{key:"removeUpload",value:function(r){return localStorage.removeItem(r),Promise.resolve()}},{key:"addUpload",value:function(r,n){var a=Math.round(Math.random()*1e12),i="tus::".concat(r,"::").concat(a);return localStorage.setItem(i,JSON.stringify(n)),Promise.resolve(i)}},{key:"_findEntries",value:function(r){for(var n=[],a=0;a<localStorage.length;a++){var i=localStorage.key(a);if(i.indexOf(r)===0)try{var l=JSON.parse(localStorage.getItem(i));l.urlStorageKey=i,n.push(l)}catch{}}return n}}])})();function ce(e){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(e)}function yo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nr(n.key),n)}}function go(e,t,r){return r&&vo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function bo(e,t,r){return t=Oe(t),xo(e,rr()?Reflect.construct(t,r||[],Oe(e).constructor):t.apply(e,r))}function xo(e,t){if(t&&(ce(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _o(e)}function _o(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rr=function(){return!!e})()}function Oe(e){return Oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Oe(e)}function wo(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&He(e,t)}function He(e,t){return He=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},He(e,t)}function Pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
8t%2?Pt(Object(r),!0).forEach(function(n){jo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jo(e,t,r){return t=nr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nr(e){var t=So(e,"string");return ce(t)=="symbol"?t:t+""}function So(e,t){if(ce(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ce(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kt=le(le({},Ee.defaultOptions),{},{httpStack:new ao,fileReader:new Qn,urlStorage:ho?new mo:new en,fingerprint:Jn}),No=(function(e){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return yo(this,t),n=le(le({},kt),n),bo(this,t,[r,n])}return wo(t,e),go(t,null,[{key:"terminate",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=le(le({},kt),a),Ee.terminate(n,a)}}])})(Ee);const Po="https://selilqqwzyujykyugxfy.supabase.co";async function ko(e){const{data:t}=await B.auth.getSession(),r=t.session?.access_token;if(!r)throw new Error("Not signed in");await new Promise((n,a)=>{const i=new No(e.file,{endpoint:`${Po}/storage/v1/upload/resumable`,retryDelays:[0,1500,3e3,6e3,12e3],headers:{authorization:`Bearer ${r}`,"x-upsert":e.upsert?"true":"false"},uploadDataDuringCreation:!0,removeFingerprintOnSuccess:!0,chunkSize:6291456,metadata:{bucketName:e.bucket,objectName:e.path,contentType:e.file.type||"application/octet-stream",cacheControl:"3600"},onError:l=>a(l),onProgress:(l,p)=>{e.onProgress?.({bytesUploaded:l,bytesTotal:p,percent:p?Math.round(l/p*100):0})},onSuccess:()=>n()});i.findPreviousUploads().then(l=>{l.length&&i.resumeFromPreviousUpload(l[0]),i.start()})})}const Ce={NGN:3e7,USD:25e3,EUR:23e3,GBP:2e4},Uo=te({method:"POST"}).middleware([ne]).handler(re("198f84a14519ddfbcc27699f536fb9c58e2f3d518ec3c4815a956f1033c8d626")),Eo=te({method:"POST"}).middleware([ne]).handler(re("cae9c3d714c4a420046c07bd742835d822833c9572da901bb9c82d91f65bd2c2")),Oo=te({method:"POST"}).middleware([ne]).handler(re("1467bf5d531bc3eb90b26bbc9381832ed4f72f439de1b30bb9872056e7527fca")),Co=te({method:"POST"}).middleware([ne]).handler(re("dc1a325e913580ee975b94aebb3c665185374da9dbdd3142038c0b518f1d0525")),Ro=te({method:"POST"}).middleware([ne]).handler(re("bcb4d43434c266b29c51a8658ca555283dfcc0ed7b674f125255663c18ca4ae1")),Lo=te({method:"POST"}).middleware([ne]).handler(re("e897349509941a9c8e9719646f5cb735896e8dfcb41c597f9c320144ee24e103")),Ao=te({method:"POST"}).middleware([ne]).handler(re("c469795e1c6ea3e1d6f63b83adad70c65645b3764e72794fb70267f697414d72")),To={NGN:"en-NG",USD:"en-US",EUR:"en-IE",GBP:"en-GB"};function Y(e,t){const r=t==="NGN"?0:2;return new Intl.NumberFormat(To[t]??"en-US",{style:"currency",currency:t,maximumFractionDigits:r,minimumFractionDigits:r}).format(e/100)}function Je(e){return e==="NGN"?1:100}function ke(e){return(Ce[e]??0)/Je(e)}function Qo(){const e=lr(),[t,r]=j.useState(null),[n,a]=j.useState(null),[i,l]=j.useState(!1),[p,f]=j.useState(!0),[m,v]=j.useState(null),[E,C]=j.useState("projects");j.useEffect(()=>{(async()=>{const{data:y}=await B.auth.getUser();if(!y.user)return;r(y.user.email??null),a(y.user.id);const{data:k}=await B.from("user_roles").select("role").eq("user_id",y.user.id);l(!!k?.some(P=>P.role==="admin")),f(!1)})()},[]);async function T(){await B.auth.signOut(),e({to:"/auth",replace:!0})}return o.jsx("div",{className:"min-h-screen bg-background px-4 py-10",children:o.jsxs("div",{className:"mx-auto max-w-5xl space-y-8",children:[o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx(ur,{to:"/",className:"text-xs text-muted-foreground hover:text-foreground",children:"← Back to bablostudios.com"}),o.jsx("h1",{className:"mt-1 text-3xl font-serif tracking-tight",children:"Client portal"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in as ",t,i&&o.jsx("span",{className:"ml-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:"Admin"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[n&&o.jsx(Mo,{userId:n,userEmail:t??"",onOpenProject:v}),o.jsx(G,{variant:"outline",onClick:T,children:"Sign out"})]})]}),p&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),!p&&m&&n&&o.jsx(Io,{projectId:m,userId:n,userEmail:t??"",isAdmin:i,onBack:()=>v(null)}),!p&&!m&&o.jsxs(o.Fragment,{children:[i&&o.jsx("div",{className:"flex gap-2 border-b border-border",children:["projects","bookings"].map(y=>o.jsx("button",{onClick:()=>C(y),className:`px-4 py-2 text-sm capitalize border-b-2 -mb-px ${E===y?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:y},y))}),!i&&o.jsx(zo,{userEmail:t??""}),(!i||E==="projects")&&o.jsx(Do,{isAdmin:i,onSelect:v}),i&&E==="bookings"&&o.jsx(Bo,{})]})]})})}function Do({isAdmin:e,onSelect:t}){const[r,n]=j.useState(null),[a,i]=j.useState(!1),[l,p]=j.useState("all"),f=j.useCallback(async()=>{const{data:v}=await B.from("projects").select("*").order("created_at",{ascending:!1});n(v??[])},[]);j.useEffect(()=>{f()},[f]);const m=j.useMemo(()=>(r??[]).filter(v=>l==="all"||v.type===l),[r,l]);return o.jsxs("section",{className:"rounded-lg border border-border bg-card p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("h2",{className:"text-lg font-semibold",children:e?"All projects":"Your projects"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex rounded-md border border-border p-0.5 text-xs",children:["all","video","web"].map(v
8=>o.jsx("button",{onClick:()=>p(v),className:`px-2.5 py-1 capitalize rounded ${l===v?"bg-primary text-primary-foreground":"text-muted-foreground"}`,children:v},v))}),e&&o.jsx(G,{size:"sm",onClick:()=>i(v=>!v),children:a?"Close":"New project"})]})]}),e&&a&&o.jsx($o,{onCreated:()=>{i(!1),f()}}),r===null&&o.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Loading…"}),r?.length===0&&o.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:e?"No projects yet. Accept a booking or create one manually.":"No projects assigned yet. Once your deposit is confirmed, your project will appear here."}),o.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:m.map(v=>o.jsxs("button",{onClick:()=>t(v.id),className:"rounded-md border border-border bg-background p-4 text-left transition hover:border-primary",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("div",{className:"font-medium",children:v.title}),o.jsx("span",{className:"rounded-full border border-border px-2 py-0.5 text-[10px] uppercase",children:v.type})]}),o.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[v.status.replaceAll("_"," "),e&&v.client_email?` · ${v.client_email}`:""]}),o.jsx("div",{className:"mt-2 text-sm",children:Y(v.total_price_cents,v.currency)}),o.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px]",children:[o.jsx("span",{className:`rounded px-2 py-0.5 ${v.deposit_paid?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:v.deposit_paid?"Deposit paid":"Deposit pending"}),o.jsx("span",{className:`rounded px-2 py-0.5 ${v.balance_paid?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:v.balance_paid?"Balance paid":"Balance pending"}),!v.client_id&&o.jsx("span",{className:"rounded px-2 py-0.5 bg-amber-500/10 text-amber-600",children:"Client not signed up"})]})]},v.id))})]})}function $o({onCreated:e}){const t=ee(Uo),[r,n]=j.useState(""),[a,i]=j.useState(""),[l,p]=j.useState(""),[f,m]=j.useState("video"),[v,E]=j.useState("NGN"),[C,T]=j.useState(ke("NGN")),[y,k]=j.useState(50),[P,A]=j.useState(!1);j.useEffect(()=>{T(ke(v))},[v]);async function b(h){h.preventDefault(),A(!0);try{const _=Math.round(C*Je(v)),x=await t({data:{clientEmail:r,title:a,description:l||null,totalPriceCents:_,currency:v,type:f,depositPercent:y}});q.success(x.linked?"Project created and linked to client":"Project created — client will see it after they sign up with this email"),n(""),i(""),p(""),e()}catch(_){q.error(_ instanceof Error?_.message:"Failed")}finally{A(!1)}}return o.jsxs("form",{onSubmit:b,className:"mt-4 grid gap-3 rounded-md border border-border bg-background p-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[o.jsx(X,{children:"Client email"}),o.jsx(J,{type:"email",required:!0,value:r,onChange:h=>n(h.target.value)}),o.jsx("p",{className:"text-[11px] text-muted-foreground",children:"The project auto-links to the client the moment they sign up with this email."})]}),o.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[o.jsx(X,{children:"Project title"}),o.jsx(J,{required:!0,value:a,onChange:h=>i(h.target.value)})]}),o.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[o.jsx(X,{children:"Description"}),o.jsx(Ge,{value:l,onChange:h=>p(h.target.value),rows:2})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(X,{children:"Type"}),o.jsxs("select",{value:f,onChange:h=>m(h.target.value),className:"w-full h-10 rounded-md border border-input bg-background px-3 text-sm",children:[o.jsx("option",{value:"video",children:"Video"}),o.jsx("option",{value:"web",children:"Web"})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(X,{children:"Currency"}),o.jsx("select",{value:v,onChange:h=>E(h.target.value),className:"w-full h-10 rounded-md border border-input bg-background px-3 text-sm",children:Object.keys(Ce).map(h=>o.jsx("option",{value:h,children:h},h))})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs(X,{children:["Total price (min ",Y(Ce[v],v),")"]}),o.jsx(J,{type:"number",min:ke(v),step:v==="NGN"?1e4:10,value:C,onChange:h=>T(Number(h.target.value)),required:!0})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(X,{children:"Deposit %"}),o.jsx(J,{type:"number",min:1,max:100,value:y,onChange:h=>k(Number(h.target.value)),required:!0})]}),o.jsx("div",{className:"sm:col-span-2",children:o.jsx(G,{type:"submit",disabled:P,children:P?"Creating…":"Create project"})})]})}function Io({projectId:e,userId:t,userEmail:r,isAdmin:n,onBack:a}){const[i,l]=j.useState(null),[p,f]=j.useState([]),[m,v]=j.useState(null),[E,C]=j.useState(null),[T,y]=j.useState([]),[k,P]=j.useState({}),[A,b]=j.useState(""),[h,_]=j.useState(null),x=j.useRef(null),R=ee(Eo),U=ee(qr),D=ee(Ao),O=j.useMemo(()=>p.find(c=>c.id===m)??null,[p,m]),F=j.useCallback(async()=>{const{data:c}=await B.from("projects").select("*").eq("id",e).single();l(c);const{data:S}=await B.from("project_videos").select("*").eq("project_id",e).order("version",{ascending:!1}),L=S??[];f(L),v(I=>I??L[0]?.id??null);const{data:$}=await B.from("comments").select("*").eq("project_id",e).order("created_at",{ascending:!0});y($??[]);const z=[...new Set(($??[]).map(I=>I.author_id))];if(z.length){const{data:I}=await B.from("profiles").select("id, display_name, email").in("id",z),M={};for(const Re of I??[])M[Re.id]=Re.display_name||Re.email||"User";P(M)}},[e]);j.useEffect(()=>{F()},[F]),j.useEffect(()=>{if(!O||!O.storage_path){C(null);return}(async()=>{try{const{url:c}=await R({data:{path:O.storage_path}});C(c)}catch(c){q.error(c instanceof Error?c.message:"Could not load video")}})()},[O,R]);async function K(c){if(c.preventDefault(),!A.trim()||!m)return;const S=i?.type==="video"?h??x.current?.currentTime??null:null,{error:L}=await B.from("comments").insert({project_id:e,video_id:m,author_id:t,body:A.trim(),timestamp_seconds:S!==null?Math.floor(S):null});if(L){q.error(L.message);return}b(""),_(null),F()}async function W(c){try{const S=await U({data:{projectId:e,kind:c}});window.location.href=S.authorization_url}catch(S){q.error(S instanceof Error?S.message:"Payment failed")}}async function N(){if(!i?.balance_paid){q.error("Balance must be paid before downloading. Redirecting to checkout…"),await W("balance");return}E&&window.open(E,"_blank")}async function V(c){if(confirm(`Delete v${c.version}? This cannot be undone.`))try{await D({data:{versionId:c.id}}),q.success("Version deleted"),m===c.id&&v(null),F()}catch(S){q.error(S instanceof Error?S.message:"Delete failed")}}async function Z(c){const{error:S}=await B.from("comments").update({resolved:!c.resolved}).eq("id",c.id);if(S){q.error(S.message);return}F()}function d(c){x.current&&(x.current.currentTime=c,x.current.play().catch(()=>{}))}function s(c){if(c===null)return"general";const S=Math.floor(c/60),L=c%60;return`${S}:${L.toString().padStart(2,"0")}`}if(!i)return o.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading project…"});const u=Math.round(i.total_price_cents*i.deposit_percent/100),g=i.total_price_cents-u,w=i.deposit_paid||n;return o.jsxs("section",{className:"space-y-6",children:[o.jsx("div",{className:"flex items-center justify-between",children:o.jsxs(G,{variant:"ghost",size:"sm",onClick:a,children:[o.jsx(fr,{className:"mr-1 h-4 w-4"})," All projects"]})}),o.jsxs("div",{className:"rounded-lg border border-border bg-card p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-2xl font-serif",children:i.title}),o.jsx("span",{className:"rounded-full border border-border px-2 py-0.5 text-[10px] uppercase",children:i.type})]}),i.description&&o.jsx("p",{className:"mt-1 text-sm text-muted-foreground whitespace-pre-wrap",children:i.description}),n&&i.client_email&&o.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Client: ",i.client_email,!i.client_id&&" · not signed up yet"]})]}),o.jsxs("div",{className:"text-right text-sm",children:[o.jsx("div",{className:"font-semibold",children:Y(i.total_price_cents,i.currency)}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:["Deposit ",i.deposit_percent,"% · ",Y(u,i.currency)]})]})]}),!n&&o.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:i.deposit_paid?i.balance_paid?o.jsx("span",{className:"rounded-md bg-primary/10 px-3 py-2 text-sm text-primary",children:"Fully paid — thank you"}):o.jsxs(G,{onClick:()=>W("balance"),children:["Pay balance — ",Y(g,i.currency)]}):o.jsxs(G,{onClick:()=>W("deposit"),children:["Pay deposit — ",Y(u,i.currency)]})})]}),n&&i.type==="video"&&o.jsx(Fo,{projectId:e,onUploaded:F}),n&&i.type==="web"&&o.jsx(qo,{projectId:e,onAdded:F}),o.jsxs("div",{className:"rounded-lg border border-border bg-card p-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-lg font-semibold",children:i.type==="video"?"Video versions":"Preview links"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.length," version",p.length===1?"":"s"]})]}),p.length===0&&o.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:n?i.type==="video"?"Upload your first cut above.":"Add your first preview link above.":i.type==="video"?"Your video will appear here as soon as it's uploaded.":"Your preview link will appear here shortly."}),p.length>0&&o.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:p.map(c=>o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("button",{onClick:()=>v(c.id),className:`rounded-md border px-3 py-1 text-xs ${m===c.id?"border-primary bg-primary/10 text-primary":"border-border"}`,children:["v",c.version,c.label?` · ${c.label}`:""]}),n&&o.jsx("button",{onClick:()=>V(c),className:"text-muted-foreground hover:text-destructive","aria-label":`Delete v${c.version}`,children:o.jsx(kr,{className:"h-3 w-3"})})]},c.id))}),O&&!w&&o.jsxs("div",{className:"mt-6 rounded-md border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:[o.jsx(rt,{className:"mx-auto mb-2 h-5 w-5"}),"Access unlocks after your deposit clears."]}),O&&w&&o.jsxs("div",{className:"mt-6 space-y-4",children:[i.type==="video"&&E&&o.jsxs("div",{className:"relative overflow-hidden rounded-md bg-black",children:[o.jsx("video",{ref:x,src:E,controls:!0,controlsList:"nodownload noremoteplayback",disablePictureInPicture:!0,onContextMenu:c=>
8c.preventDefault(),playsInline:!0,className:"w-full"}),!i.balance_paid&&o.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-between p-4 text-center",children:[o.jsxs("span",{className:"rounded bg-black/40 px-2 py-1 text-[10px] uppercase tracking-widest text-white/80",children:["Bablo Studios · Preview · ",r]}),o.jsx("span",{className:"rounded bg-black/40 px-2 py-1 text-[10px] uppercase tracking-widest text-white/80",children:"Not for distribution"})]})]}),i.type==="web"&&O.preview_url&&o.jsxs("div",{className:"rounded-md border border-border bg-background p-4",children:[o.jsxs("a",{href:O.preview_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary underline break-all",children:[o.jsx(Ut,{className:"h-4 w-4"}),O.preview_url]}),O.note&&o.jsx("p",{className:"mt-2 whitespace-pre-wrap text-sm text-muted-foreground",children:O.note})]}),i.type==="video"&&o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(G,{variant:"outline",size:"sm",onClick:()=>_(x.current?.currentTime??0),children:[o.jsx(jr,{className:"mr-1 h-3 w-3"}),"Mark timestamp ",h!==null&&`(${s(Math.floor(h))})`]}),o.jsx(G,{variant:"outline",size:"sm",onClick:N,children:i.balance_paid?o.jsxs(o.Fragment,{children:[o.jsx(xr,{className:"mr-1 h-3 w-3"})," Download"]}):o.jsxs(o.Fragment,{children:[o.jsx(rt,{className:"mr-1 h-3 w-3"})," Download (pay balance first)"]})})]}),o.jsxs("form",{onSubmit:K,className:"space-y-2 rounded-md border border-border bg-background p-3",children:[o.jsx(Ge,{placeholder:i.type==="video"&&h!==null?`Comment at ${s(Math.floor(h))}…`:i.type==="video"?"Add a comment (or mark a timestamp first)…":"Add feedback on this preview…",value:A,onChange:c=>b(c.target.value),rows:2}),o.jsx("div",{className:"flex justify-end",children:o.jsx(G,{type:"submit",size:"sm",children:"Post comment"})})]}),o.jsxs("div",{className:"space-y-2",children:[T.filter(c=>c.video_id===m).sort((c,S)=>(c.timestamp_seconds??-1)-(S.timestamp_seconds??-1)).map(c=>{const S=n||c.author_id===t;return o.jsxs("div",{className:`rounded-md border p-3 text-sm ${c.resolved?"border-emerald-500/30 bg-emerald-500/5":"border-border bg-background"}`,children:[o.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[o.jsxs("span",{children:[o.jsx("strong",{className:"text-foreground",children:k[c.author_id]??"User"}),i.type==="video"&&" · ",i.type==="video"&&(c.timestamp_seconds!==null?o.jsx("button",{className:"text-primary underline",onClick:()=>d(c.timestamp_seconds),children:s(c.timestamp_seconds)}):"general")]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{children:new Date(c.created_at).toLocaleString()}),S&&o.jsxs("button",{onClick:()=>Z(c),className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] ${c.resolved?"text-emerald-600 hover:bg-emerald-500/10":"text-muted-foreground hover:bg-muted"}`,title:c.resolved?"Mark unresolved":"Mark resolved",children:[c.resolved?o.jsx(yr,{className:"h-3 w-3"}):o.jsx(gr,{className:"h-3 w-3"}),c.resolved?"Resolved":"Resolve"]})]})]}),o.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:c.body})]},c.id)}),T.filter(c=>c.video_id===m).length===0&&o.jsx("p",{className:"text-xs text-muted-foreground",children:"No comments on this version yet."})]})]})]})]})}function Fo({projectId:e,onUploaded:t}){const[r,n]=j.useState(null),[a,i]=j.useState(""),[l,p]=j.useState(!1),[f,m]=j.useState(0);async function v(E){if(E.preventDefault(),!!r){p(!0),m(0);try{const{data:C}=await B.from("project_videos").select("version").eq("project_id",e).order("version",{ascending:!1}).limit(1),T=(C?.[0]?.version??0)+1,y=(r.name.split(".").pop()??"mp4").toLowerCase(),k=`${e}/v${T}-${Date.now()}.${y}`;await ko({bucket:"client-videos",path:k,file:r,onProgress:A=>m(A.percent)});const{error:P}=await B.from("project_videos").insert({project_id:e,storage_path:k,version:T,label:a||null,kind:"preview"});if(P)throw P;q.success(`Uploaded version ${T}`),n(null),i(""),m(0),t()}catch(C){const T=C instanceof Error?C.message:"Upload failed";console.error("[video upload]",C),q.error(T)}finally{p(!1)}}}return o.jsxs("form",{onSubmit:v,className:"rounded-lg border border-border bg-card p-6",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Er,{className:"h-4 w-4"}),o.jsx("h3",{className:"text-lg font-semibold",children:"Upload new cut"})]}),o.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-[1fr_auto_auto]",children:[o.jsx(J,{type:"file",accept:"video/*",onChange:E=>n(E.target.files?.[0]??null),required:!0,disabled:l}),o.jsx(J,{placeholder:"Label (optional)",value:a,onChange:E=>i(E.target.value),disabled:l}),o.jsx(G,{type:"submit",disabled:l||!r,children:l?`Uploading ${f}%`:"Upload"})]}),l&&o.jsxs("div",{className:"mt-3",children:[o.jsx($t,{value:f}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Large files upload in resumable chunks. Keep this tab open."})]}),o.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Every upload becomes a new version. Clients see the newest one first and can comment with timestamps."})]})}function qo({projectId:e,onAdded:t}){const r=ee(Lo),[n,a]=j.useState(""),[i,l]=j.useState(""),[p,f]=j.useState(""),[m,v]=j.useState(!1);async function E(C){C.preventDefault(),v(!0);try{const T=await r({data:{projectId:e,previewUrl:n,label:i||void 0,note:p||void 0}});q.success(`Added version ${T.version}`),a(""),l(""),f(""),t()}catch(T){q.error(T instanceof Error?T.message:"Failed")}finally{v(!1)}}return o.jsxs("form",{onSubmit:E,className:"rounded-lg border border-border bg-card p-6",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ut,{className:"h-4 w-4"}),o.jsx("h3",{className:"text-lg font-semibold",children:"Add preview link"})]}),o.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[o.jsx(X,{children:"Preview URL"}),o.jsx(J,{type:"url",required:!0,placeholder:"https://preview.example.com/v2",value:n,onChange:C=>a(C.target.value)})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(X,{children:"Label (optional)"}),o.jsx(J,{placeholder:"e.g. Homepage revision",value:i,onChange:C=>l(C.target.value)})]}),o.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[o.jsx(X,{children:"Notes (optional)"}),o.jsx(Ge,{rows:2,value:p,onChange:C=>f(C.target.value)})]}),o.jsx("div",{className:"sm:col-span-2",children:o.jsx(G,{type:"submit",disabled:m||!n,children:m?"Adding…":"Add version"})})]})]})}function Bo(){const[e,t]=j.useState(null),[r,n]=j.useState("open"),[a,i]=j.useState("all"),l=ee(Oo),p=ee(Co),f=ee(Ro),m=j.useCallback(async()=>{const{data:y}=await B.from("bookings").select("*").order("created_at",{ascending:!1});t(y??[])},[]);j.useEffect(()=>{m()},[m]);const v=j.useMemo(()=>(e??[]).filter(y=>a!=="all"&&y.preferred_type!==a?!1:r==="all"?!0:r==="open"?y.status==="new"||y.status==="contacted"||y.status==="price_updated":y.status===r),[e,r,a]);async function E(y){try{await l({data:{bookingId:y.id}}),q.success("Booking accepted — project created"),m()}catch(k){q.error(k instanceof Error?k.message:"Failed")}}async function C(y){const k=prompt("Optional decline note (visible to admin only):")??void 0;try{await p({data:{bookingId:y.id,reason:k}}),q.success("Booking declined"),m()}catch(P){q.error(P instanceof Error?P.message:"Failed")}}async function T(y){const k=y.currency??"NGN",P=ke(k),A=prompt(`New total in ${k} (min ${Y(Ce[k],k)}):`,String(P));if(!A)return;const b=Number(A);
8if(!Number.isFinite(b)||b<=0){q.error("Enter a valid number");return}try{await f({data:{bookingId:y.id,newPriceCents:Math.round(b*Je(k))}}),q.success("Price updated"),m()}catch(h){q.error(h instanceof Error?h.message:"Failed")}}return o.jsxs("section",{className:"rounded-lg border border-border bg-card p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("h2",{className:"text-lg font-semibold",children:"Bookings"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("div",{className:"flex rounded-md border border-border p-0.5 text-xs",children:["all","video","web"].map(y=>o.jsx("button",{onClick:()=>i(y),className:`px-2.5 py-1 capitalize rounded ${a===y?"bg-primary text-primary-foreground":"text-muted-foreground"}`,children:y},y))}),o.jsxs("select",{value:r,onChange:y=>n(y.target.value),className:"h-8 rounded-md border border-input bg-background px-2 text-xs",children:[o.jsx("option",{value:"open",children:"Open"}),o.jsx("option",{value:"all",children:"All"}),o.jsx("option",{value:"new",children:"New"}),o.jsx("option",{value:"contacted",children:"Contacted"}),o.jsx("option",{value:"price_updated",children:"Price updated"}),o.jsx("option",{value:"accepted",children:"Accepted"}),o.jsx("option",{value:"converted",children:"Converted"}),o.jsx("option",{value:"declined",children:"Declined"})]}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[v.length," shown"]})]})]}),e===null&&o.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Loading…"}),v.length===0&&e!==null&&o.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Nothing here."}),o.jsx("div",{className:"mt-4 space-y-4",children:v.map(y=>{const k=y.status==="converted"||y.status==="declined",P=y.currency??"NGN";return o.jsxs("div",{className:"rounded-md border border-border bg-background p-4",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"font-medium",children:[y.client_name," ",o.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",y.preferred_type??y.project_type]})]}),o.jsx("a",{href:`mailto:${y.client_email}`,className:"text-sm text-primary underline",children:y.client_email}),y.client_phone&&o.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:["· ",y.client_phone]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(or,{status:y.status}),o.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(y.created_at).toLocaleString()})]})]}),y.title&&o.jsx("p",{className:"mt-2 text-sm font-medium",children:y.title}),o.jsx("p",{className:"mt-2 whitespace-pre-wrap text-sm",children:y.brief}),o.jsxs("div",{className:"mt-3 grid gap-1 text-xs text-muted-foreground sm:grid-cols-2",children:[y.reference_links&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Refs:"})," ",y.reference_links]}),y.budget_reference&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Budget hint:"})," ",y.budget_reference]}),y.original_price_cents!==null&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Original quote:"})," ",Y(y.original_price_cents,P)]}),y.updated_price_cents!==null&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"New quote:"})," ",Y(y.updated_price_cents,P)]}),y.admin_notes&&o.jsxs("div",{className:"sm:col-span-2",children:[o.jsx("span",{className:"font-medium",children:"Notes:"})," ",y.admin_notes]})]}),!k&&o.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[o.jsxs(G,{size:"sm",onClick:()=>E(y),children:[o.jsx(Et,{className:"mr-1 h-3 w-3"})," Accept & create project"]}),o.jsxs(G,{size:"sm",variant:"outline",onClick:()=>T(y),children:[o.jsx(Nr,{className:"mr-1 h-3 w-3"})," Change price"]}),o.jsxs(G,{size:"sm",variant:"outline",onClick:()=>C(y),children:[o.jsx(Ot,{className:"mr-1 h-3 w-3"})," Decline"]})]})]},y.id)})})]})}function or({status:e}){const t={new:"bg-blue-500/10 text-blue-600 border-blue-500/20",contacted:"bg-slate-500/10 text-slate-600 border-slate-500/20",price_updated:"bg-amber-500/10 text-amber-600 border-amber-500/20",accepted:"bg-emerald-500/10 text-emerald-600 border-emerald-500/20",converted:"bg-primary/10 text-primary border-primary/20",declined:"bg-destructive/10 text-destructive border-destructive/20"};return o.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wide ${t[e]}`,children:e.replace("_"," ")})}function zo({userEmail:e}){const[t,r]=j.useState(null),n=j.useCallback(async()=>{const{data:l}=await B.from("bookings").select("*").order("created_at",{ascending:!1});r(l??[])},[]);j.useEffect(()=>{n()},[n]);async function a(l,p){const{error:f}=await B.from("bookings").update({status:p}).eq("id",l.id);if(f){q.error(f.message);return}q.success(p==="accepted"?"Quote accepted — we'll set up your project shortly":"Quote declined"),n()}const i=(t??[]).filter(l=>l.status==="price_updated"||l.status==="new"||l.status==="contacted");return t===null||t.length===0?null:o.jsxs("section",{className:"rounded-lg border border-border bg-card p-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-lg font-semibold",children:"Your booking requests"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[i.length," awaiting your action"]})]}),o.jsx("div",{className:"mt-4 space-y-3",children:t.map(l=>{const p=l.currency??"NGN",f=l.status==="price_updated";return o.jsxs("div",{className:"rounded-md border border-border bg-background p-4",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"text-sm font-medium",children:[l.title||l.brief.slice(0,80),o.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["· ",l.preferred_type??l.project_type]})]}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Submitted ",new Date(l.created_at).toLocaleDateString()," · ",e]})]}),o.jsx(or,{status:l.status})]}),o.jsxs("div",{className:"mt-2 grid gap-1 text-xs text-muted-foreground sm:grid-cols-2",children:[l.original_price_cents!==null&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Original quote:"})," ",Y(l.original_price_cents,p)]}),l.updated_price_cents!==null&&o.jsxs("div",{className:"text-foreground",children:[o.jsx("span",{className:"font-medium",children:"Updated quote:"})," ",Y(l.updated_price_cents,p)]})]}),f&&o.jsxs("div",{className:"mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 p-3 text-sm",children:[o.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"We've sent you an updated quote. Accept to move forward, or decline to end the request."}),o.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[o.jsxs(G,{size:"sm",onClick:()=>
8a(l,"accepted"),children:[o.jsx(Et,{className:"mr-1 h-3 w-3"})," Accept quote"]}),o.jsxs(G,{size:"sm",variant:"outline",onClick:()=>a(l,"declined"),children:[o.jsx(Ot,{className:"mr-1 h-3 w-3"})," Decline"]})]})]}),l.status==="converted"&&o.jsx("p",{className:"mt-2 text-xs text-primary",children:'Project created — look for it in "Your projects" below.'})]},l.id)})})]})}function Mo({userId:e,userEmail:t,onOpenProject:r}){const[n,a]=j.useState(!1),[i,l]=j.useState([]),[p,f]=j.useState(!1),m=j.useCallback(async()=>{f(!0);const{data:y}=await B.from("notifications").select("id, kind, subject, payload, read_at, created_at, related_project_id, related_booking_id").order("created_at",{ascending:!1}).limit(30);l(y??[]),f(!1)},[]);j.useEffect(()=>{m();const y=t.toLowerCase(),k=B.channel(`notifications-${e}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"notifications"},A=>{const b=A.new;(b.recipient_user_id===e||b.recipient_email?.toLowerCase()===y)&&l(h=>[b,...h].slice(0,30))}).subscribe(),P=setInterval(m,6e4);return()=>{clearInterval(P),B.removeChannel(k)}},[m,e,t]);const v=i.filter(y=>!y.read_at).length;async function E(){const y=i.filter(P=>!P.read_at).map(P=>P.id);if(y.length===0)return;const k=new Date().toISOString();l(P=>P.map(A=>y.includes(A.id)?{...A,read_at:k}:A)),await B.from("notifications").update({read_at:k}).in("id",y)}async function C(y){if(!y.read_at){const k=new Date().toISOString();l(P=>P.map(A=>A.id===y.id?{...A,read_at:k}:A)),await B.from("notifications").update({read_at:k}).eq("id",y.id)}y.related_project_id&&(r(y.related_project_id),a(!1))}function T(y){const k=Date.now()-new Date(y).getTime(),P=Math.floor(k/6e4);if(P<1)return"just now";if(P<60)return`${P}m ago`;const A=Math.floor(P/60);return A<24?`${A}h ago`:`${Math.floor(A/24)}d ago`}return o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>a(y=>!y),className:"relative inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-foreground hover:bg-accent","aria-label":"Notifications",children:[o.jsx(hr,{className:"h-4 w-4"}),v>0&&o.jsx("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] rounded-full bg-primary text-primary-foreground text-[10px] font-medium leading-[18px] px-1 text-center",children:v>9?"9+":v})]}),n&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),o.jsxs("div",{className:"absolute right-0 mt-2 z-50 w-[360px] max-w-[calc(100vw-2rem)] rounded-lg border border-border bg-popover shadow-lg",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[o.jsx("div",{className:"text-sm font-semibold",children:"Notifications"}),v>0&&o.jsx("button",{onClick:E,className:"text-xs text-muted-foreground hover:text-foreground underline",children:"Mark all read"})]}),o.jsxs("div",{className:"max-h-96 overflow-y-auto",children:[p&&o.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:"Loading…"}),!p&&i.length===0&&o.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:"You're all caught up."}),i.map(y=>o.jsxs("button",{onClick:()=>C(y),className:`block w-full text-left border-b border-border/60 px-3 py-2.5 last:border-b-0 hover:bg-accent/50 ${y.read_at?"":"bg-primary/5"}`,children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("div",{className:"text-sm font-medium leading-snug",children:y.subject}),!y.read_at&&o.jsx("span",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-primary"})]}),o.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:T(y.created_at)})]},y.id))]})]})]})]})}export{Qo as component};

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