iobroker.backitup
Version:
ioBroker.backitup allows you to backup and restore your ioBroker installation and other systems, such as databases, Zigbee, scripts and many more.
9 lines (8 loc) • 99.5 kB
JavaScript
import{j as s}from"./jsx-runtime-D2IYR6ST.js";import{C as f,a as h}from"./ConfigCustomBackItUpSet__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CYjy_hHw.js";import{C as l}from"./ConfigCustomBackItUpSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-BL9jEuPR.js";import{C as H,a as Q}from"./ConfigCustomBackItUpSet__mf_v__runtimeInit__mf_v__-kW6JvUJ8.js";import{R as b,C as w}from"./ConfigCustomBackItUpSet__loadShare__react__loadShare__-4sGW5l7i.js";import{c as I}from"./_commonjsHelpers-D6-XlEtG.js";const{loadShare:J}=Q,{initPromise:G}=H,V=G.then(n=>J("@iobroker/json-config",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),X=await V.then(n=>n());var S=X;class T extends S.ConfigGeneric{constructor(e){super(e),this.state.message=!1}isConfigFilled(e){return e==="ccu"?!!this.props.data.ccuHost&&!!this.props.data.ccuEnabled:e==="mySql"?!!this.props.data.mySqlUser&&!!this.props.data.mySqlEnabled:e==="sqlite"?!!this.props.data.sqlitePath&&!!this.props.data.sqliteEnabled:e==="pgSql"?!!this.props.data.pgSqlUser&&!!this.props.data.pgSqlEnabled:e==="influxDB"?!!this.props.data.influxDBName&&!!this.props.data.influxDBEnabled:e==="history"?!!this.props.data.historyPath&&!!this.props.data.historyEnabled:(this.showMessage(l.I18n.t("BackItUp Warning!"),l.I18n.t("Unknown config type %s",e)),!1)}fetchConfig=async(e,t)=>e==="ccu"?this.fetchCcuConfig(t):e==="mySql"?this.fetchMySqlConfig(t):e==="sqlite"?this.fetchSqliteConfig(t):e==="pgSql"?this.fetchPgSqlConfig(t):e==="influxDB"?this.fetchInfluxDBConfig(t):e==="history"?this.fetchHistoryConfig(t):(this.showMessage(l.I18n.t("BackItUp Warning!"),l.I18n.t("Unknown config type %s",e)),{changed:!1,found:!1});async fetchCcuConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.hm-rpc.","system.adapter.hm-rpc.香"));let o=!1,c=!1;if(t&&t.length){for(let i=0;i<t.length;i++){const a=t[i].common,r=t[i].native;if(a.enabled&&r){(e.ccuHost!==r.homematicAddress||e.ccuUsehttps!==r.useHttps)&&(e.ccuHost=r.homematicAddress,e.ccuUsehttps=r.useHttps,c=!0),o=t[i]._id;break}}if(!o)for(let i=0;i<t.length;i++){const a=t[i].native;a&&(e.ccuHost!==a.homematicAddress||e.ccuUsehttps!==a.useHttps)&&(e.ccuHost=a.homematicAddress,e.ccuUsehttps=a.useHttps,c=!0),o=t[i]._id}}return{changed:c,found:o}}async fetchMySqlConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.sql.","system.adapter.sql.香"));let o=!1,c=!1;if(t&&t.length){for(let i=0;i<t.length;i++){const a=t[i].common,r=t[i].native;if(a.enabled&&(r==null?void 0:r.dbtype)==="mysql"){const p=r.port==="0"?3306:r.port||3306;(e.mySqlUser!==r.user||e.mySqlPassword!==r.password||e.mySqlHost!==r.host||e.mySqlPort!==p||e.mySqlName!==r.dbname)&&(e.mySqlUser=r.user,e.mySqlPassword=r.password,e.mySqlHost=r.host,e.mySqlPort=p,e.mySqlName=r.dbname,c=!0),o=t[i]._id;break}}if(!o)for(let i=0;i<t.length;i++){const a=t[i].native;if((a==null?void 0:a.dbtype)==="mysql"){const r=a.port==="0"?3306:a.port||3306;(e.mySqlUser!==a.user||e.mySqlPassword!==a.password||e.mySqlHost!==a.host||e.mySqlPort!==r||e.mySqlName!==a.dbname)&&(e.mySqlUser=a.user,e.mySqlPassword=a.password,e.mySqlHost=a.host,e.mySqlPort=r,e.mySqlName=a.dbname,c=!0),o=t[i]._id;break}}}return{changed:c,found:o}}async fetchSqliteConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.sql.","system.adapter.sql.香"));let o=!1,c=!1;if(t&&t.length){for(let i=0;i<t.length;i++){const a=t[i].common,r=t[i].native;if(a.enabled&&r&&r.dbtype==="sqlite"&&r.fileName){const d=r.fileName.split("/")>1?r.fileName:`/opt/iobroker/iobroker-data/sqlite/${r.fileName}`;e.sqlitePath!==d&&(e.sqlitePath=d,c=!0),o=t[i]._id;break}}if(!o)for(let i=0;i<t.length;i++){const a=t[i].native;if((a==null?void 0:a.dbtype)==="sqlite"&&a.fileName){const p=a.fileName.split("/")>1?a.fileName:`/opt/iobroker/iobroker-data/sqlite/${a.fileName}`;e.sqlitePath!==p&&(e.sqlitePath=p,c=!0),o=t[i]._id;break}}}return{changed:c,found:o}}async fetchPgSqlConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.sql.","system.adapter.sql.香"));let o=!1,c=!1;if(t&&t.length){for(let i=0;i<t.length;i++){const a=t[i].common,r=t[i].native;if(a.enabled&&(r==null?void 0:r.dbtype)==="postgresql"){const p=r.port==="0"?5432:r.port||5432;(e.pgSqlUser!==r.user||e.pgSqlPassword!==r.password||e.pgSqlHost!==r.host||e.pgSqlPort!==p||e.pgSqlName!==r.dbname)&&(e.pgSqlUser=r.user,e.pgSqlPassword=r.password,e.pgSqlHost=r.host,e.pgSqlPort=p,e.pgSqlName=r.dbname,c=!0),o=t[i]._id;break}}if(!o)for(let i=0;i<t.length;i++){const a=t[i].native;if((a==null?void 0:a.dbtype)==="postgresql"){const r=a.port==="0"?5432:a.port||5432;(e.pgSqlUser!==a.user||e.pgSqlPassword!==a.password||e.pgSqlHost!==a.host||e.pgSqlPort!==r||e.pgSqlName!==a.dbname)&&(e.pgSqlUser=a.user,e.pgSqlPassword=a.password,e.pgSqlHost=a.host,e.pgSqlPort=r,e.pgSqlName=a.dbname,c=!0),o=t[i]._id;break}}}return{changed:c,found:o}}async fetchInfluxDBConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.influxdb.","system.adapter.influxdb.香"));let o=!1,c=!1;if(t&&t.length){for(let i=0;i<t.length;i++){const a=t[i].common,r=t[i].native;if(a.enabled){(e.influxDBHost!==r.host||e.influxDBVersion!==r.dbversion||e.influxDBProtocol!==r.protocol||e.influxDBName!==r.dbname||r.dbversion==="2.x"&&e.influxDBPort!==r.port)&&(e.influxDBHost=r.host,e.influxDBVersion=r.dbversion,e.influxDBProtocol=r.protocol,e.influxDBName=r.dbname,r.port&&r.dbversion==="2.x"&&(e.influxDBPort=r.port),c=!0),o=t[i]._id;break}}if(!o&&t.length&&t[0].native){const i=t[0].native;i&&(e.influxDBHost!==i.host||e.influxDBVersion!==i.dbversion||e.influxDBProtocol!==i.protocol||e.influxDBName!==i.dbname||i.dbversion==="2.x"&&e.influxDBPort!==i.port)&&(e.influxDBHost=i.host,e.influxDBVersion=i.dbversion,e.influxDBProtocol=i.protocol,e.influxDBName=i.dbname,i.port&&i.dbversion==="2.x"&&(e.influxDBPort=i.port),c=!0),o=t[0]._id}}return{changed:c,found:o}}async fetchHistoryConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.history.","system.adapter.history.香"));let o="",c=!1,i=!1;if(t!=null&&t.length){for(let r=0;r<t.length;r++){const p=t[r].common,d=t[r].native;if(p.enabled&&d){const u=d.storeDir&&!d.storeDir.startsWith("/opt/iobroker/backups")?d.storeDir:"/opt/iobroker/iobroker-data/history";e.historyPath!==u&&(e.historyPath=u,i=!0),o=d.storeDir,c=t[r]._id;break}}if(!c&&t[0]){const r=t[0].native;if(r){const p=r.storeDir&&!r.storeDir.startsWith("/opt/iobroker/backups")?r.storeDir:"/opt/iobroker/iobroker-data/history";e.historyPath!==p&&(e.historyPath=p,i=!0),o=r.storeDir,c=t[0]._id}}}let a;return c&&(o?o!=null&&o.startsWith("/opt/iobroker/backups")&&(a=l.I18n.t(`The storage path of %s must not be identical to the path for backups.
The default path of the history adapter has been set.
Please change the path in the history adapter!`,c.substring(15))):a=l.I18n.t(`No storage path of %s is configured.
The default path of the history adapter has been set.`,c.substring(15))),{changed:i,found:c,message:a}}checkAdapterInstall=async(e,t)=>{const o=this.props.common.host;let c=e;(e==="pgsql"||e==="mysql"||e==="sqlite")&&(c="sql");const i=["zigbee","esphome","zigbee2mqtt","node-red","yahka","jarvis","history"];{const a=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance",`system.adapter.${c}.`,`system.adapter.${c}.香`));if(a!=null&&a.length){let r=!1;for(let p=0;p<a.length;p++)if(a[p].common.host===o||t){r=!0;break}!r&&i.includes(c)&&this.showMessage(l.I18n.t("BackItUp Warning!"),l.I18n.t(`No %s Instance found on this host.
Please check your System`,c),"warning")}else i.includes(c)&&this.showMessage(l.I18n.t("BackItUp Warning!"),l.I18n.t(`No %s Instance found on this host.
Please check your System`,c),"warning")}};showMessage=(e,t,o)=>{this.setState({message:{title:e,text:t,level:o||"info"}})};renderMessage(){if(!this.state.message)return null;const e=this.state.message.text.split(`
`).map(t=>s.jsx("div",{style:{minHeight:24},children:t},t));return this.state.message?s.jsx(l.DialogMessage,{title:this.state.message.title,text:e,icon:this.state.message.level==="info"?s.jsx(f.Info,{}):this.state.message.level==="warning"?s.jsx(f.Warning,{style:{color:"orange"}}):this.state.message.level==="error"?s.jsx(h.Alert,{style:{color:"red"}}):void 0,onClose:()=>this.setState({message:!1})}):null}}class K extends T{renderItem(){return s.jsxs(s.Fragment,{children:[s.jsx(h.FormControlLabel,{control:s.jsx(h.Checkbox,{checked:(this.props.schema.custom.adapter==="hm-rpc"||this.props.schema.custom.adapter==="javascript"||this.props.schema.custom.adapter==="backitup")&&this.props.data.hostType==="Slave"?!1:this.props.data[this.props.attr]?this.props.data[this.props.attr]:!1,disabled:(this.props.schema.custom.adapter==="influxdb"||this.props.schema.custom.adapter==="sql")&&this.props.data._nonSupportDockerDB||(this.props.schema.custom.adapter==="hm-rpc"||this.props.schema.custom.adapter==="javascript"||this.props.schema.custom.adapter==="backitup")&&this.props.data.hostType==="Slave",onChange:e=>{e.target.checked&&(this.props.schema.custom.adapter?this.checkAdapterInstall(this.props.schema.custom.adapter,!!this.props.schema.custom.allHosts).catch(t=>console.error(t)):this.props.schema.custom.alert&&this.setState({message:{text:l.I18n.t(this.props.schema.custom.alert),title:l.I18n.t(this.props.schema.title)}})),this.props.onChange({...this.props.data,[this.props.attr]:e.target.checked})}}),label:l.I18n.t(this.props.schema.label||this.props.schema.custom.adapter)}),this.renderMessage()]})}}const Y={paper:{height:"calc(100% - 64px)"},textTime:{display:"inline-block",width:95},responseTextTime:{display:"inline-block",width:70},textLevel:{display:"inline-block",width:50},"textLevel-ERROR":{color:"red"},"textLevel-WARN":{color:"orange"},"textLevel-INFO":{color:"#00b204"},textSource:{display:"inline-block",width:100,textAlign:"left"},text:{display:"inline-block"},responseText:{display:"inline-block",wordWrap:"break-word"},textLine:{whiteSpace:"nowrap"},responseTextLine:{whiteSpace:"normal"},dialogContent:{position:"relative",padding:16},logContainer:{fontSize:12,fontFamily:"monospace",padding:8,border:"1px solid grey",borderRadius:5,overflow:"auto",boxSizing:"border-box",height:"calc(100% - 16px - 4px)",width:"calc(100% - 16px)"},responseLogContainer:{position:"relative",display:"flex",flexDirection:"column",gap:15},dialogActions:{display:"flex",flexDirection:"column",alignItems:"stretch"}};class j extends S.ConfigGeneric{lastExecutionLine;textRef;closeTimeout;constructor(e){super(e),this.state={...this.state,executing:!1,executionDialog:!1,executionLog:[],closeOnReady:!1,styles:Y,isFullScreen:!1},this.lastExecutionLine="",this.textRef=b.createRef()}static getTime(){const e=new Date;return`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`}onOutput=(e,t)=>{if(t&&t.val&&t.val!==this.lastExecutionLine){this.lastExecutionLine=t.val;const o=[...this.state.executionLog],c=(t.val||"").toString().replace(/\n$/,"").split(`
`),i=j.getTime();if(c.forEach(a=>{a=a.trim();const r=a.match(/^\[(\w+)] \[(\w+)] - (.*)/);if(r)o.push({level:r[1],source:r[2],ts:i,text:r[3]});else if(t.val.startsWith("[EXIT]")){const p=t.val.match(/^\[EXIT] ([-\d]+)/);o.push({level:p[1]==="0"?"INFO":"WARN",source:"gui",ts:i,text:p[1]==="0"?l.I18n.t("The backup was successfully created!"):l.I18n.t("The backup could not be created completely!")})}else o.push({text:a})}),this.textRef.current&&this.textRef.current.scrollTop+this.textRef.current.clientHeight>=this.textRef.current.scrollHeight&&setTimeout(()=>this.textRef.current.scrollTop=this.textRef.current.scrollHeight,100),this.setState({executionLog:o}),t.val.startsWith("[EXIT]")){this.setState({executing:!1});const a=t.val.match(/^\[EXIT] ([-\d]+)/);this.state.closeOnReady&&(!a||a[1]==="0")&&(this.closeTimeout=this.closeTimeout||setTimeout(()=>{this.closeTimeout=null,this.setState({executionDialog:!1})},1500))}}};async componentDidMount(){super.componentDidMount(),await this.props.oContext.socket.subscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.oneClick.${this.props.schema.custom.backUpType}`,this.onEnabled),await this.props.oContext.socket.subscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.output.line`,this.onOutput),this.updateFullScreenMode(),window.addEventListener("resize",this.updateFullScreenMode)}onEnabled=(e,t)=>{e===`${this.props.oContext.adapterName}.${this.props.oContext.instance}.oneClick.${this.props.schema.custom.backUpType}`&&!!(t!=null&&t.val)!==this.state.executing&&this.setState({executing:!!(t!=null&&t.val)})};componentWillUnmount(){super.componentWillUnmount(),this.props.oContext.socket.unsubscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.oneClick.${this.props.schema.custom.backUpType}`,this.onEnabled),this.props.oContext.socket.unsubscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.output.line`,this.onOutput),this.closeTimeout&&clearTimeout(this.closeTimeout),this.closeTimeout=null,window.removeEventListener("resize",this.updateFullScreenMode)}updateFullScreenMode=()=>{const e=window.matchMedia("(max-width: 600px)").matches;this.setState({isFullScreen:e})};renderLine(e,t){return s.jsxs("div",{style:{...this.state.isFullScreen?this.state.styles.responseTextLine:this.state.styles.textLine},children:[s.jsx("div",{style:{...this.state.styles.textTime,...e.level?this.state.styles[`textLevel-${e.level}`]:void 0},children:e.ts}),s.jsx("div",{style:{...this.state.styles.textLevel,...e.level?this.state.styles[`textLevel-${e.level}`]:void 0},children:e.level}),s.jsx("div",{style:{...this.state.styles.textSource,...e.level?this.state.styles[`textLevel-${e.level}`]:void 0},children:e.source}),s.jsx("div",{style:{...this.state.isFullScreen?this.state.styles.responseText:this.state.styles.text,...e.level?this.state.styles[`textLevel-${e.level}`]:void 0},children:e.text})]},t)}renderExecutionDialog(){return this.state.executionDialog?s.jsxs(h.Dialog,{open:!0,onClose:()=>this.setState({executionDialog:!1}),maxWidth:"lg",fullWidth:!0,fullScreen:this.state.isFullScreen,sx:{"& .MuiDialog-paper":this.state.styles.paper},children:[s.jsxs(h.DialogTitle,{children:[s.jsx(f.CloudUploadOutlined,{style:{width:24,height:24,margin:"0 10px -4px 0"}}),l.I18n.t("BackItUp execution:")]}),s.jsxs(h.DialogContent,{style:this.state.styles.dialogContent,children:[this.state.executing?s.jsx(h.LinearProgress,{style:{position:"absolute",top:0,left:24,width:"calc(100% - 64px)"}}):s.jsx("div",{style:{height:4,width:"calc(100% - 64px)"}}),s.jsx("div",{style:{...this.state.styles.logContainer,...this.state.isFullScreen?this.state.styles.responseLogContainer:void 0,backgroundColor:this.props.oContext.themeType==="dark"?"#111":"#EEE"},ref:this.textRef,children:this.state.executionLog.map((e,t)=>this.renderLine(e,t))})]}),s.jsxs(h.DialogActions,{style:{...this.state.isFullScreen?this.state.styles.dialogActions:void 0},children:[s.jsx(h.FormControlLabel,{control:s.jsx(h.Checkbox,{disabled:!this.state.executing,checked:this.state.closeOnReady,onChange:e=>this.setState({closeOnReady:e.target.checked})}),label:l.I18n.t("Close on ready")}),s.jsx(h.Button,{variant:"contained",color:this.props.color,onClick:()=>this.setState({executionDialog:!1}),children:l.I18n.t("Close")})]})]}):null}renderItem(){return s.jsxs(s.Fragment,{children:[s.jsx(h.Button,{disabled:!this.props.alive||this.state.executing,onClick:()=>this.setState({executionDialog:!0,executionLog:[{ts:j.getTime(),level:"INFO",text:l.I18n.t("starting Backup..."),source:"gui"}],executing:!0},async()=>{this.lastExecutionLine="",await this.props.oContext.socket.setState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.oneClick.${this.props.schema.custom.backUpType}`,!0)}),className:this.props.className,color:this.props.color,variant:"contained",style:this.props.style,endIcon:s.jsx(f.CloudUploadOutlined,{}),children:this.props.schema.label?l.I18n.t(this.props.schema.label):l.I18n.t("Backup now")}),this.renderExecutionDialog()]})}}class Z extends T{renderItem(){return s.jsxs(s.Fragment,{children:[s.jsx(h.Button,{variant:"contained",endIcon:s.jsx(f.Search,{}),onClick:async()=>{const e={...this.props.data},t=await this.fetchConfig(this.props.schema.custom.adapter,e);t.found?t.changed?(this.showMessage(l.I18n.t("BackItUp Information!"),t.message||l.I18n.t("Config taken from %s",t.found.substring(15))),this.props.onChange(e)):this.showMessage(l.I18n.t("BackItUp Information!"),t.message||l.I18n.t("Config found in %s, but nothing changed",t.found.substring(15))):this.showMessage(l.I18n.t("BackItUp Warning!"),l.I18n.t("No config found"),"warning")},children:l.I18n.t("Detect config")}),this.renderMessage()]})}}class _ extends T{async componentDidMount(){if(super.componentDidMount(),!this.isConfigFilled(this.props.schema.adapter)){const e={...this.props.data};(await this.fetchConfig(this.props.schema.adapter,e)).changed&&this.props.onChange(e)}}renderItem(){return this.renderMessage()}}class $ extends S.ConfigGeneric{googleAuthWindow;componentDidMount(){super.componentDidMount(),window.addEventListener?window.addEventListener("message",this.onMessage,!1):window.attachEvent("onmessage",this.onMessage,!1)}componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener?window.removeEventListener("message",this.onMessage,!1):window.detachEvent("onmessage",this.onMessage,!1)}onMessage=e=>{var t;if(e.origin==="https://googleauth.iobroker.in"&&(typeof e.data=="string"&&e.data.startsWith("google-authentication:")||typeof e.message=="string"&&e.message.startsWith("google-authentication:"))){const o=(e.data||e.message).split(":");o[1]==="success"?(this.setState({googleDriveUrl:"",googledriveAccessTokens:o[2],success:!0},()=>this.props.onChange({...this.props.data,googledriveAccessTokens:this.state.googledriveAccessTokens})),(t=this.googleAuthWindow)==null||t.postMessage("close",e.origin),this.googleAuthWindow=null):this.props.onError&&this.props.onError(o[2])}};onOpenUrl(){this.googleAuthWindow=window.open(this.state.googleDriveUrl,"ioBrokerGoogleAuth"),(!this.googleAuthWindow||this.googleAuthWindow.closed||typeof this.googleAuthWindow.closed>"u")&&this.setState({blocked:!0})}renderItem(){var e,t;return s.jsxs("div",{style:{width:"100%",margin:"0 0 1rem 0"},children:[s.jsx(h.Button,{disabled:!!this.state.googleDriveUrl||!this.props.alive||this.state.running,endIcon:s.jsx(f.CloudUpload,{}),variant:"contained",onClick:()=>this.setState({running:!0},async()=>{const o=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"authGoogleDrive",{url:`${window.location.protocol}//${window.location.host}${window.location.pathname}`});this.setState({googleDriveUrl:o.url,running:!1},()=>this.onOpenUrl())}),children:l.I18n.t(this.props.data.googledriveAccessTokens?"Renew Google Drive Access":"Get Google Drive Access")}),this.state.blocked?s.jsx("div",{style:{color:"red",fontSize:16,marginTop:20},children:l.I18n.t("Please allow popups in your browser for this page!")}):null,this.state.success&&((e=this.props.originalData)==null?void 0:e.googledriveAccessTokens)!==this.state.googledriveAccessTokens?s.jsx("div",{style:{color:"green",fontSize:16,marginTop:20},children:l.I18n.t("Successfully authorized. Now please be sure, the configuration is saved.")}):null,this.state.success&&((t=this.props.originalData)==null?void 0:t.googledriveAccessTokens)===this.state.googledriveAccessTokens?s.jsx("div",{style:{color:"green",fontWeight:"bold",fontSize:16,marginTop:20},children:l.I18n.t("Successfully authorized!")}):null,!this.state.success&&this.props.data.googledriveAccessTokens?s.jsx("div",{style:{color:"green",fontWeight:"bold",fontSize:16,marginTop:20},children:l.I18n.t("Authorization token exists")}):null,this.state.googleDriveUrl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{width:"100%",margin:"1rem 0 1rem 0"},children:[s.jsx("span",{style:{marginRight:4},children:`${l.I18n.t("Authorize this app by visiting this url:")}`}),s.jsx("br",{}),s.jsx("a",{target:"_blank",href:this.state.googleDriveUrl,rel:"noreferrer",children:this.state.googleDriveUrl})]}),s.jsx(h.TextField,{value:this.state.googledriveAccessTokens,label:l.I18n.t("Enter the code from that page here"),variant:"standard",onChange:o=>{this.setState({googledriveAccessTokens:o.target.value},()=>this.props.onChange({...this.props.data,googledriveAccessTokens:this.state.googledriveAccessTokens}))},fullWidth:!0})]}):null]})}}class ee extends S.ConfigGeneric{renderItem(){return s.jsxs("div",{style:{width:"100%",margin:"0 0 1rem 0"},children:[s.jsx("div",{style:{width:"100%",margin:"0 0 1rem 0"},children:s.jsxs("span",{hidden:!!this.state.onedriveUrl,children:[s.jsx("span",{style:{marginRight:4},children:`${l.I18n.t("OneDrive refresh token:")}`}),l.I18n.t(this.state.onedriveState==="Present"||this.props.data.onedriveAccessJson?"Present":"Not present")]})}),s.jsx(h.Button,{disabled:!!this.state.onedriveUrl||!this.props.alive||this.state.running,endIcon:s.jsx(f.CloudUpload,{}),variant:"contained",onClick:()=>this.setState({running:!0},async()=>{const e=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"authOnedrive",null);this.setState({onedriveUrl:e.url,running:!1})}),children:l.I18n.t(this.props.data.onedriveAccessJson?"Renew OneDrive Access":"Get OneDrive Access")}),this.state.onedriveUrl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{width:"100%",margin:"1rem 0 1rem 0"},children:[s.jsx("span",{style:{marginRight:4},children:`${l.I18n.t("Authorize this app by visiting this url:")}`}),s.jsx("br",{}),s.jsx("a",{target:"_blank",href:this.state.onedriveUrl,rel:"noreferrer",children:this.state.onedriveUrl})]}),s.jsx(h.TextField,{label:l.I18n.t("Enter the code from that page here"),variant:"standard",onChange:e=>this.setState({code:e.target.value}),fullWidth:!0}),s.jsx(h.Button,{style:{margin:"1rem 0 1rem 0"},disabled:!this.state.onedriveUrl||!this.props.alive||this.state.running,endIcon:s.jsx(f.CloudUpload,{}),variant:"contained",onClick:()=>this.setState({running:!0},async()=>{const e=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"authOnedrive",{code:this.state.code});this.props.onChange({...this.props.data,onedriveAccessJson:e.json}),this.setState({onedriveState:e.done?"Present":"Not present",running:!1,onedriveUrl:null})}),children:l.I18n.t("Submit")})]}):null]})}}class te extends S.ConfigGeneric{authWindow;async componentDidMount(){super.componentDidMount(),window.addEventListener?window.addEventListener("message",this.onMessage,!1):window.attachEvent("onmessage",this.onMessage,!1),await this.props.oContext.socket.subscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.info.dropboxTokens`,this.onTokensUpdated);const e=await this.props.oContext.socket.getState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.info.dropboxTokens`);if(e){const t=JSON.parse(e.val);new Date(t.access_token_expires_on).getTime()>Date.now()&&this.setState({accessTokens:e.val})}}onTokensUpdated=(e,t)=>{if(t!=null&&t.val){const o=JSON.parse(t.val);if(new Date(o.access_token_expires_on).getTime()>Date.now()){this.state.accessTokens!==t.val&&this.setState({accessTokens:t.val});return}}this.setState({accessTokens:""})};componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener?window.removeEventListener("message",this.onMessage,!1):window.detachEvent("onmessage",this.onMessage,!1),this.props.oContext.socket.unsubscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.info.dropboxTokens`,this.onTokensUpdated)}saveToken(e){try{e&&!e.startsWith("{")&&(e=atob(e));const t=JSON.parse(e);t.access_token&&t.refresh_token&&t.expires_in&&(t.access_token_expires_on||=new Date(Date.now()+t.expires_in*1e3).toISOString(),this.props.oContext.socket.setState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.info.dropboxTokens`,JSON.stringify(t),!0).catch(o=>console.log(`Error occurred: ${o}`)))}catch(t){console.log(t)}}onMessage=e=>{var t;if(e.origin==="https://oauth2.iobroker.in"&&(typeof e.data=="string"&&e.data.startsWith("dropbox-authentication:")||typeof e.message=="string"&&e.message.startsWith("dropbox-authentication:"))){const o=(e.data||e.message).split(":");o[1]==="success"?(this.setState({url:"",accessTokens:o[2],success:!0},()=>this.saveToken(this.state.accessTokens)),(t=this.authWindow)==null||t.postMessage("close",e.origin),this.authWindow=null):this.props.onError&&this.props.onError(o[2])}};onOpenUrl(){this.authWindow=window.open(this.state.url,"ioBrokerDropBoxAuth"),(!this.authWindow||this.authWindow.closed||typeof this.authWindow.closed>"u")&&this.setState({blocked:!0})}renderItem(){let e="";if(this.state.accessTokens)try{const t=JSON.parse(this.state.accessTokens);e=new Date(t.access_token_expires_on).toLocaleString()}catch{}return s.jsxs("div",{style:{width:"100%",margin:"0 0 1rem 0"},children:[s.jsx(h.Button,{disabled:!!this.state.url||!this.props.alive||this.state.running,endIcon:s.jsx(f.CloudUpload,{}),variant:"contained",onClick:()=>this.setState({running:!0},async()=>{const t=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"authDropbox");this.setState({url:t.url,running:!1},()=>this.onOpenUrl())}),children:l.I18n.t(this.state.accessTokens?"Renew DropBox Access":"Get DropBox Access")}),this.state.blocked?s.jsx("div",{style:{color:"red",fontSize:16,marginTop:20},children:l.I18n.t("Please allow popups in your browser for this page!")}):null,this.state.accessTokens?s.jsx("div",{style:{color:"green",fontSize:16,marginTop:20},children:this.props.alive?l.I18n.t("Successfully authorized. Token valid till %s and will be automatically renewed.",e):l.I18n.t("Successfully authorized. Token valid till %s but it can expire as the instance is not running.",e)}):null,this.state.url?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{width:"100%",margin:"1rem 0 1rem 0"},children:[s.jsx("span",{style:{marginRight:4},children:`${l.I18n.t("Authorize this app by visiting this url:")}`}),s.jsx("br",{}),s.jsx("a",{target:"_blank",href:this.state.url,rel:"noreferrer",children:this.state.url})]}),s.jsx(h.TextField,{value:this.state.accessTokens,label:l.I18n.t("Enter the code from that page here"),variant:"standard",onChange:t=>{let o=t.target.value;o&&!o.startsWith("{")&&(o=atob(o));try{const c=JSON.parse(o);c.access_token&&(c.access_token_expires_on=new Date(Date.now()+(c.expires_in-10)*1e3).toISOString(),this.setState({accessTokens:JSON.stringify(c)},()=>this.saveToken(this.state.accessTokens)))}catch{}},fullWidth:!0})]}):null]})}}class se extends T{instanceRead;async componentDidMount(){super.componentDidMount();const e=S.ConfigGeneric.getValue(this.props.data,this.props.attr),t=S.ConfigGeneric.getValue(this.props.data,this.props.schema.custom.adapter==="telegram"?"telegramUser":"discordTarget"),c=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance",`system.adapter.${this.props.schema.custom.adapter}.`,`system.adapter.${this.props.schema.custom.adapter}.香`)).map(i=>({value:i._id.substring(15),label:i._id.substring(15)}));c.unshift({value:"_",label:"none"}),this.setState({instances:c,instance:e,target:t},()=>{this.readTargets()})}async fillTelegramUser(){var e;if((e=this.state.instance)!=null&&e.startsWith("telegram.")){if(this.instanceRead!==this.state.instance){let t=!1;const o=await this.props.oContext.socket.getObject(`system.adapter.${this.state.instance}`);o&&o.native&&(t=o.native.useUsername);const c=await this.props.oContext.socket.getState(`${this.state.instance}.communicate.users`),i=c==null?void 0:c.val,a=[{value:"allTelegramUsers",label:"All Receiver"}];if(i){this.instanceRead=this.state.target;const r=JSON.parse(i);for(const p in r)t?a.push({value:r[p].userName,label:r[p].userName}):a.push({value:r[p].firstName,label:r[p].firstName})}this.setState({targets:a})}}else this.props.data.telegramUser!=="allTelegramUsers"&&setTimeout(()=>this.props.onChange({...this.props.data,telegramUser:"allTelegramUsers"}),50)}async fillDiscordTarget(){var e;if((e=this.state.instance)!=null&&e.startsWith("discord.")){if(this.instanceRead!==this.state.instance){const t=await this.props.oContext.socket.getState(`system.adapter.${this.state.instance}.alive`);if(t!=null&&t.val){const o=await this.props.oContext.socket.sendTo(this.state.instance,"getNotificationTargets",{});if(Array.isArray(o)){this.instanceRead=this.state.instance;const c=[{value:"_",label:"none"}];for(let i=0;i<o.length;i++)c.push({value:o[i].value,label:o[i].label});this.setState({targets:c})}}}}else{const t=[{value:"_",label:"none"}];this.setState({targets:t}),this.props.data.discordTarget&&setTimeout(()=>this.props.onChange({...this.props.data,discordTarget:""}),50)}}async readTargets(){this.props.schema.custom.adapter==="telegram"?await this.fillTelegramUser():this.props.schema.custom.adapter==="discord"&&await this.fillDiscordTarget()}renderItem(){var o,c;const e=(o=this.state.instances)==null?void 0:o.find(i=>i.value===(this.state.instance||"")),t=(c=this.state.targets)==null?void 0:c.find(i=>i.value===(this.state.target||""));return s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:12,justifyContent:"space-evenly",alignContent:"center",justifyItems:"stretch",gridAutoRows:"1fr"},children:[this.state.instances?s.jsxs(h.FormControl,{style:{width:"100%",marginRight:10},variant:"standard",children:[s.jsx(h.InputLabel,{children:l.I18n.t(this.props.schema.label)}),s.jsx(h.Select,{variant:"standard",value:this.state.instance||"_",renderValue:()=>e?this.getText(e.label,e.label!=="none"):this.state.instance||"",onChange:i=>this.setState({instance:i.target.value==="_"?"":i.target.value},async()=>{await this.readTargets(),await this.onChange(this.props.attr,this.state.instance)}),children:this.state.instances.map((i,a)=>s.jsx(h.MenuItem,{value:i.value,children:this.getText(i.label,(i==null?void 0:i.label)!=="none")},a))}),this.props.schema.help?s.jsx(h.FormHelperText,{children:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):null]}):null,this.state.targets&&(this.props.schema.custom.adapter==="telegram"||this.props.schema.custom.adapter==="discord")?s.jsxs(h.FormControl,{variant:"standard",children:[s.jsx(h.InputLabel,{children:l.I18n.t(this.props.schema.custom.adapter==="telegram"?"Telegram receiver":"Discord receiver")}),s.jsx(h.Select,{disabled:!this.state.instance,variant:"standard",value:this.state.target||"_",renderValue:()=>t?this.getText(t.label,(t==null?void 0:t.label)!=="none"):this.state.target||"",onChange:i=>this.setState({target:i.target.value==="_"?"":i.target.value},()=>this.onChange(this.props.schema.custom.adapter==="telegram"?"telegramUser":"discordTarget",this.state.target)),children:this.state.targets.map((i,a)=>s.jsx(h.MenuItem,{value:i.value,children:this.getText(i.label,(i==null?void 0:i.label)!=="none")},a))}),this.props.schema.help?s.jsx(h.FormHelperText,{children:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):null]}):this.props.schema.custom.adapter==="telegram"||this.props.schema.custom.adapter==="discord"?s.jsx(h.TextField,{variant:"standard",disabled:!this.state.instance,label:l.I18n.t(this.props.schema.custom.adapter==="telegram"?"Telegram receiver":"Discord receiver"),value:this.state.target,onChange:i=>this.setState({target:i.target.value},()=>this.onChange(this.props.schema.custom.adapter==="telegram"?"telegramUser":"discordTarget",this.state.target))}):null]})}}var B={exports:{}},oe=B.exports;(function(n,e){(function(t,o){o()})(oe,function(){function t(d,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function o(d,u,x){var m=new XMLHttpRequest;m.open("GET",d),m.responseType="blob",m.onload=function(){p(m.response,u,x)},m.onerror=function(){console.error("could not download file")},m.send()}function c(d){var u=new XMLHttpRequest;u.open("HEAD",d,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function i(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof I=="object"&&I.global===I?I:void 0,r=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!r?function(d,u,x){var m=a.URL||a.webkitURL,y=document.createElement("a");u=u||d.name||"download",y.download=u,y.rel="noopener",typeof d=="string"?(y.href=d,y.origin===location.origin?i(y):c(y.href)?o(d,u,x):i(y,y.target="_blank")):(y.href=m.createObjectURL(d),setTimeout(function(){m.revokeObjectURL(y.href)},4e4),setTimeout(function(){i(y)},0))}:"msSaveOrOpenBlob"in navigator?function(d,u,x){if(u=u||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(t(d,x),u);else if(c(d))o(d,u,x);else{var m=document.createElement("a");m.href=d,m.target="_blank",setTimeout(function(){i(m)})}}:function(d,u,x,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof d=="string")return o(d,u,x);var y=d.type==="application/octet-stream",P=/constructor/i.test(a.HTMLElement)||a.safari,O=/CriOS\/[\d]+/.test(navigator.userAgent);if((O||y&&P||r)&&typeof FileReader<"u"){var L=new FileReader;L.onloadend=function(){var A=L.result;A=O?A:A.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=A:location=A,m=null},L.readAsDataURL(d)}else{var U=a.URL||a.webkitURL,E=U.createObjectURL(d);m?m.location=E:location.href=E,m=null,setTimeout(function(){U.revokeObjectURL(E)},4e4)}});a.saveAs=p.saveAs=p,n.exports=p})})(B);var ie=B.exports,z={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},F=b.createContext&&b.createContext(z),ne=["attr","size","title"];function re(n,e){if(n==null)return{};var t=ae(n,e),o,c;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(c=0;c<i.length;c++)o=i[c],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function ae(n,e){if(n==null)return{};var t={};for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){if(e.indexOf(o)>=0)continue;t[o]=n[o]}return t}function D(){return D=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},D.apply(this,arguments)}function N(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(n,c).enumerable})),t.push.apply(t,o)}return t}function R(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?N(Object(t),!0).forEach(function(o){le(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):N(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function le(n,e,t){return e=ce(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ce(n){var e=he(n,"string");return typeof e=="symbol"?e:e+""}function he(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function q(n){return n&&n.map((e,t)=>b.createElement(e.tag,R({key:t},e.attr),q(e.child)))}function v(n){return e=>b.createElement(pe,D({attr:R({},n.attr)},e),q(n.child))}function pe(n){var e=t=>{var{attr:o,size:c,title:i}=n,a=re(n,ne),r=c||t.size||"1em",p;return t.className&&(p=t.className),n.className&&(p=(p?p+" ":"")+n.className),b.createElement("svg",D({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,a,{className:p,style:R(R({color:n.color||t.color},t.style),n.style),height:r,width:r,xmlns:"http://www.w3.org/2000/svg"}),i&&b.createElement("title",null,i),n.children)};return F!==void 0?b.createElement(F.Consumer,null,t=>e(t)):e(z)}function de(n){return v({attr:{viewBox:"0 0 528 512"},child:[{tag:"path",attr:{d:"M264.4 116.3l-132 84.3 132 84.3-132 84.3L0 284.1l132.3-84.3L0 116.3 132.3 32l132.1 84.3zM131.6 395.7l132-84.3 132 84.3-132 84.3-132-84.3zm132.8-111.6l132-84.3-132-83.6L395.7 32 528 116.3l-132.3 84.3L528 284.8l-132.3 84.3-131.3-85z"},child:[]}]})(n)}function ue(n){return v({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M339 314.9L175.4 32h161.2l163.6 282.9H339zm-137.5 23.6L120.9 480h310.5L512 338.5H201.5zM154.1 67.4L0 338.5 80.6 480 237 208.8 154.1 67.4z"},child:[]}]})(n)}function M(n){return v({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M640 264v-16c0-8.84-7.16-16-16-16H344v-40h72c17.67 0 32-14.33 32-32V32c0-17.67-14.33-32-32-32H224c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h72v40H16c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h104v40H64c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h160c17.67 0 32-14.33 32-32V352c0-17.67-14.33-32-32-32h-56v-40h304v40h-56c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h160c17.67 0 32-14.33 32-32V352c0-17.67-14.33-32-32-32h-56v-40h104c8.84 0 16-7.16 16-16zM256 128V64h128v64H256zm-64 320H96v-64h96v64zm352 0h-96v-64h96v64z"},child:[]}]})(n)}function ge(n){return v({attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M5.082 5.593c-0.564 0.564-0.423 1.213 0.564 2.679 0.508 0.761 1.1 1.946 1.326 2.623 0.226 0.705 0.677 1.664 0.987 2.143 0.564 0.79 0.564 0.959 0.197 2.397-0.226 0.902-0.31 2.031-0.197 2.736 0.169 1.185 1.128 2.905 1.72 3.102 0.508 0.169 1.241-0.733 1.269-1.551 0-0.705 0.028-0.733 0.338-0.226 0.536 0.874 2.228 2.735 2.369 2.594 0.056-0.056-0.31-0.79-0.846-1.607-0.508-0.846-1.1-1.946-1.325-2.454-0.31-0.846-0.423-0.902-0.79-0.508-0.226 0.226-0.508 0.874-0.592 1.466-0.226 1.354-0.733 1.523-1.128 0.367s-0.395-3.131 0-4.484c0.282-0.931 0.254-1.184-0.226-1.89-0.31-0.423-0.79-1.438-1.044-2.256-0.254-0.79-0.846-1.974-1.325-2.595-1.1-1.551-1.1-2.115 0.056-1.89 0.479 0.085 1.213 0.423 1.664 0.733 0.423 0.31 1.156 0.564 1.607 0.564 1.354 0 3.723 1.326 5.443 3.046 1.326 1.325 2.002 2.397 3.441 5.302 1.692 3.44 1.833 3.638 2.877 3.976 1.241 0.423 3.835 2.002 3.835 2.341 0 0.113-0.649 0.282-1.438 0.338-2.115 0.226-2.313 0.62-0.931 1.861 0.649 0.564 1.862 1.438 2.736 1.918l1.579 0.902-0.733-0.931c-0.423-0.508-1.297-1.297-1.974-1.72s-1.213-0.874-1.213-0.987c0-0.113 0.479-0.31 1.072-0.395 1.579-0.282 2.030-0.423 2.030-0.705 0-0.423-2.848-2.566-4.202-3.159-1.156-0.536-1.297-0.762-2.792-3.835-1.326-2.82-1.861-3.61-3.553-5.302-2.171-2.171-3.666-3.102-5.584-3.384-0.649-0.113-1.551-0.451-1.946-0.733-0.931-0.705-2.82-0.959-3.272-0.479z"},child:[]}]})(n)}function me(n){return v({attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M11.953 23.012c-1.393-0.348-2.169-1.455-2.172-3.099-0.001-0.525 0.037-0.777 0.168-1.115 0.321-0.828 1.173-1.453 2.292-1.683 0.557-0.114 0.729-0.237 0.729-0.522 0-0.089 0.066-0.355 0.147-0.591 0.368-1.070 1.050-1.963 1.779-2.328 0.763-0.382 1.147-0.468 2.070-0.463 1.31 0.007 1.964 0.291 2.878 1.251l0.503 0.528 0.45-0.156c2.18-0.754 4.353 0.53 4.528 2.676l0.048 0.587 0.429 0.154c1.226 0.439 1.802 1.361 1.698 2.717-0.068 0.887-0.483 1.595-1.14 1.946l-0.309 0.165-6.861 0.013c-5.272 0.010-6.948-0.009-7.238-0.081v0zM6.809 22.065c-0.813-0.193-1.675-0.912-2.079-1.733-0.229-0.466-0.241-0.535-0.241-1.359 0-0.784 0.020-0.91 0.202-1.299 0.385-0.821 1.122-1.414 2.047-1.647 0.195-0.049 0.379-0.128 0.408-0.174s0.061-0.301 0.072-0.566c0.064-1.642 1.142-3.089 2.646-3.554 0.813-0.251 1.834-0.189 2.718 0.164 0.28 0.112 0.249 0.136 0.842-0.641 0.351-0.46 1.059-1.032 1.639-1.323 0.626-0.314 1.277-0.459 2.055-0.457 2.176 0.005 4.051 1.366 4.744 3.443 0.222 0.664 0.21 0.849-0.051 0.855-0.114 0.002-0.441 0.065-0.726 0.139l-0.519 0.135-0.473-0.473c-1.335-1.335-3.513-1.623-5.364-0.71-0.74 0.365-1.334 0.888-1.783 1.57-0.32 0.486-0.728 1.394-0.728 1.619 0 0.16-0.129 0.24-0.682 0.421-1.711 0.561-2.709 1.857-2.709 3.515 0 0.604 0.156 1.342 0.371 1.765 0.081 0.16 0.127 0.311 0.101 0.337-0.066 0.066-2.194 0.044-2.489-0.026v0z"},child:[]}]})(n)}function fe(n){return v({attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M26.741 18.661c-0.24-0.278-0.65-0.202-0.967-0.139-0.762 0.136-1.591 0.294-2.329-0.023 1.318-2.080 2.355-4.351 2.935-6.748 0.211-0.911 0.374-1.843 0.343-2.781-0.023-0.525-0.096-1.084-0.417-1.519-0.794-1.047-1.945-1.81-3.214-2.151-1.585-0.43-3.285-0.302-4.844 0.18-0.129 0.026-0.256-0.032-0.382-0.048-1.415-0.287-2.975-0.174-4.202 0.645-1.473-0.53-3.056-0.85-4.624-0.686-1.166 0.121-2.337 0.663-3.006 1.656-0.846 1.239-0.961 2.821-0.826 4.273 0.272 1.928 0.742 3.826 1.34 5.677 0.394 1.154 0.828 2.317 1.529 3.325 0.356 0.495 0.829 0.994 1.466 1.072 0.566 0.069 1.078-0.282 1.425-0.698 0.6-0.718 1.217-1.423 1.857-2.105 0.418 0.205 0.872 0.323 1.336 0.358-0.251 0.298-0.458 0.687-0.858 0.804-0.539 0.208-1.17 0.18-1.645 0.539-0.274 0.196-0.287 0.623-0.041 0.848 0.445 0.432 1.101 0.525 1.693 0.575 0.839 0.064 1.687-0.218 2.324-0.768-0.004 1.334 0.002 2.672 0.152 3.999 0.075 0.777 0.41 1.551 1.001 2.074 0.557 0.486 1.351 0.587 2.058 0.464 0.694-0.132 1.407-0.34 1.949-0.814 0.576-0.508 0.822-1.275 0.936-2.011 0.207-1.319 0.364-2.644 0.514-3.969 1.483 0.25 3.161-0.034 4.269-1.117 0.237-0.223 0.462-0.609 0.228-0.912zM23.45 6.117c0.89 0.338 1.681 0.925 2.275 1.668 0.283 0.355 0.319 0.832 0.337 1.268 0.013 1.040-0.197 2.067-0.464 3.067-0.511 1.851-1.287 3.625-2.262 5.277-0.096 0.163-0.201 0.32-0.317 0.469-0.009-0.045-0.027-0.137-0.036-0.183 0.121-0.318 0.298-0.618 0.367-0.956 0.244-0.953 0.038-1.934-0.050-2.893-0.092-0.905 0.217-1.786 0.209-2.689 0.035-0.442-0.14-0.86-0.31-1.257-0.615-1.375-1.593-2.598-2.848-3.438-0.306-0.21-0.648-0.357-0.953-0.568 1.334-0.286 2.765-0.25 4.051 0.234zM22.637 13.836c0.078 1.071 0.389 2.221-0.116 3.237-0.677-1.347-1.552-2.633-1.857-4.133-0.086-0.477-0.108-1.081 0.316-1.413 0.538-0.382 1.241-0.296 1.863-0.258-0.027 0.859-0.291 1.702-0.205 2.567zM10.534 20.181c-0.243 0.286-0.571 0.627-0.985 0.542-0.484-0.14-0.792-0.582-1.062-0.979-0.729-1.166-1.168-2.483-1.571-3.79-0.451-1.547-0.831-3.119-1.050-4.717-0.109-1.216-0.041-2.52 0.581-3.603 0.466-0.82 1.335-1.343 2.248-1.514 1.462-0.281 2.961 0.017 4.364 0.445-0.619 0.68-1.101 1.481-1.382 2.358-0.383 1.171-0.558 2.417-0.466 3.648 0.053 0.867 0.030 1.738-0.091 2.598-0.152 1.123 0.299 2.278 1.133 3.036-0.568 0.664-1.17 1.297-1.72 1.977zM11.814 16.158c-0.143-0.636 0.044-1.276 0.065-1.913 0.049-0.721-0.002-1.443-0.016-2.164 0.674-0.436 1.462-0.777 2.279-0.73 0.423 0.018 0.813 0.317 0.915 0.734 0.371 1.477 0.486 3.121-0.225 4.52-0.248 0.54-0.449 1.099-0.622 1.666-1.182 0.012-2.187-0.987-2.396-2.112zM15.492 20.112c-0.742 1.005-2.227 1.197-3.3 0.65 0.529-0.245 1.148-0.226 1.659-0.528 0.494-0.266 0.69-0.851 1.152-1.152 0.503-0.071 0.87 0.676 0.49 1.029zM21.856 18.938c-0.282 0.454-0.183 1.008-0.252 1.512-0.162 1.413-0.321 2.828-0.551 4.232-0.109 0.673-0.395 1.388-1.030 1.723-0.651 0.331-1.407 0.539-2.139 0.426-0.695-0.122-1.133-0.77-1.33-1.401-0.144-0.529-0.159-1.082-0.2-1.627-0.070-1.315-0.071-2.633-0.037-3.949 0.029-0.514-0.235-1.049-0.694-1.299-0.222-0.125-0.482-0.142-0.73-0.162 0.195-0.967 0.784-1.802 0.986-2.768 0.262-1.195 0.117-2.439-0.151-3.619-0.131-0.589-0.579-1.11-1.175-1.253-0.918-0.231-1.844 0.128-2.665 0.512 0.104-1.334 0.461-2.7 1.278-3.783 0.601-0.806 1.533-1.344 2.528-1.473 1.642-0.209 3.366 0.243 4.671 1.27 1.078 0.852 1.93 2.006 2.389 3.304-0.763-0.027-1.628-0.058-2.245 0.472-0.56 0.472-0.632 1.277-0.506 1.953 0.292 1.608 1.241 2.975 1.941 4.421 0.186 0.339 0.436 0.635 0.674 0.939-0.283 0.143-0.599 0.28-0.76 0.571zM23.82 20.075c-0.504 0.060-1.028 0.078-1.514-0.089 0.002-0.275-0.013-0.601 0.208-0.806 0.175-0.129 0.424-0.248 0.626-0.107 0.86 0.453 1.86 0.232 2.775 0.121-0.559 0.544-1.333 0.798-2.095 0.881zM21.178 11.728c-0.179 0.147 0.014 0.367 0.168 0.436 0.373 0.219 0.884-0.087 0.896-0.513-0.337-0.157-0.76-0.141-1.065 0.077zM14.576 12.408c0.159-0.090 0.327-0.337 0.143-0.486-0.262-0.213-0.643-0.254-0.962-0.168-0.103 0.036-0.211 0.106-0.19 0.232 0.074 0.428 0.647 0.688 1.008 0.422z"},child:[]}]})(n)}function xe(n){return v({attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M14.824 7.518c0 0.007 0.103 0.202 0.232 0.441 0.126 0.235 0.219 0.437 0.205 0.447s-0.371 0.146-0.792 0.295c-0.424 0.152-0.765 0.282-0.759 0.288s0.487 0.056 1.067 0.109c0.699 0.066 1.067 0.113 1.093 0.139 0.023 0.023 0.182 0.282 0.358 0.57l0.315 0.53 0.056-0.133c0.030-0.070 0.126-0.302 0.215-0.51l0.156-0.381 0.841-0.089c0.46-0.050 0.871-0.089 0.914-0.089 0.040-0.003 0.073-0.013 0.073-0.030 0-0.013-0.311-0.142-0.696-0.285-0.381-0.142-0.696-0.265-0.696-0.268s0.083-0.205 0.182-0.447 0.175-0.447 0.169-0.454c-0.007-0.010-0.331 0.089-0.715 0.215l-0.702 0.229-0.745-0.295c-0.732-0.288-0.772-0.301-0.772-0.282zM19.452 10.038c-0.891 0.354-1.623 0.649-1.63 0.656s0.656 0.275 1.474 0.6l1.484 0.586 0.159-0.063c1.653-0.643 3.157-1.242 3.15-1.249-0.023-0.027-2.948-1.172-2.981-1.172-0.023 0.003-0.768 0.291-1.656 0.643zM10.899 9.694c-0.855 0.089-1.573 0.338-1.878 0.653-0.209 0.215-0.242 0.398-0.113 0.619 0.192 0.331 0.822 0.61 1.693 0.752 0.391 0.066 1.54 0.056 1.938-0.013 0.931-0.162 1.534-0.46 1.676-0.835 0.053-0.139 0.053-0.159 0-0.295-0.139-0.364-0.732-0.666-1.61-0.818-0.444-0.076-1.272-0.106-1.706-0.063zM26.819 10.724c-0.043 0.056-0.202 0.182-0.354 0.285-0.451 0.291-1.034 0.556-4.651 2.113-2.544 1.093-3.193 1.381-4.074 1.805-0.977 0.467-1.381 0.596-1.872 0.596-0.441 0-0.702-0.076-1.524-0.441-0.328-0.146-1.67-0.709-2.981-1.255-5.734-2.385-5.84-2.435-6.148-2.766l-0.129-0.142v2.256l0.146 0.139c0.139 0.136 0.613 0.421 0.782 0.47 0.046 0.013 0.358 0.142 0.696 0.288s1.984 0.835 3.66 1.534c2.773 1.156 3.405 1.421 4.349 1.835 0.5 0.222 0.778 0.278 1.249 0.262 0.345-0.013 0.447-0.033 0.749-0.136 0.195-0.066 0.533-0.209 0.752-0.318 0.719-0.361 1.59-0.745 5.058-2.239 3.263-1.408 3.687-1.603 4.041-1.848 0.364-0.258 0.348-0.195 0.348-1.451 0-0.6-0.003-1.090-0.010-1.090s-0.043 0.046-0.086 0.103zM15.397 12.195c-1.335 0.205-2.441 0.381-2.461 0.388-0.030 0.010 3.326 1.421 3.468 1.457 0.033 0.010 1.534-2.15 1.534-2.206 0-0.030 0.003-0.033-2.541 0.361zM26.838 14.428c-0.030 0.050-0.169 0.172-0.305 0.268-0.434 0.298-1.086 0.596-5.052 2.302-2.282 0.984-2.998 1.299-3.677 1.63-1.1 0.533-1.365 0.619-1.954 0.616-0.457-0.003-0.739-0.076-1.345-0.351-0.583-0.268-1.236-0.543-3.856-1.63-4.558-1.891-5.085-2.127-5.406-2.438l-0.159-0.149v2.219l0.179 0.169c0.292 0.272 0.262 0.258 5.154 2.296 1.795 0.745 3.488 1.457 3.76 1.58 0.722 0.325 0.931 0.401 1.216 0.46 0.666 0.136 1.159 0.026 2.239-0.5 0.702-0.341 1.56-0.722 3.637-1.616 3.948-1.703 4.922-2.14 5.21-2.332 0.103-0.073 0.242-0.189 0.311-0.265l0.123-0.136v-1.11c0-0.61-0.003-1.11-0.010-1.11-0.003 0-0.033 0.043-0.066 0.096zM26.802 18.061c-0.262 0.328-0.785 0.58-4.856 2.332-2.657 1.146-3.465 1.504-4.339 1.921-0.918 0.437-1.219 0.53-1.749 0.53-0.361 0-0.729-0.086-1.136-0.265-0.951-0.417-1.577-0.682-4.353-1.838-3.157-1.315-4.167-1.742-4.505-1.911-0.315-0.159-0.636-0.384-0.709-0.5l-0.070-0.106v1.13c0 1.295-0.023 1.199 0.325 1.434 0.384 0.258 0.954 0.51 4.744 2.083 2.65 1.1 3.604 1.501 4.074 1.713 0.961 0.431 1.216 0.5 1.752 0.47 0.49-0.023 0.812-0.129 1.66-0.533 0.884-0.424 1.537-0.715 4.422-1.958 4.008-1.726 4.442-1.934 4.747-2.286l0.106-0.119v-1.106c0-0.61-0.003-1.11-0.007-1.11-0.007 0-0.053 0.053-0.106 0.119z"},child:[]}]})(n)}function ve(n){return v({attr:{version:"1.1",viewBox:"0 0 34 32"},child:[{tag:"path",attr:{d:"M21.576 3.59c-1.115-0.994-2.465-0.595-3.798 0.588-0.198 0.176-0.395 0.371-0.591 0.579-2.279 2.418-4.395 6.897-5.053 10.318 0.256 0.519 0.456 1.182 0.588 1.688 0.034 0.13 0.064 0.252 0.089 0.355 0.058 0.245 0.089 0.405 0.089 0.405s-0.020-0.077-0.104-0.321c-0.016-0.047-0.034-0.098-0.055-0.158-0.009-0.025-0.021-0.055-0.035-0.087-0.149-0.346-0.56-1.075-0.741-1.393-0.155 0.457-0.292 0.884-0.406 1.271 0.523 0.956 0.841 2.595 0.841 2.595s-0.028-0.106-0.159-0.477c-0.117-0.328-0.697-1.345-0.835-1.583-0.235 0.869-0.329 1.455-0.244 1.598 0.164 0.277 0.32 0.754 0.457 1.282 0.309 1.189 0.524 2.637 0.524 2.637s0.007 0.096 0.019 0.244c-0.043 0.999-0.017 2.034 0.060 2.97 0.103 1.239 0.295 2.303 0.541 2.873l0.167-0.091c-0.361-1.122-0.508-2.593-0.444-4.289 0.097-2.593 0.694-5.719 1.796-8.978 1.863-4.919 4.447-8.866 6.811-10.751-2.155 1.947-5.073 8.248-5.946 10.581-0.978 2.613-1.671 5.065-2.088 7.414 0.721-2.202 3.050-3.149 3.050-3.149s1.143-1.409 2.478-3.422c-0.8 0.182-2.113 0.495-2.553 0.68-0.649 0.272-0.824 0.365-0.824 0.365s2.102-1.28 3.905-1.86c2.48-3.906 5.182-9.456 2.461-11.884z"},child:[]}]})(n)}function ye(n){return v({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.253 2.755c-.676 0-1.231.555-1.231 1.232v.976h-.083a.722.722 0