element might be a scroll container.
We have found no reliable way of detecting whether the element is a scroll container.
Under most circumstances a scroll bar will be on the element (document.documentElement)
Because we cannot determine if the is a scroll container, and generally it is not one,
we will be treating the as *not* a scroll container
More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/how-we-detect-scroll-containers.md
`) : 0;
return false;
};
const getClosestScrollable = el => {
if (el == null) {
return null;
}
if (el === document.body) {
return isBodyScrollable() ? el : null;
}
if (el === document.documentElement) {
return null;
}
if (!isElementScrollable(el)) {
return getClosestScrollable(el.parentElement);
}
return el;
};
var getClosestScrollable$1 = getClosestScrollable;
var checkForNestedScrollContainers = (scrollable => {
if (!scrollable) {
return;
}
const anotherScrollParent = getClosestScrollable$1(scrollable.parentElement);
if (!anotherScrollParent) {
return;
}
true ? warning(`
Droppable: unsupported nested scroll container detected.
A Droppable can only have one scroll parent (which can be itself)
Nested scroll containers are currently not supported.
We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131
`) : 0;
});
var getScroll = (el => ({
x: el.scrollLeft,
y: el.scrollTop
}));
const getIsFixed = el => {
if (!el) {
return false;
}
const style = window.getComputedStyle(el);
if (style.position === 'fixed') {
return true;
}
return getIsFixed(el.parentElement);
};
var getEnv = (start => {
const closestScrollable = getClosestScrollable$1(start);
const isFixedOnPage = getIsFixed(start);
return {
closestScrollable,
isFixedOnPage
};
});
var getDroppableDimension = (({
descriptor,
isEnabled,
isCombineEnabled,
isFixedOnPage,
direction,
client,
page,
closest
}) => {
const frame = (() => {
if (!closest) {
return null;
}
const {
scrollSize,
client: frameClient
} = closest;
const maxScroll = getMaxScroll({
scrollHeight: scrollSize.scrollHeight,
scrollWidth: scrollSize.scrollWidth,
height: frameClient.paddingBox.height,
width: frameClient.paddingBox.width
});
return {
pageMarginBox: closest.page.marginBox,
frameClient,
scrollSize,
shouldClipSubject: closest.shouldClipSubject,
scroll: {
initial: closest.scroll,
current: closest.scroll,
max: maxScroll,
diff: {
value: origin,
displacement: origin
}
}
};
})();
const axis = direction === 'vertical' ? vertical : horizontal;
const subject = getSubject({
page,
withPlaceholder: null,
axis,
frame
});
const dimension = {
descriptor,
isCombineEnabled,
isFixedOnPage,
axis,
isEnabled,
client,
page,
frame,
subject
};
return dimension;
});
const getClient = (targetRef, closestScrollable) => {
const base = (0,css_box_model__WEBPACK_IMPORTED_MODULE_4__.getBox)(targetRef);
if (!closestScrollable) {
return base;
}
if (targetRef !== closestScrollable) {
return base;
}
const top = base.paddingBox.top - closestScrollable.scrollTop;
const left = base.paddingBox.left - closestScrollable.scrollLeft;
const bottom = top + closestScrollable.scrollHeight;
const right = left + closestScrollable.scrollWidth;
const paddingBox = {
top,
right,
bottom,
left
};
const borderBox = (0,css_box_model__WEBPACK_IMPORTED_MODULE_4__.expand)(paddingBox, base.border);
const client = (0,css_box_model__WEBPACK_IMPORTED_MODULE_4__.createBox)({
borderBox,
margin: base.margin,
border: base.border,
padding: base.padding
});
return client;
};
var getDimension = (({
ref,
descriptor,
env,
windowScroll,
direction,
isDropDisabled,
isCombineEnabled,
shouldClipSubject
}) => {
const closestScrollable = env.closestScrollable;
const client = getClient(ref, closestScrollable);
const page = (0,css_box_model__WEBPACK_IMPORTED_MODULE_4__.withScroll)(client, windowScroll);
const closest = (() => {
if (!closestScrollable) {
return null;
}
const frameClient = (0,css_box_model__WEBPACK_IMPORTED_MODULE_4__.getBox)(closestScrollable);
const scrollSize = {
scrollHeight: closestScrollable.scrollHeight,
scrollWidth: closestScrollable.scrollWidth
};
return {
client: frameClient,
page: (0,css_box_model__WEBPACK_IMPORTED_MODULE_4__.withScroll)(frameClient, windowScroll),
scroll: getScroll(closestScrollable),
scrollSize,
shouldClipSubject
};
})();
const dimension = getDroppableDimension({
descriptor,
isEnabled: !isDropDisabled,
isCombineEnabled,
isFixedOnPage: env.isFixedOnPage,
direction,
client,
page,
closest
});
return dimension;
});
const immediate = {
passive: false
};
const delayed = {
passive: true
};
var getListenerOptions = (options => options.shouldPublishImmediately ? immediate : delayed);
const getClosestScrollableFromDrag = dragging => dragging && dragging.env.closestScrollable || null;
function useDroppablePublisher(args) {
const whileDraggingRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
const appContext = useRequiredContext(AppContext);
const uniqueId = useUniqueId$1('droppable');
const {
registry,
marshal
} = appContext;
const previousRef = usePrevious(args);
const descriptor = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => ({
id: args.droppableId,
type: args.type,
mode: args.mode
}), [args.droppableId, args.mode, args.type]);
const publishedDescriptorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(descriptor);
const memoizedUpdateScroll = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => (0,memoize_one__WEBPACK_IMPORTED_MODULE_5__["default"])((x, y) => {
!whileDraggingRef.current ? true ? invariant(false, 'Can only update scroll when dragging') : 0 : void 0;
const scroll = {
x,
y
};
marshal.updateDroppableScroll(descriptor.id, scroll);
}), [descriptor.id, marshal]);
const getClosestScroll = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
const dragging = whileDraggingRef.current;
if (!dragging || !dragging.env.closestScrollable) {
return origin;
}
return getScroll(dragging.env.closestScrollable);
}, []);
const updateScroll = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
const scroll = getClosestScroll();
memoizedUpdateScroll(scroll.x, scroll.y);
}, [getClosestScroll, memoizedUpdateScroll]);
const scheduleScrollUpdate = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => (0,raf_schd__WEBPACK_IMPORTED_MODULE_6__["default"])(updateScroll), [updateScroll]);
const onClosestScroll = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
const dragging = whileDraggingRef.current;
const closest = getClosestScrollableFromDrag(dragging);
!(dragging && closest) ? true ? invariant(false, 'Could not find scroll options while scrolling') : 0 : void 0;
const options = dragging.scrollOptions;
if (options.shouldPublishImmediately) {
updateScroll();
return;
}
scheduleScrollUpdate();
}, [scheduleScrollUpdate, updateScroll]);
const getDimensionAndWatchScroll = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)((windowScroll, options) => {
!!whileDraggingRef.current ? true ? invariant(false, 'Cannot collect a droppable while a drag is occurring') : 0 : void 0;
const previous = previousRef.current;
const ref = previous.getDroppableRef();
!ref ? true ? invariant(false, 'Cannot collect without a droppable ref') : 0 : void 0;
const env = getEnv(ref);
const dragging = {
ref,
descriptor,
env,
scrollOptions: options
};
whileDraggingRef.current = dragging;
const dimension = getDimension({
ref,
descriptor,
env,
windowScroll,
direction: previous.direction,
isDropDisabled: previous.isDropDisabled,
isCombineEnabled: previous.isCombineEnabled,
shouldClipSubject: !previous.ignoreContainerClipping
});
const scrollable = env.closestScrollable;
if (scrollable) {
scrollable.setAttribute(scrollContainer.contextId, appContext.contextId);
scrollable.addEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));
if (true) {
checkForNestedScrollContainers(scrollable);
}
}
return dimension;
}, [appContext.contextId, descriptor, onClosestScroll, previousRef]);
const getScrollWhileDragging = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
const dragging = whileDraggingRef.current;
const closest = getClosestScrollableFromDrag(dragging);
!(dragging && closest) ? true ? invariant(false, 'Can only recollect Droppable client for Droppables that have a scroll container') : 0 : void 0;
return getScroll(closest);
}, []);
const dragStopped = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
const dragging = whileDraggingRef.current;
!dragging ? true ? invariant(false, 'Cannot stop drag when no active drag') : 0 : void 0;
const closest = getClosestScrollableFromDrag(dragging);
whileDraggingRef.current = null;
if (!closest) {
return;
}
scheduleScrollUpdate.cancel();
closest.removeAttribute(scrollContainer.contextId);
closest.removeEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));
}, [onClosestScroll, scheduleScrollUpdate]);
const scroll = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(change => {
const dragging = whileDraggingRef.current;
!dragging ? true ? invariant(false, 'Cannot scroll when there is no drag') : 0 : void 0;
const closest = getClosestScrollableFromDrag(dragging);
!closest ? true ? invariant(false, 'Cannot scroll a droppable with no closest scrollable') : 0 : void 0;
closest.scrollTop += change.y;
closest.scrollLeft += change.x;
}, []);
const callbacks = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => {
return {
getDimensionAndWatchScroll,
getScrollWhileDragging,
dragStopped,
scroll
};
}, [dragStopped, getDimensionAndWatchScroll, getScrollWhileDragging, scroll]);
const entry = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => ({
uniqueId,
descriptor,
callbacks
}), [callbacks, descriptor, uniqueId]);
useLayoutEffect(() => {
publishedDescriptorRef.current = entry.descriptor;
registry.droppable.register(entry);
return () => {
if (whileDraggingRef.current) {
true ? warning('Unsupported: changing the droppableId or type of a Droppable during a drag') : 0;
dragStopped();
}
registry.droppable.unregister(entry);
};
}, [callbacks, descriptor, dragStopped, entry, marshal, registry.droppable]);
useLayoutEffect(() => {
if (!whileDraggingRef.current) {
return;
}
marshal.updateDroppableIsEnabled(publishedDescriptorRef.current.id, !args.isDropDisabled);
}, [args.isDropDisabled, marshal]);
useLayoutEffect(() => {
if (!whileDraggingRef.current) {
return;
}
marshal.updateDroppableIsCombineEnabled(publishedDescriptorRef.current.id, args.isCombineEnabled);
}, [args.isCombineEnabled, marshal]);
}
function noop() {}
const empty = {
width: 0,
height: 0,
margin: noSpacing
};
const getSize = ({
isAnimatingOpenOnMount,
placeholder,
animate
}) => {
if (isAnimatingOpenOnMount) {
return empty;
}
if (animate === 'close') {
return empty;
}
return {
height: placeholder.client.borderBox.height,
width: placeholder.client.borderBox.width,
margin: placeholder.client.margin
};
};
const getStyle = ({
isAnimatingOpenOnMount,
placeholder,
animate
}) => {
const size = getSize({
isAnimatingOpenOnMount,
placeholder,
animate
});
return {
display: placeholder.display,
boxSizing: 'border-box',
width: size.width,
height: size.height,
marginTop: size.margin.top,
marginRight: size.margin.right,
marginBottom: size.margin.bottom,
marginLeft: size.margin.left,
flexShrink: '0',
flexGrow: '0',
pointerEvents: 'none',
transition: animate !== 'none' ? transitions.placeholder : null
};
};
const Placeholder = props => {
const animateOpenTimerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
const tryClearAnimateOpenTimer = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
if (!animateOpenTimerRef.current) {
return;
}
clearTimeout(animateOpenTimerRef.current);
animateOpenTimerRef.current = null;
}, []);
const {
animate,
onTransitionEnd,
onClose,
contextId
} = props;
const [isAnimatingOpenOnMount, setIsAnimatingOpenOnMount] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(props.animate === 'open');
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
if (!isAnimatingOpenOnMount) {
return noop;
}
if (animate !== 'open') {
tryClearAnimateOpenTimer();
setIsAnimatingOpenOnMount(false);
return noop;
}
if (animateOpenTimerRef.current) {
return noop;
}
animateOpenTimerRef.current = setTimeout(() => {
animateOpenTimerRef.current = null;
setIsAnimatingOpenOnMount(false);
});
return tryClearAnimateOpenTimer;
}, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]);
const onSizeChangeEnd = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(event => {
if (event.propertyName !== 'height') {
return;
}
onTransitionEnd();
if (animate === 'close') {
onClose();
}
}, [animate, onClose, onTransitionEnd]);
const style = getStyle({
isAnimatingOpenOnMount,
animate: props.animate,
placeholder: props.placeholder
});
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(props.placeholder.tagName, {
style,
'data-rfd-placeholder-context-id': contextId,
onTransitionEnd: onSizeChangeEnd,
ref: props.innerRef
});
};
var Placeholder$1 = react__WEBPACK_IMPORTED_MODULE_0___default().memo(Placeholder);
function isBoolean(value) {
return typeof value === 'boolean';
}
function runChecks(args, checks) {
checks.forEach(check => check(args));
}
const shared = [function required({
props
}) {
!props.droppableId ? true ? invariant(false, 'A Droppable requires a droppableId prop') : 0 : void 0;
!(typeof props.droppableId === 'string') ? true ? invariant(false, `A Droppable requires a [string] droppableId. Provided: [${typeof props.droppableId}]`) : 0 : void 0;
}, function boolean({
props
}) {
!isBoolean(props.isDropDisabled) ? true ? invariant(false, 'isDropDisabled must be a boolean') : 0 : void 0;
!isBoolean(props.isCombineEnabled) ? true ? invariant(false, 'isCombineEnabled must be a boolean') : 0 : void 0;
!isBoolean(props.ignoreContainerClipping) ? true ? invariant(false, 'ignoreContainerClipping must be a boolean') : 0 : void 0;
}, function ref({
getDroppableRef
}) {
checkIsValidInnerRef(getDroppableRef());
}];
const standard = [function placeholder({
props,
getPlaceholderRef
}) {
if (!props.placeholder) {
return;
}
const ref = getPlaceholderRef();
if (ref) {
return;
}
true ? warning(`
Droppable setup issue [droppableId: "${props.droppableId}"]:
DroppableProvided > placeholder could not be found.
Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.
More information: https://github.com/hello-pangea/dnd/blob/main/docs/api/droppable.md
`) : 0;
}];
const virtual = [function hasClone({
props
}) {
!props.renderClone ? true ? invariant(false, 'Must provide a clone render function (renderClone) for virtual lists') : 0 : void 0;
}, function hasNoPlaceholder({
getPlaceholderRef
}) {
!!getPlaceholderRef() ? true ? invariant(false, 'Expected virtual list to not have a placeholder') : 0 : void 0;
}];
function useValidation(args) {
useDevSetupWarning(() => {
runChecks(args, shared);
if (args.props.mode === 'standard') {
runChecks(args, standard);
}
if (args.props.mode === 'virtual') {
runChecks(args, virtual);
}
});
}
class AnimateInOut extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComponent) {
constructor(...args) {
super(...args);
this.state = {
isVisible: Boolean(this.props.on),
data: this.props.on,
animate: this.props.shouldAnimate && this.props.on ? 'open' : 'none'
};
this.onClose = () => {
if (this.state.animate !== 'close') {
return;
}
this.setState({
isVisible: false
});
};
}
static getDerivedStateFromProps(props, state) {
if (!props.shouldAnimate) {
return {
isVisible: Boolean(props.on),
data: props.on,
animate: 'none'
};
}
if (props.on) {
return {
isVisible: true,
data: props.on,
animate: 'open'
};
}
if (state.isVisible) {
return {
isVisible: true,
data: state.data,
animate: 'close'
};
}
return {
isVisible: false,
animate: 'close',
data: null
};
}
render() {
if (!this.state.isVisible) {
return null;
}
const provided = {
onClose: this.onClose,
data: this.state.data,
animate: this.state.animate
};
return this.props.children(provided);
}
}
const Droppable = props => {
const appContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(AppContext);
!appContext ? true ? invariant(false, 'Could not find app context') : 0 : void 0;
const {
contextId,
isMovementAllowed
} = appContext;
const droppableRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
const placeholderRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
const {
children,
droppableId,
type,
mode,
direction,
ignoreContainerClipping,
isDropDisabled,
isCombineEnabled,
snapshot,
useClone,
updateViewportMaxScroll,
getContainerForClone
} = props;
const getDroppableRef = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => droppableRef.current, []);
const setDroppableRef = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)((value = null) => {
droppableRef.current = value;
}, []);
const getPlaceholderRef = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => placeholderRef.current, []);
const setPlaceholderRef = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)((value = null) => {
placeholderRef.current = value;
}, []);
useValidation({
props,
getDroppableRef,
getPlaceholderRef
});
const onPlaceholderTransitionEnd = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
if (isMovementAllowed()) {
updateViewportMaxScroll({
maxScroll: getMaxWindowScroll()
});
}
}, [isMovementAllowed, updateViewportMaxScroll]);
useDroppablePublisher({
droppableId,
type,
mode,
direction,
isDropDisabled,
isCombineEnabled,
ignoreContainerClipping,
getDroppableRef
});
const placeholder = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AnimateInOut, {
on: props.placeholder,
shouldAnimate: props.shouldAnimatePlaceholder
}, ({
onClose,
data,
animate
}) => react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Placeholder$1, {
placeholder: data,
onClose: onClose,
innerRef: setPlaceholderRef,
animate: animate,
contextId: contextId,
onTransitionEnd: onPlaceholderTransitionEnd
})), [contextId, onPlaceholderTransitionEnd, props.placeholder, props.shouldAnimatePlaceholder, setPlaceholderRef]);
const provided = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => ({
innerRef: setDroppableRef,
placeholder,
droppableProps: {
'data-rfd-droppable-id': droppableId,
'data-rfd-droppable-context-id': contextId
}
}), [contextId, droppableId, placeholder, setDroppableRef]);
const isUsingCloneFor = useClone ? useClone.dragging.draggableId : null;
const droppableContext = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => ({
droppableId,
type,
isUsingCloneFor
}), [droppableId, isUsingCloneFor, type]);
function getClone() {
if (!useClone) {
return null;
}
const {
dragging,
render
} = useClone;
const node = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PrivateDraggable, {
draggableId: dragging.draggableId,
index: dragging.source.index,
isClone: true,
isEnabled: true,
shouldRespectForcePress: false,
canDragInteractiveElements: true
}, (draggableProvided, draggableSnapshot) => render(draggableProvided, draggableSnapshot, dragging));
return react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal(node, getContainerForClone());
}
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DroppableContext.Provider, {
value: droppableContext
}, children(provided, snapshot), getClone());
};
var Droppable$1 = Droppable;
function getBody() {
!document.body ? true ? invariant(false, 'document.body is not ready') : 0 : void 0;
return document.body;
}
const defaultProps = {
mode: 'standard',
type: 'DEFAULT',
direction: 'vertical',
isDropDisabled: false,
isCombineEnabled: false,
ignoreContainerClipping: false,
renderClone: null,
getContainerForClone: getBody
};
const attachDefaultPropsToOwnProps = ownProps => {
let mergedProps = {
...ownProps
};
let defaultPropKey;
for (defaultPropKey in defaultProps) {
if (ownProps[defaultPropKey] === undefined) {
mergedProps = {
...mergedProps,
[defaultPropKey]: defaultProps[defaultPropKey]
};
}
}
return mergedProps;
};
const isMatchingType = (type, critical) => type === critical.droppable.type;
const getDraggable = (critical, dimensions) => dimensions.draggables[critical.draggable.id];
const makeMapStateToProps = () => {
const idleWithAnimation = {
placeholder: null,
shouldAnimatePlaceholder: true,
snapshot: {
isDraggingOver: false,
draggingOverWith: null,
draggingFromThisWith: null,
isUsingPlaceholder: false
},
useClone: null
};
const idleWithoutAnimation = {
...idleWithAnimation,
shouldAnimatePlaceholder: false
};
const getDraggableRubric = (0,memoize_one__WEBPACK_IMPORTED_MODULE_5__["default"])(descriptor => ({
draggableId: descriptor.id,
type: descriptor.type,
source: {
index: descriptor.index,
droppableId: descriptor.droppableId
}
}));
const getMapProps = (0,memoize_one__WEBPACK_IMPORTED_MODULE_5__["default"])((id, isEnabled, isDraggingOverForConsumer, isDraggingOverForImpact, dragging, renderClone) => {
const draggableId = dragging.descriptor.id;
const isHome = dragging.descriptor.droppableId === id;
if (isHome) {
const useClone = renderClone ? {
render: renderClone,
dragging: getDraggableRubric(dragging.descriptor)
} : null;
const snapshot = {
isDraggingOver: isDraggingOverForConsumer,
draggingOverWith: isDraggingOverForConsumer ? draggableId : null,
draggingFromThisWith: draggableId,
isUsingPlaceholder: true
};
return {
placeholder: dragging.placeholder,
shouldAnimatePlaceholder: false,
snapshot,
useClone
};
}
if (!isEnabled) {
return idleWithoutAnimation;
}
if (!isDraggingOverForImpact) {
return idleWithAnimation;
}
const snapshot = {
isDraggingOver: isDraggingOverForConsumer,
draggingOverWith: draggableId,
draggingFromThisWith: null,
isUsingPlaceholder: true
};
return {
placeholder: dragging.placeholder,
shouldAnimatePlaceholder: true,
snapshot,
useClone: null
};
});
const selector = (state, ownProps) => {
const ownPropsWithDefaultProps = attachDefaultPropsToOwnProps(ownProps);
const id = ownPropsWithDefaultProps.droppableId;
const type = ownPropsWithDefaultProps.type;
const isEnabled = !ownPropsWithDefaultProps.isDropDisabled;
const renderClone = ownPropsWithDefaultProps.renderClone;
if (isDragging(state)) {
const critical = state.critical;
if (!isMatchingType(type, critical)) {
return idleWithoutAnimation;
}
const dragging = getDraggable(critical, state.dimensions);
const isDraggingOver = whatIsDraggedOver(state.impact) === id;
return getMapProps(id, isEnabled, isDraggingOver, isDraggingOver, dragging, renderClone);
}
if (state.phase === 'DROP_ANIMATING') {
const completed = state.completed;
if (!isMatchingType(type, completed.critical)) {
return idleWithoutAnimation;
}
const dragging = getDraggable(completed.critical, state.dimensions);
return getMapProps(id, isEnabled, whatIsDraggedOverFromResult(completed.result) === id, whatIsDraggedOver(completed.impact) === id, dragging, renderClone);
}
if (state.phase === 'IDLE' && state.completed && !state.shouldFlush) {
const completed = state.completed;
if (!isMatchingType(type, completed.critical)) {
return idleWithoutAnimation;
}
const wasOver = whatIsDraggedOver(completed.impact) === id;
const wasCombining = Boolean(completed.impact.at && completed.impact.at.type === 'COMBINE');
const isHome = completed.critical.droppable.id === id;
if (wasOver) {
return wasCombining ? idleWithAnimation : idleWithoutAnimation;
}
if (isHome) {
return idleWithAnimation;
}
return idleWithoutAnimation;
}
return idleWithoutAnimation;
};
return selector;
};
const mapDispatchToProps = {
updateViewportMaxScroll: updateViewportMaxScroll
};
const ConnectedDroppable = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.connect)(makeMapStateToProps, mapDispatchToProps, (stateProps, dispatchProps, ownProps) => {
return {
...attachDefaultPropsToOwnProps(ownProps),
...stateProps,
...dispatchProps
};
}, {
context: StoreContext,
areStatePropsEqual: isStrictEqual
})(Droppable$1);
var ConnectedDroppable$1 = ConnectedDroppable;
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/memoize-one/dist/memoize-one.esm.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/memoize-one/dist/memoize-one.esm.js ***!
\*****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ memoizeOne)
/* harmony export */ });
var safeIsNaN = Number.isNaN ||
function ponyfill(value) {
return typeof value === 'number' && value !== value;
};
function isEqual(first, second) {
if (first === second) {
return true;
}
if (safeIsNaN(first) && safeIsNaN(second)) {
return true;
}
return false;
}
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (!isEqual(newInputs[i], lastInputs[i])) {
return false;
}
}
return true;
}
function memoizeOne(resultFn, isEqual) {
if (isEqual === void 0) { isEqual = areInputsEqual; }
var cache = null;
function memoized() {
var newArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
newArgs[_i] = arguments[_i];
}
if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {
return cache.lastResult;
}
var lastResult = resultFn.apply(this, newArgs);
cache = {
lastResult: lastResult,
lastArgs: newArgs,
lastThis: this,
};
return lastResult;
}
memoized.clear = function clear() {
cache = null;
};
return memoized;
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-is/cjs/react-is.development.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-is/cjs/react-is.development.js ***!
\******************************************************************************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
/**
* @license React
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (true) {
(function() {
'use strict';
// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types.
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
var REACT_MEMO_TYPE = Symbol.for('react.memo');
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
// -----------------------------------------------------------------------------
var enableScopeAPI = false; // Experimental Create Event Handle API.
var enableCacheElement = false;
var enableTransitionTracing = false; // No known bugs, but needs performance testing
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
// stuff. Intended to enable React core members to more easily debug scheduling
// issues in DEV builds.
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
var REACT_MODULE_REFERENCE;
{
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
}
function isValidElementType(type) {
if (typeof type === 'string' || typeof type === 'function') {
return true;
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
return true;
}
if (typeof type === 'object' && type !== null) {
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
return true;
}
}
return false;
}
function typeOf(object) {
if (typeof object === 'object' && object !== null) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
var type = object.type;
switch (type) {
case REACT_FRAGMENT_TYPE:
case REACT_PROFILER_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_SUSPENSE_TYPE:
case REACT_SUSPENSE_LIST_TYPE:
return type;
default:
var $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case REACT_SERVER_CONTEXT_TYPE:
case REACT_CONTEXT_TYPE:
case REACT_FORWARD_REF_TYPE:
case REACT_LAZY_TYPE:
case REACT_MEMO_TYPE:
case REACT_PROVIDER_TYPE:
return $$typeofType;
default:
return $$typeof;
}
}
case REACT_PORTAL_TYPE:
return $$typeof;
}
}
return undefined;
}
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false;
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
function isAsyncMode(object) {
{
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
}
}
return false;
}
function isConcurrentMode(object) {
{
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
}
}
return false;
}
function isContextConsumer(object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
function isSuspenseList(object) {
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
}
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.SuspenseList = SuspenseList;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isSuspenseList = isSuspenseList;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
})();
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-is/index.js":
/*!***********************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-is/index.js ***!
\***********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
if (false) {} else {
module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/@hello-pangea/dnd/node_modules/react-is/cjs/react-is.development.js");
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js ***!
\******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ReactReduxContext: () => (/* binding */ ReactReduxContext),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
const ContextKey = Symbol.for(`react-redux-context`);
const gT = typeof globalThis !== "undefined" ? globalThis :
/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
{};
function getContext() {
var _gT$ContextKey;
if (!react__WEBPACK_IMPORTED_MODULE_0__.createContext) return {};
const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map();
let realContext = contextMap.get(react__WEBPACK_IMPORTED_MODULE_0__.createContext);
if (!realContext) {
realContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
if (true) {
realContext.displayName = 'ReactRedux';
}
contextMap.set(react__WEBPACK_IMPORTED_MODULE_0__.createContext, realContext);
}
return realContext;
}
const ReactReduxContext = /*#__PURE__*/getContext();
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReactReduxContext);
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Provider.js":
/*!*******************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Provider.js ***!
\*******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Context */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js");
/* harmony import */ var _utils_Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/Subscription */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/Subscription.js");
/* harmony import */ var _utils_useIsomorphicLayoutEffect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/useIsomorphicLayoutEffect */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js");
function Provider({
store,
context,
children,
serverState,
stabilityCheck = 'once',
noopCheck = 'once'
}) {
const contextValue = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
const subscription = (0,_utils_Subscription__WEBPACK_IMPORTED_MODULE_2__.createSubscription)(store);
return {
store,
subscription,
getServerState: serverState ? () => serverState : undefined,
stabilityCheck,
noopCheck
};
}, [store, serverState, stabilityCheck, noopCheck]);
const previousState = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => store.getState(), [store]);
(0,_utils_useIsomorphicLayoutEffect__WEBPACK_IMPORTED_MODULE_3__.useIsomorphicLayoutEffect)(() => {
const {
subscription
} = contextValue;
subscription.onStateChange = subscription.notifyNestedSubs;
subscription.trySubscribe();
if (previousState !== store.getState()) {
subscription.notifyNestedSubs();
}
return () => {
subscription.tryUnsubscribe();
subscription.onStateChange = undefined;
};
}, [contextValue, previousState]);
const Context = context || _Context__WEBPACK_IMPORTED_MODULE_1__.ReactReduxContext; // @ts-ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Context.Provider, {
value: contextValue
}, children);
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Provider);
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/connect.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/connect.js ***!
\******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */ initializeConnect: () => (/* binding */ initializeConnect)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js");
/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-is */ "./node_modules/@hello-pangea/dnd/node_modules/react-is/index.js");
/* harmony import */ var _connect_selectorFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../connect/selectorFactory */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/selectorFactory.js");
/* harmony import */ var _connect_mapDispatchToProps__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../connect/mapDispatchToProps */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mapDispatchToProps.js");
/* harmony import */ var _connect_mapStateToProps__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../connect/mapStateToProps */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mapStateToProps.js");
/* harmony import */ var _connect_mergeProps__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../connect/mergeProps */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mergeProps.js");
/* harmony import */ var _utils_Subscription__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/Subscription */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/Subscription.js");
/* harmony import */ var _utils_useIsomorphicLayoutEffect__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/useIsomorphicLayoutEffect */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js");
/* harmony import */ var _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/shallowEqual */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/shallowEqual.js");
/* harmony import */ var _utils_warning__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/warning */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/warning.js");
/* harmony import */ var _Context__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Context */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js");
/* harmony import */ var _utils_useSyncExternalStore__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/useSyncExternalStore */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/useSyncExternalStore.js");
const _excluded = ["reactReduxForwardedRef"];
/* eslint-disable valid-jsdoc, @typescript-eslint/no-unused-vars */
let useSyncExternalStore = _utils_useSyncExternalStore__WEBPACK_IMPORTED_MODULE_14__.notInitialized;
const initializeConnect = fn => {
useSyncExternalStore = fn;
}; // Define some constant arrays just to avoid re-creating these
const EMPTY_ARRAY = [null, 0];
const NO_SUBSCRIPTION_ARRAY = [null, null]; // Attempts to stringify whatever not-really-a-component value we were given
// for logging in an error message
const stringifyComponent = Comp => {
try {
return JSON.stringify(Comp);
} catch (err) {
return String(Comp);
}
};
// This is "just" a `useLayoutEffect`, but with two modifications:
// - we need to fall back to `useEffect` in SSR to avoid annoying warnings
// - we extract this to a separate function to avoid closing over values
// and causing memory leaks
function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {
(0,_utils_useIsomorphicLayoutEffect__WEBPACK_IMPORTED_MODULE_10__.useIsomorphicLayoutEffect)(() => effectFunc(...effectArgs), dependencies);
} // Effect callback, extracted: assign the latest props values to refs for later usage
function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, // actualChildProps: unknown,
childPropsFromStoreUpdate, notifyNestedSubs) {
// We want to capture the wrapper props and child props we used for later comparisons
lastWrapperProps.current = wrapperProps;
renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update
if (childPropsFromStoreUpdate.current) {
childPropsFromStoreUpdate.current = null;
notifyNestedSubs();
}
} // Effect callback, extracted: subscribe to the Redux store or nearest connected ancestor,
// check for updates after dispatched actions, and trigger re-renders.
function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, // forceComponentUpdateDispatch: React.Dispatch,
additionalSubscribeListener) {
// If we're not subscribed to the store, nothing to do here
if (!shouldHandleStateChanges) return () => {}; // Capture values for checking if and when this component unmounts
let didUnsubscribe = false;
let lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component
const checkForUpdates = () => {
if (didUnsubscribe || !isMounted.current) {
// Don't run stale listeners.
// Redux doesn't guarantee unsubscriptions happen until next dispatch.
return;
} // TODO We're currently calling getState ourselves here, rather than letting `uSES` do it
const latestStoreState = store.getState();
let newChildProps, error;
try {
// Actually run the selector with the most recent store state and wrapper props
// to determine what the child props should be
newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);
} catch (e) {
error = e;
lastThrownError = e;
}
if (!error) {
lastThrownError = null;
} // If the child props haven't changed, nothing to do here - cascade the subscription update
if (newChildProps === lastChildProps.current) {
if (!renderIsScheduled.current) {
notifyNestedSubs();
}
} else {
// Save references to the new child props. Note that we track the "child props from store update"
// as a ref instead of a useState/useReducer because we need a way to determine if that value has
// been processed. If this went into useState/useReducer, we couldn't clear out the value without
// forcing another re-render, which we don't want.
lastChildProps.current = newChildProps;
childPropsFromStoreUpdate.current = newChildProps;
renderIsScheduled.current = true; // TODO This is hacky and not how `uSES` is meant to be used
// Trigger the React `useSyncExternalStore` subscriber
additionalSubscribeListener();
}
}; // Actually subscribe to the nearest connected ancestor (or store)
subscription.onStateChange = checkForUpdates;
subscription.trySubscribe(); // Pull data from the store after first render in case the store has
// changed since we began.
checkForUpdates();
const unsubscribeWrapper = () => {
didUnsubscribe = true;
subscription.tryUnsubscribe();
subscription.onStateChange = null;
if (lastThrownError) {
// It's possible that we caught an error due to a bad mapState function, but the
// parent re-rendered without this component and we're about to unmount.
// This shouldn't happen as long as we do top-down subscriptions correctly, but
// if we ever do those wrong, this throw will surface the error in our tests.
// In that case, throw the error from here so it doesn't get lost.
throw lastThrownError;
}
};
return unsubscribeWrapper;
} // Reducer initial state creation for our update reducer
const initStateUpdates = () => EMPTY_ARRAY;
function strictEqual(a, b) {
return a === b;
}
/**
* Infers the type of props that a connector will inject into a component.
*/
let hasWarnedAboutDeprecatedPureOption = false;
/**
* Connects a React component to a Redux store.
*
* - Without arguments, just wraps the component, without changing the behavior / props
*
* - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior
* is to override ownProps (as stated in the docs), so what remains is everything that's
* not a state or dispatch prop
*
* - When 3rd param is passed, we don't know if ownProps propagate and whether they
* should be valid component props, because it depends on mergeProps implementation.
* As such, it is the user's responsibility to extend ownProps interface from state or
* dispatch props or both when applicable
*
* @param mapStateToProps A function that extracts values from state
* @param mapDispatchToProps Setup for dispatching actions
* @param mergeProps Optional callback to merge state and dispatch props together
* @param options Options for configuring the connection
*
*/
function connect(mapStateToProps, mapDispatchToProps, mergeProps, {
// The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.
// @ts-ignore
pure,
areStatesEqual = strictEqual,
areOwnPropsEqual = _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_11__["default"],
areStatePropsEqual = _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_11__["default"],
areMergedPropsEqual = _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_11__["default"],
// use React's forwardRef to expose a ref of the wrapped component
forwardRef = false,
// the context consumer to use
context = _Context__WEBPACK_IMPORTED_MODULE_13__.ReactReduxContext
} = {}) {
if (true) {
if (pure !== undefined && !hasWarnedAboutDeprecatedPureOption) {
hasWarnedAboutDeprecatedPureOption = true;
(0,_utils_warning__WEBPACK_IMPORTED_MODULE_12__["default"])('The `pure` option has been removed. `connect` is now always a "pure/memoized" component');
}
}
const Context = context;
const initMapStateToProps = (0,_connect_mapStateToProps__WEBPACK_IMPORTED_MODULE_7__.mapStateToPropsFactory)(mapStateToProps);
const initMapDispatchToProps = (0,_connect_mapDispatchToProps__WEBPACK_IMPORTED_MODULE_6__.mapDispatchToPropsFactory)(mapDispatchToProps);
const initMergeProps = (0,_connect_mergeProps__WEBPACK_IMPORTED_MODULE_8__.mergePropsFactory)(mergeProps);
const shouldHandleStateChanges = Boolean(mapStateToProps);
const wrapWithConnect = WrappedComponent => {
if ( true && !(0,react_is__WEBPACK_IMPORTED_MODULE_4__.isValidElementType)(WrappedComponent)) {
throw new Error(`You must pass a component to the function returned by connect. Instead received ${stringifyComponent(WrappedComponent)}`);
}
const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
const displayName = `Connect(${wrappedComponentName})`;
const selectorFactoryOptions = {
shouldHandleStateChanges,
displayName,
wrappedComponentName,
WrappedComponent,
// @ts-ignore
initMapStateToProps,
// @ts-ignore
initMapDispatchToProps,
initMergeProps,
areStatesEqual,
areStatePropsEqual,
areOwnPropsEqual,
areMergedPropsEqual
};
function ConnectFunction(props) {
const [propsContext, reactReduxForwardedRef, wrapperProps] = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
// Distinguish between actual "data" props that were passed to the wrapper component,
// and values needed to control behavior (forwarded refs, alternate context instances).
// To maintain the wrapperProps object reference, memoize this destructuring.
const {
reactReduxForwardedRef
} = props,
wrapperProps = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, _excluded);
return [props.context, reactReduxForwardedRef, wrapperProps];
}, [props]);
const ContextToUse = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
// Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.
// Memoize the check that determines which context instance we should use.
return propsContext && propsContext.Consumer && // @ts-ignore
(0,react_is__WEBPACK_IMPORTED_MODULE_4__.isContextConsumer)( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(propsContext.Consumer, null)) ? propsContext : Context;
}, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available
const contextValue = react__WEBPACK_IMPORTED_MODULE_3__.useContext(ContextToUse); // The store _must_ exist as either a prop or in context.
// We'll check to see if it _looks_ like a Redux store first.
// This allows us to pass through a `store` prop that is just a plain value.
const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
if ( true && !didStoreComeFromProps && !didStoreComeFromContext) {
throw new Error(`Could not find "store" in the context of ` + `"${displayName}". Either wrap the root component in a , ` + `or pass a custom React context provider to and the corresponding ` + `React context consumer to ${displayName} in connect options.`);
} // Based on the previous check, one of these must be true
const store = didStoreComeFromProps ? props.store : contextValue.store;
const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;
const childPropsSelector = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
// The child props selector needs the store reference as an input.
// Re-create this selector whenever the store changes.
return (0,_connect_selectorFactory__WEBPACK_IMPORTED_MODULE_5__["default"])(store.dispatch, selectorFactoryOptions);
}, [store]);
const [subscription, notifyNestedSubs] = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component
// connected to the store via props shouldn't use subscription from context, or vice versa.
const subscription = (0,_utils_Subscription__WEBPACK_IMPORTED_MODULE_9__.createSubscription)(store, didStoreComeFromProps ? undefined : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
// the middle of the notification loop, where `subscription` will then be null. This can
// probably be avoided if Subscription's listeners logic is changed to not call listeners
// that have been unsubscribed in the middle of the notification loop.
const notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);
return [subscription, notifyNestedSubs];
}, [store, didStoreComeFromProps, contextValue]); // Determine what {store, subscription} value should be put into nested context, if necessary,
// and memoize that value to avoid unnecessary context updates.
const overriddenContextValue = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
if (didStoreComeFromProps) {
// This component is directly subscribed to a store from props.
// We don't want descendants reading from this store - pass down whatever
// the existing context value is from the nearest connected ancestor.
return contextValue;
} // Otherwise, put this component's subscription instance into context, so that
// connected descendants won't update until after this component is done
return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, contextValue, {
subscription
});
}, [didStoreComeFromProps, contextValue, subscription]); // Set up refs to coordinate values between the subscription effect and the render logic
const lastChildProps = react__WEBPACK_IMPORTED_MODULE_3__.useRef();
const lastWrapperProps = react__WEBPACK_IMPORTED_MODULE_3__.useRef(wrapperProps);
const childPropsFromStoreUpdate = react__WEBPACK_IMPORTED_MODULE_3__.useRef();
const renderIsScheduled = react__WEBPACK_IMPORTED_MODULE_3__.useRef(false);
const isProcessingDispatch = react__WEBPACK_IMPORTED_MODULE_3__.useRef(false);
const isMounted = react__WEBPACK_IMPORTED_MODULE_3__.useRef(false);
const latestSubscriptionCallbackError = react__WEBPACK_IMPORTED_MODULE_3__.useRef();
(0,_utils_useIsomorphicLayoutEffect__WEBPACK_IMPORTED_MODULE_10__.useIsomorphicLayoutEffect)(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
const actualChildPropsSelector = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
const selector = () => {
// Tricky logic here:
// - This render may have been triggered by a Redux store update that produced new child props
// - However, we may have gotten new wrapper props after that
// If we have new child props, and the same wrapper props, we know we should use the new child props as-is.
// But, if we have new wrapper props, those might change the child props, so we have to recalculate things.
// So, we'll use the child props from store update only if the wrapper props are the same as last time.
if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {
return childPropsFromStoreUpdate.current;
} // TODO We're reading the store directly in render() here. Bad idea?
// This will likely cause Bad Things (TM) to happen in Concurrent Mode.
// Note that we do this because on renders _not_ caused by store updates, we need the latest store state
// to determine what the child props should be.
return childPropsSelector(store.getState(), wrapperProps);
};
return selector;
}, [store, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns
// about useLayoutEffect in SSR, so we try to detect environment and fall back to
// just useEffect instead to avoid the warning, since neither will run anyway.
const subscribeForReact = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
const subscribe = reactListener => {
if (!subscription) {
return () => {};
}
return subscribeUpdates(shouldHandleStateChanges, store, subscription, // @ts-ignore
childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener);
};
return subscribe;
}, [subscription]);
useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs]);
let actualChildProps;
try {
actualChildProps = useSyncExternalStore( // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing
subscribeForReact, // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,
// TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.
actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector);
} catch (err) {
if (latestSubscriptionCallbackError.current) {
;
err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`;
}
throw err;
}
(0,_utils_useIsomorphicLayoutEffect__WEBPACK_IMPORTED_MODULE_10__.useIsomorphicLayoutEffect)(() => {
latestSubscriptionCallbackError.current = undefined;
childPropsFromStoreUpdate.current = undefined;
lastChildProps.current = actualChildProps;
}); // Now that all that's done, we can finally try to actually render the child component.
// We memoize the elements for the rendered child component as an optimization.
const renderedWrappedComponent = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
return (
/*#__PURE__*/
// @ts-ignore
react__WEBPACK_IMPORTED_MODULE_3__.createElement(WrappedComponent, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, actualChildProps, {
ref: reactReduxForwardedRef
}))
);
}, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.
const renderedChild = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
if (shouldHandleStateChanges) {
// If this component is subscribed to store updates, we need to pass its own
// subscription instance down to our descendants. That means rendering the same
// Context instance, and putting a different value into the context.
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(ContextToUse.Provider, {
value: overriddenContextValue
}, renderedWrappedComponent);
}
return renderedWrappedComponent;
}, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);
return renderedChild;
}
const _Connect = react__WEBPACK_IMPORTED_MODULE_3__.memo(ConnectFunction);
// Add a hacky cast to get the right output type
const Connect = _Connect;
Connect.WrappedComponent = WrappedComponent;
Connect.displayName = ConnectFunction.displayName = displayName;
if (forwardRef) {
const _forwarded = react__WEBPACK_IMPORTED_MODULE_3__.forwardRef(function forwardConnectRef(props, ref) {
// @ts-ignore
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(Connect, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
reactReduxForwardedRef: ref
}));
});
const forwarded = _forwarded;
forwarded.displayName = displayName;
forwarded.WrappedComponent = WrappedComponent;
return hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default()(forwarded, WrappedComponent);
}
return hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default()(Connect, WrappedComponent);
};
return wrapWithConnect;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (connect);
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/invalidArgFactory.js":
/*!*************************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/invalidArgFactory.js ***!
\*************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createInvalidArgFactory: () => (/* binding */ createInvalidArgFactory)
/* harmony export */ });
function createInvalidArgFactory(arg, name) {
return (dispatch, options) => {
throw new Error(`Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`);
};
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mapDispatchToProps.js":
/*!**************************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mapDispatchToProps.js ***!
\**************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ mapDispatchToPropsFactory: () => (/* binding */ mapDispatchToPropsFactory)
/* harmony export */ });
/* harmony import */ var _utils_bindActionCreators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/bindActionCreators */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/bindActionCreators.js");
/* harmony import */ var _wrapMapToProps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./wrapMapToProps */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/wrapMapToProps.js");
/* harmony import */ var _invalidArgFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./invalidArgFactory */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/invalidArgFactory.js");
function mapDispatchToPropsFactory(mapDispatchToProps) {
return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? (0,_wrapMapToProps__WEBPACK_IMPORTED_MODULE_1__.wrapMapToPropsConstant)(dispatch => // @ts-ignore
(0,_utils_bindActionCreators__WEBPACK_IMPORTED_MODULE_0__["default"])(mapDispatchToProps, dispatch)) : !mapDispatchToProps ? (0,_wrapMapToProps__WEBPACK_IMPORTED_MODULE_1__.wrapMapToPropsConstant)(dispatch => ({
dispatch
})) : typeof mapDispatchToProps === 'function' ? // @ts-ignore
(0,_wrapMapToProps__WEBPACK_IMPORTED_MODULE_1__.wrapMapToPropsFunc)(mapDispatchToProps, 'mapDispatchToProps') : (0,_invalidArgFactory__WEBPACK_IMPORTED_MODULE_2__.createInvalidArgFactory)(mapDispatchToProps, 'mapDispatchToProps');
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mapStateToProps.js":
/*!***********************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mapStateToProps.js ***!
\***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ mapStateToPropsFactory: () => (/* binding */ mapStateToPropsFactory)
/* harmony export */ });
/* harmony import */ var _wrapMapToProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapMapToProps */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/wrapMapToProps.js");
/* harmony import */ var _invalidArgFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./invalidArgFactory */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/invalidArgFactory.js");
function mapStateToPropsFactory(mapStateToProps) {
return !mapStateToProps ? (0,_wrapMapToProps__WEBPACK_IMPORTED_MODULE_0__.wrapMapToPropsConstant)(() => ({})) : typeof mapStateToProps === 'function' ? // @ts-ignore
(0,_wrapMapToProps__WEBPACK_IMPORTED_MODULE_0__.wrapMapToPropsFunc)(mapStateToProps, 'mapStateToProps') : (0,_invalidArgFactory__WEBPACK_IMPORTED_MODULE_1__.createInvalidArgFactory)(mapStateToProps, 'mapStateToProps');
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mergeProps.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/mergeProps.js ***!
\******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ defaultMergeProps: () => (/* binding */ defaultMergeProps),
/* harmony export */ mergePropsFactory: () => (/* binding */ mergePropsFactory),
/* harmony export */ wrapMergePropsFunc: () => (/* binding */ wrapMergePropsFunc)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/verifyPlainObject */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/verifyPlainObject.js");
/* harmony import */ var _invalidArgFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./invalidArgFactory */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/invalidArgFactory.js");
function defaultMergeProps(stateProps, dispatchProps, ownProps) {
// @ts-ignore
return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, ownProps, stateProps, dispatchProps);
}
function wrapMergePropsFunc(mergeProps) {
return function initMergePropsProxy(dispatch, {
displayName,
areMergedPropsEqual
}) {
let hasRunOnce = false;
let mergedProps;
return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
if (hasRunOnce) {
if (!areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
} else {
hasRunOnce = true;
mergedProps = nextMergedProps;
if (true) (0,_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_1__["default"])(mergedProps, displayName, 'mergeProps');
}
return mergedProps;
};
};
}
function mergePropsFactory(mergeProps) {
return !mergeProps ? () => defaultMergeProps : typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : (0,_invalidArgFactory__WEBPACK_IMPORTED_MODULE_2__.createInvalidArgFactory)(mergeProps, 'mergeProps');
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/selectorFactory.js":
/*!***********************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/selectorFactory.js ***!
\***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ finalPropsSelectorFactory),
/* harmony export */ pureFinalPropsSelectorFactory: () => (/* binding */ pureFinalPropsSelectorFactory)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
/* harmony import */ var _verifySubselectors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./verifySubselectors */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/verifySubselectors.js");
const _excluded = ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"];
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, {
areStatesEqual,
areOwnPropsEqual,
areStatePropsEqual
}) {
let hasRunAtLeastOnce = false;
let state;
let ownProps;
let stateProps;
let dispatchProps;
let mergedProps;
function handleFirstCall(firstState, firstOwnProps) {
state = firstState;
ownProps = firstOwnProps;
stateProps = mapStateToProps(state, ownProps);
dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
hasRunAtLeastOnce = true;
return mergedProps;
}
function handleNewPropsAndNewState() {
stateProps = mapStateToProps(state, ownProps);
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleNewProps() {
if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleNewState() {
const nextStateProps = mapStateToProps(state, ownProps);
const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
stateProps = nextStateProps;
if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleSubsequentCalls(nextState, nextOwnProps) {
const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
const stateChanged = !areStatesEqual(nextState, state, nextOwnProps, ownProps);
state = nextState;
ownProps = nextOwnProps;
if (propsChanged && stateChanged) return handleNewPropsAndNewState();
if (propsChanged) return handleNewProps();
if (stateChanged) return handleNewState();
return mergedProps;
}
return function pureFinalPropsSelector(nextState, nextOwnProps) {
return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
};
}
// TODO: Add more comments
// The selector returned by selectorFactory will memoize its results,
// allowing connect's shouldComponentUpdate to return false if final
// props have not changed.
function finalPropsSelectorFactory(dispatch, _ref) {
let {
initMapStateToProps,
initMapDispatchToProps,
initMergeProps
} = _ref,
options = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _excluded);
const mapStateToProps = initMapStateToProps(dispatch, options);
const mapDispatchToProps = initMapDispatchToProps(dispatch, options);
const mergeProps = initMergeProps(dispatch, options);
if (true) {
(0,_verifySubselectors__WEBPACK_IMPORTED_MODULE_1__["default"])(mapStateToProps, mapDispatchToProps, mergeProps);
}
return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/verifySubselectors.js":
/*!**************************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/verifySubselectors.js ***!
\**************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ verifySubselectors)
/* harmony export */ });
/* harmony import */ var _utils_warning__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/warning */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/warning.js");
function verify(selector, methodName) {
if (!selector) {
throw new Error(`Unexpected value for ${methodName} in connect.`);
} else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) {
(0,_utils_warning__WEBPACK_IMPORTED_MODULE_0__["default"])(`The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`);
}
}
}
function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) {
verify(mapStateToProps, 'mapStateToProps');
verify(mapDispatchToProps, 'mapDispatchToProps');
verify(mergeProps, 'mergeProps');
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/wrapMapToProps.js":
/*!**********************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/connect/wrapMapToProps.js ***!
\**********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ getDependsOnOwnProps: () => (/* binding */ getDependsOnOwnProps),
/* harmony export */ wrapMapToPropsConstant: () => (/* binding */ wrapMapToPropsConstant),
/* harmony export */ wrapMapToPropsFunc: () => (/* binding */ wrapMapToPropsFunc)
/* harmony export */ });
/* harmony import */ var _utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/verifyPlainObject */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/verifyPlainObject.js");
function wrapMapToPropsConstant( // * Note:
// It seems that the dispatch argument
// could be a dispatch function in some cases (ex: whenMapDispatchToPropsIsMissing)
// and a state object in some others (ex: whenMapStateToPropsIsMissing)
// eslint-disable-next-line no-unused-vars
getConstant) {
return function initConstantSelector(dispatch) {
const constant = getConstant(dispatch);
function constantSelector() {
return constant;
}
constantSelector.dependsOnOwnProps = false;
return constantSelector;
};
} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
// whether mapToProps needs to be invoked when props have changed.
//
// A length of one signals that mapToProps does not depend on props from the parent component.
// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
// therefore not reporting its length accurately..
// TODO Can this get pulled out so that we can subscribe directly to the store if we don't need ownProps?
function getDependsOnOwnProps(mapToProps) {
return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
// this function wraps mapToProps in a proxy function which does several things:
//
// * Detects whether the mapToProps function being called depends on props, which
// is used by selectorFactory to decide if it should reinvoke on props changes.
//
// * On first call, handles mapToProps if returns another function, and treats that
// new function as the true mapToProps for subsequent calls.
//
// * On first call, verifies the first result is a plain object, in order to warn
// the developer that their mapToProps function is not returning a valid result.
//
function wrapMapToPropsFunc(mapToProps, methodName) {
return function initProxySelector(dispatch, {
displayName
}) {
const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, undefined);
}; // allow detectFactoryAndVerify to get ownProps
proxy.dependsOnOwnProps = true;
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
proxy.mapToProps = mapToProps;
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
let props = proxy(stateOrDispatch, ownProps);
if (typeof props === 'function') {
proxy.mapToProps = props;
proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
props = proxy(stateOrDispatch, ownProps);
}
if (true) (0,_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__["default"])(props, displayName, methodName);
return props;
};
return proxy;
};
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/exports.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/exports.js ***!
\*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Provider: () => (/* reexport safe */ _components_Provider__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */ ReactReduxContext: () => (/* reexport safe */ _components_Context__WEBPACK_IMPORTED_MODULE_2__.ReactReduxContext),
/* harmony export */ connect: () => (/* reexport safe */ _components_connect__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */ createDispatchHook: () => (/* reexport safe */ _hooks_useDispatch__WEBPACK_IMPORTED_MODULE_3__.createDispatchHook),
/* harmony export */ createSelectorHook: () => (/* reexport safe */ _hooks_useSelector__WEBPACK_IMPORTED_MODULE_4__.createSelectorHook),
/* harmony export */ createStoreHook: () => (/* reexport safe */ _hooks_useStore__WEBPACK_IMPORTED_MODULE_5__.createStoreHook),
/* harmony export */ shallowEqual: () => (/* reexport safe */ _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */ useDispatch: () => (/* reexport safe */ _hooks_useDispatch__WEBPACK_IMPORTED_MODULE_3__.useDispatch),
/* harmony export */ useSelector: () => (/* reexport safe */ _hooks_useSelector__WEBPACK_IMPORTED_MODULE_4__.useSelector),
/* harmony export */ useStore: () => (/* reexport safe */ _hooks_useStore__WEBPACK_IMPORTED_MODULE_5__.useStore)
/* harmony export */ });
/* harmony import */ var _components_Provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/Provider */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Provider.js");
/* harmony import */ var _components_connect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/connect */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/connect.js");
/* harmony import */ var _components_Context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/Context */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js");
/* harmony import */ var _hooks_useDispatch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hooks/useDispatch */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useDispatch.js");
/* harmony import */ var _hooks_useSelector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useSelector */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useSelector.js");
/* harmony import */ var _hooks_useStore__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useStore */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useStore.js");
/* harmony import */ var _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/shallowEqual */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/shallowEqual.js");
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./types */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/types.js");
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useDispatch.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useDispatch.js ***!
\*****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createDispatchHook: () => (/* binding */ createDispatchHook),
/* harmony export */ useDispatch: () => (/* binding */ useDispatch)
/* harmony export */ });
/* harmony import */ var _components_Context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/Context */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js");
/* harmony import */ var _useStore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useStore */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useStore.js");
/**
* Hook factory, which creates a `useDispatch` hook bound to a given context.
*
* @param {React.Context} [context=ReactReduxContext] Context passed to your ``.
* @returns {Function} A `useDispatch` hook bound to the specified context.
*/
function createDispatchHook(context = _components_Context__WEBPACK_IMPORTED_MODULE_0__.ReactReduxContext) {
const useStore = // @ts-ignore
context === _components_Context__WEBPACK_IMPORTED_MODULE_0__.ReactReduxContext ? _useStore__WEBPACK_IMPORTED_MODULE_1__.useStore : (0,_useStore__WEBPACK_IMPORTED_MODULE_1__.createStoreHook)(context);
return function useDispatch() {
const store = useStore(); // @ts-ignore
return store.dispatch;
};
}
/**
* A hook to access the redux `dispatch` function.
*
* @returns {any|function} redux store's `dispatch` function
*
* @example
*
* import React, { useCallback } from 'react'
* import { useDispatch } from 'react-redux'
*
* export const CounterComponent = ({ value }) => {
* const dispatch = useDispatch()
* const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
* return (
*
* {value}
*
*
* )
* }
*/
const useDispatch = /*#__PURE__*/createDispatchHook();
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useReduxContext.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useReduxContext.js ***!
\*********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createReduxContextHook: () => (/* binding */ createReduxContextHook),
/* harmony export */ useReduxContext: () => (/* binding */ useReduxContext)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_Context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/Context */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js");
/**
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
* hook that you should usually not need to call directly.
*
* @param {React.Context} [context=ReactReduxContext] Context passed to your ``.
* @returns {Function} A `useReduxContext` hook bound to the specified context.
*/
function createReduxContextHook(context = _components_Context__WEBPACK_IMPORTED_MODULE_1__.ReactReduxContext) {
return function useReduxContext() {
const contextValue = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(context);
if ( true && !contextValue) {
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a ');
}
return contextValue;
};
}
/**
* A hook to access the value of the `ReactReduxContext`. This is a low-level
* hook that you should usually not need to call directly.
*
* @returns {any} the value of the `ReactReduxContext`
*
* @example
*
* import React from 'react'
* import { useReduxContext } from 'react-redux'
*
* export const CounterComponent = () => {
* const { store } = useReduxContext()
* return
{store.getState()}
* }
*/
const useReduxContext = /*#__PURE__*/createReduxContextHook();
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useSelector.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useSelector.js ***!
\*****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createSelectorHook: () => (/* binding */ createSelectorHook),
/* harmony export */ initializeUseSelector: () => (/* binding */ initializeUseSelector),
/* harmony export */ useSelector: () => (/* binding */ useSelector)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _useReduxContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useReduxContext */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useReduxContext.js");
/* harmony import */ var _components_Context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/Context */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js");
/* harmony import */ var _utils_useSyncExternalStore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/useSyncExternalStore */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/useSyncExternalStore.js");
let useSyncExternalStoreWithSelector = _utils_useSyncExternalStore__WEBPACK_IMPORTED_MODULE_3__.notInitialized;
const initializeUseSelector = fn => {
useSyncExternalStoreWithSelector = fn;
};
const refEquality = (a, b) => a === b;
/**
* Hook factory, which creates a `useSelector` hook bound to a given context.
*
* @param {React.Context} [context=ReactReduxContext] Context passed to your ``.
* @returns {Function} A `useSelector` hook bound to the specified context.
*/
function createSelectorHook(context = _components_Context__WEBPACK_IMPORTED_MODULE_2__.ReactReduxContext) {
const useReduxContext = context === _components_Context__WEBPACK_IMPORTED_MODULE_2__.ReactReduxContext ? _useReduxContext__WEBPACK_IMPORTED_MODULE_1__.useReduxContext : (0,_useReduxContext__WEBPACK_IMPORTED_MODULE_1__.createReduxContextHook)(context);
return function useSelector(selector, equalityFnOrOptions = {}) {
const {
equalityFn = refEquality,
stabilityCheck = undefined,
noopCheck = undefined
} = typeof equalityFnOrOptions === 'function' ? {
equalityFn: equalityFnOrOptions
} : equalityFnOrOptions;
if (true) {
if (!selector) {
throw new Error(`You must pass a selector to useSelector`);
}
if (typeof selector !== 'function') {
throw new Error(`You must pass a function as a selector to useSelector`);
}
if (typeof equalityFn !== 'function') {
throw new Error(`You must pass a function as an equality function to useSelector`);
}
}
const {
store,
subscription,
getServerState,
stabilityCheck: globalStabilityCheck,
noopCheck: globalNoopCheck
} = useReduxContext();
const firstRun = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(true);
const wrappedSelector = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)({
[selector.name](state) {
const selected = selector(state);
if (true) {
const finalStabilityCheck = typeof stabilityCheck === 'undefined' ? globalStabilityCheck : stabilityCheck;
if (finalStabilityCheck === 'always' || finalStabilityCheck === 'once' && firstRun.current) {
const toCompare = selector(state);
if (!equalityFn(selected, toCompare)) {
let stack = undefined;
try {
throw new Error();
} catch (e) {
;
({
stack
} = e);
}
console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', {
state,
selected,
selected2: toCompare,
stack
});
}
}
const finalNoopCheck = typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck;
if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) {
// @ts-ignore
if (selected === state) {
let stack = undefined;
try {
throw new Error();
} catch (e) {
;
({
stack
} = e);
}
console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', {
stack
});
}
}
if (firstRun.current) firstRun.current = false;
}
return selected;
}
}[selector.name], [selector, globalStabilityCheck, stabilityCheck]);
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useDebugValue)(selectedState);
return selectedState;
};
}
/**
* A hook to access the redux store's state. This hook takes a selector function
* as an argument. The selector is called with the store state.
*
* This hook takes an optional equality comparison function as the second parameter
* that allows you to customize the way the selected state is compared to determine
* whether the component needs to be re-rendered.
*
* @param {Function} selector the selector function
* @param {Function=} equalityFn the function that will be used to determine equality
*
* @returns {any} the selected state
*
* @example
*
* import React from 'react'
* import { useSelector } from 'react-redux'
*
* export const CounterComponent = () => {
* const counter = useSelector(state => state.counter)
* return
{counter}
* }
*/
const useSelector = /*#__PURE__*/createSelectorHook();
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useStore.js":
/*!**************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useStore.js ***!
\**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createStoreHook: () => (/* binding */ createStoreHook),
/* harmony export */ useStore: () => (/* binding */ useStore)
/* harmony export */ });
/* harmony import */ var _components_Context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/Context */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/Context.js");
/* harmony import */ var _useReduxContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useReduxContext */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useReduxContext.js");
/**
* Hook factory, which creates a `useStore` hook bound to a given context.
*
* @param {React.Context} [context=ReactReduxContext] Context passed to your ``.
* @returns {Function} A `useStore` hook bound to the specified context.
*/
function createStoreHook(context = _components_Context__WEBPACK_IMPORTED_MODULE_0__.ReactReduxContext) {
const useReduxContext = // @ts-ignore
context === _components_Context__WEBPACK_IMPORTED_MODULE_0__.ReactReduxContext ? _useReduxContext__WEBPACK_IMPORTED_MODULE_1__.useReduxContext : // @ts-ignore
(0,_useReduxContext__WEBPACK_IMPORTED_MODULE_1__.createReduxContextHook)(context);
return function useStore() {
const {
store
} = useReduxContext(); // @ts-ignore
return store;
};
}
/**
* A hook to access the redux store.
*
* @returns {any} the redux store
*
* @example
*
* import React from 'react'
* import { useStore } from 'react-redux'
*
* export const ExampleComponent = () => {
* const store = useStore()
* return
{store.getState()}
* }
*/
const useStore = /*#__PURE__*/createStoreHook();
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/index.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/index.js ***!
\*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Provider: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.Provider),
/* harmony export */ ReactReduxContext: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.ReactReduxContext),
/* harmony export */ batch: () => (/* reexport safe */ _utils_reactBatchedUpdates__WEBPACK_IMPORTED_MODULE_2__.unstable_batchedUpdates),
/* harmony export */ connect: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.connect),
/* harmony export */ createDispatchHook: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.createDispatchHook),
/* harmony export */ createSelectorHook: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.createSelectorHook),
/* harmony export */ createStoreHook: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.createStoreHook),
/* harmony export */ shallowEqual: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.shallowEqual),
/* harmony export */ useDispatch: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.useDispatch),
/* harmony export */ useSelector: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.useSelector),
/* harmony export */ useStore: () => (/* reexport safe */ _exports__WEBPACK_IMPORTED_MODULE_6__.useStore)
/* harmony export */ });
/* harmony import */ var use_sync_external_store_shim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! use-sync-external-store/shim */ "./node_modules/use-sync-external-store/shim/index.js");
/* harmony import */ var use_sync_external_store_shim_with_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! use-sync-external-store/shim/with-selector */ "./node_modules/use-sync-external-store/shim/with-selector.js");
/* harmony import */ var _utils_reactBatchedUpdates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/reactBatchedUpdates */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/reactBatchedUpdates.js");
/* harmony import */ var _utils_batch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/batch */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/batch.js");
/* harmony import */ var _hooks_useSelector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useSelector */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/hooks/useSelector.js");
/* harmony import */ var _components_connect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/connect */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/components/connect.js");
/* harmony import */ var _exports__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./exports */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/exports.js");
// The primary entry point assumes we're working with standard ReactDOM/RN, but
// older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).
// Because of that, the useSyncExternalStore compat shim is needed.
(0,_hooks_useSelector__WEBPACK_IMPORTED_MODULE_4__.initializeUseSelector)(use_sync_external_store_shim_with_selector__WEBPACK_IMPORTED_MODULE_1__.useSyncExternalStoreWithSelector);
(0,_components_connect__WEBPACK_IMPORTED_MODULE_5__.initializeConnect)(use_sync_external_store_shim__WEBPACK_IMPORTED_MODULE_0__.useSyncExternalStore); // Enable batched updates in our subscriptions for use
// with standard React renderers (ReactDOM, React Native)
(0,_utils_batch__WEBPACK_IMPORTED_MODULE_3__.setBatch)(_utils_reactBatchedUpdates__WEBPACK_IMPORTED_MODULE_2__.unstable_batchedUpdates);
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/types.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/types.js ***!
\*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/Subscription.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/Subscription.js ***!
\******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createSubscription: () => (/* binding */ createSubscription)
/* harmony export */ });
/* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./batch */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/batch.js");
// encapsulates the subscription logic for connecting a component to the redux store, as
// well as nesting subscriptions of descendant components, so that we can ensure the
// ancestor components re-render before descendants
function createListenerCollection() {
const batch = (0,_batch__WEBPACK_IMPORTED_MODULE_0__.getBatch)();
let first = null;
let last = null;
return {
clear() {
first = null;
last = null;
},
notify() {
batch(() => {
let listener = first;
while (listener) {
listener.callback();
listener = listener.next;
}
});
},
get() {
let listeners = [];
let listener = first;
while (listener) {
listeners.push(listener);
listener = listener.next;
}
return listeners;
},
subscribe(callback) {
let isSubscribed = true;
let listener = last = {
callback,
next: null,
prev: last
};
if (listener.prev) {
listener.prev.next = listener;
} else {
first = listener;
}
return function unsubscribe() {
if (!isSubscribed || first === null) return;
isSubscribed = false;
if (listener.next) {
listener.next.prev = listener.prev;
} else {
last = listener.prev;
}
if (listener.prev) {
listener.prev.next = listener.next;
} else {
first = listener.next;
}
};
}
};
}
const nullListeners = {
notify() {},
get: () => []
};
function createSubscription(store, parentSub) {
let unsubscribe;
let listeners = nullListeners; // Reasons to keep the subscription active
let subscriptionsAmount = 0; // Is this specific subscription subscribed (or only nested ones?)
let selfSubscribed = false;
function addNestedSub(listener) {
trySubscribe();
const cleanupListener = listeners.subscribe(listener); // cleanup nested sub
let removed = false;
return () => {
if (!removed) {
removed = true;
cleanupListener();
tryUnsubscribe();
}
};
}
function notifyNestedSubs() {
listeners.notify();
}
function handleChangeWrapper() {
if (subscription.onStateChange) {
subscription.onStateChange();
}
}
function isSubscribed() {
return selfSubscribed;
}
function trySubscribe() {
subscriptionsAmount++;
if (!unsubscribe) {
unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);
listeners = createListenerCollection();
}
}
function tryUnsubscribe() {
subscriptionsAmount--;
if (unsubscribe && subscriptionsAmount === 0) {
unsubscribe();
unsubscribe = undefined;
listeners.clear();
listeners = nullListeners;
}
}
function trySubscribeSelf() {
if (!selfSubscribed) {
selfSubscribed = true;
trySubscribe();
}
}
function tryUnsubscribeSelf() {
if (selfSubscribed) {
selfSubscribed = false;
tryUnsubscribe();
}
}
const subscription = {
addNestedSub,
notifyNestedSubs,
handleChangeWrapper,
isSubscribed,
trySubscribe: trySubscribeSelf,
tryUnsubscribe: tryUnsubscribeSelf,
getListeners: () => listeners
};
return subscription;
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/batch.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/batch.js ***!
\***********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ getBatch: () => (/* binding */ getBatch),
/* harmony export */ setBatch: () => (/* binding */ setBatch)
/* harmony export */ });
// Default to a dummy "batch" implementation that just runs the callback
function defaultNoopBatch(callback) {
callback();
}
let batch = defaultNoopBatch; // Allow injecting another batching function later
const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip dealing with ESM bindings
const getBatch = () => batch;
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/bindActionCreators.js":
/*!************************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/bindActionCreators.js ***!
\************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ bindActionCreators)
/* harmony export */ });
function bindActionCreators(actionCreators, dispatch) {
const boundActionCreators = {};
for (const key in actionCreators) {
const actionCreator = actionCreators[key];
if (typeof actionCreator === 'function') {
boundActionCreators[key] = (...args) => dispatch(actionCreator(...args));
}
}
return boundActionCreators;
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/isPlainObject.js":
/*!*******************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/isPlainObject.js ***!
\*******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ isPlainObject)
/* harmony export */ });
/**
* @param {any} obj The object to inspect.
* @returns {boolean} True if the argument appears to be a plain object.
*/
function isPlainObject(obj) {
if (typeof obj !== 'object' || obj === null) return false;
let proto = Object.getPrototypeOf(obj);
if (proto === null) return true;
let baseProto = proto;
while (Object.getPrototypeOf(baseProto) !== null) {
baseProto = Object.getPrototypeOf(baseProto);
}
return proto === baseProto;
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/reactBatchedUpdates.js":
/*!*************************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/reactBatchedUpdates.js ***!
\*************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ unstable_batchedUpdates: () => (/* reexport safe */ react_dom__WEBPACK_IMPORTED_MODULE_0__.unstable_batchedUpdates)
/* harmony export */ });
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/shallowEqual.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/shallowEqual.js ***!
\******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ shallowEqual)
/* harmony export */ });
function is(x, y) {
if (x === y) {
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
return x !== x && y !== y;
}
}
function shallowEqual(objA, objB) {
if (is(objA, objB)) return true;
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
const keysA = Object.keys(objA);
const keysB = Object.keys(objB);
if (keysA.length !== keysB.length) return false;
for (let i = 0; i < keysA.length; i++) {
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js":
/*!*******************************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js ***!
\*******************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ canUseDOM: () => (/* binding */ canUseDOM),
/* harmony export */ useIsomorphicLayoutEffect: () => (/* binding */ useIsomorphicLayoutEffect)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
// React currently throws a warning when using useLayoutEffect on the server.
// To get around it, we can conditionally useEffect on the server (no-op) and
// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store
// subscription callback always has the selector from the latest render commit
// available, otherwise a store update may happen between render and the effect,
// which may cause missed updates; we also must ensure the store subscription
// is created synchronously, otherwise a store update may occur before the
// subscription is created and an inconsistent state may be observed
// Matches logic in React's `shared/ExecutionEnvironment` file
const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
const useIsomorphicLayoutEffect = canUseDOM ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect;
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/useSyncExternalStore.js":
/*!**************************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/useSyncExternalStore.js ***!
\**************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ notInitialized: () => (/* binding */ notInitialized)
/* harmony export */ });
const notInitialized = () => {
throw new Error('uSES not initialized!');
};
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/verifyPlainObject.js":
/*!***********************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/verifyPlainObject.js ***!
\***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ verifyPlainObject)
/* harmony export */ });
/* harmony import */ var _isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isPlainObject */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/isPlainObject.js");
/* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./warning */ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/warning.js");
function verifyPlainObject(value, displayName, methodName) {
if (!(0,_isPlainObject__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
(0,_warning__WEBPACK_IMPORTED_MODULE_1__["default"])(`${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`);
}
}
/***/ }),
/***/ "./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/warning.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@hello-pangea/dnd/node_modules/react-redux/es/utils/warning.js ***!
\*************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ warning)
/* harmony export */ });
/**
* Prints a warning in the console if it exists.
*
* @param {String} message The warning message.
* @returns {void}
*/
function warning(message) {
/* eslint-disable no-console */
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message);
}
/* eslint-enable no-console */
try {
// This error was thrown as a convenience so that if you enable
// "break on all exceptions" in your console,
// it would pause the execution at this line.
throw new Error(message);
/* eslint-disable no-empty */
} catch (e) {}
/* eslint-enable no-empty */
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/createPopper.js":
/*!*********************************************************!*\
!*** ./node_modules/@popperjs/core/lib/createPopper.js ***!
\*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createPopper: () => (/* binding */ createPopper),
/* harmony export */ detectOverflow: () => (/* reexport safe */ _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */ popperGenerator: () => (/* binding */ popperGenerator)
/* harmony export */ });
/* harmony import */ var _dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dom-utils/getCompositeRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js");
/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js");
/* harmony import */ var _dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom-utils/listScrollParents.js */ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js");
/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/orderModifiers.js */ "./node_modules/@popperjs/core/lib/utils/orderModifiers.js");
/* harmony import */ var _utils_debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/debounce.js */ "./node_modules/@popperjs/core/lib/utils/debounce.js");
/* harmony import */ var _utils_mergeByName_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/mergeByName.js */ "./node_modules/@popperjs/core/lib/utils/mergeByName.js");
/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom-utils/instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
var DEFAULT_OPTIONS = {
placement: 'bottom',
modifiers: [],
strategy: 'absolute'
};
function areValidElements() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return !args.some(function (element) {
return !(element && typeof element.getBoundingClientRect === 'function');
});
}
function popperGenerator(generatorOptions) {
if (generatorOptions === void 0) {
generatorOptions = {};
}
var _generatorOptions = generatorOptions,
_generatorOptions$def = _generatorOptions.defaultModifiers,
defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
_generatorOptions$def2 = _generatorOptions.defaultOptions,
defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
return function createPopper(reference, popper, options) {
if (options === void 0) {
options = defaultOptions;
}
var state = {
placement: 'bottom',
orderedModifiers: [],
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
modifiersData: {},
elements: {
reference: reference,
popper: popper
},
attributes: {},
styles: {}
};
var effectCleanupFns = [];
var isDestroyed = false;
var instance = {
state: state,
setOptions: function setOptions(setOptionsAction) {
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
cleanupModifierEffects();
state.options = Object.assign({}, defaultOptions, state.options, options);
state.scrollParents = {
reference: (0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(reference) ? (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reference) : reference.contextElement ? (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reference.contextElement) : [],
popper: (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(popper)
}; // Orders the modifiers based on their dependencies and `phase`
// properties
var orderedModifiers = (0,_utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_utils_mergeByName_js__WEBPACK_IMPORTED_MODULE_3__["default"])([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
state.orderedModifiers = orderedModifiers.filter(function (m) {
return m.enabled;
});
runModifierEffects();
return instance.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function forceUpdate() {
if (isDestroyed) {
return;
}
var _state$elements = state.elements,
reference = _state$elements.reference,
popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
// anymore
if (!areValidElements(reference, popper)) {
return;
} // Store the reference and popper rects to be read by modifiers
state.rects = {
reference: (0,_dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_4__["default"])(reference, (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_5__["default"])(popper), state.options.strategy === 'fixed'),
popper: (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(popper)
}; // Modifiers have the ability to reset the current update cycle. The
// most common use case for this is the `flip` modifier changing the
// placement, which then needs to re-run all the modifiers, because the
// logic was previously ran for the previous placement and is therefore
// stale/incorrect
state.reset = false;
state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
// is filled with the initial data specified by the modifier. This means
// it doesn't persist and is fresh on each update.
// To ensure persistent data, use `${name}#persistent`
state.orderedModifiers.forEach(function (modifier) {
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
});
for (var index = 0; index < state.orderedModifiers.length; index++) {
if (state.reset === true) {
state.reset = false;
index = -1;
continue;
}
var _state$orderedModifie = state.orderedModifiers[index],
fn = _state$orderedModifie.fn,
_state$orderedModifie2 = _state$orderedModifie.options,
_options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
name = _state$orderedModifie.name;
if (typeof fn === 'function') {
state = fn({
state: state,
options: _options,
name: name,
instance: instance
}) || state;
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: (0,_utils_debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"])(function () {
return new Promise(function (resolve) {
instance.forceUpdate();
resolve(state);
});
}),
destroy: function destroy() {
cleanupModifierEffects();
isDestroyed = true;
}
};
if (!areValidElements(reference, popper)) {
return instance;
}
instance.setOptions(options).then(function (state) {
if (!isDestroyed && options.onFirstUpdate) {
options.onFirstUpdate(state);
}
}); // Modifiers have the ability to execute arbitrary code before the first
// update cycle runs. They will be executed in the same order as the update
// cycle. This is useful when a modifier adds some persistent data that
// other modifiers need to use, but the modifier is run after the dependent
// one.
function runModifierEffects() {
state.orderedModifiers.forEach(function (_ref) {
var name = _ref.name,
_ref$options = _ref.options,
options = _ref$options === void 0 ? {} : _ref$options,
effect = _ref.effect;
if (typeof effect === 'function') {
var cleanupFn = effect({
state: state,
name: name,
instance: instance,
options: options
});
var noopFn = function noopFn() {};
effectCleanupFns.push(cleanupFn || noopFn);
}
});
}
function cleanupModifierEffects() {
effectCleanupFns.forEach(function (fn) {
return fn();
});
effectCleanupFns = [];
}
return instance;
};
}
var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/contains.js":
/*!***************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/contains.js ***!
\***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ contains)
/* harmony export */ });
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
function contains(parent, child) {
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
if (parent.contains(child)) {
return true;
} // then fallback to custom implementation with Shadow DOM support
else if (rootNode && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isShadowRoot)(rootNode)) {
var next = child;
do {
if (next && parent.isSameNode(next)) {
return true;
} // $FlowFixMe[prop-missing]: need a better way to handle this...
next = next.parentNode || next.host;
} while (next);
} // Give up, the result is false
return false;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js":
/*!****************************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js ***!
\****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getBoundingClientRect)
/* harmony export */ });
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isLayoutViewport.js */ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js");
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
var clientRect = element.getBoundingClientRect();
var scaleX = 1;
var scaleY = 1;
if (includeScale && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) {
scaleX = element.offsetWidth > 0 ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.round)(clientRect.width) / element.offsetWidth || 1 : 1;
scaleY = element.offsetHeight > 0 ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.round)(clientRect.height) / element.offsetHeight || 1 : 1;
}
var _ref = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element) : window,
visualViewport = _ref.visualViewport;
var addVisualOffsets = !(0,_isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_3__["default"])() && isFixedStrategy;
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
var width = clientRect.width / scaleX;
var height = clientRect.height / scaleY;
return {
width: width,
height: height,
top: y,
right: x + width,
bottom: y + height,
left: x,
x: x,
y: y
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js":
/*!**********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getClippingRect)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _getViewportRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getViewportRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js");
/* harmony import */ var _getDocumentRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getDocumentRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js");
/* harmony import */ var _listScrollParents_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./listScrollParents.js */ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js");
/* harmony import */ var _getOffsetParent_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js");
/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./contains.js */ "./node_modules/@popperjs/core/lib/dom-utils/contains.js");
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/rectToClientRect.js */ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");
function getInnerBoundingClientRect(element, strategy) {
var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element, false, strategy === 'fixed');
rect.top = rect.top + element.clientTop;
rect.left = rect.left + element.clientLeft;
rect.bottom = rect.top + element.clientHeight;
rect.right = rect.left + element.clientWidth;
rect.width = element.clientWidth;
rect.height = element.clientHeight;
rect.x = rect.left;
rect.y = rect.top;
return rect;
}
function getClientRectFromMixedType(element, clippingParent, strategy) {
return clippingParent === _enums_js__WEBPACK_IMPORTED_MODULE_1__.viewport ? (0,_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_getViewportRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element, strategy)) : (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : (0,_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_getDocumentRect_js__WEBPACK_IMPORTED_MODULE_5__["default"])((0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(element)));
} // A "clipping parent" is an overflowable container with the characteristic of
// clipping (or hiding) overflowing elements with a position different from
// `initial`
function getClippingParents(element) {
var clippingParents = (0,_listScrollParents_js__WEBPACK_IMPORTED_MODULE_7__["default"])((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_8__["default"])(element));
var canEscapeClipping = ['absolute', 'fixed'].indexOf((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_9__["default"])(element).position) >= 0;
var clipperElement = canEscapeClipping && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isHTMLElement)(element) ? (0,_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_10__["default"])(element) : element;
if (!(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clipperElement)) {
return [];
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
return clippingParents.filter(function (clippingParent) {
return (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clippingParent) && (0,_contains_js__WEBPACK_IMPORTED_MODULE_11__["default"])(clippingParent, clipperElement) && (0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_12__["default"])(clippingParent) !== 'body';
});
} // Gets the maximum area that the element is visible in due to any number of
// clipping parents
function getClippingRect(element, boundary, rootBoundary, strategy) {
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
var firstClippingParent = clippingParents[0];
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
accRect.top = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.max)(rect.top, accRect.top);
accRect.right = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.min)(rect.right, accRect.right);
accRect.bottom = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.min)(rect.bottom, accRect.bottom);
accRect.left = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.max)(rect.left, accRect.left);
return accRect;
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
clippingRect.width = clippingRect.right - clippingRect.left;
clippingRect.height = clippingRect.bottom - clippingRect.top;
clippingRect.x = clippingRect.left;
clippingRect.y = clippingRect.top;
return clippingRect;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js":
/*!***********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js ***!
\***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getCompositeRect)
/* harmony export */ });
/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
/* harmony import */ var _getNodeScroll_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getNodeScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js");
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");
function isElementScaled(element) {
var rect = element.getBoundingClientRect();
var scaleX = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(rect.width) / element.offsetWidth || 1;
var scaleY = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(rect.height) / element.offsetHeight || 1;
return scaleX !== 1 || scaleY !== 1;
} // Returns the composite rect of an element relative to its offsetParent.
// Composite means it takes into account transforms as well as layout.
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
if (isFixed === void 0) {
isFixed = false;
}
var isOffsetParentAnElement = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent);
var offsetParentIsScaled = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent) && isElementScaled(offsetParent);
var documentElement = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(offsetParent);
var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(elementOrVirtualElement, offsetParentIsScaled, isFixed);
var scroll = {
scrollLeft: 0,
scrollTop: 0
};
var offsets = {
x: 0,
y: 0
};
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
(0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_5__["default"])(documentElement)) {
scroll = (0,_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_6__["default"])(offsetParent);
}
if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent)) {
offsets = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(offsetParent, true);
offsets.x += offsetParent.clientLeft;
offsets.y += offsetParent.clientTop;
} else if (documentElement) {
offsets.x = (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_7__["default"])(documentElement);
}
}
return {
x: rect.left + scroll.scrollLeft - offsets.x,
y: rect.top + scroll.scrollTop - offsets.y,
width: rect.width,
height: rect.height
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js":
/*!***********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js ***!
\***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getComputedStyle)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
function getComputedStyle(element) {
return (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element).getComputedStyle(element);
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js":
/*!*************************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js ***!
\*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getDocumentElement)
/* harmony export */ });
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
function getDocumentElement(element) {
// $FlowFixMe[incompatible-return]: assume body is always available
return (((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
element.document) || window.document).documentElement;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js":
/*!**********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getDocumentRect)
/* harmony export */ });
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js");
/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");
// Gets the entire size of the scrollable document area, even extending outside
// of the `` and `` rect bounds if horizontally scrollable
function getDocumentRect(element) {
var _element$ownerDocumen;
var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element);
var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element);
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
var width = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
var height = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element);
var y = -winScroll.scrollTop;
if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__["default"])(body || html).direction === 'rtl') {
x += (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.clientWidth, body ? body.clientWidth : 0) - width;
}
return {
width: width,
height: height,
x: x,
y: y
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js":
/*!***************************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js ***!
\***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getHTMLElementScroll)
/* harmony export */ });
function getHTMLElementScroll(element) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js":
/*!********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js ***!
\********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getLayoutRect)
/* harmony export */ });
/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
// Returns the layout rect of an element relative to its offsetParent. Layout
// means it doesn't take into account transforms.
function getLayoutRect(element) {
var clientRect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element); // Use the clientRect sizes if it's not been transformed.
// Fixes https://github.com/popperjs/popper-core/issues/1223
var width = element.offsetWidth;
var height = element.offsetHeight;
if (Math.abs(clientRect.width - width) <= 1) {
width = clientRect.width;
}
if (Math.abs(clientRect.height - height) <= 1) {
height = clientRect.height;
}
return {
x: element.offsetLeft,
y: element.offsetTop,
width: width,
height: height
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js":
/*!******************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js ***!
\******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getNodeName)
/* harmony export */ });
function getNodeName(element) {
return element ? (element.nodeName || '').toLowerCase() : null;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js":
/*!********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js ***!
\********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getNodeScroll)
/* harmony export */ });
/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js");
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _getHTMLElementScroll_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getHTMLElementScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js");
function getNodeScroll(node) {
if (node === (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node) || !(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(node)) {
return (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__["default"])(node);
} else {
return (0,_getHTMLElementScroll_js__WEBPACK_IMPORTED_MODULE_3__["default"])(node);
}
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js":
/*!**********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getOffsetParent)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _isTableElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isTableElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js");
/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js");
/* harmony import */ var _utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/userAgent.js */ "./node_modules/@popperjs/core/lib/utils/userAgent.js");
function getTrueOffsetParent(element) {
if (!(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || // https://github.com/popperjs/popper-core/issues/837
(0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element).position === 'fixed') {
return null;
}
return element.offsetParent;
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
// return the containing block
function getContainingBlock(element) {
var isFirefox = /firefox/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__["default"])());
var isIE = /Trident/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__["default"])());
if (isIE && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) {
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
var elementCss = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element);
if (elementCss.position === 'fixed') {
return null;
}
}
var currentNode = (0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element);
if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isShadowRoot)(currentNode)) {
currentNode = currentNode.host;
}
while ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(currentNode) && ['html', 'body'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(currentNode)) < 0) {
var css = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(currentNode); // This is non-exhaustive but covers the most common CSS properties that
// create a containing block.
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
return currentNode;
} else {
currentNode = currentNode.parentNode;
}
}
return null;
} // Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.
function getOffsetParent(element) {
var window = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_5__["default"])(element);
var offsetParent = getTrueOffsetParent(element);
while (offsetParent && (0,_isTableElement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(offsetParent) && (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(offsetParent).position === 'static') {
offsetParent = getTrueOffsetParent(offsetParent);
}
if (offsetParent && ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) === 'html' || (0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) === 'body' && (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(offsetParent).position === 'static')) {
return window;
}
return offsetParent || getContainingBlock(element) || window;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js":
/*!********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js ***!
\********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getParentNode)
/* harmony export */ });
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
function getParentNode(element) {
if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element) === 'html') {
return element;
}
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
element.parentNode || ( // DOM Element detected
(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isShadowRoot)(element) ? element.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
(0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element) // fallback
);
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js":
/*!**********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getScrollParent)
/* harmony export */ });
/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js");
/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js");
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
function getScrollParent(node) {
if (['html', 'body', '#document'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node)) >= 0) {
// $FlowFixMe[incompatible-return]: assume body is always available
return node.ownerDocument.body;
}
if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(node) && (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(node)) {
return node;
}
return getScrollParent((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(node));
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js":
/*!**********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getViewportRect)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js");
/* harmony import */ var _isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isLayoutViewport.js */ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js");
function getViewportRect(element, strategy) {
var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element);
var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element);
var visualViewport = win.visualViewport;
var width = html.clientWidth;
var height = html.clientHeight;
var x = 0;
var y = 0;
if (visualViewport) {
width = visualViewport.width;
height = visualViewport.height;
var layoutViewport = (0,_isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_2__["default"])();
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
x = visualViewport.offsetLeft;
y = visualViewport.offsetTop;
}
}
return {
width: width,
height: height,
x: x + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element),
y: y
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js":
/*!****************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js ***!
\****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getWindow)
/* harmony export */ });
function getWindow(node) {
if (node == null) {
return window;
}
if (node.toString() !== '[object Window]') {
var ownerDocument = node.ownerDocument;
return ownerDocument ? ownerDocument.defaultView || window : window;
}
return node;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js":
/*!**********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getWindowScroll)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
function getWindowScroll(node) {
var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node);
var scrollLeft = win.pageXOffset;
var scrollTop = win.pageYOffset;
return {
scrollLeft: scrollLeft,
scrollTop: scrollTop
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js":
/*!**************************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js ***!
\**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getWindowScrollBarX)
/* harmony export */ });
/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js");
function getWindowScrollBarX(element) {
// If has a CSS width greater than the viewport, then this will be
// incorrect for RTL.
// Popper 1 is broken in this case and never had a bug report so let's assume
// it's not an issue. I don't think anyone ever specifies width on
// anyway.
// Browsers where the left scrollbar doesn't cause an issue report `0` for
// this (e.g. Edge 2019, IE11, Safari)
return (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element)).left + (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element).scrollLeft;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js":
/*!*****************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js ***!
\*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ isElement: () => (/* binding */ isElement),
/* harmony export */ isHTMLElement: () => (/* binding */ isHTMLElement),
/* harmony export */ isShadowRoot: () => (/* binding */ isShadowRoot)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
function isElement(node) {
var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).Element;
return node instanceof OwnElement || node instanceof Element;
}
function isHTMLElement(node) {
var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).HTMLElement;
return node instanceof OwnElement || node instanceof HTMLElement;
}
function isShadowRoot(node) {
// IE 11 has no ShadowRoot
if (typeof ShadowRoot === 'undefined') {
return false;
}
var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).ShadowRoot;
return node instanceof OwnElement || node instanceof ShadowRoot;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js":
/*!***********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js ***!
\***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ isLayoutViewport)
/* harmony export */ });
/* harmony import */ var _utils_userAgent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/userAgent.js */ "./node_modules/@popperjs/core/lib/utils/userAgent.js");
function isLayoutViewport() {
return !/^((?!chrome|android).)*safari/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_0__["default"])());
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js":
/*!*********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js ***!
\*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ isScrollParent)
/* harmony export */ });
/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
function isScrollParent(element) {
// Firefox wants us to check `-x` and `-y` variations as well
var _getComputedStyle = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element),
overflow = _getComputedStyle.overflow,
overflowX = _getComputedStyle.overflowX,
overflowY = _getComputedStyle.overflowY;
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js":
/*!*********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js ***!
\*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ isTableElement)
/* harmony export */ });
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
function isTableElement(element) {
return ['table', 'td', 'th'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element)) >= 0;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js":
/*!************************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js ***!
\************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ listScrollParents)
/* harmony export */ });
/* harmony import */ var _getScrollParent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js");
/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js");
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js");
/*
given a DOM element, return the list of all scroll parents, up the list of ancesors
until we get to the top window object. This list is what we attach scroll listeners
to, because if any of these parent elements scroll, we'll need to re-calculate the
reference element's position.
*/
function listScrollParents(element, list) {
var _element$ownerDocumen;
if (list === void 0) {
list = [];
}
var scrollParent = (0,_getScrollParent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element);
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scrollParent);
var target = isBody ? [win].concat(win.visualViewport || [], (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(scrollParent) ? scrollParent : []) : scrollParent;
var updatedList = list.concat(target);
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
updatedList.concat(listScrollParents((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(target)));
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/enums.js":
/*!**************************************************!*\
!*** ./node_modules/@popperjs/core/lib/enums.js ***!
\**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ afterMain: () => (/* binding */ afterMain),
/* harmony export */ afterRead: () => (/* binding */ afterRead),
/* harmony export */ afterWrite: () => (/* binding */ afterWrite),
/* harmony export */ auto: () => (/* binding */ auto),
/* harmony export */ basePlacements: () => (/* binding */ basePlacements),
/* harmony export */ beforeMain: () => (/* binding */ beforeMain),
/* harmony export */ beforeRead: () => (/* binding */ beforeRead),
/* harmony export */ beforeWrite: () => (/* binding */ beforeWrite),
/* harmony export */ bottom: () => (/* binding */ bottom),
/* harmony export */ clippingParents: () => (/* binding */ clippingParents),
/* harmony export */ end: () => (/* binding */ end),
/* harmony export */ left: () => (/* binding */ left),
/* harmony export */ main: () => (/* binding */ main),
/* harmony export */ modifierPhases: () => (/* binding */ modifierPhases),
/* harmony export */ placements: () => (/* binding */ placements),
/* harmony export */ popper: () => (/* binding */ popper),
/* harmony export */ read: () => (/* binding */ read),
/* harmony export */ reference: () => (/* binding */ reference),
/* harmony export */ right: () => (/* binding */ right),
/* harmony export */ start: () => (/* binding */ start),
/* harmony export */ top: () => (/* binding */ top),
/* harmony export */ variationPlacements: () => (/* binding */ variationPlacements),
/* harmony export */ viewport: () => (/* binding */ viewport),
/* harmony export */ write: () => (/* binding */ write)
/* harmony export */ });
var top = 'top';
var bottom = 'bottom';
var right = 'right';
var left = 'left';
var auto = 'auto';
var basePlacements = [top, bottom, right, left];
var start = 'start';
var end = 'end';
var clippingParents = 'clippingParents';
var viewport = 'viewport';
var popper = 'popper';
var reference = 'reference';
var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []); // modifiers that need to read the DOM
var beforeRead = 'beforeRead';
var read = 'read';
var afterRead = 'afterRead'; // pure-logic modifiers
var beforeMain = 'beforeMain';
var main = 'main';
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
var beforeWrite = 'beforeWrite';
var write = 'write';
var afterWrite = 'afterWrite';
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/modifiers/arrow.js":
/*!************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/modifiers/arrow.js ***!
\************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js");
/* harmony import */ var _dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dom-utils/contains.js */ "./node_modules/@popperjs/core/lib/dom-utils/contains.js");
/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js");
/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/within.js */ "./node_modules/@popperjs/core/lib/utils/within.js");
/* harmony import */ var _utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/mergePaddingObject.js */ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js");
/* harmony import */ var _utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/expandToHashMap.js */ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
// eslint-disable-next-line import/no-unused-modules
var toPaddingObject = function toPaddingObject(padding, state) {
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
placement: state.placement
})) : padding;
return (0,_utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(typeof padding !== 'number' ? padding : (0,_utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_2__.basePlacements));
};
function arrow(_ref) {
var _state$modifiersData$;
var state = _ref.state,
name = _ref.name,
options = _ref.options;
var arrowElement = state.elements.arrow;
var popperOffsets = state.modifiersData.popperOffsets;
var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(state.placement);
var axis = (0,_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(basePlacement);
var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_2__.left, _enums_js__WEBPACK_IMPORTED_MODULE_2__.right].indexOf(basePlacement) >= 0;
var len = isVertical ? 'height' : 'width';
if (!arrowElement || !popperOffsets) {
return;
}
var paddingObject = toPaddingObject(options.padding, state);
var arrowRect = (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrowElement);
var minProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_2__.top : _enums_js__WEBPACK_IMPORTED_MODULE_2__.left;
var maxProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_2__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_2__.right;
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
var arrowOffsetParent = (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__["default"])(arrowElement);
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
// outside of the popper bounds
var min = paddingObject[minProp];
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
var offset = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_7__.within)(min, center, max); // Prevents breaking syntax highlighting...
var axisProp = axis;
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
}
function effect(_ref2) {
var state = _ref2.state,
options = _ref2.options;
var _options$element = options.element,
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
if (arrowElement == null) {
return;
} // CSS selector
if (typeof arrowElement === 'string') {
arrowElement = state.elements.popper.querySelector(arrowElement);
if (!arrowElement) {
return;
}
}
if (!(0,_dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_8__["default"])(state.elements.popper, arrowElement)) {
return;
}
state.elements.arrow = arrowElement;
} // eslint-disable-next-line import/no-unused-modules
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'arrow',
enabled: true,
phase: 'main',
fn: arrow,
effect: effect,
requires: ['popperOffsets'],
requiresIfExists: ['preventOverflow']
});
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js":
/*!********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js ***!
\********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */ mapToStyles: () => (/* binding */ mapToStyles)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");
// eslint-disable-next-line import/no-unused-modules
var unsetSides = {
top: 'auto',
right: 'auto',
bottom: 'auto',
left: 'auto'
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
// Zooming can change the DPR, but it seems to report a value that will
// cleanly divide the values into the appropriate subpixels.
function roundOffsetsByDPR(_ref, win) {
var x = _ref.x,
y = _ref.y;
var dpr = win.devicePixelRatio || 1;
return {
x: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(x * dpr) / dpr || 0,
y: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(y * dpr) / dpr || 0
};
}
function mapToStyles(_ref2) {
var _Object$assign2;
var popper = _ref2.popper,
popperRect = _ref2.popperRect,
placement = _ref2.placement,
variation = _ref2.variation,
offsets = _ref2.offsets,
position = _ref2.position,
gpuAcceleration = _ref2.gpuAcceleration,
adaptive = _ref2.adaptive,
roundOffsets = _ref2.roundOffsets,
isFixed = _ref2.isFixed;
var _offsets$x = offsets.x,
x = _offsets$x === void 0 ? 0 : _offsets$x,
_offsets$y = offsets.y,
y = _offsets$y === void 0 ? 0 : _offsets$y;
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
x: x,
y: y
}) : {
x: x,
y: y
};
x = _ref3.x;
y = _ref3.y;
var hasX = offsets.hasOwnProperty('x');
var hasY = offsets.hasOwnProperty('y');
var sideX = _enums_js__WEBPACK_IMPORTED_MODULE_1__.left;
var sideY = _enums_js__WEBPACK_IMPORTED_MODULE_1__.top;
var win = window;
if (adaptive) {
var offsetParent = (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(popper);
var heightProp = 'clientHeight';
var widthProp = 'clientWidth';
if (offsetParent === (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__["default"])(popper)) {
offsetParent = (0,_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(popper);
if ((0,_dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_5__["default"])(offsetParent).position !== 'static' && position === 'absolute') {
heightProp = 'scrollHeight';
widthProp = 'scrollWidth';
}
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
offsetParent = offsetParent;
if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.top || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.left || placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.right) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_1__.end) {
sideY = _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom;
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
offsetParent[heightProp];
y -= offsetY - popperRect.height;
y *= gpuAcceleration ? 1 : -1;
}
if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.left || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.top || placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_1__.end) {
sideX = _enums_js__WEBPACK_IMPORTED_MODULE_1__.right;
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
offsetParent[widthProp];
x -= offsetX - popperRect.width;
x *= gpuAcceleration ? 1 : -1;
}
}
var commonStyles = Object.assign({
position: position
}, adaptive && unsetSides);
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
x: x,
y: y
}, (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__["default"])(popper)) : {
x: x,
y: y
};
x = _ref4.x;
y = _ref4.y;
if (gpuAcceleration) {
var _Object$assign;
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
}
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
}
function computeStyles(_ref5) {
var state = _ref5.state,
options = _ref5.options;
var _options$gpuAccelerat = options.gpuAcceleration,
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
_options$adaptive = options.adaptive,
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
_options$roundOffsets = options.roundOffsets,
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
var commonStyles = {
placement: (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state.placement),
variation: (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_7__["default"])(state.placement),
popper: state.elements.popper,
popperRect: state.rects.popper,
gpuAcceleration: gpuAcceleration,
isFixed: state.options.strategy === 'fixed'
};
if (state.modifiersData.popperOffsets != null) {
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
offsets: state.modifiersData.popperOffsets,
position: state.options.strategy,
adaptive: adaptive,
roundOffsets: roundOffsets
})));
}
if (state.modifiersData.arrow != null) {
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
offsets: state.modifiersData.arrow,
position: 'absolute',
adaptive: false,
roundOffsets: roundOffsets
})));
}
state.attributes.popper = Object.assign({}, state.attributes.popper, {
'data-popper-placement': state.placement
});
} // eslint-disable-next-line import/no-unused-modules
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'computeStyles',
enabled: true,
phase: 'beforeWrite',
fn: computeStyles,
data: {}
});
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js":
/*!*********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js ***!
\*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
// eslint-disable-next-line import/no-unused-modules
var passive = {
passive: true
};
function effect(_ref) {
var state = _ref.state,
instance = _ref.instance,
options = _ref.options;
var _options$scroll = options.scroll,
scroll = _options$scroll === void 0 ? true : _options$scroll,
_options$resize = options.resize,
resize = _options$resize === void 0 ? true : _options$resize;
var window = (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(state.elements.popper);
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
if (scroll) {
scrollParents.forEach(function (scrollParent) {
scrollParent.addEventListener('scroll', instance.update, passive);
});
}
if (resize) {
window.addEventListener('resize', instance.update, passive);
}
return function () {
if (scroll) {
scrollParents.forEach(function (scrollParent) {
scrollParent.removeEventListener('scroll', instance.update, passive);
});
}
if (resize) {
window.removeEventListener('resize', instance.update, passive);
}
};
} // eslint-disable-next-line import/no-unused-modules
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'eventListeners',
enabled: true,
phase: 'write',
fn: function fn() {},
effect: effect,
data: {}
});
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/modifiers/flip.js":
/*!***********************************************************!*\
!*** ./node_modules/@popperjs/core/lib/modifiers/flip.js ***!
\***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getOppositePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js");
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getOppositeVariationPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js");
/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _utils_computeAutoPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/computeAutoPlacement.js */ "./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
// eslint-disable-next-line import/no-unused-modules
function getExpandedFallbackPlacements(placement) {
if ((0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.auto) {
return [];
}
var oppositePlacement = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(placement);
return [(0,_utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(placement), oppositePlacement, (0,_utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(oppositePlacement)];
}
function flip(_ref) {
var state = _ref.state,
options = _ref.options,
name = _ref.name;
if (state.modifiersData[name]._skip) {
return;
}
var _options$mainAxis = options.mainAxis,
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
_options$altAxis = options.altAxis,
checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
specifiedFallbackPlacements = options.fallbackPlacements,
padding = options.padding,
boundary = options.boundary,
rootBoundary = options.rootBoundary,
altBoundary = options.altBoundary,
_options$flipVariatio = options.flipVariations,
flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
allowedAutoPlacements = options.allowedAutoPlacements;
var preferredPlacement = state.options.placement;
var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(preferredPlacement);
var isBasePlacement = basePlacement === preferredPlacement;
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [(0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
return acc.concat((0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.auto ? (0,_utils_computeAutoPlacement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(state, {
placement: placement,
boundary: boundary,
rootBoundary: rootBoundary,
padding: padding,
flipVariations: flipVariations,
allowedAutoPlacements: allowedAutoPlacements
}) : placement);
}, []);
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var checksMap = new Map();
var makeFallbackChecks = true;
var firstFittingPlacement = placements[0];
for (var i = 0; i < placements.length; i++) {
var placement = placements[i];
var _basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement);
var isStartVariation = (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_5__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.start;
var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_1__.top, _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom].indexOf(_basePlacement) >= 0;
var len = isVertical ? 'width' : 'height';
var overflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state, {
placement: placement,
boundary: boundary,
rootBoundary: rootBoundary,
altBoundary: altBoundary,
padding: padding
});
var mainVariationSide = isVertical ? isStartVariation ? _enums_js__WEBPACK_IMPORTED_MODULE_1__.right : _enums_js__WEBPACK_IMPORTED_MODULE_1__.left : isStartVariation ? _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_1__.top;
if (referenceRect[len] > popperRect[len]) {
mainVariationSide = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(mainVariationSide);
}
var altVariationSide = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(mainVariationSide);
var checks = [];
if (checkMainAxis) {
checks.push(overflow[_basePlacement] <= 0);
}
if (checkAltAxis) {
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
}
if (checks.every(function (check) {
return check;
})) {
firstFittingPlacement = placement;
makeFallbackChecks = false;
break;
}
checksMap.set(placement, checks);
}
if (makeFallbackChecks) {
// `2` may be desired in some cases – research later
var numberOfChecks = flipVariations ? 3 : 1;
var _loop = function _loop(_i) {
var fittingPlacement = placements.find(function (placement) {
var checks = checksMap.get(placement);
if (checks) {
return checks.slice(0, _i).every(function (check) {
return check;
});
}
});
if (fittingPlacement) {
firstFittingPlacement = fittingPlacement;
return "break";
}
};
for (var _i = numberOfChecks; _i > 0; _i--) {
var _ret = _loop(_i);
if (_ret === "break") break;
}
}
if (state.placement !== firstFittingPlacement) {
state.modifiersData[name]._skip = true;
state.placement = firstFittingPlacement;
state.reset = true;
}
} // eslint-disable-next-line import/no-unused-modules
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'flip',
enabled: true,
phase: 'main',
fn: flip,
requiresIfExists: ['offset'],
data: {
_skip: false
}
});
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/modifiers/hide.js":
/*!***********************************************************!*\
!*** ./node_modules/@popperjs/core/lib/modifiers/hide.js ***!
\***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
function getSideOffsets(overflow, rect, preventedOffsets) {
if (preventedOffsets === void 0) {
preventedOffsets = {
x: 0,
y: 0
};
}
return {
top: overflow.top - rect.height - preventedOffsets.y,
right: overflow.right - rect.width + preventedOffsets.x,
bottom: overflow.bottom - rect.height + preventedOffsets.y,
left: overflow.left - rect.width - preventedOffsets.x
};
}
function isAnySideFullyClipped(overflow) {
return [_enums_js__WEBPACK_IMPORTED_MODULE_0__.top, _enums_js__WEBPACK_IMPORTED_MODULE_0__.right, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom, _enums_js__WEBPACK_IMPORTED_MODULE_0__.left].some(function (side) {
return overflow[side] >= 0;
});
}
function hide(_ref) {
var state = _ref.state,
name = _ref.name;
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var preventedOffsets = state.modifiersData.preventOverflow;
var referenceOverflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state, {
elementContext: 'reference'
});
var popperAltOverflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state, {
altBoundary: true
});
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
state.modifiersData[name] = {
referenceClippingOffsets: referenceClippingOffsets,
popperEscapeOffsets: popperEscapeOffsets,
isReferenceHidden: isReferenceHidden,
hasPopperEscaped: hasPopperEscaped
};
state.attributes.popper = Object.assign({}, state.attributes.popper, {
'data-popper-reference-hidden': isReferenceHidden,
'data-popper-escaped': hasPopperEscaped
});
} // eslint-disable-next-line import/no-unused-modules
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'hide',
enabled: true,
phase: 'main',
requiresIfExists: ['preventOverflow'],
fn: hide
});
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/modifiers/offset.js":
/*!*************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/modifiers/offset.js ***!
\*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */ distanceAndSkiddingToXY: () => (/* binding */ distanceAndSkiddingToXY)
/* harmony export */ });
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
// eslint-disable-next-line import/no-unused-modules
function distanceAndSkiddingToXY(placement, rects, offset) {
var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement);
var invertDistance = [_enums_js__WEBPACK_IMPORTED_MODULE_1__.left, _enums_js__WEBPACK_IMPORTED_MODULE_1__.top].indexOf(basePlacement) >= 0 ? -1 : 1;
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
placement: placement
})) : offset,
skidding = _ref[0],
distance = _ref[1];
skidding = skidding || 0;
distance = (distance || 0) * invertDistance;
return [_enums_js__WEBPACK_IMPORTED_MODULE_1__.left, _enums_js__WEBPACK_IMPORTED_MODULE_1__.right].indexOf(basePlacement) >= 0 ? {
x: distance,
y: skidding
} : {
x: skidding,
y: distance
};
}
function offset(_ref2) {
var state = _ref2.state,
options = _ref2.options,
name = _ref2.name;
var _options$offset = options.offset,
offset = _options$offset === void 0 ? [0, 0] : _options$offset;
var data = _enums_js__WEBPACK_IMPORTED_MODULE_1__.placements.reduce(function (acc, placement) {
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
return acc;
}, {});
var _data$state$placement = data[state.placement],
x = _data$state$placement.x,
y = _data$state$placement.y;
if (state.modifiersData.popperOffsets != null) {
state.modifiersData.popperOffsets.x += x;
state.modifiersData.popperOffsets.y += y;
}
state.modifiersData[name] = data;
} // eslint-disable-next-line import/no-unused-modules
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'offset',
enabled: true,
phase: 'main',
requires: ['popperOffsets'],
fn: offset
});
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js":
/*!********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js ***!
\********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_computeOffsets_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/computeOffsets.js */ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js");
function popperOffsets(_ref) {
var state = _ref.state,
name = _ref.name;
// Offsets are the actual position the popper needs to have to be
// properly positioned near its reference element
// This is the most basic placement, and will be adjusted by
// the modifiers in the next step
state.modifiersData[name] = (0,_utils_computeOffsets_js__WEBPACK_IMPORTED_MODULE_0__["default"])({
reference: state.rects.reference,
element: state.rects.popper,
strategy: 'absolute',
placement: state.placement
});
} // eslint-disable-next-line import/no-unused-modules
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'popperOffsets',
enabled: true,
phase: 'read',
fn: popperOffsets,
data: {}
});
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js":
/*!**********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js");
/* harmony import */ var _utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getAltAxis.js */ "./node_modules/@popperjs/core/lib/utils/getAltAxis.js");
/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/within.js */ "./node_modules/@popperjs/core/lib/utils/within.js");
/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js");
/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
/* harmony import */ var _utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/getFreshSideObject.js */ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");
function preventOverflow(_ref) {
var state = _ref.state,
options = _ref.options,
name = _ref.name;
var _options$mainAxis = options.mainAxis,
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
_options$altAxis = options.altAxis,
checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
boundary = options.boundary,
rootBoundary = options.rootBoundary,
altBoundary = options.altBoundary,
padding = options.padding,
_options$tether = options.tether,
tether = _options$tether === void 0 ? true : _options$tether,
_options$tetherOffset = options.tetherOffset,
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
var overflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(state, {
boundary: boundary,
rootBoundary: rootBoundary,
padding: padding,
altBoundary: altBoundary
});
var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state.placement);
var variation = (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_2__["default"])(state.placement);
var isBasePlacement = !variation;
var mainAxis = (0,_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(basePlacement);
var altAxis = (0,_utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_4__["default"])(mainAxis);
var popperOffsets = state.modifiersData.popperOffsets;
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
placement: state.placement
})) : tetherOffset;
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
mainAxis: tetherOffsetValue,
altAxis: tetherOffsetValue
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, tetherOffsetValue);
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
var data = {
x: 0,
y: 0
};
if (!popperOffsets) {
return;
}
if (checkMainAxis) {
var _offsetModifierState$;
var mainSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.top : _enums_js__WEBPACK_IMPORTED_MODULE_5__.left;
var altSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_5__.right;
var len = mainAxis === 'y' ? 'height' : 'width';
var offset = popperOffsets[mainAxis];
var min = offset + overflow[mainSide];
var max = offset - overflow[altSide];
var additive = tether ? -popperRect[len] / 2 : 0;
var minLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_5__.start ? referenceRect[len] : popperRect[len];
var maxLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_5__.start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
// outside the reference bounds
var arrowElement = state.elements.arrow;
var arrowRect = tether && arrowElement ? (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(arrowElement) : {
width: 0,
height: 0
};
var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : (0,_utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_7__["default"])();
var arrowPaddingMin = arrowPaddingObject[mainSide];
var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
// to include its full size in the calculation. If the reference is small
// and near the edge of a boundary, the popper can overflow even if the
// reference is not overflowing as well (e.g. virtual elements with no
// width or height)
var arrowLen = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(0, referenceRect[len], arrowRect[len]);
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
var arrowOffsetParent = state.elements.arrow && (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_9__["default"])(state.elements.arrow);
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
var tetherMax = offset + maxOffset - offsetModifierValue;
var preventedOffset = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(tether ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_10__.min)(min, tetherMin) : min, offset, tether ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_10__.max)(max, tetherMax) : max);
popperOffsets[mainAxis] = preventedOffset;
data[mainAxis] = preventedOffset - offset;
}
if (checkAltAxis) {
var _offsetModifierState$2;
var _mainSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.top : _enums_js__WEBPACK_IMPORTED_MODULE_5__.left;
var _altSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_5__.right;
var _offset = popperOffsets[altAxis];
var _len = altAxis === 'y' ? 'height' : 'width';
var _min = _offset + overflow[_mainSide];
var _max = _offset - overflow[_altSide];
var isOriginSide = [_enums_js__WEBPACK_IMPORTED_MODULE_5__.top, _enums_js__WEBPACK_IMPORTED_MODULE_5__.left].indexOf(basePlacement) !== -1;
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
var _preventedOffset = tether && isOriginSide ? (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.withinMaxClamp)(_tetherMin, _offset, _tetherMax) : (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
popperOffsets[altAxis] = _preventedOffset;
data[altAxis] = _preventedOffset - _offset;
}
state.modifiersData[name] = data;
} // eslint-disable-next-line import/no-unused-modules
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'preventOverflow',
enabled: true,
phase: 'main',
fn: preventOverflow,
requiresIfExists: ['offset']
});
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js":
/*!***********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js ***!
\***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ computeAutoPlacement)
/* harmony export */ });
/* harmony import */ var _getVariation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _detectOverflow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
function computeAutoPlacement(state, options) {
if (options === void 0) {
options = {};
}
var _options = options,
placement = _options.placement,
boundary = _options.boundary,
rootBoundary = _options.rootBoundary,
padding = _options.padding,
flipVariations = _options.flipVariations,
_options$allowedAutoP = _options.allowedAutoPlacements,
allowedAutoPlacements = _options$allowedAutoP === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.placements : _options$allowedAutoP;
var variation = (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement);
var placements = variation ? flipVariations ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements : _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements.filter(function (placement) {
return (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement) === variation;
}) : _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements;
var allowedPlacements = placements.filter(function (placement) {
return allowedAutoPlacements.indexOf(placement) >= 0;
});
if (allowedPlacements.length === 0) {
allowedPlacements = placements;
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
var overflows = allowedPlacements.reduce(function (acc, placement) {
acc[placement] = (0,_detectOverflow_js__WEBPACK_IMPORTED_MODULE_2__["default"])(state, {
placement: placement,
boundary: boundary,
rootBoundary: rootBoundary,
padding: padding
})[(0,_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(placement)];
return acc;
}, {});
return Object.keys(overflows).sort(function (a, b) {
return overflows[a] - overflows[b];
});
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js":
/*!*****************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/computeOffsets.js ***!
\*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ computeOffsets)
/* harmony export */ });
/* harmony import */ var _getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _getVariation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
/* harmony import */ var _getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
function computeOffsets(_ref) {
var reference = _ref.reference,
element = _ref.element,
placement = _ref.placement;
var basePlacement = placement ? (0,_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) : null;
var variation = placement ? (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement) : null;
var commonX = reference.x + reference.width / 2 - element.width / 2;
var commonY = reference.y + reference.height / 2 - element.height / 2;
var offsets;
switch (basePlacement) {
case _enums_js__WEBPACK_IMPORTED_MODULE_2__.top:
offsets = {
x: commonX,
y: reference.y - element.height
};
break;
case _enums_js__WEBPACK_IMPORTED_MODULE_2__.bottom:
offsets = {
x: commonX,
y: reference.y + reference.height
};
break;
case _enums_js__WEBPACK_IMPORTED_MODULE_2__.right:
offsets = {
x: reference.x + reference.width,
y: commonY
};
break;
case _enums_js__WEBPACK_IMPORTED_MODULE_2__.left:
offsets = {
x: reference.x - element.width,
y: commonY
};
break;
default:
offsets = {
x: reference.x,
y: reference.y
};
}
var mainAxis = basePlacement ? (0,_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(basePlacement) : null;
if (mainAxis != null) {
var len = mainAxis === 'y' ? 'height' : 'width';
switch (variation) {
case _enums_js__WEBPACK_IMPORTED_MODULE_2__.start:
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
break;
case _enums_js__WEBPACK_IMPORTED_MODULE_2__.end:
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
break;
default:
}
}
return offsets;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/debounce.js":
/*!***********************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/debounce.js ***!
\***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ debounce)
/* harmony export */ });
function debounce(fn) {
var pending;
return function () {
if (!pending) {
pending = new Promise(function (resolve) {
Promise.resolve().then(function () {
pending = undefined;
resolve(fn());
});
});
}
return pending;
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js":
/*!*****************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/detectOverflow.js ***!
\*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ detectOverflow)
/* harmony export */ });
/* harmony import */ var _dom_utils_getClippingRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getClippingRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js");
/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _dom_utils_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
/* harmony import */ var _computeOffsets_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./computeOffsets.js */ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js");
/* harmony import */ var _rectToClientRect_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rectToClientRect.js */ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergePaddingObject.js */ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js");
/* harmony import */ var _expandToHashMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./expandToHashMap.js */ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js");
// eslint-disable-next-line import/no-unused-modules
function detectOverflow(state, options) {
if (options === void 0) {
options = {};
}
var _options = options,
_options$placement = _options.placement,
placement = _options$placement === void 0 ? state.placement : _options$placement,
_options$strategy = _options.strategy,
strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
_options$boundary = _options.boundary,
boundary = _options$boundary === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.clippingParents : _options$boundary,
_options$rootBoundary = _options.rootBoundary,
rootBoundary = _options$rootBoundary === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.viewport : _options$rootBoundary,
_options$elementConte = _options.elementContext,
elementContext = _options$elementConte === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper : _options$elementConte,
_options$altBoundary = _options.altBoundary,
altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
_options$padding = _options.padding,
padding = _options$padding === void 0 ? 0 : _options$padding;
var paddingObject = (0,_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(typeof padding !== 'number' ? padding : (0,_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_2__["default"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements));
var altContext = elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.reference : _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper;
var popperRect = state.rects.popper;
var element = state.elements[altBoundary ? altContext : elementContext];
var clippingClientRect = (0,_dom_utils_getClippingRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(element) ? element : element.contextElement || (0,_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__["default"])(state.elements.popper), boundary, rootBoundary, strategy);
var referenceClientRect = (0,_dom_utils_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state.elements.reference);
var popperOffsets = (0,_computeOffsets_js__WEBPACK_IMPORTED_MODULE_7__["default"])({
reference: referenceClientRect,
element: popperRect,
strategy: 'absolute',
placement: placement
});
var popperClientRect = (0,_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_8__["default"])(Object.assign({}, popperRect, popperOffsets));
var elementClientRect = elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
// 0 or negative = within the clipping rect
var overflowOffsets = {
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
};
var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
if (elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper && offsetData) {
var offset = offsetData[placement];
Object.keys(overflowOffsets).forEach(function (key) {
var multiply = [_enums_js__WEBPACK_IMPORTED_MODULE_0__.right, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom].indexOf(key) >= 0 ? 1 : -1;
var axis = [_enums_js__WEBPACK_IMPORTED_MODULE_0__.top, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom].indexOf(key) >= 0 ? 'y' : 'x';
overflowOffsets[key] += offset[axis] * multiply;
});
}
return overflowOffsets;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js":
/*!******************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js ***!
\******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ expandToHashMap)
/* harmony export */ });
function expandToHashMap(value, keys) {
return keys.reduce(function (hashMap, key) {
hashMap[key] = value;
return hashMap;
}, {});
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/getAltAxis.js":
/*!*************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/getAltAxis.js ***!
\*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getAltAxis)
/* harmony export */ });
function getAltAxis(axis) {
return axis === 'x' ? 'y' : 'x';
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js":
/*!*******************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js ***!
\*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getBasePlacement)
/* harmony export */ });
function getBasePlacement(placement) {
return placement.split('-')[0];
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js":
/*!*********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js ***!
\*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getFreshSideObject)
/* harmony export */ });
function getFreshSideObject() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js":
/*!***************************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js ***!
\***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getMainAxisFromPlacement)
/* harmony export */ });
function getMainAxisFromPlacement(placement) {
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js":
/*!***********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js ***!
\***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getOppositePlacement)
/* harmony export */ });
var hash = {
left: 'right',
right: 'left',
bottom: 'top',
top: 'bottom'
};
function getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, function (matched) {
return hash[matched];
});
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js":
/*!********************************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js ***!
\********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getOppositeVariationPlacement)
/* harmony export */ });
var hash = {
start: 'end',
end: 'start'
};
function getOppositeVariationPlacement(placement) {
return placement.replace(/start|end/g, function (matched) {
return hash[matched];
});
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/getVariation.js":
/*!***************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/getVariation.js ***!
\***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getVariation)
/* harmony export */ });
function getVariation(placement) {
return placement.split('-')[1];
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/math.js":
/*!*******************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/math.js ***!
\*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ max: () => (/* binding */ max),
/* harmony export */ min: () => (/* binding */ min),
/* harmony export */ round: () => (/* binding */ round)
/* harmony export */ });
var max = Math.max;
var min = Math.min;
var round = Math.round;
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/mergeByName.js":
/*!**************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/mergeByName.js ***!
\**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ mergeByName)
/* harmony export */ });
function mergeByName(modifiers) {
var merged = modifiers.reduce(function (merged, current) {
var existing = merged[current.name];
merged[current.name] = existing ? Object.assign({}, existing, current, {
options: Object.assign({}, existing.options, current.options),
data: Object.assign({}, existing.data, current.data)
}) : current;
return merged;
}, {}); // IE11 does not support Object.values
return Object.keys(merged).map(function (key) {
return merged[key];
});
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js":
/*!*********************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js ***!
\*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ mergePaddingObject)
/* harmony export */ });
/* harmony import */ var _getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getFreshSideObject.js */ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js");
function mergePaddingObject(paddingObject) {
return Object.assign({}, (0,_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), paddingObject);
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/orderModifiers.js":
/*!*****************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/orderModifiers.js ***!
\*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ orderModifiers)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
// source: https://stackoverflow.com/questions/49875255
function order(modifiers) {
var map = new Map();
var visited = new Set();
var result = [];
modifiers.forEach(function (modifier) {
map.set(modifier.name, modifier);
}); // On visiting object, check for its dependencies and visit them recursively
function sort(modifier) {
visited.add(modifier.name);
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
requires.forEach(function (dep) {
if (!visited.has(dep)) {
var depModifier = map.get(dep);
if (depModifier) {
sort(depModifier);
}
}
});
result.push(modifier);
}
modifiers.forEach(function (modifier) {
if (!visited.has(modifier.name)) {
// check for visited object
sort(modifier);
}
});
return result;
}
function orderModifiers(modifiers) {
// order based on dependencies
var orderedModifiers = order(modifiers); // order based on phase
return _enums_js__WEBPACK_IMPORTED_MODULE_0__.modifierPhases.reduce(function (acc, phase) {
return acc.concat(orderedModifiers.filter(function (modifier) {
return modifier.phase === phase;
}));
}, []);
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js":
/*!*******************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js ***!
\*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ rectToClientRect)
/* harmony export */ });
function rectToClientRect(rect) {
return Object.assign({}, rect, {
left: rect.x,
top: rect.y,
right: rect.x + rect.width,
bottom: rect.y + rect.height
});
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/userAgent.js":
/*!************************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/userAgent.js ***!
\************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getUAString)
/* harmony export */ });
function getUAString() {
var uaData = navigator.userAgentData;
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
return uaData.brands.map(function (item) {
return item.brand + "/" + item.version;
}).join(' ');
}
return navigator.userAgent;
}
/***/ }),
/***/ "./node_modules/@popperjs/core/lib/utils/within.js":
/*!*********************************************************!*\
!*** ./node_modules/@popperjs/core/lib/utils/within.js ***!
\*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ within: () => (/* binding */ within),
/* harmony export */ withinMaxClamp: () => (/* binding */ withinMaxClamp)
/* harmony export */ });
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");
function within(min, value, max) {
return (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.max)(min, (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.min)(value, max));
}
function withinMaxClamp(min, value, max) {
var v = within(min, value, max);
return v > max ? max : v;
}
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useCallbackRef.js":
/*!***********************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useCallbackRef.js ***!
\***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ useCallbackRef)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/**
* A convenience hook around `useState` designed to be paired with
* the component [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) api.
* Callback refs are useful over `useRef()` when you need to respond to the ref being set
* instead of lazily accessing it in an effect.
*
* ```ts
* const [element, attachRef] = useCallbackRef()
*
* useEffect(() => {
* if (!element) return
*
* const calendar = new FullCalendar.Calendar(element)
*
* return () => {
* calendar.destroy()
* }
* }, [element])
*
* return
* ```
*
* @category refs
*/
function useCallbackRef() {
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
}
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useCommittedRef.js":
/*!************************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useCommittedRef.js ***!
\************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/**
* Creates a `Ref` whose value is updated in an effect, ensuring the most recent
* value is the one rendered with. Generally only required for Concurrent mode usage
* where previous work in `render()` may be discarded before being used.
*
* This is safe to access in an event handler.
*
* @param value The `Ref` value
*/
function useCommittedRef(value) {
const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
ref.current = value;
}, [value]);
return ref;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useCommittedRef);
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useEventCallback.js":
/*!*************************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useEventCallback.js ***!
\*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ useEventCallback)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _useCommittedRef__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useCommittedRef */ "./node_modules/@restart/hooks/esm/useCommittedRef.js");
function useEventCallback(fn) {
const ref = (0,_useCommittedRef__WEBPACK_IMPORTED_MODULE_1__["default"])(fn);
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (...args) {
return ref.current && ref.current(...args);
}, [ref]);
}
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useIsomorphicEffect.js":
/*!****************************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useIsomorphicEffect.js ***!
\****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
const isReactNative = typeof __webpack_require__.g !== 'undefined' &&
// @ts-ignore
__webpack_require__.g.navigator &&
// @ts-ignore
__webpack_require__.g.navigator.product === 'ReactNative';
const isDOM = typeof document !== 'undefined';
/**
* Is `useLayoutEffect` in a DOM or React Native environment, otherwise resolves to useEffect
* Only useful to avoid the console warning.
*
* PREFER `useEffect` UNLESS YOU KNOW WHAT YOU ARE DOING.
*
* @category effects
*/
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isDOM || isReactNative ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect);
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useMergedRefs.js":
/*!**********************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useMergedRefs.js ***!
\**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */ mergeRefs: () => (/* binding */ mergeRefs)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
const toFnRef = ref => !ref || typeof ref === 'function' ? ref : value => {
ref.current = value;
};
function mergeRefs(refA, refB) {
const a = toFnRef(refA);
const b = toFnRef(refB);
return value => {
if (a) a(value);
if (b) b(value);
};
}
/**
* Create and returns a single callback ref composed from two other Refs.
*
* ```tsx
* const Button = React.forwardRef((props, ref) => {
* const [element, attachRef] = useCallbackRef();
* const mergedRef = useMergedRefs(ref, attachRef);
*
* return
* })
* ```
*
* @param refA A Callback or mutable Ref
* @param refB A Callback or mutable Ref
* @category refs
*/
function useMergedRefs(refA, refB) {
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => mergeRefs(refA, refB), [refA, refB]);
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useMergedRefs);
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useMounted.js":
/*!*******************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useMounted.js ***!
\*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ useMounted)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/**
* Track whether a component is current mounted. Generally less preferable than
* properlly canceling effects so they don't run after a component is unmounted,
* but helpful in cases where that isn't feasible, such as a `Promise` resolution.
*
* @returns a function that returns the current isMounted state of the component
*
* ```ts
* const [data, setData] = useState(null)
* const isMounted = useMounted()
*
* useEffect(() => {
* fetchdata().then((newData) => {
* if (isMounted()) {
* setData(newData);
* }
* })
* })
* ```
*/
function useMounted() {
const mounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(true);
const isMounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(() => mounted.current);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
mounted.current = true;
return () => {
mounted.current = false;
};
}, []);
return isMounted.current;
}
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/usePrevious.js":
/*!********************************************************!*\
!*** ./node_modules/@restart/hooks/esm/usePrevious.js ***!
\********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ usePrevious)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/**
* Store the last of some value. Tracked via a `Ref` only updating it
* after the component renders.
*
* Helpful if you need to compare a prop value to it's previous value during render.
*
* ```ts
* function Component(props) {
* const lastProps = usePrevious(props)
*
* if (lastProps.foo !== props.foo)
* resetValueFromProps(props.foo)
* }
* ```
*
* @param value the value to track
*/
function usePrevious(value) {
const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
ref.current = value;
});
return ref.current;
}
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useSafeState.js":
/*!*********************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useSafeState.js ***!
\*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _useMounted__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useMounted */ "./node_modules/@restart/hooks/esm/useMounted.js");
/**
* `useSafeState` takes the return value of a `useState` hook and wraps the
* setter to prevent updates onces the component has unmounted. Can used
* with `useMergeState` and `useStateAsync` as well
*
* @param state The return value of a useStateHook
*
* ```ts
* const [show, setShow] = useSafeState(useState(true));
* ```
*/
function useSafeState(state) {
const isMounted = (0,_useMounted__WEBPACK_IMPORTED_MODULE_1__["default"])();
return [state[0], (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(nextState => {
if (!isMounted()) return;
return state[1](nextState);
}, [isMounted, state[1]])];
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useSafeState);
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useTimeout.js":
/*!*******************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useTimeout.js ***!
\*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ useTimeout)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _useMounted__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useMounted */ "./node_modules/@restart/hooks/esm/useMounted.js");
/* harmony import */ var _useWillUnmount__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useWillUnmount */ "./node_modules/@restart/hooks/esm/useWillUnmount.js");
/*
* Browsers including Internet Explorer, Chrome, Safari, and Firefox store the
* delay as a 32-bit signed integer internally. This causes an integer overflow
* when using delays larger than 2,147,483,647 ms (about 24.8 days),
* resulting in the timeout being executed immediately.
*
* via: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout
*/
const MAX_DELAY_MS = 2 ** 31 - 1;
function setChainedTimeout(handleRef, fn, timeoutAtMs) {
const delayMs = timeoutAtMs - Date.now();
handleRef.current = delayMs <= MAX_DELAY_MS ? setTimeout(fn, delayMs) : setTimeout(() => setChainedTimeout(handleRef, fn, timeoutAtMs), MAX_DELAY_MS);
}
/**
* Returns a controller object for setting a timeout that is properly cleaned up
* once the component unmounts. New timeouts cancel and replace existing ones.
*
*
*
* ```tsx
* const { set, clear } = useTimeout();
* const [hello, showHello] = useState(false);
* //Display hello after 5 seconds
* set(() => showHello(true), 5000);
* return (
*
* {hello ?
Hello
: null}
*
* );
* ```
*/
function useTimeout() {
const isMounted = (0,_useMounted__WEBPACK_IMPORTED_MODULE_1__["default"])();
// types are confused between node and web here IDK
const handleRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
(0,_useWillUnmount__WEBPACK_IMPORTED_MODULE_2__["default"])(() => clearTimeout(handleRef.current));
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
const clear = () => clearTimeout(handleRef.current);
function set(fn, delayMs = 0) {
if (!isMounted()) return;
clear();
if (delayMs <= MAX_DELAY_MS) {
// For simplicity, if the timeout is short, just set a normal timeout.
handleRef.current = setTimeout(fn, delayMs);
} else {
setChainedTimeout(handleRef, fn, Date.now() + delayMs);
}
}
return {
set,
clear
};
}, []);
}
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useUpdatedRef.js":
/*!**********************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useUpdatedRef.js ***!
\**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ useUpdatedRef)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/**
* Returns a ref that is immediately updated with the new value
*
* @param value The Ref value
* @category refs
*/
function useUpdatedRef(value) {
const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value);
valueRef.current = value;
return valueRef;
}
/***/ }),
/***/ "./node_modules/@restart/hooks/esm/useWillUnmount.js":
/*!***********************************************************!*\
!*** ./node_modules/@restart/hooks/esm/useWillUnmount.js ***!
\***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ useWillUnmount)
/* harmony export */ });
/* harmony import */ var _useUpdatedRef__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useUpdatedRef */ "./node_modules/@restart/hooks/esm/useUpdatedRef.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/**
* Attach a callback that fires when a component unmounts
*
* @param fn Handler to run when the component unmounts
* @category effects
*/
function useWillUnmount(fn) {
const onUnmount = (0,_useUpdatedRef__WEBPACK_IMPORTED_MODULE_0__["default"])(fn);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => () => onUnmount.current(), []);
}
/***/ }),
/***/ "./node_modules/@restart/ui/esm/DataKey.js":
/*!*************************************************!*\
!*** ./node_modules/@restart/ui/esm/DataKey.js ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ATTRIBUTE_PREFIX: () => (/* binding */ ATTRIBUTE_PREFIX),
/* harmony export */ PROPERTY_PREFIX: () => (/* binding */ PROPERTY_PREFIX),
/* harmony export */ dataAttr: () => (/* binding */ dataAttr),
/* harmony export */ dataProp: () => (/* binding */ dataProp)
/* harmony export */ });
const ATTRIBUTE_PREFIX = `data-rr-ui-`;
const PROPERTY_PREFIX = `rrUi`;
function dataAttr(property) {
return `${ATTRIBUTE_PREFIX}${property}`;
}
function dataProp(property) {
return `${PROPERTY_PREFIX}${property}`;
}
/***/ }),
/***/ "./node_modules/@restart/ui/esm/ImperativeTransition.js":
/*!**************************************************************!*\
!*** ./node_modules/@restart/ui/esm/ImperativeTransition.js ***!
\**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ ImperativeTransition),
/* harmony export */ renderTransition: () => (/* binding */ renderTransition),
/* harmony export */ useTransition: () => (/* binding */ useTransition)
/* harmony export */ });
/* harmony import */ var _restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @restart/hooks/useMergedRefs */ "./node_modules/@restart/hooks/esm/useMergedRefs.js");
/* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
/* harmony import */ var _restart_hooks_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @restart/hooks/useIsomorphicEffect */ "./node_modules/@restart/hooks/esm/useIsomorphicEffect.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _NoopTransition__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./NoopTransition */ "./node_modules/@restart/ui/esm/NoopTransition.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
function useTransition({
in: inProp,
onTransition
}) {
const ref = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
const isInitialRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(true);
const handleTransition = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_1__["default"])(onTransition);
(0,_restart_hooks_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_2__["default"])(() => {
if (!ref.current) {
return undefined;
}
let stale = false;
handleTransition({
in: inProp,
element: ref.current,
initial: isInitialRef.current,
isStale: () => stale
});
return () => {
stale = true;
};
}, [inProp, handleTransition]);
(0,_restart_hooks_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_2__["default"])(() => {
isInitialRef.current = false;
// this is for strict mode
return () => {
isInitialRef.current = true;
};
}, []);
return ref;
}
/**
* Adapts an imperative transition function to a subset of the RTG `` component API.
*
* ImperativeTransition does not support mounting options or `appear` at the moment, meaning
* that it always acts like: `mountOnEnter={true} unmountOnExit={true} appear={true}`
*/
function ImperativeTransition({
children,
in: inProp,
onExited,
onEntered,
transition
}) {
const [exited, setExited] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(!inProp);
// TODO: I think this needs to be in an effect
if (inProp && exited) {
setExited(false);
}
const ref = useTransition({
in: !!inProp,
onTransition: options => {
const onFinish = () => {
if (options.isStale()) return;
if (options.in) {
onEntered == null ? void 0 : onEntered(options.element, options.initial);
} else {
setExited(true);
onExited == null ? void 0 : onExited(options.element);
}
};
Promise.resolve(transition(options)).then(onFinish, error => {
if (!options.in) setExited(true);
throw error;
});
}
});
const combinedRef = (0,_restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_0__["default"])(ref, children.ref);
return exited && !inProp ? null : /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_3__.cloneElement)(children, {
ref: combinedRef
});
}
function renderTransition(Component, runTransition, props) {
if (Component) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Component, Object.assign({}, props));
}
if (runTransition) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ImperativeTransition, Object.assign({}, props, {
transition: runTransition
}));
}
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_NoopTransition__WEBPACK_IMPORTED_MODULE_5__["default"], Object.assign({}, props));
}
/***/ }),
/***/ "./node_modules/@restart/ui/esm/Modal.js":
/*!***********************************************!*\
!*** ./node_modules/@restart/ui/esm/Modal.js ***!
\***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var dom_helpers_activeElement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dom-helpers/activeElement */ "./node_modules/dom-helpers/esm/activeElement.js");
/* harmony import */ var dom_helpers_contains__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dom-helpers/contains */ "./node_modules/dom-helpers/esm/contains.js");
/* harmony import */ var dom_helpers_canUseDOM__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dom-helpers/canUseDOM */ "./node_modules/dom-helpers/esm/canUseDOM.js");
/* harmony import */ var dom_helpers_listen__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dom-helpers/listen */ "./node_modules/dom-helpers/esm/listen.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
/* harmony import */ var _restart_hooks_useMounted__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @restart/hooks/useMounted */ "./node_modules/@restart/hooks/esm/useMounted.js");
/* harmony import */ var _restart_hooks_useWillUnmount__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @restart/hooks/useWillUnmount */ "./node_modules/@restart/hooks/esm/useWillUnmount.js");
/* harmony import */ var _restart_hooks_usePrevious__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @restart/hooks/usePrevious */ "./node_modules/@restart/hooks/esm/usePrevious.js");
/* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
/* harmony import */ var _ModalManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ModalManager */ "./node_modules/@restart/ui/esm/ModalManager.js");
/* harmony import */ var _useWaitForDOMRef__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./useWaitForDOMRef */ "./node_modules/@restart/ui/esm/useWaitForDOMRef.js");
/* harmony import */ var _useWindow__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./useWindow */ "./node_modules/@restart/ui/esm/useWindow.js");
/* harmony import */ var _ImperativeTransition__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./ImperativeTransition */ "./node_modules/@restart/ui/esm/ImperativeTransition.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./node_modules/@restart/ui/esm/utils.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
const _excluded = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
/* eslint-disable @typescript-eslint/no-use-before-define, react/prop-types */
let manager;
function getManager(window) {
if (!manager) manager = new _ModalManager__WEBPACK_IMPORTED_MODULE_11__["default"]({
ownerDocument: window == null ? void 0 : window.document
});
return manager;
}
function useModalManager(provided) {
const window = (0,_useWindow__WEBPACK_IMPORTED_MODULE_12__["default"])();
const modalManager = provided || getManager(window);
const modal = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)({
dialog: null,
backdrop: null
});
return Object.assign(modal.current, {
add: () => modalManager.add(modal.current),
remove: () => modalManager.remove(modal.current),
isTopModal: () => modalManager.isTopModal(modal.current),
setDialogRef: (0,react__WEBPACK_IMPORTED_MODULE_4__.useCallback)(ref => {
modal.current.dialog = ref;
}, []),
setBackdropRef: (0,react__WEBPACK_IMPORTED_MODULE_4__.useCallback)(ref => {
modal.current.backdrop = ref;
}, [])
});
}
const Modal = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_4__.forwardRef)((_ref, ref) => {
let {
show = false,
role = 'dialog',
className,
style,
children,
backdrop = true,
keyboard = true,
onBackdropClick,
onEscapeKeyDown,
transition,
runTransition,
backdropTransition,
runBackdropTransition,
autoFocus = true,
enforceFocus = true,
restoreFocus = true,
restoreFocusOptions,
renderDialog,
renderBackdrop = props => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", Object.assign({}, props)),
manager: providedManager,
container: containerRef,
onShow,
onHide = () => {},
onExit,
onExited,
onExiting,
onEnter,
onEntering,
onEntered
} = _ref,
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
const ownerWindow = (0,_useWindow__WEBPACK_IMPORTED_MODULE_12__["default"])();
const container = (0,_useWaitForDOMRef__WEBPACK_IMPORTED_MODULE_13__["default"])(containerRef);
const modal = useModalManager(providedManager);
const isMounted = (0,_restart_hooks_useMounted__WEBPACK_IMPORTED_MODULE_6__["default"])();
const prevShow = (0,_restart_hooks_usePrevious__WEBPACK_IMPORTED_MODULE_8__["default"])(show);
const [exited, setExited] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!show);
const lastFocusRef = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
(0,react__WEBPACK_IMPORTED_MODULE_4__.useImperativeHandle)(ref, () => modal, [modal]);
if (dom_helpers_canUseDOM__WEBPACK_IMPORTED_MODULE_2__["default"] && !prevShow && show) {
lastFocusRef.current = (0,dom_helpers_activeElement__WEBPACK_IMPORTED_MODULE_0__["default"])(ownerWindow == null ? void 0 : ownerWindow.document);
}
// TODO: I think this needs to be in an effect
if (show && exited) {
setExited(false);
}
const handleShow = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_9__["default"])(() => {
modal.add();
removeKeydownListenerRef.current = (0,dom_helpers_listen__WEBPACK_IMPORTED_MODULE_3__["default"])(document, 'keydown', handleDocumentKeyDown);
removeFocusListenerRef.current = (0,dom_helpers_listen__WEBPACK_IMPORTED_MODULE_3__["default"])(document, 'focus',
// the timeout is necessary b/c this will run before the new modal is mounted
// and so steals focus from it
() => setTimeout(handleEnforceFocus), true);
if (onShow) {
onShow();
}
// autofocus after onShow to not trigger a focus event for previous
// modals before this one is shown.
if (autoFocus) {
var _modal$dialog$ownerDo, _modal$dialog;
const currentActiveElement = (0,dom_helpers_activeElement__WEBPACK_IMPORTED_MODULE_0__["default"])((_modal$dialog$ownerDo = (_modal$dialog = modal.dialog) == null ? void 0 : _modal$dialog.ownerDocument) != null ? _modal$dialog$ownerDo : ownerWindow == null ? void 0 : ownerWindow.document);
if (modal.dialog && currentActiveElement && !(0,dom_helpers_contains__WEBPACK_IMPORTED_MODULE_1__["default"])(modal.dialog, currentActiveElement)) {
lastFocusRef.current = currentActiveElement;
modal.dialog.focus();
}
}
});
const handleHide = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_9__["default"])(() => {
modal.remove();
removeKeydownListenerRef.current == null ? void 0 : removeKeydownListenerRef.current();
removeFocusListenerRef.current == null ? void 0 : removeFocusListenerRef.current();
if (restoreFocus) {
var _lastFocusRef$current;
// Support: <=IE11 doesn't support `focus()` on svg elements (RB: #917)
(_lastFocusRef$current = lastFocusRef.current) == null ? void 0 : _lastFocusRef$current.focus == null ? void 0 : _lastFocusRef$current.focus(restoreFocusOptions);
lastFocusRef.current = null;
}
});
// TODO: try and combine these effects: https://github.com/react-bootstrap/react-overlays/pull/794#discussion_r409954120
// Show logic when:
// - show is `true` _and_ `container` has resolved
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
if (!show || !container) return;
handleShow();
}, [show, container, /* should never change: */handleShow]);
// Hide cleanup logic when:
// - `exited` switches to true
// - component unmounts;
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
if (!exited) return;
handleHide();
}, [exited, handleHide]);
(0,_restart_hooks_useWillUnmount__WEBPACK_IMPORTED_MODULE_7__["default"])(() => {
handleHide();
});
// --------------------------------
const handleEnforceFocus = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_9__["default"])(() => {
if (!enforceFocus || !isMounted() || !modal.isTopModal()) {
return;
}
const currentActiveElement = (0,dom_helpers_activeElement__WEBPACK_IMPORTED_MODULE_0__["default"])(ownerWindow == null ? void 0 : ownerWindow.document);
if (modal.dialog && currentActiveElement && !(0,dom_helpers_contains__WEBPACK_IMPORTED_MODULE_1__["default"])(modal.dialog, currentActiveElement)) {
modal.dialog.focus();
}
});
const handleBackdropClick = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_9__["default"])(e => {
if (e.target !== e.currentTarget) {
return;
}
onBackdropClick == null ? void 0 : onBackdropClick(e);
if (backdrop === true) {
onHide();
}
});
const handleDocumentKeyDown = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_9__["default"])(e => {
if (keyboard && (0,_utils__WEBPACK_IMPORTED_MODULE_14__.isEscKey)(e) && modal.isTopModal()) {
onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(e);
if (!e.defaultPrevented) {
onHide();
}
}
});
const removeFocusListenerRef = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)();
const removeKeydownListenerRef = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)();
const handleHidden = (...args) => {
setExited(true);
onExited == null ? void 0 : onExited(...args);
};
if (!container) {
return null;
}
const dialogProps = Object.assign({
role,
ref: modal.setDialogRef,
// apparently only works on the dialog role element
'aria-modal': role === 'dialog' ? true : undefined
}, rest, {
style,
className,
tabIndex: -1
});
let dialog = renderDialog ? renderDialog(dialogProps) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", Object.assign({}, dialogProps, {
children: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.cloneElement(children, {
role: 'document'
})
}));
dialog = (0,_ImperativeTransition__WEBPACK_IMPORTED_MODULE_15__.renderTransition)(transition, runTransition, {
unmountOnExit: true,
mountOnEnter: true,
appear: true,
in: !!show,
onExit,
onExiting,
onExited: handleHidden,
onEnter,
onEntering,
onEntered,
children: dialog
});
let backdropElement = null;
if (backdrop) {
backdropElement = renderBackdrop({
ref: modal.setBackdropRef,
onClick: handleBackdropClick
});
backdropElement = (0,_ImperativeTransition__WEBPACK_IMPORTED_MODULE_15__.renderTransition)(backdropTransition, runBackdropTransition, {
in: !!show,
appear: true,
mountOnEnter: true,
unmountOnExit: true,
children: backdropElement
});
}
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, {
children: /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_5__.createPortal( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, {
children: [backdropElement, dialog]
}), container)
});
});
Modal.displayName = 'Modal';
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Object.assign(Modal, {
Manager: _ModalManager__WEBPACK_IMPORTED_MODULE_11__["default"]
}));
/***/ }),
/***/ "./node_modules/@restart/ui/esm/ModalManager.js":
/*!******************************************************!*\
!*** ./node_modules/@restart/ui/esm/ModalManager.js ***!
\******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ OPEN_DATA_ATTRIBUTE: () => (/* binding */ OPEN_DATA_ATTRIBUTE),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var dom_helpers_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dom-helpers/css */ "./node_modules/dom-helpers/esm/css.js");
/* harmony import */ var _DataKey__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DataKey */ "./node_modules/@restart/ui/esm/DataKey.js");
/* harmony import */ var _getScrollbarWidth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getScrollbarWidth */ "./node_modules/@restart/ui/esm/getScrollbarWidth.js");
const OPEN_DATA_ATTRIBUTE = (0,_DataKey__WEBPACK_IMPORTED_MODULE_1__.dataAttr)('modal-open');
/**
* Manages a stack of Modals as well as ensuring
* body scrolling is is disabled and padding accounted for
*/
class ModalManager {
constructor({
ownerDocument,
handleContainerOverflow = true,
isRTL = false
} = {}) {
this.handleContainerOverflow = handleContainerOverflow;
this.isRTL = isRTL;
this.modals = [];
this.ownerDocument = ownerDocument;
}
getScrollbarWidth() {
return (0,_getScrollbarWidth__WEBPACK_IMPORTED_MODULE_2__["default"])(this.ownerDocument);
}
getElement() {
return (this.ownerDocument || document).body;
}
setModalAttributes(_modal) {
// For overriding
}
removeModalAttributes(_modal) {
// For overriding
}
setContainerStyle(containerState) {
const style = {
overflow: 'hidden'
};
// we are only interested in the actual `style` here
// because we will override it
const paddingProp = this.isRTL ? 'paddingLeft' : 'paddingRight';
const container = this.getElement();
containerState.style = {
overflow: container.style.overflow,
[paddingProp]: container.style[paddingProp]
};
if (containerState.scrollBarWidth) {
// use computed style, here to get the real padding
// to add our scrollbar width
style[paddingProp] = `${parseInt((0,dom_helpers_css__WEBPACK_IMPORTED_MODULE_0__["default"])(container, paddingProp) || '0', 10) + containerState.scrollBarWidth}px`;
}
container.setAttribute(OPEN_DATA_ATTRIBUTE, '');
(0,dom_helpers_css__WEBPACK_IMPORTED_MODULE_0__["default"])(container, style);
}
reset() {
[...this.modals].forEach(m => this.remove(m));
}
removeContainerStyle(containerState) {
const container = this.getElement();
container.removeAttribute(OPEN_DATA_ATTRIBUTE);
Object.assign(container.style, containerState.style);
}
add(modal) {
let modalIdx = this.modals.indexOf(modal);
if (modalIdx !== -1) {
return modalIdx;
}
modalIdx = this.modals.length;
this.modals.push(modal);
this.setModalAttributes(modal);
if (modalIdx !== 0) {
return modalIdx;
}
this.state = {
scrollBarWidth: this.getScrollbarWidth(),
style: {}
};
if (this.handleContainerOverflow) {
this.setContainerStyle(this.state);
}
return modalIdx;
}
remove(modal) {
const modalIdx = this.modals.indexOf(modal);
if (modalIdx === -1) {
return;
}
this.modals.splice(modalIdx, 1);
// if that was the last modal in a container,
// clean up the container
if (!this.modals.length && this.handleContainerOverflow) {
this.removeContainerStyle(this.state);
}
this.removeModalAttributes(modal);
}
isTopModal(modal) {
return !!this.modals.length && this.modals[this.modals.length - 1] === modal;
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModalManager);
/***/ }),
/***/ "./node_modules/@restart/ui/esm/NoopTransition.js":
/*!********************************************************!*\
!*** ./node_modules/@restart/ui/esm/NoopTransition.js ***!
\********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
/* harmony import */ var _restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @restart/hooks/useMergedRefs */ "./node_modules/@restart/hooks/esm/useMergedRefs.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
function NoopTransition({
children,
in: inProp,
onExited,
mountOnEnter,
unmountOnExit
}) {
const ref = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
const hasEnteredRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(inProp);
const handleExited = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(onExited);
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
if (inProp) hasEnteredRef.current = true;else {
handleExited(ref.current);
}
}, [inProp, handleExited]);
const combinedRef = (0,_restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_1__["default"])(ref, children.ref);
const child = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(children, {
ref: combinedRef
});
if (inProp) return child;
if (unmountOnExit) {
return null;
}
if (!hasEnteredRef.current && mountOnEnter) {
return null;
}
return child;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NoopTransition);
/***/ }),
/***/ "./node_modules/@restart/ui/esm/Overlay.js":
/*!*************************************************!*\
!*** ./node_modules/@restart/ui/esm/Overlay.js ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
/* harmony import */ var _restart_hooks_useCallbackRef__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @restart/hooks/useCallbackRef */ "./node_modules/@restart/hooks/esm/useCallbackRef.js");
/* harmony import */ var _restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @restart/hooks/useMergedRefs */ "./node_modules/@restart/hooks/esm/useMergedRefs.js");
/* harmony import */ var _usePopper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./usePopper */ "./node_modules/@restart/ui/esm/usePopper.js");
/* harmony import */ var _useRootClose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./useRootClose */ "./node_modules/@restart/ui/esm/useRootClose.js");
/* harmony import */ var _useWaitForDOMRef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useWaitForDOMRef */ "./node_modules/@restart/ui/esm/useWaitForDOMRef.js");
/* harmony import */ var _mergeOptionsWithPopperConfig__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mergeOptionsWithPopperConfig */ "./node_modules/@restart/ui/esm/mergeOptionsWithPopperConfig.js");
/* harmony import */ var _ImperativeTransition__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ImperativeTransition */ "./node_modules/@restart/ui/esm/ImperativeTransition.js");
/**
* Built on top of `Popper.js`, the overlay component is
* great for custom tooltip overlays.
*/
const Overlay = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, outerRef) => {
const {
flip,
offset,
placement,
containerPadding,
popperConfig = {},
transition: Transition,
runTransition
} = props;
const [rootElement, attachRef] = (0,_restart_hooks_useCallbackRef__WEBPACK_IMPORTED_MODULE_2__["default"])();
const [arrowElement, attachArrowRef] = (0,_restart_hooks_useCallbackRef__WEBPACK_IMPORTED_MODULE_2__["default"])();
const mergedRef = (0,_restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_3__["default"])(attachRef, outerRef);
const container = (0,_useWaitForDOMRef__WEBPACK_IMPORTED_MODULE_4__["default"])(props.container);
const target = (0,_useWaitForDOMRef__WEBPACK_IMPORTED_MODULE_4__["default"])(props.target);
const [exited, setExited] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!props.show);
const popper = (0,_usePopper__WEBPACK_IMPORTED_MODULE_5__["default"])(target, rootElement, (0,_mergeOptionsWithPopperConfig__WEBPACK_IMPORTED_MODULE_6__["default"])({
placement,
enableEvents: !!props.show,
containerPadding: containerPadding || 5,
flip,
offset,
arrowElement,
popperConfig
}));
// TODO: I think this needs to be in an effect
if (props.show && exited) {
setExited(false);
}
const handleHidden = (...args) => {
setExited(true);
if (props.onExited) {
props.onExited(...args);
}
};
// Don't un-render the overlay while it's transitioning out.
const mountOverlay = props.show || !exited;
(0,_useRootClose__WEBPACK_IMPORTED_MODULE_7__["default"])(rootElement, props.onHide, {
disabled: !props.rootClose || props.rootCloseDisabled,
clickTrigger: props.rootCloseEvent
});
if (!mountOverlay) {
// Don't bother showing anything if we don't have to.
return null;
}
const {
onExit,
onExiting,
onEnter,
onEntering,
onEntered
} = props;
let child = props.children(Object.assign({}, popper.attributes.popper, {
style: popper.styles.popper,
ref: mergedRef
}), {
popper,
placement,
show: !!props.show,
arrowProps: Object.assign({}, popper.attributes.arrow, {
style: popper.styles.arrow,
ref: attachArrowRef
})
});
child = (0,_ImperativeTransition__WEBPACK_IMPORTED_MODULE_8__.renderTransition)(Transition, runTransition, {
in: !!props.show,
appear: true,
mountOnEnter: true,
unmountOnExit: true,
children: child,
onExit,
onExiting,
onExited: handleHidden,
onEnter,
onEntering,
onEntered
});
return container ? /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal(child, container) : null;
});
Overlay.displayName = 'Overlay';
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Overlay);
/***/ }),
/***/ "./node_modules/@restart/ui/esm/getScrollbarWidth.js":
/*!***********************************************************!*\
!*** ./node_modules/@restart/ui/esm/getScrollbarWidth.js ***!
\***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getBodyScrollbarWidth)
/* harmony export */ });
/**
* Get the width of the vertical window scrollbar if it's visible
*/
function getBodyScrollbarWidth(ownerDocument = document) {
const window = ownerDocument.defaultView;
return Math.abs(window.innerWidth - ownerDocument.documentElement.clientWidth);
}
/***/ }),
/***/ "./node_modules/@restart/ui/esm/mergeOptionsWithPopperConfig.js":
/*!**********************************************************************!*\
!*** ./node_modules/@restart/ui/esm/mergeOptionsWithPopperConfig.js ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ mergeOptionsWithPopperConfig),
/* harmony export */ toModifierArray: () => (/* binding */ toModifierArray),
/* harmony export */ toModifierMap: () => (/* binding */ toModifierMap)
/* harmony export */ });
function toModifierMap(modifiers) {
const result = {};
if (!Array.isArray(modifiers)) {
return modifiers || result;
}
// eslint-disable-next-line no-unused-expressions
modifiers == null ? void 0 : modifiers.forEach(m => {
result[m.name] = m;
});
return result;
}
function toModifierArray(map = {}) {
if (Array.isArray(map)) return map;
return Object.keys(map).map(k => {
map[k].name = k;
return map[k];
});
}
function mergeOptionsWithPopperConfig({
enabled,
enableEvents,
placement,
flip,
offset,
fixed,
containerPadding,
arrowElement,
popperConfig = {}
}) {
var _modifiers$eventListe, _modifiers$preventOve, _modifiers$preventOve2, _modifiers$offset, _modifiers$arrow;
const modifiers = toModifierMap(popperConfig.modifiers);
return Object.assign({}, popperConfig, {
placement,
enabled,
strategy: fixed ? 'fixed' : popperConfig.strategy,
modifiers: toModifierArray(Object.assign({}, modifiers, {
eventListeners: {
enabled: enableEvents,
options: (_modifiers$eventListe = modifiers.eventListeners) == null ? void 0 : _modifiers$eventListe.options
},
preventOverflow: Object.assign({}, modifiers.preventOverflow, {
options: containerPadding ? Object.assign({
padding: containerPadding
}, (_modifiers$preventOve = modifiers.preventOverflow) == null ? void 0 : _modifiers$preventOve.options) : (_modifiers$preventOve2 = modifiers.preventOverflow) == null ? void 0 : _modifiers$preventOve2.options
}),
offset: {
options: Object.assign({
offset
}, (_modifiers$offset = modifiers.offset) == null ? void 0 : _modifiers$offset.options)
},
arrow: Object.assign({}, modifiers.arrow, {
enabled: !!arrowElement,
options: Object.assign({}, (_modifiers$arrow = modifiers.arrow) == null ? void 0 : _modifiers$arrow.options, {
element: arrowElement
})
}),
flip: Object.assign({
enabled: !!flip
}, modifiers.flip)
}))
});
}
/***/ }),
/***/ "./node_modules/@restart/ui/esm/popper.js":
/*!************************************************!*\
!*** ./node_modules/@restart/ui/esm/popper.js ***!
\************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createPopper: () => (/* binding */ createPopper),
/* harmony export */ placements: () => (/* reexport safe */ _popperjs_core_lib_enums__WEBPACK_IMPORTED_MODULE_9__.placements)
/* harmony export */ });
/* harmony import */ var _popperjs_core_lib_modifiers_arrow__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @popperjs/core/lib/modifiers/arrow */ "./node_modules/@popperjs/core/lib/modifiers/arrow.js");
/* harmony import */ var _popperjs_core_lib_modifiers_computeStyles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @popperjs/core/lib/modifiers/computeStyles */ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js");
/* harmony import */ var _popperjs_core_lib_modifiers_eventListeners__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @popperjs/core/lib/modifiers/eventListeners */ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js");
/* harmony import */ var _popperjs_core_lib_modifiers_flip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @popperjs/core/lib/modifiers/flip */ "./node_modules/@popperjs/core/lib/modifiers/flip.js");
/* harmony import */ var _popperjs_core_lib_modifiers_hide__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @popperjs/core/lib/modifiers/hide */ "./node_modules/@popperjs/core/lib/modifiers/hide.js");
/* harmony import */ var _popperjs_core_lib_modifiers_offset__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @popperjs/core/lib/modifiers/offset */ "./node_modules/@popperjs/core/lib/modifiers/offset.js");
/* harmony import */ var _popperjs_core_lib_modifiers_popperOffsets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @popperjs/core/lib/modifiers/popperOffsets */ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js");
/* harmony import */ var _popperjs_core_lib_modifiers_preventOverflow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @popperjs/core/lib/modifiers/preventOverflow */ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js");
/* harmony import */ var _popperjs_core_lib_enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @popperjs/core/lib/enums */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _popperjs_core_lib_popper_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @popperjs/core/lib/popper-base */ "./node_modules/@popperjs/core/lib/createPopper.js");
// For the common JS build we will turn this file into a bundle with no imports.
// This is b/c the Popper lib is all esm files, and would break in a common js only environment
const createPopper = (0,_popperjs_core_lib_popper_base__WEBPACK_IMPORTED_MODULE_0__.popperGenerator)({
defaultModifiers: [_popperjs_core_lib_modifiers_hide__WEBPACK_IMPORTED_MODULE_1__["default"], _popperjs_core_lib_modifiers_popperOffsets__WEBPACK_IMPORTED_MODULE_2__["default"], _popperjs_core_lib_modifiers_computeStyles__WEBPACK_IMPORTED_MODULE_3__["default"], _popperjs_core_lib_modifiers_eventListeners__WEBPACK_IMPORTED_MODULE_4__["default"], _popperjs_core_lib_modifiers_offset__WEBPACK_IMPORTED_MODULE_5__["default"], _popperjs_core_lib_modifiers_flip__WEBPACK_IMPORTED_MODULE_6__["default"], _popperjs_core_lib_modifiers_preventOverflow__WEBPACK_IMPORTED_MODULE_7__["default"], _popperjs_core_lib_modifiers_arrow__WEBPACK_IMPORTED_MODULE_8__["default"]]
});
/***/ }),
/***/ "./node_modules/@restart/ui/esm/useClickOutside.js":
/*!*********************************************************!*\
!*** ./node_modules/@restart/ui/esm/useClickOutside.js ***!
\*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */ getRefTarget: () => (/* binding */ getRefTarget)
/* harmony export */ });
/* harmony import */ var dom_helpers_contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dom-helpers/contains */ "./node_modules/dom-helpers/esm/contains.js");
/* harmony import */ var dom_helpers_listen__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dom-helpers/listen */ "./node_modules/dom-helpers/esm/listen.js");
/* harmony import */ var dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/esm/ownerDocument.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
/* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
/* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_5__);
const noop = () => {};
function isLeftClickEvent(event) {
return event.button === 0;
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
const getRefTarget = ref => ref && ('current' in ref ? ref.current : ref);
const InitialTriggerEvents = {
click: 'mousedown',
mouseup: 'mousedown',
pointerup: 'pointerdown'
};
/**
* The `useClickOutside` hook registers your callback on the document that fires
* when a pointer event is registered outside of the provided ref or element.
*
* @param {Ref| HTMLElement} ref The element boundary
* @param {function} onClickOutside
* @param {object=} options
* @param {boolean=} options.disabled
* @param {string=} options.clickTrigger The DOM event name (click, mousedown, etc) to attach listeners on
*/
function useClickOutside(ref, onClickOutside = noop, {
disabled,
clickTrigger = 'click'
} = {}) {
const preventMouseClickOutsideRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(false);
const waitingForTrigger = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(false);
const handleMouseCapture = (0,react__WEBPACK_IMPORTED_MODULE_3__.useCallback)(e => {
const currentTarget = getRefTarget(ref);
warning__WEBPACK_IMPORTED_MODULE_5___default()(!!currentTarget, 'ClickOutside captured a close event but does not have a ref to compare it to. ' + 'useClickOutside(), should be passed a ref that resolves to a DOM node');
preventMouseClickOutsideRef.current = !currentTarget || isModifiedEvent(e) || !isLeftClickEvent(e) || !!(0,dom_helpers_contains__WEBPACK_IMPORTED_MODULE_0__["default"])(currentTarget, e.target) || waitingForTrigger.current;
waitingForTrigger.current = false;
}, [ref]);
const handleInitialMouse = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(e => {
const currentTarget = getRefTarget(ref);
if (currentTarget && (0,dom_helpers_contains__WEBPACK_IMPORTED_MODULE_0__["default"])(currentTarget, e.target)) {
waitingForTrigger.current = true;
}
});
const handleMouse = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(e => {
if (!preventMouseClickOutsideRef.current) {
onClickOutside(e);
}
});
(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
var _ownerWindow$event, _ownerWindow$parent;
if (disabled || ref == null) return undefined;
const doc = (0,dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_2__["default"])(getRefTarget(ref));
const ownerWindow = doc.defaultView || window;
// Store the current event to avoid triggering handlers immediately
// For things rendered in an iframe, the event might originate on the parent window
// so we should fall back to that global event if the local one doesn't exist
// https://github.com/facebook/react/issues/20074
let currentEvent = (_ownerWindow$event = ownerWindow.event) != null ? _ownerWindow$event : (_ownerWindow$parent = ownerWindow.parent) == null ? void 0 : _ownerWindow$parent.event;
let removeInitialTriggerListener = null;
if (InitialTriggerEvents[clickTrigger]) {
removeInitialTriggerListener = (0,dom_helpers_listen__WEBPACK_IMPORTED_MODULE_1__["default"])(doc, InitialTriggerEvents[clickTrigger], handleInitialMouse, true);
}
// Use capture for this listener so it fires before React's listener, to
// avoid false positives in the contains() check below if the target DOM
// element is removed in the React mouse callback.
const removeMouseCaptureListener = (0,dom_helpers_listen__WEBPACK_IMPORTED_MODULE_1__["default"])(doc, clickTrigger, handleMouseCapture, true);
const removeMouseListener = (0,dom_helpers_listen__WEBPACK_IMPORTED_MODULE_1__["default"])(doc, clickTrigger, e => {
// skip if this event is the same as the one running when we added the handlers
if (e === currentEvent) {
currentEvent = undefined;
return;
}
handleMouse(e);
});
let mobileSafariHackListeners = [];
if ('ontouchstart' in doc.documentElement) {
mobileSafariHackListeners = [].slice.call(doc.body.children).map(el => (0,dom_helpers_listen__WEBPACK_IMPORTED_MODULE_1__["default"])(el, 'mousemove', noop));
}
return () => {
removeInitialTriggerListener == null ? void 0 : removeInitialTriggerListener();
removeMouseCaptureListener();
removeMouseListener();
mobileSafariHackListeners.forEach(remove => remove());
};
}, [ref, disabled, clickTrigger, handleMouseCapture, handleInitialMouse, handleMouse]);
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useClickOutside);
/***/ }),
/***/ "./node_modules/@restart/ui/esm/usePopper.js":
/*!***************************************************!*\
!*** ./node_modules/@restart/ui/esm/usePopper.js ***!
\***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var dequal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dequal */ "./node_modules/dequal/dist/index.mjs");
/* harmony import */ var _restart_hooks_useSafeState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @restart/hooks/useSafeState */ "./node_modules/@restart/hooks/esm/useSafeState.js");
/* harmony import */ var _popper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./popper */ "./node_modules/@restart/ui/esm/popper.js");
const _excluded = ["enabled", "placement", "strategy", "modifiers"];
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
const disabledApplyStylesModifier = {
name: 'applyStyles',
enabled: false,
phase: 'afterWrite',
fn: () => undefined
};
// until docjs supports type exports...
const ariaDescribedByModifier = {
name: 'ariaDescribedBy',
enabled: true,
phase: 'afterWrite',
effect: ({
state
}) => () => {
const {
reference,
popper
} = state.elements;
if ('removeAttribute' in reference) {
const ids = (reference.getAttribute('aria-describedby') || '').split(',').filter(id => id.trim() !== popper.id);
if (!ids.length) reference.removeAttribute('aria-describedby');else reference.setAttribute('aria-describedby', ids.join(','));
}
},
fn: ({
state
}) => {
var _popper$getAttribute;
const {
popper,
reference
} = state.elements;
const role = (_popper$getAttribute = popper.getAttribute('role')) == null ? void 0 : _popper$getAttribute.toLowerCase();
if (popper.id && role === 'tooltip' && 'setAttribute' in reference) {
const ids = reference.getAttribute('aria-describedby');
if (ids && ids.split(',').indexOf(popper.id) !== -1) {
return;
}
reference.setAttribute('aria-describedby', ids ? `${ids},${popper.id}` : popper.id);
}
}
};
const EMPTY_MODIFIERS = [];
/**
* Position an element relative some reference element using Popper.js
*
* @param referenceElement
* @param popperElement
* @param {object} options
* @param {object=} options.modifiers Popper.js modifiers
* @param {boolean=} options.enabled toggle the popper functionality on/off
* @param {string=} options.placement The popper element placement relative to the reference element
* @param {string=} options.strategy the positioning strategy
* @param {function=} options.onCreate called when the popper is created
* @param {function=} options.onUpdate called when the popper is updated
*
* @returns {UsePopperState} The popper state
*/
function usePopper(referenceElement, popperElement, _ref = {}) {
let {
enabled = true,
placement = 'bottom',
strategy = 'absolute',
modifiers = EMPTY_MODIFIERS
} = _ref,
config = _objectWithoutPropertiesLoose(_ref, _excluded);
const prevModifiers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(modifiers);
const popperInstanceRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
const update = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
var _popperInstanceRef$cu;
(_popperInstanceRef$cu = popperInstanceRef.current) == null ? void 0 : _popperInstanceRef$cu.update();
}, []);
const forceUpdate = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
var _popperInstanceRef$cu2;
(_popperInstanceRef$cu2 = popperInstanceRef.current) == null ? void 0 : _popperInstanceRef$cu2.forceUpdate();
}, []);
const [popperState, setState] = (0,_restart_hooks_useSafeState__WEBPACK_IMPORTED_MODULE_2__["default"])((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
placement,
update,
forceUpdate,
attributes: {},
styles: {
popper: {},
arrow: {}
}
}));
const updateModifier = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
name: 'updateStateModifier',
enabled: true,
phase: 'write',
requires: ['computeStyles'],
fn: ({
state
}) => {
const styles = {};
const attributes = {};
Object.keys(state.elements).forEach(element => {
styles[element] = state.styles[element];
attributes[element] = state.attributes[element];
});
setState({
state,
styles,
attributes,
update,
forceUpdate,
placement: state.placement
});
}
}), [update, forceUpdate, setState]);
const nextModifiers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
if (!(0,dequal__WEBPACK_IMPORTED_MODULE_1__.dequal)(prevModifiers.current, modifiers)) {
prevModifiers.current = modifiers;
}
return prevModifiers.current;
}, [modifiers]);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
if (!popperInstanceRef.current || !enabled) return;
popperInstanceRef.current.setOptions({
placement,
strategy,
modifiers: [...nextModifiers, updateModifier, disabledApplyStylesModifier]
});
}, [strategy, placement, updateModifier, enabled, nextModifiers]);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
if (!enabled || referenceElement == null || popperElement == null) {
return undefined;
}
popperInstanceRef.current = (0,_popper__WEBPACK_IMPORTED_MODULE_3__.createPopper)(referenceElement, popperElement, Object.assign({}, config, {
placement,
strategy,
modifiers: [...nextModifiers, ariaDescribedByModifier, updateModifier]
}));
return () => {
if (popperInstanceRef.current != null) {
popperInstanceRef.current.destroy();
popperInstanceRef.current = undefined;
setState(s => Object.assign({}, s, {
attributes: {},
styles: {
popper: {}
}
}));
}
};
// This is only run once to _create_ the popper
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [enabled, referenceElement, popperElement]);
return popperState;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (usePopper);
/***/ }),
/***/ "./node_modules/@restart/ui/esm/useRootClose.js":
/*!******************************************************!*\
!*** ./node_modules/@restart/ui/esm/useRootClose.js ***!
\******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var dom_helpers_listen__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dom-helpers/listen */ "./node_modules/dom-helpers/esm/listen.js");
/* harmony import */ var dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/esm/ownerDocument.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
/* harmony import */ var _useClickOutside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useClickOutside */ "./node_modules/@restart/ui/esm/useClickOutside.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@restart/ui/esm/utils.js");
const noop = () => {};
/**
* The `useRootClose` hook registers your callback on the document
* when rendered. Powers the `` component. This is used achieve modal
* style behavior where your callback is triggered when the user tries to
* interact with the rest of the document or hits the `esc` key.
*
* @param {Ref| HTMLElement} ref The element boundary
* @param {function} onRootClose
* @param {object=} options
* @param {boolean=} options.disabled
* @param {string=} options.clickTrigger The DOM event name (click, mousedown, etc) to attach listeners on
*/
function useRootClose(ref, onRootClose, {
disabled,
clickTrigger
} = {}) {
const onClose = onRootClose || noop;
(0,_useClickOutside__WEBPACK_IMPORTED_MODULE_4__["default"])(ref, onClose, {
disabled,
clickTrigger
});
const handleKeyUp = (0,_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_3__["default"])(e => {
if ((0,_utils__WEBPACK_IMPORTED_MODULE_5__.isEscKey)(e)) {
onClose(e);
}
});
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
if (disabled || ref == null) return undefined;
const doc = (0,dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_useClickOutside__WEBPACK_IMPORTED_MODULE_4__.getRefTarget)(ref));
// Store the current event to avoid triggering handlers immediately
// https://github.com/facebook/react/issues/20074
let currentEvent = (doc.defaultView || window).event;
const removeKeyupListener = (0,dom_helpers_listen__WEBPACK_IMPORTED_MODULE_0__["default"])(doc, 'keyup', e => {
// skip if this event is the same as the one running when we added the handlers
if (e === currentEvent) {
currentEvent = undefined;
return;
}
handleKeyUp(e);
});
return () => {
removeKeyupListener();
};
}, [ref, disabled, handleKeyUp]);
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useRootClose);
/***/ }),
/***/ "./node_modules/@restart/ui/esm/useWaitForDOMRef.js":
/*!**********************************************************!*\
!*** ./node_modules/@restart/ui/esm/useWaitForDOMRef.js ***!
\**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ useWaitForDOMRef),
/* harmony export */ resolveContainerRef: () => (/* binding */ resolveContainerRef)
/* harmony export */ });
/* harmony import */ var dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/esm/ownerDocument.js");
/* harmony import */ var dom_helpers_canUseDOM__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dom-helpers/canUseDOM */ "./node_modules/dom-helpers/esm/canUseDOM.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _useWindow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useWindow */ "./node_modules/@restart/ui/esm/useWindow.js");
const resolveContainerRef = (ref, document) => {
if (!dom_helpers_canUseDOM__WEBPACK_IMPORTED_MODULE_1__["default"]) return null;
if (ref == null) return (document || (0,dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_0__["default"])()).body;
if (typeof ref === 'function') ref = ref();
if (ref && 'current' in ref) ref = ref.current;
if (ref && ('nodeType' in ref || ref.getBoundingClientRect)) return ref;
return null;
};
function useWaitForDOMRef(ref, onResolved) {
const window = (0,_useWindow__WEBPACK_IMPORTED_MODULE_3__["default"])();
const [resolvedRef, setRef] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(() => resolveContainerRef(ref, window == null ? void 0 : window.document));
if (!resolvedRef) {
const earlyRef = resolveContainerRef(ref);
if (earlyRef) setRef(earlyRef);
}
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
if (onResolved && resolvedRef) {
onResolved(resolvedRef);
}
}, [onResolved, resolvedRef]);
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
const nextRef = resolveContainerRef(ref);
if (nextRef !== resolvedRef) {
setRef(nextRef);
}
}, [ref, resolvedRef]);
return resolvedRef;
}
/***/ }),
/***/ "./node_modules/@restart/ui/esm/useWindow.js":
/*!***************************************************!*\
!*** ./node_modules/@restart/ui/esm/useWindow.js ***!
\***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ WindowProvider: () => (/* binding */ WindowProvider),
/* harmony export */ "default": () => (/* binding */ useWindow)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var dom_helpers_canUseDOM__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dom-helpers/canUseDOM */ "./node_modules/dom-helpers/esm/canUseDOM.js");
const Context = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(dom_helpers_canUseDOM__WEBPACK_IMPORTED_MODULE_1__["default"] ? window : undefined);
const WindowProvider = Context.Provider;
/**
* The document "window" placed in React context. Helpful for determining
* SSR context, or when rendering into an iframe.
*
* @returns the current window
*/
function useWindow() {
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Context);
}
/***/ }),
/***/ "./node_modules/@restart/ui/esm/utils.js":
/*!***********************************************!*\
!*** ./node_modules/@restart/ui/esm/utils.js ***!
\***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ isEscKey: () => (/* binding */ isEscKey)
/* harmony export */ });
/* eslint-disable import/prefer-default-export */
function isEscKey(e) {
return e.code === 'Escape' || e.keyCode === 27;
}
/***/ }),
/***/ "./static/js/shop/Backlog.jsx":
/*!************************************!*\
!*** ./static/js/shop/Backlog.jsx ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Backlog: () => (/* binding */ Backlog)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @hello-pangea/dnd */ "./node_modules/@hello-pangea/dnd/dist/dnd.esm.js");
/* harmony import */ var _ProductItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ProductItem */ "./static/js/shop/ProductItem.jsx");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
/**
* Component that renders the backlog in the aside
*/
function Backlog() {
var data = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.groups;
});
var items = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.cards;
});
var onClickToggleMobileSideMenu = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.switchSideMenu;
});
var isMobile = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.isMobile;
});
var ordered_groups = data.categories.map(function (groupItem) {
return {
name: groupItem.name,
items: groupItem.itemIds.map(function (itemId) {
return items[itemId];
})
};
});
var item_index = -1;
var groups = ordered_groups.map(function (group, g_index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "accordion-item",
key: "".concat(group.name)
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h2", {
className: "accordion-header"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
className: "accordion-button collapsed",
type: "button",
"data-bs-toggle": "collapse",
"data-bs-target": "#collapse".concat(g_index),
"aria-expanded": "true",
"aria-controls": "collapse".concat(g_index)
}, group.name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
id: "collapse".concat(g_index),
className: "accordion-collapse collapse",
"aria-labelledby": "headingOne",
"data-bs-parent": "#accordion_categories"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "accordion-body"
}, group.items.map(function (item) {
item_index++;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ProductItem__WEBPACK_IMPORTED_MODULE_2__.ProductItem, {
card_index: item_index,
key: item.id
});
}))));
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_3__.Droppable, {
droppableId: data.id,
isDropDisabled: false
}, function (provided) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({
className: "backlog-container",
ref: provided.innerRef
}, provided.droppableProps), isMobile ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "mobileCloseMenu"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
onClick: onClickToggleMobileSideMenu
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-close-white.svg",
alt: "add"
}))) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "accordion accordion-flush",
id: "accordion_categories"
}, groups), provided.placeholder && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
display: 'none'
}
}, provided.placeholder));
});
}
/***/ }),
/***/ "./static/js/shop/CardWarnings.jsx":
/*!*****************************************!*\
!*** ./static/js/shop/CardWarnings.jsx ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CardWarnings: () => (/* binding */ CardWarnings),
/* harmony export */ WarningIndicator: () => (/* binding */ WarningIndicator)
/* harmony export */ });
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/OverlayTrigger.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _warnings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./warnings */ "./static/js/shop/warnings.js");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
var _excluded = ["arrowProps", "hasDoneInitialMeasure", "show", "style"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function CardWarnings(_ref) {
var crate_index = _ref.crate_index,
card_index = _ref.card_index;
var warnings = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].show_warnings;
}, _utils__WEBPACK_IMPORTED_MODULE_2__.compareArraysLevelOne);
var max_level = (0,_warnings__WEBPACK_IMPORTED_MODULE_3__.MaxLevel)(warnings);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["default"], {
placement: "bottom",
trigger: ['click', 'hover', 'focus'],
overlay: function overlay(_ref2) {
var arrowProps = _ref2.arrowProps,
hasDoneInitialMeasure = _ref2.hasDoneInitialMeasure,
show = _ref2.show,
style = _ref2.style,
props = _objectWithoutProperties(_ref2, _excluded);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({
className: "k-popup-warning",
style: _objectSpread(_objectSpread({}, style), {}, {
backgroundColor: max_level.color
})
}, props), warnings.map(function (warning, _i) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
className: "rule warning",
key: "warnmsg_".concat(card_index, "_").concat(warning.name)
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", null, warning.message));
}));
},
rootClose: true
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
className: "alert-warning p-0",
src: max_level.icon
}));
}
function WarningIndicator(_ref3) {
var crate_index = _ref3.crate_index,
card_index = _ref3.card_index;
var warnings = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].show_warnings;
}, _utils__WEBPACK_IMPORTED_MODULE_2__.compareArraysLevelOne);
var max_level = (0,_warnings__WEBPACK_IMPORTED_MODULE_3__.MaxLevel)(warnings);
return max_level.priority === _warnings__WEBPACK_IMPORTED_MODULE_3__.Levels.warning.priority ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
className: "alert-warning align-self-start d-block",
src: max_level.icon
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
className: "alert-warning align-self-start d-block"
});
}
/***/ }),
/***/ "./static/js/shop/Cart.jsx":
/*!*********************************!*\
!*** ./static/js/shop/Cart.jsx ***!
\*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Cart: () => (/* binding */ Cart)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @hello-pangea/dnd */ "./node_modules/@hello-pangea/dnd/dist/dnd.esm.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var _ProductCartItem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ProductCartItem */ "./static/js/shop/ProductCartItem.jsx");
/* harmony import */ var _FakePlaceholder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FakePlaceholder */ "./static/js/shop/FakePlaceholder.jsx");
/* harmony import */ var _count_resources__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./count_resources */ "./static/js/shop/count_resources.js");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
/**
* Component that displays a list of
*/
function Cart(_ref) {
var crate_index = _ref.crate_index;
var crate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index];
}, function (a, b) {
return (0,_utils__WEBPACK_IMPORTED_MODULE_2__.compareArraysWithIds)(a.items, b.items) && a.occupiedHP === b.occupiedHP && a.crate_mode === b.crate_mode;
});
var crateParams = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crateParams;
});
var nbrOccupied = (0,_count_resources__WEBPACK_IMPORTED_MODULE_3__.hp_to_slots)(crate.occupiedHP);
var nbrSlots = (0,_count_resources__WEBPACK_IMPORTED_MODULE_3__.hp_to_slots)(crateParams(crate.crate_mode).hp);
var products = crate.items.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ProductCartItem__WEBPACK_IMPORTED_MODULE_4__.ProductCartItem, {
card_index: index,
crate_index: crate_index,
first: index === 0,
last: index === crate.items.length - 1 && nbrOccupied >= nbrSlots,
key: item.id
});
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_5__.Droppable, {
droppableId: crate.id,
direction: "horizontal"
}, function (provided, snapshot) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({
ref: provided.innerRef
}, provided.droppableProps, {
style: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.cartStyle)(provided.droppableProps.style, snapshot),
className: "items-cart-list"
}), products, provided.placeholder && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
display: 'none'
}
}, provided.placeholder), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_FakePlaceholder__WEBPACK_IMPORTED_MODULE_6__.FakePlaceholder, {
nToDraw: nbrSlots - nbrOccupied,
isDraggingOver: snapshot.isDraggingOver
}));
});
}
/***/ }),
/***/ "./static/js/shop/Crate.jsx":
/*!**********************************!*\
!*** ./static/js/shop/Crate.jsx ***!
\**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Crate: () => (/* binding */ Crate)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Cart__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Cart */ "./static/js/shop/Cart.jsx");
/* harmony import */ var _CrateMode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CrateMode */ "./static/js/shop/CrateMode.jsx");
/* harmony import */ var _CrateWarnings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CrateWarnings */ "./static/js/shop/CrateWarnings.jsx");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _CrateOptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CrateOptions */ "./static/js/shop/CrateOptions.jsx");
/**
* Component that displays the main crate with reminder rules.
* It includes and rules
*/
function Crate(_ref) {
var crate_index = _ref.crate_index;
var crate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index];
}, function (a, b) {
return a.length === b.length && a.id === b.id;
});
var modes_order = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.modes_order;
});
var onDeleteCrate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.delCrate;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "crate"
}, modes_order.includes(crate.crate_mode) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "crate-bar d-inline-flex justify-content-between"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CrateMode__WEBPACK_IMPORTED_MODULE_2__.CrateMode, {
crate_index: crate_index
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "delete-crate align-self-start align-content-start justify-content-end",
onClick: function onClick() {
return onDeleteCrate(crate.id);
}
}, "Delete crate ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-remove.svg",
alt: "remove"
}))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "crate-products"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Cart__WEBPACK_IMPORTED_MODULE_3__.Cart, {
crate_index: crate_index
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CrateWarnings__WEBPACK_IMPORTED_MODULE_4__.CrateWarnings, {
crate_index: crate_index
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CrateOptions__WEBPACK_IMPORTED_MODULE_5__.CrateOptions, {
crate_index: crate_index
})));
}
/***/ }),
/***/ "./static/js/shop/CrateList.jsx":
/*!**************************************!*\
!*** ./static/js/shop/CrateList.jsx ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CrateList: () => (/* binding */ CrateList)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/Accordion.js");
/* harmony import */ var _Crate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Crate */ "./static/js/shop/Crate.jsx");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
function CrateList() {
var crates = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates;
}, function (a, b) {
return a.length === b.length;
});
var active_crate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.active_crate;
});
var onAddCrate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.newCrate;
});
var setActiveCrate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.setActiveCrate;
});
var onSelectHandler = function onSelectHandler(e) {
// if e === null, that means that an accordion item was collapsed rather than expanded. e will be non-null when an item is expanded
if (e !== null) setActiveCrate(e);else setActiveCrate("");
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["default"], {
id: "accordion_crates",
flush: true,
activeKey: active_crate,
onSelect: onSelectHandler
}, crates.map(function (crate, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["default"].Item, {
eventKey: crate.id,
key: "accordion" + crate.id,
className: "accordion_crates_item"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["default"].Header, null, crate.name ? crate.name : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, "Crate #", "".concat(index)), " "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["default"].Body, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Crate__WEBPACK_IMPORTED_MODULE_3__.Crate, {
crate_index: index
})));
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["default"].Item, {
eventKey: "last",
id: "accordion_crates_add"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["default"].Header, {
onClick: onAddCrate
}, "Add new crate")));
}
/***/ }),
/***/ "./static/js/shop/CrateMode.jsx":
/*!**************************************!*\
!*** ./static/js/shop/CrateMode.jsx ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CrateMode: () => (/* binding */ CrateMode)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/**
* Component that displays crate modes
*/
function CrateMode(_ref) {
var crate_index = _ref.crate_index;
var modes_order = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.modes_order;
});
var crate_modes = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crate_modes;
});
var crate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index];
}, function (a, b) {
return a.id === b.id && a.crate_mode === b.crate_mode;
});
var setMode = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.setCrateMode;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "crate-mode"
}, modes_order.map(function (mode_name, _) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
key: mode_name,
className: crate.crate_mode === mode_name ? 'active' : '',
onClick: function onClick() {
return setMode(crate.id, mode_name);
},
href: "#",
role: "button"
}, crate_modes[mode_name].name);
}));
}
/***/ }),
/***/ "./static/js/shop/CrateOptions.jsx":
/*!*****************************************!*\
!*** ./static/js/shop/CrateOptions.jsx ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CrateOptions: () => (/* binding */ CrateOptions)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _options_Options__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./options/Options */ "./static/js/shop/options/Options.jsx");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function CrateOptions(_ref) {
var crate_index = _ref.crate_index;
var crate_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id;
});
var optionsLogic = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crate_options;
});
var updateOptions = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.updateCrateOptions;
});
var options_data = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].options_data || {};
});
var options = (0,_options_Options__WEBPACK_IMPORTED_MODULE_2__.ProcessOptions)({
options: optionsLogic,
data: options_data,
id: "crate_options" + crate_id,
target: {
construct: function construct(outvar, value) {
options_data[outvar] = value;
},
update: function update(outvar, value) {
if (outvar in options_data) options_data[outvar] = value;
updateOptions(crate_id, _defineProperty({}, outvar, value));
}
}
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "crate-bar"
}, options);
}
/***/ }),
/***/ "./static/js/shop/CrateWarnings.jsx":
/*!******************************************!*\
!*** ./static/js/shop/CrateWarnings.jsx ***!
\******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CrateWarnings: () => (/* binding */ CrateWarnings)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _warnings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./warnings */ "./static/js/shop/warnings.js");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
function CrateWarnings(_ref) {
var crate_index = _ref.crate_index;
var crate_warnings = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].warnings;
}, _utils__WEBPACK_IMPORTED_MODULE_2__.compareArraysWithIds);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "crate-info"
}, crate_warnings.map(function (rule, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
key: index,
className: "rule",
style: {
'color': (0,_warnings__WEBPACK_IMPORTED_MODULE_3__.LevelUI)(rule.level).color
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: (0,_warnings__WEBPACK_IMPORTED_MODULE_3__.LevelUI)(rule.level).icon
}), " ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", null, rule.message));
}));
}
/***/ }),
/***/ "./static/js/shop/FakePlaceholder.jsx":
/*!********************************************!*\
!*** ./static/js/shop/FakePlaceholder.jsx ***!
\********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ FakePlaceholder: () => (/* binding */ FakePlaceholder)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/**
* Component that displays a placeholder inside crate.
* Allows to display how it remains space for the current crate.
*/
function FakePlaceholder(_ref) {
var isDraggingOver = _ref.isDraggingOver,
nToDraw = _ref.nToDraw;
var fakePlaceholder = [];
for (var i = nToDraw; i > 0; i--) {
fakePlaceholder.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
key: i,
style: {
display: isDraggingOver ? 'none' : 'block',
border: '1px dashed #ccc',
width: '45px',
marginBottom: '5px'
}
}));
}
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, fakePlaceholder);
}
/***/ }),
/***/ "./static/js/shop/ImportJSON.jsx":
/*!***************************************!*\
!*** ./static/js/shop/ImportJSON.jsx ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ImportJSON: () => (/* binding */ ImportJSON)
/* harmony export */ });
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _options_useClickAway__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./options/useClickAway */ "./static/js/shop/options/useClickAway.js");
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/Modal.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _validate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./validate */ "./static/js/shop/validate.js");
var JSONExample = JSON.stringify({
"crates": [{
"items": [{
"pn": "1124",
"options": null
}, {
"pn": "2128",
"options": null
}, {
"pn": "2128",
"options": null
}, {
"pn": "2128",
"options": null
}],
"type": "rack"
}, {
"items": [],
"type": "no_crate"
}]
});
function ImportJSON() {
var shouldShow = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.importShouldOpen;
});
var data = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.importValue;
});
var loadDescription = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.loadDescription;
});
var updateImportDescription = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.updateImportDescription;
});
var closeImport = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.closeImport;
});
var showImport = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.openImport;
});
var ref = (0,_options_useClickAway__WEBPACK_IMPORTED_MODULE_2__.useClickAway)(function (e) {
if (e.type === "mousedown")
// ignore touchstart
closeImport();
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
className: "btn btn-sm btn-outline-primary m-0 mb-2",
style: {
'cursor': 'pointer'
},
onClick: showImport
}, "Import JSON"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_3__["default"], {
show: shouldShow,
animation: true,
centered: true,
className: "rfqFeedback"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_3__["default"].Body, {
ref: ref
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "form-group"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
className: "small"
}, "Input the JSON description below. Should be something like:", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("br", null), JSONExample)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "form-group w-100"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", {
onChange: function onChange(event) {
updateImportDescription(event.target.value);
},
value: data.value,
className: "form-control w-100",
rows: "5",
placeholder: "Input JSON description here."
})), data.error !== _validate__WEBPACK_IMPORTED_MODULE_4__.Validation.OK ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "form-group"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
className: "text-danger"
}, data.error === _validate__WEBPACK_IMPORTED_MODULE_4__.Validation.Empty ? "Empty input" : "Invalid JSON")) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "d-flex flex-column flex-sm-row justify-content-end"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
type: "button",
onClick: closeImport,
className: "btn btn-sm btn-outline-primary m-0 mb-2 mt-2 mb-sm-0 me-sm-2"
}, "Close"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
type: "button",
onClick: loadDescription,
className: "btn btn-sm btn-primary m-0 ms-sm-2 mt-2 ".concat(data.error ? 'disabled' : '')
}, "Load configuration")))));
}
/***/ }),
/***/ "./static/js/shop/Layout.jsx":
/*!***********************************!*\
!*** ./static/js/shop/Layout.jsx ***!
\***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Layout: () => (/* binding */ Layout)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/**
* Component that provides a base layout (aside/main) for the page.
*/
function Layout(_ref) {
var aside = _ref.aside,
main = _ref.main;
var mobileSideMenuShouldOpen = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.sideMenuIsOpen;
});
var onClickToggleMobileSideMenu = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.switchSideMenu;
});
var showCardAddedFeedback = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.showCardAddedFeedback;
});
var showNoDestination = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.showNoDestination;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "layout"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("aside", {
className: 'aside ' + (mobileSideMenuShouldOpen ? 'menu-opened' : '')
}, aside), mobileSideMenuShouldOpen ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("section", {
className: "main",
onClick: onClickToggleMobileSideMenu
}, main) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("section", {
className: "main"
}, main), showCardAddedFeedback ? !showNoDestination ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "feedback-add-success"
}, "\u2713 added") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "feedback-add-failure"
}, "No cards added: all crates are closed") : null);
}
/***/ }),
/***/ "./static/js/shop/OptionsWrapper.jsx":
/*!*******************************************!*\
!*** ./static/js/shop/OptionsWrapper.jsx ***!
\*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ OptionsDialogWrapper: () => (/* binding */ OptionsDialogWrapper),
/* harmony export */ OptionsSummaryWrapper: () => (/* binding */ OptionsSummaryWrapper)
/* harmony export */ });
/* harmony import */ var _options_DialogPopup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./options/DialogPopup */ "./static/js/shop/options/DialogPopup.jsx");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _options_SummaryPopup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./options/SummaryPopup */ "./static/js/shop/options/SummaryPopup.jsx");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function OptionsDialogWrapper(_ref) {
var crate_index = _ref.crate_index,
card_index = _ref.card_index,
first = _ref.first,
last = _ref.last;
var crate_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id;
});
var options = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].options;
});
var options_data = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].options_data;
});
var card_size = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].size;
});
var card_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].id;
});
var options_class = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].options_class;
});
var sideMenuIsOpen = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.sideMenuIsOpen;
});
var onOptionsUpdate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.updateOptions;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_options_DialogPopup__WEBPACK_IMPORTED_MODULE_2__.DialogPopup, {
options: options,
data: options_data,
options_class: options_class,
key: "popover" + crate_id + card_id,
id: "popover" + crate_id + card_id,
big: card_size === "big",
first: first,
last: last,
sideMenuIsOpen: sideMenuIsOpen,
target: {
construct: function construct(outvar, value) {
options_data[outvar] = value;
},
update: function update(outvar, value) {
if (outvar in options_data) options_data[outvar] = value;
onOptionsUpdate(crate_id, card_index, _defineProperty({}, outvar, value));
}
}
});
}
function OptionsSummaryWrapper(_ref2) {
var crate_index = _ref2.crate_index,
card_index = _ref2.card_index;
var card_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].id;
});
var options = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].options;
});
var options_data = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].options_data;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_options_SummaryPopup__WEBPACK_IMPORTED_MODULE_3__.SummaryPopup, {
id: card_id + "options",
options: options,
data: options_data
});
}
/***/ }),
/***/ "./static/js/shop/OrderForm.jsx":
/*!**************************************!*\
!*** ./static/js/shop/OrderForm.jsx ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ OrderForm: () => (/* binding */ OrderForm)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./validate.js */ "./static/js/shop/validate.js");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _ShowJSON__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ShowJSON */ "./static/js/shop/ShowJSON.jsx");
/**
* Components that renders the form to request quote.
*/
function OrderForm() {
var email = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.email;
});
var note = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.note;
});
var isProcessing = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.isProcessing;
});
var updateEmail = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.updateEmail;
});
var updateNote = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.updateNote;
});
var submitForm = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.submitForm;
});
var submitDisabled = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.submitDisabled;
});
var resetEmailValidation = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.resetEmailValidation;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "summary-form"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("form", {
onSubmit: submitForm,
noValidate: true
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
className: "".concat(email.error > 0 ? 'errorField' : ''),
type: "email",
placeholder: "Email",
onFocus: resetEmailValidation,
onChange: function onChange(event) {
return updateEmail(event.target.value);
},
onBlur: function onBlur(event) {
return updateEmail(event.target.value);
},
value: email.value
}), email.error === _validate_js__WEBPACK_IMPORTED_MODULE_2__.Validation.Empty ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "error"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("small", null, "Required")) : null, email.error === _validate_js__WEBPACK_IMPORTED_MODULE_2__.Validation.Invalid ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "error"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("small", null, "Your email is incomplete")) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", {
onChange: function onChange(event) {
return updateNote(event.target.value);
},
defaultValue: note.value,
rows: "5",
placeholder: "Additional notes"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "d-flex flex-column flex-sm-row justify-content-between"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ShowJSON__WEBPACK_IMPORTED_MODULE_3__.ShowJSON, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
className: "btn btn-primary w-100 m-0 ms-sm-2 order-form-submit",
type: "button",
disabled: submitDisabled(),
onClick: submitForm,
value: "".concat(isProcessing ? 'Processing ...' : 'Request quote')
}))));
}
/***/ }),
/***/ "./static/js/shop/OrderPanel.jsx":
/*!***************************************!*\
!*** ./static/js/shop/OrderPanel.jsx ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ OrderPanel: () => (/* binding */ OrderPanel)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _OrderSummary__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./OrderSummary */ "./static/js/shop/OrderSummary.jsx");
/* harmony import */ var _OrderForm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./OrderForm */ "./static/js/shop/OrderForm.jsx");
/* harmony import */ var _CrateList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CrateList */ "./static/js/shop/CrateList.jsx");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _ImportJSON__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ImportJSON */ "./static/js/shop/ImportJSON.jsx");
/* harmony import */ var _RFQFeedback__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RFQFeedback */ "./static/js/shop/RFQFeedback.jsx");
/**
* Component that renders all things for order.
* It acts like-a layout, this component do nothing more.
*/
function OrderPanel(_ref) {
var title = _ref.title,
description = _ref.description;
var isMobile = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.isMobile;
});
var onClickToggleMobileSideMenu = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.switchSideMenu;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("section", {
className: "panel"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h2", null, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "control justify-content-between"
}, description), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ImportJSON__WEBPACK_IMPORTED_MODULE_2__.ImportJSON, null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_RFQFeedback__WEBPACK_IMPORTED_MODULE_3__.RFQFeedback, null), isMobile ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "mobileBtnDisplaySideMenu"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
onClick: onClickToggleMobileSideMenu
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-add.svg",
alt: "add"
}))) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CrateList__WEBPACK_IMPORTED_MODULE_4__.CrateList, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("section", {
className: "summary"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_OrderSummary__WEBPACK_IMPORTED_MODULE_5__.OrderSummary, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_OrderForm__WEBPACK_IMPORTED_MODULE_6__.OrderForm, null)));
}
/***/ }),
/***/ "./static/js/shop/OrderSummary.jsx":
/*!*****************************************!*\
!*** ./static/js/shop/OrderSummary.jsx ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ OrderSummary: () => (/* binding */ OrderSummary)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _SummaryCrates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SummaryCrates */ "./static/js/shop/SummaryCrates.jsx");
/* harmony import */ var _SummaryTotalPrice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SummaryTotalPrice */ "./static/js/shop/SummaryTotalPrice.jsx");
/**
* Components that displays the list of card that are used in the crate.
* It is a summary of purchase
*/
function OrderSummary() {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "summary-price"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("table", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SummaryCrates__WEBPACK_IMPORTED_MODULE_1__.SummaryCrates, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tfoot", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
className: "item-card-name"
}, "Price estimate"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
className: "price"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SummaryTotalPrice__WEBPACK_IMPORTED_MODULE_2__.SummaryTotalPrice, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
style: {
'display': 'inline-block',
'width': '30px'
}
}, "\xA0"))))));
}
/***/ }),
/***/ "./static/js/shop/ProductCartItem.jsx":
/*!********************************************!*\
!*** ./static/js/shop/ProductCartItem.jsx ***!
\********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ProductCartItem: () => (/* binding */ ProductCartItem)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @hello-pangea/dnd */ "./node_modules/@hello-pangea/dnd/dist/dnd.esm.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var _Resources__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Resources */ "./static/js/shop/Resources.jsx");
/* harmony import */ var _CardWarnings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CardWarnings */ "./static/js/shop/CardWarnings.jsx");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _OptionsWrapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./OptionsWrapper */ "./static/js/shop/OptionsWrapper.jsx");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* Component that renders a product.
* Used in the crate
*/
function ProductCartItem(_ref) {
var card_index = _ref.card_index,
crate_index = _ref.crate_index,
first = _ref.first,
last = _ref.last;
var card = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index];
}, function (a, b) {
return a.id === b.id;
});
var card_show_warnings = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].show_warnings;
}, _utils__WEBPACK_IMPORTED_MODULE_2__.compareObjectsEmptiness);
var card_counted_resources = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].counted_resources;
}, _utils__WEBPACK_IMPORTED_MODULE_2__.compareObjectsEmptiness);
var highlighted = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id === state.highlighted.crate && card_index === state.highlighted.card;
});
var options_disabled = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return !!state.crateParams(state.crates[crate_index].crate_mode).warnings_disabled;
});
var crate_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id;
});
var setHighlight = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.highlightCard;
});
var removeHighlight = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.highlightReset;
});
var onCardRemove = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.deleteCard;
});
var options = !options_disabled && card && card.options && card.options.length > 0;
var warnings = !options_disabled && card_show_warnings && card_show_warnings.length > 0;
var resources = !options_disabled && card_counted_resources && card_counted_resources.length > 0;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_3__.Draggable, {
draggableId: card.id,
index: card_index
}, function (provided, snapshot) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({
ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps, {
style: _objectSpread({}, (0,_utils__WEBPACK_IMPORTED_MODULE_2__.productStyle)(provided.draggableProps.style, snapshot, true, !!highlighted, false, true)),
onMouseEnter: function onMouseEnter() {
return setHighlight(crate_id, card_index);
},
onMouseLeave: removeHighlight
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "progress-container warning d-flex justify-content-evenly"
}, warnings && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CardWarnings__WEBPACK_IMPORTED_MODULE_4__.CardWarnings, {
crate_index: crate_index,
card_index: card_index
}), options && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_OptionsWrapper__WEBPACK_IMPORTED_MODULE_5__.OptionsDialogWrapper, {
crate_index: crate_index,
card_index: card_index,
first: first,
last: last
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h6", null, card.name_number), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
onMouseEnter: function onMouseEnter() {
return setHighlight(crate_id, card_index);
},
onClick: function onClick() {
return setHighlight(crate_id, card_index);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
className: "item-cart",
src: card.image
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
'display': highlighted ? 'flex' : 'none'
},
className: "overlayRemove",
onClick: function onClick() {
return onCardRemove(crate_id, card_index);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-remove.svg",
alt: "rm"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "Remove")), resources && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Resources__WEBPACK_IMPORTED_MODULE_6__.Resources, {
crate_index: crate_index,
card_index: card_index
}));
});
}
/***/ }),
/***/ "./static/js/shop/ProductItem.jsx":
/*!****************************************!*\
!*** ./static/js/shop/ProductItem.jsx ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ProductItem: () => (/* binding */ ProductItem)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @hello-pangea/dnd */ "./node_modules/@hello-pangea/dnd/dist/dnd.esm.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
/**
* Component that renders a product.
* Used in the aside (e.g backlog of product)
*/
function ProductItem(_ref) {
var card_index = _ref.card_index;
var getCardDescription = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.getCardDescription;
});
var currency = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.currency;
});
var onAddCard = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.addCardFromBacklog;
});
var card = getCardDescription(card_index);
var render_specs = card.specs && card.specs.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", null, card.specs.map(function (spec, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
key: index
}, spec);
}));
var render_datasheet_link = card.datasheet_file && card.datasheet_name && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "ds"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
className: "doc-icon"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
href: card.datasheet_file,
target: "_blank",
rel: "noopener noreferrer"
}, card.datasheet_name));
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("section", {
className: "productItem"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "content"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", {
style: {
'marginBottom': card.name_codename ? '5px' : '20px'
}
}, card.name), card.name_codename ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, card.name_codename) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "price"
}, "".concat(currency, " ").concat((0,_utils__WEBPACK_IMPORTED_MODULE_2__.formatMoney)(card.price))), render_specs, render_datasheet_link), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "content"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
onClick: function onClick() {
return onAddCard(null, card_index, null);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-add.svg",
alt: "add"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_3__.Draggable, {
draggableId: card.id,
index: card_index
}, function (provided, snapshot) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", _extends({
ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps, {
style: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.productStyle)(provided.draggableProps.style, snapshot, true // hack: remove weird animation after a drop
),
src: card.image
})), snapshot.isDragging && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
className: "simclone",
src: card.image
}));
})));
}
/***/ }),
/***/ "./static/js/shop/RFQFeedback.jsx":
/*!****************************************!*\
!*** ./static/js/shop/RFQFeedback.jsx ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ RFQFeedback: () => (/* binding */ RFQFeedback)
/* harmony export */ });
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _options_useClickAway__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./options/useClickAway */ "./static/js/shop/options/useClickAway.js");
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/Modal.js");
/* harmony import */ var _validate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./validate */ "./static/js/shop/validate.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
function RFQFeedback() {
var closeRFQ = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.closeRFQFeedback;
});
var shouldShow = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.shouldShowRFQFeedback;
});
var status = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.processingResult;
});
var ref = (0,_options_useClickAway__WEBPACK_IMPORTED_MODULE_2__.useClickAway)(function (e) {
if (e.type === "mousedown")
// ignore touchstart
closeRFQ();
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_3__["default"], {
show: shouldShow,
animation: true,
centered: true
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_3__["default"].Body, {
ref: ref,
className: "rfqFeedback"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "d-flex"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, status.status === _validate__WEBPACK_IMPORTED_MODULE_4__.Validation.OK ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
width: "30px",
src: "/images/shop/icon-done.svg",
alt: "close"
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
width: "30px",
src: "/images/shop/icon-warning.svg",
alt: "close"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
'padding': '0 .5em'
}
}, status.message))));
}
/***/ }),
/***/ "./static/js/shop/Resources.jsx":
/*!**************************************!*\
!*** ./static/js/shop/Resources.jsx ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Resources: () => (/* binding */ Resources)
/* harmony export */ });
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/OverlayTrigger.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
var _excluded = ["arrowProps", "hasDoneInitialMeasure", "show"];
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var resourcesWidthStyle = function resourcesWidthStyle(occupied, max) {
return {
width: "".concat(Math.min(occupied * 100 / max, 100), "%")
};
};
function EEMRenderer(_ref) {
var occupied = _ref.occupied,
max = _ref.max;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "nbr-connectors",
key: (0,uuid__WEBPACK_IMPORTED_MODULE_1__["default"])()
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: _objectSpread({}, resourcesWidthStyle(occupied, max))
}));
}
function ClockRenderer(_ref2) {
var occupied = _ref2.occupied,
max = _ref2.max;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "nbr-clocks",
key: (0,uuid__WEBPACK_IMPORTED_MODULE_1__["default"])()
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: _objectSpread({}, resourcesWidthStyle(occupied, max))
}));
}
var resource_progress_renderers = {
"eem": EEMRenderer,
"clk": ClockRenderer,
"idc": EEMRenderer
};
function EEMTipRender(_ref3) {
var occupied = _ref3.occupied,
max = _ref3.max;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
key: (0,uuid__WEBPACK_IMPORTED_MODULE_1__["default"])()
}, "".concat(occupied, "/").concat(max, " EEM connectors used"));
}
function IDCTipRender(_ref4) {
var occupied = _ref4.occupied,
max = _ref4.max;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
key: (0,uuid__WEBPACK_IMPORTED_MODULE_1__["default"])()
}, "".concat(occupied, "/").concat(max, " IDC connectors used"));
}
function ClockTipRender(_ref5) {
var occupied = _ref5.occupied,
max = _ref5.max;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
key: (0,uuid__WEBPACK_IMPORTED_MODULE_1__["default"])()
}, "".concat(occupied, "/").concat(max, " clock connectors used"));
}
var resource_tip = {
"eem": EEMTipRender,
"clk": ClockTipRender,
"idc": IDCTipRender
};
function RenderResources(_ref6) {
var resources = _ref6.resources,
library = _ref6.library;
if (!resources) return null;
var result = [];
resources.forEach(function (value, _) {
if (library[value.name]) result.push(library[value.name](value));
});
return result;
}
function Resources(_ref7) {
var crate_index = _ref7.crate_index,
card_index = _ref7.card_index;
var resources = (0,_shop_store__WEBPACK_IMPORTED_MODULE_2__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].counted_resources;
}, _utils__WEBPACK_IMPORTED_MODULE_3__.compareArraysLevelOne);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["default"], {
placement: "top",
trigger: ['click', 'hover', 'focus'],
overlay: function overlay(_ref8) {
var arrowProps = _ref8.arrowProps,
hasDoneInitialMeasure = _ref8.hasDoneInitialMeasure,
show = _ref8.show,
props = _objectWithoutProperties(_ref8, _excluded);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({
className: "k-popup-connectors"
}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RenderResources, {
resources: resources,
library: resource_tip
}));
},
rootClose: true
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "progress-container"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RenderResources, {
resources: resources,
library: resource_progress_renderers
})));
}
/***/ }),
/***/ "./static/js/shop/Shop.jsx":
/*!*********************************!*\
!*** ./static/js/shop/Shop.jsx ***!
\*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Shop: () => (/* binding */ Shop)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @hello-pangea/dnd */ "./node_modules/@hello-pangea/dnd/dist/dnd.esm.js");
/* harmony import */ var _Layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Layout */ "./static/js/shop/Layout.jsx");
/* harmony import */ var _Backlog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Backlog */ "./static/js/shop/Backlog.jsx");
/* harmony import */ var _OrderPanel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./OrderPanel */ "./static/js/shop/OrderPanel.jsx");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/**
* Component that renders the entire shop
*/
function Shop() {
var addCardFromBacklog = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.addCardFromBacklog;
});
var initExtData = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.initExtData;
});
var moveCard = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.moveCard;
});
var deleteCard = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.deleteCard;
});
var cardIndexById = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.cardIndexById;
});
var handleOnDragEnd = function handleOnDragEnd(drop_result, _provided) {
if (!drop_result.destination) {
console.warn("No drop destination");
return;
}
if (drop_result.source.droppableId === "backlog") addCardFromBacklog(drop_result.destination.droppableId, drop_result.source.index, drop_result.destination.index);else if (drop_result.destination.droppableId === "backlog") deleteCard(drop_result.source.droppableId, drop_result.source.index);else moveCard(drop_result.source.droppableId, drop_result.source.index, drop_result.destination.droppableId, drop_result.destination.index);
};
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
addCardFromBacklog(null, [cardIndexById("eem_pwr_mod"), cardIndexById("kasli")], -1, true);
initExtData();
}, []);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_2__.DragDropContext, {
onDragEnd: handleOnDragEnd
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Layout__WEBPACK_IMPORTED_MODULE_3__.Layout, {
aside: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Backlog__WEBPACK_IMPORTED_MODULE_4__.Backlog, null),
main: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_OrderPanel__WEBPACK_IMPORTED_MODULE_5__.OrderPanel, {
title: "Order hardware",
description: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
className: "description"
}, "Drag and drop the cards you want into the crate below to see how the combination would look like. Configure the card settings by tapping on the top of the card; many of the options can be adjusted even after the card has been shipped. If you have any issues with this ordering system, or if you need other configurations, email us directly anytime at ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
href: "mailto:sales@m-labs.hk"
}, "sales@m-labs.hk"), ". The price is estimated and must be confirmed by a quote.")
})
}));
}
/***/ }),
/***/ "./static/js/shop/ShowJSON.jsx":
/*!*************************************!*\
!*** ./static/js/shop/ShowJSON.jsx ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ShowJSON: () => (/* binding */ ShowJSON)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/Modal.js");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _options_useClickAway__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./options/useClickAway */ "./static/js/shop/options/useClickAway.js");
/* harmony import */ var _validate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validate */ "./static/js/shop/validate.js");
var _copyButtonStates;
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var copyButtonStates = (_copyButtonStates = {}, _defineProperty(_copyButtonStates, _validate__WEBPACK_IMPORTED_MODULE_1__.Validation.OK, {
style: "btn-outline-success",
content: "✓ copied"
}), _defineProperty(_copyButtonStates, _validate__WEBPACK_IMPORTED_MODULE_1__.Validation.Empty, {
style: "btn-outline-primary",
content: "Copy"
}), _defineProperty(_copyButtonStates, _validate__WEBPACK_IMPORTED_MODULE_1__.Validation.Invalid, {
style: "btn-outline-danger",
content: "Error"
}), _copyButtonStates);
function ShowJSON() {
var shouldShow = (0,_shop_store__WEBPACK_IMPORTED_MODULE_2__.useShopStore)(function (state) {
return state.shouldShowDescription;
});
var description = (0,_shop_store__WEBPACK_IMPORTED_MODULE_2__.useShopStore)(function (state) {
return state.description;
});
var closeDescription = (0,_shop_store__WEBPACK_IMPORTED_MODULE_2__.useShopStore)(function (state) {
return state.closeDescription;
});
var showDescription = (0,_shop_store__WEBPACK_IMPORTED_MODULE_2__.useShopStore)(function (state) {
return state.showDescription;
});
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_validate__WEBPACK_IMPORTED_MODULE_1__.Validation.Empty),
_useState2 = _slicedToArray(_useState, 2),
copiedState = _useState2[0],
setCopiedState = _useState2[1];
var ref = (0,_options_useClickAway__WEBPACK_IMPORTED_MODULE_3__.useClickAway)(function (e) {
if (e.type === "mousedown")
// ignore touchstart
closeDescription();
});
var copyToClipboard = function copyToClipboard(text) {
try {
navigator.clipboard.writeText(text).then(function (_value) {
// success
setCopiedState(_validate__WEBPACK_IMPORTED_MODULE_1__.Validation.OK);
setTimeout(function () {
setCopiedState(_validate__WEBPACK_IMPORTED_MODULE_1__.Validation.Empty);
}, 1500);
}, function (reason) {
// error
setCopiedState(_validate__WEBPACK_IMPORTED_MODULE_1__.Validation.Invalid);
setTimeout(function () {
setCopiedState(_validate__WEBPACK_IMPORTED_MODULE_1__.Validation.Empty);
}, 3000);
console.warn("Copy to clipboard rejected: ", reason);
});
} catch (e) {
setCopiedState(_validate__WEBPACK_IMPORTED_MODULE_1__.Validation.Invalid);
setTimeout(function () {
setCopiedState(_validate__WEBPACK_IMPORTED_MODULE_1__.Validation.Empty);
}, 3000);
console.warn("Copy to clipboard error: ", e);
}
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
className: "btn btn-outline-primary w-100 m-0 mb-2 mb-sm-0 me-sm-2",
style: {
'cursor': 'pointer',
'fontWeight': '700'
},
defaultValue: "Show JSON",
onClick: showDescription,
readOnly: true
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["default"], {
show: shouldShow,
animation: true,
className: "rfqFeedback",
centered: true
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["default"].Body, {
ref: ref
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", {
value: description,
className: "form-control w-100",
rows: 10,
readOnly: true,
placeholder: "There should be description of the crate"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "d-flex flex-column flex-sm-row justify-content-end"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
type: "button",
onClick: function onClick() {
copyToClipboard(description);
},
className: "btn btn-sm m-0 mb-1 mt-2 mb-sm-0 me-sm-2 " + copyButtonStates[copiedState].style
}, copyButtonStates[copiedState].content), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
type: "button",
onClick: closeDescription,
className: "btn btn-sm btn-outline-primary m-0 mb-1 mt-2 mb-sm-0 me-sm-2"
}, "Close")))));
}
/***/ }),
/***/ "./static/js/shop/SummaryCrate.jsx":
/*!*****************************************!*\
!*** ./static/js/shop/SummaryCrate.jsx ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SummaryCrate: () => (/* binding */ SummaryCrate)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _SummaryCrateHeader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SummaryCrateHeader */ "./static/js/shop/SummaryCrateHeader.jsx");
/* harmony import */ var _SummaryCrateCard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SummaryCrateCard */ "./static/js/shop/SummaryCrateCard.jsx");
/* harmony import */ var _SummaryCratePricedOptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SummaryCratePricedOptions */ "./static/js/shop/SummaryCratePricedOptions.jsx");
function SummaryCrate(_ref) {
var crate_index = _ref.crate_index;
var crate_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id;
});
var crate_len = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items.length;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tbody", {
key: "summary_crate_body" + crate_id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SummaryCrateHeader__WEBPACK_IMPORTED_MODULE_2__.SummaryCrateHeader, {
crate_index: crate_index
}), (0,_utils__WEBPACK_IMPORTED_MODULE_3__.range)(0, crate_len).map(function (index, _i) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SummaryCrateCard__WEBPACK_IMPORTED_MODULE_4__.SummaryCrateCard, {
crate_index: crate_index,
card_index: index,
key: "summary_crate_" + crate_id + "_" + index
});
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SummaryCratePricedOptions__WEBPACK_IMPORTED_MODULE_5__.SummaryCratePricedOptions, {
crate_index: crate_index
}));
}
/***/ }),
/***/ "./static/js/shop/SummaryCrateCard.jsx":
/*!*********************************************!*\
!*** ./static/js/shop/SummaryCrateCard.jsx ***!
\*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SummaryCrateCard: () => (/* binding */ SummaryCrateCard)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var _CardWarnings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CardWarnings */ "./static/js/shop/CardWarnings.jsx");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _OptionsWrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./OptionsWrapper */ "./static/js/shop/OptionsWrapper.jsx");
function SummaryCrateCard(_ref) {
var crate_index = _ref.crate_index,
card_index = _ref.card_index;
var currency = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.currency;
});
var deleteCard = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.deleteCard;
});
var setHighlight = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.highlightCard;
});
var resetHighlight = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.highlightReset;
});
var highlighted = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id === state.highlighted.crate && card_index === state.highlighted.card;
});
var crate_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id;
});
var card = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index];
}, function (a, b) {
return a.id === b.id;
});
var card_show_warnings = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].show_warnings;
}, _utils__WEBPACK_IMPORTED_MODULE_2__.compareObjectsEmptiness);
var card_options_data = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].items[card_index].options_data;
}, _utils__WEBPACK_IMPORTED_MODULE_2__.compareObjectsEmptiness);
var options_disabled = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return !!state.crateParams(state.crates[crate_index].crate_mode).warnings_disabled;
});
var options = !options_disabled && card && card.options && card.options.length > 0;
var options_data = !options_disabled && card_options_data && Object.keys(card_options_data).length > 0;
var warnings = !options_disabled && card_show_warnings && card_show_warnings.length > 0;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", {
key: "summary_crate_" + crate_id + "_" + card_index,
className: "hoverable ".concat(highlighted ? 'selected' : ''),
onClick: function onClick() {
return setHighlight(crate_id, card_index);
},
onMouseEnter: function onMouseEnter() {
return setHighlight(crate_id, card_index);
},
onMouseLeave: function onMouseLeave() {
return resetHighlight();
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
className: "item-card-name"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
style: {
'display': 'inline-block',
'width': '16px'
}
}, "\xA0"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, "".concat(card.name_number, " ").concat(card.name, " ").concat(card.name_codename))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
className: "price"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "d-inline-flex align-content-center"
}, "".concat(currency, " ").concat((0,_utils__WEBPACK_IMPORTED_MODULE_2__.formatMoney)(card.price)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
onClick: function onClick() {
return deleteCard(crate_id, card_index);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-remove.svg",
className: "d-block"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
'width': '45px',
'height': '20px'
},
className: "d-inline-flex align-content-center align-self-center justify-content-evenly"
}, warnings ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CardWarnings__WEBPACK_IMPORTED_MODULE_3__.WarningIndicator, {
crate_index: crate_index,
card_index: card_index
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
style: {
'display': 'inline-block',
'minWidth': '20px'
}
}, "\xA0"), options && options_data ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_OptionsWrapper__WEBPACK_IMPORTED_MODULE_4__.OptionsSummaryWrapper, {
crate_index: crate_index,
card_index: card_index
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
style: {
'display': 'inline-block',
'width': '20px'
}
}, "\xA0")))));
}
/***/ }),
/***/ "./static/js/shop/SummaryCrateHeader.jsx":
/*!***********************************************!*\
!*** ./static/js/shop/SummaryCrateHeader.jsx ***!
\***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SummaryCrateHeader: () => (/* binding */ SummaryCrateHeader)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
function SummaryCrateHeader(_ref) {
var crate_index = _ref.crate_index;
var currency = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.currency;
});
var crateParams = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crateParams;
});
var clearCrate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.clearCrate;
});
var delCrate = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.delCrate;
});
var crate_mode = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].crate_mode;
});
var crate_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id;
});
var crate_name = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].name;
});
var modes_order = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.modes_order;
});
var crate_mode_displayed = modes_order.includes(crate_mode);
var crate_type = crateParams(crate_mode);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", {
key: "summary_crate_" + crate_id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
className: "item-card-name"
}, !!crate_name ? crate_name : crate_type.name + " #" + crate_index), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
className: "price"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "d-inline-flex"
}, crate_mode_displayed && "".concat(currency, " ").concat((0,_utils__WEBPACK_IMPORTED_MODULE_2__.formatMoney)(crate_type.price)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
onClick: function onClick() {
return clearCrate(crate_id);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-clear.svg",
alt: "empty crate"
})), crate_mode_displayed ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
onClick: function onClick() {
return delCrate(crate_id);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-remove.svg",
alt: "remove crate"
})) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
className: "span-with-margin"
}))));
}
/***/ }),
/***/ "./static/js/shop/SummaryCratePricedOptions.jsx":
/*!******************************************************!*\
!*** ./static/js/shop/SummaryCratePricedOptions.jsx ***!
\******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SummaryCratePricedOptions: () => (/* binding */ SummaryCratePricedOptions)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _options_Options__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./options/Options */ "./static/js/shop/options/Options.jsx");
function SummaryCratePricedOptions(_ref) {
var crate_index = _ref.crate_index;
var currency = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.currency;
});
var crate_id = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].id;
});
var optionsPrices = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crate_prices;
});
var updateOptions = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.updateCrateOptions;
});
var options_data = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates[crate_index].options_data || {};
});
var options = (0,_options_Options__WEBPACK_IMPORTED_MODULE_2__.ProcessOptionsToData)({
options: optionsPrices,
data: options_data
});
return options.map(function (option, i) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", {
key: "summary_crate_" + crate_id + "option_" + option.id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
className: "item-card-name"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
style: {
'display': 'inline-block',
'width': '16px'
}
}, "\xA0"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, option.title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
className: "price"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "d-inline-flex align-content-center"
}, "".concat(currency, " ").concat((0,_utils__WEBPACK_IMPORTED_MODULE_3__.formatMoney)(option.price)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
onClick: function onClick() {
return updateOptions(crate_id, option.disable_patch);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-remove.svg",
className: "d-block"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
'width': '45px',
'height': '20px'
},
className: "d-inline"
}))));
});
}
/***/ }),
/***/ "./static/js/shop/SummaryCrates.jsx":
/*!******************************************!*\
!*** ./static/js/shop/SummaryCrates.jsx ***!
\******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SummaryCrates: () => (/* binding */ SummaryCrates)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _SummaryCrate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SummaryCrate */ "./static/js/shop/SummaryCrate.jsx");
function SummaryCrates() {
var crates_l = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.crates.length;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, (0,_utils__WEBPACK_IMPORTED_MODULE_2__.range)(0, crates_l).map(function (index, _i) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SummaryCrate__WEBPACK_IMPORTED_MODULE_3__.SummaryCrate, {
crate_index: index,
key: "summary_crate_body_" + index
});
}));
}
/***/ }),
/***/ "./static/js/shop/SummaryTotalPrice.jsx":
/*!**********************************************!*\
!*** ./static/js/shop/SummaryTotalPrice.jsx ***!
\**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SummaryTotalPrice: () => (/* binding */ SummaryTotalPrice)
/* harmony export */ });
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
function SummaryTotalPrice() {
var currency = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.currency;
});
var total_price = (0,_shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore)(function (state) {
return state.total_order_price;
});
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, currency, " ", (0,_utils__WEBPACK_IMPORTED_MODULE_2__.formatMoney)(total_price), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
style: {
'opacity': '0',
'cursor': 'initial'
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-remove.svg",
alt: "icon remove"
})));
}
/***/ }),
/***/ "./static/js/shop/count_resources.js":
/*!*******************************************!*\
!*** ./static/js/shop/count_resources.js ***!
\*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CountResources: () => (/* binding */ CountResources),
/* harmony export */ FillResources: () => (/* binding */ FillResources),
/* harmony export */ hp_to_slots: () => (/* binding */ hp_to_slots),
/* harmony export */ item_occupied_counters: () => (/* binding */ item_occupied_counters),
/* harmony export */ resource_counters: () => (/* binding */ resource_counters)
/* harmony export */ });
var count_item_occupied_eem = function count_item_occupied_eem(item) {
if (!item.options_data || item.options_data.ext_pwr === false || item.options_data.mono_eem === false) return item.consumes && item.consumes.eem || 0;else if (item.options_data.ext_pwr === true) return 0;else if (item.options_data.mono_eem === true || item.options_data.n_eem === "1 EEM") return 1;else if (item.options_data.n_eem === "3 EEM") return 3;
return item.consumes && item.consumes.eem || 0;
};
var count_item_occupied_clock = function count_item_occupied_clock(item) {
return item.options_data && (item.options_data.ext_clk === true || item.options_data.ext_clk && item.options_data.ext_clk.checked === true) ? 0 : item.consumes && item.consumes.clk || 0;
};
var count_item_occupied_idc = function count_item_occupied_idc(item) {
return item.consumes && item.consumes.idc || 0;
};
var count_item_occupied_hp = function count_item_occupied_hp(item) {
return item.consumes && item.consumes.hp || 0;
};
var item_occupied_counters = {
"eem": count_item_occupied_eem,
"clk": count_item_occupied_clock,
"idc": count_item_occupied_idc,
"hp": count_item_occupied_hp
};
function CounterFactory(name) {
return function (data, index) {
var count = 0;
for (var i = index + 1; i < data.length; i++) {
count += item_occupied_counters[name](data[i]);
if (data[i].resources && !!data[i].resources.find(function (value, _i) {
return value.name === name;
})) break;
}
return count;
};
}
var resource_counters = {
"eem": CounterFactory("eem"),
"clk": CounterFactory("clk"),
"idc": CounterFactory("idc"),
"hp": CounterFactory("hp")
};
function CountResources(data, index) {
if (!data[index].resources) return null;
var result = [];
data[index].resources.forEach(function (item, _) {
if (resource_counters[item.name]) result.push({
name: item.name,
occupied: resource_counters[item.name](data, index),
max: item.max
});
});
return result;
}
function FillResources(data, disabled) {
return data.map(function (element, index) {
element.counted_resources = disabled ? [] : CountResources(data, index);
return element;
});
}
function hp_to_slots(hp) {
return Math.trunc(hp / 4);
}
/***/ }),
/***/ "./static/js/shop/json_porter.js":
/*!***************************************!*\
!*** ./static/js/shop/json_porter.js ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CratesToJSON: () => (/* binding */ CratesToJSON),
/* harmony export */ JSONToCrates: () => (/* binding */ JSONToCrates),
/* harmony export */ validateJSON: () => (/* binding */ validateJSON)
/* harmony export */ });
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
/* harmony import */ var _options_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./options/utils */ "./static/js/shop/options/utils.js");
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function validateJSON(description) {
var crates_raw;
try {
var parsed = JSON.parse(description);
// here we can check additional fields
crates_raw = parsed.crates;
} catch (e) {
return false;
}
var crate_modes = _shop_store__WEBPACK_IMPORTED_MODULE_0__.useShopStore.getState().crate_modes;
var modes_order = _shop_store__WEBPACK_IMPORTED_MODULE_0__.useShopStore.getState().modes_order;
var pn_to_card = _shop_store__WEBPACK_IMPORTED_MODULE_0__.useShopStore.getState().pn_to_cards;
try {
var _iterator = _createForOfIteratorHelper(crates_raw),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var crate = _step.value;
if (!crate.type || !crate.items || !(crate.type in crate_modes)) return false;
var _iterator2 = _createForOfIteratorHelper(crate.items),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var card = _step2.value;
if (!(card.pn in pn_to_card) || card.options === undefined) return false;
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
} catch (e) {
return false;
}
// only last one should be spare cards
return crates_raw.filter(function (crate) {
return !modes_order.includes(crate.type);
}).length === 1 && crates_raw[crates_raw.length - 1].type === "no_crate";
}
// no validation in this function
function JSONToCrates(description) {
var parsed = JSON.parse(description);
var crates_raw = parsed.crates;
var pn_to_card = _shop_store__WEBPACK_IMPORTED_MODULE_0__.useShopStore.getState().getCardDescriptionByPn;
var fanTrayAvailable = _shop_store__WEBPACK_IMPORTED_MODULE_0__.useShopStore.getState().fanTrayAvailableForMode;
var crates = Array.from(crates_raw.map(function (crate, c_i) {
return {
id: crate.type === "no_crate" ? "spare" : "crate" + c_i,
name: crate.type === "no_crate" ? "Spare cards" : undefined,
fan_tray: fanTrayAvailable(crate.type) && crate.fan_tray === true,
crate_mode: crate.type,
items: Array.from(crate.items.map(function (card, _i) {
return _objectSpread(_objectSpread({}, pn_to_card(card.pn)), {}, {
id: (0,uuid__WEBPACK_IMPORTED_MODULE_1__["default"])(),
options_data: card.options || {}
});
})),
warnings: [],
occupiedHP: 0
};
}));
return {
// some additional fields go here
crates: crates
};
}
function CratesToJSON(crates) {
var fanTrayAvailable = _shop_store__WEBPACK_IMPORTED_MODULE_0__.useShopStore.getState().fanTrayAvailableForMode;
return JSON.stringify({
// additional fields can go here
crates: Array.from(crates.map(function (crate, _i) {
return {
items: Array.from(crate.items.map(function (card, _) {
return {
pn: card.name_number,
options: card.options_data && card.options ? (0,_options_utils__WEBPACK_IMPORTED_MODULE_2__.FilterOptions)(card.options, card.options_data) : null
};
})),
type: crate.crate_mode,
fan_tray: (!fanTrayAvailable(crate.crate_mode) ? undefined : true) && crate.fan_tray
};
}))
}, null, 2);
}
/***/ }),
/***/ "./static/js/shop/options/DialogPopup.jsx":
/*!************************************************!*\
!*** ./static/js/shop/options/DialogPopup.jsx ***!
\************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ DialogPopup: () => (/* binding */ DialogPopup)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _useClickAway__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useClickAway */ "./static/js/shop/options/useClickAway.js");
/* harmony import */ var _Options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options */ "./static/js/shop/options/Options.jsx");
/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Notification */ "./static/js/shop/options/Notification.jsx");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function DialogPopup(_ref) {
var options = _ref.options,
data = _ref.data,
target = _ref.target,
id = _ref.id,
big = _ref.big,
first = _ref.first,
last = _ref.last,
options_class = _ref.options_class,
sideMenuIsOpen = _ref.sideMenuIsOpen;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
_useState2 = _slicedToArray(_useState, 2),
show = _useState2[0],
setShow = _useState2[1];
var ref = (0,_useClickAway__WEBPACK_IMPORTED_MODULE_1__.useClickAway)(function (e) {
if (e.type === "mousedown")
// ignore touchstart
setShow(false);
});
var div_classes = "overlayVariant border rounded ".concat(big ? "overlay-bigcard" : "overlay-smallcard", " ").concat(!big && first ? "overlay-first" : "", " ").concat(!big && last ? "overlay-last" : "", " ").concat(options_class || "");
var handleClick = function handleClick(_event) {
setShow(!show);
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
ref: ref
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Notification__WEBPACK_IMPORTED_MODULE_2__.Notification, {
id: "processed_options_notification" + id,
tip: "Customization options available",
sideMenuIsOpen: sideMenuIsOpen,
content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
className: "alert-info",
src: show ? "/images/shop/icon-close.svg" : "/images/shop/icon-customize.svg",
onClick: handleClick
})
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
'display': show ? 'flex' : 'none'
},
className: div_classes
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Options__WEBPACK_IMPORTED_MODULE_3__.ProcessOptions, {
options: options,
data: data,
key: "processed_options_" + id,
id: "processed_options_" + id,
target: target
})));
}
/***/ }),
/***/ "./static/js/shop/options/Notification.jsx":
/*!*************************************************!*\
!*** ./static/js/shop/options/Notification.jsx ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Notification: () => (/* binding */ Notification)
/* harmony export */ });
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/OverlayTrigger.js");
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/Tooltip.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function Notification(_ref) {
var id = _ref.id,
tip = _ref.tip,
content = _ref.content,
sideMenuIsOpen = _ref.sideMenuIsOpen;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
_useState2 = _slicedToArray(_useState, 2),
show = _useState2[0],
setShow = _useState2[1];
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
setTimeout(function () {
setShow(true);
}, 100);
setTimeout(function () {
setShow(false);
}, 5000);
}, []);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["default"], {
placement: "top",
trigger: ["click", "hover"],
style: {
display: 'inline'
},
show: show,
onToggle: function onToggle() {
return setShow(false);
},
overlay: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["default"], {
id: id
}, tip),
rootClose: !sideMenuIsOpen
}, content);
}
/***/ }),
/***/ "./static/js/shop/options/Options.jsx":
/*!********************************************!*\
!*** ./static/js/shop/options/Options.jsx ***!
\********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ProcessOptions: () => (/* binding */ ProcessOptions),
/* harmony export */ ProcessOptionsToData: () => (/* binding */ ProcessOptionsToData)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var json_logic_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! json-logic-js */ "./node_modules/json-logic-js/logic.js");
/* harmony import */ var json_logic_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(json_logic_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/components */ "./static/js/shop/options/components/components.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./static/js/shop/options/utils.js");
function ProcessOptions(_ref) {
var options = _ref.options,
data = _ref.data,
target = _ref.target,
id = _ref.id;
var options_t = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.true_type_of)(options);
if (options_t === "array") {
return Array.from(options.map(function (option_item, i) {
return ProcessOptions({
options: option_item,
data: data,
target: target,
id: id + i
});
}));
} else if (options_t === "object") {
if ((0,_utils__WEBPACK_IMPORTED_MODULE_2__.true_type_of)(options.type) === "string" && ((0,_utils__WEBPACK_IMPORTED_MODULE_2__.true_type_of)(options.args) === "object" || (0,_utils__WEBPACK_IMPORTED_MODULE_2__.true_type_of)(options.items) === "array")) {
if (options.type in _components_components__WEBPACK_IMPORTED_MODULE_3__.componentsList) {
return _components_components__WEBPACK_IMPORTED_MODULE_3__.componentsList[options.type](target, id + options.type, data, options.args);
} else if (options.type === "Group") {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "border rounded",
key: id + "group"
}, ProcessOptions({
options: (0,json_logic_js__WEBPACK_IMPORTED_MODULE_1__.apply)(options.items, data),
data: data,
target: target,
id: id
}));
} else {
return _components_components__WEBPACK_IMPORTED_MODULE_3__.componentsList["Default"](options.type, id + "missing");
}
} else {
return ProcessOptions({
options: (0,json_logic_js__WEBPACK_IMPORTED_MODULE_1__.apply)(options, data),
data: data,
target: target,
id: id
});
}
}
}
function ProcessOptionsToData(_ref2) {
var options = _ref2.options,
data = _ref2.data;
var options_t = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.true_type_of)(options);
if (options_t === "array") {
return Array.from(options.map(function (option_item, i) {
return ProcessOptionsToData({
options: option_item,
data: data
});
})).filter(function (item, i) {
return !!item;
}).flat();
} else if (options_t === "object") {
if ((0,_utils__WEBPACK_IMPORTED_MODULE_2__.true_type_of)(options.title) === "string") {
return options;
} else {
return ProcessOptionsToData({
options: (0,json_logic_js__WEBPACK_IMPORTED_MODULE_1__.apply)(options, data),
data: data
});
}
} else {
//throw Error("Incompatible type for the option: " + options_t)
return null;
}
}
/***/ }),
/***/ "./static/js/shop/options/SummaryPopup.jsx":
/*!*************************************************!*\
!*** ./static/js/shop/options/SummaryPopup.jsx ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SummaryPopup: () => (/* binding */ SummaryPopup)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _useClickAway__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useClickAway */ "./static/js/shop/options/useClickAway.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./static/js/shop/options/utils.js");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function SummaryPopup(_ref) {
var id = _ref.id,
options = _ref.options,
data = _ref.data;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
_useState2 = _slicedToArray(_useState, 2),
show = _useState2[0],
setShow = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
x: 0,
y: 0
}),
_useState4 = _slicedToArray(_useState3, 2),
position = _useState4[0],
setPosition = _useState4[1];
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
w: 0,
h: 0
}),
_useState6 = _slicedToArray(_useState5, 2),
size = _useState6[0],
setSize = _useState6[1];
var display_options = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.FilterOptions)(options, data);
var close = function close() {
setShow(false);
document.removeEventListener("scroll", handleScroll, true);
};
var ref = (0,_useClickAway__WEBPACK_IMPORTED_MODULE_2__.useClickAway)(close);
var reposition = function reposition() {
var popup_button = document.getElementById(id + "img");
if (!popup_button) {
document.removeEventListener("scroll", handleScroll, true);
return;
}
var rect = popup_button.getBoundingClientRect();
var pos_x = (rect.left + rect.right) / 2;
var pos_y = (rect.top + rect.bottom) / 2;
if (pos_x + size.w > window.innerWidth) {
setPosition({
x: pos_x - size.w - 20,
y: pos_y - size.h / 2
});
} else {
setPosition({
x: pos_x - size.w / 2,
y: pos_y - size.h - 20
});
}
};
var handleScroll = function handleScroll(e) {
if (e.target !== document.getElementById(id)) {
close();
}
};
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
if (show) {
var popup = document.getElementById(id);
var width = popup.offsetWidth;
var height = popup.offsetHeight;
setSize({
w: width,
h: height
});
reposition();
}
}, [show]);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
if (show) {
reposition();
}
}, [show, size]);
var handleClick = function handleClick(_event) {
setShow(!show);
if (!show) {
document.addEventListener("scroll", handleScroll, true);
}
};
var stringify = function stringify(value) {
var value_type = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.true_type_of)(value);
if (value_type === "string") {
return value;
} else if (value_type === "object") {
if (value.checked === false) {
return "off";
} else if (value.checked === true && value.text) {
return value.text;
}
}
return JSON.stringify(value);
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
ref: ref
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
className: "alert-info d-block",
src: show ? "/images/shop/icon-close.svg" : "/images/shop/icon-customize.svg",
id: id + "img",
onClick: handleClick
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
'display': show ? 'flex' : 'none',
'top': position.y,
'left': position.x
},
className: "overlayVariant card border rounded",
id: id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "card-body"
}, Array.from(Object.entries(display_options).filter(function (_ref2, _) {
var _ref3 = _slicedToArray(_ref2, 2),
key = _ref3[0],
value = _ref3[1];
return key !== "ext_data";
}).map(function (_ref4, _) {
var _ref5 = _slicedToArray(_ref4, 2),
key = _ref5[0],
value = _ref5[1];
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
className: "card-text",
key: id + key
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", null, key), ": ", stringify(value));
})))));
}
/***/ }),
/***/ "./static/js/shop/options/components/Line.jsx":
/*!****************************************************!*\
!*** ./static/js/shop/options/components/Line.jsx ***!
\****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ LineWrapper: () => (/* binding */ LineWrapper)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Tip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Tip */ "./static/js/shop/options/components/Tip.jsx");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Line = /*#__PURE__*/function (_Component) {
_inherits(Line, _Component);
var _super = _createSuper(Line);
function Line(props) {
var _this;
_classCallCheck(this, Line);
_this = _super.call(this, props);
// Initialize the state object with the initial values from the props
_this.state = {
text: props.outvar in props.data ? props.data[props.outvar] : props.fallback ? props.fallback : ""
};
// Bind the event handler to this
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
_this.props.target.construct(_this.props.outvar, _this.state.text);
return _this;
}
_createClass(Line, [{
key: "handleClick",
value: function handleClick(element) {
var text = element.target.value;
this.setState({
text: text
});
this.props.target.update(this.props.outvar, text);
}
}, {
key: "render",
value: function render() {
var key = this.props.id + this.props.outvar;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "shop-line",
key: this.props.id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
htmlFor: key,
className: "form-label"
}, this.props.icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images".concat(this.props.icon),
className: "options-icon"
}), this.props.title, ":"), this.props.tip && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Tip__WEBPACK_IMPORTED_MODULE_1__.Tip, {
id: this.props.id + "tooltip",
tip: this.props.tip
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
type: "text",
className: "form-control form-control-sm",
id: key,
onChange: this.handleClick,
value: this.state.text
}));
}
}]);
return Line;
}(react__WEBPACK_IMPORTED_MODULE_0__.Component);
function LineWrapper(target, id, data, _ref) {
var title = _ref.title,
fallback = _ref.fallback,
outvar = _ref.outvar,
icon = _ref.icon,
tip = _ref.tip;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Line, {
target: target,
title: title,
fallback: fallback,
outvar: outvar,
icon: icon,
tip: tip,
key: id,
id: id,
data: data
});
}
/***/ }),
/***/ "./static/js/shop/options/components/Radio.jsx":
/*!*****************************************************!*\
!*** ./static/js/shop/options/components/Radio.jsx ***!
\*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ RadioWrapper: () => (/* binding */ RadioWrapper)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Tip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Tip */ "./static/js/shop/options/components/Tip.jsx");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Radio = /*#__PURE__*/function (_Component) {
_inherits(Radio, _Component);
var _super = _createSuper(Radio);
function Radio(props) {
var _this;
_classCallCheck(this, Radio);
_this = _super.call(this, props);
// Initialize the state object with the initial values from the props
_this.state = {
variant: props.outvar in props.data ? props.data[props.outvar] : props.variants[props.fallback ? props.fallback : 0]
};
// Bind the event handler to this
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
_this.props.target.construct(_this.props.outvar, _this.state.variant);
return _this;
}
_createClass(Radio, [{
key: "handleClick",
value: function handleClick(variant) {
// Update the state object with the new value for outvar
this.setState(_objectSpread(_objectSpread({}, this.state), {}, {
variant: variant
}));
this.props.target.update(this.props.outvar, variant);
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var key = this.props.id + this.props.outvar;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "shop-radio",
key: this.props.id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
style: {
"display": "inline"
}
}, this.props.icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images".concat(this.props.icon),
className: "options-icon"
}), this.props.title), this.props.tip && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Tip__WEBPACK_IMPORTED_MODULE_1__.Tip, {
id: this.props.id + "tooltip",
tip: this.props.tip
}), this.props.variants.map(function (variant, _) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "form-check",
key: key + variant
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
className: "form-check-input",
type: "radio",
name: key,
id: key + variant,
checked: _this2.state.variant === variant,
onClick: function onClick() {
return _this2.handleClick(variant);
},
onChange: function onChange() {
return _this2.handleClick(variant);
}
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
className: "form-check-label",
htmlFor: key + variant
}, variant));
}));
}
}]);
return Radio;
}(react__WEBPACK_IMPORTED_MODULE_0__.Component);
function RadioWrapper(target, id, data, _ref) {
var title = _ref.title,
variants = _ref.variants,
outvar = _ref.outvar,
fallback = _ref.fallback,
icon = _ref.icon,
tip = _ref.tip;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Radio, {
target: target,
title: title,
variants: variants,
outvar: outvar,
icon: icon,
tip: tip,
key: id,
fallback: fallback,
id: id,
data: data
});
}
/***/ }),
/***/ "./static/js/shop/options/components/Switch.jsx":
/*!******************************************************!*\
!*** ./static/js/shop/options/components/Switch.jsx ***!
\******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SwitchWrapper: () => (/* binding */ SwitchWrapper)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Tip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Tip */ "./static/js/shop/options/components/Tip.jsx");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Switch = /*#__PURE__*/function (_Component) {
_inherits(Switch, _Component);
var _super = _createSuper(Switch);
function Switch(props) {
var _this;
_classCallCheck(this, Switch);
_this = _super.call(this, props);
// Initialize the state object with the initial values from the props
_this.state = {
checked: props.outvar in props.data ? !!props.data[props.outvar] : !!props.fallback
};
// Bind the event handler to this
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
_this.props.target.construct(_this.props.outvar, _this.state.checked);
return _this;
}
_createClass(Switch, [{
key: "handleClick",
value: function handleClick() {
// Update the state object with the new value for outvar
var new_checked = !this.state.checked;
this.setState({
checked: new_checked
});
this.props.target.update(this.props.outvar, new_checked);
}
}, {
key: "render",
value: function render() {
var key = this.props.id + this.props.outvar;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "shop-switch",
key: this.props.id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "form-check form-switch",
key: key
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
className: "form-check-input",
type: "checkbox",
role: "switch",
id: key,
checked: this.state.checked,
onClick: this.handleClick,
onChange: this.handleClick
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
className: "form-check-label",
htmlFor: key,
style: {
"display": "inline"
}
}, this.props.icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images".concat(this.props.icon),
className: "options-icon"
}), this.props.title), this.props.tip && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Tip__WEBPACK_IMPORTED_MODULE_1__.Tip, {
id: this.props.id + "tooltip",
tip: this.props.tip
})));
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, current_state) {
if (current_state.checked !== props.data[props.outvar]) {
return {
checked: props.data[props.outvar]
};
}
return null;
}
}]);
return Switch;
}(react__WEBPACK_IMPORTED_MODULE_0__.Component);
function SwitchWrapper(target, id, data, _ref) {
var title = _ref.title,
fallback = _ref.fallback,
outvar = _ref.outvar,
icon = _ref.icon,
tip = _ref.tip;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Switch, {
target: target,
title: title,
fallback: fallback,
outvar: outvar,
icon: icon,
tip: tip,
key: id,
id: id,
data: data
});
}
/***/ }),
/***/ "./static/js/shop/options/components/SwitchLine.jsx":
/*!**********************************************************!*\
!*** ./static/js/shop/options/components/SwitchLine.jsx ***!
\**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ SwitchLineWrapper: () => (/* binding */ SwitchLineWrapper)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Tip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Tip */ "./static/js/shop/options/components/Tip.jsx");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var SwitchLine = /*#__PURE__*/function (_Component) {
_inherits(SwitchLine, _Component);
var _super = _createSuper(SwitchLine);
function SwitchLine(props) {
var _this;
_classCallCheck(this, SwitchLine);
_this = _super.call(this, props);
// Initialize the state object with the initial values from the props
_this.state = {
text: props.outvar in props.data ? props.data[props.outvar].text : props.fallback ? props.fallback.text : "",
checked: props.outvar in props.data ? props.data[props.outvar].checked : props.fallback ? props.fallback.checked : false
};
// Bind the event handler to this
_this.handleText = _this.handleText.bind(_assertThisInitialized(_this));
_this.handleCheck = _this.handleCheck.bind(_assertThisInitialized(_this));
_this.props.target.construct(_this.props.outvar, _this.state);
return _this;
}
_createClass(SwitchLine, [{
key: "handleText",
value: function handleText(element) {
var new_state = _objectSpread(_objectSpread({}, this.state), {}, {
text: element.target.value
});
this.setState(new_state);
this.props.target.update(this.props.outvar, new_state);
}
}, {
key: "handleCheck",
value: function handleCheck() {
// Update the state object with the new value for outvar
var new_state = _objectSpread(_objectSpread({}, this.state), {}, {
checked: !this.state.checked
});
this.setState(new_state);
this.props.target.update(this.props.outvar, new_state);
}
}, {
key: "render",
value: function render() {
var key = this.props.id + this.props.outvar;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "shop-switch-line",
key: this.props.id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "form-check form-switch",
key: key
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
className: "form-check-input",
type: "checkbox",
role: "switch",
id: key + "switch",
checked: this.state.checked,
onClick: this.handleCheck,
onChange: this.handleCheck
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
className: "form-check-label",
htmlFor: key + "switch"
}, this.props.icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images".concat(this.props.icon),
className: "options-icon"
}), this.props.title), this.props.tip && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Tip__WEBPACK_IMPORTED_MODULE_1__.Tip, {
id: this.props.id + "tooltip",
tip: this.props.tip
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
type: "text",
className: "form-control form-control-sm",
id: key + "line",
onChange: this.handleText,
value: this.state.text,
disabled: !this.state.checked
}));
}
}]);
return SwitchLine;
}(react__WEBPACK_IMPORTED_MODULE_0__.Component);
function SwitchLineWrapper(target, id, data, _ref) {
var title = _ref.title,
fallback = _ref.fallback,
outvar = _ref.outvar,
icon = _ref.icon,
tip = _ref.tip;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SwitchLine, {
target: target,
title: title,
fallback: fallback,
outvar: outvar,
icon: icon,
tip: tip,
key: id,
id: id,
data: data
});
}
/***/ }),
/***/ "./static/js/shop/options/components/Tip.jsx":
/*!***************************************************!*\
!*** ./static/js/shop/options/components/Tip.jsx ***!
\***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Tip: () => (/* binding */ Tip)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/OverlayTrigger.js");
/* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/Tooltip.js");
function Tip(_ref) {
var id = _ref.id,
tip = _ref.tip;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["default"], {
placement: "auto",
trigger: ['click', 'hover', 'focus'],
style: {
display: 'inline'
},
overlay: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["default"], {
id: id
}, tip),
rootClose: true
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", {
src: "/images/shop/icon-reminder.svg",
className: "options-icon"
}));
}
/***/ }),
/***/ "./static/js/shop/options/components/UnimplementedComponent.jsx":
/*!**********************************************************************!*\
!*** ./static/js/shop/options/components/UnimplementedComponent.jsx ***!
\**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ UnimplementedComponent: () => (/* binding */ UnimplementedComponent)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
function UnimplementedComponent(type, id) {
//console.error("Missing component with type:", type)
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
key: type + id,
style: {
background: "red"
}
}, "UNIMPLEMENTED");
}
/***/ }),
/***/ "./static/js/shop/options/components/components.js":
/*!*********************************************************!*\
!*** ./static/js/shop/options/components/components.js ***!
\*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ componentsList: () => (/* binding */ componentsList)
/* harmony export */ });
/* harmony import */ var _Line__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Line */ "./static/js/shop/options/components/Line.jsx");
/* harmony import */ var _Radio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Radio */ "./static/js/shop/options/components/Radio.jsx");
/* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Switch */ "./static/js/shop/options/components/Switch.jsx");
/* harmony import */ var _SwitchLine__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SwitchLine */ "./static/js/shop/options/components/SwitchLine.jsx");
/* harmony import */ var _UnimplementedComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./UnimplementedComponent */ "./static/js/shop/options/components/UnimplementedComponent.jsx");
// Class components are used because we cannot use hooks for updating the state
var componentsList = {
"Radio": _Radio__WEBPACK_IMPORTED_MODULE_0__.RadioWrapper,
"Switch": _Switch__WEBPACK_IMPORTED_MODULE_1__.SwitchWrapper,
"Line": _Line__WEBPACK_IMPORTED_MODULE_2__.LineWrapper,
"SwitchLine": _SwitchLine__WEBPACK_IMPORTED_MODULE_3__.SwitchLineWrapper,
"Default": _UnimplementedComponent__WEBPACK_IMPORTED_MODULE_4__.UnimplementedComponent
};
/***/ }),
/***/ "./static/js/shop/options/useClickAway.js":
/*!************************************************!*\
!*** ./static/js/shop/options/useClickAway.js ***!
\************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ useClickAway: () => (/* binding */ useClickAway)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
// copy from "@uidotdev/usehooks"
function useClickAway(cb) {
var ref = react__WEBPACK_IMPORTED_MODULE_0___default().useRef(null);
var refCb = react__WEBPACK_IMPORTED_MODULE_0___default().useRef(cb);
react__WEBPACK_IMPORTED_MODULE_0___default().useLayoutEffect(function () {
refCb.current = cb;
});
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(function () {
var handler = function handler(e) {
var element = ref.current;
if (element && !element.contains(e.target)) {
refCb.current(e);
}
};
document.addEventListener("mousedown", handler);
document.addEventListener("touchstart", handler);
return function () {
document.removeEventListener("mousedown", handler);
document.removeEventListener("touchstart", handler);
};
}, []);
return ref;
}
/***/ }),
/***/ "./static/js/shop/options/utils.js":
/*!*****************************************!*\
!*** ./static/js/shop/options/utils.js ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ FillExtCardData: () => (/* binding */ FillExtCardData),
/* harmony export */ FillExtCrateData: () => (/* binding */ FillExtCrateData),
/* harmony export */ FilterOptions: () => (/* binding */ FilterOptions),
/* harmony export */ true_type_of: () => (/* binding */ true_type_of)
/* harmony export */ });
/* harmony import */ var json_logic_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! json-logic-js */ "./node_modules/json-logic-js/logic.js");
/* harmony import */ var json_logic_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(json_logic_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/components */ "./static/js/shop/options/components/components.js");
// https://stackoverflow.com/a/70511311
var true_type_of = function true_type_of(obj) {
return Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();
};
function FillExtCardData(data, index) {
return {
has_other_dio: data.filter(function (value, item_index) {
return index !== item_index && value.name && value.name.endsWith("-TTL");
}).length > 0,
has_dds: data.filter(function (value, _) {
return value.name === "DDS" && value.name_number === "4410" && (!value.options_data || !value.options_data.mono_eem);
}).length > 0,
has_sampler: data.filter(function (value, _) {
return value.name === "Sampler" && (!value.options_data || !value.options_data.mono_eem);
}).length > 0
};
}
function FillExtCrateData(crate) {
return {
crate_mode: crate.crate_mode
};
}
function FilterOptions(options, data) {
var options_t = true_type_of(options);
var target = {};
if (options_t === "array") {
options.map(function (option_item, _) {
Object.assign(target, FilterOptions(option_item, data));
});
} else if (options_t === "object") {
if (true_type_of(options.type) === "string" && (true_type_of(options.args) === "object" || true_type_of(options.items) === "array")) {
if (options.type in _components_components__WEBPACK_IMPORTED_MODULE_1__.componentsList) {
target[options.args.outvar] = data[options.args.outvar];
} else if (options.type === "Group") {
Object.assign(target, FilterOptions((0,json_logic_js__WEBPACK_IMPORTED_MODULE_0__.apply)(options.items, data), data));
}
} else {
Object.assign(target, FilterOptions((0,json_logic_js__WEBPACK_IMPORTED_MODULE_0__.apply)(options, data), data));
}
}
return target;
}
/***/ }),
/***/ "./static/js/shop/shop_store.js":
/*!**************************************!*\
!*** ./static/js/shop/shop_store.js ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ useShopStore: () => (/* binding */ useShopStore)
/* harmony export */ });
/* harmony import */ var zustand_traditional__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! zustand/traditional */ "./node_modules/zustand/esm/traditional.mjs");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./static/js/shop/utils.js");
/* harmony import */ var _options_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./options/utils */ "./static/js/shop/options/utils.js");
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js");
/* harmony import */ var _count_resources__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./count_resources */ "./static/js/shop/count_resources.js");
/* harmony import */ var _warnings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./warnings */ "./static/js/shop/warnings.js");
/* harmony import */ var _validate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./validate */ "./static/js/shop/validate.js");
/* harmony import */ var _json_porter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./json_porter */ "./static/js/shop/json_porter.js");
/* harmony import */ var _options_Options__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./options/Options */ "./static/js/shop/options/Options.jsx");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var cards_to_pn_map = function cards_to_pn_map(cards) {
var result = {};
Object.entries(cards).forEach(function (_ref, _i) {
var _ref2 = _slicedToArray(_ref, 2),
key = _ref2[0],
card = _ref2[1];
result[card.name_number] = key;
});
return result;
};
var useBacklog = function useBacklog(set, get) {
return {
cards: _utils__WEBPACK_IMPORTED_MODULE_0__.data.items,
groups: _utils__WEBPACK_IMPORTED_MODULE_0__.data.columns.backlog,
cards_list: _utils__WEBPACK_IMPORTED_MODULE_0__.itemsUnfoldedList,
currency: _utils__WEBPACK_IMPORTED_MODULE_0__.data.currency,
pn_to_cards: cards_to_pn_map(_utils__WEBPACK_IMPORTED_MODULE_0__.data.items),
getCardDescription: function getCardDescription(index) {
return get().cards[get().cards_list[index]];
},
getCardDescriptionByPn: function getCardDescriptionByPn(pn) {
return get().cards[get().pn_to_cards[pn]];
},
cardIndexById: function cardIndexById(card_id) {
return get().cards_list.findIndex(function (element) {
return card_id === element;
});
}
};
};
var useCrateModes = function useCrateModes(set, get) {
return {
crate_modes: _utils__WEBPACK_IMPORTED_MODULE_0__.data.crateModes,
modes_order: _utils__WEBPACK_IMPORTED_MODULE_0__.data.crateModeOrder,
crateParams: function crateParams(mode) {
return get().crate_modes[mode];
}
};
};
var useCrateOptions = function useCrateOptions(set, get) {
return {
crate_options: _utils__WEBPACK_IMPORTED_MODULE_0__.data.crateOptions.options,
crate_prices: _utils__WEBPACK_IMPORTED_MODULE_0__.data.crateOptions.prices,
fillExtCrateData: function fillExtCrateData(crate_id) {
return set(function (state) {
return {
crates: state.crates.map(function (crate, _i) {
if (crate_id === crate.id) {
var previous_options = crate.options_data || {};
return _objectSpread(_objectSpread({}, crate), {}, {
options_data: _objectSpread(_objectSpread({}, previous_options), {}, {
ext_data: (0,_options_utils__WEBPACK_IMPORTED_MODULE_1__.FillExtCrateData)(crate)
})
});
} else return crate;
})
};
});
},
_updateCrateOption: function _updateCrateOption(crate_id, new_options) {
return set(function (state) {
return {
crates: state.crates.map(function (crate, _i) {
if (crate_id === crate.id) {
var previous_options = crate.options_data || {};
return _objectSpread(_objectSpread({}, crate), {}, {
options_data: _objectSpread(_objectSpread({}, previous_options), new_options)
});
} else return crate;
})
};
});
},
updateCrateOptions: function updateCrateOptions(crate_id, new_options) {
get().fillExtCrateData(crate_id);
get()._updateCrateOption(crate_id, new_options);
get()._updateTotalOrderPrice();
}
};
};
var useOrderOptions = function useOrderOptions(set, get) {
return {
orderOptions: _utils__WEBPACK_IMPORTED_MODULE_0__.data.crateOptions.options,
orderPrices: _utils__WEBPACK_IMPORTED_MODULE_0__.data.crateOptions.prices,
order_options_data: {},
// in case of future needs
fillOrderExtData: function fillOrderExtData(_) {},
_updateOrderOptions: function _updateOrderOptions(new_options) {
return set(function (state) {
return {
order_options_data: _objectSpread(_objectSpread({}, state.order_options_data), new_options)
};
});
},
updateOrderOptions: function updateOrderOptions(new_options) {
get().fillOrderExtData();
get()._updateOrderOptions(new_options);
get()._updateTotalOrderPrice();
}
};
};
var useLayout = function useLayout(set, get) {
return {
isTouch: window.isTouchEnabled(),
isMobile: window.deviceIsMobile(),
sideMenuIsOpen: false,
showCardAddedFeedback: false,
showNoDestination: false,
timerAdded: null,
switchSideMenu: function switchSideMenu() {
return set(function (state) {
return {
sideMenuIsOpen: !state.sideMenuIsOpen
};
});
},
cardAdded: function cardAdded() {
return set(function (state) {
return {
showCardAddedFeedback: true,
showNoDestination: false,
timerAdded: (!!state.timerAdded ? clearTimeout(state.timerAdded) : null) || state.isMobile && setTimeout(function () {
get()._endCardAdded();
}, 2000)
};
});
},
noDestinationWarning: function noDestinationWarning() {
return set(function (state) {
return {
showCardAddedFeedback: true,
showNoDestination: true,
timerAdded: (!!state.timerAdded ? clearTimeout(state.timerAdded) : null) || setTimeout(function () {
get()._endCardAdded();
}, 2000)
};
});
},
_endCardAdded: function _endCardAdded() {
return set(function (state) {
return {
showCardAddedFeedback: false,
timerAdded: !!state.timerAdded ? clearTimeout(state.timerAdded) : null
};
});
}
};
};
var useImportJSON = function useImportJSON(set, get) {
return {
importShouldOpen: false,
importValue: {
value: "",
error: _validate__WEBPACK_IMPORTED_MODULE_2__.Validation.OK
},
openImport: function openImport() {
return set(function (state) {
return {
importShouldOpen: true
};
});
},
closeImport: function closeImport() {
return set(function (state) {
return {
importShouldOpen: false
};
});
},
_loadDescription: function _loadDescription() {
return set(function (state) {
var parsed = (0,_json_porter__WEBPACK_IMPORTED_MODULE_3__.JSONToCrates)(state.importValue.value);
// if (parsed.crates[-1].crate_mode !== "")
return {
importShouldOpen: false,
// additional fields go here
crates: parsed.crates
};
});
},
loadDescription: function loadDescription() {
get()._loadDescription();
get().crates.forEach(function (crate, _i) {
get().fillExtData(crate.id);
get().fillWarnings(crate.id);
});
},
updateImportDescription: function updateImportDescription(new_description) {
return set(function (state) {
return {
importValue: {
value: new_description,
error: (0,_validate__WEBPACK_IMPORTED_MODULE_2__.validateJSONInput)(new_description)
}
};
});
}
};
};
var useSubmitForm = function useSubmitForm(set, get) {
return {
isProcessing: false,
shouldShowRFQFeedback: false,
processingResult: {
status: _validate__WEBPACK_IMPORTED_MODULE_2__.Validation.OK,
message: ""
},
API_RFQ: _utils__WEBPACK_IMPORTED_MODULE_0__.data.API_RFQ,
email: {
value: "",
error: null
},
note: {
value: "",
error: _validate__WEBPACK_IMPORTED_MODULE_2__.Validation.OK
},
description: "",
shouldShowDescription: false,
updateEmail: function updateEmail(new_email) {
return set(function (state) {
return {
email: {
value: new_email,
error: (0,_validate__WEBPACK_IMPORTED_MODULE_2__.validateEmail)(new_email)
}
};
});
},
updateNote: function updateNote(new_notes) {
return set(function (state) {
return {
note: {
value: new_notes,
error: (0,_validate__WEBPACK_IMPORTED_MODULE_2__.validateNote)(new_notes)
}
};
});
},
resetEmailValidation: function resetEmailValidation() {
return set(function (state) {
return {
email: {
value: state.email.value,
error: _validate__WEBPACK_IMPORTED_MODULE_2__.Validation.OK
}
};
});
},
_revalidateForm: function _revalidateForm() {
return set(function (state) {
return {
email: {
value: state.email.value,
error: (0,_validate__WEBPACK_IMPORTED_MODULE_2__.validateEmail)(state.email.value)
},
note: {
value: state.note.value,
error: (0,_validate__WEBPACK_IMPORTED_MODULE_2__.validateEmail)(state.note.value)
}
};
});
},
updateDescription: function updateDescription() {
return set(function (state) {
return {
description: (0,_json_porter__WEBPACK_IMPORTED_MODULE_3__.CratesToJSON)(state.crates)
};
});
},
showDescription: function showDescription() {
return set(function (state) {
return {
description: (0,_json_porter__WEBPACK_IMPORTED_MODULE_3__.CratesToJSON)(state.crates),
shouldShowDescription: true
};
});
},
closeDescription: function closeDescription() {
return set(function (state) {
return {
shouldShowDescription: false
};
});
},
_submitForm: function _submitForm() {
return set(function (state) {
return {
isProcessing: true
};
});
},
finishSubmitForm: function finishSubmitForm(result) {
return set(function (state) {
return {
isProcessing: false,
shouldShowRFQFeedback: true,
processingResult: result
};
});
},
submitDisabled: function submitDisabled() {
return get().email.error !== _validate__WEBPACK_IMPORTED_MODULE_2__.Validation.OK;
},
submitForm: function submitForm() {
get().updateDescription();
get()._revalidateForm();
get()._submitForm();
if (get().submitDisabled()) return;
fetch(get().API_RFQ, {
method: "POST",
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: get().email.value,
note: get().note.value,
configuration: get().description
})
}).then(function (response) {
if (response.status !== 200) {
throw Error("Response status is not OK: " + response.status + ".\n" + response);
}
get().finishSubmitForm({
status: _validate__WEBPACK_IMPORTED_MODULE_2__.Validation.OK,
message: "We've received your request and will be in contact soon."
});
}, function (reason) {
console.error("Request rejected, reason:", reason);
get().finishSubmitForm({
status: _validate__WEBPACK_IMPORTED_MODULE_2__.Validation.Invalid,
message: "We cannot receive your request. Try using the export by coping the configuration and send it to us at sales@m-labs.hk"
});
})["catch"](function (err) {
console.error("Request failed, reason:", err);
get().finishSubmitForm({
status: _validate__WEBPACK_IMPORTED_MODULE_2__.Validation.Invalid,
message: "We cannot receive your request. Try using the export by coping the configuration and send it to us at sales@m-labs.hk"
});
});
},
closeRFQFeedback: function closeRFQFeedback() {
return set(function (state) {
return {
shouldShowRFQFeedback: false
};
});
}
};
};
var useHighlighted = function useHighlighted(set, get) {
return {
highlighted: {
crate: "",
card: 0
},
highlightedTimer: null,
highlightCard: function highlightCard(crate_id, index) {
return set(function (state) {
return {
highlighted: {
crate: crate_id,
card: index
},
highlightedTimer: (!!state.highlightedTimer ? clearTimeout(state.highlightedTimer) : null) || state.isTouch && setTimeout(function () {
get().highlightReset();
}, 2000)
};
});
},
highlightReset: function highlightReset() {
return set(function (state) {
return {
highlighted: {
crate: "",
card: 0
},
highlightedTimer: !!state.highlightedTimer ? clearTimeout(state.highlightedTimer) : null
};
});
}
};
};
var useCart = function useCart(set, get) {
return {
crates: _utils__WEBPACK_IMPORTED_MODULE_0__.data.columns.crates,
active_crate: "crate0",
_defaultCrates: Array.from(_utils__WEBPACK_IMPORTED_MODULE_0__.data.columns.crates),
total_order_price: 0,
_newCrate: function _newCrate(crate_id) {
return set(function (state) {
return {
crates: state.crates.toSpliced(-1, 0, _objectSpread(_objectSpread({}, state._defaultCrates[0]), {}, {
id: crate_id || "crate" + state.crates.length
})),
active_crate: crate_id || "crate" + state.crates.length
};
});
},
delCrate: function delCrate(id) {
return set(function (state) {
return {
crates: state.crates.filter(function (crate) {
return crate.id !== id || !state.modes_order.includes(crate.crate_mode);
}),
active_crate: state.active_crate === id ? null : state.active_crate
};
});
},
_setCrateMode: function _setCrateMode(id, mode) {
return set(function (state) {
return {
crates: state.crates.map(function (crate, _i) {
if (crate.id === id) {
return _objectSpread(_objectSpread({}, crate), {}, {
crate_mode: mode
});
} else return crate;
})
};
});
},
setActiveCrate: function setActiveCrate(id) {
return set(function (state) {
return {
active_crate: id
};
});
},
_addCardFromBacklog: function _addCardFromBacklog(crate_to, index_from, index_to) {
return set(function (state) {
var take_from = ((0,_options_utils__WEBPACK_IMPORTED_MODULE_1__.true_type_of)(index_from) === "array" ? index_from : [index_from]).map(function (item, _i) {
return state.cards_list[item];
});
var dest = crate_to || state.active_crate;
if (!dest) return {};
return {
crates: state.crates.map(function (crate, _i) {
if (dest === crate.id) {
var _crate$items;
index_to = index_to != null ? index_to : crate.items.length;
return _objectSpread(_objectSpread({}, crate), {}, {
items: (_crate$items = crate.items).toSpliced.apply(_crate$items, [index_to, 0].concat(_toConsumableArray(take_from.map(function (card_name, _) {
return _objectSpread(_objectSpread({}, state.cards[card_name]), {}, {
id: (0,uuid__WEBPACK_IMPORTED_MODULE_4__["default"])()
});
}))))
});
} else return crate;
})
};
});
},
_moveCard: function _moveCard(crate_from, index_from, crate_to, index_to) {
return set(function (state) {
var the_card = state.crates.find(function (crate, _) {
return crate_from === crate.id;
}).items[index_from];
return {
crates: state.crates.map(function (crate, _i) {
if (crate_to === crate_from && crate_to === crate.id) {
var items_copy = Array.from(crate.items);
var item = items_copy.splice(index_from, 1)[0];
items_copy.splice(index_to, 0, item).filter(function (item, _) {
return !!item;
});
return _objectSpread(_objectSpread({}, crate), {}, {
items: items_copy
});
} else if (crate_to === crate.id) {
return _objectSpread(_objectSpread({}, crate), {}, {
items: crate.items.toSpliced(index_to, 0, the_card)
});
} else if (crate_from === crate.id) {
return _objectSpread(_objectSpread({}, crate), {}, {
items: crate.items.toSpliced(index_to, 1)
});
} else return crate;
})
};
});
},
_deleteCard: function _deleteCard(crate_id, index) {
return set(function (state) {
return {
crates: state.crates.map(function (crate, _i) {
if (crate_id === crate.id) {
return _objectSpread(_objectSpread({}, crate), {}, {
items: crate.items.toSpliced(index, 1)
});
} else return crate;
})
};
});
},
_clearCrate: function _clearCrate(id) {
return set(function (state) {
return {
crates: state.crates.map(function (crate, _i) {
if (id === crate.id) {
return _objectSpread(_objectSpread({}, crate), {}, {
items: []
});
} else return crate;
})
};
});
},
clearAll: function clearAll() {
return set(function (state) {
return {
crates: state._defaultCrates
};
});
},
_updateOptions: function _updateOptions(crate_id, index, new_options) {
return set(function (state) {
return {
crates: state.crates.map(function (crate, _i) {
if (crate_id === crate.id) {
var itemsCopy = Array.from(crate.items);
itemsCopy[index] = _objectSpread(_objectSpread({}, itemsCopy[index]), {}, {
options_data: _objectSpread(_objectSpread({}, itemsCopy[index].options_data), new_options)
});
return _objectSpread(_objectSpread({}, crate), {}, {
items: itemsCopy
});
} else return crate;
})
};
});
},
fillWarnings: function fillWarnings(crate_id) {
return set(function (state) {
return {
crates: state.crates.map(function (crate, _i) {
if (crate_id === crate.id) {
//console.log("--- CHECK ALERTS ---")
var itemsCopy = Array.from(crate.items);
var disabled = !!get().crateParams(crate.crate_mode).warnings_disabled;
itemsCopy = (0,_count_resources__WEBPACK_IMPORTED_MODULE_5__.FillResources)(itemsCopy, disabled);
itemsCopy = (0,_warnings__WEBPACK_IMPORTED_MODULE_6__.TriggerWarnings)(itemsCopy, disabled);
var _TriggerCrateWarnings = (0,_warnings__WEBPACK_IMPORTED_MODULE_6__.TriggerCrateWarnings)(crate),
_TriggerCrateWarnings2 = _slicedToArray(_TriggerCrateWarnings, 2),
crate_warnings = _TriggerCrateWarnings2[0],
occupied = _TriggerCrateWarnings2[1];
return _objectSpread(_objectSpread({}, crate), {}, {
items: itemsCopy,
warnings: crate_warnings,
occupiedHP: occupied
});
} else return crate;
})
};
});
},
fillExtData: function fillExtData(crate_id) {
return set(function (state) {
return {
crates: state.crates.map(function (crate, _i) {
if (crate_id === crate.id) {
var itemsCopy = Array.from(crate.items);
itemsCopy = itemsCopy.map(function (item, index) {
if (!item.options) return item;
if (!item.options_data) item.options_data = {};
item.options_data.ext_data = (0,_options_utils__WEBPACK_IMPORTED_MODULE_1__.FillExtCardData)(itemsCopy, index);
return item;
});
return _objectSpread(_objectSpread({}, crate), {}, {
items: Array.from(itemsCopy)
});
} else return crate;
})
};
});
},
_updateTotalOrderPrice: function _updateTotalOrderPrice() {
return set(function (state) {
var sum = 0;
get().crates.forEach(function (crate, i) {
sum += get().crate_modes[crate.crate_mode].price;
sum += crate.fan_tray && get().fanTrayAvailableByIndex(i) ? get().fanTray.price : 0;
var crate_options = (0,_options_Options__WEBPACK_IMPORTED_MODULE_7__.ProcessOptionsToData)({
options: get().crate_prices,
data: crate.options_data || {}
});
sum += crate_options ? crate_options.reduce(function (accumulator, currentValue) {
return accumulator + currentValue.price;
}, 0) : 0;
crate.items.forEach(function (item, _) {
sum += item.price;
});
});
return {
total_order_price: sum
};
});
},
// Composite actions that require warnings recalculation:
newCrate: function newCrate() {
var crate_id = "crate" + get().crates.length;
get()._newCrate(crate_id);
get().fillExtData(crate_id);
get().fillExtCrateData(crate_id);
get().fillWarnings(crate_id);
get()._updateTotalOrderPrice();
},
setCrateMode: function setCrateMode(id, mode) {
get()._setCrateMode(id, mode);
get().fillExtData(id);
get().fillExtCrateData(id);
get().fillWarnings(id);
get().setActiveCrate(id);
get()._updateTotalOrderPrice();
},
addCardFromBacklog: function addCardFromBacklog(crate_to, index_from, index_to, just_mounted) {
var dest = crate_to || get().active_crate;
if (!dest) {
console.warn("No destination");
get().noDestinationWarning();
return {};
}
get()._addCardFromBacklog(dest, index_from, index_to);
get().fillExtData(dest);
get().fillWarnings(dest);
get().setActiveCrate(dest);
get()._updateTotalOrderPrice();
if (!just_mounted) {
get().cardAdded();
}
},
moveCard: function moveCard(crate_from, index_from, crate_to, index_to) {
get()._moveCard(crate_from, index_from, crate_to, index_to);
get().fillExtData(crate_to);
get().fillWarnings(crate_to);
get().setActiveCrate(crate_to);
get()._updateTotalOrderPrice();
if (crate_from !== crate_to) {
get().fillExtData(crate_from);
get().fillWarnings(crate_from);
}
},
deleteCard: function deleteCard(crate_id, index) {
get()._deleteCard(crate_id, index);
get().fillExtData(crate_id);
get().fillWarnings(crate_id);
get()._updateTotalOrderPrice();
if (crate_id === get().highlighted.crate && index === get().highlighted.card) get().highlightReset();
},
clearCrate: function clearCrate(id) {
get()._clearCrate(id);
get().fillWarnings(id);
},
updateOptions: function updateOptions(crate_id, index, new_options) {
get()._updateOptions(crate_id, index, new_options);
get().fillExtData(crate_id);
get().fillWarnings(crate_id);
},
initExtData: function initExtData() {
get().fillOrderExtData();
get().crates.forEach(function (crate, _i) {
get().fillExtData(crate.id);
get().fillExtCrateData(crate.id);
});
get()._updateTotalOrderPrice();
}
};
};
var useShopStore = (0,zustand_traditional__WEBPACK_IMPORTED_MODULE_8__.createWithEqualityFn)(function () {
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, useBacklog.apply(void 0, arguments)), useCrateModes.apply(void 0, arguments)), useCart.apply(void 0, arguments)), useSubmitForm.apply(void 0, arguments)), useLayout.apply(void 0, arguments)), useHighlighted.apply(void 0, arguments)), useImportJSON.apply(void 0, arguments)), useCrateOptions.apply(void 0, arguments)), useOrderOptions.apply(void 0, arguments));
});
/***/ }),
/***/ "./static/js/shop/utils.js":
/*!*********************************!*\
!*** ./static/js/shop/utils.js ***!
\*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ cartStyle: () => (/* binding */ cartStyle),
/* harmony export */ compareArraysLevelOne: () => (/* binding */ compareArraysLevelOne),
/* harmony export */ compareArraysWithIds: () => (/* binding */ compareArraysWithIds),
/* harmony export */ compareObjectsEmptiness: () => (/* binding */ compareObjectsEmptiness),
/* harmony export */ data: () => (/* binding */ data),
/* harmony export */ formatMoney: () => (/* binding */ formatMoney),
/* harmony export */ itemsUnfoldedList: () => (/* binding */ itemsUnfoldedList),
/* harmony export */ move: () => (/* binding */ move),
/* harmony export */ productStyle: () => (/* binding */ productStyle),
/* harmony export */ range: () => (/* binding */ range)
/* harmony export */ });
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var data = window.shop_data;
var itemsUnfoldedList = Array.from(data.columns.backlog.categories.map(function (groupId) {
return groupId.itemIds;
}).flat());
var productStyle = function productStyle(style, snapshot, removeAnim, hovered, selected) {
var cart = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
var custom = {
opacity: snapshot.isDragging ? .7 : 1,
backgroundColor: hovered || selected ? '#eae7f7' : 'initial'
};
if (!cart && snapshot.draggingOver == null && (
// hack for backlog
!snapshot.isDragging // prevent next elements from animation
|| snapshot.isDragging && snapshot.isDropAnimating)) {
// prevent dragged element from weird animation
style.transform = "none";
}
if (!snapshot.isDropAnimating) {
return _objectSpread(_objectSpread({}, style), custom);
}
if (removeAnim) {
// cannot be 0, but make it super tiny
custom.transitionDuration = '0.001s';
}
return _objectSpread(_objectSpread({}, style), custom);
};
var cartStyle = function cartStyle(style, snapshot) {
var isDraggingOver = snapshot.isDraggingOver;
return _objectSpread(_objectSpread({}, style), {
backgroundColor: isDraggingOver ? '#f2f2f2' : '#f9f9f9',
border: isDraggingOver ? '1px dashed #ccc' : '0'
});
};
function formatMoney(amount) {
var decimalCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
var decimal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ".";
var thousands = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ",";
// https://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-currency-string-in-javascript
// changes: return amount if error in order to avoid empty value
try {
decimalCount = Math.abs(decimalCount);
decimalCount = isNaN(decimalCount) ? 2 : decimalCount;
var negativeSign = amount < 0 ? "-" : "";
var i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString();
var j = i.length > 3 ? i.length % 3 : 0;
return negativeSign + (j ? i.substr(0, j) + thousands : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands) + (decimalCount ? decimal + Math.abs(amount - i).toFixed(decimalCount).slice(2) : "");
} catch (e) {
return amount;
}
}
var range = function range(start, end) {
var length = end - start;
return Array.from({
length: length
}, function (_, i) {
return start + i;
});
};
var move = function move(source, destination, droppableSource, droppableDestination) {
console.log('==> move', source, destination);
var sourceClone = Array.from(source);
var destClone = Array.from(destination);
var _sourceClone$splice = sourceClone.splice(droppableSource.index, 1),
_sourceClone$splice2 = _slicedToArray(_sourceClone$splice, 1),
removed = _sourceClone$splice2[0];
destClone.splice(droppableDestination.index, 0, removed);
var result = {
columns: {}
};
result.columns[droppableSource.droppableId] = sourceClone;
result.columns[droppableDestination.droppableId] = destClone;
return result;
};
var compareArraysWithIds = function compareArraysWithIds(a, b) {
return a.length === b.length && a.every(function (element, index) {
return element.id === b[index].id;
});
};
var compareArraysLevelOne = function compareArraysLevelOne(a, b) {
return a.length === b.length && a.every(function (element, index) {
return element === b[index];
});
};
function compareObjectsEmptiness(a, b) {
return !a && !b || !(!a !== !b) && Object.getPrototypeOf(a) === Object.getPrototypeOf(b) && (Object.getPrototypeOf(a) !== Object.getPrototypeOf([]) || !!Object.keys(a).length === !!Object.keys(b).length);
}
/***/ }),
/***/ "./static/js/shop/validate.js":
/*!************************************!*\
!*** ./static/js/shop/validate.js ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Validation: () => (/* binding */ Validation),
/* harmony export */ validateEmail: () => (/* binding */ validateEmail),
/* harmony export */ validateJSONInput: () => (/* binding */ validateJSONInput),
/* harmony export */ validateNote: () => (/* binding */ validateNote)
/* harmony export */ });
/* harmony import */ var _json_porter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./json_porter */ "./static/js/shop/json_porter.js");
var Validation = {
OK: 0,
Empty: 1,
Invalid: 2
};
function validateEmail(value) {
if (!value || value.trim() === '') {
return Validation.Empty;
} else if (value && !value.match(/^\w+([\+\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) {
return Validation.Invalid;
}
return Validation.OK;
}
function validateNote(value) {
if (!value || value.trim() === '') {
return Validation.Empty;
}
return Validation.OK;
}
function validateJSONInput(value) {
if (!value || value.trim() === '') {
return Validation.Empty;
} else if (value && !(0,_json_porter__WEBPACK_IMPORTED_MODULE_0__.validateJSON)(value)) {
return Validation.Invalid;
}
return Validation.OK;
}
/***/ }),
/***/ "./static/js/shop/warnings.js":
/*!************************************!*\
!*** ./static/js/shop/warnings.js ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ LevelUI: () => (/* binding */ LevelUI),
/* harmony export */ Levels: () => (/* binding */ Levels),
/* harmony export */ MaxLevel: () => (/* binding */ MaxLevel),
/* harmony export */ TriggerCrateWarnings: () => (/* binding */ TriggerCrateWarnings),
/* harmony export */ TriggerWarnings: () => (/* binding */ TriggerWarnings)
/* harmony export */ });
/* harmony import */ var _count_resources__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./count_resources */ "./static/js/shop/count_resources.js");
/* harmony import */ var _shop_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shop_store */ "./static/js/shop/shop_store.js");
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* This module should contain warnings subsystem.
* First idea - there should be either definitive list of available warnings,
* or defined as some json logic leading to the warning message(s), similar way how FillExtData works.
* Second - resources indicator should be separate component
*/
var Levels = {
"reminder": {
priority: 1,
icon: '/images/shop/icon-reminder.svg',
color: "#0d3547"
},
"warning": {
priority: 2,
icon: '/images/shop/icon-warning.svg',
color: "#c75e5e"
}
};
var find_in_counters = function find_in_counters(counters, name) {
return counters.find(function (element) {
return element.name === name;
});
};
var find_previous_source = function find_previous_source(data, index, source) {
return data.slice(0, index).find(function (element) {
return element.resources && find_in_counters(element.resources, source);
});
};
var find_next_source_index = function find_next_source_index(data, index, source) {
return data.slice(index + 1).findIndex(function (element) {
return element.resources && find_in_counters(element.resources, source);
}) + index + 1;
};
var not_enough_resource_trigger = function not_enough_resource_trigger(name) {
return function (_data, _index, counters) {
var resource = find_in_counters(counters, name);
return resource.occupied > resource.max;
};
};
var no_source_trigger = function no_source_trigger(name) {
return function (data, index, _counters) {
var occupied = _count_resources__WEBPACK_IMPORTED_MODULE_0__.item_occupied_counters[name](data[index]);
if (occupied > 0) return !find_previous_source(data, index, name);
return false;
};
};
var wiring_constraint = function wiring_constraint(name) {
return function (data, index, _counters) {
var next = find_next_source_index(data, index, name);
return next - index === 1;
};
};
var Types = {
"eem_resource": {
level: "warning",
trigger: not_enough_resource_trigger("eem"),
message: "Insufficient EEM connectors"
},
"no_eem_source": {
level: "warning",
trigger: no_source_trigger("eem"),
message: 'This card needs a card that provides a EEM connector (e.g. Kasli) at its left.'
},
"idc_resource": {
level: "warning",
trigger: not_enough_resource_trigger("idc"),
message: "Insufficient IDC connectors."
},
"no_idc_source": {
level: "warning",
trigger: no_source_trigger("idc"),
message: 'Should be after a Zotino or a HD68-IDC or with another IDC adapter.'
},
"clk_resource": {
level: "warning",
trigger: not_enough_resource_trigger("clk"),
message: "Insufficient clock connectors."
},
"no_clk_source": {
level: "warning",
trigger: no_source_trigger("clk"),
message: 'This card needs either a card that provides a clock source (e.g. Kasli or Clocker) at its left or use an external clock source.'
},
"eem_wiring_constraint": {
level: "reminder",
trigger: wiring_constraint("eem"),
message: "Due to wiring constraints, the carrier can only connect to EEM cards immediately at its right, without crossing another carrier."
},
"default": {
level: "warning",
trigger: function trigger(_a, _b, _c) {
return true;
},
message: 'This item has unimplemented warning'
}
};
function TriggerWarnings(data, disabled) {
return data.map(function (element, index) {
if (!element.warnings) return element;
element.show_warnings = disabled ? [] : element.warnings.map(function (warning, _) {
if (!!Types[warning]) return Types[warning].trigger(data, index, element.counted_resources) ? _objectSpread({
trigger: undefined,
name: warning
}, Types[warning]) : null;else return Types["default"];
}).filter(function (warning, _) {
return !!warning;
});
return element;
});
}
function MaxLevel(warnings) {
var mx = {
priority: 0,
icon: null
};
var _iterator = _createForOfIteratorHelper(warnings),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var warning = _step.value;
if (Levels[warning.level].priority > mx.priority) mx = Levels[warning.level];
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return mx;
}
function LevelUI(warning_level) {
var warning_t = Levels[warning_level];
return {
icon: warning_t.icon,
color: warning_t.color
};
}
var crate_warnings = {
"overfit": {
message: "You have reached the maximum number of slots allowed for this crate. Consider removing cards.",
level: "warning",
trigger: function trigger(crate, occupied) {
var nbrHP = _shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore.getState().crateParams(crate.crate_mode).hp;
return occupied > nbrHP && nbrHP > 0;
}
},
"underfit_rack": {
message: "The selected cards fit in a 42hp desktop crate, consider switching to it for a more compact system",
level: "reminder",
trigger: function trigger(crate, occupied) {
var nbrHPDesktop = _shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore.getState().crate_modes.desktop.hp;
return crate.crate_mode === _shop_store__WEBPACK_IMPORTED_MODULE_1__.useShopStore.getState().crate_modes.rack.id && occupied < nbrHPDesktop;
}
}
};
function TriggerCrateWarnings(crate) {
var nbrOccupied = _count_resources__WEBPACK_IMPORTED_MODULE_0__.resource_counters.hp(crate.items, -1);
var warnings = [];
Object.entries(crate_warnings).forEach(function (_ref, _) {
var _ref2 = _slicedToArray(_ref, 2),
id = _ref2[0],
warning = _ref2[1];
if (warning.trigger(crate, nbrOccupied)) warnings.push(_objectSpread(_objectSpread({}, warning), {}, {
id: id,
trigger: undefined
}));
});
return [warnings, nbrOccupied];
}
/***/ }),
/***/ "./node_modules/classnames/index.js":
/*!******************************************!*\
!*** ./node_modules/classnames/index.js ***!
\******************************************/
/***/ ((module, exports) => {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
var nativeCodeString = '[native code]';
function classNames() {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
if (arg.length) {
var inner = classNames.apply(null, arg);
if (inner) {
classes.push(inner);
}
}
} else if (argType === 'object') {
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
classes.push(arg.toString());
continue;
}
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if ( true && module.exports) {
classNames.default = classNames;
module.exports = classNames;
} else if (true) {
// register as 'classnames', consistent with npm package name
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return classNames;
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}());
/***/ }),
/***/ "./node_modules/css-box-model/dist/css-box-model.esm.js":
/*!**************************************************************!*\
!*** ./node_modules/css-box-model/dist/css-box-model.esm.js ***!
\**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ calculateBox: () => (/* binding */ calculateBox),
/* harmony export */ createBox: () => (/* binding */ createBox),
/* harmony export */ expand: () => (/* binding */ expand),
/* harmony export */ getBox: () => (/* binding */ getBox),
/* harmony export */ getRect: () => (/* binding */ getRect),
/* harmony export */ offset: () => (/* binding */ offset),
/* harmony export */ shrink: () => (/* binding */ shrink),
/* harmony export */ withScroll: () => (/* binding */ withScroll)
/* harmony export */ });
/* harmony import */ var tiny_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/esm/tiny-invariant.js");
var getRect = function getRect(_ref) {
var top = _ref.top,
right = _ref.right,
bottom = _ref.bottom,
left = _ref.left;
var width = right - left;
var height = bottom - top;
var rect = {
top: top,
right: right,
bottom: bottom,
left: left,
width: width,
height: height,
x: left,
y: top,
center: {
x: (right + left) / 2,
y: (bottom + top) / 2
}
};
return rect;
};
var expand = function expand(target, expandBy) {
return {
top: target.top - expandBy.top,
left: target.left - expandBy.left,
bottom: target.bottom + expandBy.bottom,
right: target.right + expandBy.right
};
};
var shrink = function shrink(target, shrinkBy) {
return {
top: target.top + shrinkBy.top,
left: target.left + shrinkBy.left,
bottom: target.bottom - shrinkBy.bottom,
right: target.right - shrinkBy.right
};
};
var shift = function shift(target, shiftBy) {
return {
top: target.top + shiftBy.y,
left: target.left + shiftBy.x,
bottom: target.bottom + shiftBy.y,
right: target.right + shiftBy.x
};
};
var noSpacing = {
top: 0,
right: 0,
bottom: 0,
left: 0
};
var createBox = function createBox(_ref2) {
var borderBox = _ref2.borderBox,
_ref2$margin = _ref2.margin,
margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin,
_ref2$border = _ref2.border,
border = _ref2$border === void 0 ? noSpacing : _ref2$border,
_ref2$padding = _ref2.padding,
padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;
var marginBox = getRect(expand(borderBox, margin));
var paddingBox = getRect(shrink(borderBox, border));
var contentBox = getRect(shrink(paddingBox, padding));
return {
marginBox: marginBox,
borderBox: getRect(borderBox),
paddingBox: paddingBox,
contentBox: contentBox,
margin: margin,
border: border,
padding: padding
};
};
var parse = function parse(raw) {
var value = raw.slice(0, -2);
var suffix = raw.slice(-2);
if (suffix !== 'px') {
return 0;
}
var result = Number(value);
!!isNaN(result) ? true ? (0,tiny_invariant__WEBPACK_IMPORTED_MODULE_0__["default"])(false, "Could not parse value [raw: " + raw + ", without suffix: " + value + "]") : 0 : void 0;
return result;
};
var getWindowScroll = function getWindowScroll() {
return {
x: window.pageXOffset,
y: window.pageYOffset
};
};
var offset = function offset(original, change) {
var borderBox = original.borderBox,
border = original.border,
margin = original.margin,
padding = original.padding;
var shifted = shift(borderBox, change);
return createBox({
borderBox: shifted,
border: border,
margin: margin,
padding: padding
});
};
var withScroll = function withScroll(original, scroll) {
if (scroll === void 0) {
scroll = getWindowScroll();
}
return offset(original, scroll);
};
var calculateBox = function calculateBox(borderBox, styles) {
var margin = {
top: parse(styles.marginTop),
right: parse(styles.marginRight),
bottom: parse(styles.marginBottom),
left: parse(styles.marginLeft)
};
var padding = {
top: parse(styles.paddingTop),
right: parse(styles.paddingRight),
bottom: parse(styles.paddingBottom),
left: parse(styles.paddingLeft)
};
var border = {
top: parse(styles.borderTopWidth),
right: parse(styles.borderRightWidth),
bottom: parse(styles.borderBottomWidth),
left: parse(styles.borderLeftWidth)
};
return createBox({
borderBox: borderBox,
margin: margin,
padding: padding,
border: border
});
};
var getBox = function getBox(el) {
var borderBox = el.getBoundingClientRect();
var styles = window.getComputedStyle(el);
return calculateBox(borderBox, styles);
};
/***/ }),
/***/ "./node_modules/dom-helpers/esm/activeElement.js":
/*!*******************************************************!*\
!*** ./node_modules/dom-helpers/esm/activeElement.js ***!
\*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ activeElement)
/* harmony export */ });
/* harmony import */ var _ownerDocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ownerDocument */ "./node_modules/dom-helpers/esm/ownerDocument.js");
/**
* Returns the actively focused element safely.
*
* @param doc the document to check
*/
function activeElement(doc) {
if (doc === void 0) {
doc = (0,_ownerDocument__WEBPACK_IMPORTED_MODULE_0__["default"])();
}
// Support: IE 9 only
// IE9 throws an "Unspecified error" accessing document.activeElement from an