PageSourceSearch

https://magiclight.ai/assets/DKcQNQ_N.js

js magiclight.ai collected 2026-09-24 11:19:24 UTC 3,649 bytes, 1 lines download raw bytes

1import{d as ne,r as o,v as oe,c as k,w as le,n as y,o as se,j as re,M as z,N as F,Q as R,a2 as ce,a3 as H,ak as ue,an as ie,_ as de}from"./O4ENX8gu.js";const me={class:"magic-textarea"},ve=["id","name","value","placeholder","maxlength","disabled"],D=20,pe=ne({__name:"magic-textarea",props:{modelValue:{default:""},placeholder:{default:""},maxlength:{default:void 0},disabled:{type:Boolean,default:!1},id:{default:void 0},name:{default:void 0}},emits:["update:modelValue","beforeInput","focus","blur","paste"],setup($,{emit:Y}){var N;const l=$,r=Y,s=o(null),b=o(null),m=o(!1),v=o(0),c=o(0),u=o(0),p=o(1),f=o(!1),_=o(0),S=o(0);let B=0,i=null;const w=oe(),I="magic-textarea-".concat((N=w==null?void 0:w.uid)!=null?N:"field"),j=k(()=>l.id||I),U=k(()=>l.name||l.id||I),M=(e,t,a)=>Math.max(t,Math.min(a,e)),C=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},Q=()=>{var h;const e=s.value;if(!e)return;const t=e.style.paddingRight;e.style.paddingRight="";const a=window.getComputedStyle(e),n=window.getComputedStyle((h=e.parentElement)!=null?h:e);_.value=C(a.paddingRight),S.value=C(n.getPropertyValue("--magic-textarea-track-width")),e.style.paddingRight=t},Z=k(()=>{const e=m.value?_.value+S.value:_.value;return{paddingRight:"".concat(e,"px")}}),E=e=>{if(!m.value||u.value<=0){c.value=0;return}const t=Math.round(e/p.value);c.value=M(t,0,u.value)},g=()=>{const e=s.value;if(!e)return;Q();const{clientHeight:t,offsetHeight:a,scrollHeight:n,scrollTop:h}=e,P=n>t+1;if(m.value=P,!P){v.value=0,c.value=0,u.value=0,p.value=1;return}const x=Math.max(a,t),te=Math.round(x/Math.min(n/t,x/D)),L=M(te,D,x),T=Math.max(x-L,0),ae=T>0?(n-t)/T:1;v.value=L,u.value=T,p.value=ae,E(h)},V=e=>{const t=s.value;if(!t)return;const a=M(e,0,u.value);c.value=a,t.scrollTo({top:Math.round(a*p.value)})},q=e=>{const t=e.target;t&&E(t.scrollTop)},O=e=>{const t=b.value;if(!t||!f.value)return;const a=t.getBoundingClientRect().top,n=e.clientY-a-B;V(n)},d=()=>{f.value=!1,window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",d),window.removeEventListener("contextmenu",d)},A=e=>{var a,n;e.preventDefault(),e.stopPropagation();const t=(n=(a=e.currentTarget)==null?void 0:a.getBoundingClientRect().top)!=null?n:0;B=e.clientY-t,f.value=!0,window.addEventListener("mousemove",O),window.addEventListener("mouseup",d),window.addEventListener("contextmenu",d)},G=e=>{const t=b.value;if(!t)return;const a=t.getBoundingClientRect().top,n=e.clientY-a-v.value/2;V(n)},J=e=>{const t=e.target;t&&(r("update:modelValue",t.value),y(()=>{g()}))},K=e=>{e instanceof InputEvent&&r("beforeInput",e)},W=e=>{r("paste",e)},X=e=>{r("focus",e)},ee=e=>{r("blur",e)};return le(()=>l.modelValue,()=>{y(()=>{g()})}),se(()=>{y(()=>{g()}),typeof ResizeObserver<"u"&&s.value&&(i=new ResizeObserver(()=>{g()}),i.observe(s.value))}),re(()=>{d(),i==null||i.disconnect()}),(e,t)=>(F(),z("div",me,[R("textarea",{id:j.value,ref_key:"textareaRef",ref:s,name:U.value,class:"magic-textarea__inner",style:H(Z.value),value:l.modelValue,placeholder:l.placeholder,maxlength:l.maxlength,disabled:l.disabled,onBeforeinput:K,onInput:J,onPaste:W,onScroll:q,onFocus:X,onBlur:ee},null,44,ve),m.value?(F(),z("div",{key:0,ref_key:"verticalTrackRef",ref:b,class:"magic-textarea__track",onMousedown:ue(G,["self"])},[R("div",{class:ie(["magic-textarea__thumb",{"magic-textarea__thumb--dragging":f.value}]),style:H({height:"".concat(v.value,"px"),top:"".concat(c.value,"px")}),onMousedown:A},[...t[0]||(t[0]=[R("div",{class:"magic-textarea__thumb-bar"},null,-1)])],38)],544)):ce("",!0)]))}}),ge=Object.assign(de(pe,[["__scopeId","data-v-5f51bdc7"]]),{__name:"CommonMagicTextarea"});export{ge as M};

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.