@copart/ops-tool-kit 1.13.0-beta.30 → 1.13.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +0 -0
- package/dist/ops-tool-kit.js +394 -340
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -49,7 +49,7 @@ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
|
49
49
|
var ReactRouterDOM__namespace = /*#__PURE__*/_interopNamespace(ReactRouterDOM);
|
|
50
50
|
|
|
51
51
|
const name$1 = "@copart/ops-tool-kit";
|
|
52
|
-
const version$3 = "1.13.0-beta.
|
|
52
|
+
const version$3 = "1.13.0-beta.31";
|
|
53
53
|
const main$1 = "dist/ops-tool-kit.js";
|
|
54
54
|
const style = "dist/ops-tool-kit.css";
|
|
55
55
|
const files = [
|
|
@@ -2847,266 +2847,6 @@ var createOpsStorage = function createOpsStorage() {
|
|
|
2847
2847
|
var storage$2 = createOpsStorage();
|
|
2848
2848
|
global.storage = storage$2;
|
|
2849
2849
|
|
|
2850
|
-
var DEFAULT_BREADCRUMBS_CONTEXT = {
|
|
2851
|
-
error: 'You tried to use Breadcrumbs outside of its context.'
|
|
2852
|
-
};
|
|
2853
|
-
|
|
2854
|
-
var css_248z$r = ".utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Breadcrumbs {\n /* height: 36px;\n background: #3c4656; */\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--crumbs {\n display: flex;\n}\n\n#notCrumbs {\n height: 100%;\n margin-right: 12px;\n display: flex;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb {\n cursor: pointer;\n height: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: 300;\n letter-spacing: 0;\n /* transition: all 0.2s; */\n position: relative;\n top: -2px;\n color: rgba(255, 255, 255, 0.8);\n grid-gap: 6px;\n gap: 6px;\n margin-left: 5px;\n opacity: 1;\n}\n\n@-webkit-keyframes utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--fadeIn {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(-6px);\n transform: translateX(-6px);\n /* transform: scale(0.9); */\n }\n 100% {\n opacity: 1;\n -webkit-transform: translateX(0px);\n transform: translateX(0px);\n /* transform: scale(1); */\n }\n}\n\n@keyframes utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--fadeIn {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(-6px);\n transform: translateX(-6px);\n /* transform: scale(0.9); */\n }\n 100% {\n opacity: 1;\n -webkit-transform: translateX(0px);\n transform: translateX(0px);\n /* transform: scale(1); */\n }\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb {\n -webkit-animation-name: utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--fadeIn;\n animation-name: utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--fadeIn;\n -webkit-animation-duration: 0.2s;\n animation-duration: 0.2s;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb::before {\n content: '\\f054';\n color: rgba(255, 255, 255, 0.4);\n display: inline-block;\n font-family: 'Font Awesome 6 Pro';\n font-size: 16px;\n margin: 0 6px;\n position: relative;\n top: 2px;\n}\n\n/* .Crumb:first-of-type {\n margin-left: 12px;\n font-weight: 400;\n} */\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb:hover {\n /* background: rgba(0, 0, 0, 0.15); */\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb:not(:last-of-type):not(:hover) {\n /* opacity: 0.75; */\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb:last-of-type {\n font-weight: 700;\n opacity: 1;\n color: rgba(255, 255, 255, 1);\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb:last-of-type::before {\n font-weight: 300;\n /* opacity: 0.8; */\n}\n\n/* .crumbSpacer {} */\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--crumbs {\n /* margin: 10px; */\n flex-grow: 2;\n font-size: 14px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--notCrumbs {\n height: 100%;\n display: flex;\n margin-right: 0px !important;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--entityIndicator {\n height: 100%;\n display: flex;\n margin-right: 0px !important;\n}";
|
|
2855
|
-
styleInject(css_248z$r);
|
|
2856
|
-
|
|
2857
|
-
var Context = createContext(DEFAULT_BREADCRUMBS_CONTEXT);
|
|
2858
|
-
var withBreadcrumbs = function withBreadcrumbs(Comp) {
|
|
2859
|
-
return /*#__PURE__*/function (_React$Component) {
|
|
2860
|
-
function _class() {
|
|
2861
|
-
_classCallCheck$3(this, _class);
|
|
2862
|
-
return _callSuper(this, _class, arguments);
|
|
2863
|
-
}
|
|
2864
|
-
_inherits$2(_class, _React$Component);
|
|
2865
|
-
return _createClass$2(_class, [{
|
|
2866
|
-
key: "render",
|
|
2867
|
-
value: function render() {
|
|
2868
|
-
var _this = this;
|
|
2869
|
-
return /*#__PURE__*/React__namespace.createElement(Context.Consumer, null, function (breadcrumbs) {
|
|
2870
|
-
return /*#__PURE__*/React__namespace.createElement(Comp, _extends$1({}, _this.props, {
|
|
2871
|
-
breadcrumbs: breadcrumbs
|
|
2872
|
-
}));
|
|
2873
|
-
});
|
|
2874
|
-
}
|
|
2875
|
-
}]);
|
|
2876
|
-
}(React__namespace.Component);
|
|
2877
|
-
};
|
|
2878
|
-
var Breadcrumbs = withBreadcrumbs(index$1.purist(function (props) {
|
|
2879
|
-
var _props$appTile, _props$appTile3;
|
|
2880
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
2881
|
-
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Breadcrumbs"
|
|
2882
|
-
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
2883
|
-
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--crumbs"
|
|
2884
|
-
}, props !== null && props !== void 0 && (_props$appTile = props.appTile) !== null && _props$appTile !== void 0 && _props$appTile.title ? /*#__PURE__*/React__namespace.createElement("a", {
|
|
2885
|
-
onClick: function onClick() {
|
|
2886
|
-
var _props$appTile2;
|
|
2887
|
-
var isEmbedded = window.location.pathname.includes('embedded');
|
|
2888
|
-
props.history.push(isEmbedded && (_props$appTile2 = props.appTile) !== null && _props$appTile2 !== void 0 && _props$appTile2.path ? props.appTile.path : '/');
|
|
2889
|
-
},
|
|
2890
|
-
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb"
|
|
2891
|
-
}, props === null || props === void 0 ? void 0 : (_props$appTile3 = props.appTile) === null || _props$appTile3 === void 0 ? void 0 : _props$appTile3.title) : null, props.breadcrumbs.crumbs.map(function (crumb, idx) {
|
|
2892
|
-
return /*#__PURE__*/React__namespace.createElement("a", {
|
|
2893
|
-
onClick: function onClick() {
|
|
2894
|
-
return props.history.push(crumb.to);
|
|
2895
|
-
},
|
|
2896
|
-
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb",
|
|
2897
|
-
key: crumb.crumbId != null ? crumb.crumbId : idx
|
|
2898
|
-
}, crumb.children);
|
|
2899
|
-
}, this)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
2900
|
-
id: "notCrumbs",
|
|
2901
|
-
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--notCrumbs"
|
|
2902
|
-
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
2903
|
-
id: "entityIndicator",
|
|
2904
|
-
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--entityIndicator"
|
|
2905
|
-
}));
|
|
2906
|
-
}));
|
|
2907
|
-
|
|
2908
|
-
var url = '_~getRandomVcryp0123456789bfhijklqsuvwxzABCDEFGHIJKLMNOPQSTUWXYZ';
|
|
2909
|
-
function random(size) {
|
|
2910
|
-
var result = [];
|
|
2911
|
-
while (0 < size--) {
|
|
2912
|
-
result.push(Math.floor(Math.random() * 256));
|
|
2913
|
-
}
|
|
2914
|
-
return result;
|
|
2915
|
-
}
|
|
2916
|
-
var nonSecure = function (size) {
|
|
2917
|
-
size = size || 21;
|
|
2918
|
-
var id = '';
|
|
2919
|
-
var bytes = random(size);
|
|
2920
|
-
while (0 < size--) {
|
|
2921
|
-
id += url[bytes[size] & 63];
|
|
2922
|
-
}
|
|
2923
|
-
return id;
|
|
2924
|
-
};
|
|
2925
|
-
|
|
2926
|
-
var BreadcrumbsProvider = /*#__PURE__*/function (_React$Component) {
|
|
2927
|
-
function BreadcrumbsProvider(props) {
|
|
2928
|
-
var _this;
|
|
2929
|
-
_classCallCheck$3(this, BreadcrumbsProvider);
|
|
2930
|
-
_this = _callSuper(this, BreadcrumbsProvider, [props]);
|
|
2931
|
-
_defineProperty$2(_this, "crumbIds", new Set());
|
|
2932
|
-
_this.state = function () {
|
|
2933
|
-
var self = _this;
|
|
2934
|
-
return {
|
|
2935
|
-
crumbs: [],
|
|
2936
|
-
addCrumb: function addCrumb(props, crumbId, oldId) {
|
|
2937
|
-
var newCrumb = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2938
|
-
crumbId: crumbId
|
|
2939
|
-
});
|
|
2940
|
-
self.setState(function (state) {
|
|
2941
|
-
return {
|
|
2942
|
-
crumbs: oldId ? state.crumbs.map(function (crumb) {
|
|
2943
|
-
return crumb.crumbId === oldId ? newCrumb : crumb;
|
|
2944
|
-
}) : [].concat(_toConsumableArray(state.crumbs), [newCrumb])
|
|
2945
|
-
};
|
|
2946
|
-
});
|
|
2947
|
-
},
|
|
2948
|
-
removeCrumb: function removeCrumb(crumbId) {
|
|
2949
|
-
// Filter out the specific crumb by its crumbId.
|
|
2950
|
-
self.setState(function (state) {
|
|
2951
|
-
return {
|
|
2952
|
-
crumbs: state.crumbs.filter(function (crumb) {
|
|
2953
|
-
return crumb.crumbId !== crumbId;
|
|
2954
|
-
})
|
|
2955
|
-
};
|
|
2956
|
-
});
|
|
2957
|
-
}
|
|
2958
|
-
};
|
|
2959
|
-
}();
|
|
2960
|
-
return _this;
|
|
2961
|
-
}
|
|
2962
|
-
_inherits$2(BreadcrumbsProvider, _React$Component);
|
|
2963
|
-
return _createClass$2(BreadcrumbsProvider, [{
|
|
2964
|
-
key: "render",
|
|
2965
|
-
value: function render() {
|
|
2966
|
-
return /*#__PURE__*/React__namespace.createElement(Context.Provider, {
|
|
2967
|
-
value: this.state
|
|
2968
|
-
}, this.props.children);
|
|
2969
|
-
}
|
|
2970
|
-
}]);
|
|
2971
|
-
}(React__namespace.Component);
|
|
2972
|
-
|
|
2973
|
-
var _class;
|
|
2974
|
-
var _excluded$6 = ["breadcrumbs"];
|
|
2975
|
-
var getCrumbProps = function getCrumbProps(props) {
|
|
2976
|
-
props.breadcrumbs;
|
|
2977
|
-
var crumbProps = _objectWithoutProperties(props, _excluded$6);
|
|
2978
|
-
return crumbProps;
|
|
2979
|
-
};
|
|
2980
|
-
|
|
2981
|
-
// Flatten children to a comparable text label. Children may be a React element
|
|
2982
|
-
// (e.g. <span onClick>Label</span>) whose internal fiber refs (`_owner`) are
|
|
2983
|
-
// circular, so it must never be passed to JSON.stringify.
|
|
2984
|
-
var _crumbLabel = function crumbLabel(children) {
|
|
2985
|
-
if (children == null) return '';
|
|
2986
|
-
if (typeof children === 'string' || typeof children === 'number') return String(children);
|
|
2987
|
-
if (Array.isArray(children)) return children.map(_crumbLabel).join('');
|
|
2988
|
-
if (React__namespace.isValidElement(children) && children.props && children.props.children != null) {
|
|
2989
|
-
return _crumbLabel(children.props.children);
|
|
2990
|
-
}
|
|
2991
|
-
return '';
|
|
2992
|
-
};
|
|
2993
|
-
|
|
2994
|
-
// Safe replacement for the old JSON.stringify diff, which threw
|
|
2995
|
-
// "Converting circular structure to JSON" whenever children was a React element.
|
|
2996
|
-
var crumbPropsChanged = function crumbPropsChanged(oldProps, newProps) {
|
|
2997
|
-
var keys = new Set([].concat(_toConsumableArray(Object.keys(oldProps)), _toConsumableArray(Object.keys(newProps))));
|
|
2998
|
-
var _iterator = _createForOfIteratorHelper(keys),
|
|
2999
|
-
_step;
|
|
3000
|
-
try {
|
|
3001
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
3002
|
-
var key = _step.value;
|
|
3003
|
-
if (key === 'children') {
|
|
3004
|
-
if (_crumbLabel(oldProps.children) !== _crumbLabel(newProps.children)) return true;
|
|
3005
|
-
} else if (oldProps[key] !== newProps[key]) {
|
|
3006
|
-
return true;
|
|
3007
|
-
}
|
|
3008
|
-
}
|
|
3009
|
-
} catch (err) {
|
|
3010
|
-
_iterator.e(err);
|
|
3011
|
-
} finally {
|
|
3012
|
-
_iterator.f();
|
|
3013
|
-
}
|
|
3014
|
-
return false;
|
|
3015
|
-
};
|
|
3016
|
-
var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
|
|
3017
|
-
function Crumb() {
|
|
3018
|
-
var _this;
|
|
3019
|
-
_classCallCheck$3(this, Crumb);
|
|
3020
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3021
|
-
args[_key] = arguments[_key];
|
|
3022
|
-
}
|
|
3023
|
-
_this = _callSuper(this, Crumb, [].concat(args));
|
|
3024
|
-
_defineProperty$2(_this, "crumbId", nonSecure());
|
|
3025
|
-
return _this;
|
|
3026
|
-
}
|
|
3027
|
-
_inherits$2(Crumb, _React$Component);
|
|
3028
|
-
return _createClass$2(Crumb, [{
|
|
3029
|
-
key: "componentDidMount",
|
|
3030
|
-
value: function componentDidMount() {
|
|
3031
|
-
var crumbProps = getCrumbProps(this.props);
|
|
3032
|
-
this.props.breadcrumbs.addCrumb(crumbProps, this.crumbId);
|
|
3033
|
-
}
|
|
3034
|
-
}, {
|
|
3035
|
-
key: "shouldComponentUpdate",
|
|
3036
|
-
value: function shouldComponentUpdate(nextProps) {
|
|
3037
|
-
var oldProps = getCrumbProps(this.props);
|
|
3038
|
-
var newProps = getCrumbProps(nextProps);
|
|
3039
|
-
return crumbPropsChanged(oldProps, newProps);
|
|
3040
|
-
}
|
|
3041
|
-
}, {
|
|
3042
|
-
key: "componentDidUpdate",
|
|
3043
|
-
value: function componentDidUpdate() {
|
|
3044
|
-
var oldId = this.crumbId;
|
|
3045
|
-
this.crumbId = nonSecure();
|
|
3046
|
-
var crumbProps = getCrumbProps(this.props);
|
|
3047
|
-
this.props.breadcrumbs.addCrumb(crumbProps, this.crumbId, oldId);
|
|
3048
|
-
}
|
|
3049
|
-
}, {
|
|
3050
|
-
key: "componentWillUnmount",
|
|
3051
|
-
value: function componentWillUnmount() {
|
|
3052
|
-
this.props.breadcrumbs.removeCrumb(this.crumbId);
|
|
3053
|
-
}
|
|
3054
|
-
}, {
|
|
3055
|
-
key: "render",
|
|
3056
|
-
value: function render() {
|
|
3057
|
-
return null;
|
|
3058
|
-
}
|
|
3059
|
-
}]);
|
|
3060
|
-
}(React__namespace.Component)) || _class;
|
|
3061
|
-
Crumb$1.defaultProps = {
|
|
3062
|
-
breadcrumbs: {
|
|
3063
|
-
addCrumb: function addCrumb() {},
|
|
3064
|
-
removeCrumb: function removeCrumb() {},
|
|
3065
|
-
crumbs: []
|
|
3066
|
-
}
|
|
3067
|
-
};
|
|
3068
|
-
|
|
3069
|
-
/**
|
|
3070
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3071
|
-
*
|
|
3072
|
-
* This source code is licensed under the MIT license found in the
|
|
3073
|
-
* LICENSE file in the root directory of this source tree.
|
|
3074
|
-
*/
|
|
3075
|
-
|
|
3076
|
-
/**
|
|
3077
|
-
* Use invariant() to assert state which your program assumes to be true.
|
|
3078
|
-
*
|
|
3079
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
3080
|
-
* to provide information about what broke and what you were
|
|
3081
|
-
* expecting.
|
|
3082
|
-
*
|
|
3083
|
-
* The invariant message will be stripped in production, but the invariant
|
|
3084
|
-
* will remain to ensure logic does not differ in production.
|
|
3085
|
-
*/
|
|
3086
|
-
var invariant = function (condition, format, a, b, c, d, e, f) {
|
|
3087
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3088
|
-
if (format === undefined) {
|
|
3089
|
-
throw new Error('invariant requires an error message argument');
|
|
3090
|
-
}
|
|
3091
|
-
}
|
|
3092
|
-
if (!condition) {
|
|
3093
|
-
var error;
|
|
3094
|
-
if (format === undefined) {
|
|
3095
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
3096
|
-
} else {
|
|
3097
|
-
var args = [a, b, c, d, e, f];
|
|
3098
|
-
var argIndex = 0;
|
|
3099
|
-
error = new Error(format.replace(/%s/g, function () {
|
|
3100
|
-
return args[argIndex++];
|
|
3101
|
-
}));
|
|
3102
|
-
error.name = 'Invariant Violation';
|
|
3103
|
-
}
|
|
3104
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
3105
|
-
throw error;
|
|
3106
|
-
}
|
|
3107
|
-
};
|
|
3108
|
-
var browser$2 = invariant;
|
|
3109
|
-
|
|
3110
2850
|
var bind$4 = function bind(fn, thisArg) {
|
|
3111
2851
|
return function wrap() {
|
|
3112
2852
|
var args = new Array(arguments.length);
|
|
@@ -4294,6 +4034,24 @@ axios_1.default = _default;
|
|
|
4294
4034
|
|
|
4295
4035
|
var axios = axios_1;
|
|
4296
4036
|
|
|
4037
|
+
var url = '_~getRandomVcryp0123456789bfhijklqsuvwxzABCDEFGHIJKLMNOPQSTUWXYZ';
|
|
4038
|
+
function random(size) {
|
|
4039
|
+
var result = [];
|
|
4040
|
+
while (0 < size--) {
|
|
4041
|
+
result.push(Math.floor(Math.random() * 256));
|
|
4042
|
+
}
|
|
4043
|
+
return result;
|
|
4044
|
+
}
|
|
4045
|
+
var nonSecure = function (size) {
|
|
4046
|
+
size = size || 21;
|
|
4047
|
+
var id = '';
|
|
4048
|
+
var bytes = random(size);
|
|
4049
|
+
while (0 < size--) {
|
|
4050
|
+
id += url[bytes[size] & 63];
|
|
4051
|
+
}
|
|
4052
|
+
return id;
|
|
4053
|
+
};
|
|
4054
|
+
|
|
4297
4055
|
var __assign$8 = undefined && undefined.__assign || function () {
|
|
4298
4056
|
__assign$8 = Object.assign || function (t) {
|
|
4299
4057
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -5282,16 +5040,6 @@ fetcher$1.interceptors.response.use(function (response) {
|
|
|
5282
5040
|
};
|
|
5283
5041
|
}());
|
|
5284
5042
|
|
|
5285
|
-
Object.defineProperty(fetcher$1, 'extend', {
|
|
5286
|
-
enumerable: false,
|
|
5287
|
-
value: function value(name, fn) {
|
|
5288
|
-
var INVALID_NAMES = ['defaults', 'delete', 'put', 'post', 'get', 'head', 'interceptors', 'options', 'patch', 'request'];
|
|
5289
|
-
var INVALID_NAME_WARNING = "The name of the method used (\"".concat(name, "\") to extend fetcher is invalid.");
|
|
5290
|
-
!!INVALID_NAMES.includes(name) ? process.env.NODE_ENV !== "production" ? browser$2(false, INVALID_NAME_WARNING) : browser$2(false) : void 0;
|
|
5291
|
-
fetcher$1[name] = fn;
|
|
5292
|
-
}
|
|
5293
|
-
});
|
|
5294
|
-
|
|
5295
5043
|
var DEFAULT_USER_RULES$1 = {
|
|
5296
5044
|
allow: [],
|
|
5297
5045
|
deny: []
|
|
@@ -5360,14 +5108,39 @@ var getConfig = /*#__PURE__*/function () {
|
|
|
5360
5108
|
return _ref.apply(this, arguments);
|
|
5361
5109
|
};
|
|
5362
5110
|
}();
|
|
5111
|
+
|
|
5112
|
+
// Does this pathname sit under an iframe app's mount path?
|
|
5113
|
+
// Works for BOTH legacy Angular apps at "/embedded/<app>" and new React apps at
|
|
5114
|
+
// their own root path "/<app>" — matches by the tile's configured path, never by
|
|
5115
|
+
// a hard-coded "/embedded" URL substring (which root-mounted apps do not have).
|
|
5116
|
+
var pathIsUnderTile = function pathIsUnderTile(tile, pathname) {
|
|
5117
|
+
return typeof tile.path === 'string' && (pathname === tile.path || pathname.startsWith("".concat(tile.path, "/")));
|
|
5118
|
+
};
|
|
5119
|
+
|
|
5120
|
+
// Canonical matcher: the embedded (iframe) tile that owns a given pathname, or
|
|
5121
|
+
// null. Longest path wins so a deeper mount path is preferred. Single source of
|
|
5122
|
+
// truth reused by app-frame chrome (see utilities.isEmbeddedRoute) so "which
|
|
5123
|
+
// embedded app am I on" is decided exactly one way across the toolkit.
|
|
5124
|
+
var getEmbeddedTileForPath = function getEmbeddedTileForPath() {
|
|
5125
|
+
var tiles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
5126
|
+
var pathname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.pathname;
|
|
5127
|
+
return tiles.filter(function (tile) {
|
|
5128
|
+
return tile.appName === 'embedded' && pathIsUnderTile(tile, pathname);
|
|
5129
|
+
}).sort(function (a, b) {
|
|
5130
|
+
return b.path.length - a.path.length;
|
|
5131
|
+
})[0] || null;
|
|
5132
|
+
};
|
|
5363
5133
|
var tileFilter = function tileFilter(tile) {
|
|
5364
5134
|
var _window$toolkitEnv;
|
|
5365
|
-
var
|
|
5366
|
-
|
|
5367
|
-
|
|
5135
|
+
var pathname = window.location.pathname;
|
|
5136
|
+
// Iframe apps are matched by mount path (prefix), not by APP_NAME — shell-side
|
|
5137
|
+
// the APP_NAME is the shell's, not the embedded app's.
|
|
5138
|
+
if (tile.appName === 'embedded') {
|
|
5139
|
+
return pathIsUnderTile(tile, pathname);
|
|
5368
5140
|
}
|
|
5141
|
+
var appName = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
|
|
5369
5142
|
if (tile.appName) {
|
|
5370
|
-
return tile.appName ===
|
|
5143
|
+
return tile.appName === appName;
|
|
5371
5144
|
} else {
|
|
5372
5145
|
return tile.path === "/".concat(appName);
|
|
5373
5146
|
}
|
|
@@ -5399,7 +5172,7 @@ var getAppTileData = /*#__PURE__*/function () {
|
|
|
5399
5172
|
return getConfig(coreConfigUri);
|
|
5400
5173
|
case 1:
|
|
5401
5174
|
config = _context2.v;
|
|
5402
|
-
storage.setLocalItem('opsportal-core:config', config);
|
|
5175
|
+
storage$2.setLocalItem('opsportal-core:config', config);
|
|
5403
5176
|
return _context2.a(2, findAppData(config.tiles, config.tileOverrides));
|
|
5404
5177
|
}
|
|
5405
5178
|
}, _callee2);
|
|
@@ -5409,6 +5182,317 @@ var getAppTileData = /*#__PURE__*/function () {
|
|
|
5409
5182
|
};
|
|
5410
5183
|
}();
|
|
5411
5184
|
|
|
5185
|
+
var getRouteName = function getRouteName() {
|
|
5186
|
+
return window.location.pathname.split('/').splice(1)[0];
|
|
5187
|
+
};
|
|
5188
|
+
|
|
5189
|
+
// True when the current URL is an iframe-embedded app — legacy "/embedded/<app>"
|
|
5190
|
+
// OR a new root-mounted React app at "/<app>". Decided from config (tiles with
|
|
5191
|
+
// appName === 'embedded'), NOT from a "/embedded" URL substring, so root-mounted
|
|
5192
|
+
// apps get identical chrome/behaviour. Single predicate reused across app-frame.
|
|
5193
|
+
var isEmbeddedRoute = function isEmbeddedRoute() {
|
|
5194
|
+
var pathname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.pathname;
|
|
5195
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config') || {};
|
|
5196
|
+
return Boolean(getEmbeddedTileForPath(coreAppConfig.tiles || [], pathname));
|
|
5197
|
+
};
|
|
5198
|
+
var regexCountry = /\.co\.([a-z]{2})/;
|
|
5199
|
+
var regexCobaltCountry = /\.copart\.([a-z]{2})/;
|
|
5200
|
+
var isLogoutRoute = ['logout'].includes(getRouteName());
|
|
5201
|
+
var isAuthRoute = ['login', 'logout', ''].includes(getRouteName());
|
|
5202
|
+
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
|
|
5203
|
+
var getDomain = function getDomain(url) {
|
|
5204
|
+
var country = url.match(regexCountry);
|
|
5205
|
+
var countryCode = (country && country.length > 1 && country[1] || 'US').toUpperCase();
|
|
5206
|
+
if (countryCode === 'UK') {
|
|
5207
|
+
return 'copart.co.uk';
|
|
5208
|
+
} else {
|
|
5209
|
+
var matchedCountry = url.match(regexCobaltCountry);
|
|
5210
|
+
var matchedCountryCode = matchedCountry.length > 1 ? matchedCountry[1].toLowerCase() : ['.copart.co', 'co'];
|
|
5211
|
+
if (matchedCountryCode === 'de') {
|
|
5212
|
+
return 'copart.de';
|
|
5213
|
+
} else if (matchedCountryCode === 'es') {
|
|
5214
|
+
return 'copart.es';
|
|
5215
|
+
} else return 'copart.com';
|
|
5216
|
+
}
|
|
5217
|
+
};
|
|
5218
|
+
var dateDiffInDays = function dateDiffInDays(date1, date2) {
|
|
5219
|
+
var diffInMilliseconds = Math.abs(date2 - date1);
|
|
5220
|
+
var millisecondsPerDay = 24 * 60 * 60 * 1000;
|
|
5221
|
+
return Math.floor(diffInMilliseconds / millisecondsPerDay);
|
|
5222
|
+
};
|
|
5223
|
+
var isChrome = function isChrome() {
|
|
5224
|
+
var userAgent = window.navigator.userAgent;
|
|
5225
|
+
var isChromium = userAgent.indexOf('Chrome/') > -1;
|
|
5226
|
+
var isEdge = userAgent.indexOf('Edg/') > -1;
|
|
5227
|
+
return isChromium && !isEdge;
|
|
5228
|
+
};
|
|
5229
|
+
var isUserStatusHidden = function isUserStatusHidden() {
|
|
5230
|
+
var _window$toolkitEnv, _storage$coreConfig2, _storage$coreConfig3;
|
|
5231
|
+
var isCoreApp = isEmbeddedRoute() ? false : (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
5232
|
+
if (isCoreApp) {
|
|
5233
|
+
var _storage$coreConfig;
|
|
5234
|
+
return ((_storage$coreConfig = storage$2.coreConfig) === null || _storage$coreConfig === void 0 ? void 0 : _storage$coreConfig.hideUserStatus) || false;
|
|
5235
|
+
}
|
|
5236
|
+
if ((_storage$coreConfig2 = storage$2.coreConfig) !== null && _storage$coreConfig2 !== void 0 && _storage$coreConfig2.checkUserStatusByApp) {
|
|
5237
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config') || {};
|
|
5238
|
+
var appData = findAppData(coreAppConfig.tiles || [], coreAppConfig.tileOverrides || []);
|
|
5239
|
+
return (appData === null || appData === void 0 ? void 0 : appData.showUserStatus) !== true;
|
|
5240
|
+
}
|
|
5241
|
+
return ((_storage$coreConfig3 = storage$2.coreConfig) === null || _storage$coreConfig3 === void 0 ? void 0 : _storage$coreConfig3.hideUserStatus) || false;
|
|
5242
|
+
};
|
|
5243
|
+
|
|
5244
|
+
var DEFAULT_BREADCRUMBS_CONTEXT = {
|
|
5245
|
+
error: 'You tried to use Breadcrumbs outside of its context.'
|
|
5246
|
+
};
|
|
5247
|
+
|
|
5248
|
+
var css_248z$r = ".utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Breadcrumbs {\n /* height: 36px;\n background: #3c4656; */\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--crumbs {\n display: flex;\n}\n\n#notCrumbs {\n height: 100%;\n margin-right: 12px;\n display: flex;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb {\n cursor: pointer;\n height: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: 300;\n letter-spacing: 0;\n /* transition: all 0.2s; */\n position: relative;\n top: -2px;\n color: rgba(255, 255, 255, 0.8);\n grid-gap: 6px;\n gap: 6px;\n margin-left: 5px;\n opacity: 1;\n}\n\n@-webkit-keyframes utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--fadeIn {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(-6px);\n transform: translateX(-6px);\n /* transform: scale(0.9); */\n }\n 100% {\n opacity: 1;\n -webkit-transform: translateX(0px);\n transform: translateX(0px);\n /* transform: scale(1); */\n }\n}\n\n@keyframes utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--fadeIn {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(-6px);\n transform: translateX(-6px);\n /* transform: scale(0.9); */\n }\n 100% {\n opacity: 1;\n -webkit-transform: translateX(0px);\n transform: translateX(0px);\n /* transform: scale(1); */\n }\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb {\n -webkit-animation-name: utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--fadeIn;\n animation-name: utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--fadeIn;\n -webkit-animation-duration: 0.2s;\n animation-duration: 0.2s;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb::before {\n content: '\\f054';\n color: rgba(255, 255, 255, 0.4);\n display: inline-block;\n font-family: 'Font Awesome 6 Pro';\n font-size: 16px;\n margin: 0 6px;\n position: relative;\n top: 2px;\n}\n\n/* .Crumb:first-of-type {\n margin-left: 12px;\n font-weight: 400;\n} */\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb:hover {\n /* background: rgba(0, 0, 0, 0.15); */\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb:not(:last-of-type):not(:hover) {\n /* opacity: 0.75; */\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb:last-of-type {\n font-weight: 700;\n opacity: 1;\n color: rgba(255, 255, 255, 1);\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb:last-of-type::before {\n font-weight: 300;\n /* opacity: 0.8; */\n}\n\n/* .crumbSpacer {} */\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--crumbs {\n /* margin: 10px; */\n flex-grow: 2;\n font-size: 14px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--notCrumbs {\n height: 100%;\n display: flex;\n margin-right: 0px !important;\n}\n\n.utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--entityIndicator {\n height: 100%;\n display: flex;\n margin-right: 0px !important;\n}";
|
|
5249
|
+
styleInject(css_248z$r);
|
|
5250
|
+
|
|
5251
|
+
var Context = createContext(DEFAULT_BREADCRUMBS_CONTEXT);
|
|
5252
|
+
var withBreadcrumbs = function withBreadcrumbs(Comp) {
|
|
5253
|
+
return /*#__PURE__*/function (_React$Component) {
|
|
5254
|
+
function _class() {
|
|
5255
|
+
_classCallCheck$3(this, _class);
|
|
5256
|
+
return _callSuper(this, _class, arguments);
|
|
5257
|
+
}
|
|
5258
|
+
_inherits$2(_class, _React$Component);
|
|
5259
|
+
return _createClass$2(_class, [{
|
|
5260
|
+
key: "render",
|
|
5261
|
+
value: function render() {
|
|
5262
|
+
var _this = this;
|
|
5263
|
+
return /*#__PURE__*/React__namespace.createElement(Context.Consumer, null, function (breadcrumbs) {
|
|
5264
|
+
return /*#__PURE__*/React__namespace.createElement(Comp, _extends$1({}, _this.props, {
|
|
5265
|
+
breadcrumbs: breadcrumbs
|
|
5266
|
+
}));
|
|
5267
|
+
});
|
|
5268
|
+
}
|
|
5269
|
+
}]);
|
|
5270
|
+
}(React__namespace.Component);
|
|
5271
|
+
};
|
|
5272
|
+
var Breadcrumbs = withBreadcrumbs(index$1.purist(function (props) {
|
|
5273
|
+
var _props$appTile, _props$appTile3;
|
|
5274
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
5275
|
+
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Breadcrumbs"
|
|
5276
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
5277
|
+
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--crumbs"
|
|
5278
|
+
}, props !== null && props !== void 0 && (_props$appTile = props.appTile) !== null && _props$appTile !== void 0 && _props$appTile.title ? /*#__PURE__*/React__namespace.createElement("a", {
|
|
5279
|
+
onClick: function onClick() {
|
|
5280
|
+
var _props$appTile2;
|
|
5281
|
+
var isEmbedded = isEmbeddedRoute();
|
|
5282
|
+
props.history.push(isEmbedded && (_props$appTile2 = props.appTile) !== null && _props$appTile2 !== void 0 && _props$appTile2.path ? props.appTile.path : '/');
|
|
5283
|
+
},
|
|
5284
|
+
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb"
|
|
5285
|
+
}, props === null || props === void 0 ? void 0 : (_props$appTile3 = props.appTile) === null || _props$appTile3 === void 0 ? void 0 : _props$appTile3.title) : null, props.breadcrumbs.crumbs.map(function (crumb, idx) {
|
|
5286
|
+
return /*#__PURE__*/React__namespace.createElement("a", {
|
|
5287
|
+
onClick: function onClick() {
|
|
5288
|
+
return props.history.push(crumb.to);
|
|
5289
|
+
},
|
|
5290
|
+
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb",
|
|
5291
|
+
key: crumb.crumbId != null ? crumb.crumbId : idx
|
|
5292
|
+
}, crumb.children);
|
|
5293
|
+
}, this)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
5294
|
+
id: "notCrumbs",
|
|
5295
|
+
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--notCrumbs"
|
|
5296
|
+
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
5297
|
+
id: "entityIndicator",
|
|
5298
|
+
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--entityIndicator"
|
|
5299
|
+
}));
|
|
5300
|
+
}));
|
|
5301
|
+
|
|
5302
|
+
var BreadcrumbsProvider = /*#__PURE__*/function (_React$Component) {
|
|
5303
|
+
function BreadcrumbsProvider(props) {
|
|
5304
|
+
var _this;
|
|
5305
|
+
_classCallCheck$3(this, BreadcrumbsProvider);
|
|
5306
|
+
_this = _callSuper(this, BreadcrumbsProvider, [props]);
|
|
5307
|
+
_defineProperty$2(_this, "crumbIds", new Set());
|
|
5308
|
+
_this.state = function () {
|
|
5309
|
+
var self = _this;
|
|
5310
|
+
return {
|
|
5311
|
+
crumbs: [],
|
|
5312
|
+
addCrumb: function addCrumb(props, crumbId, oldId) {
|
|
5313
|
+
var newCrumb = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
5314
|
+
crumbId: crumbId
|
|
5315
|
+
});
|
|
5316
|
+
self.setState(function (state) {
|
|
5317
|
+
return {
|
|
5318
|
+
crumbs: oldId ? state.crumbs.map(function (crumb) {
|
|
5319
|
+
return crumb.crumbId === oldId ? newCrumb : crumb;
|
|
5320
|
+
}) : [].concat(_toConsumableArray(state.crumbs), [newCrumb])
|
|
5321
|
+
};
|
|
5322
|
+
});
|
|
5323
|
+
},
|
|
5324
|
+
removeCrumb: function removeCrumb(crumbId) {
|
|
5325
|
+
// Filter out the specific crumb by its crumbId.
|
|
5326
|
+
self.setState(function (state) {
|
|
5327
|
+
return {
|
|
5328
|
+
crumbs: state.crumbs.filter(function (crumb) {
|
|
5329
|
+
return crumb.crumbId !== crumbId;
|
|
5330
|
+
})
|
|
5331
|
+
};
|
|
5332
|
+
});
|
|
5333
|
+
}
|
|
5334
|
+
};
|
|
5335
|
+
}();
|
|
5336
|
+
return _this;
|
|
5337
|
+
}
|
|
5338
|
+
_inherits$2(BreadcrumbsProvider, _React$Component);
|
|
5339
|
+
return _createClass$2(BreadcrumbsProvider, [{
|
|
5340
|
+
key: "render",
|
|
5341
|
+
value: function render() {
|
|
5342
|
+
return /*#__PURE__*/React__namespace.createElement(Context.Provider, {
|
|
5343
|
+
value: this.state
|
|
5344
|
+
}, this.props.children);
|
|
5345
|
+
}
|
|
5346
|
+
}]);
|
|
5347
|
+
}(React__namespace.Component);
|
|
5348
|
+
|
|
5349
|
+
var _class;
|
|
5350
|
+
var _excluded$6 = ["breadcrumbs"];
|
|
5351
|
+
var getCrumbProps = function getCrumbProps(props) {
|
|
5352
|
+
props.breadcrumbs;
|
|
5353
|
+
var crumbProps = _objectWithoutProperties(props, _excluded$6);
|
|
5354
|
+
return crumbProps;
|
|
5355
|
+
};
|
|
5356
|
+
|
|
5357
|
+
// Flatten children to a comparable text label. Children may be a React element
|
|
5358
|
+
// (e.g. <span onClick>Label</span>) whose internal fiber refs (`_owner`) are
|
|
5359
|
+
// circular, so it must never be passed to JSON.stringify.
|
|
5360
|
+
var _crumbLabel = function crumbLabel(children) {
|
|
5361
|
+
if (children == null) return '';
|
|
5362
|
+
if (typeof children === 'string' || typeof children === 'number') return String(children);
|
|
5363
|
+
if (Array.isArray(children)) return children.map(_crumbLabel).join('');
|
|
5364
|
+
if (React__namespace.isValidElement(children) && children.props && children.props.children != null) {
|
|
5365
|
+
return _crumbLabel(children.props.children);
|
|
5366
|
+
}
|
|
5367
|
+
return '';
|
|
5368
|
+
};
|
|
5369
|
+
|
|
5370
|
+
// Safe replacement for the old JSON.stringify diff, which threw
|
|
5371
|
+
// "Converting circular structure to JSON" whenever children was a React element.
|
|
5372
|
+
var crumbPropsChanged = function crumbPropsChanged(oldProps, newProps) {
|
|
5373
|
+
var keys = new Set([].concat(_toConsumableArray(Object.keys(oldProps)), _toConsumableArray(Object.keys(newProps))));
|
|
5374
|
+
var _iterator = _createForOfIteratorHelper(keys),
|
|
5375
|
+
_step;
|
|
5376
|
+
try {
|
|
5377
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
5378
|
+
var key = _step.value;
|
|
5379
|
+
if (key === 'children') {
|
|
5380
|
+
if (_crumbLabel(oldProps.children) !== _crumbLabel(newProps.children)) return true;
|
|
5381
|
+
} else if (oldProps[key] !== newProps[key]) {
|
|
5382
|
+
return true;
|
|
5383
|
+
}
|
|
5384
|
+
}
|
|
5385
|
+
} catch (err) {
|
|
5386
|
+
_iterator.e(err);
|
|
5387
|
+
} finally {
|
|
5388
|
+
_iterator.f();
|
|
5389
|
+
}
|
|
5390
|
+
return false;
|
|
5391
|
+
};
|
|
5392
|
+
var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
|
|
5393
|
+
function Crumb() {
|
|
5394
|
+
var _this;
|
|
5395
|
+
_classCallCheck$3(this, Crumb);
|
|
5396
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5397
|
+
args[_key] = arguments[_key];
|
|
5398
|
+
}
|
|
5399
|
+
_this = _callSuper(this, Crumb, [].concat(args));
|
|
5400
|
+
_defineProperty$2(_this, "crumbId", nonSecure());
|
|
5401
|
+
return _this;
|
|
5402
|
+
}
|
|
5403
|
+
_inherits$2(Crumb, _React$Component);
|
|
5404
|
+
return _createClass$2(Crumb, [{
|
|
5405
|
+
key: "componentDidMount",
|
|
5406
|
+
value: function componentDidMount() {
|
|
5407
|
+
var crumbProps = getCrumbProps(this.props);
|
|
5408
|
+
this.props.breadcrumbs.addCrumb(crumbProps, this.crumbId);
|
|
5409
|
+
}
|
|
5410
|
+
}, {
|
|
5411
|
+
key: "shouldComponentUpdate",
|
|
5412
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
5413
|
+
var oldProps = getCrumbProps(this.props);
|
|
5414
|
+
var newProps = getCrumbProps(nextProps);
|
|
5415
|
+
return crumbPropsChanged(oldProps, newProps);
|
|
5416
|
+
}
|
|
5417
|
+
}, {
|
|
5418
|
+
key: "componentDidUpdate",
|
|
5419
|
+
value: function componentDidUpdate() {
|
|
5420
|
+
var oldId = this.crumbId;
|
|
5421
|
+
this.crumbId = nonSecure();
|
|
5422
|
+
var crumbProps = getCrumbProps(this.props);
|
|
5423
|
+
this.props.breadcrumbs.addCrumb(crumbProps, this.crumbId, oldId);
|
|
5424
|
+
}
|
|
5425
|
+
}, {
|
|
5426
|
+
key: "componentWillUnmount",
|
|
5427
|
+
value: function componentWillUnmount() {
|
|
5428
|
+
this.props.breadcrumbs.removeCrumb(this.crumbId);
|
|
5429
|
+
}
|
|
5430
|
+
}, {
|
|
5431
|
+
key: "render",
|
|
5432
|
+
value: function render() {
|
|
5433
|
+
return null;
|
|
5434
|
+
}
|
|
5435
|
+
}]);
|
|
5436
|
+
}(React__namespace.Component)) || _class;
|
|
5437
|
+
Crumb$1.defaultProps = {
|
|
5438
|
+
breadcrumbs: {
|
|
5439
|
+
addCrumb: function addCrumb() {},
|
|
5440
|
+
removeCrumb: function removeCrumb() {},
|
|
5441
|
+
crumbs: []
|
|
5442
|
+
}
|
|
5443
|
+
};
|
|
5444
|
+
|
|
5445
|
+
/**
|
|
5446
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5447
|
+
*
|
|
5448
|
+
* This source code is licensed under the MIT license found in the
|
|
5449
|
+
* LICENSE file in the root directory of this source tree.
|
|
5450
|
+
*/
|
|
5451
|
+
|
|
5452
|
+
/**
|
|
5453
|
+
* Use invariant() to assert state which your program assumes to be true.
|
|
5454
|
+
*
|
|
5455
|
+
* Provide sprintf-style format (only %s is supported) and arguments
|
|
5456
|
+
* to provide information about what broke and what you were
|
|
5457
|
+
* expecting.
|
|
5458
|
+
*
|
|
5459
|
+
* The invariant message will be stripped in production, but the invariant
|
|
5460
|
+
* will remain to ensure logic does not differ in production.
|
|
5461
|
+
*/
|
|
5462
|
+
var invariant = function (condition, format, a, b, c, d, e, f) {
|
|
5463
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5464
|
+
if (format === undefined) {
|
|
5465
|
+
throw new Error('invariant requires an error message argument');
|
|
5466
|
+
}
|
|
5467
|
+
}
|
|
5468
|
+
if (!condition) {
|
|
5469
|
+
var error;
|
|
5470
|
+
if (format === undefined) {
|
|
5471
|
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
5472
|
+
} else {
|
|
5473
|
+
var args = [a, b, c, d, e, f];
|
|
5474
|
+
var argIndex = 0;
|
|
5475
|
+
error = new Error(format.replace(/%s/g, function () {
|
|
5476
|
+
return args[argIndex++];
|
|
5477
|
+
}));
|
|
5478
|
+
error.name = 'Invariant Violation';
|
|
5479
|
+
}
|
|
5480
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
5481
|
+
throw error;
|
|
5482
|
+
}
|
|
5483
|
+
};
|
|
5484
|
+
var browser$2 = invariant;
|
|
5485
|
+
|
|
5486
|
+
Object.defineProperty(fetcher$1, 'extend', {
|
|
5487
|
+
enumerable: false,
|
|
5488
|
+
value: function value(name, fn) {
|
|
5489
|
+
var INVALID_NAMES = ['defaults', 'delete', 'put', 'post', 'get', 'head', 'interceptors', 'options', 'patch', 'request'];
|
|
5490
|
+
var INVALID_NAME_WARNING = "The name of the method used (\"".concat(name, "\") to extend fetcher is invalid.");
|
|
5491
|
+
!!INVALID_NAMES.includes(name) ? process.env.NODE_ENV !== "production" ? browser$2(false, INVALID_NAME_WARNING) : browser$2(false) : void 0;
|
|
5492
|
+
fetcher$1[name] = fn;
|
|
5493
|
+
}
|
|
5494
|
+
});
|
|
5495
|
+
|
|
5412
5496
|
var MEA_COUNTRIES = ['ARE', 'BHR', 'OMN'];
|
|
5413
5497
|
var getHeaders$1 = function getHeaders() {
|
|
5414
5498
|
var country = storage.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
@@ -9337,56 +9421,6 @@ fetcher$1.getUserScopes = getUserScopes;
|
|
|
9337
9421
|
fetcher$1.getCobaltUserFacilities = getCobaltUserFacilities;
|
|
9338
9422
|
fetcher$1.getCobaltUserRoles = getCobaltUserRoles;
|
|
9339
9423
|
|
|
9340
|
-
var getRouteName = function getRouteName() {
|
|
9341
|
-
return window.location.pathname.split('/').splice(1)[0];
|
|
9342
|
-
};
|
|
9343
|
-
var regexCountry = /\.co\.([a-z]{2})/;
|
|
9344
|
-
var regexCobaltCountry = /\.copart\.([a-z]{2})/;
|
|
9345
|
-
var isLogoutRoute = ['logout'].includes(getRouteName());
|
|
9346
|
-
var isAuthRoute = ['login', 'logout', ''].includes(getRouteName());
|
|
9347
|
-
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
|
|
9348
|
-
var getDomain = function getDomain(url) {
|
|
9349
|
-
var country = url.match(regexCountry);
|
|
9350
|
-
var countryCode = (country && country.length > 1 && country[1] || 'US').toUpperCase();
|
|
9351
|
-
if (countryCode === 'UK') {
|
|
9352
|
-
return 'copart.co.uk';
|
|
9353
|
-
} else {
|
|
9354
|
-
var matchedCountry = url.match(regexCobaltCountry);
|
|
9355
|
-
var matchedCountryCode = matchedCountry.length > 1 ? matchedCountry[1].toLowerCase() : ['.copart.co', 'co'];
|
|
9356
|
-
if (matchedCountryCode === 'de') {
|
|
9357
|
-
return 'copart.de';
|
|
9358
|
-
} else if (matchedCountryCode === 'es') {
|
|
9359
|
-
return 'copart.es';
|
|
9360
|
-
} else return 'copart.com';
|
|
9361
|
-
}
|
|
9362
|
-
};
|
|
9363
|
-
var dateDiffInDays = function dateDiffInDays(date1, date2) {
|
|
9364
|
-
var diffInMilliseconds = Math.abs(date2 - date1);
|
|
9365
|
-
var millisecondsPerDay = 24 * 60 * 60 * 1000;
|
|
9366
|
-
return Math.floor(diffInMilliseconds / millisecondsPerDay);
|
|
9367
|
-
};
|
|
9368
|
-
var isChrome = function isChrome() {
|
|
9369
|
-
var userAgent = window.navigator.userAgent;
|
|
9370
|
-
var isChromium = userAgent.indexOf('Chrome/') > -1;
|
|
9371
|
-
var isEdge = userAgent.indexOf('Edg/') > -1;
|
|
9372
|
-
return isChromium && !isEdge;
|
|
9373
|
-
};
|
|
9374
|
-
var isUserStatusHidden = function isUserStatusHidden() {
|
|
9375
|
-
var _window$toolkitEnv, _storage$coreConfig2, _storage$coreConfig3;
|
|
9376
|
-
var isEmbeddedRoute = window.location.pathname.includes('embedded');
|
|
9377
|
-
var isCoreApp = isEmbeddedRoute ? false : (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
|
|
9378
|
-
if (isCoreApp) {
|
|
9379
|
-
var _storage$coreConfig;
|
|
9380
|
-
return ((_storage$coreConfig = storage$2.coreConfig) === null || _storage$coreConfig === void 0 ? void 0 : _storage$coreConfig.hideUserStatus) || false;
|
|
9381
|
-
}
|
|
9382
|
-
if ((_storage$coreConfig2 = storage$2.coreConfig) !== null && _storage$coreConfig2 !== void 0 && _storage$coreConfig2.checkUserStatusByApp) {
|
|
9383
|
-
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config') || {};
|
|
9384
|
-
var appData = findAppData(coreAppConfig.tiles || [], coreAppConfig.tileOverrides || []);
|
|
9385
|
-
return (appData === null || appData === void 0 ? void 0 : appData.showUserStatus) !== true;
|
|
9386
|
-
}
|
|
9387
|
-
return ((_storage$coreConfig3 = storage$2.coreConfig) === null || _storage$coreConfig3 === void 0 ? void 0 : _storage$coreConfig3.hideUserStatus) || false;
|
|
9388
|
-
};
|
|
9389
|
-
|
|
9390
9424
|
var css_248z$q = ".utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--ConfigFetcher {\n}\n\n.utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--spinner {\n margin: 80px 0 40px;\n width: 100%;\n height: 100%;\n}\n\n.utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--spinner * {\n width: 60px;\n height: 60px;\n}\n";
|
|
9391
9425
|
styleInject(css_248z$q);
|
|
9392
9426
|
|
|
@@ -21618,7 +21652,7 @@ var _styleModuleImportMap$9 = {
|
|
|
21618
21652
|
}
|
|
21619
21653
|
};
|
|
21620
21654
|
var isEmbeddedPath = function isEmbeddedPath() {
|
|
21621
|
-
return typeof window !== 'undefined' &&
|
|
21655
|
+
return typeof window !== 'undefined' && isEmbeddedRoute();
|
|
21622
21656
|
};
|
|
21623
21657
|
var CopartLogo = function CopartLogo() {
|
|
21624
21658
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
@@ -27051,7 +27085,11 @@ var generateAppBarElements = function generateAppBarElements(props, showCallout)
|
|
|
27051
27085
|
enableIdeaNote = coreAppConfig.enableIdeaNote,
|
|
27052
27086
|
enableMiHelp = coreAppConfig.enableMiHelp;
|
|
27053
27087
|
var showSettingsInAppbar = false;
|
|
27054
|
-
|
|
27088
|
+
|
|
27089
|
+
// isCoreRoute is frozen at shell-boot URL and stays true through SPA nav on a
|
|
27090
|
+
// home-booted session; isEmbeddedRoute() adds the same branch for a COLD-LOAD
|
|
27091
|
+
// onto a root-mounted iframe app so cold-load === home-nav.
|
|
27092
|
+
if (isCoreRoute || isEmbeddedRoute()) {
|
|
27055
27093
|
showSettingsInAppbar = enableNewToolkitFeatures;
|
|
27056
27094
|
} else if (!isAuthRoute) {
|
|
27057
27095
|
if (enableNewToolkitFeatures && showSettingsMenuByTileConfig) {
|
|
@@ -27695,12 +27733,12 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27695
27733
|
return tile.path === "/".concat(appName);
|
|
27696
27734
|
}
|
|
27697
27735
|
});
|
|
27698
|
-
|
|
27699
|
-
|
|
27700
|
-
|
|
27701
|
-
|
|
27702
|
-
|
|
27703
|
-
matchingTiles = [].concat(_toConsumableArray(matchingTiles),
|
|
27736
|
+
// Also match the iframe app whose mount path owns the current URL — legacy
|
|
27737
|
+
// "/embedded/<app>" or new root-mounted "/<app>". Config-driven (see
|
|
27738
|
+
// getEmbeddedTileForPath), not a "/embedded" URL substring.
|
|
27739
|
+
var embeddedTile = getEmbeddedTileForPath(appTiles, window.location.pathname);
|
|
27740
|
+
if (embeddedTile) {
|
|
27741
|
+
matchingTiles = [].concat(_toConsumableArray(matchingTiles), [embeddedTile]);
|
|
27704
27742
|
}
|
|
27705
27743
|
if (matchingTiles.length > 1) {
|
|
27706
27744
|
var currentLocation = window.location.pathname;
|
|
@@ -30689,7 +30727,10 @@ var notificationsSource = pathOr$1([], ['notificationsSource'])(coreAppConfig);
|
|
|
30689
30727
|
var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures;
|
|
30690
30728
|
var getIdeaNoteEnabledStatus = function getIdeaNoteEnabledStatus(tileData) {
|
|
30691
30729
|
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
30692
|
-
|
|
30730
|
+
// isCoreRoute is frozen at shell-boot URL; on a home-booted session it stays
|
|
30731
|
+
// true through SPA nav to any iframe app. isEmbeddedRoute() adds the same
|
|
30732
|
+
// branch for a COLD-LOAD onto a root-mounted app so cold-load === home-nav.
|
|
30733
|
+
if (isCoreRoute || isEmbeddedRoute() || coreAppConfig.enableIdeaNoteGlobally) {
|
|
30693
30734
|
return coreAppConfig.enableIdeaNote;
|
|
30694
30735
|
} else {
|
|
30695
30736
|
return tileData.enableIdeaNote;
|
|
@@ -30783,9 +30824,10 @@ var AppBar = function AppBar(_ref) {
|
|
|
30783
30824
|
var _useErrorNotification = useErrorNotification(),
|
|
30784
30825
|
showError = _useErrorNotification.showError;
|
|
30785
30826
|
var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
|
|
30786
|
-
var
|
|
30827
|
+
var isEmbeddedApp = isEmbeddedRoute();
|
|
30828
|
+
var mihelpAppPath = isCoreRoute && !isEmbeddedApp ? null : tileData.mihelpAppPath;
|
|
30787
30829
|
var isMihelpEnabled;
|
|
30788
|
-
if (isCoreRoute && !
|
|
30830
|
+
if (isCoreRoute && !isEmbeddedApp) {
|
|
30789
30831
|
isMihelpEnabled = coreAppConfig.enableMiHelp;
|
|
30790
30832
|
} else {
|
|
30791
30833
|
isMihelpEnabled = Boolean(mihelpAppPath);
|
|
@@ -31262,7 +31304,11 @@ var AppBar = function AppBar(_ref) {
|
|
|
31262
31304
|
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
31263
31305
|
};
|
|
31264
31306
|
}, [socketClient]);
|
|
31265
|
-
|
|
31307
|
+
|
|
31308
|
+
// Reset notifications per embedded app switch. Keyed on the pathname for any
|
|
31309
|
+
// iframe app (legacy "/embedded/*" or root-mounted "/<app>"); a single sentinel
|
|
31310
|
+
// otherwise so standalone/core routes share one bucket.
|
|
31311
|
+
var notificationsReloadPathKey = pathname && isEmbeddedRoute(pathname) ? pathname : '__non_embedded__';
|
|
31266
31312
|
React.useEffect(function () {
|
|
31267
31313
|
setNotifications([]);
|
|
31268
31314
|
setListOfAllNotifications([]);
|
|
@@ -31653,7 +31699,14 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
31653
31699
|
// If we got this far, the user must be authenticated, and
|
|
31654
31700
|
// opsportal-core accepts ALL authenticated users. So if we determine
|
|
31655
31701
|
// that we are on a opsportal-core route, allow the user in.
|
|
31656
|
-
|
|
31702
|
+
//
|
|
31703
|
+
// isEmbeddedRoute() covers a COLD-LOAD onto an iframe app's own path
|
|
31704
|
+
// (legacy "/embedded/*" is already core via isCoreRoute; new root-mounted
|
|
31705
|
+
// React apps at "/<app>" are not). Passing here makes the shell frame-gate
|
|
31706
|
+
// identical to the home-nav flow, where AuthGuard already passed at "/" boot
|
|
31707
|
+
// and per-iframe access is enforced by IframeComponent.userHasAccess. This
|
|
31708
|
+
// keeps cold-load functionally identical to navigating from Home.
|
|
31709
|
+
if (!(isCoreRoute || isEmbeddedRoute())) {
|
|
31657
31710
|
_context.n = 2;
|
|
31658
31711
|
break;
|
|
31659
31712
|
}
|
|
@@ -65377,7 +65430,7 @@ var AppFrame = function AppFrame(props) {
|
|
|
65377
65430
|
chatBotAppFunctionId = _ref.chatBotAppFunctionId;
|
|
65378
65431
|
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
|
|
65379
65432
|
var hasChatBotAccess = userHasChatBotAccess$1(chatBotAppFunctionId);
|
|
65380
|
-
var chatBotEnabled = isCoreRoute && !
|
|
65433
|
+
var chatBotEnabled = isCoreRoute && !isEmbeddedRoute() ? enableChatBot && hasChatBotAccess : (tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot) && hasChatBotAccess;
|
|
65381
65434
|
setChatBotEnabled(chatBotEnabled);
|
|
65382
65435
|
chatBotEnabledRef.current = chatBotEnabled;
|
|
65383
65436
|
};
|
|
@@ -70972,6 +71025,7 @@ function registerEarlyLoadUriListener() {
|
|
|
70972
71025
|
window.__IFRAME_EARLY_LOAD_URI_LISTENER_REGISTERED = true;
|
|
70973
71026
|
window.__IFRAME_EARLY_LOAD_URI = null;
|
|
70974
71027
|
window.addEventListener('message', function (event) {
|
|
71028
|
+
if (event.source !== window.parent) return;
|
|
70975
71029
|
if (!isAllowedOrigin(event.origin)) return;
|
|
70976
71030
|
if (event.data && event.data.eventType === IFRAME_EVENTS.LOAD_URI && event.data.eventProps) {
|
|
70977
71031
|
window.__IFRAME_EARLY_LOAD_URI = event.data.eventProps.uri || '/';
|