- Notifications
You must be signed in to change notification settings - Fork9
License
ioBroker/adapter-react-v5
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository is no longer maintained. Please useioBroker.admin instead.
You can find demo onhttps://github.com/ioBroker/adapter-react-demo
If you want to create the configuration page with ReactJS:
- Create github repo for adapter.
- execute
npx create-react-app src
. It will take a while. cd src
- Modify package.json file in src directory:
- Change
name
fromsrc
toADAPTERNAME-admin
(Of course replaceADAPTERNAME
with yours) - Add to devDependencies:Versions can be higher.So your
"@iobroker/adapter-react-v5": "^7.2.4",
src/package.json
should look like:
- Change
{"name":"ADAPTERNAME-admin","version":"0.1.0","private":true,"dependencies": {"@iobroker/adapter-react-v5":"^7.2.4","@iobroker/build-tools":"^1.0.0","@iobroker/eslint-config":"^0.1.2","@mui/material":"^6.0.2","@mui/icons-material":"^6.0.2","@sentry/browser":"^8.28.0","babel-eslint":"^10.1.0","eslint":"^9.10.0","react":"^18.3.1","react-dom":"^18.3.1","react-scripts":"^5.0.1","react-icons":"^5.3.0" },"scripts": {"start":"react-scripts start","build":"react-scripts build","test":"react-scripts test","eject":"react-scripts eject" },"eslintConfig": {"extends":"react-app" },"homepage":".","browserslist": [">0.2%","not dead","not ie <= 11","not op_mini all"]}
- Call in
src
:npm install
- Copy
tasks.js
intosrc
:cp node_modules/@iobroker/adapter-react-v5/tasks.js tasks.js
- Add scripts to your
package.json
scripts
section:
"scripts": {"0-clean":"node tasks --0-clean","1-npm":"node tasks --1-npm","2-build":"node tasks --2-build","3-copy":"node tasks --3-copy","4-patch":"node tasks --4-patch","build":"node tasks"}
- Start your dummy application
npm run start
for developing or build withnpm run build
andcopy files inbuild
directory towww
or toadmin
. In the admin you must renameindex.html
toindex_m.html
. - You can do that with
npm
tasks:npm run build
- Add
socket.io
topublic/index.html
.After
<linkrel="manifest"href="%PUBLIC_URL%/manifest.json"/>
insert
<script>constscript=document.createElement('script');window.registerSocketOnLoad=function(cb){window.socketLoadedHandler=cb;};constparts=(window.location.search||'').replace(/^\?/,'').split('&');constquery={};parts.forEach(item=>{const[name,val]=item.split('=');query[decodeURIComponent(name)]=val!==undefined ?decodeURIComponent(val) :true;});script.onload=function(){typeofwindow.socketLoadedHandler==='function'&&window.socketLoadedHandler();};script.src=window.location.port==='3000' ?window.location.protocol+'//'+(query.host||window.location.hostname)+':'+(query.port||8081)+'/lib/js/socket.io.js' :'%PUBLIC_URL%/../../lib/js/socket.io.js';document.head.appendChild(script);</script>
- Add to App.js constructor initialization for I18n:
classAppextendsGenericApp{constructor(props){constextendedProps={ ...props};extendedProps.encryptedFields=['pass'];// this parameter will be encrypted and decrypted automaticallyextendedProps.translations={en:require('./i18n/en'),de:require('./i18n/de'),ru:require('./i18n/ru'),pt:require('./i18n/pt'),nl:require('./i18n/nl'),fr:require('./i18n/fr'),it:require('./i18n/it'),es:require('./i18n/es'),pl:require('./i18n/pl'),uk:require('./i18n/uk'),'zh-cn':require('./i18n/zh-cn'),};// get actual admin portextendedProps.socket={port:parseInt(window.location.port,10)};// Only if close, save buttons are not required at the bottom (e.g. if admin tab)// extendedProps.bottomButtons = false;// only for debug purposesif(extendedProps.socket.port===3000){extendedProps.socket.port=8081;}// allow to manage GenericApp the sentry initialisation or do not set the sentryDSN if no sentry availableextendedProps.sentryDSN='https://yyy@sentry.iobroker.net/xx';super(extendedProps);}// ...}
- Replace
index.js
with the following code to support themes:
importReactfrom'react';import{createRoot}from'react-dom/client';import*asserviceWorkerfrom'./serviceWorker';import'./index.css';importAppfrom'./App';import{version}from'../package.json';console.log(`iobroker.scenes@${version}`);constcontainer=document.getElementById('root');constroot=createRoot(container);root.render(<App/>);// If you want your app to work offline and load faster, you can change// unregister() to register() below. Note this comes with some pitfalls.// Learn more about service workers: http://bit.ly/CRA-PWAserviceWorker.unregister();
- Add to App.js encoding and decoding of values:
classAppextendsGenericApp{// ...onPrepareLoad(settings){settings.pass=this.decode(settings.pass);}onPrepareSave(settings){settings.pass=this.encode(settings.pass);}}
- The optional step is to validate the data to be saved:
onPrepareSave(settings){super.onPrepareSave(settings);if(DATA_INVALID){returnfalse;// configuration will not be saved}else{returntrue;}}
This is a non-React class to provide the communication for socket connection with the server.
Some dialogs are predefined and could be used out of the box.
Usage:
importReactfrom'react';import{I18n,ConfirmasConfirmDialog}from'@iobroker/adapter-react-v5';classExportImportDialogextendsReact.Component{constructor(props){super(props);this.state={confirmDialog:false,};}renderConfirmDialog(){if(!this.state.confirmDialog){returnnull;}return(<ConfirmDialogtitle={I18n.t('Scene will be overwritten.')}text={I18n.t('All data will be lost. Confirm?')}ok={I18n.t('Yes')}cancel={I18n.t('Cancel')}suppressQuestionMinutes={5}dialogName="myConfirmDialogThatCouldBeSuppressed"suppressText={I18n.t('Suppress question for next %s minutes',5)}onClose={isYes=>{this.setState({confirmDialog:false});}}/>);}render(){return(<div><ButtononClick={()=>this.setState({confirmDialog:true})}>Click</Button>{this.renderConfirmDialog()}</div>);}}exportdefaultExportImportDialog;
renderMessage(){if(this.state.showMessage){return<Messagetext={this.state.showMessage}onClose={()=>this.setState({showMessage:false})}/>;}else{returnnull;}}
import{SelectIDasDialogSelectID}from'@iobroker/adapter-react-v5';classMyComponentextendsComponent{constructor(props){super(props);this.state={showSelectId:false,};}renderSelectIdDialog(){if(this.state.showSelectId){return(<DialogSelectIDkey="tableSelect"imagePrefix="../.."dialogName={this.props.adapterName}themeType={this.props.themeType}socket={this.props.socket}statesOnly={true}selected={this.state.selectIdValue}onClose={()=>this.setState({showSelectId:false})}onOk={(selected,name)=>{this.setState({showSelectId:false,selectIdValue:selected});}}/>);}else{returnnull;}}render(){returnrenderSelectIdDialog();}}
Include"react-text-mask": "^5.4.3",
in package.json.
functionrenderCron(){if(!showCron){returnnull;}else{return(<DialogCronkey="dialogCron1"cron={this.state.cronValue||'* * * * *'}onClose={()=>this.setState({showCron:false})}onOk={cronValue=>{this.setState({ cronValue});}}/>);}}
getObjectNameFromObj(obj, settings, options, isDesc)
Get object name from a single object.
Usage:Utils.getObjectNameFromObj(this.objects[id], null, {language: I18n.getLanguage()})
getObjectIcon(id, obj)
Get icon from the object.
Usage:
consticon=Utils.getObjectIcon(id,this.objects[id]);return<imgsrc={icon}/>;
isUseBright(color, defaultValue)
Usage: `
render(){if(!this.state.loaded){return<MuiThemeProvidertheme={this.state.theme}><Loadertheme={this.state.themeType}/></MuiThemeProvider>;}// render loaded data}
render(){return<formclassName={this.props.classes.tab}><Logoinstance={this.props.instance}common={this.props.common}native={this.props.native}onError={text=>this.setState({errorText:text})}onLoad={this.props.onLoad}/> ...</form>;}
It is better to useDialog/SelectID
, but if you want:
<ObjectBrowserfoldersFirst={this.props.foldersFirst}imagePrefix={this.props.imagePrefix||this.props.prefix}// prefix is for back compatibilitydefaultFilters={this.filters}dialogName={this.dialogName}showExpertButton={this.props.showExpertButton!==undefined ?this.props.showExpertButton :true}style={{width:'100%',height:'100%'}}columns={this.props.columns||['name','type','role','room','func','val']}types={this.props.types||['state']}t={I18n.t}lang={this.props.lang||I18n.getLanguage()}socket={this.props.socket}selected={this.state.selected}multiSelect={this.props.multiSelect}notEditable={this.props.notEditable===undefined ?true :this.props.notEditable}name={this.state.name}theme={this.props.theme}themeName={this.props.themeName}themeType={this.props.themeType}customFilter={this.props.customFilter}onFilterChanged={filterConfig=>{this.filters=filterConfig;window.localStorage.setItem(this.dialogName,JSON.stringify(filterConfig));}}onSelect={(selected,name,isDouble)=>{if(JSON.stringify(selected)!==JSON.stringify(this.state.selected)){this.setState({ selected, name},()=>isDouble&&this.handleOk());}elseif(isDouble){this.handleOk();}}}/>
// STYLESconststyles={tableDiv:{width:'100%',overflow:'hidden',height:'calc(100% - 48px)',},};classMyComponentextendsComponent{constructor(props){super(props);this.state={data:[{id:'UniqueID1',// requiredfieldIdInData:'Name1',myType:'number',},{id:'UniqueID2',// requiredfieldIdInData:'Name12',myType:'string',},],};this.columns=[{title:'Name of field',// required, else it will be "field"field:'fieldIdInData',// requirededitable:false,// or true [default - true]cellStyle:{// CSS style - // optionalmaxWidth:'12rem',overflow:'hidden',wordBreak:'break-word',},lookup:{// optional => edit will be automatically "SELECT"value1:'text1',value2:'text2',},},{title:'Type',// required, else it will be "field"field:'myType',// requirededitable:true,// or true [default - true]lookup:{// optional => edit will be automatically "SELECT"number:'Number',string:'String',boolean:'Boolean',},type:'number/string/color/oid/icon/boolean',// oid=ObjectID,icon=base64-iconeditComponent:props=>(<div> Prefix{<br/><textarearows={4}style={{width:'100%',resize:'vertical'}}value={props.value}onChange={e=>props.onChange(e.target.value)}/> Suffix</div>),},];}// renderTablerender(){return(<divclassName={this.props.classes.tableDiv}><TreeTablecolumns={this.columns}data={this.state.data}onUpdate={(newData,oldData)=>{constdata=JSON.parse(JSON.stringify(this.state.data));// Added new lineif(newData===true){// find unique IDleti=1;letid='line_'+i;// eslint-disable-next-linewhile(this.state.data.find(item=>item.id===id)){i++;id='line_'+i;}data.push({ id,name:I18n.t('New resource')+'_'+i,color:'',icon:'',unit:'',price:0,});}else{// existing line was modifedconstpos=this.state.data.indexOf(oldData);if(pos!==-1){Object.keys(newData).forEach(attr=>(data[pos][attr]=newData[attr]));}}this.setState({ data});}}onDelete={oldData=>{console.log('Delete: '+JSON.stringify(oldData));constpos=this.state.data.indexOf(oldData);if(pos!==-1){constdata=JSON.parse(JSON.stringify(this.state.data));data.splice(pos,1);this.setState({ data});}}}/></div>);}}
Toast is not a part ofadapter-react
but it is an example how to use toast in application:
import{Component}from'react';import{Snackbar}from'@mui/material';classMyComponentextendsComponent{constructor(props){super(props);this.state={// ....toast:'',};}// ...renderToast(){if(!this.state.toast){returnnull;}return(<SnackbaranchorOrigin={{vertical:'bottom',horizontal:'left',}}open={true}autoHideDuration={6000}onClose={()=>this.setState({toast:''})}ContentProps={{'aria-describedby':'message-id'}}message={<spanid="message-id">{this.state.toast}</span>}action={[<IconButtonkey="close"aria-label="Close"color="inherit"className={this.props.classes.close}onClick={()=>this.setState({toast:''})}><IconClose/></IconButton>,]}/>);}render(){return<div>{this.renderToast()}</div>;}}
- Admin
- Backitup
- iot
- echarts
- text2command
- scenes
- javascript
- devices
- eventlist
- cameras
- web
- vis-2
- vis-2-widgets-xxx
- fullcalendar
- openweathermap
In dialogs, the OK button is first (on the left) and the cancel button is last (on the right)
This project uses icons fromFlaticon.
ioBroker GmbH has a valid license for all the used icons.The icons may not be reused in other projects without the proper flaticon license or flaticon subscription.
You can find the migration instructions:
- from adapter-react-v5@6.x to adapter-react-v5@7.x
- from adapter-react-v5@5.x to adapter-react-v5@6.x
- from adapter-react to adapter-react-v5@5.x
- (@GermanBluefox) Corrected file browser
- (@GermanBluefox) Changed Open/Close Folder icons
- (@GermanBluefox) Small layout change for Icon Picker
- (@GermanBluefox) Allowed using an array of elements in dialogs
- (@GermanBluefox) Allowed to use
socket.iob
instead ofsocket.io
- (@GermanBluefox) Updated socket classes
- (@GermanBluefox) Updated socket classes
- (@GermanBluefox) Added additional confirmation dialog for CRONs for every minute execution
- (@GermanBluefox) Corrected TabContainer
- (@GermanBluefox) Optimized the icon picker
- (@GermanBluefox) Used common eslint-config
- (@GermanBluefox) Showed the context menu under cursor position in the object browser
- (@GermanBluefox) Added links to aliases in the object browser
- (@GermanBluefox) Updated the object browser
- (@GermanBluefox) Used MUI Library 6.0
- (@GermanBluefox) Updated the object browser
- (@GermanBluefox) Updated JSON schema
- (@GermanBluefox) Added translations
- (@GermanBluefox) Optimize package
- (@GermanBluefox) Added sources to package
- (@GermanBluefox) Better typing of legacy connection
- (@GermanBluefox) Added translations
- (@GermanBluefox) Replace by CRON to text the package to
cronstrue
- (@GermanBluefox) added some packages for federation
- (@GermanBluefox) Allowed playing mp3 files in the file browser
- (@GermanBluefox) Corrected jump by object selection
- (@GermanBluefox) Corrected theme type selection
- (@GermanBluefox) Corrected color picker
- (@GermanBluefox) Added support for the overrides in the theme
- (@GermanBluefox) Added translation
- (@GermanBluefox) Mobile object browser improved
- (@GermanBluefox) Corrected Icons
- (@GermanBluefox) Corrected types of the select ID dialog
- (@GermanBluefox) Made the tooltips neutral to the pointer events
- (@GermanBluefox) Synchronised with admin
- (@GermanBluefox) Added translations for time scheduler
- (@GermanBluefox) Removed the usage of
withStyles
in favor ofsx
andstyle
properties (seeMigration from v5 to v6 - (@GermanBluefox) (BREAKING) Higher version of
@mui/material
(5.15.20) is used
- (@GermanBluefox) Added
modulefederation.admin.config.js
for module federation
- (@GermanBluefox) Sources were synchronized with admin
- (@GermanBluefox) Added better typing
- (@GermanBluefox) Added better typing
- (@GermanBluefox) Json-Config is now a separate package and must be installed additionally
- (@GermanBluefox) Types are now exported
- (@GermanBluefox) Translator renamed to Translate
- (@GermanBluefox) Breaking: Theme renamed to IobTheme because of the naming conflict
(@GermanBluefox) Updated packages
(@GermanBluefox) Updated packages
- (@GermanBluefox) Better types added
- (@GermanBluefox) updated theme definitions
- (@GermanBluefox) corrected dates in cron dialog
- (@GermanBluefox) Updated packages
- (@GermanBluefox) Updated ioBroker types
- (@GermanBluefox) All files are migrated to Typescript
- (@GermanBluefox) Corrected the size of icons
- (@GermanBluefox) Migrated all icons to Typescript
- (@GermanBluefox) Updated socket-client package
- (@GermanBluefox) Corrected CRON selector
- (@GermanBluefox) Migrated ColorPicker to typescript
- (@GermanBluefox) Migrated TreeTable to typescript
- (@GermanBluefox) corrected the object subscription
- (@GermanBluefox) used new connection classes
- (@GermanBluefox) Improved the
SelectID
dialog
- (@GermanBluefox) used new connection classes
- (@GermanBluefox) Migrated legacy connection to typescript
- (@GermanBluefox) Added support for remote cloud
- (@GermanBluefox) Corrected rendering of LoaderMV
- (@GermanBluefox) Corrected types of IconPicker
- (@GermanBluefox) Made filters for the file selector dialog optional
- (@GermanBluefox) Migrated GenericApp to typescript
- (@GermanBluefox) Migrated some components to typescript
- (@GermanBluefox) Migrated some components to typescript
- (foxriver76) type GenericApp socket correctly
- (@GermanBluefox) translations
- (@GermanBluefox) updated JSON config
- (foxriver76) also check plugin state of instance to see if Sentry is explicitly disabled
- (@GermanBluefox) allowed hiding wizard in cron dialog
- (foxriver76) allow passing down the instance number do avoid determining from url
- (foxriver76) make
copyToClipboard
event parameter optional
- (foxriver76) try to fix
SelectID
scrolling
- (foxriver76) bump version of
@iobroker/json-config
- (foxriver76)
@iobroker/json-config
moved to real dependencies
- (foxriver76) migrate to
@iobroker/json-config
module to have a single point of truth - (@GermanBluefox) Allowed using of
filterFunc
as string
- (@GermanBluefox) Added Device manager to JSON Config
- (@GermanBluefox) Corrected parsing of a text
- (@GermanBluefox) Added possibility to define the root style and embedded property
- (@GermanBluefox) Extended color picker with "noInputField" option
- (@GermanBluefox) Corrected the icon picker
- (foxriver76) port to
@iobroker/types
- (@GermanBluefox) Added translations
- (@GermanBluefox) Corrected subscribe on objects in the legacy connection
- (@GermanBluefox) Updated packages
- (@GermanBluefox) Made getStates method in legacy connection compatible with new one
- (@GermanBluefox) Updated packages
- (foxriver76) fixed problem with color picker, where editing TextField was buggy
- (foxriver76) fixed light mode color of a path in FileBrowser
- (@GermanBluefox) Synced with admin
- (@GermanBluefox) Added GIF to image files
- (@GermanBluefox) Added return value for
subscribeOnInstance
for Connection class
- (@GermanBluefox) Fixed the legacy connection
- (foxriver76) fixed object browser with date
- (@GermanBluefox) Updated the packages
- (@GermanBluefox) Just updated the packages
- (@GermanBluefox) Synced with admin
- (@GermanBluefox) Experimental feature added: update states on re-subscribe
- (@GermanBluefox) Added export for IconNoIcon
- (@GermanBluefox) Added the restricting to folder property for select file dialog
- (foxriver76) fixed css classes of TableResize, seeioBroker/ioBroker.admin#1860
- (foxriver76) added missing export of TableResize
- (foxriver76) fix dialog TextInput
- (@GermanBluefox) Synchronize components with admin
- (@GermanBluefox) Added translations
- (@GermanBluefox) Added
subscribeStateAsync
method to wait for answer - (@GermanBluefox) Added support for arrays for un/subscriptions
- (@GermanBluefox) Updated packages
- (@GermanBluefox) Added translations
- (@GermanBluefox) Updated packages
- (@GermanBluefox) Added translations
- (@GermanBluefox) Synced object browser
- (@GermanBluefox) formatting
- (@GermanBluefox) Updated packages
- (@GermanBluefox) Added translations
- (@GermanBluefox) Updated packages
- (@GermanBluefox) Added new method
getObjectsById
to the socket communication
- (@GermanBluefox) Allowed setting theme name directly by theme toggle
- (@GermanBluefox)
craco-module-federation.js
was added. For node 16
- (@GermanBluefox) Allowed showing only specific root in SelectIDDialog
- (@GermanBluefox) Added IDs to the buttons in the dialog for GUI tests
- (@GermanBluefox) Extended
TextWithIcon
with defined color and icon
- (@GermanBluefox) Updated the file selector in tile mode
- (@GermanBluefox) Added translations
- (@GermanBluefox) Re-Activate legacy connection
- (@GermanBluefox) Added translations
- (@GermanBluefox) Color picker was improved
- (@GermanBluefox) Packages were updated
- (@GermanBluefox) Added new translations
- (@GermanBluefox) Packages were updated
- (@GermanBluefox) Added translations
- (@GermanBluefox) Added port controller to JSON config
- (@GermanBluefox) Updated the object browser and file browser
- (@GermanBluefox) added handler of alert messages
- (@GermanBluefox) Corrected the theme button
- (@GermanBluefox) made the fix for
echarts
- (@GermanBluefox) Updated packages
- (@GermanBluefox) The
chartReady
event was omitted
- (@GermanBluefox) Updated packages
- (@GermanBluefox) made the fix for
material
- (@GermanBluefox) Updated packages
- (@GermanBluefox) Extended socket with
log
command
- (@GermanBluefox) Corrected URL for the connection
- (@GermanBluefox) Added support of custom palette for color picker
- (@GermanBluefox) use
@iobroker/socket-client
instead ofConnection.tsx
- (@GermanBluefox) Improved
renderTextWithA
function to support<b>
and<i>
tags
- (@GermanBluefox) updated json config component
- (@GermanBluefox) Added button text for message dialog
- (@GermanBluefox) Added file selector
- (@GermanBluefox) Added subscribe on files
- (@GermanBluefox) Added
fullWidth
property toDialog
- (xXBJXx) Improved TreeTable component
- (@GermanBluefox) Added the role filter for the object browser
- (@GermanBluefox) Added support for alfa channel for
invertColor
- (@GermanBluefox) Corrected expert mode for object browser
- (@GermanBluefox) Added support for prefixes for translations
- (@GermanBluefox) Corrected color inversion
- (@GermanBluefox) Added ukrainian translation
- (@GermanBluefox) small changes for material
- (@GermanBluefox) Implemented fallback to english by translations
- (@GermanBluefox) Added support for onchange flag
- (@GermanBluefox) Added method
getCompactSystemRepositories
- (@GermanBluefox) corrected error in
ObjectBrowser
- (@GermanBluefox) Disable file editing in FileViewer
- (@GermanBluefox) Added translations
- (@GermanBluefox) JSON schema was extended with missing definitions
- (@GermanBluefox) Updated file browser and object browser
- (@GermanBluefox) Extend custom filter for object selector
- (@GermanBluefox) Added i18n tools for development
- (@GermanBluefox) Allowed to show select dialog with the expert mode enabled
- (@GermanBluefox) Allowed extending translations for all languages together
- (@GermanBluefox) Added translation
- (@GermanBluefox) Deactivate JSON editor for JSONConfig because of space
- (@GermanBluefox) Update object browser
- (@GermanBluefox) Allowed using of spaces in name
- (@GermanBluefox) Added translations
- (@GermanBluefox) Added preparations for iobroker cloud
- (@GermanBluefox) Added translations
- (@GermanBluefox) Allowed working behind reverse proxy
- (@GermanBluefox) Added file select dialog
- (@GermanBluefox) Added table with resized headers
- (@GermanBluefox) Added new document icon (read only)
- (@GermanBluefox) Allowed working behind reverse proxy
- (@GermanBluefox) Some german texts were corrected
- (@GermanBluefox) Allowed calling getAdapterInstances not for admin too
- (@GermanBluefox) Updated JsonConfigComponent: password, table
- (@GermanBluefox) Added ConfigGeneric to import
- (@GermanBluefox) Made the module definitions
- (@GermanBluefox) Added JsonConfigComponent
- (@GermanBluefox) Update file browser. It supports now the file changed events.
- (@GermanBluefox) Corrected object browser
- (@GermanBluefox) Corrected expert mode in object browser
- (@GermanBluefox) Changes were synchronized with adapter-react-v5
- (@GermanBluefox) Added
I18n.disableWarning
method
- (@GermanBluefox) Added
log
method to connection - (@GermanBluefox) Corrected translations
- (@GermanBluefox) Corrected error in TreeTable
- (@GermanBluefox) BREAKING_CHANGE: Corrected error with readFile(base64=false)
- (@GermanBluefox) Initial version
- (@GermanBluefox) Fixed theme errors
- (@GermanBluefox) Fixed eslint warnings
- (@GermanBluefox) beta version
- (@GermanBluefox) try to publish a first version
- initial commit
The MIT License (MIT)
Copyright (c) 2019-2024 @GermanBluefoxdogafox@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.