phanpy-cz/assets/compose-8rrDtgaW.js

27 lines
83 KiB
JavaScript
Raw Permalink Normal View History

2024-12-30 07:44:29 +01:00
var qt=s=>{throw TypeError(s)};var xt=(s,t,n)=>t.has(s)||qt("Cannot "+n);var B=(s,t,n)=>(xt(s,t,"read from private field"),n?n.call(s):t.get(s)),de=(s,t,n)=>t.has(s)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),ge=(s,t,n,a)=>(xt(s,t,"write to private field"),a?a.call(s,n):t.set(s,n),n),te=(s,t,n)=>(xt(s,t,"access private method"),n);import{x as An,s as ce,V as on,u as ze,a as Bt,h as H,A as q,K as Sn,aD as rn,e as Te,y as oe,w as _n,aE as In,r as Oe,i as Ne,d as e,T as G,b as Bn,k as qe,v as dt,o as Tn,ae as Mn,P as Rn,c as Dn,q as Wt,M as ln}from"./useTitle-jLgT0T3g.js";import{j as Le,G as $n,$ as jn,a as Ke,a9 as Pn,y as Ut,u as On,aa as Hn,m as cn,b as Kn,I as N,B as Vt,i as st,ab as Nn,c as un,d as Be,l as Ct,M as at,s as Se,a5 as qn,a1 as Wn,r as Un,Q as Vn,Y as ht,p as nt,z as Gn}from"./fuse-1Fw6A_G2.js";class Yn{constructor(t,n,{tabInsertsSuggestions:a,defaultFirstOption:l}={}){this.input=t,this.list=n,this.tabInsertsSuggestions=a??!0,this.defaultFirstOption=l??!1,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=d=>Zn(d,this),this.compositionEventHandler=d=>Xn(d,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",Gt),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",Gt)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(yt)[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(yt)[0],a=Array.from(this.list.querySelectorAll('[role="option"]')).filter(yt),l=a.indexOf(n);if(l===a.length-1&&t===1||l===0&&t===-1){this.clearSelection(),this.input.focus();return}let d=t===1?0:a.length-1;if(n&&l>=0){const p=l+t;p>=0&&p<a.length&&(d=p)}const r=a[d];if(r)for(const p of a)p.removeAttribute("data-combobox-option-default"),r===p?(this.input.setAttribute("aria-activedescendant",r.id),r.setAttribute("aria-selected","true"),Qn(this.list,r)):p.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 Zn(s,t){if(!(s.shiftKey||s.metaKey||s.altKey)&&!(!t.ctrlBindings&&s.ctrlKey)&&!t.isComposing)switch(s.key){case"Enter":Yt(t.input,t.list)&&s.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&Yt(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.ctr
`,n-1)>r||s.lastIndexOf(".",n-1)>r)return}else if(s.lastIndexOf(" ",n-1)>r)return;const p=s[r-1];return p&&!ti.test(p)?void 0:{text:s.substring(r+t.length,n),position:r+t.length}}class ii extends HTMLElement{}class si extends Event{constructor(){super("update")}}const wt=new WeakMap;var We,Ue,Ve,ke,Y,zt,Ie,Me,Re,Lt,De,ot,rt,lt,Ge,_e;const Mt=class Mt extends ii{constructor(){super(...arguments);de(this,Y);de(this,We,new MutationObserver(()=>te(this,Y,rt).call(this)));de(this,Ue,new ResizeObserver(()=>te(this,Y,ot).call(this)));de(this,Ve);de(this,ke);de(this,Me,0);de(this,Re,0);de(this,De,!1);de(this,Ge,()=>te(this,Y,lt).call(this));de(this,_e,n=>{te(this,Y,Ie).call(this,a=>{(n.target===document||n.target===window||n.target instanceof Node&&n.target.contains(a))&&te(this,Y,ot).call(this)})})}static for(n){let a=wt.get(n);return a||(a=new Mt,a.connect(n),wt.set(n,a)),a}connect(n){ge(this,Ve,new WeakRef(n)),ge(this,ke,document.createElement("div")),B(this,ke).style.position="absolute",B(this,ke).style.pointerEvents="none",n.after(B(this,ke)),B(this,ke).appendChild(this)}forceUpdate(){te(this,Y,rt).call(this),te(this,Y,lt).call(this)}connectedCallback(){te(this,Y,Ie).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"),te(this,Y,rt).call(this),te(this,Y,lt).call(this),B(this,We).observe(n,{attributeFilter:["style","dir"]}),B(this,Ue).observe(n),document.addEventListener("scroll",B(this,_e),{capture:!0}),window.addEventListener("resize",B(this,_e),{capture:!0}),n.addEventListener("input",B(this,Ge),{capture:!0})})}disconnectedCallback(){var a;(a=B(this,ke))==null||a.remove(),B(this,We).disconnect(),B(this,Ue).disconnect(),document.removeEventListener("scroll",B(this,_e),{capture:!0}),window.removeEventListener("resize",B(this,_e),{capture:!0});const n=B(this,Y,zt);n&&(n.removeEventListener("input",B(this,Ge),{capture:!0}),wt.delete(n))}};We=new WeakMap,Ue=new WeakMap,Ve=new WeakMap,ke=new WeakMap,Y=new WeakSet,zt=function(){var n;return(n=B(this,Ve))==null?void 0:n.deref()},Ie=function(n){const a=B(this,Y,zt);return a?n(a):this.remove()},Me=new WeakMap,Re=new WeakMap,Lt=function(){te(this,Y,Ie).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 l=n.getBoundingClientRect(),d=this.getBoundingClientRect();ge(this,Me,B(this,Me)+l.left-d.left),ge(this,Re,B(this,Re)+l.top-d.top),this.style.transform=`translate(${B(this,Me)}px, ${B(this,Re)}px)`,this.scrollTop=n.scrollTop,this.scrollLeft=n.scrollLeft,this.dispatchEvent(new si)})},De=new WeakMap,ot=function(){B(this,De)||(ge(this,De,!0),requestAnimationFrame(()=>{te(this,Y,Lt).call(this),ge(this,De,!1)}))},rt=function(){te(this,Y,Ie).call(this,n=>{const a=window.getComputedStyle(n);for(const l of ai)this.style[l]=a[l];te(this,Y,ot).call(this)})},lt=function(){te(this,Y,Ie).call(this,n=>{this.textContent=n.value,te(this,Y,Lt).call(this)})},Ge=new WeakMap,_e=new WeakMap;let ct=Mt;const ai=["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",ct)}catch(s){if(!(s instanceof DOMException&&s.name==="NotSupportedError"))throw s}var ye,$e,je,he,St,dn,
`)&&(_.current.selectionStart=0,_.current.selectionEnd=0),(k=_.current)==null||k.focus())},300)};oe(()=>{var o,u;if(t){const{spoilerText:k,visibility:h,language:A,sensitive:L}=t;k&&j.current&&(j.current.value=k);const x=[...new Set([t.account.acct,...t.mentions.map(C=>C.acct)])].filter(C=>C!==P.acct);x.length>0&&(_.current.value=`${x.map(C=>`@${C}`).join(" ")} `,be()),xe(),se(h==="public"&&ae["posting:default:visibility"]?ae["posting:default:visibility"].toLowerCase():h),I(A||((o=ae["posting:default:language"])==null?void 0:o.toLowerCase())||Ae),ie(L&&!!k)}else if(n){const{visibility:k,language:h,sensitive:A,poll:L,mediaAttachments:S}=n,x=!!(L!=null&&L.options)&&{...L,options:L.options.map(C=>(C==null?void 0:C.title)||C),expiresIn:(L==null?void 0:L.expiresIn)||en(L.expiresAt)};R("loading"),(async()=>{var C;try{const O=await T.v1.statuses.$select(n.id).source.fetch(),{text:me,spoilerText:fe}=O;_.current.value=me,_.current.dataset.source=me,be(),xe(),j.current.value=fe,se(k),I(h||((C=ae["posting:default:language"])==null?void 0:C.toLowerCase())||Ae),ie(A),x&&ue(x),ee(S),R("default")}catch(O){alert((O==null?void 0:O.reason)||O),R("error")}})()}else xe(),ae["posting:default:visibility"]&&se(ae["posting:default:visibility"].toLowerCase()),ae["posting:default:language"]&&I(ae["posting:default:language"].toLowerCase()),ae["posting:default:sensitive"]&&ie(!!ae["posting:default:sensitive"]);if(a){const{status:k,spoilerText:h,visibility:A,language:L,sensitive:S,poll:x,mediaAttachments:C}=a,O=!!(x!=null&&x.options)&&{...x,options:x.options.map(me=>(me==null?void 0:me.title)||me),expiresIn:(x==null?void 0:x.expiresIn)||en(x.expiresAt)};_.current.value=k,be(),xe(),h&&(j.current.value=h),A&&se(A),I(L||((u=ae["posting:default:language"])==null?void 0:u.toLowerCase())||Ae),S!==null&&ie(S),O&&ue(O),C&&ee(C)}},[a,n,t]);const Ye=q(),Rt=F({id:"hR9gtK"}),pt=()=>{const{value:o,dataset:u}=_.current;if(E==="loading")return!1;const k=(o||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),h=m.length>0;if(!k&&!h||m.length>0&&m.every(C=>C.id))return!0;const L=(t==null?void 0:t.account.id)===P.id,S=t&&o.trim()===`@${t.account.acct}`;return!!(!L&&S||o===(u==null?void 0:u.source))},Ze=()=>pt()?!0:confirm(Rt);oe(()=>{const o=u=>{pt()||(u.preventDefault(),u.returnValue=Rt)};return window.addEventListener("beforeunload",o,{capture:!0}),()=>window.removeEventListener("beforeunload",o,{capture:!0})},[]);const fn=()=>{const{value:o}=_.current,{value:u}=j.current;return Jt(ki(o))+Jt(u)},mt=()=>{const o=fn();ce.composerCharacterCount=o};oe(mt,[]);const Dt=window.CloseWatcher,gt=q(!1);Ke("esc",()=>{gt.current=!0},{enabled:!Dt,enableOnFormTags:!0}),Ke("esc",()=>{!l&&gt.current&&Ze()&&s(),gt.current=!1},{enabled:!Dt,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:o=>{const u=document.querySelectorAll("#modal-container > *"),k=!!u,h=u.length===1&&u[0].querySelector("#compose-container");return k&&!h}}),Pn(()=>{!l&&Ze()&&s()},[l,Ze,s]);const $t=q({}),jt=()=>`${_n()}#${W.current}`,ft=()=>{if(n||ce.composerState.minimized)return;const o=jt(),u={key:o,replyTo:t?{id:t.id,account:{id:t.account.id,username:t.account.username,acct:t.account.acct}}:null,draftStatus:{uid:W.current,status:_.current.value,spoilerText:j.current.value,visibility:Z,language:Q,sensitive:V,poll:D,mediaAttachments:m}};!In(u,$t.current)&&!pt()&&(Ut.drafts.set(o,{...u,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(k=>{}),$t.current=structuredClone(u))};On(ft,5e3),oe(()=>(ft(),()=>{Ut.drafts.del(jt())}),[]),oe(()=>{const o=k=>{const{items:h}=k.clipboardData||k.dataTransfer,A=[],L=[];for(let S=0;S<h.length;S++){const x=h[S];if(x.kind==="file"){const C=x.getAsFile();b!==void 0&&!b.includes(C.type)?L.push(C):A.push(C)}}if(L.length>0&&alert(Oe._({id:"rpXAF6",values:{0:L.length,1:L[0].name,2:re.format(L.map(S=>S.name))}})),A.length>0&&m.length>=c){alert(Oe._({id:"ctFhjs",values:{maxMediaAttachments:c}}));return}if(A.length>0){k.preventDefault(),k.stopPropagation();let S=A;if(c!==void 0){const C=c-m.length;if(S=S.slice(0,C),S.length<=0){alert(Oe._({id:"ctFhjs",values:{
<li role="option" data-value="${Fe(Z)}">
<img src="${Fe(se)}" width="16" height="16" alt="" loading="lazy" />
${Fe(Z)}
</li>`}),_+=`<li role="option" data-value="" data-more="${X}">${n({id:"24misb"})}</li>`,Ce.innerHTML=_,ne(Promise.resolve({matched:pe.length>0,fragment:Ce}));return}const U={"@":"accounts","#":"hashtags"}[J];ne(new Promise(pe=>{F({type:U,q:X,limit:5}).then(j=>{if(X!==E.current)return;const Z=j[U]||j;let se="";Z.forEach(V=>{var ae;const{name:ie,avatarStatic:Q,displayName:I,username:K,acct:m,emojis:ee,history:D}=V,ue=Wn(I,ee);if(m)se+=`
<li role="option" data-value="${Fe(m)}">
<span class="avatar">
<img src="${Fe(Q)}" width="16" height="16" alt="" loading="lazy" />
</span>
<span>
<b>${ue||K}</b>
<br><span class="bidi-isolate">@${Fe(m)}</span>
</span>
</li>
`;else{const be=(ae=D==null?void 0:D.reduce)==null?void 0:ae.call(D,(xe,Ye)=>xe+ +Ye.uses,0);se+=`
<li role="option" data-value="${Fe(ie)}">
<span class="grow">#<b>${Fe(ie)}</b></span>
${be?`<span class="count">${Un(be)}</span>`:""}
</li>
`}}),U==="accounts"&&(se+=`<li role="option" data-value="" data-more="${X}">${n({id:"24misb"})}</li>`),Ce.innerHTML=se,pe({matched:Z.length>0,fragment:Ce})})}))},g.current.addEventListener("text-expander-change",c),f=z=>{const{key:J,item:ne}=z.detail,{value:X,more:U}=ne.dataset;J===":"?(z.detail.value=X?`:${X}:`:"",U&&(z.detail.continue=!0,setTimeout(()=>{v==null||v({name:"custom-emojis",defaultSearchTerm:U})},300))):J==="@"?(z.detail.value=X?`@${X} `:"",U&&(z.detail.continue=!0,setTimeout(()=>{v==null||v({name:"mention",defaultSearchTerm:U})},300))):z.detail.value=`${J}${X}`},g.current.addEventListener("text-expander-value",f),b=z=>{const{input:J}=z.detail;if(r(J.value),t.current){const ne=new Event("input",{bubbles:!0});t.current.dispatchEvent(ne)}},g.current.addEventListener("text-expander-committed",b),y=()=>{R.current=!0},g.current.addEventListener("text-expander-activate",y),M=()=>{R.current=!1},g.current.addEventListener("text-expander-deactivate",M)),()=>{g.current&&(g.current.removeEventListener("text-expander-change",c),g.current.removeEventListener("text-expander-value",f),g.current.removeEventListener("text-expander-committed",b),g.current.removeEventListener("text-expander-activate",y),g.current.removeEventListener("text-expander-deactivate",M))}},[]),oe(()=>{const c=t.current;if(!c)return;new ResizeObserver(()=>{if(g.current){const{height:b}=c.getBoundingClientRect();g.current.style.height=b+"px"}}).observe(c)},[]);const W=q(0),$=q(),P=Vn(c=>{var y;if(!$.current)return;if(W.current>3){$.current.innerHTML="",$.current=null,(y=P==null?void 0:P.cancel)==null||y.call(P);return}let f,b;W.current<=3&&(f=Date.now()),$.current.innerHTML=Si(c,{maxCharacters:p})+`
`,W.current<=3&&(b=Date.now()),f&&b&&b-f>50&&W.current++},500),le=ht(()=>{var b,y;const c=(b=$.current)==null?void 0:b.cloneNode(!0);if(!c)return;c.querySelectorAll("mark").forEach(M=>{M.remove()});const f=(y=c.innerText)==null?void 0:y.trim();f&&(async()=>{const M=await Ti(f);M!=null&&M.length&&(v==null||v({name:"auto-detect-language",languages:M}))})()},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",...re,ref:t,name:"status",value:d,onKeyDown:c=>{const{key:f,target:b}=c,y=R.current;if(f==="Enter"&&!(c.ctrlKey||c.metaKey||y))try{const{value:M,selectionStart:z}=b,ne=M.slice(0,z).split(`
`).slice(-1)[0];if(ne&&/^\s*(-|\d+\.)\s/.test(ne)){const[X,U,ve,pe,_]=ne.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(_){c.preventDefault();const[j]=ve.match(/\d+/)||[],Z=j?`${+j+1}.`:"-",se=`
${U}${Z}${pe}`;b.setRangeText(se,z,z);const V=z+se.length;b.setSelectionRange(V,V)}else{const j=z-ne.length;b.setRangeText("",j,z)}nn(b),b.dispatchEvent(new Event("input"))}}catch{}$.current&&($.current.scrollTop=b.scrollTop)},onInput:c=>{var y;const{target:f}=c,b=f.value.replace(/\u200b/g,"");r(b),nn(f),(y=s.onInput)==null||y.call(s,c),P(b),le()},style:{width:"100%",height:"4em"},onScroll:c=>{if($.current){const{scrollTop:f}=c.target;$.current.scrollTop=f}}}),e("div",{ref:$,class:"compose-highlight","aria-hidden":"true"})]})});function Ri({maxCharacters:s=500,hidden:t}){const a=Dn(ce).composerCharacterCount,l=s-a;return t?e("span",{class:"char-counter",hidden:!0}):e("span",{class:"char-counter",title:`${l}/${s}`,style:{"--percentage":a/s*100},children:[e("meter",{class:`${l<=-10?"explode":l<=0?"danger":l<=20?"warning":""}`,value:a,max:s}),e("span",{class:"counter",children:l})]})}function sn(s,t,n,a){const l=Math.sqrt(t/s),d=Math.floor(n*l),r=Math.floor(a*l);return{newWidth:d,newHeight:r}}function Di({attachment:s,disabled:t,lang:n,onDescriptionChange:a=()=>{},onRemove:l=()=>{}}){const{i18n:d,_:r}=ze(),[p,F]=H("default"),v=st("@mastodon/edit-media-attributes"),{type:re,id:T,file:g}=s,E=Ne(()=>g?URL.createObjectURL(g):s.url,[g,s.url]),R=!!(g!=null&&g.size),W=R?rn():{},{mediaAttachments:{imageSizeLimit:$,imageMatrixLimit:P,videoSizeLimit:le,videoMatrixLimit:w,videoFrameRateLimit:c}={}}=W||{},[f,b]=H(()=>R?re.startsWith("image")&&$&&g.size>$?{type:"imageSizeLimit",details:{imageSize:g.size,imageSizeLimit:$}}:re.startsWith("video")&&le&&g.size>le?{type:"videoSizeLimit",details:{videoSize:g.size,videoSizeLimit:le}}:null:null),[y,M]=H({});oe(()=>{!R||!P||(y==null?void 0:y.matrix)>P&&b({type:"imageMatrixLimit",details:{imageMatrix:y==null?void 0:y.matrix,imageMatrixLimit:P,width:y==null?void 0:y.width,height:y==null?void 0:y.height}})},[y,P,R]);const[z,J]=H({});oe(()=>{!R||!w||(z==null?void 0:z.matrix)>w&&b({type:"videoMatrixLimit",details:{videoMatrix:z==null?void 0:z.matrix,videoMatrixLimit:w,width:z==null?void 0:z.width,height:z==null?void 0:z.height}})},[z,w,R]);const[ne,X]=H(s.description),[U,ve]=re.split("/"),pe=ht(a,250);oe(()=>{pe(ne)},[ne,pe]);const[_,j]=H(!1),Z=q(null);oe(()=>{let I;return _&&Z.current&&(I=setTimeout(()=>{Z.current.focus()},100)),()=>{clearTimeout(I)}},[_]);const se=e(qe,{children:T&&!v?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:e(G,{id:"3wG7HI"})}),e("p",{title:ne,children:s.description||e("i",{children:"No description"})})]}):e("textarea",{ref:Z,value:ne||"",lang:n,placeholder:{image:r({id:"Lh8B0N"}),video:r({id:"mN4S+e"}),audio:r({id:"ieZytw"})}[U],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:t||p==="loading",class:p==="loading"?"loading":"",maxlength:"1500",onInput:I=>{const{value:K}=I.target;X(K)}})}),V=q(null);oe(()=>()=>{var I,K;(K=(I=V.current)==null?void 0:I.hideToast)==null||K.call(I)},[]);const ie=q(null),Q=I=>{const{type:K,details:m}=I;switch(K){case"imageSizeLimit":{const{imageSize:ee,imageSizeLimit:D}=m;return r({id:"d83/LB",values:{0:nt(ee),1:nt(D)}})}case"imageMatrixLimit":{const{imageMatrix:ee,imageMatrixLimit:D,width:ue,height:ae}=m,{newWidth:be,newHeight:xe}=sn(ee,D,ue,ae);return r({id:"TQrVea",values:{2:d.number(ue),3:d.number(ae),4:d.number(be),5:d.number(xe)}})}case"videoSizeLimit":{const{videoSize:ee,videoSizeLimit:D}=m;return r({id:"J5GTer",values:{6:nt(ee),7:nt(D)}})}case"videoMatrixLimit":{const{videoMatrix:ee,videoMatrixLimit:D,width:ue,height:ae}=m,{newWidth:be,newHeight:xe}=sn(ee,D,ue,ae);return r({id:"OG73zj",values:{8:d.number(ue),9:d.number(ae),10:d.number(be),11:d.number(xe)}})}case"videoFrameRateLimit":return r({id:"S1fBwy"})}};return e(qe,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{j(!0)},children:U==="image"?e("img",{src:E,alt:"",onLoad:I=>{if(!R)return;const{naturalWidth:K,naturalHeight:m}=I.target;M({matrix:K*m,width:K,height:m})}}):U==="video"||U==="gifv"?e("video",{src:E+"#t=0.1",playsinline:!0,muted:!0,disablePic
//# sourceMappingURL=compose-8rrDtgaW.js.map