PageSourceSearch

https://roualdes.us/_npm/[email protected]/d162d8c6.js

js roualdes.us collected 2026-09-28 05:45:29 UTC 9,795 bytes, 7 lines download raw bytes

vendor: 9,795 bytes, lines 1-7
1/**
2 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.
3 * Original file: /npm/[email protected]/src/index.js
4 *
5 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6 */
7import{dispatch as At}from"../[email protected]/3fb06f14.js";import{dragDisable as zt,dragEnable as Dt}from"../[email protected]/20b76948.js";import{interpolate as Xt}from"../[email protected]/e0a47f97.js";import{select as W,pointer as pt}from"../[email protected]/28717d05.js";import{interrupt as mt}from"../[email protected]/bd07fd9a.js";var et=t=>()=>t;function Yt(t,{sourceEvent:E,target:I,selection:R,mode:M,dispatch:P}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},target:{value:I,enumerable:!0,configurable:!0},selection:{value:R,enumerable:!0,configurable:!0},mode:{value:M,enumerable:!0,configurable:!0},_:{value:P}})}function Mt(t){t.stopImmediatePropagation()}function nt(t){t.preventDefault(),t.stopImmediatePropagation()}var bt={name:"drag"},rt={name:"space"},B={name:"handle"},G={name:"center"};const{abs:dt,max:k,min:_}=Math;function yt(t){return[+t[0],+t[1]]}function it(t){return[yt(t[0]),yt(t[1])]}var Z={name:"x",handles:["w","e"].map(q),input:function(t,E){return t==null?null:[[+t[0],E[0][1]],[+t[1],E[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},$={name:"y",handles:["n","s"].map(q),input:function(t,E){return t==null?null:[[E[0][0],+t[0]],[E[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},St={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(q),input:function(t){return t==null?null:it(t)},output:function(t){return t}},Y={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},gt={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},wt={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Tt={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Kt={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function q(t){return{type:t}}function Ot(t){return!t.ctrlKey&&!t.button}function Pt(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Ct(){return navigator.maxTouchPoints||"ontouchstart"in this}function st(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Nt(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Vt(t){var E=t.__brush;return E?E.dim.output(E.selection):null}function Bt(){return ut(Z)}function Gt(){return ut($)}function It(){return ut(St)}function ut(t){var E=Pt,I=Ot,R=Ct,M=!0,P=At("start","brush","end"),D=6,j;function p(e){var n=e.property("__brush",_t).selectAll(".overlay").data([q("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Y.overlay).merge(n).each(function(){var r=st(this).extent;W(this).attr("x",r[0][0]).attr("y",r[0][1]).attr("width",r[1][0]-r[0][0]).attr("height",r[1][1]-r[0][1])}),e.selectAll(".selection").data([q("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Y.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var s=e.selectAll(".handle").data(t.handles,function(r){return r.type});s.exit().remove(),s.enter().append("rect").attr("class",function(r){return"handle handle--"+r.type}).attr("cursor",function(r){return Y[r.type]}),e.each(V).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",ot).filter(R).on("touchstart.brush",ot).on("touchmove.brush",vt).on("touchend.brush touchcancel.brush",kt).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.move=function(e,n,s){e.tween?e.on("start.brush",function(r){C(this,arguments).beforestart().start(r)}).on("interrupt.brush end.brush",function(r){C(this,arguments).end(r)}).tween("brush",function(){var r=this,u=r.__brush,a=C(r,arguments),x=u.selection,X=t.input(typeof n=="function"?n.apply(this,arguments):n,u.extent),l=Xt(x,X);function z(o){u.selection=o===1&&X===null?null:l(o),V.call(r),a.brush()}return x!==null&&X!==null?z:z(1)}):e.each(function(){var r=this,u=arguments,a=r.__brush,x=t.input(typeof n=="function"?n.apply(r,u):n,a.extent),X=C(r,u).beforestart();mt(r),a.selection=x===null?null:x,V.call(r),X.start(s).brush(s).end(s)})},p.clear=function(e,n){p.move(e,null,n)};function V(){var e=W(this),n=st(this).selection;n?(e.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),e.selectAll(".handle").style("display",null).attr("x",function(s){return s.type[s.type.length-1]==="e"?n[1][0]-D/2:n[0][0]-D/2}).attr("y",function(s){return s.type[0]==="s"?n[1][1]-D/2:n[0][1]-D/2}).attr("width",function(s){return s.type==="n"||s.type==="s"?n[1][0]-n[0][0]+D:D}).attr("height",function(s){return s.type==="e"||s.type==="w"?n[1][1]-n[0][1]+D:D})):e.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function C(e,n,s){var r=e.__brush.emitter;return r&&(!s||!r.clean)?r:new at(e,n,s)}function at(e,n,s){this.that=e,this.args=n,this.state=e.__brush,this.active=0,this.clean=s}at.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(e,n){return this.starting?(this.starting=!1,this.emit("start",e,n)):this.emit("brush",e),this},brush:function(e,n){return this.emit("brush",e,n),this},end:function(e,n){return--this.active===0&&(delete this.state.emitter,this.emit("end",e,n)),this},emit:function(e,n,s){var r=W(this.that).datum();P.call(e,this.that,new Yt(e,{sourceEvent:n,target:p,selection:t.output(this.state.selection),mode:s,dispatch:P}),r)}};function ot(e){if(j&&!e.touches||!I.apply(this,arguments))return;var n=this,s=e.target.__data__.type,r=(M&&e.metaKey?s="overlay":s)==="selection"?bt:M&&e.altKey?G:B,u=t===$?null:Tt[s],a=t===Z?null:Kt[s],x=st(n),X=x.extent,l=x.selection,z=X[0][0],o,m,S=X[0][1],b,d,T=X[1][0],y,g,K=X[1][1],w,v,c=0,f=0,tt,J=u&&a&&M&&e.shiftKey,Q,U,A=Array.from(e.touches||[e],i=>{const h=i.identifier;return i=pt(i,n),i.point0=i.slice(),i.identifier=h,i});mt(n);var F=C(n,arguments,!0).beforestart();if(s==="overlay"){l&&(tt=!0);const i=[A[0],A[1]||A[0]];x.selection=l=[[o=t===$?z:_(i[0][0],i[1][0]),b=t===Z?S:_(i[0][1],i[1][1])],[y=t===$?T:k(i[0][0],i[1][0]),w=t===Z?K:k(i[0][1],i[1][1])]],A.length>1&&N(e)}else o=l[0][0],b=l[0][1],y=l[1][0],w=l[1][1];m=o,d=b,g=y,v=w;var lt=W(n).attr("pointer-events","none"),H=lt.selectAll(".overlay").attr("cursor",Y[s]);if(e.touches)F.moved=ft,F.ended=ht;else{var ct=W(e.view).on("mousemove.brush",ft,!0).on("mouseup.brush",ht,!0);M&&ct.on("keydown.brush",Et,!0).on("keyup.brush",xt,!0),zt(e.view)}V.call(n),F.start(e,r.name);function ft(i){for(const h of i.changedTouches||[i])for(const L of A)L.identifier===h.identifier&&(L.cur=pt(h,n));if(J&&!Q&&!U&&A.length===1){const h=A[0];dt(h.cur[0]-h[0])>dt(h.cur[1]-h[1])?U=!0:Q=!0}for(const h of A)h.cur&&(h[0]=h.cur[0],h[1]=h.cur[1]);tt=!0,nt(i),N(i)}function N(i){const h=A[0],L=h.point0;var O;switch(c=h[0]-L[0],f=h[1]-L[1],r){case rt:case bt:{u&&(c=k(z-o,_(T-y,c)),m=o+c,g=y+c),a&&(f=k(S-b,_(K-w,f)),d=b+f,v=w+f);break}case B:{A[1]?(u&&(m=k(z,_(T,A[0][0])),g=k(z,_(T,A[1][0])),u=1),a&&(d=k(S,_(K,A[0][1])),v=k(S,_(K,A[1][1])),a=1)):(u<0?(c=k(z-o,_(T-o,c)),m=o+c,g=y):u>0&&(c=k(z-y,_(T-y,c)),m=o,g=y+c),a<0?(f=k(S-b,_(K-b,f)),d=b+f,v=w):a>0&&(f=k(S-w,_(K-w,f)),d=b,v=w+f));break}case G:{u&&(m=k(z,_(T,o-c*u)),g=k(z,_(T,y+c*u))),a&&(d=k(S,_(K,b-f*a)),v=k(S,_(K,w+f*a)));break}}g<m&&(u*=-1,O=o,o=y,y=O,O=m,m=g,g=O,s in gt&&H.attr("cursor",Y[s=gt[s]])),v<d&&(a*=-1,O=b,b=w,w=O,O=d,d=v,v=O,s in wt&&H.attr("cursor",Y[s=wt[s]])),x.selection&&(l=x.selection),Q&&(m=l[0][0],g=l[1][0]),U&&(d=l[0][1],v=l[1][1]),(l[0][0]!==m||l[0][1]!==d||l[1][0]!==g||l[1][1]!==v)&&(x.selection=[[m,d],[g,v]],V.call(n),F.brush(i,r.name))}function ht(i){if(Mt(i),i.touches){if(i.touches.length)return;j&&clearTimeout(j),j=setTimeout(function(){j=null},500)}else Dt(i.view,tt),ct.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);lt.attr("pointer-events","all"),H.attr("cursor",Y.overlay),x.selection&&(l=x.selection),Nt(l)&&(x.selection=null,V.call(n)),F.end(i,r.name)}function Et(i){switch(i.keyCode){case 16:{J=u&&a;break}case 18:{r===B&&(u&&(y=g-c*u,o=m+c*u),a&&(w=v-f*a,b=d+f*a),r=G,N(i));break}case 32:{(r===B||r===G)&&(u<0?y=g-c:u>0&&(o=m-c),a<0?w=v-f:a>0&&(b=d-f),r=rt,H.attr("cursor",Y.selection),N(i));break}default:return}nt(i)}function xt(i){switch(i.keyCode){case 16:{J&&(Q=U=J=!1,N(i));break}case 18:{r===G&&(u<0?y=g:u>0&&(o=m),a<0?w=v:a>0&&(b=d),r=B,N(i));break}case 32:{r===rt&&(i.altKey?(u&&(y=g-c*u,o=m+c*u),a&&(w=v-f*a,b=d+f*a),r=G):(u<0?y=g:u>0&&(o=m),a<0?w=v:a>0&&(b=d),r=B),H.attr("cursor",Y[s]),N(i));break}default:return}nt(i)}}function vt(e){C(this,arguments).moved(e)}function kt(e){C(this,arguments).ended(e)}function _t(){var e=this.__brush||{selection:null};return e.extent=it(E.apply(this,arguments)),e.dim=t,e}return p.extent=function(e){return arguments.length?(E=typeof e=="function"?e:et(it(e)),p):E},p.filter=function(e){return arguments.length?(I=typeof e=="function"?e:et(!!e),p):I},p.touchable=function(e){return arguments.length?(R=typeof e=="function"?e:et(!!e),p):R},p.handleSize=function(e){return arguments.length?(D=+e,p):D},p.keyModifiers=function(e){return arguments.length?(M=!!e,p):M},p.on=function(){var e=P.on.apply(P,arguments);return e===P?p:e},p}export{It as brush,Vt as brushSelection,Bt as brushX,Gt as brushY};

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.