floating-ui.dom.system.min.js 37.7 KB
Newer Older
1
System.register([],(function(t){"use strict";return{execute:function(){function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(){r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),c=new j(r||[]);return i(a,"_invoke",{value:S(t,n,c)}),a}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",d="suspendedYield",v="executing",m="completed",y={};function g(){}function b(){}function x(){}var w={};l(w,c,(function(){return this}));var k=Object.getPrototypeOf,O=k&&k(k(D([])));O&&O!==n&&o.call(O,c)&&(w=O);var E=x.prototype=g.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(r,i,a,c){var u=p(t[r],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function S(e,n,r){var o=h;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=P(c,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var f=p(e,n,r);if("normal"===f.type){if(o=r.done?m:d,f.arg===y)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(o=m,r.method="throw",r.arg=f.arg)}}}function P(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=x,i(E,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},L(A.prototype),l(A.prototype,u,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new A(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(E),l(E,f,"Generator"),l(E,c,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=D,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function c(t){a(i,r,o,c,u,"next",t)}function u(t){a(i,r,o,c,u,"throw",t)}c(void 0)}))}}function u(t,e,n){return(e=o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function l(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}t({autoUpdate:function(t,e,n,r){void 0===r&&(r={});var o=r.ancestorScroll,i=void 0===o||o,a=r.ancestorResize,c=void 0===a||a,u=r.elementResize,f=void 0===u?"function"==typeof ResizeObserver:u,l=r.layoutShift,s=void 0===l?"function"==typeof IntersectionObserver:l,h=r.animationFrame,d=void 0!==h&&h,y=kt(t),g=i||c?m(m([],v(y?xt(y):[]),!1),v(xt(e)),!1):[];g.forEach((function(t){i&&t.addEventListener("scroll",n,{passive:!0}),c&&t.addEventListener("resize",n)}));var b,k=y&&s?function(t,e){var n,r=null,o=at(t);function i(){clearTimeout(n),r&&r.disconnect(),r=null}function a(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();var f=t.getBoundingClientRect(),l=f.left,s=f.top,h=f.width,d=f.height;if(c||e(),h&&d){var v=O(s),m=O(o.clientWidth-(l+h)),y=O(o.clientHeight-(s+d)),g=O(l),b={rootMargin:"".concat(-v,"px ").concat(-m,"px ").concat(-y,"px ").concat(-g,"px"),threshold:w(0,x(1,u))||1},k=!0;try{r=new IntersectionObserver(E,p(p({},b),{root:o.ownerDocument}))}catch(t){r=new IntersectionObserver(E,b)}r.observe(t)}function E(t){var e=t[0].intersectionRatio;if(e!==u){if(!k)return a();e?a(!1,e):n=setTimeout((function(){a(!1,1e-7)}),100)}k=!1}}return a(!0),i}(y,n):null,E=-1,L=null;f&&(L=new ResizeObserver((function(t){var r=v(t,1)[0];r&&r.target===y&&L&&(L.unobserve(e),cancelAnimationFrame(E),E=requestAnimationFrame((function(){L&&L.observe(e)}))),n()})),y&&!d&&L.observe(y),L.observe(e));var A=d?At(t):null;d&&function e(){var r=At(t);!A||r.x===A.x&&r.y===A.y&&r.width===A.width&&r.height===A.height||n();A=r,b=requestAnimationFrame(e)}();return n(),function(){g.forEach((function(t){i&&t.removeEventListener("scroll",n),c&&t.removeEventListener("resize",n)})),k&&k(),L&&L.disconnect(),L=null,d&&cancelAnimationFrame(b)}},detectOverflow:X,getOverflowAncestors:xt});var p=function(){return p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},p.apply(this,arguments)};function h(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))}function d(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function v(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function m(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var y=["top","right","bottom","left"],g=["start","end"],b=y.reduce((function(t,e){return t.concat(e,e+"-"+g[0],e+"-"+g[1])}),[]),x=Math.min,w=Math.max,k=Math.round,O=Math.floor,E=function(t){return{x:t,y:t}},L={left:"right",right:"left",bottom:"top",top:"bottom"},A={start:"end",end:"start"};function S(t,e,n){return w(t,x(e,n))}function P(t,e){return"function"==typeof t?t(e):t}function R(t){return t.split("-")[0]}function T(t){return t.split("-")[1]}function j(t){return"x"===t?"y":"x"}function D(t){return"y"===t?"height":"width"}function C(t){return["top","bottom"].includes(R(t))?"y":"x"}function F(t){return j(C(t))}function _(t,e,n){void 0===n&&(n=!1);var r=T(t),o=F(t),i=D(o),a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=B(a)),[a,B(a)]}function H(t){var e=B(t);return[N(t),e,N(e)]}function N(t){return t.replace(/start|end/g,(function(t){return A[t]}))}function W(t,e,n,r){var o=T(t),i=function(t,e,n){var r=["left","right"],o=["right","left"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?["top","bottom"]:["bottom","top"];default:return[]}}(R(t),"start"===n,r);return o&&(i=i.map((function(t){return t+"-"+o})),e&&(i=i.concat(i.map(N)))),i}function B(t){return t.replace(/left|right|bottom|top/g,(function(t){return L[t]}))}function I(t){return"number"!=typeof t?function(t){return n({top:0,right:0,bottom:0,left:0},t)}(t):{top:t,right:t,bottom:t,left:t}}function G(t){return n(n({},t),{},{top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height})}var M=["crossAxis","alignment","allowedPlacements","autoAlignment"],V=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],z=["strategy"],Y=["mainAxis","crossAxis","limiter"],$=["apply"];function q(t,e,n){var r,o=t.reference,i=t.floating,a=C(e),c=F(e),u=D(c),f=R(e),l="y"===a,s=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,h=o[u]/2-i[u]/2;switch(f){case"top":r={x:s,y:o.y-i.height};break;case"bottom":r={x:s,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:p};break;case"left":r={x:o.x-i.width,y:p};break;default:r={x:o.x,y:o.y}}switch(T(e)){case"start":r[c]-=h*(n&&l?-1:1);break;case"end":r[c]+=h*(n&&l?-1:1)}return r}var U=function(){var t=c(r().mark((function t(e,o,a){var c,f,l,s,p,h,d,v,m,y,g,b,x,w,k,O,E,L,A,S,P,R,T,j,D,C;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=a.placement,f=void 0===c?"bottom":c,l=a.strategy,s=void 0===l?"absolute":l,p=a.middleware,h=void 0===p?[]:p,d=a.platform,v=h.filter(Boolean),t.next=4,null==d.isRTL?void 0:d.isRTL(o);case 4:return m=t.sent,t.next=7,d.getElementRects({reference:e,floating:o,strategy:s});case 7:y=t.sent,g=q(y,f,m),b=g.x,x=g.y,w=f,k={},O=0,E=0;case 13:if(!(E<v.length)){t.next=46;break}return L=v[E],A=L.name,S=L.fn,t.next=17,S({x:b,y:x,initialPlacement:f,placement:w,strategy:s,middlewareData:k,rects:y,platform:d,elements:{reference:e,floating:o}});case 17:if(P=t.sent,R=P.x,T=P.y,j=P.data,D=P.reset,b=null!=R?R:b,x=null!=T?T:x,k=n(n({},k),{},u({},A,n(n({},k[A]),j))),!(D&&O<=50)){t.next=43;break}if(O++,"object"!==i(D)){t.next=41;break}if(D.placement&&(w=D.placement),!D.rects){t.next=38;break}if(!0!==D.rects){t.next=36;break}return t.next=33,d.getElementRects({reference:e,floating:o,strategy:s});case 33:t.t0=t.sent,t.next=37;break;case 36:t.t0=D.rects;case 37:y=t.t0;case 38:C=q(y,w,m),b=C.x,x=C.y;case 41:return E=-1,t.abrupt("continue",43);case 43:E++,t.next=13;break;case 46:return t.abrupt("return",{x:b,y:x,placement:w,strategy:s,middlewareData:k});case 47:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}();function X(t,e){return J.apply(this,arguments)}function J(){return J=c(r().mark((function t(e,o){var i,a,c,u,f,l,s,p,h,d,v,m,y,g,b,x,w,k,O,E,L,A,S,R,T;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===o&&(o={}),a=e.x,c=e.y,u=e.platform,f=e.rects,l=e.elements,s=e.strategy,p=P(o,e),h=p.boundary,d=void 0===h?"clippingAncestors":h,v=p.rootBoundary,m=void 0===v?"viewport":v,y=p.elementContext,g=void 0===y?"floating":y,b=p.altBoundary,x=void 0!==b&&b,w=p.padding,k=I(void 0===w?0:w),O="floating"===g?"reference":"floating",E=l[x?O:g],t.t0=G,t.t1=u,t.next=10,null==u.isElement?void 0:u.isElement(E);case 10:if(t.t2=i=t.sent,null==t.t2){t.next=15;break}t.t3=i,t.next=16;break;case 15:t.t3=!0;case 16:if(!t.t3){t.next=20;break}t.t4=E,t.next=26;break;case 20:if(t.t5=E.contextElement,t.t5){t.next=25;break}return t.next=24,null==u.getDocumentElement?void 0:u.getDocumentElement(l.floating);case 24:t.t5=t.sent;case 25:t.t4=t.t5;case 26:return t.t6=t.t4,t.t7=d,t.t8=m,t.t9=s,t.t10={element:t.t6,boundary:t.t7,rootBoundary:t.t8,strategy:t.t9},t.next=33,t.t1.getClippingRect.call(t.t1,t.t10);case 33:return t.t11=t.sent,L=(0,t.t0)(t.t11),A="floating"===g?n(n({},f.floating),{},{x:a,y:c}):f.reference,t.next=38,null==u.getOffsetParent?void 0:u.getOffsetParent(l.floating);case 38:return S=t.sent,t.next=41,null==u.isElement?void 0:u.isElement(S);case 41:if(!t.sent){t.next=50;break}return t.next=44,null==u.getScale?void 0:u.getScale(S);case 44:if(t.t13=t.sent,t.t13){t.next=47;break}t.t13={x:1,y:1};case 47:t.t12=t.t13,t.next=51;break;case 50:t.t12={x:1,y:1};case 51:if(R=t.t12,t.t14=G,!u.convertOffsetParentRelativeRectToViewportRelativeRect){t.next=59;break}return t.next=56,u.convertOffsetParentRelativeRectToViewportRelativeRect({rect:A,offsetParent:S,strategy:s});case 56:t.t15=t.sent,t.next=60;break;case 59:t.t15=A;case 60:return t.t16=t.t15,T=(0,t.t14)(t.t16),t.abrupt("return",{top:(L.top-T.top+k.top)/R.y,bottom:(T.bottom-L.bottom+k.bottom)/R.y,left:(L.left-T.left+k.left)/R.x,right:(T.right-L.right+k.right)/R.x});case 63:case"end":return t.stop()}}),t)}))),J.apply(this,arguments)}t("arrow",(function(t){return{name:"arrow",options:t,fn:function(e){return c(r().mark((function o(){var i,a,c,f,l,s,p,h,d,v,m,y,g,b,w,k,O,E,L,A,R,j,C,_,H,N,W,B,G,M,V,z,Y,$;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=e.x,a=e.y,c=e.placement,f=e.rects,l=e.platform,s=e.elements,p=e.middlewareData,h=P(t,e)||{},d=h.element,v=h.padding,m=void 0===v?0:v,null!=d){r.next=4;break}return r.abrupt("return",{});case 4:return y=I(m),g={x:i,y:a},b=F(c),w=D(b),r.next=10,l.getDimensions(d);case 10:return k=r.sent,E=(O="y"===b)?"top":"left",L=O?"bottom":"right",A=O?"clientHeight":"clientWidth",R=f.reference[w]+f.reference[b]-g[b]-f.floating[w],j=g[b]-f.reference[b],r.next=19,null==l.getOffsetParent?void 0:l.getOffsetParent(d);case 19:if(C=r.sent,_=C?C[A]:0,r.t0=!_,r.t0){r.next=26;break}return r.next=25,null==l.isElement?void 0:l.isElement(C);case 25:r.t0=!r.sent;case 26:if(!r.t0){r.next=28;break}_=s.floating[A]||f.floating[w];case 28:return H=R/2-j/2,N=_/2-k[w]/2-1,W=x(y[E],N),B=x(y[L],N),G=W,M=_-k[w]-B,V=_/2-k[w]/2+H,z=S(G,V,M),Y=!p.arrow&&null!=T(c)&&V!=z&&f.reference[w]/2-(V<G?W:B)-k[w]/2<0,$=Y?V<G?V-G:V-M:0,r.abrupt("return",u(u(u({},b,g[b]+$),"data",n(u(u({},b,z),"centerOffset",V-z-$),Y&&{alignmentOffset:$})),"reset",Y));case 39:case"end":return r.stop()}}),o)})))()}}}));function K(t,e,n){return(t?[].concat(l(n.filter((function(e){return T(e)===t}))),l(n.filter((function(e){return T(e)!==t})))):n.filter((function(t){return R(t)===t}))).filter((function(n){return!t||(T(n)===t||!!e&&N(n)!==n)}))}t("autoPlacement",(function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,fn:function(e){return c(r().mark((function n(){var o,i,a,c,u,s,p,h,d,v,m,y,g,x,w,k,O,E,L,A,S,j,D,C,F,H,N,W;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return c=e.rects,u=e.middlewareData,s=e.placement,p=e.platform,h=e.elements,d=P(t,e),v=d.crossAxis,m=void 0!==v&&v,y=d.alignment,g=d.allowedPlacements,x=void 0===g?b:g,w=d.autoAlignment,k=void 0===w||w,O=f(d,M),E=void 0!==y||x===b?K(y||null,k,x):x,n.next=5,X(e,O);case 5:if(L=n.sent,A=(null==(o=u.autoPlacement)?void 0:o.index)||0,null!=(S=E[A])){n.next=10;break}return n.abrupt("return",{});case 10:return n.t0=_,n.t1=S,n.t2=c,n.next=15,null==p.isRTL?void 0:p.isRTL(h.floating);case 15:if(n.t3=n.sent,j=(0,n.t0)(n.t1,n.t2,n.t3),s===S){n.next=19;break}return n.abrupt("return",{reset:{placement:E[0]}});case 19:if(D=[L[R(S)],L[j[0]],L[j[1]]],C=[].concat(l((null==(i=u.autoPlacement)?void 0:i.overflows)||[]),[{placement:S,overflows:D}]),!(F=E[A+1])){n.next=24;break}return n.abrupt("return",{data:{index:A+1,overflows:C},reset:{placement:F}});case 24:if(H=C.map((function(t){var e=T(t.placement);return[t.placement,e&&m?t.overflows.slice(0,2).reduce((function(t,e){return t+e}),0):t.overflows[0],t.overflows]})).sort((function(t,e){return t[1]-e[1]})),N=H.filter((function(t){return t[2].slice(0,T(t[0])?2:3).every((function(t){return t<=0}))})),(W=(null==(a=N[0])?void 0:a[0])||H[0][0])===s){n.next=29;break}return n.abrupt("return",{data:{index:A+1,overflows:C},reset:{placement:W}});case 29:return n.abrupt("return",{});case 30:case"end":return n.stop()}}),n)})))()}}})),t("flip",(function(t){return void 0===t&&(t={}),{name:"flip",options:t,fn:function(e){return c(r().mark((function n(){var o,i,a,c,u,s,p,h,d,v,m,y,g,b,x,w,k,O,E,L,A,S,T,j,D,C,F,N,I,G,M,z,Y,$,q,U,J;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=e.placement,c=e.middlewareData,u=e.rects,s=e.initialPlacement,p=e.platform,h=e.elements,d=P(t,e),v=d.mainAxis,m=void 0===v||v,y=d.crossAxis,g=void 0===y||y,b=d.fallbackPlacements,x=d.fallbackStrategy,w=void 0===x?"bestFit":x,k=d.fallbackAxisSideDirection,O=void 0===k?"none":k,E=d.flipAlignment,L=void 0===E||E,A=f(d,V),null==(o=c.arrow)||!o.alignmentOffset){n.next=4;break}return n.abrupt("return",{});case 4:return S=R(a),T=R(s)===s,n.next=8,null==p.isRTL?void 0:p.isRTL(h.floating);case 8:return j=n.sent,D=b||(T||!L?[B(s)]:H(s)),b||"none"===O||D.push.apply(D,l(W(s,L,O,j))),C=[s].concat(l(D)),n.next=14,X(e,A);case 14:if(F=n.sent,N=[],I=(null==(i=c.flip)?void 0:i.overflows)||[],m&&N.push(F[S]),g&&(G=_(a,u,j),N.push(F[G[0]],F[G[1]])),I=[].concat(l(I),[{placement:a,overflows:N}]),N.every((function(t){return t<=0}))){n.next=37;break}if(Y=((null==(M=c.flip)?void 0:M.index)||0)+1,!($=C[Y])){n.next=25;break}return n.abrupt("return",{data:{index:Y,overflows:I},reset:{placement:$}});case 25:if(q=null==(z=I.filter((function(t){return t.overflows[0]<=0})).sort((function(t,e){return t.overflows[1]-e.overflows[1]}))[0])?void 0:z.placement){n.next=35;break}n.t0=w,n.next="bestFit"===n.t0?30:"initialPlacement"===n.t0?33:35;break;case 30:return J=null==(U=I.map((function(t){return[t.placement,t.overflows.filter((function(t){return t>0})).reduce((function(t,e){return t+e}),0)]})).sort((function(t,e){return t[1]-e[1]}))[0])?void 0:U[0],J&&(q=J),n.abrupt("break",35);case 33:return q=s,n.abrupt("break",35);case 35:if(a===q){n.next=37;break}return n.abrupt("return",{reset:{placement:q}});case 37:return n.abrupt("return",{});case 38:case"end":return n.stop()}}),n)})))()}}}));function Q(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Z(t){return y.some((function(e){return t[e]>=0}))}t("hide",(function(t){return void 0===t&&(t={}),{name:"hide",options:t,fn:function(e){return c(r().mark((function o(){var i,a,c,u,l,s,p,h,d;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=e.rects,a=P(t,e),c=a.strategy,u=void 0===c?"referenceHidden":c,l=f(a,z),r.t0=u,r.next="referenceHidden"===r.t0?5:"escaped"===r.t0?10:15;break;case 5:return r.next=7,X(e,n(n({},l),{},{elementContext:"reference"}));case 7:return s=r.sent,p=Q(s,i.reference),r.abrupt("return",{data:{referenceHiddenOffsets:p,referenceHidden:Z(p)}});case 10:return r.next=12,X(e,n(n({},l),{},{altBoundary:!0}));case 12:return h=r.sent,d=Q(h,i.floating),r.abrupt("return",{data:{escapedOffsets:d,escaped:Z(d)}});case 15:return r.abrupt("return",{});case 16:case"end":return r.stop()}}),o)})))()}}}));function tt(t){var e=x.apply(void 0,l(t.map((function(t){return t.left})))),n=x.apply(void 0,l(t.map((function(t){return t.top}))));return{x:e,y:n,width:w.apply(void 0,l(t.map((function(t){return t.right}))))-e,height:w.apply(void 0,l(t.map((function(t){return t.bottom}))))-n}}function et(t){for(var e=t.slice().sort((function(t,e){return t.y-e.y})),n=[],r=null,o=0;o<e.length;o++){var i=e[o];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map((function(t){return G(tt(t))}))}t("inline",(function(t){return void 0===t&&(t={}),{name:"inline",options:t,fn:function(e){return c(r().mark((function n(){var o,i,a,c,u,f,s,p,h,d,v,m,y,g,b,k;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return b=function(){if(2===m.length&&m[0].left>m[1].right&&null!=h&&null!=d)return m.find((function(t){return h>t.left-g.left&&h<t.right+g.right&&d>t.top-g.top&&d<t.bottom+g.bottom}))||y;if(m.length>=2){if("y"===C(o)){var t=m[0],e=m[m.length-1],n="top"===R(o),r=t.top,i=e.bottom,a=n?t.left:e.left,c=n?t.right:e.right;return{top:r,bottom:i,left:a,right:c,width:c-a,height:i-r,x:a,y:r}}var u="left"===R(o),f=w.apply(void 0,l(m.map((function(t){return t.right})))),s=x.apply(void 0,l(m.map((function(t){return t.left})))),p=m.filter((function(t){return u?t.left===s:t.right===f})),v=p[0].top,b=p[p.length-1].bottom;return{top:v,bottom:b,left:s,right:f,width:f-s,height:b-v,x:s,y:v}}return y},o=e.placement,i=e.elements,a=e.rects,c=e.platform,u=e.strategy,f=P(t,e),s=f.padding,p=void 0===s?2:s,h=f.x,d=f.y,n.t0=Array,n.next=6,null==c.getClientRects?void 0:c.getClientRects(i.reference);case 6:if(n.t1=n.sent,n.t1){n.next=9;break}n.t1=[];case 9:return n.t2=n.t1,v=n.t0.from.call(n.t0,n.t2),m=et(v),y=G(tt(v)),g=I(p),n.next=16,c.getElementRects({reference:{getBoundingClientRect:b},floating:i.floating,strategy:u});case 16:if(k=n.sent,a.reference.x===k.reference.x&&a.reference.y===k.reference.y&&a.reference.width===k.reference.width&&a.reference.height===k.reference.height){n.next=19;break}return n.abrupt("return",{reset:{rects:k}});case 19:return n.abrupt("return",{});case 20:case"end":return n.stop()}}),n)})))()}}}));function nt(t,e){return rt.apply(this,arguments)}function rt(){return rt=c(r().mark((function t(e,o){var i,a,c,u,f,l,s,p,h,d,v,m,y,g;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.placement,a=e.platform,c=e.elements,t.next=3,null==a.isRTL?void 0:a.isRTL(c.floating);case 3:return u=t.sent,f=R(i),l=T(i),s="y"===C(i),p=["left","top"].includes(f)?-1:1,h=u&&s?-1:1,d=P(o,e),v="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:n({mainAxis:0,crossAxis:0,alignmentAxis:null},d),m=v.mainAxis,y=v.crossAxis,g=v.alignmentAxis,l&&"number"==typeof g&&(y="end"===l?-1*g:g),t.abrupt("return",s?{x:y*h,y:m*p}:{x:m*p,y:y*h});case 13:case"end":return t.stop()}}),t)}))),rt.apply(this,arguments)}t("offset",(function(t){return void 0===t&&(t=0),{name:"offset",options:t,fn:function(e){return c(r().mark((function o(){var i,a,c,u,f,l,s;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=e.x,u=e.y,f=e.placement,l=e.middlewareData,r.next=3,nt(e,t);case 3:if(s=r.sent,f!==(null==(i=l.offset)?void 0:i.placement)||null==(a=l.arrow)||!a.alignmentOffset){r.next=6;break}return r.abrupt("return",{});case 6:return r.abrupt("return",{x:c+s.x,y:u+s.y,data:n(n({},s),{},{placement:f})});case 7:case"end":return r.stop()}}),o)})))()}}})),t("shift",(function(t){return void 0===t&&(t={}),{name:"shift",options:t,fn:function(e){return c(r().mark((function o(){var i,a,c,l,s,p,h,d,v,m,y,g,b,x,w,k,O,E,L,A,T,D,F,_;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=e.x,a=e.y,c=e.placement,l=P(t,e),s=l.mainAxis,p=void 0===s||s,h=l.crossAxis,d=void 0!==h&&h,v=l.limiter,m=void 0===v?{fn:function(t){return{x:t.x,y:t.y}}}:v,y=f(l,Y),g={x:i,y:a},r.next=5,X(e,y);case 5:return b=r.sent,x=C(R(c)),w=j(x),k=g[w],O=g[x],p&&(E="y"===w?"bottom":"right",L=k+b["y"===w?"top":"left"],A=k-b[E],k=S(L,k,A)),d&&(T="y"===x?"bottom":"right",D=O+b["y"===x?"top":"left"],F=O-b[T],O=S(D,O,F)),_=m.fn(n(n({},e),{},u(u({},w,k),x,O))),r.abrupt("return",n(n({},_),{},{data:{x:_.x-i,y:_.y-a}}));case 14:case"end":return r.stop()}}),o)})))()}}})),t("limitShift",(function(t){return void 0===t&&(t={}),{options:t,fn:function(e){var r=e.x,o=e.y,i=e.placement,a=e.rects,c=e.middlewareData,f=P(t,e),l=f.offset,s=void 0===l?0:l,p=f.mainAxis,h=void 0===p||p,d=f.crossAxis,v=void 0===d||d,m={x:r,y:o},y=C(i),g=j(y),b=m[g],x=m[y],w=P(s,e),k="number"==typeof w?{mainAxis:w,crossAxis:0}:n({mainAxis:0,crossAxis:0},w);if(h){var O="y"===g?"height":"width",E=a.reference[g]-a.floating[O]+k.mainAxis,L=a.reference[g]+a.reference[O]-k.mainAxis;b<E?b=E:b>L&&(b=L)}if(v){var A,S,T="y"===g?"width":"height",D=["top","left"].includes(R(i)),F=a.reference[y]-a.floating[T]+(D&&(null==(A=c.offset)?void 0:A[y])||0)+(D?0:k.crossAxis),_=a.reference[y]+a.reference[T]+(D?0:(null==(S=c.offset)?void 0:S[y])||0)-(D?k.crossAxis:0);x<F?x=F:x>_&&(x=_)}return u(u({},g,b),y,x)}}})),t("size",(function(t){return void 0===t&&(t={}),{name:"size",options:t,fn:function(e){return c(r().mark((function o(){var i,a,c,u,l,s,p,h,d,v,m,y,g,b,k,O,E,L,A,S,j,D,F,_,H,N,W,B,I;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=e.placement,a=e.rects,c=e.platform,u=e.elements,l=P(t,e),s=l.apply,p=void 0===s?function(){}:s,h=f(l,$),r.next=4,X(e,h);case 4:if(d=r.sent,v=R(i),m=T(i),y="y"===C(i),g=a.floating,b=g.width,k=g.height,"top"!==v&&"bottom"!==v){r.next=28;break}return O=v,r.t0=m,r.next=14,null==c.isRTL?void 0:c.isRTL(u.floating);case 14:if(!r.sent){r.next=18;break}r.t1="start",r.next=19;break;case 18:r.t1="end";case 19:if(r.t2=r.t1,r.t0!==r.t2){r.next=24;break}r.t3="left",r.next=25;break;case 24:r.t3="right";case 25:E=r.t3,r.next=30;break;case 28:E=v,O="end"===m?"top":"bottom";case 30:return L=k-d[O],A=b-d[E],S=!e.middlewareData.shift,j=L,D=A,y?(F=b-d.left-d.right,D=m||S?x(A,F):F):(_=k-d.top-d.bottom,j=m||S?x(L,_):_),S&&!m&&(H=w(d.left,0),N=w(d.right,0),W=w(d.top,0),B=w(d.bottom,0),y?D=b-2*(0!==H||0!==N?H+N:w(d.left,d.right)):j=k-2*(0!==W||0!==B?W+B:w(d.top,d.bottom))),r.next=39,p(n(n({},e),{},{availableWidth:D,availableHeight:j}));case 39:return r.next=41,c.getDimensions(u.floating);case 41:if(I=r.sent,b===I.width&&k===I.height){r.next=44;break}return r.abrupt("return",{reset:{rects:!0}});case 44:return r.abrupt("return",{});case 45:case"end":return r.stop()}}),o)})))()}}}));function ot(t){return ct(t)?(t.nodeName||"").toLowerCase():"#document"}function it(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function at(t){var e;return null==(e=(ct(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ct(t){return t instanceof Node||t instanceof it(t).Node}function ut(t){return t instanceof Element||t instanceof it(t).Element}function ft(t){return t instanceof HTMLElement||t instanceof it(t).HTMLElement}function lt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof it(t).ShadowRoot)}function st(t){var e=mt(t),n=e.overflow,r=e.overflowX,o=e.overflowY,i=e.display;return/auto|scroll|overlay|hidden|clip/.test(n+o+r)&&!["inline","contents"].includes(i)}function pt(t){return["table","td","th"].includes(ot(t))}function ht(t){var e=dt(),n=mt(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((function(t){return(n.willChange||"").includes(t)}))||["paint","layout","strict","content"].some((function(t){return(n.contain||"").includes(t)}))}function dt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function vt(t){return["html","body","#document"].includes(ot(t))}function mt(t){return it(t).getComputedStyle(t)}function yt(t){return ut(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function gt(t){if("html"===ot(t))return t;var e=t.assignedSlot||t.parentNode||lt(t)&&t.host||at(t);return lt(e)?e.host:e}function bt(t){var e=gt(t);return vt(e)?t.ownerDocument?t.ownerDocument.body:t.body:ft(e)&&st(e)?e:bt(e)}function xt(t,e,n){var r;void 0===e&&(e=[]),void 0===n&&(n=!0);var o=bt(t),i=o===(null==(r=t.ownerDocument)?void 0:r.body),a=it(o);return i?e.concat(a,a.visualViewport||[],st(o)?o:[],a.frameElement&&n?xt(a.frameElement):[]):e.concat(o,xt(o,[],n))}function wt(t){var e=mt(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,o=ft(t),i=o?t.offsetWidth:n,a=o?t.offsetHeight:r,c=k(n)!==i||k(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function kt(t){return ut(t)?t:t.contextElement}function Ot(t){var e=kt(t);if(!ft(e))return E(1);var n=e.getBoundingClientRect(),r=wt(e),o=r.width,i=r.height,a=r.$,c=(a?k(n.width):n.width)/o,u=(a?k(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),u&&Number.isFinite(u)||(u=1),{x:c,y:u}}var Et=E(0);function Lt(t){var e=it(t);return dt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Et}function At(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=kt(t),a=E(1);e&&(r?ut(r)&&(a=Ot(r)):a=Ot(t));var c=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==it(t))&&e}(i,n,r)?Lt(i):E(0),u=(o.left+c.x)/a.x,f=(o.top+c.y)/a.y,l=o.width/a.x,s=o.height/a.y;if(i)for(var p=it(i),h=r&&ut(r)?it(r):r,d=p.frameElement;d&&r&&h!==p;){var v=Ot(d),m=d.getBoundingClientRect(),y=mt(d),g=m.left+(d.clientLeft+parseFloat(y.paddingLeft))*v.x,b=m.top+(d.clientTop+parseFloat(y.paddingTop))*v.y;u*=v.x,f*=v.y,l*=v.x,s*=v.y,u+=g,f+=b,d=it(d).frameElement}return G({width:l,height:s,x:u,y:f})}function St(t){return At(at(t)).left+yt(t).scrollLeft}function Pt(t,e,n){var r;if("viewport"===e)r=function(t,e){var n=it(t),r=at(t),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,c=0,u=0;if(o){i=o.width,a=o.height;var f=dt();(!f||f&&"fixed"===e)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:c,y:u}}(t,n);else if("document"===e)r=function(t){var e=at(t),n=yt(t),r=t.ownerDocument.body,o=w(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=w(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),a=-n.scrollLeft+St(t),c=-n.scrollTop;return"rtl"===mt(r).direction&&(a+=w(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:c}}(at(t));else if(ut(e))r=function(t,e){var n=At(t,!0,"fixed"===e),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=ft(t)?Ot(t):E(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:o*i.x,y:r*i.y}}(e,n);else{var o=Lt(t);r=p(p({},e),{x:e.x-o.x,y:e.y-o.y})}return G(r)}function Rt(t,e){var n=gt(t);return!(n===e||!ut(n)||vt(n))&&("fixed"===mt(n).position||Rt(n,e))}function Tt(t,e,n){var r=ft(e),o=at(e),i="fixed"===n,a=At(t,!0,i,e),c={scrollLeft:0,scrollTop:0},u=E(0);if(r||!r&&!i)if(("body"!==ot(e)||st(o))&&(c=yt(e)),r){var f=At(e,!0,i,e);u.x=f.x+e.clientLeft,u.y=f.y+e.clientTop}else o&&(u.x=St(o));return{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function jt(t,e){return ft(t)&&"fixed"!==mt(t).position?e?e(t):t.offsetParent:null}function Dt(t,e){var n=it(t);if(!ft(t))return n;for(var r=jt(t,e);r&&pt(r)&&"static"===mt(r).position;)r=jt(r,e);return r&&("html"===ot(r)||"body"===ot(r)&&"static"===mt(r).position&&!ht(r))?n:r||function(t){for(var e=gt(t);ft(e)&&!vt(e);){if(ht(e))return e;e=gt(e)}return null}(t)||n}var Ct=t("platform",{convertOffsetParentRelativeRectToViewportRelativeRect:function(t){var e=t.rect,n=t.offsetParent,r=t.strategy,o=ft(n),i=at(n);if(n===i)return e;var a={scrollLeft:0,scrollTop:0},c=E(1),u=E(0);if((o||!o&&"fixed"!==r)&&(("body"!==ot(n)||st(i))&&(a=yt(n)),ft(n))){var f=At(n);c=Ot(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-a.scrollLeft*c.x+u.x,y:e.y*c.y-a.scrollTop*c.y+u.y}},getDocumentElement:at,getClippingRect:function(t){var e=t.element,n=t.boundary,r=t.rootBoundary,o=t.strategy,i=m(m([],v("clippingAncestors"===n?function(t,e){var n=e.get(t);if(n)return n;for(var r=xt(t,[],!1).filter((function(t){return ut(t)&&"body"!==ot(t)})),o=null,i="fixed"===mt(t).position,a=i?gt(t):t;ut(a)&&!vt(a);){var c=mt(a),u=ht(a);u||"fixed"!==c.position||(o=null),(i?!u&&!o:!u&&"static"===c.position&&o&&["absolute","fixed"].includes(o.position)||st(a)&&!u&&Rt(t,a))?r=r.filter((function(t){return t!==a})):o=c,a=gt(a)}return e.set(t,r),r}(e,this._c):[].concat(n)),!1),[r],!1),a=i[0],c=i.reduce((function(t,n){var r=Pt(e,n,o);return t.top=w(r.top,t.top),t.right=x(r.right,t.right),t.bottom=x(r.bottom,t.bottom),t.left=w(r.left,t.left),t}),Pt(e,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Dt,getElementRects:function(t){var e=t.reference,n=t.floating,r=t.strategy;return h(this,void 0,void 0,(function(){var t,o,i,a,c,u;return d(this,(function(f){switch(f.label){case 0:return t=this.getOffsetParent||Dt,o=this.getDimensions,u={},i=Tt,a=[e],[4,t(n)];case 1:return u.reference=i.apply(void 0,a.concat([f.sent(),r])),c=[{x:0,y:0}],[4,o(n)];case 2:return[2,(u.floating=p.apply(void 0,c.concat([f.sent()])),u)]}}))}))},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return wt(t)},getScale:Ot,isElement:ut,isRTL:function(t){return"rtl"===mt(t).direction}});t("computePosition",(function(t,e,n){var r=new Map,o=p({platform:Ct},n),i=p(p({},o.platform),{_c:r});return U(t,e,p(p({},o),{platform:i}))}))}}}));