"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../utils/mix/number.mjs.js"),e=require("../utils/has-transform.mjs.js");function o(t,e,o){return o+e*(t-o)}function s(t,e,s,n,l){return void 0!==l&&(t=o(t,l,n)),o(t,s,n)+e}function n(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0;t.min=s(t.min,e,o,n,l),t.max=s(t.max,e,o,n,l)}function l(t,e){let{x:o,y:s}=e;n(t.x,o.translate,o.scale,o.originPoint),n(t.y,s.translate,s.scale,s.originPoint)}const r=.999999999999,i=1.0000000000001;function a(t,e){t.min+=e,t.max+=e}function x(e,o,s,l){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5;n(e,o,s,t.mixNumber(e.min,e.max,r),l)}function c(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function p(t,e,o){const s=o??t;x(t.x,c(e.x,s.x),e.scaleX,e.scale,e.originX),x(t.y,c(e.y,s.y),e.scaleY,e.scale,e.originY)}exports.applyAxisDelta=n,exports.applyBoxDelta=l,exports.applyPointDelta=s,exports.applyTreeDeltas=function(t,o,s){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const x=s.length;if(!x)return;let c,u;o.x=o.y=1;for(let r=0;r<x;r++){c=s[r],u=c.projectionDelta;const{visualElement:i}=c.options;i&&i.props.style&&"contents"===i.props.style.display||(n&&c.options.layoutScroll&&c.scroll&&c!==c.root&&(a(t.x,-c.scroll.offset.x),a(t.y,-c.scroll.offset.y)),u&&(o.x*=u.x.scale,o.y*=u.y.scale,l(t,u)),n&&e.hasTransform(c.latestValues)&&p(t,c.latestValues,c.layout?.layoutBox))}o.x<i&&o.x>r&&(o.x=1),o.y<i&&o.y>r&&(o.y=1)},exports.scalePoint=o,exports.transformAxis=x,exports.transformBox=p,exports.translateAxis=a;
//# sourceMappingURL=delta-apply.mjs.js.map
