1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`b78958ff758bb53e54a65080c20433eb04e35ca5`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`dd563377-1eab-44c8-90f5-8c6998fc917f`,e._sentryDebugIdIdentifier=`sentry-dbid-dd563377-1eab-44c8-90f5-8c6998fc917f`)}catch{}})();import{o as e}from"./rolldown-runtime-mHe5nTj_.js";import{R as t}from"./internal-utils-B_2oL_ii.js";var n=e(t(),1),r={1:6,2:12,3:4,4:3,5:8,6:9},i=6,a=Object.entries(r).map(([e,t])=>({span:Number(e),columns:t})),o=e=>a.reduce((t,n)=>{let r=Math.abs(n.columns-e),i=Math.abs(t.columns-e);return r<i||r===i&&n.columns<t.columns?n:t}).span,s=(e,t,n,r,i)=>{let a=Math.min(Math.max(Math.round(n),3),12);return{w:a,h:Math.min(Math.max(Math.round(r),u(i)),24),x:Math.min(Math.max(Math.round(e),0),12-a),y:Math.max(Math.round(t),0)}},c=e=>typeof e?.x==`number`&&typeof e?.y==`number`&&typeof e?.w==`number`&&typeof e?.h==`number`,l={"widget-divider":{min:1,initial:1},"widget-text":{min:2,initial:2},"widget-link":{min:2,initial:3},"widget-number":{min:3,initial:3},"widget-image":{min:3,initial:6},"widget-table":{min:4,initial:8}},u=e=>l[e??``]?.min??5,d=e=>l[e??``]?.initial??(e?.includes(`table`)?11:9),f=(e,t,n)=>{let a=t??new Map,o=[],l=[];(e??[]).forEach((e,t)=>{let r=a.get(e);if(c(r)){o.push({i:e,...s(r.x,r.y,r.w,r.h,n?.[e])});return}l.push({id:e,order:r?.order,span:r?.span,index:t})});let u=o.reduce((e,t)=>Math.max(e,t.y+t.h),0),f=[],p=0,m=u,h=0;return l.slice().sort((e,t)=>(e.order??2**53-1)-(t.order??2**53-1)||e.index-t.index).forEach(({id:e,span:t})=>{let a=r[t??0]??i,o=d(n?.[e]);p+a>12&&(p=0,m+=h,h=0),f.push({i:e,x:p,y:m,w:a,h:o}),p+=a,h=Math.max(h,o)}),[...o,...f]},p=(e,t)=>{let n=new Map(t??[]);return e.slice().sort((e,t)=>
1e.y-t.y||e.x-t.x).forEach((e,t)=>{n.set(e.i,{...n.get(e.i),x:e.x,y:e.y,w:e.w,h:e.h,order:t+1,span:o(e.w)})}),n},m=e=>e*40+(e-1)*16,h=e=>{let t=Math.floor((e-176)/12);return!Number.isFinite(t)||t<=0?e:t*12+176},g=()=>{let[e,t]=(0,n.useState)({width:0,height:0}),r=(0,n.useRef)(null),i=(0,n.useCallback)(e=>{if(r.current?.disconnect(),r.current=null,!e)return;let n=new ResizeObserver(e=>{let n=e[0]?.contentRect;n&&t(e=>e.width===n.width&&e.height===n.height?e:{width:n.width,height:n.height})});n.observe(e),r.current=n,t(t=>t.width===e.clientWidth&&t.height===e.clientHeight?t:{width:e.clientWidth,height:e.clientHeight})},[]);return(0,n.useEffect)(()=>()=>r.current?.disconnect(),[]),[i,e]},_=`__add-panel-tile__`,v=e=>{let t=0;return(e??[]).forEach(e=>{let n=Math.min(Math.max(Math.round(e)||6,1),12);t=t+n>12?n:t+n}),12-t},y=e=>{let t=v(e);return t>=3?t:6},b=e=>r[e??0]??6,x=(e,t)=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h,S=e=>{let t=e??[],n={x:0,y:t.reduce((e,t)=>Math.max(e,t.y+t.h),0),w:6,h:5};if(!t.length)return n;let r=t.reduce((e,t)=>t.y>e.y||t.y===e.y&&t.x>e.x?t:e),i=r.x+r.w,a=12-i;if(a<3)return n;let o={x:i,y:r.y,w:a,h:Math.max(r.h,5)};return t.some(e=>x(o,e))?n:o};export{g as a,d as c,p as d,h as f,b as i,u as l,y as n,r as o,S as r,m as s,_ as t,f as u}; 2//# sourceMappingURL=addPanelTilePlacement-Cgebj_ZV.js.map
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.