{ "version": 3, "sources": ["../../tslib/tslib.es6.mjs", "../../fast-deep-equal/react.js", "../../js-cookie/src/js.cookie.js", "../../toggle-selection/index.js", "../../copy-to-clipboard/index.js", "../../nano-css/index.js", "../../nano-css/addon/__dev__/warnOnMissingDependencies.js", "../../nano-css/addon/cssom.js", "../../nano-css/addon/vcssom/removeRule.js", "../../nano-css/addon/vcssom.js", "../../nano-css/addon/vcssom/cssToTree.js", "../../screenfull/dist/screenfull.js", "../../react-universal-interface/src/render.ts", "../../react-universal-interface/src/wrapInStatefulComponent.ts", "../../react-universal-interface/src/addClassDecoratorSupport.ts", "../../react-universal-interface/src/createEnhancer.ts", "../../react-universal-interface/src/hookToRenderProp.ts", "../../react-universal-interface/src/index.ts", "../../fast-shallow-equal/index.js", "../../ts-easing/lib/index.js", "../../@use-gesture/core/dist/maths-0ab39ae9.esm.js", "../../@use-gesture/core/dist/actions-fe213e88.esm.js", "../../@use-gesture/react/dist/use-gesture-react.esm.js", "../../@use-gesture/core/dist/use-gesture-core.esm.js", "../../src/tile-layout/table-utils/table.ts", "../../src/tile-layout/table-utils/tiles-table.ts", "../../src/tile-layout/table-utils/tiles.ts", "../../src/tile-layout/strategies/move.ts", "../../src/tile-layout/strategies/reorder.ts", "../../src/tile-layout/useTileTable.ts", "../../react-use/esm/factory/createMemo.js", "../../react-use/esm/factory/createReducerContext.js", "../../react-use/esm/factory/createReducer.js", "../../react-use/esm/useUpdateEffect.js", "../../react-use/esm/useFirstMountState.js", "../../react-use/esm/factory/createStateContext.js", "../../react-use/esm/useAsync.js", "../../react-use/esm/useAsyncFn.js", "../../react-use/esm/useMountedState.js", "../../react-use/esm/useAsyncRetry.js", "../../react-use/esm/factory/createHTMLMediaHook.js", "../../react-use/esm/useSetState.js", "../../react-use/esm/misc/parseTimeRanges.js", "../../react-use/esm/useAudio.js", "../../react-use/esm/useBattery.js", "../../react-use/esm/misc/util.js", "../../react-use/esm/misc/isDeepEqual.js", "../../react-use/esm/useBeforeUnload.js", "../../react-use/esm/useToggle.js", "../../react-use/esm/useClickAway.js", "../../react-use/esm/useCookie.js", "../../react-use/esm/useCopyToClipboard.js", "../../react-use/esm/useCounter.js", "../../react-use/esm/useGetSet.js", "../../react-use/esm/useUpdate.js", "../../react-use/esm/useCss.js", "../../react-use/esm/useIsomorphicLayoutEffect.js", "../../react-use/esm/useCustomCompareEffect.js", "../../react-use/esm/useDebounce.js", "../../react-use/esm/useTimeoutFn.js", "../../react-use/esm/useDefault.js", "../../react-use/esm/useDrop.js", "../../react-use/esm/useDropArea.js", "../../react-use/esm/useEffectOnce.js", "../../react-use/esm/useEnsuredForwardedRef.js", "../../react-use/esm/useEvent.js", "../../react-use/esm/useError.js", "../../react-use/esm/useFavicon.js", "../../react-use/esm/useFullscreen.js", "../../react-use/esm/useGeolocation.js", "../../react-use/esm/useGetSetState.js", "../../react-use/esm/useHarmonicIntervalFn.js", "../../react-use/esm/useHover.js", "../../react-use/esm/useHoverDirty.js", "../../react-use/esm/useIdle.js", "../../react-use/esm/useIntersection.js", "../../react-use/esm/useInterval.js", "../../react-use/esm/useKey.js", "../../react-use/esm/factory/createBreakpoint.js", "../../react-use/esm/useKeyPress.js", "../../react-use/esm/useLatest.js", "../../react-use/esm/useLifecycles.js", "../../react-use/esm/useList.js", "../../react-use/esm/useLocalStorage.js", "../../react-use/esm/useLocation.js", "../../react-use/esm/useLockBodyScroll.js", "../../react-use/esm/useLogger.js", "../../react-use/esm/useLongPress.js", "../../react-use/esm/useMap.js", "../../react-use/esm/useMedia.js", "../../react-use/esm/useMediaDevices.js", "../../react-use/esm/useMediatedState.js", "../../react-use/esm/useMethods.js", "../../react-use/esm/useMotion.js", "../../react-use/esm/useMouse.js", "../../react-use/esm/useRafState.js", "../../react-use/esm/useUnmount.js", "../../react-use/esm/useMouseWheel.js", "../../react-use/esm/useNetworkState.js", "../../react-use/esm/useObservable.js", "../../react-use/esm/useOrientation.js", "../../react-use/esm/usePageLeave.js", "../../react-use/esm/usePermission.js", "../../react-use/esm/usePrevious.js", "../../react-use/esm/usePreviousDistinct.js", "../../react-use/esm/usePromise.js", "../../react-use/esm/useQueue.js", "../../react-use/esm/useRaf.js", "../../react-use/esm/useRafLoop.js", "../../react-use/esm/useSearchParam.js", "../../react-use/esm/useScratch.js", "../../react-use/esm/useScroll.js", "../../react-use/esm/useScrolling.js", "../../react-use/esm/useSessionStorage.js", "../../react-use/esm/useShallowCompareEffect.js", "../../react-use/esm/useSize.js", "../../react-use/esm/useSlider.js", "../../react-use/esm/useSpeech.js", "../../react-use/esm/useStateWithHistory.js", "../../react-use/esm/useStateList.js", "../../react-use/esm/useThrottle.js", "../../react-use/esm/useThrottleFn.js", "../../react-use/esm/useTitle.js", "../../react-use/esm/useTween.js", "../../react-use/esm/useUnmountPromise.js", "../../react-use/esm/useUpsert.js", "../../react-use/esm/useVibrate.js", "../../react-use/esm/useVideo.js", "../../react-use/esm/useStateValidator.js", "../../react-use/esm/useScrollbarWidth.js", "../../react-use/esm/useMultiStateValidator.js", "../../react-use/esm/useWindowScroll.js", "../../react-use/esm/useWindowSize.js", "../../react-use/esm/useMeasure.js", "../../react-use/esm/usePinchZoom.js", "../../react-use/esm/useRendersCount.js", "../../react-use/esm/useSet.js", "../../react-use/esm/factory/createGlobalState.js", "../../react-use/esm/useHash.js", "../../react-tiles-dnd/esm/tile-layout/TilesContainer.module.css.js", "../../src/utils/useComposedRef.ts", "../../src/utils/joinclasses.ts", "../../lodash-es/_freeGlobal.js", "../../lodash-es/_root.js", "../../lodash-es/_Symbol.js", "../../lodash-es/_getRawTag.js", "../../lodash-es/_objectToString.js", "../../lodash-es/_baseGetTag.js", "../../lodash-es/isObjectLike.js", "../../lodash-es/isSymbol.js", "../../lodash-es/_baseToNumber.js", "../../lodash-es/_arrayMap.js", "../../lodash-es/isArray.js", "../../lodash-es/_baseToString.js", "../../lodash-es/_createMathOperation.js", "../../lodash-es/add.js", "../../lodash-es/_trimmedEndIndex.js", "../../lodash-es/_baseTrim.js", "../../lodash-es/isObject.js", "../../lodash-es/toNumber.js", "../../lodash-es/toFinite.js", "../../lodash-es/toInteger.js", "../../lodash-es/after.js", "../../lodash-es/identity.js", "../../lodash-es/isFunction.js", "../../lodash-es/_coreJsData.js", "../../lodash-es/_isMasked.js", "../../lodash-es/_toSource.js", "../../lodash-es/_baseIsNative.js", "../../lodash-es/_getValue.js", "../../lodash-es/_getNative.js", "../../lodash-es/_WeakMap.js", "../../lodash-es/_metaMap.js", "../../lodash-es/_baseSetData.js", "../../lodash-es/_baseCreate.js", "../../lodash-es/_createCtor.js", "../../lodash-es/_createBind.js", "../../lodash-es/_apply.js", "../../lodash-es/_composeArgs.js", "../../lodash-es/_composeArgsRight.js", "../../lodash-es/_countHolders.js", "../../lodash-es/_baseLodash.js", "../../lodash-es/_LazyWrapper.js", "../../lodash-es/noop.js", "../../lodash-es/_getData.js", "../../lodash-es/_realNames.js", "../../lodash-es/_getFuncName.js", "../../lodash-es/_LodashWrapper.js", "../../lodash-es/_copyArray.js", "../../lodash-es/_wrapperClone.js", "../../lodash-es/wrapperLodash.js", "../../lodash-es/_isLaziable.js", "../../lodash-es/_shortOut.js", "../../lodash-es/_setData.js", "../../lodash-es/_getWrapDetails.js", "../../lodash-es/_insertWrapDetails.js", "../../lodash-es/constant.js", "../../lodash-es/_defineProperty.js", "../../lodash-es/_baseSetToString.js", "../../lodash-es/_setToString.js", "../../lodash-es/_arrayEach.js", "../../lodash-es/_baseFindIndex.js", "../../lodash-es/_baseIsNaN.js", "../../lodash-es/_strictIndexOf.js", "../../lodash-es/_baseIndexOf.js", "../../lodash-es/_arrayIncludes.js", "../../lodash-es/_updateWrapDetails.js", "../../lodash-es/_setWrapToString.js", "../../lodash-es/_createRecurry.js", "../../lodash-es/_getHolder.js", "../../lodash-es/_isIndex.js", "../../lodash-es/_reorder.js", "../../lodash-es/_replaceHolders.js", "../../lodash-es/_createHybrid.js", "../../lodash-es/_createCurry.js", "../../lodash-es/_createPartial.js", "../../lodash-es/_mergeData.js", "../../lodash-es/_createWrap.js", "../../lodash-es/ary.js", "../../lodash-es/_baseAssignValue.js", "../../lodash-es/eq.js", "../../lodash-es/_assignValue.js", "../../lodash-es/_copyObject.js", "../../lodash-es/_overRest.js", "../../lodash-es/_baseRest.js", "../../lodash-es/isLength.js", "../../lodash-es/isArrayLike.js", "../../lodash-es/_isIterateeCall.js", "../../lodash-es/_createAssigner.js", "../../lodash-es/_isPrototype.js", "../../lodash-es/_baseTimes.js", "../../lodash-es/_baseIsArguments.js", "../../lodash-es/isArguments.js", "../../lodash-es/stubFalse.js", "../../lodash-es/isBuffer.js", "../../lodash-es/_baseIsTypedArray.js", "../../lodash-es/_baseUnary.js", "../../lodash-es/_nodeUtil.js", "../../lodash-es/isTypedArray.js", "../../lodash-es/_arrayLikeKeys.js", "../../lodash-es/_overArg.js", "../../lodash-es/_nativeKeys.js", "../../lodash-es/_baseKeys.js", "../../lodash-es/keys.js", "../../lodash-es/assign.js", "../../lodash-es/_nativeKeysIn.js", "../../lodash-es/_baseKeysIn.js", "../../lodash-es/keysIn.js", "../../lodash-es/assignIn.js", "../../lodash-es/assignInWith.js", "../../lodash-es/assignWith.js", "../../lodash-es/_isKey.js", "../../lodash-es/_nativeCreate.js", "../../lodash-es/_hashClear.js", "../../lodash-es/_hashDelete.js", "../../lodash-es/_hashGet.js", "../../lodash-es/_hashHas.js", "../../lodash-es/_hashSet.js", "../../lodash-es/_Hash.js", "../../lodash-es/_listCacheClear.js", "../../lodash-es/_assocIndexOf.js", "../../lodash-es/_listCacheDelete.js", "../../lodash-es/_listCacheGet.js", "../../lodash-es/_listCacheHas.js", "../../lodash-es/_listCacheSet.js", "../../lodash-es/_ListCache.js", "../../lodash-es/_Map.js", "../../lodash-es/_mapCacheClear.js", "../../lodash-es/_isKeyable.js", "../../lodash-es/_getMapData.js", "../../lodash-es/_mapCacheDelete.js", "../../lodash-es/_mapCacheGet.js", "../../lodash-es/_mapCacheHas.js", "../../lodash-es/_mapCacheSet.js", "../../lodash-es/_MapCache.js", "../../lodash-es/memoize.js", "../../lodash-es/_memoizeCapped.js", "../../lodash-es/_stringToPath.js", "../../lodash-es/toString.js", "../../lodash-es/_castPath.js", "../../lodash-es/_toKey.js", "../../lodash-es/_baseGet.js", "../../lodash-es/get.js", "../../lodash-es/_baseAt.js", "../../lodash-es/_arrayPush.js", "../../lodash-es/_isFlattenable.js", "../../lodash-es/_baseFlatten.js", "../../lodash-es/flatten.js", "../../lodash-es/_flatRest.js", "../../lodash-es/at.js", "../../lodash-es/_getPrototype.js", "../../lodash-es/isPlainObject.js", "../../lodash-es/isError.js", "../../lodash-es/attempt.js", "../../lodash-es/before.js", "../../lodash-es/bind.js", "../../lodash-es/bindAll.js", "../../lodash-es/bindKey.js", "../../lodash-es/_baseSlice.js", "../../lodash-es/_castSlice.js", "../../lodash-es/_hasUnicode.js", "../../lodash-es/_asciiToArray.js", "../../lodash-es/_unicodeToArray.js", "../../lodash-es/_stringToArray.js", "../../lodash-es/_createCaseFirst.js", "../../lodash-es/upperFirst.js", "../../lodash-es/capitalize.js", "../../lodash-es/_arrayReduce.js", "../../lodash-es/_basePropertyOf.js", "../../lodash-es/_deburrLetter.js", "../../lodash-es/deburr.js", "../../lodash-es/_asciiWords.js", "../../lodash-es/_hasUnicodeWord.js", "../../lodash-es/_unicodeWords.js", "../../lodash-es/words.js", "../../lodash-es/_createCompounder.js", "../../lodash-es/camelCase.js", "../../lodash-es/castArray.js", "../../lodash-es/_createRound.js", "../../lodash-es/ceil.js", "../../lodash-es/chain.js", "../../lodash-es/chunk.js", "../../lodash-es/_baseClamp.js", "../../lodash-es/clamp.js", "../../lodash-es/_stackClear.js", "../../lodash-es/_stackDelete.js", "../../lodash-es/_stackGet.js", "../../lodash-es/_stackHas.js", "../../lodash-es/_stackSet.js", "../../lodash-es/_Stack.js", "../../lodash-es/_baseAssign.js", "../../lodash-es/_baseAssignIn.js", "../../lodash-es/_cloneBuffer.js", "../../lodash-es/_arrayFilter.js", "../../lodash-es/stubArray.js", "../../lodash-es/_getSymbols.js", "../../lodash-es/_copySymbols.js", "../../lodash-es/_getSymbolsIn.js", "../../lodash-es/_copySymbolsIn.js", "../../lodash-es/_baseGetAllKeys.js", "../../lodash-es/_getAllKeys.js", "../../lodash-es/_getAllKeysIn.js", "../../lodash-es/_DataView.js", "../../lodash-es/_Promise.js", "../../lodash-es/_Set.js", "../../lodash-es/_getTag.js", "../../lodash-es/_initCloneArray.js", "../../lodash-es/_Uint8Array.js", "../../lodash-es/_cloneArrayBuffer.js", "../../lodash-es/_cloneDataView.js", "../../lodash-es/_cloneRegExp.js", "../../lodash-es/_cloneSymbol.js", "../../lodash-es/_cloneTypedArray.js", "../../lodash-es/_initCloneByTag.js", "../../lodash-es/_initCloneObject.js", "../../lodash-es/_baseIsMap.js", "../../lodash-es/isMap.js", "../../lodash-es/_baseIsSet.js", "../../lodash-es/isSet.js", "../../lodash-es/_baseClone.js", "../../lodash-es/clone.js", "../../lodash-es/cloneDeep.js", "../../lodash-es/cloneDeepWith.js", "../../lodash-es/cloneWith.js", "../../lodash-es/commit.js", "../../lodash-es/compact.js", "../../lodash-es/concat.js", "../../lodash-es/_setCacheAdd.js", "../../lodash-es/_setCacheHas.js", "../../lodash-es/_SetCache.js", "../../lodash-es/_arraySome.js", "../../lodash-es/_cacheHas.js", "../../lodash-es/_equalArrays.js", "../../lodash-es/_mapToArray.js", "../../lodash-es/_setToArray.js", "../../lodash-es/_equalByTag.js", "../../lodash-es/_equalObjects.js", "../../lodash-es/_baseIsEqualDeep.js", "../../lodash-es/_baseIsEqual.js", "../../lodash-es/_baseIsMatch.js", "../../lodash-es/_isStrictComparable.js", "../../lodash-es/_getMatchData.js", "../../lodash-es/_matchesStrictComparable.js", "../../lodash-es/_baseMatches.js", "../../lodash-es/_baseHasIn.js", "../../lodash-es/_hasPath.js", "../../lodash-es/hasIn.js", "../../lodash-es/_baseMatchesProperty.js", "../../lodash-es/_baseProperty.js", "../../lodash-es/_basePropertyDeep.js", "../../lodash-es/property.js", "../../lodash-es/_baseIteratee.js", "../../lodash-es/cond.js", "../../lodash-es/_baseConformsTo.js", "../../lodash-es/_baseConforms.js", "../../lodash-es/conforms.js", "../../lodash-es/conformsTo.js", "../../lodash-es/_arrayAggregator.js", "../../lodash-es/_createBaseFor.js", "../../lodash-es/_baseFor.js", "../../lodash-es/_baseForOwn.js", "../../lodash-es/_createBaseEach.js", "../../lodash-es/_baseEach.js", "../../lodash-es/_baseAggregator.js", "../../lodash-es/_createAggregator.js", "../../lodash-es/countBy.js", "../../lodash-es/create.js", "../../lodash-es/curry.js", "../../lodash-es/curryRight.js", "../../lodash-es/now.js", "../../lodash-es/debounce.js", "../../lodash-es/defaultTo.js", "../../lodash-es/defaults.js", "../../lodash-es/_assignMergeValue.js", "../../lodash-es/isArrayLikeObject.js", "../../lodash-es/_safeGet.js", "../../lodash-es/toPlainObject.js", "../../lodash-es/_baseMergeDeep.js", "../../lodash-es/_baseMerge.js", "../../lodash-es/_customDefaultsMerge.js", "../../lodash-es/mergeWith.js", "../../lodash-es/defaultsDeep.js", "../../lodash-es/_baseDelay.js", "../../lodash-es/defer.js", "../../lodash-es/delay.js", "../../lodash-es/_arrayIncludesWith.js", "../../lodash-es/_baseDifference.js", "../../lodash-es/difference.js", "../../lodash-es/last.js", "../../lodash-es/differenceBy.js", "../../lodash-es/differenceWith.js", "../../lodash-es/divide.js", "../../lodash-es/drop.js", "../../lodash-es/dropRight.js", "../../lodash-es/_baseWhile.js", "../../lodash-es/dropRightWhile.js", "../../lodash-es/dropWhile.js", "../../lodash-es/_castFunction.js", "../../lodash-es/forEach.js", "../../lodash-es/_arrayEachRight.js", "../../lodash-es/_baseForRight.js", "../../lodash-es/_baseForOwnRight.js", "../../lodash-es/_baseEachRight.js", "../../lodash-es/forEachRight.js", "../../lodash-es/endsWith.js", "../../lodash-es/_baseToPairs.js", "../../lodash-es/_setToPairs.js", "../../lodash-es/_createToPairs.js", "../../lodash-es/toPairs.js", "../../lodash-es/toPairsIn.js", "../../lodash-es/_escapeHtmlChar.js", "../../lodash-es/escape.js", "../../lodash-es/escapeRegExp.js", "../../lodash-es/_arrayEvery.js", "../../lodash-es/_baseEvery.js", "../../lodash-es/every.js", "../../lodash-es/toLength.js", "../../lodash-es/_baseFill.js", "../../lodash-es/fill.js", "../../lodash-es/_baseFilter.js", "../../lodash-es/filter.js", "../../lodash-es/_createFind.js", "../../lodash-es/findIndex.js", "../../lodash-es/find.js", "../../lodash-es/_baseFindKey.js", "../../lodash-es/findKey.js", "../../lodash-es/findLastIndex.js", "../../lodash-es/findLast.js", "../../lodash-es/findLastKey.js", "../../lodash-es/head.js", "../../lodash-es/_baseMap.js", "../../lodash-es/map.js", "../../lodash-es/flatMap.js", "../../lodash-es/flatMapDeep.js", "../../lodash-es/flatMapDepth.js", "../../lodash-es/flattenDeep.js", "../../lodash-es/flattenDepth.js", "../../lodash-es/flip.js", "../../lodash-es/floor.js", "../../lodash-es/_createFlow.js", "../../lodash-es/flow.js", "../../lodash-es/flowRight.js", "../../lodash-es/forIn.js", "../../lodash-es/forInRight.js", "../../lodash-es/forOwn.js", "../../lodash-es/forOwnRight.js", "../../lodash-es/fromPairs.js", "../../lodash-es/_baseFunctions.js", "../../lodash-es/functions.js", "../../lodash-es/functionsIn.js", "../../lodash-es/groupBy.js", "../../lodash-es/_baseGt.js", "../../lodash-es/_createRelationalOperation.js", "../../lodash-es/gt.js", "../../lodash-es/gte.js", "../../lodash-es/_baseHas.js", "../../lodash-es/has.js", "../../lodash-es/_baseInRange.js", "../../lodash-es/inRange.js", "../../lodash-es/isString.js", "../../lodash-es/_baseValues.js", "../../lodash-es/values.js", "../../lodash-es/includes.js", "../../lodash-es/indexOf.js", "../../lodash-es/initial.js", "../../lodash-es/_baseIntersection.js", "../../lodash-es/_castArrayLikeObject.js", "../../lodash-es/intersection.js", "../../lodash-es/intersectionBy.js", "../../lodash-es/intersectionWith.js", "../../lodash-es/_baseInverter.js", "../../lodash-es/_createInverter.js", "../../lodash-es/invert.js", "../../lodash-es/invertBy.js", "../../lodash-es/_parent.js", "../../lodash-es/_baseInvoke.js", "../../lodash-es/invoke.js", "../../lodash-es/invokeMap.js", "../../lodash-es/_baseIsArrayBuffer.js", "../../lodash-es/isArrayBuffer.js", "../../lodash-es/isBoolean.js", "../../lodash-es/_baseIsDate.js", "../../lodash-es/isDate.js", "../../lodash-es/isElement.js", "../../lodash-es/isEmpty.js", "../../lodash-es/isEqual.js", "../../lodash-es/isEqualWith.js", "../../lodash-es/isFinite.js", "../../lodash-es/isInteger.js", "../../lodash-es/isMatch.js", "../../lodash-es/isMatchWith.js", "../../lodash-es/isNumber.js", "../../lodash-es/isNaN.js", "../../lodash-es/_isMaskable.js", "../../lodash-es/isNative.js", "../../lodash-es/isNil.js", "../../lodash-es/isNull.js", "../../lodash-es/_baseIsRegExp.js", "../../lodash-es/isRegExp.js", "../../lodash-es/isSafeInteger.js", "../../lodash-es/isUndefined.js", "../../lodash-es/isWeakMap.js", "../../lodash-es/isWeakSet.js", "../../lodash-es/iteratee.js", "../../lodash-es/join.js", "../../lodash-es/kebabCase.js", "../../lodash-es/keyBy.js", "../../lodash-es/_strictLastIndexOf.js", "../../lodash-es/lastIndexOf.js", "../../lodash-es/lowerCase.js", "../../lodash-es/lowerFirst.js", "../../lodash-es/_baseLt.js", "../../lodash-es/lt.js", "../../lodash-es/lte.js", "../../lodash-es/mapKeys.js", "../../lodash-es/mapValues.js", "../../lodash-es/matches.js", "../../lodash-es/matchesProperty.js", "../../lodash-es/_baseExtremum.js", "../../lodash-es/max.js", "../../lodash-es/maxBy.js", "../../lodash-es/_baseSum.js", "../../lodash-es/_baseMean.js", "../../lodash-es/mean.js", "../../lodash-es/meanBy.js", "../../lodash-es/merge.js", "../../lodash-es/method.js", "../../lodash-es/methodOf.js", "../../lodash-es/min.js", "../../lodash-es/minBy.js", "../../lodash-es/mixin.js", "../../lodash-es/multiply.js", "../../lodash-es/negate.js", "../../lodash-es/_iteratorToArray.js", "../../lodash-es/toArray.js", "../../lodash-es/next.js", "../../lodash-es/_baseNth.js", "../../lodash-es/nth.js", "../../lodash-es/nthArg.js", "../../lodash-es/_baseUnset.js", "../../lodash-es/_customOmitClone.js", "../../lodash-es/omit.js", "../../lodash-es/_baseSet.js", "../../lodash-es/_basePickBy.js", "../../lodash-es/pickBy.js", "../../lodash-es/omitBy.js", "../../lodash-es/once.js", "../../lodash-es/_baseSortBy.js", "../../lodash-es/_compareAscending.js", "../../lodash-es/_compareMultiple.js", "../../lodash-es/_baseOrderBy.js", "../../lodash-es/orderBy.js", "../../lodash-es/_createOver.js", "../../lodash-es/over.js", "../../lodash-es/_castRest.js", "../../lodash-es/overArgs.js", "../../lodash-es/overEvery.js", "../../lodash-es/overSome.js", "../../lodash-es/_baseRepeat.js", "../../lodash-es/_asciiSize.js", "../../lodash-es/_unicodeSize.js", "../../lodash-es/_stringSize.js", "../../lodash-es/_createPadding.js", "../../lodash-es/pad.js", "../../lodash-es/padEnd.js", "../../lodash-es/padStart.js", "../../lodash-es/parseInt.js", "../../lodash-es/partial.js", "../../lodash-es/partialRight.js", "../../lodash-es/partition.js", "../../lodash-es/_basePick.js", "../../lodash-es/pick.js", "../../lodash-es/plant.js", "../../lodash-es/propertyOf.js", "../../lodash-es/_baseIndexOfWith.js", "../../lodash-es/_basePullAll.js", "../../lodash-es/pullAll.js", "../../lodash-es/pull.js", "../../lodash-es/pullAllBy.js", "../../lodash-es/pullAllWith.js", "../../lodash-es/_basePullAt.js", "../../lodash-es/pullAt.js", "../../lodash-es/_baseRandom.js", "../../lodash-es/random.js", "../../lodash-es/_baseRange.js", "../../lodash-es/_createRange.js", "../../lodash-es/range.js", "../../lodash-es/rangeRight.js", "../../lodash-es/rearg.js", "../../lodash-es/_baseReduce.js", "../../lodash-es/reduce.js", "../../lodash-es/_arrayReduceRight.js", "../../lodash-es/reduceRight.js", "../../lodash-es/reject.js", "../../lodash-es/remove.js", "../../lodash-es/repeat.js", "../../lodash-es/replace.js", "../../lodash-es/rest.js", "../../lodash-es/result.js", "../../lodash-es/reverse.js", "../../lodash-es/round.js", "../../lodash-es/_arraySample.js", "../../lodash-es/_baseSample.js", "../../lodash-es/sample.js", "../../lodash-es/_shuffleSelf.js", "../../lodash-es/_arraySampleSize.js", "../../lodash-es/_baseSampleSize.js", "../../lodash-es/sampleSize.js", "../../lodash-es/set.js", "../../lodash-es/setWith.js", "../../lodash-es/_arrayShuffle.js", "../../lodash-es/_baseShuffle.js", "../../lodash-es/shuffle.js", "../../lodash-es/size.js", "../../lodash-es/slice.js", "../../lodash-es/snakeCase.js", "../../lodash-es/_baseSome.js", "../../lodash-es/some.js", "../../lodash-es/sortBy.js", "../../lodash-es/_baseSortedIndexBy.js", "../../lodash-es/_baseSortedIndex.js", "../../lodash-es/sortedIndex.js", "../../lodash-es/sortedIndexBy.js", "../../lodash-es/sortedIndexOf.js", "../../lodash-es/sortedLastIndex.js", "../../lodash-es/sortedLastIndexBy.js", "../../lodash-es/sortedLastIndexOf.js", "../../lodash-es/_baseSortedUniq.js", "../../lodash-es/sortedUniq.js", "../../lodash-es/sortedUniqBy.js", "../../lodash-es/split.js", "../../lodash-es/spread.js", "../../lodash-es/startCase.js", "../../lodash-es/startsWith.js", "../../lodash-es/stubObject.js", "../../lodash-es/stubString.js", "../../lodash-es/stubTrue.js", "../../lodash-es/subtract.js", "../../lodash-es/sum.js", "../../lodash-es/sumBy.js", "../../lodash-es/tail.js", "../../lodash-es/take.js", "../../lodash-es/takeRight.js", "../../lodash-es/takeRightWhile.js", "../../lodash-es/takeWhile.js", "../../lodash-es/tap.js", "../../lodash-es/_customDefaultsAssignIn.js", "../../lodash-es/_escapeStringChar.js", "../../lodash-es/_reInterpolate.js", "../../lodash-es/_reEscape.js", "../../lodash-es/_reEvaluate.js", "../../lodash-es/templateSettings.js", "../../lodash-es/template.js", "../../lodash-es/throttle.js", "../../lodash-es/thru.js", "../../lodash-es/times.js", "../../lodash-es/toIterator.js", "../../lodash-es/_baseWrapperValue.js", "../../lodash-es/wrapperValue.js", "../../lodash-es/toLower.js", "../../lodash-es/toPath.js", "../../lodash-es/toSafeInteger.js", "../../lodash-es/toUpper.js", "../../lodash-es/transform.js", "../../lodash-es/_charsEndIndex.js", "../../lodash-es/_charsStartIndex.js", "../../lodash-es/trim.js", "../../lodash-es/trimEnd.js", "../../lodash-es/trimStart.js", "../../lodash-es/truncate.js", "../../lodash-es/unary.js", "../../lodash-es/_unescapeHtmlChar.js", "../../lodash-es/unescape.js", "../../lodash-es/_createSet.js", "../../lodash-es/_baseUniq.js", "../../lodash-es/union.js", "../../lodash-es/unionBy.js", "../../lodash-es/unionWith.js", "../../lodash-es/uniq.js", "../../lodash-es/uniqBy.js", "../../lodash-es/uniqWith.js", "../../lodash-es/uniqueId.js", "../../lodash-es/unset.js", "../../lodash-es/unzip.js", "../../lodash-es/unzipWith.js", "../../lodash-es/_baseUpdate.js", "../../lodash-es/update.js", "../../lodash-es/updateWith.js", "../../lodash-es/upperCase.js", "../../lodash-es/valuesIn.js", "../../lodash-es/without.js", "../../lodash-es/wrap.js", "../../lodash-es/wrapperAt.js", "../../lodash-es/wrapperChain.js", "../../lodash-es/wrapperReverse.js", "../../lodash-es/_baseXor.js", "../../lodash-es/xor.js", "../../lodash-es/xorBy.js", "../../lodash-es/xorWith.js", "../../lodash-es/zip.js", "../../lodash-es/_baseZipObject.js", "../../lodash-es/zipObject.js", "../../lodash-es/zipObjectDeep.js", "../../lodash-es/zipWith.js", "../../lodash-es/array.default.js", "../../lodash-es/collection.default.js", "../../lodash-es/date.default.js", "../../lodash-es/function.default.js", "../../lodash-es/lang.default.js", "../../lodash-es/math.default.js", "../../lodash-es/number.default.js", "../../lodash-es/object.default.js", "../../lodash-es/seq.default.js", "../../lodash-es/string.default.js", "../../lodash-es/util.default.js", "../../lodash-es/_lazyClone.js", "../../lodash-es/_lazyReverse.js", "../../lodash-es/_getView.js", "../../lodash-es/_lazyValue.js", "../../lodash-es/lodash.default.js", "../../src/tile-layout/TilesContainer.tsx"], "sourcesContent": ["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n continue;\n }\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t// character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n", "\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n", "\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = \"true\"\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n", "'use strict';\n\nvar KEBAB_REGEX = /[A-Z]/g;\n\nvar hash = function (str) {\n var h = 5381, i = str.length;\n\n while (i) h = (h * 33) ^ str.charCodeAt(--i);\n\n return '_' + (h >>> 0).toString(36);\n};\n\nexports.create = function (config) {\n config = config || {};\n var assign = config.assign || Object.assign;\n var client = typeof window === 'object';\n\n // Check if we are really in browser environment.\n if (process.env.NODE_ENV !== 'production') {\n if (client) {\n if ((typeof document !== 'object') || !document.getElementsByTagName('HTML')) {\n console.error(\n 'nano-css detected browser environment because of \"window\" global, but ' +\n '\"document\" global seems to be defective.'\n );\n }\n }\n }\n\n var renderer = assign({\n raw: '',\n pfx: '_',\n client: client,\n assign: assign,\n stringify: JSON.stringify,\n kebab: function (prop) {\n return prop.replace(KEBAB_REGEX, '-$&').toLowerCase();\n },\n decl: function (key, value) {\n key = renderer.kebab(key);\n return key + ':' + value + ';';\n },\n hash: function (obj) {\n return hash(renderer.stringify(obj));\n },\n selector: function (parent, selector) {\n return parent + (selector[0] === ':' ? '' : ' ') + selector;\n },\n putRaw: function (rawCssRule) {\n renderer.raw += rawCssRule;\n }\n }, config);\n\n if (renderer.client) {\n if (!renderer.sh)\n document.head.appendChild(renderer.sh = document.createElement('style'));\n\n if (process.env.NODE_ENV !== 'production') {\n renderer.sh.setAttribute('data-nano-css-dev', '');\n\n // Test style sheet used in DEV mode to test if .insetRule() would throw.\n renderer.shTest = document.createElement('style');\n renderer.shTest.setAttribute('data-nano-css-dev-tests', '');\n document.head.appendChild(renderer.shTest);\n }\n\n renderer.putRaw = function (rawCssRule) {\n // .insertRule() is faster than .appendChild(), that's why we use it in PROD.\n // But CSS injected using .insertRule() is not displayed in Chrome Devtools,\n // that's why we use .appendChild in DEV.\n if (process.env.NODE_ENV === 'production') {\n var sheet = renderer.sh.sheet;\n\n // Unknown pseudo-selectors will throw, this try/catch swallows all errors.\n try {\n sheet.insertRule(rawCssRule, sheet.cssRules.length);\n // eslint-disable-next-line no-empty\n } catch (error) {}\n } else {\n // Test if .insertRule() works in dev mode. Unknown pseudo-selectors will throw when\n // .insertRule() is used, but .appendChild() will not throw.\n try {\n renderer.shTest.sheet.insertRule(rawCssRule, renderer.shTest.sheet.cssRules.length);\n } catch (error) {\n if (config.verbose) {\n console.error(error);\n }\n }\n\n // Insert pretty-printed CSS for dev mode.\n renderer.sh.appendChild(document.createTextNode(rawCssRule));\n }\n };\n }\n\n renderer.put = function (selector, decls, atrule) {\n var str = '';\n var prop, value;\n var postponed = [];\n\n for (prop in decls) {\n value = decls[prop];\n\n if ((value instanceof Object) && !(value instanceof Array)) {\n postponed.push(prop);\n } else {\n if ((process.env.NODE_ENV !== 'production') && !renderer.sourcemaps) {\n str += ' ' + renderer.decl(prop, value, selector, atrule) + '\\n';\n } else {\n str += renderer.decl(prop, value, selector, atrule);\n }\n }\n }\n\n if (str) {\n if ((process.env.NODE_ENV !== 'production') && !renderer.sourcemaps) {\n str = '\\n' + selector + ' {\\n' + str + '}\\n';\n } else {\n str = selector + '{' + str + '}';\n }\n renderer.putRaw(atrule ? atrule + '{' + str + '}' : str);\n }\n\n for (var i = 0; i < postponed.length; i++) {\n prop = postponed[i];\n\n if (prop[0] === '@' && prop !== '@font-face') {\n renderer.putAt(selector, decls[prop], prop);\n } else {\n renderer.put(renderer.selector(selector, prop), decls[prop], atrule);\n }\n }\n };\n\n renderer.putAt = renderer.put;\n\n return renderer;\n};\n", "'use strict';\n\nvar pkgName = 'nano-css';\n\nmodule.exports = function warnOnMissingDependencies (addon, renderer, deps) {\n var missing = [];\n\n for (var i = 0; i < deps.length; i++) {\n var name = deps[i];\n\n if (!renderer[name]) {\n missing.push(name);\n }\n }\n\n if (missing.length) {\n var str = 'Addon \"' + addon + '\" is missing the following dependencies:';\n\n for (var j = 0; j < missing.length; j++) {\n str += '\\n require(\"' + pkgName + '/addon/' + missing[j] + '\").addon(nano);';\n }\n\n throw new Error(str);\n }\n};\n", "'use strict';\n\nexports.addon = function (renderer) {\n // CSSOM support only browser environment.\n if (!renderer.client) return;\n\n if (process.env.NODE_ENV !== 'production') {\n require('./__dev__/warnOnMissingDependencies')('cssom', renderer, ['sh']);\n }\n\n // Style sheet for media queries.\n document.head.appendChild(renderer.msh = document.createElement('style'));\n\n renderer.createRule = function (selector, prelude) {\n var rawCss = selector + '{}';\n if (prelude) rawCss = prelude + '{' + rawCss + '}';\n var sheet = prelude ? renderer.msh.sheet : renderer.sh.sheet;\n var index = sheet.insertRule(rawCss, sheet.cssRules.length);\n var rule = (sheet.cssRules || sheet.rules)[index];\n\n // Keep track of `index` where rule was inserted in the sheet. This is\n // needed for rule deletion.\n rule.index = index;\n\n if (prelude) {\n // If rule has media query (it has prelude), move style (CSSStyleDeclaration)\n // object to the \"top\" to normalize it with a rule without the media\n // query, so that both rules have `.style` property available.\n var selectorRule = (rule.cssRules || rule.rules)[0];\n rule.style = selectorRule.style;\n rule.styleMap = selectorRule.styleMap;\n }\n\n return rule;\n };\n};\n", "function removeRule (rule) {\n var maxIndex = rule.index;\n var sh = rule.parentStyleSheet;\n var rules = sh.cssRules || sh.rules;\n maxIndex = Math.max(maxIndex, rules.length - 1);\n while (maxIndex >= 0) {\n if (rules[maxIndex] === rule) {\n sh.deleteRule(maxIndex);\n break;\n }\n maxIndex--;\n }\n}\n\nexports.removeRule = removeRule;\n", "'use strict';\n\nvar removeRule = require('./vcssom/removeRule').removeRule;\n\nexports.addon = function (renderer) {\n // VCSSOM support only browser environment.\n if (!renderer.client) return;\n\n if (process.env.NODE_ENV !== 'production') {\n require('./__dev__/warnOnMissingDependencies')('cssom', renderer, ['createRule']); // cssom\n }\n\n var kebab = renderer.kebab;\n\n function VRule (selector, prelude) {\n this.rule = renderer.createRule(selector, prelude);\n this.decl = {};\n }\n VRule.prototype.diff = function (newDecl) {\n var oldDecl = this.decl;\n var style = this.rule.style;\n var property;\n for (property in oldDecl)\n if (newDecl[property] === undefined)\n style.removeProperty(property);\n for (property in newDecl)\n if (newDecl[property] !== oldDecl[property])\n style.setProperty(kebab(property), newDecl[property]);\n this.decl = newDecl;\n };\n VRule.prototype.del = function () {\n removeRule(this.rule);\n };\n\n function VSheet () {\n /**\n * {\n * '': {\n * '': {\n * color: 'red\n * }\n * }\n * }\n */\n this.tree = {};\n }\n VSheet.prototype.diff = function (newTree) {\n var oldTree = this.tree;\n\n // Remove media queries not present in new tree.\n for (var prelude in oldTree) {\n if (newTree[prelude] === undefined) {\n var rules = oldTree[prelude];\n for (var selector in rules)\n rules[selector].del();\n }\n }\n\n for (var prelude in newTree) {\n if (oldTree[prelude] === undefined) {\n // Whole media query is new.\n for (var selector in newTree[prelude]) {\n var rule = new VRule(selector, prelude);\n rule.diff(newTree[prelude][selector]);\n newTree[prelude][selector] = rule;\n }\n } else {\n // Old tree already has rules with this media query.\n var oldRules = oldTree[prelude];\n var newRules = newTree[prelude];\n\n // Remove rules not present in new tree.\n for (var selector in oldRules)\n if (!newRules[selector])\n oldRules[selector].del();\n\n // Apply new rules.\n for (var selector in newRules) {\n var rule = oldRules[selector];\n if (rule) {\n rule.diff(newRules[selector]);\n newRules[selector] = rule;\n } else {\n rule = new VRule(selector, prelude);\n rule.diff(newRules[selector]);\n newRules[selector] = rule;\n }\n }\n }\n }\n\n this.tree = newTree;\n };\n\n renderer.VRule = VRule;\n renderer.VSheet = VSheet;\n};\n", "function cssToTree (tree, css, selector, prelude) {\n var declarations = {};\n var hasDeclarations = false;\n var key, value;\n\n for (key in css) {\n value = css[key];\n if (typeof value !== 'object') {\n hasDeclarations = true;\n declarations[key] = value;\n }\n }\n\n if (hasDeclarations) {\n if (!tree[prelude]) tree[prelude] = {};\n tree[prelude][selector] = declarations;\n }\n\n for (key in css) {\n value = css[key];\n if (typeof value === 'object') {\n if (key[0] === '@') {\n cssToTree(tree, value, selector, key);\n } else {\n var hasCurrentSymbol = key.indexOf('&') > -1;\n var selectorParts = selector.split(',');\n if (hasCurrentSymbol) {\n for (var i = 0; i < selectorParts.length; i++) {\n selectorParts[i] = key.replace(/&/g, selectorParts[i]);\n }\n } else {\n for (var i = 0; i < selectorParts.length; i++) {\n selectorParts[i] = selectorParts[i] + ' ' + key;\n }\n }\n cssToTree(tree, value, selectorParts.join(','), prelude);\n }\n }\n }\n};\n\nexports.cssToTree = cssToTree;\n", "/*!\n* screenfull\n* v5.2.0 - 2021-11-03\n* (c) Sindre Sorhus; MIT License\n*/\n(function () {\n\t'use strict';\n\n\tvar document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};\n\tvar isCommonjs = typeof module !== 'undefined' && module.exports;\n\n\tvar fn = (function () {\n\t\tvar val;\n\n\t\tvar fnMap = [\n\t\t\t[\n\t\t\t\t'requestFullscreen',\n\t\t\t\t'exitFullscreen',\n\t\t\t\t'fullscreenElement',\n\t\t\t\t'fullscreenEnabled',\n\t\t\t\t'fullscreenchange',\n\t\t\t\t'fullscreenerror'\n\t\t\t],\n\t\t\t// New WebKit\n\t\t\t[\n\t\t\t\t'webkitRequestFullscreen',\n\t\t\t\t'webkitExitFullscreen',\n\t\t\t\t'webkitFullscreenElement',\n\t\t\t\t'webkitFullscreenEnabled',\n\t\t\t\t'webkitfullscreenchange',\n\t\t\t\t'webkitfullscreenerror'\n\n\t\t\t],\n\t\t\t// Old WebKit\n\t\t\t[\n\t\t\t\t'webkitRequestFullScreen',\n\t\t\t\t'webkitCancelFullScreen',\n\t\t\t\t'webkitCurrentFullScreenElement',\n\t\t\t\t'webkitCancelFullScreen',\n\t\t\t\t'webkitfullscreenchange',\n\t\t\t\t'webkitfullscreenerror'\n\n\t\t\t],\n\t\t\t[\n\t\t\t\t'mozRequestFullScreen',\n\t\t\t\t'mozCancelFullScreen',\n\t\t\t\t'mozFullScreenElement',\n\t\t\t\t'mozFullScreenEnabled',\n\t\t\t\t'mozfullscreenchange',\n\t\t\t\t'mozfullscreenerror'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'msRequestFullscreen',\n\t\t\t\t'msExitFullscreen',\n\t\t\t\t'msFullscreenElement',\n\t\t\t\t'msFullscreenEnabled',\n\t\t\t\t'MSFullscreenChange',\n\t\t\t\t'MSFullscreenError'\n\t\t\t]\n\t\t];\n\n\t\tvar i = 0;\n\t\tvar l = fnMap.length;\n\t\tvar ret = {};\n\n\t\tfor (; i < l; i++) {\n\t\t\tval = fnMap[i];\n\t\t\tif (val && val[1] in document) {\n\t\t\t\tfor (i = 0; i < val.length; i++) {\n\t\t\t\t\tret[fnMap[0][i]] = val[i];\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t})();\n\n\tvar eventNameMap = {\n\t\tchange: fn.fullscreenchange,\n\t\terror: fn.fullscreenerror\n\t};\n\n\tvar screenfull = {\n\t\trequest: function (element, options) {\n\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\tvar onFullScreenEntered = function () {\n\t\t\t\t\tthis.off('change', onFullScreenEntered);\n\t\t\t\t\tresolve();\n\t\t\t\t}.bind(this);\n\n\t\t\t\tthis.on('change', onFullScreenEntered);\n\n\t\t\t\telement = element || document.documentElement;\n\n\t\t\t\tvar returnPromise = element[fn.requestFullscreen](options);\n\n\t\t\t\tif (returnPromise instanceof Promise) {\n\t\t\t\t\treturnPromise.then(onFullScreenEntered).catch(reject);\n\t\t\t\t}\n\t\t\t}.bind(this));\n\t\t},\n\t\texit: function () {\n\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\tif (!this.isFullscreen) {\n\t\t\t\t\tresolve();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar onFullScreenExit = function () {\n\t\t\t\t\tthis.off('change', onFullScreenExit);\n\t\t\t\t\tresolve();\n\t\t\t\t}.bind(this);\n\n\t\t\t\tthis.on('change', onFullScreenExit);\n\n\t\t\t\tvar returnPromise = document[fn.exitFullscreen]();\n\n\t\t\t\tif (returnPromise instanceof Promise) {\n\t\t\t\t\treturnPromise.then(onFullScreenExit).catch(reject);\n\t\t\t\t}\n\t\t\t}.bind(this));\n\t\t},\n\t\ttoggle: function (element, options) {\n\t\t\treturn this.isFullscreen ? this.exit() : this.request(element, options);\n\t\t},\n\t\tonchange: function (callback) {\n\t\t\tthis.on('change', callback);\n\t\t},\n\t\tonerror: function (callback) {\n\t\t\tthis.on('error', callback);\n\t\t},\n\t\ton: function (event, callback) {\n\t\t\tvar eventName = eventNameMap[event];\n\t\t\tif (eventName) {\n\t\t\t\tdocument.addEventListener(eventName, callback, false);\n\t\t\t}\n\t\t},\n\t\toff: function (event, callback) {\n\t\t\tvar eventName = eventNameMap[event];\n\t\t\tif (eventName) {\n\t\t\t\tdocument.removeEventListener(eventName, callback, false);\n\t\t\t}\n\t\t},\n\t\traw: fn\n\t};\n\n\tif (!fn) {\n\t\tif (isCommonjs) {\n\t\t\tmodule.exports = {isEnabled: false};\n\t\t} else {\n\t\t\twindow.screenfull = {isEnabled: false};\n\t\t}\n\n\t\treturn;\n\t}\n\n\tObject.defineProperties(screenfull, {\n\t\tisFullscreen: {\n\t\t\tget: function () {\n\t\t\t\treturn Boolean(document[fn.fullscreenElement]);\n\t\t\t}\n\t\t},\n\t\telement: {\n\t\t\tenumerable: true,\n\t\t\tget: function () {\n\t\t\t\treturn document[fn.fullscreenElement];\n\t\t\t}\n\t\t},\n\t\tisEnabled: {\n\t\t\tenumerable: true,\n\t\t\tget: function () {\n\t\t\t\t// Coerce to boolean in case of old WebKit\n\t\t\t\treturn Boolean(document[fn.fullscreenEnabled]);\n\t\t\t}\n\t\t}\n\t});\n\n\tif (isCommonjs) {\n\t\tmodule.exports = screenfull;\n\t} else {\n\t\twindow.screenfull = screenfull;\n\t}\n})();\n", "import {createElement as h, cloneElement, version} from 'react';\n\nconst isReact16Plus = parseInt(version.substr(0, version.indexOf('.'))) > 15;\nconst isFn = fn => typeof fn === 'function';\n\nconst render = (props, data, ...more) => {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof props !== 'object') {\n throw new TypeError('renderChildren(props, data) first argument must be a props object.');\n }\n\n const {children, render} = props;\n\n if (isFn(children) && isFn(render)) {\n console.warn(\n 'Both \"render\" and \"children\" are specified for in a universal interface component. ' +\n 'Children will be used.'\n );\n console.trace();\n }\n\n if (typeof data !== 'object') {\n console.warn(\n 'Universal component interface normally expects data to be an object, ' +\n `\"${typeof data}\" received.`\n );\n console.trace();\n }\n }\n\n const {render, children = render, component, comp = component} = props;\n\n if (isFn(children)) return children(data, ...more);\n\n if (comp) {\n return h(comp, data);\n }\n\n if (children instanceof Array)\n return isReact16Plus ? children : h('div', null, ...children);\n\n if (children && (children instanceof Object)) {\n if (process.env.NODE_ENV !== 'production') {\n if (!children.type || ((typeof children.type !== 'string') && (typeof children.type !== 'function') && (typeof children.type !== 'symbol'))) {\n console.warn(\n 'Universal component interface received object as children, ' +\n 'expected React element, but received unexpected React \"type\".'\n );\n console.trace();\n }\n\n if (typeof children.type === 'string')\n return children;\n\n return cloneElement(children, Object.assign({}, children.props, data));\n } else {\n if (typeof children.type === 'string')\n return children;\n\n return cloneElement(children, Object.assign({}, children.props, data));\n }\n }\n\n return children || null;\n};\n\nexport default render;\n", "import * as React from 'react';\n\nconst wrapInStatefulComponent = (Comp) => {\n const Decorated = class extends React.Component {\n render () {\n return Comp(this.props, this.context);\n }\n };\n\n if (process.env.NODE_ENV !== 'production') {\n (Decorated as any).displayName = `Decorated(${Comp.displayName || Comp.name})`;\n }\n\n return Decorated;\n};\n\nexport default wrapInStatefulComponent;\n", "import wrapInStatefulComponent from './wrapInStatefulComponent';\n\nconst addClassDecoratorSupport = (Comp) => {\n const isSFC = !Comp.prototype;\n return !isSFC ? Comp : wrapInStatefulComponent(Comp);\n};\n\nexport default addClassDecoratorSupport;\n", "import * as React from 'react';\nimport addClassDecoratorSupport from './addClassDecoratorSupport';\n\nconst h = React.createElement;\n\nconst noWrap = (Comp, propName, props, state) => h(Comp, propName ?\n {[propName]: state, ...props} :\n {...state, ...props}\n);\n\nexport const divWrapper = (Comp, propName, props, state) =>\n h('div', null, noWrap(Comp, propName, props, state)) as any;\n\nconst createEnhancer = (Facc, prop?: string, wrapper = noWrap) => {\n const enhancer = (Comp, propName: any = prop, faccProps: object = null) => {\n const isClassDecoratorMethodCall = typeof Comp === 'string';\n\n if (isClassDecoratorMethodCall) {\n return (Klass) => enhancer(Klass, Comp as any || prop, propName as any);\n }\n\n const Enhanced = (props) =>\n h(Facc, faccProps, (state) => wrapper(Comp, propName, props, state));\n\n if (process.env.NODE_ENV !== 'production') {\n (Enhanced as any).displayName = `${Facc.displayName || Facc.name}(${Comp.displayName || Comp.name})`;\n }\n\n return isClassDecoratorMethodCall ? addClassDecoratorSupport(Enhanced) : Enhanced;\n };\n\n return enhancer;\n}\n\nexport default createEnhancer;\n", "import {FC} from 'react';\nimport render from './render';\n\nexport type MapPropsToArgs = (props: Props) => Args;\nexport type CreateRenderProp = (hook: (...args: Args) => State, mapPropsToArgs?: MapPropsToArgs) => FC;\n\nconst defaultMapPropsToArgs = props => [props];\n\nconst hookToRenderProp: CreateRenderProp = (hook, mapPropsToArgs = defaultMapPropsToArgs as any) =>\n props => render(props, hook(...mapPropsToArgs(props)));\n\nexport default hookToRenderProp;\n", "import render from './render';\nimport createEnhancer from './createEnhancer';\nimport hookToRenderProp from './hookToRenderProp';\n\nexport interface UniversalProps {\n children?: ((data: Data) => React.ReactNode) | React.ReactNode;\n render?: (data: Data) => React.ReactNode;\n comp?: React.ComponentType;\n component?: React.ComponentType;\n}\n\nexport {\n render,\n createEnhancer,\n hookToRenderProp,\n};\n", "var keyList = Object.keys;\n\nexports.equal = function equal (a, b) {\n if (a === b) return true;\n if (!(a instanceof Object) || !(b instanceof Object)) return false;\n\n var keys = keyList(a);\n var length = keys.length;\n\n for (var i = 0; i < length; i++)\n if (!(keys[i] in b)) return false;\n\n for (var i = 0; i < length; i++)\n if (a[keys[i]] !== b[keys[i]]) return false;\n\n return length === keyList(b).length;\n};\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.easing = {\n // No easing, no acceleration\n linear: function (t) { return t; },\n // Accelerates fast, then slows quickly towards end.\n quadratic: function (t) { return t * (-(t * t) * t + 4 * t * t - 6 * t + 4); },\n // Overshoots over 1 and then returns to 1 towards end.\n cubic: function (t) { return t * (4 * t * t - 9 * t + 6); },\n // Overshoots over 1 multiple times - wiggles around 1.\n elastic: function (t) { return t * (33 * t * t * t * t - 106 * t * t * t + 126 * t * t - 67 * t + 15); },\n // Accelerating from zero velocity\n inQuad: function (t) { return t * t; },\n // Decelerating to zero velocity\n outQuad: function (t) { return t * (2 - t); },\n // Acceleration until halfway, then deceleration\n inOutQuad: function (t) { return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t; },\n // Accelerating from zero velocity\n inCubic: function (t) { return t * t * t; },\n // Decelerating to zero velocity\n outCubic: function (t) { return (--t) * t * t + 1; },\n // Acceleration until halfway, then deceleration\n inOutCubic: function (t) { return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; },\n // Accelerating from zero velocity\n inQuart: function (t) { return t * t * t * t; },\n // Decelerating to zero velocity\n outQuart: function (t) { return 1 - (--t) * t * t * t; },\n // Acceleration until halfway, then deceleration\n inOutQuart: function (t) { return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t; },\n // Accelerating from zero velocity\n inQuint: function (t) { return t * t * t * t * t; },\n // Decelerating to zero velocity\n outQuint: function (t) { return 1 + (--t) * t * t * t * t; },\n // Acceleration until halfway, then deceleration\n inOutQuint: function (t) { return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t; },\n // Accelerating from zero velocity\n inSine: function (t) { return -Math.cos(t * (Math.PI / 2)) + 1; },\n // Decelerating to zero velocity\n outSine: function (t) { return Math.sin(t * (Math.PI / 2)); },\n // Accelerating until halfway, then decelerating\n inOutSine: function (t) { return -(Math.cos(Math.PI * t) - 1) / 2; },\n // Exponential accelerating from zero velocity\n inExpo: function (t) { return Math.pow(2, 10 * (t - 1)); },\n // Exponential decelerating to zero velocity\n outExpo: function (t) { return -Math.pow(2, -10 * t) + 1; },\n // Exponential accelerating until halfway, then decelerating\n inOutExpo: function (t) {\n t /= .5;\n if (t < 1)\n return Math.pow(2, 10 * (t - 1)) / 2;\n t--;\n return (-Math.pow(2, -10 * t) + 2) / 2;\n },\n // Circular accelerating from zero velocity\n inCirc: function (t) { return -Math.sqrt(1 - t * t) + 1; },\n // Circular decelerating to zero velocity Moves VERY fast at the beginning and\n // then quickly slows down in the middle. This tween can actually be used\n // in continuous transitions where target value changes all the time,\n // because of the very quick start, it hides the jitter between target value changes.\n outCirc: function (t) { return Math.sqrt(1 - (t = t - 1) * t); },\n // Circular acceleration until halfway, then deceleration\n inOutCirc: function (t) {\n t /= .5;\n if (t < 1)\n return -(Math.sqrt(1 - t * t) - 1) / 2;\n t -= 2;\n return (Math.sqrt(1 - t * t) + 1) / 2;\n }\n};\n", "function clamp(v, min, max) {\n return Math.max(min, Math.min(v, max));\n}\nconst V = {\n toVector(v, fallback) {\n if (v === undefined) v = fallback;\n return Array.isArray(v) ? v : [v, v];\n },\n add(v1, v2) {\n return [v1[0] + v2[0], v1[1] + v2[1]];\n },\n sub(v1, v2) {\n return [v1[0] - v2[0], v1[1] - v2[1]];\n },\n addTo(v1, v2) {\n v1[0] += v2[0];\n v1[1] += v2[1];\n },\n subTo(v1, v2) {\n v1[0] -= v2[0];\n v1[1] -= v2[1];\n }\n};\nfunction rubberband(distance, dimension, constant) {\n if (dimension === 0 || Math.abs(dimension) === Infinity) return Math.pow(distance, constant * 5);\n return distance * dimension * constant / (dimension + constant * distance);\n}\nfunction rubberbandIfOutOfBounds(position, min, max, constant = 0.15) {\n if (constant === 0) return clamp(position, min, max);\n if (position < min) return -rubberband(min - position, max - min, constant) + min;\n if (position > max) return +rubberband(position - max, max - min, constant) + max;\n return position;\n}\nfunction computeRubberband(bounds, [Vx, Vy], [Rx, Ry]) {\n const [[X0, X1], [Y0, Y1]] = bounds;\n return [rubberbandIfOutOfBounds(Vx, X0, X1, Rx), rubberbandIfOutOfBounds(Vy, Y0, Y1, Ry)];\n}\n\nexport { V, computeRubberband as c, rubberbandIfOutOfBounds as r };\n", "import { V, c as computeRubberband } from './maths-0ab39ae9.esm.js';\n\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\n\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nfunction _defineProperty(obj, key, value) {\n key = _toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\n\nconst EVENT_TYPE_MAP = {\n pointer: {\n start: 'down',\n change: 'move',\n end: 'up'\n },\n mouse: {\n start: 'down',\n change: 'move',\n end: 'up'\n },\n touch: {\n start: 'start',\n change: 'move',\n end: 'end'\n },\n gesture: {\n start: 'start',\n change: 'change',\n end: 'end'\n }\n};\nfunction capitalize(string) {\n if (!string) return '';\n return string[0].toUpperCase() + string.slice(1);\n}\nconst actionsWithoutCaptureSupported = ['enter', 'leave'];\nfunction hasCapture(capture = false, actionKey) {\n return capture && !actionsWithoutCaptureSupported.includes(actionKey);\n}\nfunction toHandlerProp(device, action = '', capture = false) {\n const deviceProps = EVENT_TYPE_MAP[device];\n const actionKey = deviceProps ? deviceProps[action] || action : action;\n return 'on' + capitalize(device) + capitalize(actionKey) + (hasCapture(capture, actionKey) ? 'Capture' : '');\n}\nconst pointerCaptureEvents = ['gotpointercapture', 'lostpointercapture'];\nfunction parseProp(prop) {\n let eventKey = prop.substring(2).toLowerCase();\n const passive = !!~eventKey.indexOf('passive');\n if (passive) eventKey = eventKey.replace('passive', '');\n const captureKey = pointerCaptureEvents.includes(eventKey) ? 'capturecapture' : 'capture';\n const capture = !!~eventKey.indexOf(captureKey);\n if (capture) eventKey = eventKey.replace('capture', '');\n return {\n device: eventKey,\n capture,\n passive\n };\n}\nfunction toDomEventType(device, action = '') {\n const deviceProps = EVENT_TYPE_MAP[device];\n const actionKey = deviceProps ? deviceProps[action] || action : action;\n return device + actionKey;\n}\nfunction isTouch(event) {\n return 'touches' in event;\n}\nfunction getPointerType(event) {\n if (isTouch(event)) return 'touch';\n if ('pointerType' in event) return event.pointerType;\n return 'mouse';\n}\nfunction getCurrentTargetTouchList(event) {\n return Array.from(event.touches).filter(e => {\n var _event$currentTarget, _event$currentTarget$;\n return e.target === event.currentTarget || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || (_event$currentTarget$ = _event$currentTarget.contains) === null || _event$currentTarget$ === void 0 ? void 0 : _event$currentTarget$.call(_event$currentTarget, e.target));\n });\n}\nfunction getTouchList(event) {\n return event.type === 'touchend' || event.type === 'touchcancel' ? event.changedTouches : event.targetTouches;\n}\nfunction getValueEvent(event) {\n return isTouch(event) ? getTouchList(event)[0] : event;\n}\nfunction distanceAngle(P1, P2) {\n try {\n const dx = P2.clientX - P1.clientX;\n const dy = P2.clientY - P1.clientY;\n const cx = (P2.clientX + P1.clientX) / 2;\n const cy = (P2.clientY + P1.clientY) / 2;\n const distance = Math.hypot(dx, dy);\n const angle = -(Math.atan2(dx, dy) * 180) / Math.PI;\n const origin = [cx, cy];\n return {\n angle,\n distance,\n origin\n };\n } catch (_unused) {}\n return null;\n}\nfunction touchIds(event) {\n return getCurrentTargetTouchList(event).map(touch => touch.identifier);\n}\nfunction touchDistanceAngle(event, ids) {\n const [P1, P2] = Array.from(event.touches).filter(touch => ids.includes(touch.identifier));\n return distanceAngle(P1, P2);\n}\nfunction pointerId(event) {\n const valueEvent = getValueEvent(event);\n return isTouch(event) ? valueEvent.identifier : valueEvent.pointerId;\n}\nfunction pointerValues(event) {\n const valueEvent = getValueEvent(event);\n return [valueEvent.clientX, valueEvent.clientY];\n}\nconst LINE_HEIGHT = 40;\nconst PAGE_HEIGHT = 800;\nfunction wheelValues(event) {\n let {\n deltaX,\n deltaY,\n deltaMode\n } = event;\n if (deltaMode === 1) {\n deltaX *= LINE_HEIGHT;\n deltaY *= LINE_HEIGHT;\n } else if (deltaMode === 2) {\n deltaX *= PAGE_HEIGHT;\n deltaY *= PAGE_HEIGHT;\n }\n return [deltaX, deltaY];\n}\nfunction scrollValues(event) {\n var _ref, _ref2;\n const {\n scrollX,\n scrollY,\n scrollLeft,\n scrollTop\n } = event.currentTarget;\n return [(_ref = scrollX !== null && scrollX !== void 0 ? scrollX : scrollLeft) !== null && _ref !== void 0 ? _ref : 0, (_ref2 = scrollY !== null && scrollY !== void 0 ? scrollY : scrollTop) !== null && _ref2 !== void 0 ? _ref2 : 0];\n}\nfunction getEventDetails(event) {\n const payload = {};\n if ('buttons' in event) payload.buttons = event.buttons;\n if ('shiftKey' in event) {\n const {\n shiftKey,\n altKey,\n metaKey,\n ctrlKey\n } = event;\n Object.assign(payload, {\n shiftKey,\n altKey,\n metaKey,\n ctrlKey\n });\n }\n return payload;\n}\n\nfunction call(v, ...args) {\n if (typeof v === 'function') {\n return v(...args);\n } else {\n return v;\n }\n}\nfunction noop() {}\nfunction chain(...fns) {\n if (fns.length === 0) return noop;\n if (fns.length === 1) return fns[0];\n return function () {\n let result;\n for (const fn of fns) {\n result = fn.apply(this, arguments) || result;\n }\n return result;\n };\n}\nfunction assignDefault(value, fallback) {\n return Object.assign({}, fallback, value || {});\n}\n\nconst BEFORE_LAST_KINEMATICS_DELAY = 32;\nclass Engine {\n constructor(ctrl, args, key) {\n this.ctrl = ctrl;\n this.args = args;\n this.key = key;\n if (!this.state) {\n this.state = {};\n this.computeValues([0, 0]);\n this.computeInitial();\n if (this.init) this.init();\n this.reset();\n }\n }\n get state() {\n return this.ctrl.state[this.key];\n }\n set state(state) {\n this.ctrl.state[this.key] = state;\n }\n get shared() {\n return this.ctrl.state.shared;\n }\n get eventStore() {\n return this.ctrl.gestureEventStores[this.key];\n }\n get timeoutStore() {\n return this.ctrl.gestureTimeoutStores[this.key];\n }\n get config() {\n return this.ctrl.config[this.key];\n }\n get sharedConfig() {\n return this.ctrl.config.shared;\n }\n get handler() {\n return this.ctrl.handlers[this.key];\n }\n reset() {\n const {\n state,\n shared,\n ingKey,\n args\n } = this;\n shared[ingKey] = state._active = state.active = state._blocked = state._force = false;\n state._step = [false, false];\n state.intentional = false;\n state._movement = [0, 0];\n state._distance = [0, 0];\n state._direction = [0, 0];\n state._delta = [0, 0];\n state._bounds = [[-Infinity, Infinity], [-Infinity, Infinity]];\n state.args = args;\n state.axis = undefined;\n state.memo = undefined;\n state.elapsedTime = state.timeDelta = 0;\n state.direction = [0, 0];\n state.distance = [0, 0];\n state.overflow = [0, 0];\n state._movementBound = [false, false];\n state.velocity = [0, 0];\n state.movement = [0, 0];\n state.delta = [0, 0];\n state.timeStamp = 0;\n }\n start(event) {\n const state = this.state;\n const config = this.config;\n if (!state._active) {\n this.reset();\n this.computeInitial();\n state._active = true;\n state.target = event.target;\n state.currentTarget = event.currentTarget;\n state.lastOffset = config.from ? call(config.from, state) : state.offset;\n state.offset = state.lastOffset;\n state.startTime = state.timeStamp = event.timeStamp;\n }\n }\n computeValues(values) {\n const state = this.state;\n state._values = values;\n state.values = this.config.transform(values);\n }\n computeInitial() {\n const state = this.state;\n state._initial = state._values;\n state.initial = state.values;\n }\n compute(event) {\n const {\n state,\n config,\n shared\n } = this;\n state.args = this.args;\n let dt = 0;\n if (event) {\n state.event = event;\n if (config.preventDefault && event.cancelable) state.event.preventDefault();\n state.type = event.type;\n shared.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size;\n shared.locked = !!document.pointerLockElement;\n Object.assign(shared, getEventDetails(event));\n shared.down = shared.pressed = shared.buttons % 2 === 1 || shared.touches > 0;\n dt = event.timeStamp - state.timeStamp;\n state.timeStamp = event.timeStamp;\n state.elapsedTime = state.timeStamp - state.startTime;\n }\n if (state._active) {\n const _absoluteDelta = state._delta.map(Math.abs);\n V.addTo(state._distance, _absoluteDelta);\n }\n if (this.axisIntent) this.axisIntent(event);\n const [_m0, _m1] = state._movement;\n const [t0, t1] = config.threshold;\n const {\n _step,\n values\n } = state;\n if (config.hasCustomTransform) {\n if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && values[0];\n if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && values[1];\n } else {\n if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && Math.sign(_m0) * t0;\n if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && Math.sign(_m1) * t1;\n }\n state.intentional = _step[0] !== false || _step[1] !== false;\n if (!state.intentional) return;\n const movement = [0, 0];\n if (config.hasCustomTransform) {\n const [v0, v1] = values;\n movement[0] = _step[0] !== false ? v0 - _step[0] : 0;\n movement[1] = _step[1] !== false ? v1 - _step[1] : 0;\n } else {\n movement[0] = _step[0] !== false ? _m0 - _step[0] : 0;\n movement[1] = _step[1] !== false ? _m1 - _step[1] : 0;\n }\n if (this.restrictToAxis && !state._blocked) this.restrictToAxis(movement);\n const previousOffset = state.offset;\n const gestureIsActive = state._active && !state._blocked || state.active;\n if (gestureIsActive) {\n state.first = state._active && !state.active;\n state.last = !state._active && state.active;\n state.active = shared[this.ingKey] = state._active;\n if (event) {\n if (state.first) {\n if ('bounds' in config) state._bounds = call(config.bounds, state);\n if (this.setup) this.setup();\n }\n state.movement = movement;\n this.computeOffset();\n }\n }\n const [ox, oy] = state.offset;\n const [[x0, x1], [y0, y1]] = state._bounds;\n state.overflow = [ox < x0 ? -1 : ox > x1 ? 1 : 0, oy < y0 ? -1 : oy > y1 ? 1 : 0];\n state._movementBound[0] = state.overflow[0] ? state._movementBound[0] === false ? state._movement[0] : state._movementBound[0] : false;\n state._movementBound[1] = state.overflow[1] ? state._movementBound[1] === false ? state._movement[1] : state._movementBound[1] : false;\n const rubberband = state._active ? config.rubberband || [0, 0] : [0, 0];\n state.offset = computeRubberband(state._bounds, state.offset, rubberband);\n state.delta = V.sub(state.offset, previousOffset);\n this.computeMovement();\n if (gestureIsActive && (!state.last || dt > BEFORE_LAST_KINEMATICS_DELAY)) {\n state.delta = V.sub(state.offset, previousOffset);\n const absoluteDelta = state.delta.map(Math.abs);\n V.addTo(state.distance, absoluteDelta);\n state.direction = state.delta.map(Math.sign);\n state._direction = state._delta.map(Math.sign);\n if (!state.first && dt > 0) {\n state.velocity = [absoluteDelta[0] / dt, absoluteDelta[1] / dt];\n state.timeDelta = dt;\n }\n }\n }\n emit() {\n const state = this.state;\n const shared = this.shared;\n const config = this.config;\n if (!state._active) this.clean();\n if ((state._blocked || !state.intentional) && !state._force && !config.triggerAllEvents) return;\n const memo = this.handler(_objectSpread2(_objectSpread2(_objectSpread2({}, shared), state), {}, {\n [this.aliasKey]: state.values\n }));\n if (memo !== undefined) state.memo = memo;\n }\n clean() {\n this.eventStore.clean();\n this.timeoutStore.clean();\n }\n}\n\nfunction selectAxis([dx, dy], threshold) {\n const absDx = Math.abs(dx);\n const absDy = Math.abs(dy);\n if (absDx > absDy && absDx > threshold) {\n return 'x';\n }\n if (absDy > absDx && absDy > threshold) {\n return 'y';\n }\n return undefined;\n}\nclass CoordinatesEngine extends Engine {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"aliasKey\", 'xy');\n }\n reset() {\n super.reset();\n this.state.axis = undefined;\n }\n init() {\n this.state.offset = [0, 0];\n this.state.lastOffset = [0, 0];\n }\n computeOffset() {\n this.state.offset = V.add(this.state.lastOffset, this.state.movement);\n }\n computeMovement() {\n this.state.movement = V.sub(this.state.offset, this.state.lastOffset);\n }\n axisIntent(event) {\n const state = this.state;\n const config = this.config;\n if (!state.axis && event) {\n const threshold = typeof config.axisThreshold === 'object' ? config.axisThreshold[getPointerType(event)] : config.axisThreshold;\n state.axis = selectAxis(state._movement, threshold);\n }\n state._blocked = (config.lockDirection || !!config.axis) && !state.axis || !!config.axis && config.axis !== state.axis;\n }\n restrictToAxis(v) {\n if (this.config.axis || this.config.lockDirection) {\n switch (this.state.axis) {\n case 'x':\n v[1] = 0;\n break;\n case 'y':\n v[0] = 0;\n break;\n }\n }\n }\n}\n\nconst identity = v => v;\nconst DEFAULT_RUBBERBAND = 0.15;\nconst commonConfigResolver = {\n enabled(value = true) {\n return value;\n },\n eventOptions(value, _k, config) {\n return _objectSpread2(_objectSpread2({}, config.shared.eventOptions), value);\n },\n preventDefault(value = false) {\n return value;\n },\n triggerAllEvents(value = false) {\n return value;\n },\n rubberband(value = 0) {\n switch (value) {\n case true:\n return [DEFAULT_RUBBERBAND, DEFAULT_RUBBERBAND];\n case false:\n return [0, 0];\n default:\n return V.toVector(value);\n }\n },\n from(value) {\n if (typeof value === 'function') return value;\n if (value != null) return V.toVector(value);\n },\n transform(value, _k, config) {\n const transform = value || config.shared.transform;\n this.hasCustomTransform = !!transform;\n if (process.env.NODE_ENV === 'development') {\n const originalTransform = transform || identity;\n return v => {\n const r = originalTransform(v);\n if (!isFinite(r[0]) || !isFinite(r[1])) {\n console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${r[0]},${[1]}]`);\n }\n return r;\n };\n }\n return transform || identity;\n },\n threshold(value) {\n return V.toVector(value, 0);\n }\n};\nif (process.env.NODE_ENV === 'development') {\n Object.assign(commonConfigResolver, {\n domTarget(value) {\n if (value !== undefined) {\n throw Error(`[@use-gesture]: \\`domTarget\\` option has been renamed to \\`target\\`.`);\n }\n return NaN;\n },\n lockDirection(value) {\n if (value !== undefined) {\n throw Error(`[@use-gesture]: \\`lockDirection\\` option has been merged with \\`axis\\`. Use it as in \\`{ axis: 'lock' }\\``);\n }\n return NaN;\n },\n initial(value) {\n if (value !== undefined) {\n throw Error(`[@use-gesture]: \\`initial\\` option has been renamed to \\`from\\`.`);\n }\n return NaN;\n }\n });\n}\n\nconst DEFAULT_AXIS_THRESHOLD = 0;\nconst coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {\n axis(_v, _k, {\n axis\n }) {\n this.lockDirection = axis === 'lock';\n if (!this.lockDirection) return axis;\n },\n axisThreshold(value = DEFAULT_AXIS_THRESHOLD) {\n return value;\n },\n bounds(value = {}) {\n if (typeof value === 'function') {\n return state => coordinatesConfigResolver.bounds(value(state));\n }\n if ('current' in value) {\n return () => value.current;\n }\n if (typeof HTMLElement === 'function' && value instanceof HTMLElement) {\n return value;\n }\n const {\n left = -Infinity,\n right = Infinity,\n top = -Infinity,\n bottom = Infinity\n } = value;\n return [[left, right], [top, bottom]];\n }\n});\n\nconst KEYS_DELTA_MAP = {\n ArrowRight: (displacement, factor = 1) => [displacement * factor, 0],\n ArrowLeft: (displacement, factor = 1) => [-1 * displacement * factor, 0],\n ArrowUp: (displacement, factor = 1) => [0, -1 * displacement * factor],\n ArrowDown: (displacement, factor = 1) => [0, displacement * factor]\n};\nclass DragEngine extends CoordinatesEngine {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"ingKey\", 'dragging');\n }\n reset() {\n super.reset();\n const state = this.state;\n state._pointerId = undefined;\n state._pointerActive = false;\n state._keyboardActive = false;\n state._preventScroll = false;\n state._delayed = false;\n state.swipe = [0, 0];\n state.tap = false;\n state.canceled = false;\n state.cancel = this.cancel.bind(this);\n }\n setup() {\n const state = this.state;\n if (state._bounds instanceof HTMLElement) {\n const boundRect = state._bounds.getBoundingClientRect();\n const targetRect = state.currentTarget.getBoundingClientRect();\n const _bounds = {\n left: boundRect.left - targetRect.left + state.offset[0],\n right: boundRect.right - targetRect.right + state.offset[0],\n top: boundRect.top - targetRect.top + state.offset[1],\n bottom: boundRect.bottom - targetRect.bottom + state.offset[1]\n };\n state._bounds = coordinatesConfigResolver.bounds(_bounds);\n }\n }\n cancel() {\n const state = this.state;\n if (state.canceled) return;\n state.canceled = true;\n state._active = false;\n setTimeout(() => {\n this.compute();\n this.emit();\n }, 0);\n }\n setActive() {\n this.state._active = this.state._pointerActive || this.state._keyboardActive;\n }\n clean() {\n this.pointerClean();\n this.state._pointerActive = false;\n this.state._keyboardActive = false;\n super.clean();\n }\n pointerDown(event) {\n const config = this.config;\n const state = this.state;\n if (event.buttons != null && (Array.isArray(config.pointerButtons) ? !config.pointerButtons.includes(event.buttons) : config.pointerButtons !== -1 && config.pointerButtons !== event.buttons)) return;\n const ctrlIds = this.ctrl.setEventIds(event);\n if (config.pointerCapture) {\n event.target.setPointerCapture(event.pointerId);\n }\n if (ctrlIds && ctrlIds.size > 1 && state._pointerActive) return;\n this.start(event);\n this.setupPointer(event);\n state._pointerId = pointerId(event);\n state._pointerActive = true;\n this.computeValues(pointerValues(event));\n this.computeInitial();\n if (config.preventScrollAxis && getPointerType(event) !== 'mouse') {\n state._active = false;\n this.setupScrollPrevention(event);\n } else if (config.delay > 0) {\n this.setupDelayTrigger(event);\n if (config.triggerAllEvents) {\n this.compute(event);\n this.emit();\n }\n } else {\n this.startPointerDrag(event);\n }\n }\n startPointerDrag(event) {\n const state = this.state;\n state._active = true;\n state._preventScroll = true;\n state._delayed = false;\n this.compute(event);\n this.emit();\n }\n pointerMove(event) {\n const state = this.state;\n const config = this.config;\n if (!state._pointerActive) return;\n const id = pointerId(event);\n if (state._pointerId !== undefined && id !== state._pointerId) return;\n const _values = pointerValues(event);\n if (document.pointerLockElement === event.target) {\n state._delta = [event.movementX, event.movementY];\n } else {\n state._delta = V.sub(_values, state._values);\n this.computeValues(_values);\n }\n V.addTo(state._movement, state._delta);\n this.compute(event);\n if (state._delayed && state.intentional) {\n this.timeoutStore.remove('dragDelay');\n state.active = false;\n this.startPointerDrag(event);\n return;\n }\n if (config.preventScrollAxis && !state._preventScroll) {\n if (state.axis) {\n if (state.axis === config.preventScrollAxis || config.preventScrollAxis === 'xy') {\n state._active = false;\n this.clean();\n return;\n } else {\n this.timeoutStore.remove('startPointerDrag');\n this.startPointerDrag(event);\n return;\n }\n } else {\n return;\n }\n }\n this.emit();\n }\n pointerUp(event) {\n this.ctrl.setEventIds(event);\n try {\n if (this.config.pointerCapture && event.target.hasPointerCapture(event.pointerId)) {\n ;\n event.target.releasePointerCapture(event.pointerId);\n }\n } catch (_unused) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`[@use-gesture]: If you see this message, it's likely that you're using an outdated version of \\`@react-three/fiber\\`. \\n\\nPlease upgrade to the latest version.`);\n }\n }\n const state = this.state;\n const config = this.config;\n if (!state._active || !state._pointerActive) return;\n const id = pointerId(event);\n if (state._pointerId !== undefined && id !== state._pointerId) return;\n this.state._pointerActive = false;\n this.setActive();\n this.compute(event);\n const [dx, dy] = state._distance;\n state.tap = dx <= config.tapsThreshold && dy <= config.tapsThreshold;\n if (state.tap && config.filterTaps) {\n state._force = true;\n } else {\n const [_dx, _dy] = state._delta;\n const [_mx, _my] = state._movement;\n const [svx, svy] = config.swipe.velocity;\n const [sx, sy] = config.swipe.distance;\n const sdt = config.swipe.duration;\n if (state.elapsedTime < sdt) {\n const _vx = Math.abs(_dx / state.timeDelta);\n const _vy = Math.abs(_dy / state.timeDelta);\n if (_vx > svx && Math.abs(_mx) > sx) state.swipe[0] = Math.sign(_dx);\n if (_vy > svy && Math.abs(_my) > sy) state.swipe[1] = Math.sign(_dy);\n }\n }\n this.emit();\n }\n pointerClick(event) {\n if (!this.state.tap && event.detail > 0) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n setupPointer(event) {\n const config = this.config;\n const device = config.device;\n if (process.env.NODE_ENV === 'development') {\n try {\n if (device === 'pointer' && config.preventScrollDelay === undefined) {\n const currentTarget = 'uv' in event ? event.sourceEvent.currentTarget : event.currentTarget;\n const style = window.getComputedStyle(currentTarget);\n if (style.touchAction === 'auto') {\n console.warn(`[@use-gesture]: The drag target has its \\`touch-action\\` style property set to \\`auto\\`. It is recommended to add \\`touch-action: 'none'\\` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\\n\\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.`, currentTarget);\n }\n }\n } catch (_unused2) {}\n }\n if (config.pointerLock) {\n event.currentTarget.requestPointerLock();\n }\n if (!config.pointerCapture) {\n this.eventStore.add(this.sharedConfig.window, device, 'change', this.pointerMove.bind(this));\n this.eventStore.add(this.sharedConfig.window, device, 'end', this.pointerUp.bind(this));\n this.eventStore.add(this.sharedConfig.window, device, 'cancel', this.pointerUp.bind(this));\n }\n }\n pointerClean() {\n if (this.config.pointerLock && document.pointerLockElement === this.state.currentTarget) {\n document.exitPointerLock();\n }\n }\n preventScroll(event) {\n if (this.state._preventScroll && event.cancelable) {\n event.preventDefault();\n }\n }\n setupScrollPrevention(event) {\n this.state._preventScroll = false;\n persistEvent(event);\n const remove = this.eventStore.add(this.sharedConfig.window, 'touch', 'change', this.preventScroll.bind(this), {\n passive: false\n });\n this.eventStore.add(this.sharedConfig.window, 'touch', 'end', remove);\n this.eventStore.add(this.sharedConfig.window, 'touch', 'cancel', remove);\n this.timeoutStore.add('startPointerDrag', this.startPointerDrag.bind(this), this.config.preventScrollDelay, event);\n }\n setupDelayTrigger(event) {\n this.state._delayed = true;\n this.timeoutStore.add('dragDelay', () => {\n this.state._step = [0, 0];\n this.startPointerDrag(event);\n }, this.config.delay);\n }\n keyDown(event) {\n const deltaFn = KEYS_DELTA_MAP[event.key];\n if (deltaFn) {\n const state = this.state;\n const factor = event.shiftKey ? 10 : event.altKey ? 0.1 : 1;\n this.start(event);\n state._delta = deltaFn(this.config.keyboardDisplacement, factor);\n state._keyboardActive = true;\n V.addTo(state._movement, state._delta);\n this.compute(event);\n this.emit();\n }\n }\n keyUp(event) {\n if (!(event.key in KEYS_DELTA_MAP)) return;\n this.state._keyboardActive = false;\n this.setActive();\n this.compute(event);\n this.emit();\n }\n bind(bindFunction) {\n const device = this.config.device;\n bindFunction(device, 'start', this.pointerDown.bind(this));\n if (this.config.pointerCapture) {\n bindFunction(device, 'change', this.pointerMove.bind(this));\n bindFunction(device, 'end', this.pointerUp.bind(this));\n bindFunction(device, 'cancel', this.pointerUp.bind(this));\n bindFunction('lostPointerCapture', '', this.pointerUp.bind(this));\n }\n if (this.config.keys) {\n bindFunction('key', 'down', this.keyDown.bind(this));\n bindFunction('key', 'up', this.keyUp.bind(this));\n }\n if (this.config.filterTaps) {\n bindFunction('click', '', this.pointerClick.bind(this), {\n capture: true,\n passive: false\n });\n }\n }\n}\nfunction persistEvent(event) {\n 'persist' in event && typeof event.persist === 'function' && event.persist();\n}\n\nconst isBrowser = typeof window !== 'undefined' && window.document && window.document.createElement;\nfunction supportsTouchEvents() {\n return isBrowser && 'ontouchstart' in window;\n}\nfunction isTouchScreen() {\n return supportsTouchEvents() || isBrowser && window.navigator.maxTouchPoints > 1;\n}\nfunction supportsPointerEvents() {\n return isBrowser && 'onpointerdown' in window;\n}\nfunction supportsPointerLock() {\n return isBrowser && 'exitPointerLock' in window.document;\n}\nfunction supportsGestureEvents() {\n try {\n return 'constructor' in GestureEvent;\n } catch (e) {\n return false;\n }\n}\nconst SUPPORT = {\n isBrowser,\n gesture: supportsGestureEvents(),\n touch: supportsTouchEvents(),\n touchscreen: isTouchScreen(),\n pointer: supportsPointerEvents(),\n pointerLock: supportsPointerLock()\n};\n\nconst DEFAULT_PREVENT_SCROLL_DELAY = 250;\nconst DEFAULT_DRAG_DELAY = 180;\nconst DEFAULT_SWIPE_VELOCITY = 0.5;\nconst DEFAULT_SWIPE_DISTANCE = 50;\nconst DEFAULT_SWIPE_DURATION = 250;\nconst DEFAULT_KEYBOARD_DISPLACEMENT = 10;\nconst DEFAULT_DRAG_AXIS_THRESHOLD = {\n mouse: 0,\n touch: 0,\n pen: 8\n};\nconst dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {\n device(_v, _k, {\n pointer: {\n touch = false,\n lock = false,\n mouse = false\n } = {}\n }) {\n this.pointerLock = lock && SUPPORT.pointerLock;\n if (SUPPORT.touch && touch) return 'touch';\n if (this.pointerLock) return 'mouse';\n if (SUPPORT.pointer && !mouse) return 'pointer';\n if (SUPPORT.touch) return 'touch';\n return 'mouse';\n },\n preventScrollAxis(value, _k, {\n preventScroll\n }) {\n this.preventScrollDelay = typeof preventScroll === 'number' ? preventScroll : preventScroll || preventScroll === undefined && value ? DEFAULT_PREVENT_SCROLL_DELAY : undefined;\n if (!SUPPORT.touchscreen || preventScroll === false) return undefined;\n return value ? value : preventScroll !== undefined ? 'y' : undefined;\n },\n pointerCapture(_v, _k, {\n pointer: {\n capture = true,\n buttons = 1,\n keys = true\n } = {}\n }) {\n this.pointerButtons = buttons;\n this.keys = keys;\n return !this.pointerLock && this.device === 'pointer' && capture;\n },\n threshold(value, _k, {\n filterTaps = false,\n tapsThreshold = 3,\n axis = undefined\n }) {\n const threshold = V.toVector(value, filterTaps ? tapsThreshold : axis ? 1 : 0);\n this.filterTaps = filterTaps;\n this.tapsThreshold = tapsThreshold;\n return threshold;\n },\n swipe({\n velocity = DEFAULT_SWIPE_VELOCITY,\n distance = DEFAULT_SWIPE_DISTANCE,\n duration = DEFAULT_SWIPE_DURATION\n } = {}) {\n return {\n velocity: this.transform(V.toVector(velocity)),\n distance: this.transform(V.toVector(distance)),\n duration\n };\n },\n delay(value = 0) {\n switch (value) {\n case true:\n return DEFAULT_DRAG_DELAY;\n case false:\n return 0;\n default:\n return value;\n }\n },\n axisThreshold(value) {\n if (!value) return DEFAULT_DRAG_AXIS_THRESHOLD;\n return _objectSpread2(_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value);\n },\n keyboardDisplacement(value = DEFAULT_KEYBOARD_DISPLACEMENT) {\n return value;\n }\n});\nif (process.env.NODE_ENV === 'development') {\n Object.assign(dragConfigResolver, {\n useTouch(value) {\n if (value !== undefined) {\n throw Error(`[@use-gesture]: \\`useTouch\\` option has been renamed to \\`pointer.touch\\`. Use it as in \\`{ pointer: { touch: true } }\\`.`);\n }\n return NaN;\n },\n experimental_preventWindowScrollY(value) {\n if (value !== undefined) {\n throw Error(`[@use-gesture]: \\`experimental_preventWindowScrollY\\` option has been renamed to \\`preventScroll\\`.`);\n }\n return NaN;\n },\n swipeVelocity(value) {\n if (value !== undefined) {\n throw Error(`[@use-gesture]: \\`swipeVelocity\\` option has been renamed to \\`swipe.velocity\\`. Use it as in \\`{ swipe: { velocity: 0.5 } }\\`.`);\n }\n return NaN;\n },\n swipeDistance(value) {\n if (value !== undefined) {\n throw Error(`[@use-gesture]: \\`swipeDistance\\` option has been renamed to \\`swipe.distance\\`. Use it as in \\`{ swipe: { distance: 50 } }\\`.`);\n }\n return NaN;\n },\n swipeDuration(value) {\n if (value !== undefined) {\n throw Error(`[@use-gesture]: \\`swipeDuration\\` option has been renamed to \\`swipe.duration\\`. Use it as in \\`{ swipe: { duration: 250 } }\\`.`);\n }\n return NaN;\n }\n });\n}\n\nfunction clampStateInternalMovementToBounds(state) {\n const [ox, oy] = state.overflow;\n const [dx, dy] = state._delta;\n const [dirx, diry] = state._direction;\n if (ox < 0 && dx > 0 && dirx < 0 || ox > 0 && dx < 0 && dirx > 0) {\n state._movement[0] = state._movementBound[0];\n }\n if (oy < 0 && dy > 0 && diry < 0 || oy > 0 && dy < 0 && diry > 0) {\n state._movement[1] = state._movementBound[1];\n }\n}\n\nconst SCALE_ANGLE_RATIO_INTENT_DEG = 30;\nconst PINCH_WHEEL_RATIO = 100;\nclass PinchEngine extends Engine {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"ingKey\", 'pinching');\n _defineProperty(this, \"aliasKey\", 'da');\n }\n init() {\n this.state.offset = [1, 0];\n this.state.lastOffset = [1, 0];\n this.state._pointerEvents = new Map();\n }\n reset() {\n super.reset();\n const state = this.state;\n state._touchIds = [];\n state.canceled = false;\n state.cancel = this.cancel.bind(this);\n state.turns = 0;\n }\n computeOffset() {\n const {\n type,\n movement,\n lastOffset\n } = this.state;\n if (type === 'wheel') {\n this.state.offset = V.add(movement, lastOffset);\n } else {\n this.state.offset = [(1 + movement[0]) * lastOffset[0], movement[1] + lastOffset[1]];\n }\n }\n computeMovement() {\n const {\n offset,\n lastOffset\n } = this.state;\n this.state.movement = [offset[0] / lastOffset[0], offset[1] - lastOffset[1]];\n }\n axisIntent() {\n const state = this.state;\n const [_m0, _m1] = state._movement;\n if (!state.axis) {\n const axisMovementDifference = Math.abs(_m0) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(_m1);\n if (axisMovementDifference < 0) state.axis = 'angle';else if (axisMovementDifference > 0) state.axis = 'scale';\n }\n }\n restrictToAxis(v) {\n if (this.config.lockDirection) {\n if (this.state.axis === 'scale') v[1] = 0;else if (this.state.axis === 'angle') v[0] = 0;\n }\n }\n cancel() {\n const state = this.state;\n if (state.canceled) return;\n setTimeout(() => {\n state.canceled = true;\n state._active = false;\n this.compute();\n this.emit();\n }, 0);\n }\n touchStart(event) {\n this.ctrl.setEventIds(event);\n const state = this.state;\n const ctrlTouchIds = this.ctrl.touchIds;\n if (state._active) {\n if (state._touchIds.every(id => ctrlTouchIds.has(id))) return;\n }\n if (ctrlTouchIds.size < 2) return;\n this.start(event);\n state._touchIds = Array.from(ctrlTouchIds).slice(0, 2);\n const payload = touchDistanceAngle(event, state._touchIds);\n if (!payload) return;\n this.pinchStart(event, payload);\n }\n pointerStart(event) {\n if (event.buttons != null && event.buttons % 2 !== 1) return;\n this.ctrl.setEventIds(event);\n event.target.setPointerCapture(event.pointerId);\n const state = this.state;\n const _pointerEvents = state._pointerEvents;\n const ctrlPointerIds = this.ctrl.pointerIds;\n if (state._active) {\n if (Array.from(_pointerEvents.keys()).every(id => ctrlPointerIds.has(id))) return;\n }\n if (_pointerEvents.size < 2) {\n _pointerEvents.set(event.pointerId, event);\n }\n if (state._pointerEvents.size < 2) return;\n this.start(event);\n const payload = distanceAngle(...Array.from(_pointerEvents.values()));\n if (!payload) return;\n this.pinchStart(event, payload);\n }\n pinchStart(event, payload) {\n const state = this.state;\n state.origin = payload.origin;\n this.computeValues([payload.distance, payload.angle]);\n this.computeInitial();\n this.compute(event);\n this.emit();\n }\n touchMove(event) {\n if (!this.state._active) return;\n const payload = touchDistanceAngle(event, this.state._touchIds);\n if (!payload) return;\n this.pinchMove(event, payload);\n }\n pointerMove(event) {\n const _pointerEvents = this.state._pointerEvents;\n if (_pointerEvents.has(event.pointerId)) {\n _pointerEvents.set(event.pointerId, event);\n }\n if (!this.state._active) return;\n const payload = distanceAngle(...Array.from(_pointerEvents.values()));\n if (!payload) return;\n this.pinchMove(event, payload);\n }\n pinchMove(event, payload) {\n const state = this.state;\n const prev_a = state._values[1];\n const delta_a = payload.angle - prev_a;\n let delta_turns = 0;\n if (Math.abs(delta_a) > 270) delta_turns += Math.sign(delta_a);\n this.computeValues([payload.distance, payload.angle - 360 * delta_turns]);\n state.origin = payload.origin;\n state.turns = delta_turns;\n state._movement = [state._values[0] / state._initial[0] - 1, state._values[1] - state._initial[1]];\n this.compute(event);\n this.emit();\n }\n touchEnd(event) {\n this.ctrl.setEventIds(event);\n if (!this.state._active) return;\n if (this.state._touchIds.some(id => !this.ctrl.touchIds.has(id))) {\n this.state._active = false;\n this.compute(event);\n this.emit();\n }\n }\n pointerEnd(event) {\n const state = this.state;\n this.ctrl.setEventIds(event);\n try {\n event.target.releasePointerCapture(event.pointerId);\n } catch (_unused) {}\n if (state._pointerEvents.has(event.pointerId)) {\n state._pointerEvents.delete(event.pointerId);\n }\n if (!state._active) return;\n if (state._pointerEvents.size < 2) {\n state._active = false;\n this.compute(event);\n this.emit();\n }\n }\n gestureStart(event) {\n if (event.cancelable) event.preventDefault();\n const state = this.state;\n if (state._active) return;\n this.start(event);\n this.computeValues([event.scale, event.rotation]);\n state.origin = [event.clientX, event.clientY];\n this.compute(event);\n this.emit();\n }\n gestureMove(event) {\n if (event.cancelable) event.preventDefault();\n if (!this.state._active) return;\n const state = this.state;\n this.computeValues([event.scale, event.rotation]);\n state.origin = [event.clientX, event.clientY];\n const _previousMovement = state._movement;\n state._movement = [event.scale - 1, event.rotation];\n state._delta = V.sub(state._movement, _previousMovement);\n this.compute(event);\n this.emit();\n }\n gestureEnd(event) {\n if (!this.state._active) return;\n this.state._active = false;\n this.compute(event);\n this.emit();\n }\n wheel(event) {\n const modifierKey = this.config.modifierKey;\n if (modifierKey && (Array.isArray(modifierKey) ? !modifierKey.find(k => event[k]) : !event[modifierKey])) return;\n if (!this.state._active) this.wheelStart(event);else this.wheelChange(event);\n this.timeoutStore.add('wheelEnd', this.wheelEnd.bind(this));\n }\n wheelStart(event) {\n this.start(event);\n this.wheelChange(event);\n }\n wheelChange(event) {\n const isR3f = ('uv' in event);\n if (!isR3f) {\n if (event.cancelable) {\n event.preventDefault();\n }\n if (process.env.NODE_ENV === 'development' && !event.defaultPrevented) {\n console.warn(`[@use-gesture]: To properly support zoom on trackpads, try using the \\`target\\` option.\\n\\nThis message will only appear in development mode.`);\n }\n }\n const state = this.state;\n state._delta = [-wheelValues(event)[1] / PINCH_WHEEL_RATIO * state.offset[0], 0];\n V.addTo(state._movement, state._delta);\n clampStateInternalMovementToBounds(state);\n this.state.origin = [event.clientX, event.clientY];\n this.compute(event);\n this.emit();\n }\n wheelEnd() {\n if (!this.state._active) return;\n this.state._active = false;\n this.compute();\n this.emit();\n }\n bind(bindFunction) {\n const device = this.config.device;\n if (!!device) {\n bindFunction(device, 'start', this[device + 'Start'].bind(this));\n bindFunction(device, 'change', this[device + 'Move'].bind(this));\n bindFunction(device, 'end', this[device + 'End'].bind(this));\n bindFunction(device, 'cancel', this[device + 'End'].bind(this));\n bindFunction('lostPointerCapture', '', this[device + 'End'].bind(this));\n }\n if (this.config.pinchOnWheel) {\n bindFunction('wheel', '', this.wheel.bind(this), {\n passive: false\n });\n }\n }\n}\n\nconst pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {\n device(_v, _k, {\n shared,\n pointer: {\n touch = false\n } = {}\n }) {\n const sharedConfig = shared;\n if (sharedConfig.target && !SUPPORT.touch && SUPPORT.gesture) return 'gesture';\n if (SUPPORT.touch && touch) return 'touch';\n if (SUPPORT.touchscreen) {\n if (SUPPORT.pointer) return 'pointer';\n if (SUPPORT.touch) return 'touch';\n }\n },\n bounds(_v, _k, {\n scaleBounds = {},\n angleBounds = {}\n }) {\n const _scaleBounds = state => {\n const D = assignDefault(call(scaleBounds, state), {\n min: -Infinity,\n max: Infinity\n });\n return [D.min, D.max];\n };\n const _angleBounds = state => {\n const A = assignDefault(call(angleBounds, state), {\n min: -Infinity,\n max: Infinity\n });\n return [A.min, A.max];\n };\n if (typeof scaleBounds !== 'function' && typeof angleBounds !== 'function') return [_scaleBounds(), _angleBounds()];\n return state => [_scaleBounds(state), _angleBounds(state)];\n },\n threshold(value, _k, config) {\n this.lockDirection = config.axis === 'lock';\n const threshold = V.toVector(value, this.lockDirection ? [0.1, 3] : 0);\n return threshold;\n },\n modifierKey(value) {\n if (value === undefined) return 'ctrlKey';\n return value;\n },\n pinchOnWheel(value = true) {\n return value;\n }\n});\n\nclass MoveEngine extends CoordinatesEngine {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"ingKey\", 'moving');\n }\n move(event) {\n if (this.config.mouseOnly && event.pointerType !== 'mouse') return;\n if (!this.state._active) this.moveStart(event);else this.moveChange(event);\n this.timeoutStore.add('moveEnd', this.moveEnd.bind(this));\n }\n moveStart(event) {\n this.start(event);\n this.computeValues(pointerValues(event));\n this.compute(event);\n this.computeInitial();\n this.emit();\n }\n moveChange(event) {\n if (!this.state._active) return;\n const values = pointerValues(event);\n const state = this.state;\n state._delta = V.sub(values, state._values);\n V.addTo(state._movement, state._delta);\n this.computeValues(values);\n this.compute(event);\n this.emit();\n }\n moveEnd(event) {\n if (!this.state._active) return;\n this.state._active = false;\n this.compute(event);\n this.emit();\n }\n bind(bindFunction) {\n bindFunction('pointer', 'change', this.move.bind(this));\n bindFunction('pointer', 'leave', this.moveEnd.bind(this));\n }\n}\n\nconst moveConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {\n mouseOnly: (value = true) => value\n});\n\nclass ScrollEngine extends CoordinatesEngine {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"ingKey\", 'scrolling');\n }\n scroll(event) {\n if (!this.state._active) this.start(event);\n this.scrollChange(event);\n this.timeoutStore.add('scrollEnd', this.scrollEnd.bind(this));\n }\n scrollChange(event) {\n if (event.cancelable) event.preventDefault();\n const state = this.state;\n const values = scrollValues(event);\n state._delta = V.sub(values, state._values);\n V.addTo(state._movement, state._delta);\n this.computeValues(values);\n this.compute(event);\n this.emit();\n }\n scrollEnd() {\n if (!this.state._active) return;\n this.state._active = false;\n this.compute();\n this.emit();\n }\n bind(bindFunction) {\n bindFunction('scroll', '', this.scroll.bind(this));\n }\n}\n\nconst scrollConfigResolver = coordinatesConfigResolver;\n\nclass WheelEngine extends CoordinatesEngine {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"ingKey\", 'wheeling');\n }\n wheel(event) {\n if (!this.state._active) this.start(event);\n this.wheelChange(event);\n this.timeoutStore.add('wheelEnd', this.wheelEnd.bind(this));\n }\n wheelChange(event) {\n const state = this.state;\n state._delta = wheelValues(event);\n V.addTo(state._movement, state._delta);\n clampStateInternalMovementToBounds(state);\n this.compute(event);\n this.emit();\n }\n wheelEnd() {\n if (!this.state._active) return;\n this.state._active = false;\n this.compute();\n this.emit();\n }\n bind(bindFunction) {\n bindFunction('wheel', '', this.wheel.bind(this));\n }\n}\n\nconst wheelConfigResolver = coordinatesConfigResolver;\n\nclass HoverEngine extends CoordinatesEngine {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"ingKey\", 'hovering');\n }\n enter(event) {\n if (this.config.mouseOnly && event.pointerType !== 'mouse') return;\n this.start(event);\n this.computeValues(pointerValues(event));\n this.compute(event);\n this.emit();\n }\n leave(event) {\n if (this.config.mouseOnly && event.pointerType !== 'mouse') return;\n const state = this.state;\n if (!state._active) return;\n state._active = false;\n const values = pointerValues(event);\n state._movement = state._delta = V.sub(values, state._values);\n this.computeValues(values);\n this.compute(event);\n state.delta = state.movement;\n this.emit();\n }\n bind(bindFunction) {\n bindFunction('pointer', 'enter', this.enter.bind(this));\n bindFunction('pointer', 'leave', this.leave.bind(this));\n }\n}\n\nconst hoverConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {\n mouseOnly: (value = true) => value\n});\n\nconst EngineMap = new Map();\nconst ConfigResolverMap = new Map();\nfunction registerAction(action) {\n EngineMap.set(action.key, action.engine);\n ConfigResolverMap.set(action.key, action.resolver);\n}\nconst dragAction = {\n key: 'drag',\n engine: DragEngine,\n resolver: dragConfigResolver\n};\nconst hoverAction = {\n key: 'hover',\n engine: HoverEngine,\n resolver: hoverConfigResolver\n};\nconst moveAction = {\n key: 'move',\n engine: MoveEngine,\n resolver: moveConfigResolver\n};\nconst pinchAction = {\n key: 'pinch',\n engine: PinchEngine,\n resolver: pinchConfigResolver\n};\nconst scrollAction = {\n key: 'scroll',\n engine: ScrollEngine,\n resolver: scrollConfigResolver\n};\nconst wheelAction = {\n key: 'wheel',\n engine: WheelEngine,\n resolver: wheelConfigResolver\n};\n\nexport { ConfigResolverMap as C, EngineMap as E, SUPPORT as S, _objectSpread2 as _, _defineProperty as a, touchIds as b, chain as c, toHandlerProp as d, dragAction as e, pinchAction as f, hoverAction as h, isTouch as i, moveAction as m, parseProp as p, registerAction as r, scrollAction as s, toDomEventType as t, wheelAction as w };\n", "import { registerAction, dragAction, pinchAction, wheelAction, scrollAction, moveAction, hoverAction } from '@use-gesture/core/actions';\nexport * from '@use-gesture/core/actions';\nimport React from 'react';\nimport { Controller, parseMergedHandlers } from '@use-gesture/core';\nexport * from '@use-gesture/core/utils';\nexport * from '@use-gesture/core/types';\n\nfunction useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) {\n const ctrl = React.useMemo(() => new Controller(handlers), []);\n ctrl.applyHandlers(handlers, nativeHandlers);\n ctrl.applyConfig(config, gestureKey);\n React.useEffect(ctrl.effect.bind(ctrl));\n React.useEffect(() => {\n return ctrl.clean.bind(ctrl);\n }, []);\n if (config.target === undefined) {\n return ctrl.bind.bind(ctrl);\n }\n return undefined;\n}\n\nfunction useDrag(handler, config) {\n registerAction(dragAction);\n return useRecognizers({\n drag: handler\n }, config || {}, 'drag');\n}\n\nfunction usePinch(handler, config) {\n registerAction(pinchAction);\n return useRecognizers({\n pinch: handler\n }, config || {}, 'pinch');\n}\n\nfunction useWheel(handler, config) {\n registerAction(wheelAction);\n return useRecognizers({\n wheel: handler\n }, config || {}, 'wheel');\n}\n\nfunction useScroll(handler, config) {\n registerAction(scrollAction);\n return useRecognizers({\n scroll: handler\n }, config || {}, 'scroll');\n}\n\nfunction useMove(handler, config) {\n registerAction(moveAction);\n return useRecognizers({\n move: handler\n }, config || {}, 'move');\n}\n\nfunction useHover(handler, config) {\n registerAction(hoverAction);\n return useRecognizers({\n hover: handler\n }, config || {}, 'hover');\n}\n\nfunction createUseGesture(actions) {\n actions.forEach(registerAction);\n return function useGesture(_handlers, _config) {\n const {\n handlers,\n nativeHandlers,\n config\n } = parseMergedHandlers(_handlers, _config || {});\n return useRecognizers(handlers, config, undefined, nativeHandlers);\n };\n}\n\nfunction useGesture(handlers, config) {\n const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction]);\n return hook(handlers, config || {});\n}\n\nexport { createUseGesture, useDrag, useGesture, useHover, useMove, usePinch, useScroll, useWheel };\n", "import { S as SUPPORT, C as ConfigResolverMap, _ as _objectSpread2, a as _defineProperty, t as toDomEventType, i as isTouch, b as touchIds, E as EngineMap, c as chain, p as parseProp, d as toHandlerProp } from './actions-fe213e88.esm.js';\nimport './maths-0ab39ae9.esm.js';\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\n\nconst sharedConfigResolver = {\n target(value) {\n if (value) {\n return () => 'current' in value ? value.current : value;\n }\n return undefined;\n },\n enabled(value = true) {\n return value;\n },\n window(value = SUPPORT.isBrowser ? window : undefined) {\n return value;\n },\n eventOptions({\n passive = true,\n capture = false\n } = {}) {\n return {\n passive,\n capture\n };\n },\n transform(value) {\n return value;\n }\n};\n\nconst _excluded = [\"target\", \"eventOptions\", \"window\", \"enabled\", \"transform\"];\nfunction resolveWith(config = {}, resolvers) {\n const result = {};\n for (const [key, resolver] of Object.entries(resolvers)) {\n switch (typeof resolver) {\n case 'function':\n if (process.env.NODE_ENV === 'development') {\n const r = resolver.call(result, config[key], key, config);\n if (!Number.isNaN(r)) result[key] = r;\n } else {\n result[key] = resolver.call(result, config[key], key, config);\n }\n break;\n case 'object':\n result[key] = resolveWith(config[key], resolver);\n break;\n case 'boolean':\n if (resolver) result[key] = config[key];\n break;\n }\n }\n return result;\n}\nfunction parse(newConfig, gestureKey, _config = {}) {\n const _ref = newConfig,\n {\n target,\n eventOptions,\n window,\n enabled,\n transform\n } = _ref,\n rest = _objectWithoutProperties(_ref, _excluded);\n _config.shared = resolveWith({\n target,\n eventOptions,\n window,\n enabled,\n transform\n }, sharedConfigResolver);\n if (gestureKey) {\n const resolver = ConfigResolverMap.get(gestureKey);\n _config[gestureKey] = resolveWith(_objectSpread2({\n shared: _config.shared\n }, rest), resolver);\n } else {\n for (const key in rest) {\n const resolver = ConfigResolverMap.get(key);\n if (resolver) {\n _config[key] = resolveWith(_objectSpread2({\n shared: _config.shared\n }, rest[key]), resolver);\n } else if (process.env.NODE_ENV === 'development') {\n if (!['drag', 'pinch', 'scroll', 'wheel', 'move', 'hover'].includes(key)) {\n if (key === 'domTarget') {\n throw Error(`[@use-gesture]: \\`domTarget\\` option has been renamed to \\`target\\`.`);\n }\n console.warn(`[@use-gesture]: Unknown config key \\`${key}\\` was used. Please read the documentation for further information.`);\n }\n }\n }\n }\n return _config;\n}\n\nclass EventStore {\n constructor(ctrl, gestureKey) {\n _defineProperty(this, \"_listeners\", new Set());\n this._ctrl = ctrl;\n this._gestureKey = gestureKey;\n }\n add(element, device, action, handler, options) {\n const listeners = this._listeners;\n const type = toDomEventType(device, action);\n const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {};\n const eventOptions = _objectSpread2(_objectSpread2({}, _options), options);\n element.addEventListener(type, handler, eventOptions);\n const remove = () => {\n element.removeEventListener(type, handler, eventOptions);\n listeners.delete(remove);\n };\n listeners.add(remove);\n return remove;\n }\n clean() {\n this._listeners.forEach(remove => remove());\n this._listeners.clear();\n }\n}\n\nclass TimeoutStore {\n constructor() {\n _defineProperty(this, \"_timeouts\", new Map());\n }\n add(key, callback, ms = 140, ...args) {\n this.remove(key);\n this._timeouts.set(key, window.setTimeout(callback, ms, ...args));\n }\n remove(key) {\n const timeout = this._timeouts.get(key);\n if (timeout) window.clearTimeout(timeout);\n }\n clean() {\n this._timeouts.forEach(timeout => void window.clearTimeout(timeout));\n this._timeouts.clear();\n }\n}\n\nclass Controller {\n constructor(handlers) {\n _defineProperty(this, \"gestures\", new Set());\n _defineProperty(this, \"_targetEventStore\", new EventStore(this));\n _defineProperty(this, \"gestureEventStores\", {});\n _defineProperty(this, \"gestureTimeoutStores\", {});\n _defineProperty(this, \"handlers\", {});\n _defineProperty(this, \"config\", {});\n _defineProperty(this, \"pointerIds\", new Set());\n _defineProperty(this, \"touchIds\", new Set());\n _defineProperty(this, \"state\", {\n shared: {\n shiftKey: false,\n metaKey: false,\n ctrlKey: false,\n altKey: false\n }\n });\n resolveGestures(this, handlers);\n }\n setEventIds(event) {\n if (isTouch(event)) {\n this.touchIds = new Set(touchIds(event));\n return this.touchIds;\n } else if ('pointerId' in event) {\n if (event.type === 'pointerup' || event.type === 'pointercancel') this.pointerIds.delete(event.pointerId);else if (event.type === 'pointerdown') this.pointerIds.add(event.pointerId);\n return this.pointerIds;\n }\n }\n applyHandlers(handlers, nativeHandlers) {\n this.handlers = handlers;\n this.nativeHandlers = nativeHandlers;\n }\n applyConfig(config, gestureKey) {\n this.config = parse(config, gestureKey, this.config);\n }\n clean() {\n this._targetEventStore.clean();\n for (const key of this.gestures) {\n this.gestureEventStores[key].clean();\n this.gestureTimeoutStores[key].clean();\n }\n }\n effect() {\n if (this.config.shared.target) this.bind();\n return () => this._targetEventStore.clean();\n }\n bind(...args) {\n const sharedConfig = this.config.shared;\n const props = {};\n let target;\n if (sharedConfig.target) {\n target = sharedConfig.target();\n if (!target) return;\n }\n if (sharedConfig.enabled) {\n for (const gestureKey of this.gestures) {\n const gestureConfig = this.config[gestureKey];\n const bindFunction = bindToProps(props, gestureConfig.eventOptions, !!target);\n if (gestureConfig.enabled) {\n const Engine = EngineMap.get(gestureKey);\n new Engine(this, args, gestureKey).bind(bindFunction);\n }\n }\n const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target);\n for (const eventKey in this.nativeHandlers) {\n nativeBindFunction(eventKey, '', event => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, {\n event,\n args\n })), undefined, true);\n }\n }\n for (const handlerProp in props) {\n props[handlerProp] = chain(...props[handlerProp]);\n }\n if (!target) return props;\n for (const handlerProp in props) {\n const {\n device,\n capture,\n passive\n } = parseProp(handlerProp);\n this._targetEventStore.add(target, device, '', props[handlerProp], {\n capture,\n passive\n });\n }\n }\n}\nfunction setupGesture(ctrl, gestureKey) {\n ctrl.gestures.add(gestureKey);\n ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl, gestureKey);\n ctrl.gestureTimeoutStores[gestureKey] = new TimeoutStore();\n}\nfunction resolveGestures(ctrl, internalHandlers) {\n if (internalHandlers.drag) setupGesture(ctrl, 'drag');\n if (internalHandlers.wheel) setupGesture(ctrl, 'wheel');\n if (internalHandlers.scroll) setupGesture(ctrl, 'scroll');\n if (internalHandlers.move) setupGesture(ctrl, 'move');\n if (internalHandlers.pinch) setupGesture(ctrl, 'pinch');\n if (internalHandlers.hover) setupGesture(ctrl, 'hover');\n}\nconst bindToProps = (props, eventOptions, withPassiveOption) => (device, action, handler, options = {}, isNative = false) => {\n var _options$capture, _options$passive;\n const capture = (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : eventOptions.capture;\n const passive = (_options$passive = options.passive) !== null && _options$passive !== void 0 ? _options$passive : eventOptions.passive;\n let handlerProp = isNative ? device : toHandlerProp(device, action, capture);\n if (withPassiveOption && passive) handlerProp += 'Passive';\n props[handlerProp] = props[handlerProp] || [];\n props[handlerProp].push(handler);\n};\n\nconst RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;\nfunction sortHandlers(_handlers) {\n const native = {};\n const handlers = {};\n const actions = new Set();\n for (let key in _handlers) {\n if (RE_NOT_NATIVE.test(key)) {\n actions.add(RegExp.lastMatch);\n handlers[key] = _handlers[key];\n } else {\n native[key] = _handlers[key];\n }\n }\n return [handlers, native, actions];\n}\nfunction registerGesture(actions, handlers, handlerKey, key, internalHandlers, config) {\n if (!actions.has(handlerKey)) return;\n if (!EngineMap.has(key)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`[@use-gesture]: You've created a custom handler that that uses the \\`${key}\\` gesture but isn't properly configured.\\n\\nPlease add \\`${key}Action\\` when creating your handler.`);\n }\n return;\n }\n const startKey = handlerKey + 'Start';\n const endKey = handlerKey + 'End';\n const fn = state => {\n let memo = undefined;\n if (state.first && startKey in handlers) handlers[startKey](state);\n if (handlerKey in handlers) memo = handlers[handlerKey](state);\n if (state.last && endKey in handlers) handlers[endKey](state);\n return memo;\n };\n internalHandlers[key] = fn;\n config[key] = config[key] || {};\n}\nfunction parseMergedHandlers(mergedHandlers, mergedConfig) {\n const [handlers, nativeHandlers, actions] = sortHandlers(mergedHandlers);\n const internalHandlers = {};\n registerGesture(actions, handlers, 'onDrag', 'drag', internalHandlers, mergedConfig);\n registerGesture(actions, handlers, 'onWheel', 'wheel', internalHandlers, mergedConfig);\n registerGesture(actions, handlers, 'onScroll', 'scroll', internalHandlers, mergedConfig);\n registerGesture(actions, handlers, 'onPinch', 'pinch', internalHandlers, mergedConfig);\n registerGesture(actions, handlers, 'onMove', 'move', internalHandlers, mergedConfig);\n registerGesture(actions, handlers, 'onHover', 'hover', internalHandlers, mergedConfig);\n return {\n handlers: internalHandlers,\n config: mergedConfig,\n nativeHandlers\n };\n}\n\nexport { Controller, parseMergedHandlers };\n", "import { GridConfig, GridCoords, GridSpan, TableOf } from '../model';\n\nexport const newTable = (rows: number, cols: number, value: T): TableOf =>\n new Array(rows).fill(null).map(_ => new Array(cols).fill(value));\n\nexport const copyTable = (table: TableOf): TableOf =>\n [...table].map(row => [...row]);\n\nexport const tableSize = (table: TableOf) => {\n const rows = table.length;\n const cols = rows ? table[0].length : 0;\n return { rows, cols };\n};\n\nexport const isEmptyRow = (row: Array) => !row.find(cell => !!cell);\n\nexport const trimLocation = (\n table: TableOf,\n { col, row }: GridCoords\n) => {\n const { cols, rows } = tableSize(table);\n return {\n col: col < 0 ? 0 : col >= cols ? cols - 1 : col,\n row: row < 0 ? 0 : row >= rows ? rows - 1 : row,\n };\n};\nexport const pointToLocation = (\n table: TableOf,\n x: number,\n y: number,\n { elementWidth, elementHeight }: GridConfig\n) => {\n const col = Math.floor(x / elementWidth);\n const row = Math.floor(y / elementHeight);\n return trimLocation(table, { col, row });\n};\n\nexport const fitsInTable = (\n coords: GridCoords & GridSpan,\n table: TableOf\n) => {\n const { rows, cols } = tableSize(table);\n for (let row = coords.row; row < coords.row + coords.rowSpan; row++) {\n for (let col = coords.col; col < coords.col + coords.colSpan; col++) {\n if (row > rows || col > cols) return false;\n if (table[row][col]) return false;\n }\n }\n return true;\n};\n\nexport const placeInTable = (\n coords: GridCoords & GridSpan,\n data: T,\n table: TableOf\n): TableOf => {\n const newTable = copyTable(table);\n for (let row = coords.row; row < coords.row + coords.rowSpan; row++) {\n for (let col = coords.col; col < coords.col + coords.colSpan; col++) {\n newTable[row][col] = data;\n }\n }\n return newTable;\n};\n\nexport const findFirstFittingPosition = (\n span: GridSpan,\n table: TableOf\n): GridCoords | undefined => {\n const { rows, cols } = tableSize(table);\n let free = true;\n for (let tableRow = 0; tableRow <= rows - span.rowSpan; tableRow++) {\n for (let tableCol = 0; tableCol <= cols - span.colSpan; tableCol++) {\n //check if all cells are available\n free = true;\n for (let cellRow = 0; cellRow < span.rowSpan; cellRow++) {\n for (let cellCol = 0; cellCol < span.colSpan; cellCol++) {\n free = free && !table[tableRow + cellRow][tableCol + cellCol];\n }\n }\n if (free) {\n return { row: tableRow, col: tableCol };\n }\n }\n }\n};\n", "import { TilesTable, TilePositionInfo, TileInfo } from '../model';\nimport {\n findFirstFittingPosition,\n isEmptyRow,\n newTable,\n placeInTable,\n tableSize,\n} from './table';\n\nexport const interceptTiles = (\n table: TilesTable,\n startRow: number,\n startCol: number,\n rowSpan: number,\n colSpan: number\n) => {\n let interceptTiles: TilePositionInfo[] = [];\n const { rows, cols } = tableSize(table);\n\n for (let row = startRow; row < startRow + rowSpan; row++) {\n if (row >= rows) continue;\n for (let col = startCol; col < startCol + colSpan; col++) {\n if (col >= cols) continue;\n const cell = table[row][col];\n if (cell && !interceptTiles.find(t => t.data === cell.data)) {\n interceptTiles.push(cell);\n }\n }\n }\n\n return interceptTiles.sort(\n (a, b) => a.col + a.row * cols - (b.col + b.row * cols)\n );\n};\n\nexport const tableToTilesList = (table: TilesTable) => {\n const { rows, cols } = tableSize(table);\n return interceptTiles(table, 0, 0, rows, cols);\n};\n\nexport const tilesListToTable = (\n tiles: TileInfo[],\n columns: number\n): TilesTable => {\n const maxRows = tiles.reduce((memo, tile) => memo + tile.rowSpan, 0);\n let table = newTable | undefined>(\n maxRows,\n columns,\n undefined\n );\n tiles.forEach(tile => {\n let position = findFirstFittingPosition(tile, table);\n if (position) {\n const fittedTile: TilePositionInfo = { ...tile, ...position };\n table = placeInTable(fittedTile, fittedTile, table);\n }\n });\n\n //trim the table\n\n return table.filter(row => !isEmptyRow(row)) as TilesTable;\n};\n", "import { GridConfig, TilePositionInfo } from '../model';\nimport { newTable } from './table';\n\nexport const positionedTilesMaxRows = (\n positionedTiles: TilePositionInfo[]\n) => {\n //calculate the max row\n return positionedTiles.reduce((memo, tile) => {\n const maxTileRow = tile.row + tile.rowSpan;\n return memo > maxTileRow ? memo : maxTileRow;\n }, 0);\n};\n\n/**\n * Check if the elements are overlapping in the table\n *\n * @param positionedTiles\n */\nexport const checkOverlap = (\n positionedTiles: TilePositionInfo[],\n { columns }: GridConfig\n) => {\n //calculate the max row\n const maxRows = positionedTilesMaxRows(positionedTiles);\n\n //create a new temporary table to support the overlap check\n //the rows need to be filled with null and then mapped,\n //otherwise each row will be identical\n const checkTable = newTable(maxRows, columns, false);\n\n const overlaps = positionedTiles.find(tile => {\n for (let col = tile.col; col <= tile.col + tile.colSpan - 1; col++) {\n for (let row = tile.row; row <= tile.row + tile.rowSpan - 1; row++) {\n console.log('checktable:', {\n tile,\n row,\n col,\n outcome: checkTable[row][col],\n });\n if (checkTable[row][col] === true) return true;\n checkTable[row][col] = true;\n }\n }\n return false;\n });\n console.log('OVERLAP', overlaps);\n return !!overlaps;\n};\n\nexport const getTileTouchPoint = (\n draggingTile: TilePositionInfo,\n targetTile: TilePositionInfo,\n absolutePosition: { x: number; y: number },\n { elementHeight, elementWidth, activeBorderSize }: GridConfig\n) => {\n const position = {\n x: absolutePosition.x - targetTile.col * elementWidth,\n y: absolutePosition.y - targetTile.row * elementHeight,\n };\n\n if (draggingTile.col >= targetTile.col && position.x < activeBorderSize)\n return 'left';\n if (\n draggingTile.col <= targetTile.col &&\n position.x > elementWidth * targetTile.colSpan - activeBorderSize\n )\n return 'right';\n if (\n draggingTile.row <= targetTile.row &&\n position.y > elementHeight * targetTile.rowSpan - activeBorderSize\n )\n return 'bottom';\n if (draggingTile.row >= targetTile.row && position.y < activeBorderSize)\n return 'top';\n if (\n position.x > activeBorderSize &&\n position.y < elementWidth * targetTile.colSpan - activeBorderSize &&\n position.y > activeBorderSize &&\n position.y < elementHeight * targetTile.rowSpan - activeBorderSize\n )\n return 'center';\n};\n\nexport const tileIncludes = (\n tile: TilePositionInfo,\n point: { col: number; row: number; height: number }\n) => {\n return (\n tile.col >= point.col &&\n point.col < tile.col + tile.colSpan &&\n tile.row >= point.row &&\n point.row < tile.row + tile.rowSpan\n );\n};\n", "import { StrategyInterface, TilePositionInfo } from '../model';\nimport * as TilesTableUtils from '../table-utils/tiles-table';\nimport * as TableUtils from '../table-utils/table';\nimport * as TilesUtils from '../table-utils/tiles';\n\n/**\n * Calculates the new table configuration while the tiles are moving\n * @param offsetX\n * @param offsetY\n * @returns\n */\nconst dragMove: StrategyInterface = {\n onDragMove: ({ offsetX, offsetY, config, state, table, canAcceptDrop }) => {\n const { elementHeight, elementWidth, columns } = config;\n const {\n draggingTile,\n dragPosition,\n dropTargetTile,\n droppable,\n start,\n tiles,\n } = state;\n\n if (!draggingTile || !dragPosition || !start || !tiles) return;\n\n const x = start.col * elementWidth + offsetX + dragPosition.x;\n const y = start.row * elementHeight + offsetY + dragPosition.y;\n\n //find the position of the tile in the grid\n const cell = TableUtils.pointToLocation(table, x, y, config);\n const tsize = TableUtils.tableSize(table);\n\n //console.log('data:', { x, y, cell, start, draggingTile });\n\n //try to see if we're touching a hot point\n if (cell.col <= tsize.cols && cell.row <= tsize.rows) {\n //find the touched tile within the move\n\n const touchedTile = table[cell.row][cell.col];\n if (!touchedTile || touchedTile.data === draggingTile.data) return;\n\n //get the touchpoint of the touched tile\n const touchPoint = TilesUtils.getTileTouchPoint(\n draggingTile,\n touchedTile,\n {\n x,\n y,\n },\n config\n );\n if (!touchPoint) return;\n\n //console.log('HIT TOUCHPOINT', { table, tiles });\n\n if (touchPoint === 'center') {\n if (touchedTile === dropTargetTile)\n return {\n dropTargetTile,\n droppable,\n };\n if (canAcceptDrop(draggingTile, touchedTile))\n return { dropTargetTile: touchedTile, droppable: true };\n return;\n }\n\n //a touchpoint has been identified\n\n const rowDisplacement = Math.floor(dragPosition.y / elementHeight);\n const colDisplacement = Math.floor(dragPosition.x / elementWidth);\n\n //calculate the new dragged tile location. This depends on the touched side.\n const newDragTileLocation = TableUtils.trimLocation(\n table,\n touchPoint === 'right'\n ? {\n col: cell.col - (draggingTile.colSpan - 1),\n row: cell.row - rowDisplacement,\n }\n : touchPoint === 'left'\n ? {\n col: cell.col,\n row: cell.row - rowDisplacement,\n }\n : touchPoint === 'top'\n ? {\n col: cell.col - colDisplacement,\n row: cell.row,\n }\n : /*touchPoint === 'bottom'*/ {\n col: cell.col - colDisplacement,\n row: cell.row - (draggingTile.rowSpan - 1),\n }\n );\n\n /*\n console.log(\n 'Effective location:',\n newDragTileLocation,\n touchedTile,\n touchPoint,\n state\n );\n */\n\n //identify all hover tiles (excluding ourselves)\n const hoverTiles = TilesTableUtils.interceptTiles(\n table,\n newDragTileLocation.row,\n newDragTileLocation.col,\n draggingTile.rowSpan,\n draggingTile.colSpan\n ).filter(tiles => tiles.data !== draggingTile.data);\n\n if (!hoverTiles.length) {\n return;\n }\n\n //console.log('hover tiles:', hoverTiles);\n\n //create a table with the remaining tiles\n const otherTiles = tiles.filter(\n tile =>\n tile.data !== draggingTile.data &&\n !hoverTiles.find(t => t.data === tile.data)\n );\n const newDraggingTile = {\n ...draggingTile,\n ...newDragTileLocation,\n };\n\n let checkTable = TableUtils.newTable(\n tsize.rows + draggingTile.rowSpan - 1,\n tsize.cols,\n 0\n );\n otherTiles.forEach(tile => {\n checkTable = TableUtils.placeInTable(tile, 1, checkTable);\n });\n\n /*\n console.log('checktable dump:');\n checkTable.forEach(row => {\n console.log(row.join(''));\n });\n */\n\n //try to fit the dragging tile in the current location\n if (!TableUtils.fitsInTable(newDraggingTile, checkTable)) {\n //console.log('new drag tile does not fit');\n return;\n }\n checkTable = TableUtils.placeInTable(newDraggingTile, 1, checkTable);\n\n /*\n console.log('checktable dump with drag tile:');\n checkTable.forEach(row => {\n console.log(row.join(''));\n });\n */\n\n const repositionedHoverTiles: TilePositionInfo[] = [];\n if (\n hoverTiles.find(tile => {\n const newPosition = TableUtils.findFirstFittingPosition(\n tile,\n checkTable\n );\n //console.log('fitting', { tile, newPosition });\n if (!newPosition) return true;\n const repositionedTile = { ...tile, ...newPosition };\n repositionedHoverTiles.push(repositionedTile);\n checkTable = TableUtils.placeInTable(repositionedTile, 1, checkTable);\n return false;\n })\n ) {\n //console.log('repositioning failed');\n return;\n }\n\n const reorderedTiles = [\n ...repositionedHoverTiles,\n ...otherTiles,\n newDraggingTile,\n ].sort((a, b) => a.col + a.row * columns - (b.col + b.row * columns));\n return {\n draggingTile: newDraggingTile,\n tiles: reorderedTiles,\n };\n }\n },\n onDragEnd: () => undefined,\n};\n\nexport default dragMove;\n", "import { StrategyInterface, TilePositionInfo, DragState } from '../model';\nimport * as TilesTableUtils from '../table-utils/tiles-table';\nimport * as TableUtils from '../table-utils/table';\nimport * as TilesUtils from '../table-utils/tiles';\n\n/**\n * Calculates the new table configuration while the tiles are moving\n * @param offsetX\n * @param offsetY\n * @returns\n */\nconst reorder: StrategyInterface = {\n onDragMove: ({ offsetX, offsetY, config, state, table, canAcceptDrop }) => {\n const { elementHeight, elementWidth } = config;\n const {\n draggingTile,\n dragPosition,\n dropTargetTile,\n droppable,\n start,\n tiles,\n } = state;\n\n console.log('DRAG MOVE');\n\n if (!draggingTile || !dragPosition || !start || !tiles) return;\n\n const getInsertionPoint = (\n tiles: TilePositionInfo[],\n touchPoint: 'left' | 'right',\n touchedTile: TilePositionInfo\n ) => {\n const tilePosition = tiles.findIndex(\n tile => tile.data === touchedTile?.data\n );\n if (touchPoint === 'left') {\n const leftTile =\n tilePosition - 1 >= 0 ? tiles[tilePosition - 1] : undefined;\n if (leftTile === draggingTile) return undefined;\n return {\n insertionPoint: {\n right: touchedTile,\n left: leftTile?.row === touchedTile.row ? leftTile : undefined,\n },\n };\n } else {\n const rightTile =\n tilePosition + 1 < tiles.length ? tiles[tilePosition + 1] : undefined;\n if (rightTile === draggingTile) return undefined;\n return {\n insertionPoint: {\n left: touchedTile,\n right: rightTile?.row === touchedTile.row ? rightTile : undefined,\n },\n };\n }\n };\n\n const x = start.col * elementWidth + offsetX + dragPosition.x;\n const y = start.row * elementHeight + offsetY + dragPosition.y;\n\n //find the position of the tile in the grid\n const cell = TableUtils.pointToLocation(table, x, y, config);\n const tsize = TableUtils.tableSize(table);\n\n //console.log('data:', { x, y, cell, start, draggingTile });\n\n //try to see if we're touching a hot point\n //find the touched tile within the move\n\n const touchedTile = table[cell.row][cell.col];\n if (!touchedTile || touchedTile.data === draggingTile.data) return;\n\n //get the touchpoint of the touched tile\n const touchPoint = TilesUtils.getTileTouchPoint(\n touchedTile,\n touchedTile,\n {\n x,\n y,\n },\n config\n );\n if (!touchPoint) return;\n\n //console.log('HIT TOUCHPOINT', { table, tiles });\n console.log('touch point:', touchPoint);\n\n if (touchPoint === 'center') {\n if (touchedTile === dropTargetTile)\n return {\n dropTargetTile,\n droppable,\n };\n if (canAcceptDrop(draggingTile, touchedTile))\n return {\n dropTargetTile: touchedTile,\n droppable: true,\n };\n return;\n }\n\n //apply calculation only if touching left or right areas\n if (touchPoint !== 'right' && touchPoint !== 'left') return;\n\n //if the touch point is in the bottom of the cell, pick the adjacent cell\n if (touchedTile.row !== cell.row) {\n const adjacentCol =\n touchPoint === 'left' ? cell.col - 1 : cell.col + touchedTile.colSpan;\n if (adjacentCol < 0 || adjacentCol > tsize.cols) return;\n const adjacentTile = table[cell.row][adjacentCol];\n if (!adjacentTile) return;\n\n const shiftedInsertionPoint = getInsertionPoint(\n tiles,\n touchPoint === 'left' ? 'right' : 'left',\n adjacentTile\n )?.insertionPoint;\n console.log('SHIFTING: ', { shiftedInsertionPoint, touchPoint });\n\n return {\n insertionPoint: {\n left:\n touchPoint === 'left' ? shiftedInsertionPoint?.right : undefined,\n right:\n touchPoint === 'right' ? shiftedInsertionPoint?.left : undefined,\n },\n };\n }\n\n return getInsertionPoint(tiles, touchPoint, touchedTile);\n },\n\n onDragEnd: ({ state }) => {\n const { insertionPoint, draggingTile, tiles } = state;\n console.log('Drag end start:', {\n insertionPoint,\n draggingTile,\n tiles,\n });\n\n if (!tiles || !draggingTile || !insertionPoint) return;\n const newTiles = tiles.filter(tile => tile.data !== draggingTile.data);\n const { left, right } = insertionPoint;\n\n const insertionLeftIdx = left\n ? newTiles.findIndex(tile => tile.data === left.data) + 1\n : -1;\n const insertionRightIdx = right\n ? newTiles.findIndex(tile => tile.data === right.data)\n : -1;\n\n const insertionIndex =\n insertionLeftIdx > 0 ? insertionLeftIdx : insertionRightIdx;\n if (insertionIndex < 0) newTiles.push(draggingTile);\n else {\n newTiles.splice(insertionIndex, 0, draggingTile);\n }\n console.log('Drag end:', {\n insertionPoint,\n insertionLeftIdx,\n insertionRightIdx,\n draggingTile,\n tiles,\n newTiles,\n });\n\n return { tiles: newTiles };\n },\n};\n\nexport default reorder;\n", "import { useMemo, useState } from 'react';\nimport { useDrag } from '@use-gesture/react';\nimport {\n GridConfig,\n TileInfo,\n TilePositionInfo,\n RenderTileProps,\n} from './model';\nimport * as TilesTableUtils from './table-utils/tiles-table';\nimport moveStrategy from './strategies/move';\nimport reorderStrategy from './strategies/reorder';\nimport { DragState } from './model';\nimport { reduceRight } from 'lodash';\n\ninterface TileTableDNDProps {\n strategy: 'reorder' | 'move';\n enabled: boolean;\n elementWidth: number;\n elementHeight: number;\n activeBorderSize: number;\n columns: number;\n currentTiles: TileInfo[];\n canAcceptDrop: (\n draggingTile: TileInfo,\n targetTile: TileInfo\n ) => boolean;\n didDrop: (draggingTile: TileInfo, targetTile: TileInfo) => void;\n changeTilesOrder: (tiles: TileInfo[]) => void;\n}\n\nexport const useTileTable = ({\n enabled,\n strategy,\n elementWidth,\n elementHeight,\n activeBorderSize,\n columns,\n currentTiles,\n canAcceptDrop,\n changeTilesOrder,\n didDrop,\n}: TileTableDNDProps) => {\n const strategyImpl = strategy === 'reorder' ? reorderStrategy : moveStrategy;\n const [state, setState] = useState>({\n dragging: false,\n droppable: false,\n });\n\n //the tile layout table\n const { tiles: draggingTiles, dragging, insertionPoint } = state;\n\n const effectiveTiles = (enabled && dragging && draggingTiles) || currentTiles;\n\n const table = useMemo(\n () => TilesTableUtils.tilesListToTable(effectiveTiles, columns),\n [effectiveTiles, columns]\n );\n\n const positionedTiles = useMemo(\n () => TilesTableUtils.tableToTilesList(table),\n [table]\n );\n\n const config: GridConfig = {\n elementHeight,\n elementWidth,\n activeBorderSize,\n columns,\n };\n\n const bind = useDrag>(\n ({ args: [data], dragging, tap, xy, movement, event }) => {\n if (dragging) {\n if (!tap) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n //if this is the first event, initialize the dragging\n if (!state.dragging) {\n const rect = event.currentTarget.getBoundingClientRect();\n\n //identify the hit tile\n const draggingTile = positionedTiles.find(tile => tile.data === data);\n if (!draggingTile) return;\n\n setState({\n dragging: true,\n droppable: false,\n tiles: positionedTiles,\n draggingTile,\n dragPosition: { x: xy[0] - rect.x, y: xy[1] - rect.y },\n offset: { x: movement[0], y: movement[1] },\n start: { col: draggingTile.col, row: draggingTile.row },\n });\n } else {\n const result =\n strategyImpl.onDragMove({\n offsetX: movement[0],\n offsetY: movement[1],\n canAcceptDrop,\n config,\n state,\n table,\n }) || {};\n setState(state => ({\n ...state,\n offset: { x: movement[0], y: movement[1] },\n dropTargetTile: undefined,\n droppable: false,\n insertionPoint: undefined,\n ...result,\n }));\n }\n } else {\n if (state.draggingTile && state.dropTargetTile && state.droppable) {\n didDrop(state.draggingTile, state.dropTargetTile);\n } else {\n const result =\n strategyImpl.onDragEnd({\n offsetX: movement[0],\n offsetY: movement[1],\n canAcceptDrop,\n config,\n state,\n table,\n }) || {};\n const finalState = { ...state, ...result };\n finalState.tiles && changeTilesOrder(finalState.tiles);\n }\n\n setState({\n dragging: false,\n droppable: false,\n });\n }\n },\n { filterTaps: true, enabled }\n );\n\n const renderTileProps = useMemo<\n (RenderTileProps & {\n x: number;\n y: number;\n key: number;\n })[]\n >(() => {\n if (!enabled) {\n return positionedTiles\n .map(tile => ({\n ...tile,\n tileWidth: elementWidth,\n tileHeight: elementHeight,\n isDragging: false,\n isDropTarget: false,\n isDroppable: false,\n isDroppableAtInsertPosition: false,\n insertAtLeft: false,\n insertAtRight: false,\n x: tile.col * elementWidth,\n y: tile.row * elementHeight,\n }))\n .sort((a, b) => a.key - b.key);\n } else\n return positionedTiles\n .map(tile => {\n return {\n ...tile,\n tileWidth: elementWidth,\n tileHeight: elementHeight,\n isDragging: tile.data === state.draggingTile?.data,\n isDropTarget: tile.data === state.dropTargetTile?.data,\n insertAtLeft: tile.data === state.insertionPoint?.left?.data,\n insertAtRight: tile.data === state.insertionPoint?.right?.data,\n isDroppable:\n tile.data === state.draggingTile?.data && state.droppable,\n isDroppableAtInsertPosition: !!(\n tile.data === state.draggingTile?.data && state.insertionPoint\n ),\n x:\n tile.data === state.draggingTile?.data\n ? (state.start?.col || 0) * elementWidth +\n (state.offset?.x || 0)\n : tile.col * elementWidth,\n y:\n tile.data === state.draggingTile?.data\n ? (state.start?.row || 0) * elementHeight +\n (state.offset?.y || 0)\n : tile.row * elementHeight,\n };\n })\n .sort((a, b) => a.key - b.key);\n }, [state, positionedTiles, elementHeight, elementWidth, enabled]);\n\n const { draggingTile } = state;\n const insertIndicatorPosition = useMemo(() => {\n const { left, right } = insertionPoint || {};\n if (left)\n return {\n x: (left.col + left.colSpan) * elementWidth,\n y: left.row * elementHeight,\n };\n if (right)\n return {\n x: right.col * elementWidth,\n y: right.row * elementHeight,\n };\n if (draggingTile)\n return {\n x: draggingTile.col * elementWidth,\n y: draggingTile.row * elementHeight,\n };\n }, [insertionPoint, elementHeight, elementWidth, draggingTile]);\n\n return {\n table,\n tableHeight: table.length * elementHeight,\n tiles: positionedTiles,\n insertIndicatorPosition,\n bind,\n renderTileProps,\n };\n};\n", "import { useMemo } from 'react';\nvar createMemo = function (fn) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return useMemo(function () { return fn.apply(void 0, args); }, args);\n };\n};\nexport default createMemo;\n", "import { createContext, createElement, useContext, useReducer } from 'react';\nvar createReducerContext = function (reducer, defaultInitialState) {\n var context = createContext(undefined);\n var providerFactory = function (props, children) { return createElement(context.Provider, props, children); };\n var ReducerProvider = function (_a) {\n var children = _a.children, initialState = _a.initialState;\n var state = useReducer(reducer, initialState !== undefined ? initialState : defaultInitialState);\n return providerFactory({ value: state }, children);\n };\n var useReducerContext = function () {\n var state = useContext(context);\n if (state == null) {\n throw new Error(\"useReducerContext must be used inside a ReducerProvider.\");\n }\n return state;\n };\n return [useReducerContext, ReducerProvider, context];\n};\nexport default createReducerContext;\n", "import { useCallback, useRef, useState } from 'react';\nimport useUpdateEffect from '../useUpdateEffect';\nfunction composeMiddleware(chain) {\n return function (context, dispatch) {\n return chain.reduceRight(function (res, middleware) {\n return middleware(context)(res);\n }, dispatch);\n };\n}\nvar createReducer = function () {\n var middlewares = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n middlewares[_i] = arguments[_i];\n }\n var composedMiddleware = composeMiddleware(middlewares);\n return function (reducer, initialState, initializer) {\n if (initializer === void 0) { initializer = function (value) { return value; }; }\n var ref = useRef(initializer(initialState));\n var _a = useState(ref.current), setState = _a[1];\n var dispatch = useCallback(function (action) {\n ref.current = reducer(ref.current, action);\n setState(ref.current);\n return action;\n }, [reducer]);\n var dispatchRef = useRef(composedMiddleware({\n getState: function () { return ref.current; },\n dispatch: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return dispatchRef.current.apply(dispatchRef, args);\n },\n }, dispatch));\n useUpdateEffect(function () {\n dispatchRef.current = composedMiddleware({\n getState: function () { return ref.current; },\n dispatch: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return dispatchRef.current.apply(dispatchRef, args);\n },\n }, dispatch);\n }, [dispatch]);\n return [ref.current, dispatchRef.current];\n };\n};\nexport default createReducer;\n", "import { useEffect } from 'react';\nimport { useFirstMountState } from './useFirstMountState';\nvar useUpdateEffect = function (effect, deps) {\n var isFirstMount = useFirstMountState();\n useEffect(function () {\n if (!isFirstMount) {\n return effect();\n }\n }, deps);\n};\nexport default useUpdateEffect;\n", "import { useRef } from 'react';\nexport function useFirstMountState() {\n var isFirst = useRef(true);\n if (isFirst.current) {\n isFirst.current = false;\n return true;\n }\n return isFirst.current;\n}\n", "import { createContext, createElement, useContext, useState } from 'react';\nvar createStateContext = function (defaultInitialValue) {\n var context = createContext(undefined);\n var providerFactory = function (props, children) { return createElement(context.Provider, props, children); };\n var StateProvider = function (_a) {\n var children = _a.children, initialValue = _a.initialValue;\n var state = useState(initialValue !== undefined ? initialValue : defaultInitialValue);\n return providerFactory({ value: state }, children);\n };\n var useStateContext = function () {\n var state = useContext(context);\n if (state == null) {\n throw new Error(\"useStateContext must be used inside a StateProvider.\");\n }\n return state;\n };\n return [useStateContext, StateProvider, context];\n};\nexport default createStateContext;\n", "import { useEffect } from 'react';\nimport useAsyncFn from './useAsyncFn';\nexport default function useAsync(fn, deps) {\n if (deps === void 0) { deps = []; }\n var _a = useAsyncFn(fn, deps, {\n loading: true,\n }), state = _a[0], callback = _a[1];\n useEffect(function () {\n callback();\n }, [callback]);\n return state;\n}\n", "import { __assign } from \"tslib\";\nimport { useCallback, useRef, useState } from 'react';\nimport useMountedState from './useMountedState';\nexport default function useAsyncFn(fn, deps, initialState) {\n if (deps === void 0) { deps = []; }\n if (initialState === void 0) { initialState = { loading: false }; }\n var lastCallId = useRef(0);\n var isMounted = useMountedState();\n var _a = useState(initialState), state = _a[0], set = _a[1];\n var callback = useCallback(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var callId = ++lastCallId.current;\n if (!state.loading) {\n set(function (prevState) { return (__assign(__assign({}, prevState), { loading: true })); });\n }\n return fn.apply(void 0, args).then(function (value) {\n isMounted() && callId === lastCallId.current && set({ value: value, loading: false });\n return value;\n }, function (error) {\n isMounted() && callId === lastCallId.current && set({ error: error, loading: false });\n return error;\n });\n }, deps);\n return [state, callback];\n}\n", "import { useCallback, useEffect, useRef } from 'react';\nexport default function useMountedState() {\n var mountedRef = useRef(false);\n var get = useCallback(function () { return mountedRef.current; }, []);\n useEffect(function () {\n mountedRef.current = true;\n return function () {\n mountedRef.current = false;\n };\n }, []);\n return get;\n}\n", "import { __assign, __spreadArrays } from \"tslib\";\nimport { useCallback, useState } from 'react';\nimport useAsync from './useAsync';\nvar useAsyncRetry = function (fn, deps) {\n if (deps === void 0) { deps = []; }\n var _a = useState(0), attempt = _a[0], setAttempt = _a[1];\n var state = useAsync(fn, __spreadArrays(deps, [attempt]));\n var stateLoading = state.loading;\n var retry = useCallback(function () {\n if (stateLoading) {\n if (process.env.NODE_ENV === 'development') {\n console.log('You are calling useAsyncRetry hook retry() method while loading in progress, this is a no-op.');\n }\n return;\n }\n setAttempt(function (currentAttempt) { return currentAttempt + 1; });\n }, __spreadArrays(deps, [stateLoading]));\n return __assign(__assign({}, state), { retry: retry });\n};\nexport default useAsyncRetry;\n", "import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { useEffect, useRef } from 'react';\nimport useSetState from '../useSetState';\nimport parseTimeRanges from '../misc/parseTimeRanges';\nexport default function createHTMLMediaHook(tag) {\n return function (elOrProps) {\n var element;\n var props;\n if (React.isValidElement(elOrProps)) {\n element = elOrProps;\n props = element.props;\n }\n else {\n props = elOrProps;\n }\n var _a = useSetState({\n buffered: [],\n time: 0,\n duration: 0,\n paused: true,\n muted: false,\n volume: 1,\n playing: false,\n }), state = _a[0], setState = _a[1];\n var ref = useRef(null);\n var wrapEvent = function (userEvent, proxyEvent) {\n return function (event) {\n try {\n proxyEvent && proxyEvent(event);\n }\n finally {\n userEvent && userEvent(event);\n }\n };\n };\n var onPlay = function () { return setState({ paused: false }); };\n var onPlaying = function () { return setState({ playing: true }); };\n var onWaiting = function () { return setState({ playing: false }); };\n var onPause = function () { return setState({ paused: true, playing: false }); };\n var onVolumeChange = function () {\n var el = ref.current;\n if (!el) {\n return;\n }\n setState({\n muted: el.muted,\n volume: el.volume,\n });\n };\n var onDurationChange = function () {\n var el = ref.current;\n if (!el) {\n return;\n }\n var duration = el.duration, buffered = el.buffered;\n setState({\n duration: duration,\n buffered: parseTimeRanges(buffered),\n });\n };\n var onTimeUpdate = function () {\n var el = ref.current;\n if (!el) {\n return;\n }\n setState({ time: el.currentTime });\n };\n var onProgress = function () {\n var el = ref.current;\n if (!el) {\n return;\n }\n setState({ buffered: parseTimeRanges(el.buffered) });\n };\n if (element) {\n element = React.cloneElement(element, __assign(__assign({ controls: false }, props), { ref: ref, onPlay: wrapEvent(props.onPlay, onPlay), onPlaying: wrapEvent(props.onPlaying, onPlaying), onWaiting: wrapEvent(props.onWaiting, onWaiting), onPause: wrapEvent(props.onPause, onPause), onVolumeChange: wrapEvent(props.onVolumeChange, onVolumeChange), onDurationChange: wrapEvent(props.onDurationChange, onDurationChange), onTimeUpdate: wrapEvent(props.onTimeUpdate, onTimeUpdate), onProgress: wrapEvent(props.onProgress, onProgress) }));\n }\n else {\n element = React.createElement(tag, __assign(__assign({ controls: false }, props), { ref: ref, onPlay: wrapEvent(props.onPlay, onPlay), onPlaying: wrapEvent(props.onPlaying, onPlaying), onWaiting: wrapEvent(props.onWaiting, onWaiting), onPause: wrapEvent(props.onPause, onPause), onVolumeChange: wrapEvent(props.onVolumeChange, onVolumeChange), onDurationChange: wrapEvent(props.onDurationChange, onDurationChange), onTimeUpdate: wrapEvent(props.onTimeUpdate, onTimeUpdate), onProgress: wrapEvent(props.onProgress, onProgress) })); // TODO: fix this typing.\n }\n // Some browsers return `Promise` on `.play()` and may throw errors\n // if one tries to execute another `.play()` or `.pause()` while that\n // promise is resolving. So we prevent that with this lock.\n // See: https://bugs.chromium.org/p/chromium/issues/detail?id=593273\n var lockPlay = false;\n var controls = {\n play: function () {\n var el = ref.current;\n if (!el) {\n return undefined;\n }\n if (!lockPlay) {\n var promise = el.play();\n var isPromise = typeof promise === 'object';\n if (isPromise) {\n lockPlay = true;\n var resetLock = function () {\n lockPlay = false;\n };\n promise.then(resetLock, resetLock);\n }\n return promise;\n }\n return undefined;\n },\n pause: function () {\n var el = ref.current;\n if (el && !lockPlay) {\n return el.pause();\n }\n },\n seek: function (time) {\n var el = ref.current;\n if (!el || state.duration === undefined) {\n return;\n }\n time = Math.min(state.duration, Math.max(0, time));\n el.currentTime = time;\n },\n volume: function (volume) {\n var el = ref.current;\n if (!el) {\n return;\n }\n volume = Math.min(1, Math.max(0, volume));\n el.volume = volume;\n setState({ volume: volume });\n },\n mute: function () {\n var el = ref.current;\n if (!el) {\n return;\n }\n el.muted = true;\n },\n unmute: function () {\n var el = ref.current;\n if (!el) {\n return;\n }\n el.muted = false;\n },\n };\n useEffect(function () {\n var el = ref.current;\n if (!el) {\n if (process.env.NODE_ENV !== 'production') {\n if (tag === 'audio') {\n console.error('useAudio() ref to