{"map":"{\"version\":3,\"file\":\"distanceFrom.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/operators/distanceFrom.ts\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,EACL,SAAS,EACT,SAAS,GACV,MAAM,eAAe,CAAC;AAavB,MAAM,2BAAgF,UAAa;IACjG,MAAM,CAAC,KAAM,SAAQ,UAAU;QAQ7B,YAAY,CAAC,EAAE,OAAO,EAA+C;YACnE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBACxB,OAAO,GAAG,SAAS,CAAC,CAAC,CAA0B,CAAC;YAClD,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;gBACvB,SAAS,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAsC;oBAChE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;wBACxB,MAAM,CAAC,IAAI,CAAC,IAAI,CACd,SAAA,CAAE,MAAkB,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAI,CAAC,CAAA;4BACzC,SAAA,CAAE,MAAkB,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAI,CAAC,CAAA,CAC1C,CAAC;oBACJ,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACN,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAgB,GAAG,QAAQ,CAAC,CAAC;oBAC/C,CAAC;gBACH,CAAC;gBACD,MAAM,EAAE;oBACN,MAAM,EAAE,OAAO;iBAChB;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC\"}","code":"/** @license\r\n *  Copyright 2016 - present The Material Motion Authors. All Rights Reserved.\r\n *\r\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n *  use this file except in compliance with the License. You may obtain a copy\r\n *  of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n *  Unless required by applicable law or agreed to in writing, software\r\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n *  License for the specific language governing permissions and limitations\r\n *  under the License.\r\n */\r\nimport { isDefined, isPoint2D, } from '../typeGuards';\r\nexport function withDistanceFrom(superclass) {\r\n    return class extends superclass {\r\n        distanceFrom({ origin$ }) {\r\n            if (!isDefined(origin$)) {\r\n                origin$ = arguments[0];\r\n            }\r\n            return this._reactiveMap({\r\n                transform({ upstream, origin }) {\r\n                    if (isPoint2D(upstream)) {\r\n                        return Math.sqrt(Math.pow((origin.x - upstream.x), 2) +\r\n                            Math.pow((origin.y - upstream.y), 2));\r\n                    }\r\n                    else {\r\n                        return Math.abs(origin - upstream);\r\n                    }\r\n                },\r\n                inputs: {\r\n                    origin: origin$,\r\n                },\r\n            });\r\n        }\r\n    };\r\n}\r\n//# sourceMappingURL=distanceFrom.js.map","dts":{"name":"/Users/brentons/Projects/material-motion-js/packages/core/operators/distanceFrom.d.ts","text":"/** @license\r\n *  Copyright 2016 - present The Material Motion Authors. All Rights Reserved.\r\n *\r\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n *  use this file except in compliance with the License. You may obtain a copy\r\n *  of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n *  Unless required by applicable law or agreed to in writing, software\r\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n *  License for the specific language governing permissions and limitations\r\n *  under the License.\r\n */\r\nimport { Constructor, MotionReactiveMappable, Observable, ObservableWithMotionOperators, Point2D } from '../types';\r\nexport declare type DistanceFromOrigin<T> = (T & (Point2D | number)) | Observable<T & (Point2D | number)>;\r\nexport declare type DistanceFromArgs<T> = {\r\n    origin$: DistanceFromOrigin<T>;\r\n};\r\nexport interface MotionMeasurable<T> {\r\n    distanceFrom(kwargs: DistanceFromArgs<T>): ObservableWithMotionOperators<number>;\r\n    distanceFrom(origin$: DistanceFromOrigin<T>): ObservableWithMotionOperators<number>;\r\n}\r\nexport declare function withDistanceFrom<T, S extends Constructor<MotionReactiveMappable<T>>>(superclass: S): S & Constructor<MotionMeasurable<T>>;\r\n"}}
