-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path11306.28f2636e.iframe.bundle.js
1 lines (1 loc) · 59.5 KB
/
11306.28f2636e.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[11306],{"./ui/components/app/permission-cell/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>permission_cell});var react=__webpack_require__("./node_modules/react/index.js"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),es=__webpack_require__("./node_modules/react-redux/es/index.js"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),tooltip=__webpack_require__("./ui/components/ui/tooltip/index.js"),selectors=__webpack_require__("./ui/selectors/index.js"),box=__webpack_require__("./ui/components/ui/box/index.js"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),menu=__webpack_require__("./ui/components/ui/menu/index.js"),popover_component=__webpack_require__("./ui/components/ui/popover/popover.component.js"),permissions=__webpack_require__("./shared/constants/snaps/permissions.ts"),actions=__webpack_require__("./ui/__mocks__/actions.js");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var PermissionCellOptions=function(param){var snapId=param.snapId,permissionName=param.permissionName,description=param.description,t=(0,useI18nContext.P)(),dispatch=(0,es.wA)(),ref=(0,react.useRef)(!1),_useState=_sliced_to_array((0,react.useState)(!1),2),showOptions=_useState[0],setShowOptions=_useState[1],_useState1=_sliced_to_array((0,react.useState)(!1),2),showDetails=_useState1[0],setShowDetails=_useState1[1],isRevokable=permissions.Kx.includes(permissionName);return description||isRevokable?react.createElement(box.Ay,{ref:ref},react.createElement(component_library.a2,{iconName:component_library.$M.MoreVertical,ariaLabel:t("options"),onClick:function(){setShowOptions(!0)},"data-testid":permissionName}),showOptions&&react.createElement(menu.W,{anchorElement:ref.current,onHide:function(){setShowOptions(!1)}},description&&react.createElement(menu.D,{onClick:function(){setShowOptions(!1),setShowDetails(!0)}},react.createElement(component_library.EY,{variant:design_system.J3.bodySm,style:{whiteSpace:"nowrap"}},t("details"))),isRevokable&&react.createElement(menu.D,{onClick:function(){setShowOptions(!1),dispatch((0,actions.revokeDynamicSnapPermissions)(snapId,[permissionName]))}},react.createElement(component_library.EY,{variant:design_system.J3.bodySm,color:design_system.r7.errorDefault,style:{whiteSpace:"nowrap"}},t("revokePermission")))),showDetails&&react.createElement(popover_component.A,{title:t("details"),onClose:function(){setShowOptions(!1),setShowDetails(!1)}},react.createElement(box.Ay,{marginLeft:4,marginRight:4,marginBottom:4},react.createElement(component_library.EY,null,description)))):null};PermissionCellOptions.propTypes={snapId:prop_types_default().string.isRequired,permissionName:prop_types_default().string.isRequired,description:prop_types_default().oneOfType([prop_types_default().string,prop_types_default().object])},PermissionCellOptions.__docgenInfo={description:"",methods:[],displayName:"PermissionCellOptions",props:{snapId:{description:"",type:{name:"string"},required:!0},permissionName:{description:"",type:{name:"string"},required:!0},description:{description:"",type:{name:"union",value:[{name:"string"},{name:"object"}]},required:!1}}};var avatar_group=__webpack_require__("./ui/components/multichain/avatar-group/index.ts"),avatar_group_types=__webpack_require__("./ui/components/multichain/avatar-group/avatar-group.types.tsx"),util=__webpack_require__("./ui/helpers/utils/util.js"),constants_network=__webpack_require__("./shared/constants/network.ts"),PermissionCellStatus=function(param){var revoked=param.revoked,approved=param.approved,dateApproved=param.dateApproved,accounts=param.accounts,networks=param.networks,t=(0,useI18nContext.P)(),renderAccountsGroup=function(){return react.createElement(react.Fragment,null,networks.length>0?react.createElement(component_library.az,{as:"span",className:"permission-cell__status__accounts-group-box",display:design_system.nl.InlineFlex},react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column},null==networks?void 0:networks.map(function(network,index){return react.createElement(component_library.az,{key:"".concat(network.name,"_").concat(index),display:design_system.nl.Flex,justifyContent:design_system.A9.flexStart,alignItems:design_system.k2.center,marginTop:2},react.createElement(component_library.Gn,{size:component_library.LM.Xs,src:constants_network.Cl[network.chainId],name:network.name}),react.createElement(component_library.EY,{variant:design_system.J3.bodyMdMedium,marginLeft:2},network.name))}))):react.createElement(component_library.az,{as:"span",className:"permission-cell__status__accounts-group-box",display:design_system.nl.InlineFlex},react.createElement(tooltip.A,{position:"bottom",html:react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column,justifyContent:design_system.A9.center,alignItems:design_system.k2.center},react.createElement(component_library.EY,{variant:design_system.J3.headingSm,color:design_system.r7.textAlternative,textAlign:design_system.nO.Center},t("accounts")),react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column},accounts.map(function(account,index){return react.createElement(component_library.az,{key:"".concat(account.avatarValue,"_").concat(index),display:design_system.nl.Flex,justifyContent:design_system.A9.flexStart,alignItems:design_system.k2.center,marginTop:2},react.createElement(component_library.vs,{address:account.avatarValue,size:component_library.oG.Xs,borderColor:design_system.cG.backgroundDefault}),react.createElement(component_library.EY,{variant:design_system.J3.bodyMdMedium,marginLeft:2},account.avatarName))})))},react.createElement(avatar_group.Z,{limit:3,members:accounts,avatarType:avatar_group_types.u.ACCOUNT,size:component_library.gh.Xs,width:design_system.Zf.Min,borderColor:design_system.cG.backgroundDefault,marginLeft:4,paddingLeft:4}))))};return react.createElement(component_library.EY,{as:"div",className:"permission-cell__status",variant:design_system.J3.bodySm,color:design_system.r7.textAlternative,display:design_system.nl.Flex},revoked?accounts&&accounts.length?t("permissionRevokedForAccounts",[renderAccountsGroup()]):t("permissionRevoked"):dateApproved?accounts&&accounts.length?t("approvedOnForAccounts",[(0,util.Yq)(dateApproved,"yyyy-MM-dd"),renderAccountsGroup()]):t("approvedOn",[(0,util.Yq)(dateApproved,"yyyy-MM-dd")]):approved?t("approved"):accounts&&accounts.length?t("permissionRequestedForAccounts",[renderAccountsGroup()]):t("permissionRequested"))};PermissionCellStatus.propTypes={revoked:prop_types_default().bool,approved:prop_types_default().bool,dateApproved:prop_types_default().number,accounts:prop_types_default().array,networks:prop_types_default().array},PermissionCellStatus.__docgenInfo={description:"Renders status of the given permission. Used by PermissionCell component.\n\n@param props - The props.\n@param props.revoked - Boolean value to identify if permission is being revoked.\n@param props.dateApproved - Timestamp when permission is approved.\n@param props.accounts - List of accounts for which permission is requested, approved or revoked.\n@param props.approved - Boolean value in case a permission has been approved, but there is no date to show.\n@param props.networks\n@returns React element rendering permission status with or without account icons displayed as AvatarGroup.",methods:[],displayName:"PermissionCellStatus",props:{revoked:{description:"",type:{name:"bool"},required:!1},approved:{description:"",type:{name:"bool"},required:!1},dateApproved:{description:"",type:{name:"number"},required:!1},accounts:{description:"",type:{name:"array"},required:!1},networks:{description:"",type:{name:"array"},required:!1}}};var PermissionCell=function(param){var _avatarIcon_props,snapId=param.snapId,permissionName=param.permissionName,title=param.title,description=param.description,weight=param.weight,avatarIcon=param.avatarIcon,dateApproved=param.dateApproved,revoked=param.revoked,approved=param.approved,showOptions=param.showOptions,hideStatus=param.hideStatus,accounts=param.accounts,permissionValue=param.permissionValue,infoIcon=component_library.$M.Info,infoIconColor=design_system.Li.iconMuted,iconColor=design_system.Li.primaryDefault,iconBackgroundColor=design_system.Q1.primaryMuted;!revoked&&weight<=2&&(iconColor=design_system.Li.warningDefault,iconBackgroundColor=design_system.Q1.warningMuted,infoIconColor=design_system.Li.warningDefault),(dateApproved||approved)&&(iconColor=design_system.Li.iconMuted,iconBackgroundColor=design_system.Q1.backgroundAlternative),revoked&&(iconColor=design_system.Li.iconMuted,iconBackgroundColor=design_system.Q1.backgroundAlternative);var permissionIcon=avatarIcon;"string"!=typeof avatarIcon&&(null==avatarIcon?void 0:null===(_avatarIcon_props=avatarIcon.props)||void 0===_avatarIcon_props?void 0:_avatarIcon_props.iconName)&&(permissionIcon=avatarIcon.props.iconName);var networksInfo=(0,es.d4)(function(state){return(0,selectors.k88)(state,permissionValue)});return react.createElement(component_library.az,{className:"permission-cell",display:design_system.nl.Flex,justifyContent:design_system.A9.center,alignItems:design_system.k2.flexStart,paddingTop:2,paddingBottom:2},react.createElement(component_library.az,{display:design_system.nl.Flex},"string"==typeof permissionIcon?react.createElement(component_library.hS,{iconName:permissionIcon,size:component_library.OQ.Md,iconProps:{size:component_library.lK.Sm},color:iconColor,backgroundColor:iconBackgroundColor}):permissionIcon),react.createElement(component_library.az,{display:design_system.nl.Flex,flexWrap:design_system.I4.Wrap,flexDirection:design_system.bo.Column,width:design_system.Zf.Full,marginLeft:4,marginRight:4},react.createElement(component_library.EY,{size:design_system.or.MD,variant:design_system.J3.bodyMd,className:classnames_default()("permission-cell__title",{"permission-cell__title-revoked":revoked})},title),!hideStatus&&react.createElement(PermissionCellStatus,{revoked:revoked,approved:approved,dateApproved:dateApproved,accounts:accounts,networks:networksInfo||null})),react.createElement(component_library.az,{display:design_system.nl.Flex},showOptions&&snapId?react.createElement(PermissionCellOptions,{snapId:snapId,permissionName:permissionName,description:description}):description&&react.createElement(tooltip.A,{html:react.createElement(component_library.EY,{variant:design_system.J3.bodySm,color:design_system.r7.textAlternative},description),position:"bottom"},react.createElement(component_library.In,{color:infoIconColor,name:infoIcon,size:component_library.lK.Sm}))))};PermissionCell.propTypes={snapId:prop_types_default().string,permissionName:prop_types_default().oneOfType([prop_types_default().string,prop_types_default().element]).isRequired,title:prop_types_default().oneOfType([prop_types_default().string.isRequired,prop_types_default().object.isRequired]),description:prop_types_default().oneOfType([prop_types_default().string,prop_types_default().object]),weight:prop_types_default().number,avatarIcon:prop_types_default().any.isRequired,dateApproved:prop_types_default().number,revoked:prop_types_default().bool,approved:prop_types_default().bool,showOptions:prop_types_default().bool,hideStatus:prop_types_default().bool,accounts:prop_types_default().array,permissionValue:prop_types_default().array};let permission_cell=PermissionCell;PermissionCell.__docgenInfo={description:"",methods:[],displayName:"PermissionCell",props:{snapId:{description:"",type:{name:"string"},required:!1},permissionName:{description:"",type:{name:"union",value:[{name:"string"},{name:"element"}]},required:!0},title:{description:"",type:{name:"union",value:[{name:"string"},{name:"object"}]},required:!1},description:{description:"",type:{name:"union",value:[{name:"string"},{name:"object"}]},required:!1},weight:{description:"",type:{name:"number"},required:!1},avatarIcon:{description:"",type:{name:"any"},required:!0},dateApproved:{description:"",type:{name:"number"},required:!1},revoked:{description:"",type:{name:"bool"},required:!1},approved:{description:"",type:{name:"bool"},required:!1},showOptions:{description:"",type:{name:"bool"},required:!1},hideStatus:{description:"",type:{name:"bool"},required:!1},accounts:{description:"",type:{name:"array"},required:!1},permissionValue:{description:"",type:{name:"array"},required:!1}}}},"./ui/components/app/permissions-connect-permission-list/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>PermissionsConnectPermissionList});var react=__webpack_require__("./node_modules/react/index.js"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),es=__webpack_require__("./node_modules/react-redux/es/index.js"),permission=__webpack_require__("./ui/helpers/utils/permission.js"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),selectors=__webpack_require__("./ui/selectors/index.js"),util=__webpack_require__("./ui/helpers/utils/util.js"),permission_cell=__webpack_require__("./ui/components/app/permission-cell/index.js"),component_library=__webpack_require__("./ui/components/component-library/index.ts");function getDescriptionNode(permission,index,accounts){return react.createElement(permission_cell.A,{permissionName:permission.name,title:permission.label,description:permission.description,weight:permission.weight,avatarIcon:permission.leftIcon,key:"".concat(permission.permissionName,"-").concat(index),accounts:accounts,permissionValue:permission.permissionValue.restrictNetworkSwitching})}function PermissionsConnectPermissionList(param){var permissions=param.permissions,subjectName=param.subjectName,accounts=param.accounts,t=(0,useI18nContext.P)(),snapsMetadata=(0,es.d4)(selectors.JaC);return react.createElement(component_library.az,{as:"span"},(0,permission.iv)({t:t,permissions:permissions,getSubjectName:(0,util.IB)(snapsMetadata),subjectName:subjectName}).map(function(permission,index){return getDescriptionNode(permission,index,accounts)}))}PermissionsConnectPermissionList.propTypes={permissions:prop_types_default().object.isRequired,subjectName:prop_types_default().string.isRequired,accounts:prop_types_default().arrayOf(prop_types_default().object)},PermissionsConnectPermissionList.__docgenInfo={description:"",methods:[],displayName:"PermissionsConnectPermissionList",props:{permissions:{description:"",type:{name:"object"},required:!0},subjectName:{description:"",type:{name:"string"},required:!0},accounts:{description:"",type:{name:"arrayOf",value:{name:"object"}},required:!1}}}},"./ui/components/ui/menu/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{W:()=>menu,D:()=>menu_item});var prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),react=__webpack_require__("./node_modules/react/index.js"),react_dom=__webpack_require__("./node_modules/react-dom/index.js"),usePopper=__webpack_require__("./node_modules/react-popper/lib/esm/usePopper.js"),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames);function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var Menu=function(param){var anchorElement=param.anchorElement,children=param.children,className=param.className,dataTestId=param["data-testid"],onHide=param.onHide,popperOptions=param.popperOptions,_useState=_sliced_to_array((0,react.useState)(null),2),popperElement=_useState[0],setPopperElement=_useState[1],popoverContainerElement=(0,react.useRef)(document.getElementById("popover-content")),_usePopper=(0,usePopper.E)(anchorElement,popperElement,popperOptions),attributes=_usePopper.attributes,styles=_usePopper.styles;return(0,react_dom.createPortal)(react.createElement(react.Fragment,null,react.createElement("div",{className:"menu__background","data-testid":dataTestId,onClick:onHide}),react.createElement("div",_object_spread({className:classnames_default()("menu__container",className),"data-testid":className,ref:setPopperElement,style:styles.popper},attributes.popper),children)),popoverContainerElement.current)};Menu.propTypes={anchorElement:prop_types_default().instanceOf(window.Element),children:prop_types_default().node.isRequired,className:prop_types_default().string,onHide:prop_types_default().func.isRequired,popperOptions:prop_types_default().object,dataTestId:prop_types_default().string},Menu.defaultProps={anchorElement:void 0,className:void 0,popperOptions:void 0};let menu=Menu;var component_library=__webpack_require__("./ui/components/component-library/index.ts"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),MenuItem=react.forwardRef(function(param,ref){var children=param.children,className=param.className,dataTestId=param["data-testid"],iconName=param.iconName,iconColor=param.iconColor,onClick=param.onClick,subtitle=param.subtitle,_param_disabled=param.disabled,showInfoDot=param.showInfoDot;return react.createElement("button",{className:classnames_default()("menu-item",className),"data-testid":dataTestId,onClick:onClick,ref:ref,disabled:void 0!==_param_disabled&&_param_disabled},iconName&&showInfoDot&&react.createElement(component_library.ph,{anchorElementShape:component_library.Hs.circular,display:design_system.nl.Block,position:component_library.uc.topRight,positionObj:{top:-6,right:4},badge:react.createElement(component_library.In,{name:component_library.$M.FullCircle,size:component_library.lK.Xs,color:design_system.Li.primaryDefault,style:{"--size":"10px"}})},react.createElement(component_library.In,{name:iconName,size:component_library.lK.Sm,marginRight:2})),iconName&&!showInfoDot&&react.createElement(component_library.In,{name:iconName,size:component_library.lK.Sm,marginRight:2,color:iconColor}),react.createElement("div",null,react.createElement(component_library.EY,{as:"div"},children),subtitle?react.createElement(component_library.EY,{variant:design_system.J3.bodyXs},subtitle):null))});MenuItem.propTypes={children:prop_types_default().node.isRequired,className:prop_types_default().string,"data-testid":prop_types_default().string,iconName:prop_types_default().string,onClick:prop_types_default().func,subtitle:prop_types_default().node,disabled:prop_types_default().bool,showInfoDot:prop_types_default().bool,iconColor:prop_types_default().string},MenuItem.displayName="MenuItem";let menu_item=MenuItem;MenuItem.__docgenInfo={description:"",methods:[],displayName:"MenuItem",props:{disabled:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},children:{description:"",type:{name:"node"},required:!0},className:{description:"",type:{name:"string"},required:!1},"data-testid":{description:"",type:{name:"string"},required:!1},iconName:{description:"",type:{name:"string"},required:!1},onClick:{description:"",type:{name:"func"},required:!1},subtitle:{description:"",type:{name:"node"},required:!1},showInfoDot:{description:"",type:{name:"bool"},required:!1},iconColor:{description:"",type:{name:"string"},required:!1}}}},"./ui/components/ui/tooltip/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>_tooltip__WEBPACK_IMPORTED_MODULE_0__.A});var _tooltip__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/components/ui/tooltip/tooltip.js")},"./ui/components/ui/tooltip/tooltip.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Tooltip});var prop_types__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_tippy__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-tippy/dist/react-tippy.js");function _assert_this_initialized(self){if(void 0===self)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _class_call_check(instance,Constructor){if(!(instance instanceof Constructor))throw 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||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _create_class(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _get_prototype_of(o){return(_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}function _possible_constructor_return(self,call){return call&&("object"===_type_of(call)||"function"==typeof call)?call:_assert_this_initialized(self)}function _set_prototype_of(o,p){return(_set_prototype_of=Object.setPrototypeOf||function setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _type_of(obj){return obj&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj}function _is_native_reflect_construct(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _create_super(Derived){var hasNativeReflectConstruct=_is_native_reflect_construct();return function _createSuperInternal(){var result,Super=_get_prototype_of(Derived);return result=hasNativeReflectConstruct?Reflect.construct(Super,arguments,_get_prototype_of(this).constructor):Super.apply(this,arguments),_possible_constructor_return(this,result)}}var Tooltip=function(PureComponent){_inherits(Tooltip,PureComponent);var _super=_create_super(Tooltip);function Tooltip(){return _class_call_check(this,Tooltip),_super.apply(this,arguments)}return _create_class(Tooltip,[{key:"render",value:function render(){var _this_props=this.props,arrow=_this_props.arrow,children=_this_props.children,containerClassName=_this_props.containerClassName,disabled=_this_props.disabled,position=_this_props.position,html=_this_props.html,interactive=_this_props.interactive,size=_this_props.size,distance=_this_props.distance,title=_this_props.title,trigger=_this_props.trigger,onHidden=_this_props.onHidden,offset=_this_props.offset,open=_this_props.open,wrapperClassName=_this_props.wrapperClassName,style=_this_props.style,wrapperStyle=_this_props.wrapperStyle,theme=_this_props.theme,tabIndex=_this_props.tabIndex,tag=_this_props.tag;return title||html?react__WEBPACK_IMPORTED_MODULE_0__.createElement(tag,{className:wrapperClassName,style:wrapperStyle},react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_tippy__WEBPACK_IMPORTED_MODULE_1__.Tooltip,{arrow:arrow,className:containerClassName,disabled:disabled,hideOnClick:!1,distance:distance,html:html,interactive:interactive,onHidden:onHidden,position:position,size:size,offset:offset,style:style,title:disabled?"":title,trigger:trigger,open:open,theme:"tippy-tooltip--mm-custom ".concat(theme),tabIndex:tabIndex||0,tag:tag},children)):react__WEBPACK_IMPORTED_MODULE_0__.createElement("div",{className:wrapperClassName},children)}}]),Tooltip}(react__WEBPACK_IMPORTED_MODULE_0__.PureComponent);_define_property(Tooltip,"defaultProps",{arrow:!0,children:null,containerClassName:"",html:null,interactive:void 0,onHidden:null,distance:0,position:"left",offset:0,open:void 0,size:"small",title:null,trigger:"mouseenter focus",wrapperClassName:void 0,theme:"",tag:"div",wrapperStyle:{}}),_define_property(Tooltip,"propTypes",{arrow:prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool,children:prop_types__WEBPACK_IMPORTED_MODULE_2___default().node,containerClassName:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string,disabled:prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool,html:prop_types__WEBPACK_IMPORTED_MODULE_2___default().node,distance:prop_types__WEBPACK_IMPORTED_MODULE_2___default().number,interactive:prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool,offset:prop_types__WEBPACK_IMPORTED_MODULE_2___default().number,onHidden:prop_types__WEBPACK_IMPORTED_MODULE_2___default().func,open:prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool,position:prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(["top","right","bottom","left"]),size:prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(["small","regular","big"]),title:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string,trigger:prop_types__WEBPACK_IMPORTED_MODULE_2___default().any,wrapperClassName:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string,style:prop_types__WEBPACK_IMPORTED_MODULE_2___default().object,wrapperStyle:prop_types__WEBPACK_IMPORTED_MODULE_2___default().object,theme:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string,tabIndex:prop_types__WEBPACK_IMPORTED_MODULE_2___default().number,tag:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string}),Tooltip.__docgenInfo={description:"",methods:[],displayName:"Tooltip",props:{arrow:{defaultValue:{value:"true",computed:!1},description:"",type:{name:"bool"},required:!1},children:{defaultValue:{value:"null",computed:!1},description:"",type:{name:"node"},required:!1},containerClassName:{defaultValue:{value:"''",computed:!1},description:"",type:{name:"string"},required:!1},html:{defaultValue:{value:"null",computed:!1},description:"",type:{name:"node"},required:!1},interactive:{defaultValue:{value:"undefined",computed:!0},description:"",type:{name:"bool"},required:!1},onHidden:{defaultValue:{value:"null",computed:!1},description:"",type:{name:"func"},required:!1},distance:{defaultValue:{value:"0",computed:!1},description:"",type:{name:"number"},required:!1},position:{defaultValue:{value:"'left'",computed:!1},description:"",type:{name:"enum",value:[{value:"'top'",computed:!1},{value:"'right'",computed:!1},{value:"'bottom'",computed:!1},{value:"'left'",computed:!1}]},required:!1},offset:{defaultValue:{value:"0",computed:!1},description:"",type:{name:"number"},required:!1},open:{defaultValue:{value:"undefined",computed:!0},description:"",type:{name:"bool"},required:!1},size:{defaultValue:{value:"'small'",computed:!1},description:"",type:{name:"enum",value:[{value:"'small'",computed:!1},{value:"'regular'",computed:!1},{value:"'big'",computed:!1}]},required:!1},title:{defaultValue:{value:"null",computed:!1},description:"",type:{name:"string"},required:!1},trigger:{defaultValue:{value:"'mouseenter focus'",computed:!1},description:"",type:{name:"any"},required:!1},wrapperClassName:{defaultValue:{value:"undefined",computed:!0},description:"",type:{name:"string"},required:!1},theme:{defaultValue:{value:"''",computed:!1},description:"",type:{name:"string"},required:!1},tag:{defaultValue:{value:"'div'",computed:!1},description:"",type:{name:"string"},required:!1},wrapperStyle:{defaultValue:{value:"{}",computed:!1},description:"",type:{name:"object"},required:!1},disabled:{description:"",type:{name:"bool"},required:!1},style:{description:"",type:{name:"object"},required:!1},tabIndex:{description:"",type:{name:"number"},required:!1}}}},"./ui/helpers/utils/permission.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{gO:()=>getPermissionDescription,iv:()=>getWeightedPermissions});var _obj,deep_freeze_strict__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/deep-freeze-strict/index.js"),deep_freeze_strict__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(deep_freeze_strict__WEBPACK_IMPORTED_MODULE_0__),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),_metamask_snaps_rpc_methods__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@metamask/snaps-rpc-methods/dist/endowments/rpc.mjs"),_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@metamask/snaps-utils/dist/derivation-paths.mjs"),_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@metamask/snaps-utils/dist/caveats.mjs"),_metamask_controller_utils__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@metamask/controller-utils/dist/util.mjs"),_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./shared/constants/permissions.ts"),_components_component_library__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/components/component-library/index.ts"),_constants_design_system__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_app_scripts_controllers_permissions__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./app/scripts/controllers/permissions/index.js"),_util__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/helpers/utils/util.js");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var UNKNOWN_PERMISSION=Symbol("unknown"),RIGHT_INFO_ICON=react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.In,{name:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Info,size:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.lK.Sm,color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.Li.iconMuted});function getSnapNameComponent(snapName){return react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit},snapName)}var PERMISSION_DESCRIPTIONS=deep_freeze_strict__WEBPACK_IMPORTED_MODULE_0___default()((_define_property(_obj={},_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.eth_accounts,function(param){return{label:(0,param.t)("permission_ethereumAccounts"),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Eye,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.eth_accounts}}),_define_property(_obj,_app_scripts_controllers_permissions__WEBPACK_IMPORTED_MODULE_5__.Y8.permittedChains,function(param){return{label:(0,param.t)("permission_walletSwitchEthereumChain"),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Wifi,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.permittedChains}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_dialog,function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_dialog"),description:t("permission_dialogDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Messages,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_dialog}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_notify,function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_notifications"),description:t("permission_notificationsDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Notification,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_notify}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_getBip32PublicKey,function(param){var t=param.t,permissionValue=param.permissionValue,subjectName=param.subjectName;return permissionValue.caveats[0].value.map(function(param,i){var _path_join,_getSnapDerivationPathName,path=param.path,curve=param.curve,baseDescription={leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.SecuritySearch,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_getBip32PublicKey,id:"public-key-access-bip32-".concat(null===(_path_join=path.join("-"))||void 0===_path_join?void 0:_path_join.replace(RegExp("'","gu"),"h"),"-").concat(curve,"-").concat(i),warningMessageSubject:null!==(_getSnapDerivationPathName=(0,_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_7__.sm)(path,curve))&&void 0!==_getSnapDerivationPathName?_getSnapDerivationPathName:"".concat(t("unknownNetworkForKeyEntropy")," ").concat(path.join("/")," (").concat(curve,")")},friendlyName=(0,_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_7__.sm)(path,curve);return friendlyName?_object_spread_props(_object_spread({},baseDescription),{label:t("permission_viewNamedBip32PublicKeys",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:path.join("/")},friendlyName)]),description:t("permission_viewBip32PublicKeysDescription",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:"description-".concat(path.join("/"))},friendlyName),getSnapNameComponent(subjectName)])}):_object_spread_props(_object_spread({},baseDescription),{label:t("permission_viewBip32PublicKeys",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:path.join("/")},"".concat(t("unknownNetworkForKeyEntropy")," ")," ",path.join("/")),curve]),description:t("permission_viewBip32PublicKeysDescription",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:"description-".concat(path.join("/"))},path.join("/")),getSnapNameComponent(subjectName)])})})}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_getBip32Entropy,function(param){var t=param.t,permissionValue=param.permissionValue,subjectName=param.subjectName;return permissionValue.caveats[0].value.map(function(param,i){var _path_join,_getSnapDerivationPathName,path=param.path,curve=param.curve,baseDescription={leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Key,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_getBip32Entropy,id:"key-access-bip32-".concat(null===(_path_join=path.join("-"))||void 0===_path_join?void 0:_path_join.replace(RegExp("'","gu"),"h"),"-").concat(curve,"-").concat(i),warningMessageSubject:null!==(_getSnapDerivationPathName=(0,_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_7__.sm)(path,curve))&&void 0!==_getSnapDerivationPathName?_getSnapDerivationPathName:"".concat(t("unknownNetworkForKeyEntropy")," ").concat(path.join("/")," (").concat(curve,")")},friendlyName=(0,_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_7__.sm)(path,curve);return friendlyName?_object_spread_props(_object_spread({},baseDescription),{label:t("permission_manageBip32Keys",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:path.join("/")},friendlyName)]),description:t("permission_manageBip44AndBip32KeysDescription",[getSnapNameComponent(subjectName)])}):_object_spread_props(_object_spread({},baseDescription),{label:t("permission_manageBip32Keys",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:path.join("/")},"".concat(t("unknownNetworkForKeyEntropy")," ").concat(path.join("/")," (").concat(curve,")"))]),description:t("permission_manageBip44AndBip32KeysDescription",[getSnapNameComponent(subjectName)])})})}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_getBip44Entropy,function(param){var t=param.t,permissionValue=param.permissionValue,subjectName=param.subjectName;return permissionValue.caveats[0].value.map(function(param,i){var _getSlip44ProtocolName,_getSlip44ProtocolName1,coinType=param.coinType;return{label:t("permission_manageBip44Keys",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:"coin-type-".concat(coinType)},null!==(_getSlip44ProtocolName=(0,_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_7__.My)(coinType))&&void 0!==_getSlip44ProtocolName?_getSlip44ProtocolName:"".concat(t("unknownNetworkForKeyEntropy")," m/44'/").concat(coinType,"'"))]),description:t("permission_manageBip44AndBip32KeysDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Key,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_getBip44Entropy,id:"key-access-bip44-".concat(coinType,"-").concat(i),warningMessageSubject:null!==(_getSlip44ProtocolName1=(0,_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_7__.My)(coinType))&&void 0!==_getSlip44ProtocolName1?_getSlip44ProtocolName1:"".concat(t("unknownNetworkForKeyEntropy")," m/44'/").concat(coinType,"'")}})}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_getEntropy,function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_getEntropy",[getSnapNameComponent(subjectName)]),description:t("permission_getEntropyDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.SecurityKey,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_getEntropy}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_manageState,function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_manageState"),description:t("permission_manageStateDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.AddSquare,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_manageState}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_getLocale,function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_getLocale"),description:t("permission_getLocaleDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Global,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_getLocale}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_getPreferences,function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_getPreferences"),description:t("permission_getPreferencesDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Customize,weight:4}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.wallet_snap,function(param){var t=param.t,permissionValue=param.permissionValue,getSubjectName=param.getSubjectName,snaps=permissionValue.caveats[0].value,baseDescription={leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Flash,rightIcon:RIGHT_INFO_ICON,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.wallet_snap};return Object.keys(snaps).map(function(snapId){var snapName=getSubjectName(snapId);return snapName?_object_spread_props(_object_spread({},baseDescription),{label:t("permission_accessNamedSnap",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:snapId},snapName)]),description:t("permission_accessSnapDescription",[snapName])}):_object_spread_props(_object_spread({},baseDescription),{label:t("permission_accessSnap",[snapId]),description:t("permission_accessSnapDescription",[snapId])})})}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:network-access"],function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_accessNetwork"),description:t("permission_accessNetworkDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Wifi,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_networkAccess}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:webassembly"],function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_webAssembly"),description:t("permission_webAssemblyDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.DocumentCode,rightIcon:null,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_webassembly}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:transaction-insight"],function(param){var t=param.t,permissionValue=param.permissionValue,subjectName=param.subjectName,baseDescription={leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Speedometer,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_transactionInsight},result=[_object_spread_props(_object_spread({},baseDescription),{label:t("permission_transactionInsight"),description:t("permission_transactionInsightDescription",[getSnapNameComponent(subjectName)])})];return(0,_metamask_controller_utils__WEBPACK_IMPORTED_MODULE_8__.EI)(permissionValue.caveats)&&permissionValue.caveats[0].type===_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_9__.R.TransactionOrigin&&permissionValue.caveats[0].value&&result.push(_object_spread_props(_object_spread({},baseDescription),{label:t("permission_transactionInsightOrigin"),description:t("permission_transactionInsightOriginDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Explore})),result}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:cronjob"],function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_cronjob"),description:t("permission_cronjobDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Clock,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_cronjob}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:ethereum-provider"],function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_ethereumProvider"),description:t("permission_ethereumProviderDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Ethereum,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_ethereumProvider,id:"ethereum-provider-access",message:t("ethereumProviderAccess",[getSnapNameComponent(subjectName)])}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:rpc"],function(param){var originsMessage,t=param.t,permissionValue=param.permissionValue,subjectName=param.subjectName,baseDescription={leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Hierarchy,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_rpc},_getRpcCaveatOrigins=(0,_metamask_snaps_rpc_methods__WEBPACK_IMPORTED_MODULE_10__.Ro)(permissionValue),snaps=_getRpcCaveatOrigins.snaps,dapps=_getRpcCaveatOrigins.dapps,allowedOrigins=_getRpcCaveatOrigins.allowedOrigins,results=[];if(snaps&&results.push(_object_spread_props(_object_spread({},baseDescription),{label:t("permission_rpc",[t("otherSnaps"),getSnapNameComponent(subjectName)]),description:t("permission_rpcDescription",[t("otherSnaps"),getSnapNameComponent(subjectName)])})),dapps&&results.push(_object_spread_props(_object_spread({},baseDescription),{label:t("permission_rpc",[t("websites"),getSnapNameComponent(subjectName)]),description:t("permission_rpcDescription",[t("websites"),getSnapNameComponent(subjectName)])})),(null==allowedOrigins?void 0:allowedOrigins.length)>0){if(1===allowedOrigins.length)originsMessage=react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,style:{lineBreak:"anywhere"}},allowedOrigins[0]);else{var lastOrigin=allowedOrigins.slice(-1);originsMessage=t("permission_rpcDescriptionOriginList",[allowedOrigins.slice(0,-1).map(function(origin){return react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment,null,react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,style:{lineBreak:"anywhere"}},origin),", ")}),react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,key:"2",style:{lineBreak:"anywhere"}},lastOrigin)])}results.push(_object_spread_props(_object_spread({},baseDescription),{label:t("permission_rpc",[originsMessage,getSnapNameComponent(subjectName)]),description:t("permission_rpcDescription",[originsMessage,getSnapNameComponent(subjectName)])}))}return results}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:lifecycle-hooks"],function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_lifecycleHooks"),description:t("permission_lifecycleHooksDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Hierarchy,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_lifecycleHooks}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:page-home"],function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_homePage"),description:t("permission_homePageDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Home,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_pageHome}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.wq.snap_manageAccounts,function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_manageAccounts"),description:t("permission_manageAccountsDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.UserCircleAdd,rightIcon:null,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.snap_manageAccounts}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:keyring"],function(param){var t=param.t,subjectName=param.subjectName;return{label:t("permission_keyring"),description:t("permission_keyringDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.UserCircleAdd,rightIcon:null,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_keyring}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:name-lookup"],function(param){var t=param.t;return{label:t("permission_nameLookup"),description:t("permission_nameLookupDescription"),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Search,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_nameLookup}}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.Kc["endowment:signature-insight"],function(param){var t=param.t,permissionValue=param.permissionValue,subjectName=param.subjectName,baseDescription={leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Warning,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.endowment_signatureInsight},result=[_object_spread_props(_object_spread({},baseDescription),{label:t("permission_signatureInsight"),description:t("permission_signatureInsightDescription",[getSnapNameComponent(subjectName)])})];return(0,_metamask_controller_utils__WEBPACK_IMPORTED_MODULE_8__.EI)(permissionValue.caveats)&&permissionValue.caveats.find(function(caveat){return caveat.type===_metamask_snaps_utils__WEBPACK_IMPORTED_MODULE_9__.R.SignatureOrigin&&caveat.value})&&result.push(_object_spread_props(_object_spread({},baseDescription),{label:t("permission_signatureInsightOrigin"),description:t("permission_signatureInsightOriginDescription",[getSnapNameComponent(subjectName)]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Explore})),result}),_define_property(_obj,_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.mz.connection_permission,function(param){var t=param.t,permissionValue=param.permissionValue,subjectName=param.subjectName;return Object.keys(permissionValue).map(function(connection){var connectionName=(0,_util__WEBPACK_IMPORTED_MODULE_6__.US)(connection);return connectionName||(connectionName=connection.replace("npm:","")),{label:t("snapConnectTo",[react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{key:"connectToMain",fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit,style:{lineBreak:"anywhere"}},connectionName)]),description:t("snapConnectionPermissionDescription",[getSnapNameComponent(subjectName),react__WEBPACK_IMPORTED_MODULE_1__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_3__.EY,{key:"connectToDescription",fontWeight:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.IT.Medium,variant:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.inherit,color:_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.inherit},connectionName)]),leftIcon:void 0,connection:connection,connectionName:connectionName,subjectName:subjectName,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.connection_permission}})}),_define_property(_obj,UNKNOWN_PERMISSION,function(param){var t=param.t,permissionName=param.permissionName;return{label:t("permission_unknown",[null!=permissionName?permissionName:"undefined"]),leftIcon:_components_component_library__WEBPACK_IMPORTED_MODULE_3__.$M.Question,rightIcon:null,weight:_shared_constants_permissions__WEBPACK_IMPORTED_MODULE_2__.a1.unknown_permission}}),_obj)),getPermissionDescription=function(param){var t=param.t,permissionName=param.permissionName,permissionValue=param.permissionValue,subjectName=param.subjectName,getSubjectName=param.getSubjectName,value=PERMISSION_DESCRIPTIONS[UNKNOWN_PERMISSION];Object.hasOwnProperty.call(PERMISSION_DESCRIPTIONS,permissionName)&&(value=PERMISSION_DESCRIPTIONS[permissionName]);var result=value({t:t,permissionName:permissionName,permissionValue:permissionValue,subjectName:subjectName,getSubjectName:getSubjectName});return Array.isArray(result)?result.map(function(item){return _object_spread_props(_object_spread({},item),{permissionName:permissionName,permissionValue:permissionValue})}):[_object_spread_props(_object_spread({},result),{permissionName:permissionName,permissionValue:permissionValue})]};function getWeightedPermissions(param){var t=param.t,permissions=param.permissions,getSubjectName=param.getSubjectName,subjectName=param.subjectName;return Object.entries(permissions).reduce(function(target,param){var _param=_sliced_to_array(param,2),permissionName=_param[0],permissionValue=_param[1];return target.concat(getPermissionDescription({t:t,permissionName:permissionName,permissionValue:permissionValue,subjectName:subjectName,getSubjectName:getSubjectName}))},[]).sort(function(left,right){return left.weight-right.weight})}}}]);