UNPKG

@bjia56/scrypted-glanceapp

Version:

Glance dashboard for Scrypted

1 lines 115 kB
(()=>{var e={192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScryptedMimeTypes=t.ScryptedInterface=t.MediaPlayerState=t.SecuritySystemObstruction=t.SecuritySystemMode=t.AirQuality=t.AirPurifierMode=t.AirPurifierStatus=t.ChargeState=t.LockState=t.PanTiltZoomMovement=t.ThermostatMode=t.TemperatureUnit=t.FanMode=t.HumidityMode=t.ScryptedDeviceType=t.ScryptedInterfaceDescriptors=t.ScryptedInterfaceMethod=t.ScryptedInterfaceProperty=t.DeviceBase=t.TYPES_VERSION=void 0,t.TYPES_VERSION="0.3.116";var i,s,r,n,o,a,h,c,d,l,u,m,p,f,y,g,S,b;t.DeviceBase=class{},function(e){e.id="id",e.info="info",e.interfaces="interfaces",e.mixins="mixins",e.name="name",e.nativeId="nativeId",e.pluginId="pluginId",e.providedInterfaces="providedInterfaces",e.providedName="providedName",e.providedRoom="providedRoom",e.providedType="providedType",e.providerId="providerId",e.room="room",e.type="type",e.scryptedRuntimeArguments="scryptedRuntimeArguments",e.on="on",e.brightness="brightness",e.colorTemperature="colorTemperature",e.rgb="rgb",e.hsv="hsv",e.buttons="buttons",e.sensors="sensors",e.running="running",e.paused="paused",e.docked="docked",e.temperatureSetting="temperatureSetting",e.temperature="temperature",e.temperatureUnit="temperatureUnit",e.humidity="humidity",e.audioVolumes="audioVolumes",e.recordingActive="recordingActive",e.ptzCapabilities="ptzCapabilities",e.lockState="lockState",e.entryOpen="entryOpen",e.batteryLevel="batteryLevel",e.chargeState="chargeState",e.online="online",e.fromMimeType="fromMimeType",e.toMimeType="toMimeType",e.converters="converters",e.binaryState="binaryState",e.tampered="tampered",e.sleeping="sleeping",e.powerDetected="powerDetected",e.audioDetected="audioDetected",e.motionDetected="motionDetected",e.ambientLight="ambientLight",e.occupied="occupied",e.flooded="flooded",e.ultraviolet="ultraviolet",e.luminance="luminance",e.position="position",e.securitySystemState="securitySystemState",e.pm10Density="pm10Density",e.pm25Density="pm25Density",e.vocDensity="vocDensity",e.noxDensity="noxDensity",e.co2ppm="co2ppm",e.airQuality="airQuality",e.airPurifierState="airPurifierState",e.filterChangeIndication="filterChangeIndication",e.filterLifeLevel="filterLifeLevel",e.humiditySetting="humiditySetting",e.fan="fan",e.applicationInfo="applicationInfo",e.systemDevice="systemDevice"}(i||(t.ScryptedInterfaceProperty=i={})),function(e){e.listen="listen",e.probe="probe",e.setMixins="setMixins",e.setName="setName",e.setRoom="setRoom",e.setType="setType",e.getPluginJson="getPluginJson",e.turnOff="turnOff",e.turnOn="turnOn",e.setBrightness="setBrightness",e.getTemperatureMaxK="getTemperatureMaxK",e.getTemperatureMinK="getTemperatureMinK",e.setColorTemperature="setColorTemperature",e.setRgb="setRgb",e.setHsv="setHsv",e.pressButton="pressButton",e.sendNotification="sendNotification",e.start="start",e.stop="stop",e.pause="pause",e.resume="resume",e.dock="dock",e.setTemperature="setTemperature",e.setTemperatureUnit="setTemperatureUnit",e.getPictureOptions="getPictureOptions",e.takePicture="takePicture",e.getAudioStream="getAudioStream",e.setAudioVolumes="setAudioVolumes",e.startDisplay="startDisplay",e.stopDisplay="stopDisplay",e.getVideoStream="getVideoStream",e.getVideoStreamOptions="getVideoStreamOptions",e.getPrivacyMasks="getPrivacyMasks",e.setPrivacyMasks="setPrivacyMasks",e.getVideoTextOverlays="getVideoTextOverlays",e.setVideoTextOverlay="setVideoTextOverlay",e.getRecordingStream="getRecordingStream",e.getRecordingStreamCurrentTime="getRecordingStreamCurrentTime",e.getRecordingStreamOptions="getRecordingStreamOptions",e.getRecordingStreamThumbnail="getRecordingStreamThumbnail",e.deleteRecordingStream="deleteRecordingStream",e.setRecordingActive="setRecordingActive",e.ptzCommand="ptzCommand",e.getRecordedEvents="getRecordedEvents",e.getVideoClip="getVideoClip",e.getVideoClips="getVideoClips",e.getVideoClipThumbnail="getVideoClipThumbnail",e.removeVideoClips="removeVideoClips",e.setVideoStreamOptions="setVideoStreamOptions",e.startIntercom="startIntercom",e.stopIntercom="stopIntercom",e.lock="lock",e.unlock="unlock",e.addPassword="addPassword",e.getPasswords="getPasswords",e.removePassword="removePassword",e.activate="activate",e.deactivate="deactivate",e.isReversible="isReversible",e.closeEntry="closeEntry",e.openEntry="openEntry",e.getDevice="getDevice",e.releaseDevice="releaseDevice",e.adoptDevice="adoptDevice",e.discoverDevices="discoverDevices",e.createDevice="createDevice",e.getCreateDeviceSettings="getCreateDeviceSettings",e.reboot="reboot",e.getRefreshFrequency="getRefreshFrequency",e.refresh="refresh",e.getMediaStatus="getMediaStatus",e.load="load",e.seek="seek",e.skipNext="skipNext",e.skipPrevious="skipPrevious",e.convert="convert",e.convertMedia="convertMedia",e.getSettings="getSettings",e.putSetting="putSetting",e.armSecuritySystem="armSecuritySystem",e.disarmSecuritySystem="disarmSecuritySystem",e.setAirPurifierState="setAirPurifierState",e.getReadmeMarkdown="getReadmeMarkdown",e.getOauthUrl="getOauthUrl",e.onOauthCallback="onOauthCallback",e.canMixin="canMixin",e.getMixin="getMixin",e.releaseMixin="releaseMixin",e.onRequest="onRequest",e.onConnection="onConnection",e.onPush="onPush",e.run="run",e.eval="eval",e.loadScripts="loadScripts",e.saveScript="saveScript",e.forkInterface="forkInterface",e.trackObjects="trackObjects",e.getDetectionInput="getDetectionInput",e.getObjectTypes="getObjectTypes",e.detectObjects="detectObjects",e.generateObjectDetections="generateObjectDetections",e.getDetectionModel="getDetectionModel",e.setHumidity="setHumidity",e.setFan="setFan",e.startRTCSignalingSession="startRTCSignalingSession",e.createRTCSignalingSession="createRTCSignalingSession",e.getScryptedUserAccessControl="getScryptedUserAccessControl",e.generateVideoFrames="generateVideoFrames",e.connectStream="connectStream",e.getTTYSettings="getTTYSettings"}(s||(t.ScryptedInterfaceMethod=s={})),t.ScryptedInterfaceDescriptors={ScryptedDevice:{name:"ScryptedDevice",methods:["listen","probe","setMixins","setName","setRoom","setType"],properties:["id","info","interfaces","mixins","name","nativeId","pluginId","providedInterfaces","providedName","providedRoom","providedType","providerId","room","type"]},ScryptedPlugin:{name:"ScryptedPlugin",methods:["getPluginJson"],properties:[]},ScryptedPluginRuntime:{name:"ScryptedPluginRuntime",methods:[],properties:["scryptedRuntimeArguments"]},OnOff:{name:"OnOff",methods:["turnOff","turnOn"],properties:["on"]},Brightness:{name:"Brightness",methods:["setBrightness"],properties:["brightness"]},ColorSettingTemperature:{name:"ColorSettingTemperature",methods:["getTemperatureMaxK","getTemperatureMinK","setColorTemperature"],properties:["colorTemperature"]},ColorSettingRgb:{name:"ColorSettingRgb",methods:["setRgb"],properties:["rgb"]},ColorSettingHsv:{name:"ColorSettingHsv",methods:["setHsv"],properties:["hsv"]},Buttons:{name:"Buttons",methods:[],properties:["buttons"]},PressButtons:{name:"PressButtons",methods:["pressButton"],properties:[]},Sensors:{name:"Sensors",methods:[],properties:["sensors"]},Notifier:{name:"Notifier",methods:["sendNotification"],properties:[]},StartStop:{name:"StartStop",methods:["start","stop"],properties:["running"]},Pause:{name:"Pause",methods:["pause","resume"],properties:["paused"]},Dock:{name:"Dock",methods:["dock"],properties:["docked"]},TemperatureSetting:{name:"TemperatureSetting",methods:["setTemperature"],properties:["temperatureSetting"]},Thermometer:{name:"Thermometer",methods:["setTemperatureUnit"],properties:["temperature","temperatureUnit"]},HumiditySensor:{name:"HumiditySensor",methods:[],properties:["humidity"]},Camera:{name:"Camera",methods:["getPictureOptions","takePicture"],properties:[]},Microphone:{name:"Microphone",methods:["getAudioStream"],properties:[]},AudioVolumeControl:{name:"AudioVolumeControl",methods:["setAudioVolumes"],properties:["audioVolumes"]},Display:{name:"Display",methods:["startDisplay","stopDisplay"],properties:[]},VideoCamera:{name:"VideoCamera",methods:["getVideoStream","getVideoStreamOptions"],properties:[]},VideoCameraMask:{name:"VideoCameraMask",methods:["getPrivacyMasks","setPrivacyMasks"],properties:[]},VideoTextOverlays:{name:"VideoTextOverlays",methods:["getVideoTextOverlays","setVideoTextOverlay"],properties:[]},VideoRecorder:{name:"VideoRecorder",methods:["getRecordingStream","getRecordingStreamCurrentTime","getRecordingStreamOptions","getRecordingStreamThumbnail"],properties:["recordingActive"]},VideoRecorderManagement:{name:"VideoRecorderManagement",methods:["deleteRecordingStream","setRecordingActive"],properties:[]},PanTiltZoom:{name:"PanTiltZoom",methods:["ptzCommand"],properties:["ptzCapabilities"]},EventRecorder:{name:"EventRecorder",methods:["getRecordedEvents"],properties:[]},VideoClips:{name:"VideoClips",methods:["getVideoClip","getVideoClips","getVideoClipThumbnail","removeVideoClips"],properties:[]},VideoCameraConfiguration:{name:"VideoCameraConfiguration",methods:["setVideoStreamOptions"],properties:[]},Intercom:{name:"Intercom",methods:["startIntercom","stopIntercom"],properties:[]},Lock:{name:"Lock",methods:["lock","unlock"],properties:["lockState"]},PasswordStore:{name:"PasswordStore",methods:["addPassword","getPasswords","removePassword"],properties:[]},Scene:{name:"Scene",methods:["activate","deactivate","isReversible"],properties:[]},Entry:{name:"Entry",methods:["closeEntry","openEntry"],properties:[]},EntrySensor:{name:"EntrySensor",methods:[],properties:["entryOpen"]},DeviceProvider:{name:"DeviceProvider",methods:["getDevice","releaseDevice"],properties:[]},DeviceDiscovery:{name:"DeviceDiscovery",methods:["adoptDevice","discoverDevices"],properties:[]},DeviceCreator:{name:"DeviceCreator",methods:["createDevice","getCreateDeviceSettings"],properties:[]},Battery:{name:"Battery",methods:[],properties:["batteryLevel"]},Charger:{name:"Charger",methods:[],properties:["chargeState"]},Reboot:{name:"Reboot",methods:["reboot"],properties:[]},Refresh:{name:"Refresh",methods:["getRefreshFrequency","refresh"],properties:[]},MediaPlayer:{name:"MediaPlayer",methods:["getMediaStatus","load","seek","skipNext","skipPrevious"],properties:[]},Online:{name:"Online",methods:[],properties:["online"]},BufferConverter:{name:"BufferConverter",methods:["convert"],properties:["fromMimeType","toMimeType"]},MediaConverter:{name:"MediaConverter",methods:["convertMedia"],properties:["converters"]},Settings:{name:"Settings",methods:["getSettings","putSetting"],properties:[]},BinarySensor:{name:"BinarySensor",methods:[],properties:["binaryState"]},TamperSensor:{name:"TamperSensor",methods:[],properties:["tampered"]},Sleep:{name:"Sleep",methods:[],properties:["sleeping"]},PowerSensor:{name:"PowerSensor",methods:[],properties:["powerDetected"]},AudioSensor:{name:"AudioSensor",methods:[],properties:["audioDetected"]},MotionSensor:{name:"MotionSensor",methods:[],properties:["motionDetected"]},AmbientLightSensor:{name:"AmbientLightSensor",methods:[],properties:["ambientLight"]},OccupancySensor:{name:"OccupancySensor",methods:[],properties:["occupied"]},FloodSensor:{name:"FloodSensor",methods:[],properties:["flooded"]},UltravioletSensor:{name:"UltravioletSensor",methods:[],properties:["ultraviolet"]},LuminanceSensor:{name:"LuminanceSensor",methods:[],properties:["luminance"]},PositionSensor:{name:"PositionSensor",methods:[],properties:["position"]},SecuritySystem:{name:"SecuritySystem",methods:["armSecuritySystem","disarmSecuritySystem"],properties:["securitySystemState"]},PM10Sensor:{name:"PM10Sensor",methods:[],properties:["pm10Density"]},PM25Sensor:{name:"PM25Sensor",methods:[],properties:["pm25Density"]},VOCSensor:{name:"VOCSensor",methods:[],properties:["vocDensity"]},NOXSensor:{name:"NOXSensor",methods:[],properties:["noxDensity"]},CO2Sensor:{name:"CO2Sensor",methods:[],properties:["co2ppm"]},AirQualitySensor:{name:"AirQualitySensor",methods:[],properties:["airQuality"]},AirPurifier:{name:"AirPurifier",methods:["setAirPurifierState"],properties:["airPurifierState"]},FilterMaintenance:{name:"FilterMaintenance",methods:[],properties:["filterChangeIndication","filterLifeLevel"]},Readme:{name:"Readme",methods:["getReadmeMarkdown"],properties:[]},OauthClient:{name:"OauthClient",methods:["getOauthUrl","onOauthCallback"],properties:[]},MixinProvider:{name:"MixinProvider",methods:["canMixin","getMixin","releaseMixin"],properties:[]},HttpRequestHandler:{name:"HttpRequestHandler",methods:["onRequest"],properties:[]},EngineIOHandler:{name:"EngineIOHandler",methods:["onConnection"],properties:[]},PushHandler:{name:"PushHandler",methods:["onPush"],properties:[]},Program:{name:"Program",methods:["run"],properties:[]},Scriptable:{name:"Scriptable",methods:["eval","loadScripts","saveScript"],properties:[]},ClusterForkInterface:{name:"ClusterForkInterface",methods:["forkInterface"],properties:[]},ObjectTracker:{name:"ObjectTracker",methods:["trackObjects"],properties:[]},ObjectDetector:{name:"ObjectDetector",methods:["getDetectionInput","getObjectTypes"],properties:[]},ObjectDetection:{name:"ObjectDetection",methods:["detectObjects","generateObjectDetections","getDetectionModel"],properties:[]},ObjectDetectionPreview:{name:"ObjectDetectionPreview",methods:[],properties:[]},ObjectDetectionGenerator:{name:"ObjectDetectionGenerator",methods:[],properties:[]},HumiditySetting:{name:"HumiditySetting",methods:["setHumidity"],properties:["humiditySetting"]},Fan:{name:"Fan",methods:["setFan"],properties:["fan"]},RTCSignalingChannel:{name:"RTCSignalingChannel",methods:["startRTCSignalingSession"],properties:[]},RTCSignalingClient:{name:"RTCSignalingClient",methods:["createRTCSignalingSession"],properties:[]},LauncherApplication:{name:"LauncherApplication",methods:[],properties:["applicationInfo"]},ScryptedUser:{name:"ScryptedUser",methods:["getScryptedUserAccessControl"],properties:[]},VideoFrameGenerator:{name:"VideoFrameGenerator",methods:["generateVideoFrames"],properties:[]},StreamService:{name:"StreamService",methods:["connectStream"],properties:[]},TTY:{name:"TTY",methods:[],properties:[]},TTYSettings:{name:"TTYSettings",methods:["getTTYSettings"],properties:[]},ScryptedSystemDevice:{name:"ScryptedSystemDevice",methods:[],properties:["systemDevice"]},ScryptedDeviceCreator:{name:"ScryptedDeviceCreator",methods:[],properties:[]},ScryptedSettings:{name:"ScryptedSettings",methods:[],properties:[]}},function(e){e.Builtin="Builtin",e.Internal="Internal",e.Camera="Camera",e.Fan="Fan",e.Light="Light",e.Switch="Switch",e.Outlet="Outlet",e.Sensor="Sensor",e.Scene="Scene",e.Program="Program",e.Automation="Automation",e.Vacuum="Vacuum",e.Notifier="Notifier",e.Thermostat="Thermostat",e.Lock="Lock",e.PasswordControl="PasswordControl",e.Display="Display",e.SmartDisplay="SmartDisplay",e.Speaker="Speaker",e.SmartSpeaker="SmartSpeaker",e.Event="Event",e.Entry="Entry",e.Garage="Garage",e.DeviceProvider="DeviceProvider",e.DataSource="DataSource",e.API="API",e.Doorbell="Doorbell",e.Irrigation="Irrigation",e.Valve="Valve",e.Person="Person",e.SecuritySystem="SecuritySystem",e.WindowCovering="WindowCovering",e.Siren="Siren",e.AirPurifier="AirPurifier",e.Internet="Internet",e.Network="Network",e.Bridge="Bridge",e.Unknown="Unknown"}(r||(t.ScryptedDeviceType=r={})),function(e){e.Humidify="Humidify",e.Dehumidify="Dehumidify",e.Auto="Auto",e.Off="Off"}(n||(t.HumidityMode=n={})),function(e){e.Auto="Auto",e.Manual="Manual"}(o||(t.FanMode=o={})),function(e){e.C="C",e.F="F"}(a||(t.TemperatureUnit=a={})),function(e){e.Off="Off",e.Cool="Cool",e.Heat="Heat",e.HeatCool="HeatCool",e.Auto="Auto",e.FanOnly="FanOnly",e.Purifier="Purifier",e.Eco="Eco",e.Dry="Dry",e.On="On"}(h||(t.ThermostatMode=h={})),function(e){e.Absolute="Absolute",e.Relative="Relative",e.Continuous="Continuous",e.Preset="Preset",e.Home="Home"}(c||(t.PanTiltZoomMovement=c={})),function(e){e.Locked="Locked",e.Unlocked="Unlocked",e.Jammed="Jammed"}(d||(t.LockState=d={})),function(e){e.Trickle="trickle",e.Charging="charging",e.NotCharging="not-charging"}(l||(t.ChargeState=l={})),function(e){e.Inactive="Inactive",e.Idle="Idle",e.Active="Active",e.ActiveNightMode="ActiveNightMode"}(u||(t.AirPurifierStatus=u={})),function(e){e.Manual="Manual",e.Automatic="Automatic"}(m||(t.AirPurifierMode=m={})),function(e){e.Unknown="Unknown",e.Excellent="Excellent",e.Good="Good",e.Fair="Fair",e.Inferior="Inferior",e.Poor="Poor"}(p||(t.AirQuality=p={})),function(e){e.Disarmed="Disarmed",e.HomeArmed="HomeArmed",e.AwayArmed="AwayArmed",e.NightArmed="NightArmed"}(f||(t.SecuritySystemMode=f={})),function(e){e.Sensor="Sensor",e.Occupied="Occupied",e.Time="Time",e.Error="Error"}(y||(t.SecuritySystemObstruction=y={})),function(e){e.Idle="Idle",e.Playing="Playing",e.Paused="Paused",e.Buffering="Buffering"}(g||(t.MediaPlayerState=g={})),function(e){e.ScryptedDevice="ScryptedDevice",e.ScryptedPlugin="ScryptedPlugin",e.ScryptedPluginRuntime="ScryptedPluginRuntime",e.OnOff="OnOff",e.Brightness="Brightness",e.ColorSettingTemperature="ColorSettingTemperature",e.ColorSettingRgb="ColorSettingRgb",e.ColorSettingHsv="ColorSettingHsv",e.Buttons="Buttons",e.PressButtons="PressButtons",e.Sensors="Sensors",e.Notifier="Notifier",e.StartStop="StartStop",e.Pause="Pause",e.Dock="Dock",e.TemperatureSetting="TemperatureSetting",e.Thermometer="Thermometer",e.HumiditySensor="HumiditySensor",e.Camera="Camera",e.Microphone="Microphone",e.AudioVolumeControl="AudioVolumeControl",e.Display="Display",e.VideoCamera="VideoCamera",e.VideoCameraMask="VideoCameraMask",e.VideoTextOverlays="VideoTextOverlays",e.VideoRecorder="VideoRecorder",e.VideoRecorderManagement="VideoRecorderManagement",e.PanTiltZoom="PanTiltZoom",e.EventRecorder="EventRecorder",e.VideoClips="VideoClips",e.VideoCameraConfiguration="VideoCameraConfiguration",e.Intercom="Intercom",e.Lock="Lock",e.PasswordStore="PasswordStore",e.Scene="Scene",e.Entry="Entry",e.EntrySensor="EntrySensor",e.DeviceProvider="DeviceProvider",e.DeviceDiscovery="DeviceDiscovery",e.DeviceCreator="DeviceCreator",e.Battery="Battery",e.Charger="Charger",e.Reboot="Reboot",e.Refresh="Refresh",e.MediaPlayer="MediaPlayer",e.Online="Online",e.BufferConverter="BufferConverter",e.MediaConverter="MediaConverter",e.Settings="Settings",e.BinarySensor="BinarySensor",e.TamperSensor="TamperSensor",e.Sleep="Sleep",e.PowerSensor="PowerSensor",e.AudioSensor="AudioSensor",e.MotionSensor="MotionSensor",e.AmbientLightSensor="AmbientLightSensor",e.OccupancySensor="OccupancySensor",e.FloodSensor="FloodSensor",e.UltravioletSensor="UltravioletSensor",e.LuminanceSensor="LuminanceSensor",e.PositionSensor="PositionSensor",e.SecuritySystem="SecuritySystem",e.PM10Sensor="PM10Sensor",e.PM25Sensor="PM25Sensor",e.VOCSensor="VOCSensor",e.NOXSensor="NOXSensor",e.CO2Sensor="CO2Sensor",e.AirQualitySensor="AirQualitySensor",e.AirPurifier="AirPurifier",e.FilterMaintenance="FilterMaintenance",e.Readme="Readme",e.OauthClient="OauthClient",e.MixinProvider="MixinProvider",e.HttpRequestHandler="HttpRequestHandler",e.EngineIOHandler="EngineIOHandler",e.PushHandler="PushHandler",e.Program="Program",e.Scriptable="Scriptable",e.ClusterForkInterface="ClusterForkInterface",e.ObjectTracker="ObjectTracker",e.ObjectDetector="ObjectDetector",e.ObjectDetection="ObjectDetection",e.ObjectDetectionPreview="ObjectDetectionPreview",e.ObjectDetectionGenerator="ObjectDetectionGenerator",e.HumiditySetting="HumiditySetting",e.Fan="Fan",e.RTCSignalingChannel="RTCSignalingChannel",e.RTCSignalingClient="RTCSignalingClient",e.LauncherApplication="LauncherApplication",e.ScryptedUser="ScryptedUser",e.VideoFrameGenerator="VideoFrameGenerator",e.StreamService="StreamService",e.TTY="TTY",e.TTYSettings="TTYSettings",e.ScryptedSystemDevice="ScryptedSystemDevice",e.ScryptedDeviceCreator="ScryptedDeviceCreator",e.ScryptedSettings="ScryptedSettings"}(S||(t.ScryptedInterface=S={})),function(e){e.Url="text/x-uri",e.InsecureLocalUrl="text/x-insecure-local-uri",e.LocalUrl="text/x-local-uri",e.ServerId="text/x-server-id",e.PushEndpoint="text/x-push-endpoint",e.SchemePrefix="x-scrypted/x-scrypted-scheme-",e.MediaStreamUrl="text/x-media-url",e.MediaObject="x-scrypted/x-scrypted-media-object",e.RequestMediaObject="x-scrypted/x-scrypted-request-media-object",e.RequestMediaStream="x-scrypted/x-scrypted-request-stream",e.MediaStreamFeedback="x-scrypted/x-media-stream-feedback",e.FFmpegInput="x-scrypted/x-ffmpeg-input",e.FFmpegTranscodeStream="x-scrypted/x-ffmpeg-transcode-stream",e.RTCSignalingChannel="x-scrypted/x-scrypted-rtc-signaling-channel",e.RTCSignalingSession="x-scrypted/x-scrypted-rtc-signaling-session",e.RTCConnectionManagement="x-scrypted/x-scrypted-rtc-connection-management",e.Image="x-scrypted/x-scrypted-image"}(b||(t.ScryptedMimeTypes=b={}))},339:e=>{"use strict";e.exports=require("module")},473:e=>{const t=require("adm-zip");e.exports=t},562:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.sdk=t.MixinDeviceBase=t.ScryptedDeviceBase=void 0,r(i(192),t);const n=i(192);i(339);class o extends n.DeviceBase{constructor(e){super(),this.nativeId=e}get storage(){return this._storage||(this._storage=t.sdk.deviceManager.getDeviceStorage(this.nativeId)),this._storage}get log(){return this._log||(this._log=t.sdk.deviceManager.getDeviceLogger(this.nativeId)),this._log}get console(){return this._console||(this._console=t.sdk.deviceManager.getDeviceConsole(this.nativeId)),this._console}async createMediaObject(e,i){return t.sdk.mediaManager.createMediaObject(e,i,{sourceId:this.id})}getMediaObjectConsole(e){return"string"!=typeof e.sourceId?this.console:t.sdk.deviceManager.getMixinConsole(e.sourceId,this.nativeId)}_lazyLoadDeviceState(){this._deviceState||(this.nativeId?this._deviceState=t.sdk.deviceManager.getDeviceState(this.nativeId):this._deviceState=t.sdk.deviceManager.getDeviceState())}onDeviceEvent(e,i){return t.sdk.deviceManager.onDeviceEvent(this.nativeId,e,i)}}t.ScryptedDeviceBase=o;class a extends n.DeviceBase{constructor(e){super(),this._listeners=new Set,this.mixinDevice=e.mixinDevice,this.mixinDeviceInterfaces=e.mixinDeviceInterfaces,this.mixinStorageSuffix=e.mixinStorageSuffix,this._deviceState=e.mixinDeviceState,this.nativeId=t.sdk.systemManager.getDeviceById(this.id).nativeId,this.mixinProviderNativeId=e.mixinProviderNativeId,this._deviceState.__rpcproxy_traps_all_properties&&"string"==typeof this._deviceState.id&&(this._deviceState=t.sdk.deviceManager.createDeviceState(this._deviceState.id,this._deviceState.setState))}get storage(){if(!this._storage){const e=this.mixinStorageSuffix,i=this.id+(e?":"+e:"");this._storage=t.sdk.deviceManager.getMixinStorage(i,this.mixinProviderNativeId)}return this._storage}get console(){return this._console||(t.sdk.deviceManager.getMixinConsole?this._console=t.sdk.deviceManager.getMixinConsole(this.id,this.mixinProviderNativeId):this._console=t.sdk.deviceManager.getDeviceConsole(this.mixinProviderNativeId)),this._console}async createMediaObject(e,i){return t.sdk.mediaManager.createMediaObject(e,i,{sourceId:this.id})}getMediaObjectConsole(e){return"string"!=typeof e.sourceId?this.console:t.sdk.deviceManager.getMixinConsole(e.sourceId,this.mixinProviderNativeId)}onDeviceEvent(e,i){return t.sdk.deviceManager.onMixinEvent(this.id,this,e,i)}_lazyLoadDeviceState(){}manageListener(e){this._listeners.add(e)}release(){for(const e of this._listeners)e.removeListener()}}t.MixinDeviceBase=a,function(){function e(e){return function(){return this._lazyLoadDeviceState(),this._deviceState?.[e]}}function t(e){return function(t){this._lazyLoadDeviceState(),this._deviceState?this._deviceState[e]=t:console.warn("device state is unavailable. the device must be discovered with deviceManager.onDeviceDiscovered or deviceManager.onDevicesChanged before the state can be set.")}}for(const i of Object.values(n.ScryptedInterfaceProperty))i!==n.ScryptedInterfaceProperty.nativeId&&(Object.defineProperty(o.prototype,i,{set:t(i),get:e(i)}),Object.defineProperty(a.prototype,i,{set:t(i),get:e(i)}))}(),t.sdk={};try{let e=!1;try{process.env.SCRYPTED_SDK_ES_MODULE||process.env.SCRYPTED_SDK_MODULE;const s=process.env.SCRYPTED_SDK_CJS_MODULE||process.env.SCRYPTED_SDK_MODULE;if(s)if("undefined"!=typeof require){const i=require(process.env.SCRYPTED_SDK_MODULE);Object.assign(t.sdk,i.getScryptedStatic()),e=!0}else{const r=i(891)(s);Object.assign(t.sdk,r.getScryptedStatic()),e=!0}}catch(e){throw console.warn("failed to load sdk module",e),e}if(!e){let e;try{e=pluginRuntimeAPI}catch(e){}Object.assign(t.sdk,{log:deviceManager.getDeviceLogger(void 0),deviceManager,endpointManager,mediaManager,systemManager,pluginHostAPI,...e})}try{t.sdk.systemManager.setScryptedInterfaceDescriptors?.(n.TYPES_VERSION,n.ScryptedInterfaceDescriptors)?.catch((()=>{}))}catch(e){}}catch(e){console.error("sdk initialization error, import @scrypted/types or use @scrypted/client instead",e)}t.default=t.sdk},891:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=891,e.exports=t}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};(()=>{"use strict";i.r(s),i.d(s,{default:()=>rn});var e=i(562);const t=require("os"),r=require("path");var n=i.n(r);const o=require("fs"),a=require("fs/promises"),h=require("child_process"),c=require("net");var d=i(473),l=i.n(d);const u=require("events"),m=require("node:events"),p=require("node:stream"),f=require("node:string_decoder"),y="object"==typeof process&&process?process:{stdout:null,stderr:null},g=e=>!!e&&"object"==typeof e&&(e instanceof te||e instanceof p||S(e)||b(e)),S=e=>!!e&&"object"==typeof e&&e instanceof m.EventEmitter&&"function"==typeof e.pipe&&e.pipe!==p.Writable.prototype.pipe,b=e=>!!e&&"object"==typeof e&&e instanceof m.EventEmitter&&"function"==typeof e.write&&"function"==typeof e.end,v=Symbol("EOF"),w=Symbol("maybeEmitEnd"),E=Symbol("emittedEnd"),R=Symbol("emittingEnd"),O=Symbol("emittedError"),_=Symbol("closed"),T=Symbol("read"),D=Symbol("flush"),k=Symbol("flushChunk"),C=Symbol("encoding"),P=Symbol("decoder"),M=Symbol("flowing"),x=Symbol("paused"),I=Symbol("resume"),A=Symbol("buffer"),L=Symbol("pipes"),N=Symbol("bufferLength"),F=Symbol("bufferPush"),B=Symbol("bufferShift"),U=Symbol("objectMode"),j=Symbol("destroyed"),z=Symbol("error"),V=Symbol("emitData"),H=Symbol("emitEnd"),G=Symbol("emitEnd2"),q=Symbol("async"),Z=Symbol("abort"),$=Symbol("aborted"),Y=Symbol("signal"),W=Symbol("dataListeners"),K=Symbol("discarded"),X=e=>Promise.resolve().then(e),Q=e=>e();class J{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[I](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class ee extends J{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=e=>t.emit("error",e),e.on("error",this.proxyErrors)}}class te extends m.EventEmitter{[M]=!1;[x]=!1;[L]=[];[A]=[];[U];[C];[q];[P];[v]=!1;[E]=!1;[R]=!1;[_]=!1;[O]=null;[N]=0;[j]=!1;[Y];[$]=!1;[W]=0;[K]=!1;writable=!0;readable=!0;constructor(...e){const t=e[0]||{};if(super(),t.objectMode&&"string"==typeof t.encoding)throw new TypeError("Encoding and objectMode may not be used together");t.objectMode?(this[U]=!0,this[C]=null):(e=>!e.objectMode&&!!e.encoding&&"buffer"!==e.encoding)(t)?(this[C]=t.encoding,this[U]=!1):(this[U]=!1,this[C]=null),this[q]=!!t.async,this[P]=this[C]?new f.StringDecoder(this[C]):null,t&&!0===t.debugExposeBuffer&&Object.defineProperty(this,"buffer",{get:()=>this[A]}),t&&!0===t.debugExposePipes&&Object.defineProperty(this,"pipes",{get:()=>this[L]});const{signal:i}=t;i&&(this[Y]=i,i.aborted?this[Z]():i.addEventListener("abort",(()=>this[Z]())))}get bufferLength(){return this[N]}get encoding(){return this[C]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[U]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[q]}set async(e){this[q]=this[q]||!!e}[Z](){this[$]=!0,this.emit("abort",this[Y]?.reason),this.destroy(this[Y]?.reason)}get aborted(){return this[$]}set aborted(e){}write(e,t,i){if(this[$])return!1;if(this[v])throw new Error("write after end");if(this[j])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;"function"==typeof t&&(i=t,t="utf8"),t||(t="utf8");const s=this[q]?X:Q;if(!this[U]&&!Buffer.isBuffer(e))if(r=e,!Buffer.isBuffer(r)&&ArrayBuffer.isView(r))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if((e=>e instanceof ArrayBuffer||!!e&&"object"==typeof e&&e.constructor&&"ArrayBuffer"===e.constructor.name&&e.byteLength>=0)(e))e=Buffer.from(e);else if("string"!=typeof e)throw new Error("Non-contiguous data written to non-objectMode stream");var r;return this[U]?(this[M]&&0!==this[N]&&this[D](!0),this[M]?this.emit("data",e):this[F](e),0!==this[N]&&this.emit("readable"),i&&s(i),this[M]):e.length?("string"!=typeof e||t===this[C]&&!this[P]?.lastNeed||(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[C]&&(e=this[P].write(e)),this[M]&&0!==this[N]&&this[D](!0),this[M]?this.emit("data",e):this[F](e),0!==this[N]&&this.emit("readable"),i&&s(i),this[M]):(0!==this[N]&&this.emit("readable"),i&&s(i),this[M])}read(e){if(this[j])return null;if(this[K]=!1,0===this[N]||0===e||e&&e>this[N])return this[w](),null;this[U]&&(e=null),this[A].length>1&&!this[U]&&(this[A]=[this[C]?this[A].join(""):Buffer.concat(this[A],this[N])]);const t=this[T](e||null,this[A][0]);return this[w](),t}[T](e,t){if(this[U])this[B]();else{const i=t;e===i.length||null===e?this[B]():"string"==typeof i?(this[A][0]=i.slice(e),t=i.slice(0,e),this[N]-=e):(this[A][0]=i.subarray(e),t=i.subarray(0,e),this[N]-=e)}return this.emit("data",t),this[A].length||this[v]||this.emit("drain"),t}end(e,t,i){return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t="utf8"),void 0!==e&&this.write(e,t),i&&this.once("end",i),this[v]=!0,this.writable=!1,!this[M]&&this[x]||this[w](),this}[I](){this[j]||(this[W]||this[L].length||(this[K]=!0),this[x]=!1,this[M]=!0,this.emit("resume"),this[A].length?this[D]():this[v]?this[w]():this.emit("drain"))}resume(){return this[I]()}pause(){this[M]=!1,this[x]=!0,this[K]=!1}get destroyed(){return this[j]}get flowing(){return this[M]}get paused(){return this[x]}[F](e){this[U]?this[N]+=1:this[N]+=e.length,this[A].push(e)}[B](){return this[U]?this[N]-=1:this[N]-=this[A][0].length,this[A].shift()}[D](e=!1){do{}while(this[k](this[B]())&&this[A].length);e||this[A].length||this[v]||this.emit("drain")}[k](e){return this.emit("data",e),this[M]}pipe(e,t){if(this[j])return e;this[K]=!1;const i=this[E];return t=t||{},e===y.stdout||e===y.stderr?t.end=!1:t.end=!1!==t.end,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[L].push(t.proxyErrors?new ee(this,e,t):new J(this,e,t)),this[q]?X((()=>this[I]())):this[I]()),e}unpipe(e){const t=this[L].find((t=>t.dest===e));t&&(1===this[L].length?(this[M]&&0===this[W]&&(this[M]=!1),this[L]=[]):this[L].splice(this[L].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){const i=super.on(e,t);if("data"===e)this[K]=!1,this[W]++,this[L].length||this[M]||this[I]();else if("readable"===e&&0!==this[N])super.emit("readable");else if((e=>"end"===e||"finish"===e||"prefinish"===e)(e)&&this[E])super.emit(e),this.removeAllListeners(e);else if("error"===e&&this[O]){const e=t;this[q]?X((()=>e.call(this,this[O]))):e.call(this,this[O])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){const i=super.off(e,t);return"data"===e&&(this[W]=this.listeners("data").length,0!==this[W]||this[K]||this[L].length||(this[M]=!1)),i}removeAllListeners(e){const t=super.removeAllListeners(e);return"data"!==e&&void 0!==e||(this[W]=0,this[K]||this[L].length||(this[M]=!1)),t}get emittedEnd(){return this[E]}[w](){this[R]||this[E]||this[j]||0!==this[A].length||!this[v]||(this[R]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[_]&&this.emit("close"),this[R]=!1)}emit(e,...t){const i=t[0];if("error"!==e&&"close"!==e&&e!==j&&this[j])return!1;if("data"===e)return!(!this[U]&&!i)&&(this[q]?(X((()=>this[V](i))),!0):this[V](i));if("end"===e)return this[H]();if("close"===e){if(this[_]=!0,!this[E]&&!this[j])return!1;const e=super.emit("close");return this.removeAllListeners("close"),e}if("error"===e){this[O]=i,super.emit(z,i);const e=!(this[Y]&&!this.listeners("error").length)&&super.emit("error",i);return this[w](),e}if("resume"===e){const e=super.emit("resume");return this[w](),e}if("finish"===e||"prefinish"===e){const t=super.emit(e);return this.removeAllListeners(e),t}const s=super.emit(e,...t);return this[w](),s}[V](e){for(const t of this[L])!1===t.dest.write(e)&&this.pause();const t=!this[K]&&super.emit("data",e);return this[w](),t}[H](){return!this[E]&&(this[E]=!0,this.readable=!1,this[q]?(X((()=>this[G]())),!0):this[G]())}[G](){if(this[P]){const e=this[P].end();if(e){for(const t of this[L])t.dest.write(e);this[K]||super.emit("data",e)}}for(const e of this[L])e.end();const e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){const e=Object.assign([],{dataLength:0});this[U]||(e.dataLength=0);const t=this.promise();return this.on("data",(t=>{e.push(t),this[U]||(e.dataLength+=t.length)})),await t,e}async concat(){if(this[U])throw new Error("cannot concat in objectMode");const e=await this.collect();return this[C]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise(((e,t)=>{this.on(j,(()=>t(new Error("stream destroyed")))),this.on("error",(e=>t(e))),this.on("end",(()=>e()))}))}[Symbol.asyncIterator](){this[K]=!1;let e=!1;const t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();const i=this.read();if(null!==i)return Promise.resolve({done:!1,value:i});if(this[v])return t();let s,r;const n=e=>{this.off("data",o),this.off("end",a),this.off(j,h),t(),r(e)},o=e=>{this.off("error",n),this.off("end",a),this.off(j,h),this.pause(),s({value:e,done:!!this[v]})},a=()=>{this.off("error",n),this.off("data",o),this.off(j,h),t(),s({done:!0,value:void 0})},h=()=>n(new Error("stream destroyed"));return new Promise(((e,t)=>{r=t,s=e,this.once(j,h),this.once("error",n),this.once("end",a),this.once("data",o)}))},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[K]=!1;let e=!1;const t=()=>(this.pause(),this.off(z,t),this.off(j,t),this.off("end",t),e=!0,{done:!0,value:void 0});return this.once("end",t),this.once(z,t),this.once(j,t),{next:()=>{if(e)return t();const i=this.read();return null===i?t():{done:!1,value:i}},throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[j])return e?this.emit("error",e):this.emit(j),this;this[j]=!0,this[K]=!0,this[A].length=0,this[N]=0;return"function"!=typeof this.close||this[_]||this.close(),e?this.emit("error",e):this.emit(j),this}static get isStream(){return g}}const ie=o.writev,se=Symbol("_autoClose"),re=Symbol("_close"),ne=Symbol("_ended"),oe=Symbol("_fd"),ae=Symbol("_finished"),he=Symbol("_flags"),ce=Symbol("_flush"),de=Symbol("_handleChunk"),le=Symbol("_makeBuf"),ue=Symbol("_mode"),me=Symbol("_needDrain"),pe=Symbol("_onerror"),fe=Symbol("_onopen"),ye=Symbol("_onread"),ge=Symbol("_onwrite"),Se=Symbol("_open"),be=Symbol("_path"),ve=Symbol("_pos"),we=Symbol("_queue"),Ee=Symbol("_read"),Re=Symbol("_readSize"),Oe=Symbol("_reading"),_e=Symbol("_remain"),Te=Symbol("_size"),De=Symbol("_write"),ke=Symbol("_writing"),Ce=Symbol("_defaultFlag"),Pe=Symbol("_errored");class Me extends te{[Pe]=!1;[oe];[be];[Re];[Oe]=!1;[Te];[_e];[se];constructor(e,t){if(super(t=t||{}),this.readable=!0,this.writable=!1,"string"!=typeof e)throw new TypeError("path must be a string");this[Pe]=!1,this[oe]="number"==typeof t.fd?t.fd:void 0,this[be]=e,this[Re]=t.readSize||16777216,this[Oe]=!1,this[Te]="number"==typeof t.size?t.size:1/0,this[_e]=this[Te],this[se]="boolean"!=typeof t.autoClose||t.autoClose,"number"==typeof this[oe]?this[Ee]():this[Se]()}get fd(){return this[oe]}get path(){return this[be]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Se](){o.open(this[be],"r",((e,t)=>this[fe](e,t)))}[fe](e,t){e?this[pe](e):(this[oe]=t,this.emit("open",t),this[Ee]())}[le](){return Buffer.allocUnsafe(Math.min(this[Re],this[_e]))}[Ee](){if(!this[Oe]){this[Oe]=!0;const e=this[le]();if(0===e.length)return process.nextTick((()=>this[ye](null,0,e)));o.read(this[oe],e,0,e.length,null,((e,t,i)=>this[ye](e,t,i)))}}[ye](e,t,i){this[Oe]=!1,e?this[pe](e):this[de](t,i)&&this[Ee]()}[re](){if(this[se]&&"number"==typeof this[oe]){const e=this[oe];this[oe]=void 0,o.close(e,(e=>e?this.emit("error",e):this.emit("close")))}}[pe](e){this[Oe]=!0,this[re](),this.emit("error",e)}[de](e,t){let i=!1;return this[_e]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(0===e||this[_e]<=0)&&(i=!1,this[re](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return"number"==typeof this[oe]&&this[Ee](),!1;case"error":return!this[Pe]&&(this[Pe]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}}class xe extends Me{[Se](){let e=!0;try{this[fe](null,o.openSync(this[be],"r")),e=!1}finally{e&&this[re]()}}[Ee](){let e=!0;try{if(!this[Oe]){for(this[Oe]=!0;;){const e=this[le](),t=0===e.length?0:o.readSync(this[oe],e,0,e.length,null);if(!this[de](t,e))break}this[Oe]=!1}e=!1}finally{e&&this[re]()}}[re](){if(this[se]&&"number"==typeof this[oe]){const e=this[oe];this[oe]=void 0,o.closeSync(e),this.emit("close")}}}class Ie extends u{readable=!1;writable=!0;[Pe]=!1;[ke]=!1;[ne]=!1;[we]=[];[me]=!1;[be];[ue];[se];[oe];[Ce];[he];[ae]=!1;[ve];constructor(e,t){super(t=t||{}),this[be]=e,this[oe]="number"==typeof t.fd?t.fd:void 0,this[ue]=void 0===t.mode?438:t.mode,this[ve]="number"==typeof t.start?t.start:void 0,this[se]="boolean"!=typeof t.autoClose||t.autoClose;const i=void 0!==this[ve]?"r+":"w";this[Ce]=void 0===t.flags,this[he]=void 0===t.flags?i:t.flags,void 0===this[oe]&&this[Se]()}emit(e,...t){if("error"===e){if(this[Pe])return!1;this[Pe]=!0}return super.emit(e,...t)}get fd(){return this[oe]}get path(){return this[be]}[pe](e){this[re](),this[ke]=!0,this.emit("error",e)}[Se](){o.open(this[be],this[he],this[ue],((e,t)=>this[fe](e,t)))}[fe](e,t){this[Ce]&&"r+"===this[he]&&e&&"ENOENT"===e.code?(this[he]="w",this[Se]()):e?this[pe](e):(this[oe]=t,this.emit("open",t),this[ke]||this[ce]())}end(e,t){return e&&this.write(e,t),this[ne]=!0,this[ke]||this[we].length||"number"!=typeof this[oe]||this[ge](null,0),this}write(e,t){return"string"==typeof e&&(e=Buffer.from(e,t)),this[ne]?(this.emit("error",new Error("write() after end()")),!1):void 0===this[oe]||this[ke]||this[we].length?(this[we].push(e),this[me]=!0,!1):(this[ke]=!0,this[De](e),!0)}[De](e){o.write(this[oe],e,0,e.length,this[ve],((e,t)=>this[ge](e,t)))}[ge](e,t){e?this[pe](e):(void 0!==this[ve]&&"number"==typeof t&&(this[ve]+=t),this[we].length?this[ce]():(this[ke]=!1,this[ne]&&!this[ae]?(this[ae]=!0,this[re](),this.emit("finish")):this[me]&&(this[me]=!1,this.emit("drain"))))}[ce](){if(0===this[we].length)this[ne]&&this[ge](null,0);else if(1===this[we].length)this[De](this[we].pop());else{const e=this[we];this[we]=[],ie(this[oe],e,this[ve],((e,t)=>this[ge](e,t)))}}[re](){if(this[se]&&"number"==typeof this[oe]){const e=this[oe];this[oe]=void 0,o.close(e,(e=>e?this.emit("error",e):this.emit("close")))}}}class Ae extends Ie{[Se](){let e;if(this[Ce]&&"r+"===this[he])try{e=o.openSync(this[be],this[he],this[ue])}catch(e){if("ENOENT"===e?.code)return this[he]="w",this[Se]();throw e}else e=o.openSync(this[be],this[he],this[ue]);this[fe](null,e)}[re](){if(this[se]&&"number"==typeof this[oe]){const e=this[oe];this[oe]=void 0,o.closeSync(e),this.emit("close")}}[De](e){let t=!0;try{this[ge](null,o.writeSync(this[oe],e,0,e.length,this[ve])),t=!1}finally{if(t)try{this[re]()}catch{}}}}const Le=require("node:path"),Ne=require("node:fs"),Fe=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),Be=e=>{const t=Fe.get(e);return t||e},Ue=(e={})=>{if(!e)return{};const t={};for(const[i,s]of Object.entries(e)){t[Be(i)]=s}return void 0===t.chmod&&!1===t.noChmod&&(t.chmod=!0),delete t.noChmod,t},je=(e,t,i,s,r)=>Object.assign(((n=[],o,a)=>{Array.isArray(n)&&(o=n,n={}),"function"==typeof o&&(a=o,o=void 0),o=o?Array.from(o):[];const h=Ue(n);if(r?.(h,o),(c=h).sync&&c.file){if("function"==typeof a)throw new TypeError("callback not supported for sync tar functions");return e(h,o)}if((e=>!e.sync&&!!e.file)(h)){const e=t(h,o),i=a||void 0;return i?e.then((()=>i()),i):e}if((e=>!!e.sync&&!e.file)(h)){if("function"==typeof a)throw new TypeError("callback not supported for sync tar functions");return i(h,o)}if((e=>!e.sync&&!e.file)(h)){if("function"==typeof a)throw new TypeError("callback only supported with file option");return s(h,o)}throw new Error("impossible options??");var c}),{syncFile:e,asyncFile:t,syncNoFile:i,asyncNoFile:s,validate:r}),ze=require("assert"),Ve=require("buffer"),He=require("zlib"),Ge=He.constants||{ZLIB_VERNUM:4736},qe=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Ge)),Ze=Ve.Buffer.concat,$e=Symbol("_superWrite");class Ye extends Error{code;errno;constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const We=Symbol("flushFlag");class Ke extends te{#e=!1;#t=!1;#i;#s;#r;#n;#o;get sawError(){return this.#e}get handle(){return this.#n}get flushFlag(){return this.#i}constructor(e,t){if(!e||"object"!=typeof e)throw new TypeError("invalid options for ZlibBase constructor");super(e),this.#i=e.flush??0,this.#s=e.finishFlush??0,this.#r=e.fullFlushFlag??0;try{this.#n=new He[t](e)}catch(e){throw new Ye(e)}this.#o=e=>{this.#e||(this.#e=!0,this.close(),this.emit("error",e))},this.#n?.on("error",(e=>this.#o(new Ye(e)))),this.once("end",(()=>this.close))}close(){this.#n&&(this.#n.close(),this.#n=void 0,this.emit("close"))}reset(){if(!this.#e)return ze(this.#n,"zlib binding closed"),this.#n.reset?.()}flush(e){this.ended||("number"!=typeof e&&(e=this.#r),this.write(Object.assign(Ve.Buffer.alloc(0),{[We]:e})))}end(e,t,i){return"function"==typeof e&&(i=e,t=void 0,e=void 0),"function"==typeof t&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#s),this.#t=!0,super.end(i)}get ended(){return this.#t}[$e](e){return super.write(e)}write(e,t,i){if("function"==typeof t&&(i=t,t="utf8"),"string"==typeof e&&(e=Ve.Buffer.from(e,t)),this.#e)return;ze(this.#n,"zlib binding closed");const s=this.#n._handle,r=s.close;s.close=()=>{};const n=this.#n.close;let o,a;this.#n.close=()=>{},Ve.Buffer.concat=e=>e;try{const t="number"==typeof e[We]?e[We]:this.#i;o=this.#n._processChunk(e,t),Ve.Buffer.concat=Ze}catch(e){Ve.Buffer.concat=Ze,this.#o(new Ye(e))}finally{this.#n&&(this.#n._handle=s,s.close=r,this.#n.close=n,this.#n.removeAllListeners("error"))}if(this.#n&&this.#n.on("error",(e=>this.#o(new Ye(e)))),o)if(Array.isArray(o)&&o.length>0){const e=o[0];a=this[$e](Ve.Buffer.from(e));for(let e=1;e<o.length;e++)a=this[$e](o[e])}else a=this[$e](Ve.Buffer.from(o));return i&&i(),a}}class Xe extends Ke{#a;#h;constructor(e,t){(e=e||{}).flush=e.flush||qe.Z_NO_FLUSH,e.finishFlush=e.finishFlush||qe.Z_FINISH,e.fullFlushFlag=qe.Z_FULL_FLUSH,super(e,t),this.#a=e.level,this.#h=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#a!==e||this.#h!==t){this.flush(qe.Z_SYNC_FLUSH),ze(this.handle,"zlib binding closed");const i=this.handle.flush;this.handle.flush=(e,t)=>{"function"==typeof e&&(t=e,e=this.flushFlag),this.flush(e),t?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#a=e,this.#h=t)}}}}class Qe extends Xe{#c;constructor(e){super(e,"Gzip"),this.#c=e&&!!e.portable}[$e](e){return this.#c?(this.#c=!1,e[9]=255,super[$e](e)):super[$e](e)}}class Je extends Xe{constructor(e){super(e,"Unzip")}}class et extends Ke{constructor(e,t){(e=e||{}).flush=e.flush||qe.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||qe.BROTLI_OPERATION_FINISH,e.fullFlushFlag=qe.BROTLI_OPERATION_FLUSH,super(e,t)}}class tt extends et{constructor(e){super(e,"BrotliCompress")}}class it extends et{constructor(e){super(e,"BrotliDecompress")}}class st{tail;head;length=0;static create(e=[]){return new st(e)}constructor(e=[]){for(const t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");const t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);const t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);const t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let t=0,i=e.length;t<i;t++)nt(this,e[t]);return this.length}unshift(...e){for(var t=0,i=e.length;t<i;t++)ot(this,e[t]);return this.length}pop(){if(!this.tail)return;const e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;const e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let i=this.head,s=0;i;s++)e.call(t,i.value,s,this),i=i.next}forEachReverse(e,t){t=t||thi