Files

11 lines
87 KiB
JavaScript
Raw Permalink Normal View History

2026-10-19 17:33:22 +03:00
var Yt=Math.min,yt=Math.max,Kt=Math.round;var ot=n=>({x:n,y:n}),on={left:"right",right:"left",bottom:"top",top:"bottom"};function Re(n,t,e){return yt(n,Yt(t,e))}function jt(n,t){return typeof n=="function"?n(t):n}function wt(n){return n.split("-")[0]}function Ut(n){return n.split("-")[1]}function Me(n){return n==="x"?"y":"x"}function _e(n){return n==="y"?"height":"width"}function pt(n){let t=n[0];return t==="t"||t==="b"?"y":"x"}function Pe(n){return Me(pt(n))}function ni(n,t,e){e===void 0&&(e=!1);let i=Ut(n),s=Pe(n),o=_e(s),r=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Xt(r)),[r,Xt(r)]}function si(n){let t=Xt(n);return[ce(n),t,ce(t)]}function ce(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var ei=["left","right"],ii=["right","left"],rn=["top","bottom"],an=["bottom","top"];function ln(n,t,e){switch(n){case"top":case"bottom":return e?t?ii:ei:t?ei:ii;case"left":case"right":return t?rn:an;default:return[]}}function oi(n,t,e,i){let s=Ut(n),o=ln(wt(n),e==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(ce)))),o}function Xt(n){let t=wt(n);return on[t]+n.slice(t.length)}function cn(n){return{top:0,right:0,bottom:0,left:0,...n}}function ri(n){return typeof n!="number"?cn(n):{top:n,right:n,bottom:n,left:n}}function xt(n){let{x:t,y:e,width:i,height:s}=n;return{width:i,height:s,top:e,left:t,right:t+i,bottom:e+s,x:t,y:e}}function ai(n,t,e){let{reference:i,floating:s}=n,o=pt(t),r=Pe(t),a=_e(r),l=wt(t),c=o==="y",h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,p=i[a]/2-s[a]/2,f;switch(l){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-s.width,y:u};break;default:f={x:i.x,y:i.y}}switch(Ut(t)){case"start":f[r]-=p*(e&&c?-1:1);break;case"end":f[r]+=p*(e&&c?-1:1);break}return f}async function li(n,t){var e;t===void 0&&(t={});let{x:i,y:s,platform:o,rects:r,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=jt(t,n),m=ri(f),S=a[p?u==="floating"?"reference":"floating":u],O=xt(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(S)))==null||e?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=u==="floating"?{x:i,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},M=xt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(O.top-M.top+m.top)/A.y,bottom:(M.bottom-O.bottom+m.bottom)/A.y,left:(O.left-M.left+m.left)/A.x,right:(M.right-O.right+m.right)/A.x}}var un=50,ci=async(n,t,e)=>{let{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:li},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:u}=ai(c,i,l),p=i,f=0,m={};for(let g=0;g<o.length;g++){let S=o[g];if(!S)continue;let{name:O,fn:w}=S,{x,y:A,data:M,reset:C}=await w({x:h,y:u,initialPlacement:i,placement:p,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:n,floating:t}});h=x??h,u=A??u,m[O]={...m[O],...M},C&&f<un&&(f++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:n,floating:t,strategy:s}):C.rects),{x:h,y:u}=ai(c,p,l)),g=-1)}return{x:h,y:u,placement:p,strategy:s,middlewareData:m}};var ui=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlign
2026-09-28 20:53:46 +03:00
/*! Bundled license information:
sortablejs/modular/sortable.esm.js:
(**!
* Sortable 1.15.7
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*)
*/