"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkXD2OIZABjs = require('./chunk-XD2OIZAB.js');var b={};_chunkXD2OIZABjs.b.call(void 0, b,{default:()=>R});var g,R,h=_chunkXD2OIZABjs.a.call(void 0, ()=>{"use strict";g=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n=[{kind:"Variable",name:"input",variableName:"input"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},a={alias:null,args:null,concreteType:"ErrorType",kind:"LinkedField",name:"errors",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"field",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"messages",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"UnreadChatMutation",selections:[{alias:null,args:n,concreteType:"ChatRoomUnreadPayload",kind:"LinkedField",name:"chatRoomUnread",plural:!1,selections:[{alias:null,args:null,concreteType:"ChatRoom",kind:"LinkedField",name:"room",plural:!1,selections:[t,{args:null,kind:"FragmentSpread",name:"UnreadMessagesCountFragment"}],storageKey:null},a],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"UnreadChatMutation",selections:[{alias:null,args:n,concreteType:"ChatRoomUnreadPayload",kind:"LinkedField",name:"chatRoomUnread",plural:!1,selections:[{alias:null,args:null,concreteType:"ChatRoom",kind:"LinkedField",name:"room",plural:!1,selections:[t,{alias:null,args:null,concreteType:"UnreadMessageCount",kind:"LinkedField",name:"unreadMessages",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"markedUnread",storageKey:null},t],storageKey:null}],storageKey:null},a],storageKey:null}]},params:{cacheID:"b5c9682f04c174e181c522db06feb0a5",id:null,metadata:{},name:"UnreadChatMutation",operationKind:"mutation",text:`mutation UnreadChatMutation(
  $input: ChatRoomUnreadInput!
) {
  chatRoomUnread(input: $input) {
    room {
      id
      ...UnreadMessagesCountFragment
    }
    errors {
      field
      messages
    }
  }
}

fragment UnreadMessagesCountFragment on ChatRoom {
  id
  unreadMessages {
    count
    markedUnread
    id
  }
}
`}}}();g.hash="fb95629ed4c89ffb9689a72b91d6cefa";R=g});var _utils = require('@baseapp-frontend/utils');var _reactrelay = require('react-relay');function c(e){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},c(e)}var i;function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,a)}return t}function C(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?v(Object(t),!0).forEach(function(a){F(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}function F(e,n,t){return(n=j(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function j(e){var n=_(e,"string");return c(n)=="symbol"?n:n+""}function _(e,n){if(c(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var a=t.call(e,n||"default");if(c(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function P(e,n){return A(e)||w(e,n)||K(e,n)||T()}function T(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K(e,n){if(e){if(typeof e=="string")return U(e,n);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?U(e,n):void 0}}function U(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,a=Array(n);t<n;t++)a[t]=e[t];return a}function w(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var a,l,m,u,s=[],d=!0,r=!1;try{if(m=(t=t.call(e)).next,n===0){if(Object(t)!==t)return;d=!1}else for(;!(d=(a=m.call(t)).done)&&(s.push(a.value),s.length!==n);d=!0);}catch(y){r=!0,l=y}finally{try{if(!d&&t.return!=null&&(u=t.return(),Object(u)!==u))return}finally{if(r)throw l}}return s}}function A(e){if(Array.isArray(e))return e}var E=(i!==void 0||(i=(h(),_chunkXD2OIZABjs.c.call(void 0, b)),i.hash&&i.hash!=="fb95629ed4c89ffb9689a72b91d6cefa"&&console.error("The definition of 'UnreadChatMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),i),q= exports.b =function(){var n=_utils.useNotification.call(void 0, ),t=n.sendToast,a=_reactrelay.useMutation.call(void 0, E),l=P(a,2),m=l[0],u=l[1],s=function(r){return m(C(C({},r),{},{onCompleted:function(p,o){var f;_optionalChain([o, 'optionalAccess', _2 => _2.forEach, 'call', _3 => _3(function(M){t(M.message,{type:"error"})})]),r==null||(f=r.onCompleted)===null||f===void 0||f.call(r,p,o)},onError:function(p){var o;t(p.message,{type:"error"}),r==null||(o=r.onError)===null||o===void 0||o.call(r,p)}}))};return[s,u]};exports.a = E; exports.b = q;
//# sourceMappingURL=chunk-GQRQITT5.js.map