PageSourceSearch

https://events.marketecturelive.com/static/react-webcam-3uhCilC2.js

js marketecturelive.com collected 2026-09-28 11:53:45 UTC 6,740 bytes, 1 lines download raw bytes

1import{h as E,g as P}from"./vendor-react-nj2ukvvY.js";function C(M,O){for(var y=0;y<O.length;y++){const m=O[y];if(typeof m!="string"&&!Array.isArray(m)){for(const d in m)if(d!=="default"&&!(d in M)){const a=Object.getOwnPropertyDescriptor(m,d);a&&Object.defineProperty(M,d,a.get?a:{enumerable:!0,get:()=>m[d]})}}}return Object.freeze(Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}))}var U={exports:{}},W=U.exports,_;function D(){return _||(_=1,(function(M,O){(function(m,d){M.exports=d(E())})(W,function(y){return(function(m){var d={};function a(i){if(d[i])return d[i].exports;var s=d[i]={i,l:!1,exports:{}};return m[i].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=m,a.c=d,a.d=function(i,s,p){a.o(i,s)||Object.defineProperty(i,s,{enumerable:!0,get:p})},a.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},a.t=function(i,s){if(s&1&&(i=a(i)),s&8||s&4&&typeof i=="object"&&i&&i.__esModule)return i;var p=Object.create(null);if(a.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:i}),s&2&&typeof i!="string")for(var b in i)a.d(p,b,(function(S){return i[S]}).bind(null,b));return p},a.n=function(i){var s=i&&i.__esModule?(function(){return i.default}):(function(){return i});return a.d(s,"a",s),s},a.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},a.p="",a(a.s="./src/react-webcam.tsx")})({
1"./src/react-webcam.tsx":(function(m,d,a){a.r(d);var i=a("react"),s=(function(){var u=function(n,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)r.hasOwnProperty(o)&&(e[o]=r[o])},u(n,t)};return function(n,t){u(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),p=function(){return p=Object.assign||function(u){for(var n,t=1,e=arguments.length;t<e;t++){n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(u[r]=n[r])}return u},p.apply(this,arguments)},b=function(u,n){var t={};for(var e in u)Object.prototype.hasOwnProperty.call(u,e)&&n.indexOf(e)<0&&(t[e]=u[e]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(u);r<e.length;r++)n.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(u,e[r])&&(t[e[r]]=u[e[r]]);return t};function S(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)}var j=(function(u){s(n,u);function n(t){var e=u.call(this,t)||this;return e.ctx=null,e.state={hasUserMedia:!1},e}return n.prototype.componentDidMount=function(){if(S()){var t=this.state;n.mountedInstances.push(this),!t.hasUserMedia&&!n.userMediaRequested&&this.requestUserMedia()}},n.prototype.componentDidUpdate=function(t){var e=this.props;(JSON.stringify(t.audioConstraints)!==JSON.stringify(e.audioConstraints)||JSON.stringify(t.videoConstraints)!==JSON.stringify(e.videoConstraints))&&this.requestUserMedia()},n.prototype.componentWillUnmount=function(){var t=this.state,e=n.mountedInstances.indexOf(this);n.mountedInstances.splice(e,1),n.userMediaRequested=!1,n.mountedInstances.length===0&&t.hasUserMedia&&(this.stream.getVideoTracks&&this.stream.getAudioTracks?(this.stream.getVideoTracks().map(function(r){return r.stop()}),this.stream.getAudioTracks().map(function(r){return r.stop()})):this.stream.stop(),t.src&&window.URL.revokeObjectURL(t.src))},n.prototype.getScreenshot=function(){var t=this,e=t.state,r=t.props;if(!e.hasUserMedia)return null;var o=this.getCanvas();return o&&o.toDataURL(r.screenshotFormat,r.screenshotQuality)},n.prototype.getCanvas=function(){var t=this,e=t.state,r=t.props;if(!this.video||!e.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var o=document.createElement("canvas"),l=this.video.videoWidth/this.video.videoHeight,c=r.minScreenshotWidth||this.video.clientWidth,h=c/l;r.minScreenshotHeight&&h<r.minScreenshotHeight&&(h=r.minScreenshotHeight,c=h*l),o.width=c,o.height=h,this.canvas=o,this.ctx=o.getContext("2d")}var v=this,f=v.ctx,g=v.canvas;return f&&(r.mirrored?(f.translate(g.width,0),f.scale(-1,1)):(f.translate(0,0),f.scale(1,1)),f.imageSmoothingEnabled=r.imageSmoothing,f.drawImage(this.video,0,0,g.width,g.height)),g},n.prototype.requestUserMedia=function(){var t=this.props;navigator.getUserMedia=navigator.mediaDevices.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var e=function(l,c){var h={video:typeof c<"u"?c:!0};t.audio&&(h.audio=typeof l<"u"?l:!0),navigator.mediaDevices.getUserMedia(h).then(function(v){n.mountedInstances.forEach(function(f){return f.handleUserMedia(null,v)})}).catch(function(v){n.mountedInstances.forEach(function(f){return f.handleUserMedia(v)})})};if("mediaDevices"in navigator)e(t.audioConstraints,t.videoConstraints);else{var r=function(l){return{optional:[{sourceId:l}]}},o=function(l){var c=l.deviceId;return typeof c=="string"?c:Array.isArray(c)&&c.length>0?c[0]:typeof c=="object"&&c.ideal?c.ideal:null};MediaStreamTrack.getSources(function(l){var c=null,h=null;l.forEach(function(g){g.kind==="audio"?c=g.id:g.kind==="video"&&(h=g.id)});var v=o(t.audioConstraints);v&&(c=v);var f=o(t.videoConstraints);f&&(h=f),e(r(c),r(h))})}n.userMediaRequested=!0},n.prototype.handleUserMedia=function(t,e){var r=this.props;if(t||!e){this.setState({hasUserMedia:!1}),r.onUserMediaError(t);return}this.stream=e;try{this.video&&(this.video.srcObject=e),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(e)})}r.onUserMedia()},n.prototype.render=function(){var t=this,e=this,r=e.state,o=e.props,l=o.audio;o.onUserMedia,o.onUserMediaError,o.screenshotFormat,o.screenshotQuality,o.minScreenshotWidth,o.minScreenshotHeight,o.audioConstraints,o.videoConstraints,o.imageSmoothing;var c=o.mirrored,h=o.style,v=h===void 0?{}:h,f=b(o,["audio","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style"]),g=c?p(p({},v),{transform:(v.transform||"")+" scaleX(-1)"}):v;return i.createElement("video",p({autoPlay:!0,src:r.src,muted:l,playsInl
1ine:!0,ref:function(w){t.video=w},style:g},f))},n.defaultProps={audio:!0,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},n.mountedInstances=[],n.userMediaRequested=!1,n})(i.Component);d.default=j})
1,react:(function(m,d){m.exports=y})}).default})})(U)),U.exports}var x=D();const R=P(x),k=C({__proto__:null,default:R},[x]);export{R as W,k as r};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.