phanpy-cz/assets/compose-N6HS-39B.js

27 lines
81 KiB
JavaScript
Raw Permalink Normal View History

2024-11-16 10:51:00 +00:00
var Dt=s=>{throw TypeError(s)};var mt=(s,t,n)=>t.has(s)||Dt("Cannot "+n);var M=(s,t,n)=>(mt(s,t,"read from private field"),n?n.call(s):t.get(s)),oe=(s,t,n)=>t.has(s)?Dt("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),Y=(s,t,n)=>(mt(s,t,"access private method"),n);import{z as fn,s as le,V as Xt,j as qe,a as _t,h as K,A as V,M as vn,aE as Jt,d as Se,y as te,x as bn,aF as xn,l as je,c as e,T as q,b as yn,f as Pe,w as at,r as wn,af as kn,i as ve,P as En,u as Fn,t as $t,C as Qt}from"./useTitle-TK72setz.js";import{j as Fe,G as Cn,$ as zn,a as $e,a9 as _n,y as jt,u as Ln,m as en,b as An,I as Z,B as Pt,i as Je,aa as Sn,l as yt,M as Qe,s as ze,a5 as In,a1 as Bn,r as Mn,Q as Tn,Y as rt,p as Ze,c as Rn,d as Ot,z as Dn}from"./fuse-zg_VFt4r.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=l=>jn(l,this),this.compositionEventHandler=l=>On(l,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",Ht),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",Ht)}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 l=t===1?0:a.length-1;if(n&&c>=0){const y=c+t;y>=0&&y<a.length&&(l=y)}const o=a[l];if(o)for(const y of a)y.removeAttribute("data-combobox-option-default"),o===y?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),Hn(this.list,o)):y.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":Nt(t.input,t.list)&&s.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&Nt(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.n
`,n-1)>o||s.lastIndexOf(".",n-1)>o)return}else if(s.lastIndexOf(" ",n-1)>o)return;const y=s[o-1];return y&&!Kn.test(y)?void 0:{text:s.substring(o+t.length,n),position:o+t.length}}class Wn extends HTMLElement{}class Un extends Event{constructor(){super("update")}}const ft=new WeakMap;var Oe,He,Ne,ye,W,wt,Ae,Ie,Be,kt,Me,et,tt,nt,Ke,_e;const At=class At extends Wn{constructor(){super(...arguments);oe(this,W);oe(this,Oe,new MutationObserver(()=>Y(this,W,tt).call(this)));oe(this,He,new ResizeObserver(()=>Y(this,W,et).call(this)));oe(this,Ne);oe(this,ye);oe(this,Ie,0);oe(this,Be,0);oe(this,Me,!1);oe(this,Ke,()=>Y(this,W,nt).call(this));oe(this,_e,n=>{Y(this,W,Ae).call(this,a=>{(n.target===document||n.target===window||n.target instanceof Node&&n.target.contains(a))&&Y(this,W,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,ye,document.createElement("div")),M(this,ye).style.position="absolute",M(this,ye).style.pointerEvents="none",n.after(M(this,ye)),M(this,ye).appendChild(this)}forceUpdate(){Y(this,W,tt).call(this),Y(this,W,nt).call(this)}connectedCallback(){Y(this,W,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"),Y(this,W,tt).call(this),Y(this,W,nt).call(this),M(this,Oe).observe(n,{attributeFilter:["style","dir"]}),M(this,He).observe(n),document.addEventListener("scroll",M(this,_e),{capture:!0}),window.addEventListener("resize",M(this,_e),{capture:!0}),n.addEventListener("input",M(this,Ke),{capture:!0})})}disconnectedCallback(){var a;(a=M(this,ye))==null||a.remove(),M(this,Oe).disconnect(),M(this,He).disconnect(),document.removeEventListener("scroll",M(this,_e),{capture:!0}),window.removeEventListener("resize",M(this,_e),{capture:!0});const n=M(this,W,wt);n&&(n.removeEventListener("input",M(this,Ke),{capture:!0}),ft.delete(n))}};Oe=new WeakMap,He=new WeakMap,Ne=new WeakMap,ye=new WeakMap,W=new WeakSet,wt=function(){var n;return(n=M(this,Ne))==null?void 0:n.deref()},Ae=function(n){const a=M(this,W,wt);return a?n(a):this.remove()},Ie=new WeakMap,Be=new WeakMap,kt=function(){Y(this,W,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(),l=this.getBoundingClientRect();me(this,Ie,M(this,Ie)+c.left-l.left),me(this,Be,M(this,Be)+c.top-l.top),this.style.transform=`translate(${M(this,Ie)}px, ${M(this,Be)}px)`,this.scrollTop=n.scrollTop,this.scrollLeft=n.scrollLeft,this.dispatchEvent(new Un)})},Me=new WeakMap,et=function(){M(this,Me)||(me(this,Me,!0),requestAnimationFrame(()=>{Y(this,W,kt).call(this),me(this,Me,!1)}))},tt=function(){Y(this,W,Ae).call(this,n=>{const a=window.getComputedStyle(n);for(const c of Vn)this.style[c]=a[c];Y(this,W,et).call(this)})},nt=function(){Y(this,W,Ae).call(this,n=>{this.textContent=n.value,Y(this,W,kt).call(this)})},Ke=new WeakMap,_e=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,Te,Re,ce,Ft,tn,Ct,De;const st=c
`)&&(S.current.selectionStart=0,S.current.selectionEnd=0),(x=S.current)==null||x.focus())},300)};te(()=>{var r,d;if(t){const{spoilerText:x,visibility:p,language:A,sensitive:F}=t;x&&O.current&&(O.current.value=x);const b=[...new Set([t.account.acct,...t.mentions.map(E=>E.acct)])].filter(E=>E!==T.acct);b.length>0&&(S.current.value=`${b.map(E=>`@${E}`).join(" ")} `,ge()),we(),ie(p==="public"&&Q["posting:default:visibility"]?Q["posting:default:visibility"].toLowerCase():p),de(A||((r=Q["posting:default:language"])==null?void 0:r.toLowerCase())||Ce),ae(F&&!!x)}else if(n){const{visibility:x,language:p,sensitive:A,poll:F,mediaAttachments:I}=n,b=!!(F!=null&&F.options)&&{...F,options:F.options.map(E=>(E==null?void 0:E.title)||E),expiresIn:(F==null?void 0:F.expiresIn)||Vt(F.expiresAt)};B("loading"),(async()=>{var E;try{const H=await z.v1.statuses.$select(n.id).source.fetch(),{text:he,spoilerText:fe}=H;S.current.value=he,S.current.dataset.source=he,ge(),we(),O.current.value=fe,ie(x),de(p||((E=Q["posting:default:language"])==null?void 0:E.toLowerCase())||Ce),ae(A),b&&J(b),L(I),B("default")}catch(H){alert((H==null?void 0:H.reason)||H),B("error")}})()}else we(),Q["posting:default:visibility"]&&ie(Q["posting:default:visibility"].toLowerCase()),Q["posting:default:language"]&&de(Q["posting:default:language"].toLowerCase()),Q["posting:default:sensitive"]&&ae(!!Q["posting:default:sensitive"]);if(a){const{status:x,spoilerText:p,visibility:A,language:F,sensitive:I,poll:b,mediaAttachments:E}=a,H=!!(b!=null&&b.options)&&{...b,options:b.options.map(he=>(he==null?void 0:he.title)||he),expiresIn:(b==null?void 0:b.expiresIn)||Vt(b.expiresAt)};S.current.value=x,ge(),we(),p&&(O.current.value=p),A&&ie(A),de(F||((d=Q["posting:default:language"])==null?void 0:d.toLowerCase())||Ce),I!==null&&ae(I),H&&J(H),E&&L(E)}},[a,n,t]);const Le=V(),St=o._({id:"hR9gtK"}),ot=()=>{const{value:r,dataset:d}=S.current;if(g==="loading")return!1;const x=(r||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),p=v.length>0;if(!x&&!p||v.length>0&&v.every(E=>E.id))return!0;const F=(t==null?void 0:t.account.id)===T.id,I=t&&r.trim()===`@${t.account.acct}`;return!!(!F&&I||r===(d==null?void 0:d.source))},We=()=>ot()?!0:confirm(St);te(()=>{const r=d=>{ot()||(d.preventDefault(),d.returnValue=St)};return window.addEventListener("beforeunload",r,{capture:!0}),()=>window.removeEventListener("beforeunload",r,{capture:!0})},[]);const on=()=>{const{value:r}=S.current,{value:d}=O.current;return qt(ui(r))+qt(d)},lt=()=>{const r=on();le.composerCharacterCount=r};te(lt,[]);const It=window.CloseWatcher,ct=V(!1);$e("esc",()=>{ct.current=!0},{enabled:!It,enableOnFormTags:!0}),$e("esc",()=>{!c&&ct.current&&We()&&s(),ct.current=!1},{enabled:!It,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:r=>{const d=document.querySelectorAll("#modal-container > *"),x=!!d,p=d.length===1&&d[0].querySelector("#compose-container");return x&&!p}}),_n(()=>{!c&&We()&&s()},[c,We,s]);const Bt=V({}),Mt=()=>`${bn()}#${C.current}`,ut=()=>{if(n||le.composerState.minimized)return;const r=Mt(),d={key:r,replyTo:t?{id:t.id,account:{id:t.account.id,username:t.account.username,acct:t.account.acct}}:null,draftStatus:{uid:C.current,status:S.current.value,spoilerText:O.current.value,visibility:U,language:D,sensitive:se,poll:P,mediaAttachments:v}};!xn(d,Bt.current)&&!ot()&&(jt.drafts.set(r,{...d,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(x=>{}),Bt.current=structuredClone(d))};Ln(ut,5e3),te(()=>(ut(),()=>{jt.drafts.del(Mt())}),[]),te(()=>{const r=x=>{const{items:p}=x.clipboardData||x.dataTransfer,A=[],F=[];for(let I=0;I<p.length;I++){const b=p[I];if(b.kind==="file"){const E=b.getAsFile();m!==void 0&&!m.includes(E.type)?F.push(E):A.push(E)}}if(F.length>0&&alert(o._({id:"rpXAF6",values:{0:F.length,1:F[0].name,2:_.format(F.map(I=>I.name))}})),A.length>0&&v.length>=u){alert(o._({id:"ctFhjs",values:{maxMediaAttachments:u}}));return}if(A.length>0){x.preventDefault(),x.stopPropagation();let I=A;if(u!==void 0){const E=u-v.length;if(I=I.slice(0,E),I.length<=0){alert(o._({id:"ctFhjs",values:{maxMediaAtta
<li role="option" data-value="${ke(S)}">
<img src="${ke(O)}" width="16" height="16" alt="" loading="lazy" />
${ke(S)}
</li>`}),X+=`<li role="option" data-value="" data-more="${k}">${ve._({id:"24misb"})}</li>`,Ee.innerHTML=X,j(Promise.resolve({matched:ue.length>0,fragment:Ee}));return}const G={"@":"accounts","#":"hashtags"}[f];j(new Promise(ue=>{y({type:G,q:k,limit:5}).then(pe=>{if(k!==B.current)return;const S=pe[G]||pe;let O="";S.forEach(U=>{var P;const{name:ie,avatarStatic:se,displayName:ae,username:D,acct:de,emojis:R,history:v}=U,L=Bn(ae,R);if(de)O+=`
<li role="option" data-value="${ke(de)}">
<span class="avatar">
<img src="${ke(se)}" width="16" height="16" alt="" loading="lazy" />
</span>
<span>
<b>${L||D}</b>
<br><span class="bidi-isolate">@${ke(de)}</span>
</span>
</li>
`;else{const J=(P=v==null?void 0:v.reduce)==null?void 0:P.call(v,(Q,ge)=>Q+ +ge.uses,0);O+=`
<li role="option" data-value="${ke(ie)}">
<span class="grow">#<b>${ke(ie)}</b></span>
${J?`<span class="count">${Mn(J)}</span>`:""}
</li>
`}}),G==="accounts"&&(O+=`<li role="option" data-value="" data-more="${k}">${ve._({id:"24misb"})}</li>`),Ee.innerHTML=O,ue({matched:S.length>0,fragment:Ee})})}))},g.current.addEventListener("text-expander-change",u),h=w=>{const{key:f,item:j}=w.detail,{value:k,more:G}=j.dataset;f===":"?(w.detail.value=k?`:${k}:`:"",G&&(w.detail.continue=!0,setTimeout(()=>{_==null||_({name:"custom-emojis",defaultSearchTerm:G})},300))):f==="@"?(w.detail.value=k?`@${k} `:"",G&&(w.detail.continue=!0,setTimeout(()=>{_==null||_({name:"mention",defaultSearchTerm:G})},300))):w.detail.value=`${f}${k}`},g.current.addEventListener("text-expander-value",h),m=w=>{const{input:f}=w.detail;if(l(f.value),t.current){const j=new Event("input",{bubbles:!0});t.current.dispatchEvent(j)}},g.current.addEventListener("text-expander-committed",m)),()=>{g.current&&(g.current.removeEventListener("text-expander-change",u),g.current.removeEventListener("text-expander-value",h),g.current.removeEventListener("text-expander-committed",m))}},[]),te(()=>{const u=t.current;if(!u)return;new ResizeObserver(()=>{if(g.current){const{height:m}=u.getBoundingClientRect();g.current.style.height=m+"px"}}).observe(u)},[]);const C=V(0),$=V(),T=Tn(u=>{var w;if(!$.current)return;if(C.current>3){$.current.innerHTML="",$.current=null,(w=T==null?void 0:T.cancel)==null||w.call(T);return}let h,m;C.current<=3&&(h=Date.now()),$.current.innerHTML=vi(u,{maxCharacters:o})+`
`,C.current<=3&&(m=Date.now()),h&&m&&m-h>50&&C.current++},500),ne=rt(()=>{var m,w;const u=(m=$.current)==null?void 0:m.cloneNode(!0);if(!u)return;u.querySelectorAll("mark").forEach(f=>{f.remove()});const h=(w=u.innerText)==null?void 0:w.trim();h&&(async()=>{const f=await wi(h);f!=null&&f.length&&(_==null||_({name:"auto-detect-language",languages:f}))})()},2e3);return e("text-expander",{ref:g,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",...z,ref:t,name:"status",value:c,onKeyDown:u=>{const{key:h,target:m}=u;if(h==="Enter"&&!(u.ctrlKey||u.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[G,re,ue,X,pe]=k.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(pe){u.preventDefault();const[S]=ue.match(/\d+/)||[],O=S?`${+S+1}.`:"-",U=`
${re}${O}${X}`;m.setRangeText(U,f,f);const ie=f+U.length;m.setSelectionRange(ie,ie)}else{const S=f-k.length;m.setRangeText("",S,f)}Gt(m),m.dispatchEvent(new Event("input"))}}catch{}$.current&&($.current.scrollTop=m.scrollTop)},onInput:u=>{var w;const{target:h}=u,m=h.value.replace(/\u200b/g,"");l(m),Gt(h),(w=s.onInput)==null||w.call(s,u),T(m),ne()},style:{width:"100%",height:"4em"},onScroll:u=>{if($.current){const{scrollTop:h}=u.target;$.current.scrollTop=h}}}),e("div",{ref:$,class:"compose-highlight","aria-hidden":"true"})]})});function Ei({maxCharacters:s=500,hidden:t}){const a=Fn(le).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),l=Math.floor(n*c),o=Math.floor(a*c);return{newWidth:l,newHeight:o}}function Fi({attachment:s,disabled:t,lang:n,onDescriptionChange:a=()=>{},onRemove:c=()=>{}}){const{i18n:l}=qe(),[o,y]=K("default"),_=Je("@mastodon/edit-media-attributes"),{type:z,id:N,file:g}=s,B=je(()=>g?URL.createObjectURL(g):s.url,[g,s.url]),C=!!(g!=null&&g.size),$=C?Jt():{},{mediaAttachments:{imageSizeLimit:T,imageMatrixLimit:ne,videoSizeLimit:ee,videoMatrixLimit:u,videoFrameRateLimit:h}={}}=$||{},[m,w]=K(()=>C?z.startsWith("image")&&T&&g.size>T?{type:"imageSizeLimit",details:{imageSize:g.size,imageSizeLimit:T}}:z.startsWith("video")&&ee&&g.size>ee?{type:"videoSizeLimit",details:{videoSize:g.size,videoSizeLimit:ee}}:null:null),[f,j]=K({});te(()=>{!C||!ne||(f==null?void 0:f.matrix)>ne&&w({type:"imageMatrixLimit",details:{imageMatrix:f==null?void 0:f.matrix,imageMatrixLimit:ne,width:f==null?void 0:f.width,height:f==null?void 0:f.height}})},[f,ne,C]);const[k,G]=K({});te(()=>{!C||!u||(k==null?void 0:k.matrix)>u&&w({type:"videoMatrixLimit",details:{videoMatrix:k==null?void 0:k.matrix,videoMatrixLimit:u,width:k==null?void 0:k.width,height:k==null?void 0:k.height}})},[k,u,C]);const[re,ue]=K(s.description),[X,pe]=z.split("/"),S=rt(a,250);te(()=>{S(re)},[re,S]);const[O,U]=K(!1),ie=V(null);te(()=>{let R;return O&&ie.current&&(R=setTimeout(()=>{ie.current.focus()},100)),()=>{clearTimeout(R)}},[O]);const se=e(Pe,{children:N&&!_?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:e(q,{id:"3wG7HI"})}),e("p",{title:re,children:s.description||e("i",{children:"No description"})})]}):e("textarea",{ref:ie,value:re||"",lang:n,placeholder:{image:l._({id:"Lh8B0N"}),video:l._({id:"mN4S+e"}),audio:l._({id:"ieZytw"})}[X],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:t||o==="loading",class:o==="loading"?"loading":"",maxlength:"1500",onInput:R=>{const{value:v}=R.target;ue(v)}})}),ae=V(null);te(()=>()=>{var R,v;(v=(R=ae.current)==null?void 0:R.hideToast)==null||v.call(R)},[]);const D=V(null),de=R=>{const{type:v,details:L}=R;switch(v){case"imageSizeLimit":{const{imageSize:P,imageSizeLimit:J}=L;return l._({id:"d83/LB",values:{0:Ze(P),1:Ze(J)}})}case"imageMatrixLimit":{const{imageMatrix:P,imageMatrixLimit:J,width:Q,height:ge}=L,{newWidth:we,newHeight:Le}=Yt(P,J,Q,ge);return l._({id:"DuvOX/",values:{0:l.number(Q),1:l.number(ge),2:l.number(we),3:l.number(Le)}})}case"videoSizeLimit":{const{videoSize:P,videoSizeLimit:J}=L;return l._({id:"d83/LB",values:{0:Ze(P),1:Ze(J)}})}case"videoMatrixLimit":{const{videoMatrix:P,videoMatrixLimit:J,width:Q,height:ge}=L,{newWidth:we,newHeight:Le}=Yt(P,J,Q,ge);return l._({id:"DuvOX/",values:{0:l.number(Q),1:l.number(ge),2:l.number(we),3:l.number(Le)}})}case"videoFrameRateLimit":return l._({id:"S1fBwy"})}};return e(Pe,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{U(!0)},children:X==="image"?e("img",{src:B,alt:"",onLoad:R=>{if(!C)return;const{naturalWidth:v,naturalHeight:L}=R.target;j({matrix:v*L,width:v,height:L})}}):X==="video"||X==="gifv"?e("video",{src:B+"#t=0.1",playsinline:!0,muted:!0,disableP
//# sourceMappingURL=compose-N6HS-39B.js.map