phanpy-cz/assets/compose-hDlR2o-x.js

27 lines
81 KiB
JavaScript
Raw Permalink Normal View History

2024-10-08 17:16:36 +00:00
var Rt=s=>{throw TypeError(s)};var mt=(s,t,n)=>t.has(s)||Rt("Cannot "+n);var I=(s,t,n)=>(mt(s,t,"read from private field"),n?n.call(s):t.get(s)),re=(s,t,n)=>t.has(s)?Rt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),me=(s,t,n,a)=>(mt(s,t,"write to private field"),a?a.call(s,n):t.set(s,n),n),X=(s,t,n)=>(mt(s,t,"access private method"),n);import{i as ge,z as gn,s as oe,V as fn,j as Ke,a as _t,h as U,A as Y,M as vn,aC as Xt,d as Se,y as ne,x as bn,aD as yn,l as je,c as e,T as V,b as xn,f as Oe,w as at,r as wn,af as kn,P as En,u as Fn,t as Dt,C as Jt}from"./useTitle-6AJYXxJy.js";import{j as Ee,F as Cn,_ as zn,a as $e,a8 as _n,x as $t,u as Ln,k as Qt,b as An,I as J,z as jt,i as Je,a9 as Sn,l as xt,M as Qe,s as Ce,a4 as In,a0 as Mn,q as Tn,O as Bn,X as rt,c as Rn,d as Ot,y as Dn}from"./fuse-uYeGZ3ik.js";class $n{constructor(t,n,{tabInsertsSuggestions:a,defaultFirstOption:c}={}){this.input=t,this.list=n,this.tabInsertsSuggestions=a??!0,this.defaultFirstOption=c??!1,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=o=>jn(o,this),this.compositionEventHandler=o=>Pn(o,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",n.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Pt),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Pt)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(gt)[0])===null||t===void 0||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const n=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(gt)[0],a=Array.from(this.list.querySelectorAll('[role="option"]')).filter(gt),c=a.indexOf(n);if(c===a.length-1&&t===1||c===0&&t===-1){this.clearSelection(),this.input.focus();return}let o=t===1?0:a.length-1;if(n&&c>=0){const x=c+t;x>=0&&x<a.length&&(o=x)}const l=a[o];if(l)for(const x of a)x.removeAttribute("data-combobox-option-default"),l===x?(this.input.setAttribute("aria-activedescendant",l.id),l.setAttribute("aria-selected","true"),Hn(this.list,l)):x.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function jn(s,t){if(!(s.shiftKey||s.metaKey||s.altKey)&&!(!t.ctrlBindings&&s.ctrlKey)&&!t.isComposing)switch(s.key){case"Enter":Ht(t.input,t.list)&&s.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&Ht(t.input,t.list)&&s.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),s.preventDefault();break;case"ArrowUp":t.navigate(-1),s.preventDefault();break;case"n":t.ctrlBindings&&s.ctrlKey&&(t.navigate(1),s.preventDefault());break;case"p":t.ctrlBindings&&s.ctrlKey&&(t.navigate(
`,n-1)>l||s.lastIndexOf(".",n-1)>l)return}else if(s.lastIndexOf(" ",n-1)>l)return;const x=s[l-1];return x&&!qn.test(x)?void 0:{text:s.substring(l+t.length,n),position:l+t.length}}class Wn extends HTMLElement{}class Un extends Event{constructor(){super("update")}}const ft=new WeakMap;var Pe,He,Ne,xe,G,wt,Ae,Ie,Me,kt,Te,et,tt,nt,qe,ze;const At=class At extends Wn{constructor(){super(...arguments);re(this,G);re(this,Pe,new MutationObserver(()=>X(this,G,tt).call(this)));re(this,He,new ResizeObserver(()=>X(this,G,et).call(this)));re(this,Ne);re(this,xe);re(this,Ie,0);re(this,Me,0);re(this,Te,!1);re(this,qe,()=>X(this,G,nt).call(this));re(this,ze,n=>{X(this,G,Ae).call(this,a=>{(n.target===document||n.target===window||n.target instanceof Node&&n.target.contains(a))&&X(this,G,et).call(this)})})}static for(n){let a=ft.get(n);return a||(a=new At,a.connect(n),ft.set(n,a)),a}connect(n){me(this,Ne,new WeakRef(n)),me(this,xe,document.createElement("div")),I(this,xe).style.position="absolute",I(this,xe).style.pointerEvents="none",n.after(I(this,xe)),I(this,xe).appendChild(this)}forceUpdate(){X(this,G,tt).call(this),X(this,G,nt).call(this)}connectedCallback(){X(this,G,Ae).call(this,n=>{this.style.pointerEvents="none",this.style.userSelect="none",this.style.overflow="hidden",this.style.display="block",this.style.visibility="hidden",n instanceof HTMLTextAreaElement?(this.style.whiteSpace="pre-wrap",this.style.wordWrap="break-word"):(this.style.whiteSpace="nowrap",this.style.display="table-cell",this.style.verticalAlign="middle"),this.setAttribute("aria-hidden","true"),X(this,G,tt).call(this),X(this,G,nt).call(this),I(this,Pe).observe(n,{attributeFilter:["style","dir"]}),I(this,He).observe(n),document.addEventListener("scroll",I(this,ze),{capture:!0}),window.addEventListener("resize",I(this,ze),{capture:!0}),n.addEventListener("input",I(this,qe),{capture:!0})})}disconnectedCallback(){var a;(a=I(this,xe))==null||a.remove(),I(this,Pe).disconnect(),I(this,He).disconnect(),document.removeEventListener("scroll",I(this,ze),{capture:!0}),window.removeEventListener("resize",I(this,ze),{capture:!0});const n=I(this,G,wt);n&&(n.removeEventListener("input",I(this,qe),{capture:!0}),ft.delete(n))}};Pe=new WeakMap,He=new WeakMap,Ne=new WeakMap,xe=new WeakMap,G=new WeakSet,wt=function(){var n;return(n=I(this,Ne))==null?void 0:n.deref()},Ae=function(n){const a=I(this,G,wt);return a?n(a):this.remove()},Ie=new WeakMap,Me=new WeakMap,kt=function(){X(this,G,Ae).call(this,n=>{const a=window.getComputedStyle(n);this.style.height=a.height,this.style.width=a.width,n.clientHeight!==this.clientHeight&&(this.style.height=`calc(${a.height} + ${n.clientHeight-this.clientHeight}px)`),n.clientWidth!==this.clientWidth&&(this.style.width=`calc(${a.width} + ${n.clientWidth-this.clientWidth}px)`);const c=n.getBoundingClientRect(),o=this.getBoundingClientRect();me(this,Ie,I(this,Ie)+c.left-o.left),me(this,Me,I(this,Me)+c.top-o.top),this.style.transform=`translate(${I(this,Ie)}px, ${I(this,Me)}px)`,this.scrollTop=n.scrollTop,this.scrollLeft=n.scrollLeft,this.dispatchEvent(new Un)})},Te=new WeakMap,et=function(){I(this,Te)||(me(this,Te,!0),requestAnimationFrame(()=>{X(this,G,kt).call(this),me(this,Te,!1)}))},tt=function(){X(this,G,Ae).call(this,n=>{const a=window.getComputedStyle(n);for(const c of Vn)this.style[c]=a[c];X(this,G,et).call(this)})},nt=function(){X(this,G,Ae).call(this,n=>{this.textContent=n.value,X(this,G,kt).call(this)})},qe=new WeakMap,ze=new WeakMap;let it=At;const Vn=["direction","writingMode","unicodeBidi","textOrientation","boxSizing","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];try{customElements.define("input-style-clone",it)}catch(s){if(!(s instanceof DOMException&&s.name==="NotSupportedError"))throw s}var be,Be,Re,le,Ft,en,Ct,De;const st=c
`)&&(D.current.selectionStart=0,D.current.selectionEnd=0),(y=D.current)==null||y.focus())},300)};ne(()=>{var r,u;if(t){const{spoilerText:y,visibility:h,language:A,sensitive:C}=t;y&&W.current&&(W.current.value=y);const v=[...new Set([t.account.acct,...t.mentions.map(_=>_.acct)])].filter(_=>_!==B.acct);v.length>0&&(D.current.value=`${v.map(_=>`@${_}`).join(" ")} `,de()),pe(),te(h==="public"&&N["posting:default:visibility"]?N["posting:default:visibility"].toLowerCase():h),se(A||((r=N["posting:default:language"])==null?void 0:r.toLowerCase())||Fe),ue(C&&!!y)}else if(n){const{visibility:y,language:h,sensitive:A,poll:C,mediaAttachments:R}=n,v=!!(C!=null&&C.options)&&{...C,options:C.options.map(_=>(_==null?void 0:_.title)||_),expiresIn:(C==null?void 0:C.expiresIn)||Vt(C.expiresAt)};b("loading"),(async()=>{var _;try{const q=await E.v1.statuses.$select(n.id).source.fetch(),{text:he,spoilerText:ve}=q;D.current.value=he,D.current.dataset.source=he,de(),pe(),W.current.value=ve,te(y),se(h||((_=N["posting:default:language"])==null?void 0:_.toLowerCase())||Fe),ue(A),v&&ee(v),S(R),b("default")}catch(q){alert((q==null?void 0:q.reason)||q),b("error")}})()}else pe(),N["posting:default:visibility"]&&te(N["posting:default:visibility"].toLowerCase()),N["posting:default:language"]&&se(N["posting:default:language"].toLowerCase()),N["posting:default:sensitive"]&&ue(!!N["posting:default:sensitive"]);if(a){const{status:y,spoilerText:h,visibility:A,language:C,sensitive:R,poll:v,mediaAttachments:_}=a,q=!!(v!=null&&v.options)&&{...v,options:v.options.map(he=>(he==null?void 0:he.title)||he),expiresIn:(v==null?void 0:v.expiresIn)||Vt(v.expiresAt)};D.current.value=y,de(),pe(),h&&(W.current.value=h),A&&te(A),se(C||((u=N["posting:default:language"])==null?void 0:u.toLowerCase())||Fe),R!==null&&ue(R),q&&ee(q),_&&S(_)}},[a,n,t]);const _e=Y(),Le=l._({id:"hR9gtK"}),ot=()=>{const{value:r,dataset:u}=D.current;if(F==="loading")return!1;const y=(r||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),h=g.length>0;if(!y&&!h||g.length>0&&g.every(_=>_.id))return!0;const C=(t==null?void 0:t.account.id)===B.id,R=t&&r.trim()===`@${t.account.acct}`;return!!(!C&&R||r===(u==null?void 0:u.source))},We=()=>ot()?!0:confirm(Le);ne(()=>{const r=u=>{ot()||(u.preventDefault(),u.returnValue=Le)};return window.addEventListener("beforeunload",r,{capture:!0}),()=>window.removeEventListener("beforeunload",r,{capture:!0})},[]);const rn=()=>{const{value:r}=D.current,{value:u}=W.current;return qt(ui(r))+qt(u)},lt=()=>{const r=rn();oe.composerCharacterCount=r};ne(lt,[]);const St=window.CloseWatcher,ct=Y(!1);$e("esc",()=>{ct.current=!0},{enabled:!St,enableOnFormTags:!0}),$e("esc",()=>{!c&&ct.current&&We()&&s(),ct.current=!1},{enabled:!St,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:r=>{const u=document.querySelectorAll("#modal-container > *"),y=!!u,h=u.length===1&&u[0].querySelector("#compose-container");return y&&!h}}),_n(()=>{!c&&We()&&s()},[c,We,s]);const It=Y({}),Mt=()=>`${bn()}#${T.current}`,ut=()=>{if(n||oe.composerState.minimized)return;const r=Mt(),u={key:r,replyTo:t?{id:t.id,account:{id:t.account.id,username:t.account.username,acct:t.account.acct}}:null,draftStatus:{uid:T.current,status:D.current.value,spoilerText:W.current.value,visibility:H,language:P,sensitive:Z,poll:z,mediaAttachments:g}};!yn(u,It.current)&&!ot()&&($t.drafts.set(r,{...u,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(y=>{}),It.current=structuredClone(u))};Ln(ut,5e3),ne(()=>(ut(),()=>{$t.drafts.del(Mt())}),[]),ne(()=>{const r=y=>{const{items:h}=y.clipboardData||y.dataTransfer,A=[];for(let C=0;C<h.length;C++){const R=h[C];if(R.kind==="file"){const v=R.getAsFile();v&&d.includes(v.type)&&A.push(v)}}if(A.length>0&&g.length>=j){alert(l._({id:"ctFhjs",values:{maxMediaAttachments:j}}));return}if(A.length>0){y.preventDefault(),y.stopPropagation();const C=j-g.length,R=A.slice(0,C);if(R.length<=0){alert(l._({id:"ctFhjs",values:{maxMediaAttachments:j}}));return}const v=R.map(_=>({file:_,type:_.type,size:_.size,url:URL.createObjectURL(_),id:null,description:null}));S([...g,...v])}};wi
<li role="option" data-value="${we(W)}">
<img src="${we(H)}" width="16" height="16" alt="" loading="lazy" />
${we(W)}
</li>`}),Q+=`<li role="option" data-value="" data-more="${k}">${ge._({id:"24misb"})}</li>`,ke.innerHTML=Q,O(Promise.resolve({matched:ce.length>0,fragment:ke}));return}const K={"@":"accounts","#":"hashtags"}[f];O(new Promise(ce=>{x({type:K,q:k,limit:5}).then(D=>{if(k!==T.current)return;const W=D[K]||D;let H="";W.forEach(te=>{var ee;const{name:Z,avatarStatic:ue,displayName:P,username:se,acct:fe,emojis:g,history:S}=te,z=Mn(P,g);if(fe)H+=`
<li role="option" data-value="${we(fe)}">
<span class="avatar">
<img src="${we(ue)}" width="16" height="16" alt="" loading="lazy" />
</span>
<span>
<b>${z||se}</b>
<br><span class="bidi-isolate">@${we(fe)}</span>
</span>
</li>
`;else{const N=(ee=S==null?void 0:S.reduce)==null?void 0:ee.call(S,(de,pe)=>de+ +pe.uses,0);H+=`
<li role="option" data-value="${we(Z)}">
<span class="grow">#<b>${we(Z)}</b></span>
${N?`<span class="count">${Tn(N)}</span>`:""}
</li>
`}}),K==="accounts"&&(H+=`<li role="option" data-value="" data-more="${k}">${ge._({id:"24misb"})}</li>`),ke.innerHTML=H,ce({matched:W.length>0,fragment:ke})})}))},b.current.addEventListener("text-expander-change",p),d=w=>{const{key:f,item:O}=w.detail,{value:k,more:K}=O.dataset;f===":"?(w.detail.value=k?`:${k}:`:"",K&&(w.detail.continue=!0,setTimeout(()=>{E==null||E({name:"custom-emojis",defaultSearchTerm:K})},300))):f==="@"?(w.detail.value=k?`@${k} `:"",K&&(w.detail.continue=!0,setTimeout(()=>{E==null||E({name:"mention",defaultSearchTerm:K})},300))):w.detail.value=`${f}${k}`},b.current.addEventListener("text-expander-value",d),m=w=>{const{input:f}=w.detail;if(o(f.value),t.current){const O=new Event("input",{bubbles:!0});t.current.dispatchEvent(O)}},b.current.addEventListener("text-expander-committed",m)),()=>{b.current&&(b.current.removeEventListener("text-expander-change",p),b.current.removeEventListener("text-expander-value",d),b.current.removeEventListener("text-expander-committed",m))}},[]),ne(()=>{const p=t.current;if(!p)return;new ResizeObserver(()=>{if(b.current){const{height:m}=p.getBoundingClientRect();b.current.style.height=m+"px"}}).observe(p)},[]);const L=Y(0),B=Y(),$=Bn(p=>{var w;if(!B.current)return;if(L.current>3){B.current.innerHTML="",B.current=null,(w=$==null?void 0:$.cancel)==null||w.call($);return}let d,m;L.current<=3&&(d=Date.now()),B.current.innerHTML=vi(p,{maxCharacters:l})+`
`,L.current<=3&&(m=Date.now()),d&&m&&m-d>50&&L.current++},500),ie=rt(()=>{var m,w;const p=(m=B.current)==null?void 0:m.cloneNode(!0);if(!p)return;p.querySelectorAll("mark").forEach(f=>{f.remove()});const d=(w=p.innerText)==null?void 0:w.trim();d&&(async()=>{const f=await xi(d);f!=null&&f.length&&(E==null||E({name:"auto-detect-language",languages:f}))})()},2e3);return e("text-expander",{ref:b,keys:"@ # :",class:"compose-field-container",children:[e("textarea",{class:"compose-field",autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",rows:"6",cols:"50",...M,ref:t,name:"status",value:c,onKeyDown:p=>{const{key:d,target:m}=p;if(d==="Enter"&&!(p.ctrlKey||p.metaKey))try{const{value:w,selectionStart:f}=m,k=w.slice(0,f).split(`
`).slice(-1)[0];if(k&&/^\s*(-|\d+\.)\s/.test(k)){const[K,ae,ce,Q,D]=k.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(D){p.preventDefault();const[W]=ce.match(/\d+/)||[],H=W?`${+W+1}.`:"-",te=`
${ae}${H}${Q}`;m.setRangeText(te,f,f);const Z=f+te.length;m.setSelectionRange(Z,Z)}else{const W=f-k.length;m.setRangeText("",W,f)}Gt(m),m.dispatchEvent(new Event("input"))}}catch{}B.current&&(B.current.scrollTop=m.scrollTop)},onInput:p=>{var w;const{target:d}=p,m=d.value.replace(/\u200b/g,"");o(m),Gt(d),(w=s.onInput)==null||w.call(s,p),$(m),ie()},style:{width:"100%",height:"4em"},onScroll:p=>{if(B.current){const{scrollTop:d}=p.target;B.current.scrollTop=d}}}),e("div",{ref:B,class:"compose-highlight","aria-hidden":"true"})]})});function ki({maxCharacters:s=500,hidden:t}){const a=Fn(oe).composerCharacterCount,c=s-a;return t?e("span",{class:"char-counter",hidden:!0}):e("span",{class:"char-counter",title:`${c}/${s}`,style:{"--percentage":a/s*100},children:[e("meter",{class:`${c<=-10?"explode":c<=0?"danger":c<=20?"warning":""}`,value:a,max:s}),e("span",{class:"counter",children:c})]})}function Yt(s,t,n,a){const c=Math.sqrt(t/s),o=Math.floor(n*c),l=Math.floor(a*c);return{newWidth:o,newHeight:l}}function Ei({attachment:s,disabled:t,lang:n,onDescriptionChange:a=()=>{},onRemove:c=()=>{}}){const{i18n:o}=Ke(),[l,x]=U("default"),E=Je("@mastodon/edit-media-attributes"),{type:M,id:F,file:b}=s,T=je(()=>b?URL.createObjectURL(b):s.url,[b,s.url]),L=!!(b!=null&&b.size),B=L?Xt():{},{mediaAttachments:{imageSizeLimit:$,imageMatrixLimit:ie,videoSizeLimit:j,videoMatrixLimit:p,videoFrameRateLimit:d}={}}=B||{},[m,w]=U(()=>L?M.startsWith("image")&&$&&b.size>$?{type:"imageSizeLimit",details:{imageSize:b.size,imageSizeLimit:$}}:M.startsWith("video")&&j&&b.size>j?{type:"videoSizeLimit",details:{videoSize:b.size,videoSizeLimit:j}}:null:null),[f,O]=U({});ne(()=>{!L||!ie||(f==null?void 0:f.matrix)>ie&&w({type:"imageMatrixLimit",details:{imageMatrix:f==null?void 0:f.matrix,imageMatrixLimit:ie,width:f==null?void 0:f.width,height:f==null?void 0:f.height}})},[f,ie,L]);const[k,K]=U({});ne(()=>{!L||!p||(k==null?void 0:k.matrix)>p&&w({type:"videoMatrixLimit",details:{videoMatrix:k==null?void 0:k.matrix,videoMatrixLimit:p,width:k==null?void 0:k.width,height:k==null?void 0:k.height}})},[k,p,L]);const[ae,ce]=U(s.description),[Q,D]=M.split("/"),W=rt(a,250);ne(()=>{W(ae)},[ae,W]);const[H,te]=U(!1),Z=Y(null);ne(()=>{let g;return H&&Z.current&&(g=setTimeout(()=>{Z.current.focus()},100)),()=>{clearTimeout(g)}},[H]);const ue=e(Oe,{children:F&&!E?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:e(V,{id:"3wG7HI"})}),e("p",{title:ae,children:s.description||e("i",{children:"No description"})})]}):e("textarea",{ref:Z,value:ae||"",lang:n,placeholder:{image:o._({id:"Lh8B0N"}),video:o._({id:"mN4S+e"}),audio:o._({id:"ieZytw"})}[Q],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:t||l==="loading",class:l==="loading"?"loading":"",maxlength:"1500",onInput:g=>{const{value:S}=g.target;ce(S)}})}),P=Y(null);ne(()=>()=>{var g,S;(S=(g=P.current)==null?void 0:g.hideToast)==null||S.call(g)},[]);const se=Y(null),fe=g=>{const{type:S,details:z}=g;switch(S){case"imageSizeLimit":{const{imageSize:ee,imageSizeLimit:N}=z;return o._({id:"d83/LB",values:{0:Xe(ee),1:Xe(N)}})}case"imageMatrixLimit":{const{imageMatrix:ee,imageMatrixLimit:N,width:de,height:pe}=z,{newWidth:_e,newHeight:Le}=Yt(ee,N,de,pe);return o._({id:"DuvOX/",values:{0:o.number(de),1:o.number(pe),2:o.number(_e),3:o.number(Le)}})}case"videoSizeLimit":{const{videoSize:ee,videoSizeLimit:N}=z;return o._({id:"d83/LB",values:{0:Xe(ee),1:Xe(N)}})}case"videoMatrixLimit":{const{videoMatrix:ee,videoMatrixLimit:N,width:de,height:pe}=z,{newWidth:_e,newHeight:Le}=Yt(ee,N,de,pe);return o._({id:"DuvOX/",values:{0:o.number(de),1:o.number(pe),2:o.number(_e),3:o.number(Le)}})}case"videoFrameRateLimit":return o._({id:"S1fBwy"})}};return e(Oe,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{te(!0)},children:Q==="image"?e("img",{src:T,alt:"",onLoad:g=>{if(!L)return;const{naturalWidth:S,naturalHeight:z}=g.target;O({matrix:S*z,width:S,height:z})}}):Q==="video"||Q==="gifv"?e("video",{src:T+"#t=0.1",playsinline:!0,muted:!0,dis
//# sourceMappingURL=compose-hDlR2o-x.js.map