"use strict";(self.webpackChunk_deathbeds_jupyterlab_deck=self.webpackChunk_deathbeds_jupyterlab_deck||[]).push([[450],{450:(t,e,s)=>{s.r(e),s.d(e,{Layover:()=>r});var n=s(169),d=s(526),l=s(992),o=s(334),a=s(152),i=s(342);class r extends l.Widget{constructor(t){super(t),this._d3=null,this._drag=null,this.render=()=>{const t=a.Z(this.node).selectAll(`.${i.ux.layoverPart}`).data(this.model.partData,r.getPartKey).join("div").classed(i.ux.layoverPart,!0).style("left",(({bounds:t})=>`${t.left}px`)).style("top",(({bounds:t})=>`${t.top}px`)).style("height",(({bounds:t})=>`${t.height}px`)).style("width",(({bounds:t})=>`${t.width}px`)).call(r.boxDrag);t.selectAll(`.${i.ux.layoverPartLabel}`).data(((t,e)=>[e])).join("div").classed(i.ux.layoverPartLabel,!0).text((t=>t+1)),t.selectAll(`.${i.ux.layoverHandle}`).data(r.handleData).join("div").attr("class",r.getHandleClass).classed(i.ux.layoverHandle,!0).call(r.handleDrag.container(this.node)),t.selectAll(`.${i.ux.layoverUnstyle}`).data(r.resetData).join("button").classed(i.ux.layoverUnstyle,!0).text("↺").on("click",r.onReset)},this.addClass(i.ux.layover),this._model=new r.Model,document.body.appendChild(this.node),this.model.stateChanged.connect(this.render,this),window.addEventListener("resize",this.render),document.body.dataset[i.D_.layoutMode]=i.D_.designing,this.render()}dispose(){if(this.isDisposed)return;this.model.dispose();const{node:t}=this;super.dispose(),document.body.removeChild(t),window.removeEventListener("resize",this.render),delete document.body.dataset[i.D_.layoutMode]}get model(){return this._model}}!function(t){class e extends n.VDomModel{constructor(){super(...arguments),this._parts=[],this._partDatum=t=>{const{left:e,top:s,width:n,height:d}=t.node.getBoundingClientRect();let l=parseFloat(window.getComputedStyle(t.node).getPropertyValue("zoom")||"1.0");return{...t,bounds:{left:e*l,top:s*l,width:n*l,height:d*l}}}}get partData(){return this._parts.map(this._partDatum)}get parts(){return this._parts}set parts(t){this._parts=t,this.stateChanged.emit(void 0)}}function s(t){const{bounds:e}=t,{innerWidth:s,innerHeight:n}=window;t.setStyles({...t.getStyles()||d.JSONExt.emptyObject,position:"fixed",left:e.left/s*100+"%",top:e.top/n*100+"%",width:e.width/s*100+"%",height:e.height/n*100+"%"})}t.Model=e,t.resetData=function(t){let e=t.getStyles();return e&&"fixed"===e.position?[t]:[]},t.onReset=function(t,e){let s=e.getStyles()||d.JSONExt.emptyObject;e.setStyles({...s,position:null,left:null,top:null,width:null,height:null})},t.getPartKey=function(t){return t.key},t.getHandleClass=function(t){return`${i.ux.layoverHandle}-${t.handle}`},t.boxDrag=(0,o.drag)().on("start",(function(t,e){a.Z(this).classed(i.ux.dragging,!0)})).on("drag",(function(t,e){e.bounds.left+=t.dx,e.bounds.top+=t.dy,a.Z(this).style("left",`${e.bounds.left}px`).style("top",`${e.bounds.top}px`)})).on("end",(function(t,e){a.Z(this).classed(i.ux.dragging,!1),s(e)})),t.handleDrag=(0,o.drag)().on("start",(function(t,e){a.Z(this.parentElement).classed(i.ux.dragging,!0)})).on("drag",(function(t,e){let{dx:s,dy:n}=t,{bounds:d}=e.part,l=e.handle;l.includes("n")?(d.top+=n,d.height-=n):l.includes("s")&&(d.height+=n),l.includes("w")?(d.left+=s,d.width-=s):l.includes("e")&&(d.width+=s),a.Z(this.parentElement).style("left",`${d.left}px`).style("top",`${d.top}px`).style("height",`${d.height}px`).style("width",`${d.width}px`)})).on("end",(function(t,e){a.Z(this.parentElement).classed(i.ux.dragging,!1),s(e.part)})),t.handleData=function(t){let e=[];for(const s of l)e.push({part:t,handle:s});return e};const l=["nw","n","ne","w","e","sw","s","se"]}(r||(r={}))}}]);
//# sourceMappingURL=450.456a1ef519c6cf962c6a.js.map?v=456a1ef519c6cf962c6a