{"ast":null,"code":"import { __extends, __assign } from 'tslib';\nimport React__default, { useContext } from 'react';\nimport { isSharedLayout, SharedLayoutContext, FramerTreeLayoutContext } from '../../../context/SharedLayoutContext.js';\nimport { snapshotViewportBox } from '../../../render/dom/projection/utils.js';\n\n/**\n * This component is responsible for scheduling the measuring of the motion component\n */\nvar Measure = /** @class */function (_super) {\n  __extends(Measure, _super);\n  function Measure() {\n    return _super !== null && _super.apply(this, arguments) || this;\n  }\n  /**\n   * If this is a child of a SyncContext, register the VisualElement with it on mount.\n   */\n  Measure.prototype.componentDidMount = function () {\n    var _a = this.props,\n      syncLayout = _a.syncLayout,\n      framerSyncLayout = _a.framerSyncLayout,\n      visualElement = _a.visualElement;\n    isSharedLayout(syncLayout) && syncLayout.register(visualElement);\n    isSharedLayout(framerSyncLayout) && framerSyncLayout.register(visualElement);\n    visualElement.onUnmount(function () {\n      if (isSharedLayout(syncLayout)) {\n        syncLayout.remove(visualElement);\n      }\n      if (isSharedLayout(framerSyncLayout)) {\n        framerSyncLayout.remove(visualElement);\n      }\n    });\n  };\n  /**\n   * If this is a child of a SyncContext, notify it that it needs to re-render. It will then\n   * handle the snapshotting.\n   *\n   * If it is stand-alone component, add it to the batcher.\n   */\n  Measure.prototype.getSnapshotBeforeUpdate = function () {\n    var _a = this.props,\n      syncLayout = _a.syncLayout,\n      visualElement = _a.visualElement;\n    if (isSharedLayout(syncLayout)) {\n      syncLayout.syncUpdate();\n    } else {\n      snapshotViewportBox(visualElement);\n      syncLayout.add(visualElement);\n    }\n    return null;\n  };\n  Measure.prototype.componentDidUpdate = function () {\n    var syncLayout = this.props.syncLayout;\n    if (!isSharedLayout(syncLayout)) syncLayout.flush();\n  };\n  Measure.prototype.render = function () {\n    return null;\n  };\n  return Measure;\n}(React__default.Component);\nfunction MeasureContextProvider(props) {\n  var syncLayout = useContext(SharedLayoutContext);\n  var framerSyncLayout = useContext(FramerTreeLayoutContext);\n  return React__default.createElement(Measure, __assign({}, props, {\n    syncLayout: syncLayout,\n    framerSyncLayout: framerSyncLayout\n  }));\n}\nexport { MeasureContextProvider };","map":{"version":3,"names":["__extends","__assign","React__default","useContext","isSharedLayout","SharedLayoutContext","FramerTreeLayoutContext","snapshotViewportBox","Measure","_super","apply","arguments","prototype","componentDidMount","_a","props","syncLayout","framerSyncLayout","visualElement","register","onUnmount","remove","getSnapshotBeforeUpdate","syncUpdate","add","componentDidUpdate","flush","render","Component","MeasureContextProvider","createElement"],"sources":["D:/DSP_Management/node_modules/framer-motion/dist/es/motion/features/layout/Measure.js"],"sourcesContent":["import { __extends, __assign } from 'tslib';\nimport React__default, { useContext } from 'react';\nimport { isSharedLayout, SharedLayoutContext, FramerTreeLayoutContext } from '../../../context/SharedLayoutContext.js';\nimport { snapshotViewportBox } from '../../../render/dom/projection/utils.js';\n\n/**\n * This component is responsible for scheduling the measuring of the motion component\n */\nvar Measure = /** @class */ (function (_super) {\n    __extends(Measure, _super);\n    function Measure() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    /**\n     * If this is a child of a SyncContext, register the VisualElement with it on mount.\n     */\n    Measure.prototype.componentDidMount = function () {\n        var _a = this.props, syncLayout = _a.syncLayout, framerSyncLayout = _a.framerSyncLayout, visualElement = _a.visualElement;\n        isSharedLayout(syncLayout) && syncLayout.register(visualElement);\n        isSharedLayout(framerSyncLayout) &&\n            framerSyncLayout.register(visualElement);\n        visualElement.onUnmount(function () {\n            if (isSharedLayout(syncLayout)) {\n                syncLayout.remove(visualElement);\n            }\n            if (isSharedLayout(framerSyncLayout)) {\n                framerSyncLayout.remove(visualElement);\n            }\n        });\n    };\n    /**\n     * If this is a child of a SyncContext, notify it that it needs to re-render. It will then\n     * handle the snapshotting.\n     *\n     * If it is stand-alone component, add it to the batcher.\n     */\n    Measure.prototype.getSnapshotBeforeUpdate = function () {\n        var _a = this.props, syncLayout = _a.syncLayout, visualElement = _a.visualElement;\n        if (isSharedLayout(syncLayout)) {\n            syncLayout.syncUpdate();\n        }\n        else {\n            snapshotViewportBox(visualElement);\n            syncLayout.add(visualElement);\n        }\n        return null;\n    };\n    Measure.prototype.componentDidUpdate = function () {\n        var syncLayout = this.props.syncLayout;\n        if (!isSharedLayout(syncLayout))\n            syncLayout.flush();\n    };\n    Measure.prototype.render = function () {\n        return null;\n    };\n    return Measure;\n}(React__default.Component));\nfunction MeasureContextProvider(props) {\n    var syncLayout = useContext(SharedLayoutContext);\n    var framerSyncLayout = useContext(FramerTreeLayoutContext);\n    return (React__default.createElement(Measure, __assign({}, props, { syncLayout: syncLayout, framerSyncLayout: framerSyncLayout })));\n}\n\nexport { MeasureContextProvider };\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,OAAOC,cAAc,IAAIC,UAAU,QAAQ,OAAO;AAClD,SAASC,cAAc,EAAEC,mBAAmB,EAAEC,uBAAuB,QAAQ,yCAAyC;AACtH,SAASC,mBAAmB,QAAQ,yCAAyC;;AAE7E;AACA;AACA;AACA,IAAIC,OAAO,GAAG,aAAe,UAAUC,MAAM,EAAE;EAC3CT,SAAS,CAACQ,OAAO,EAAEC,MAAM,CAAC;EAC1B,SAASD,OAAOA,CAAA,EAAG;IACf,OAAOC,MAAM,KAAK,IAAI,IAAIA,MAAM,CAACC,KAAK,CAAC,IAAI,EAAEC,SAAS,CAAC,IAAI,IAAI;EACnE;EACA;AACJ;AACA;EACIH,OAAO,CAACI,SAAS,CAACC,iBAAiB,GAAG,YAAY;IAC9C,IAAIC,EAAE,GAAG,IAAI,CAACC,KAAK;MAAEC,UAAU,GAAGF,EAAE,CAACE,UAAU;MAAEC,gBAAgB,GAAGH,EAAE,CAACG,gBAAgB;MAAEC,aAAa,GAAGJ,EAAE,CAACI,aAAa;IACzHd,cAAc,CAACY,UAAU,CAAC,IAAIA,UAAU,CAACG,QAAQ,CAACD,aAAa,CAAC;IAChEd,cAAc,CAACa,gBAAgB,CAAC,IAC5BA,gBAAgB,CAACE,QAAQ,CAACD,aAAa,CAAC;IAC5C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