{"ast":null,"code":"import _slicedToArray from \"C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray\";\n\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled(_ref) {\n  var controlled = _ref.controlled,\n      defaultProp = _ref.default,\n      name = _ref.name,\n      _ref$state = _ref.state,\n      state = _ref$state === void 0 ? 'value' : _ref$state;\n\n  // isControlled is ignored in the hook dependency lists as it should never change.\n  var _React$useRef = React.useRef(controlled !== undefined),\n      isControlled = _React$useRef.current;\n\n  var _React$useState = React.useState(defaultProp),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      valueState = _React$useState2[0],\n      setValue = _React$useState2[1];\n\n  var value = isControlled ? controlled : valueState;\n\n  if (process.env.NODE_ENV !== 'production') {\n    React.useEffect(function () {\n      if (isControlled !== (controlled !== undefined)) {\n        console.error([\"Material-UI: A component is changing the \".concat(isControlled ? '' : 'un', \"controlled \").concat(state, \" state of \").concat(name, \" to be \").concat(isControlled ? 'un' : '', \"controlled.\"), 'Elements should not switch from uncontrolled to controlled (or vice versa).', \"Decide between using a controlled or uncontrolled \".concat(name, \" \") + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n      }\n    }, [state, name, controlled]);\n\n    var _React$useRef2 = React.useRef(defaultProp),\n        defaultValue = _React$useRef2.current;\n\n    React.useEffect(function () {\n      if (!isControlled && defaultValue !== defaultProp) {\n        console.error([\"Material-UI: A component is changing the default \".concat(state, \" state of an uncontrolled \").concat(name, \" after being initialized. \") + \"To suppress this warning opt to use a controlled \".concat(name, \".\")].join('\\n'));\n      }\n    }, [JSON.stringify(defaultProp)]);\n  }\n\n  var setValueIfUncontrolled = React.useCallback(function (newValue) {\n    if (!isControlled) {\n      setValue(newValue);\n    }\n  }, []);\n  return [value, setValueIfUncontrolled];\n}","map":{"version":3,"sources":["C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/node_modules/@material-ui/data-grid/node_modules/@material-ui/utils/esm/useControlled.js"],"names":["React","useControlled","controlled","defaultProp","default","name","state","useRef","undefined","isControlled","current","useState","valueState","setValue","value","process","env","NODE_ENV","useEffect","console","error","join","defaultValue","JSON","stringify","setValueIfUncontrolled","useCallback","newValue"],"mappings":";;AAAA;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,eAAe,SAASC,aAAT,OAKZ;AAAA,MAJDC,UAIC,QAJDA,UAIC;AAAA,MAHQC,WAGR,QAHDC,OAGC;AAAA,MAFDC,IAEC,QAFDA,IAEC;AAAA,wBADDC,KACC;AAAA,MADDA,KACC,2BADO,OACP;;AACD;AADC,sBAIGN,KAAK,CAACO,MAAN,CAAaL,UAAU,KAAKM,SAA5B,CAJH;AAAA,MAGUC,YAHV,iBAGCC,OAHD;;AAAA,wBAK8BV,KAAK,CAACW,QAAN,CAAeR,WAAf,CAL9B;AAAA;AAAA,MAKMS,UALN;AAAA,MAKkBC,QALlB;;AAMD,MAAMC,KAAK,GAAGL,YAAY,GAAGP,UAAH,GAAgBU,UAA1C;;AAEA,MAAIG,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;AACzCjB,IAAAA,KAAK,CAACkB,SAAN,CAAgB,YAAM;AACpB,UAAIT,YAAY,MAAMP,UAAU,KAAKM,SAArB,CAAhB,EAAiD;AAC/CW,QAAAA,OAAO,CAACC,KAAR,CAAc,oDAA6CX,YAAY,GAAG,EAAH,GAAQ,IAAjE,wBAAmFH,KAAnF,uBAAqGD,IAArG,oBAAmHI,YAAY,GAAG,IAAH,GAAU,EAAzI,kBAA0J,6EAA1J,EAAyO,4DAAqDJ,IAArD,SAA+D,4CAAxS,EAAsV,4HAAtV,EAAod,sDAApd,EAA4gBgB,IAA5gB,CAAihB,IAAjhB,CAAd;AACD;AACF,KAJD,EAIG,CAACf,KAAD,EAAQD,IAAR,EAAcH,UAAd,CAJH;;AADyC,yBAQrCF,KAAK,CAACO,MAAN,CAAaJ,WAAb,CARqC;AAAA,QAO9BmB,YAP8B,kBAOvCZ,OAPuC;;AASzCV,IAAAA,KAAK,CAACkB,SAAN,CAAgB,YAAM;AACpB,UAAI,CAACT,YAAD,IAAiBa,YAAY,KAAKnB,WAAtC,EAAmD;AACjDgB,QAAAA,OAAO,CAACC,KAAR,CAAc,CAAC,2DAAoDd,KAApD,uCAAsFD,IAAtF,6FAA6KA,IAA7K,MAAD,EAAuLgB,IAAvL,CAA4L,IAA5L,CAAd;AACD;AACF,KAJD,EAIG,CAACE,IAAI,CAACC,SAAL,CAAerB,WAAf,CAAD,CAJH;AAKD;;AAED,MAAMsB,sBAAsB,GAAGzB,KAAK,CAAC0B,WAAN,CAAkB,UAAAC,QAAQ,EAAI;AAC3D,QAAI,CAAClB,YAAL,EAAmB;AACjBI,MAAAA,QAAQ,CAACc,QAAD,CAAR;AACD;AACF,GAJ8B,EAI5B,EAJ4B,CAA/B;AAKA,SAAO,CAACb,KAAD,EAAQW,sBAAR,CAAP;AACD","sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n  controlled,\n  default: defaultProp,\n  name,\n  state = 'value'\n}) {\n  // isControlled is ignored in the hook dependency lists as it should never change.\n  const {\n    current: isControlled\n  } = React.useRef(controlled !== undefined);\n  const [valueState, setValue] = React.useState(defaultProp);\n  const value = isControlled ? controlled : valueState;\n\n  if (process.env.NODE_ENV !== 'production') {\n    React.useEffect(() => {\n      if (isControlled !== (controlled !== undefined)) {\n        console.error([`Material-UI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n      }\n    }, [state, name, controlled]);\n    const {\n      current: defaultValue\n    } = React.useRef(defaultProp);\n    React.useEffect(() => {\n      if (!isControlled && defaultValue !== defaultProp) {\n        console.error([`Material-UI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n      }\n    }, [JSON.stringify(defaultProp)]);\n  }\n\n  const setValueIfUncontrolled = React.useCallback(newValue => {\n    if (!isControlled) {\n      setValue(newValue);\n    }\n  }, []);\n  return [value, setValueIfUncontrolled];\n}"]},"metadata":{},"sourceType":"module"}