"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[79137],{979137(e,t,i){i.r(t),i.d(t,{default:()=>b});var a=i(296540),l=i(469733),n=i(951272),r=i(217439),s=i(71479),A=i(870443),E=i(566723),c=i(126457),m=i(916537),C=i(143811),o=i(705426);const _=(0,s.A)("div")`
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: ${E.S2};
`,u=(0,s.A)(r.A)`
  color: ${({theme:{motifPalette:{text01:e}}})=>e} !important;
  padding-right: ${({theme:{spacing:e}})=>e["spacing-xl"]};
`,d={url:""},O=A.A.object().shape({url:A.A.string().label("DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL").matches(/^(ftp|https?):\/\/.+\/[^\/]+\.(bin|tar)$/,{message:a.createElement(m.sA,{id:"COMMON_VALIDATION_VALID_URL"})}).required()}),b=({onCancel:e,onConfirm:t})=>{const i=(0,l.useDispatch)(),s=(0,a.useCallback)(e=>{t(e.url)},[t]),A=(0,a.useCallback)(()=>{e?e():i((0,c.AS)())},[e]);return a.createElement(n.l1,{initialValues:d,validationSchema:O,onSubmit:s},({handleSubmit:e,dirty:t,isValid:i,isSubmitting:l})=>a.createElement(o.A,{actions:[{text:a.createElement(m.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:A},{text:a.createElement(m.sA,{id:"COMMON_ACTION_UPDATE"}),type:"button",variant:"primary",disabled:!t||!i||l,onClick:e}],title:a.createElement(u,{size:"medium",weight:"bold",isTruncated:!0},a.createElement(m.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_TITLE"})),size:"small",onRequestClose:A},a.createElement(_,null,a.createElement(r.A,{size:"medium"},a.createElement(m.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_MESSAGE"}))),a.createElement(C.A,{name:"url",label:"DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL",variant:"secondary"}),a.createElement(r.A,{color:"text-3",size:"small"},a.createElement(m.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_PLACEHOLDER"}))))}}}]);