;/*FB_PKG_DELIM*/ __d("WASmaxInBlocklistsGetOptOutListResponseInternalServerError",["WAResultOrError","WASmaxInBlocklistsIQErrorResponseMixin","WASmaxInBlocklistsServerErrors","WASmaxParseUtils"],(function(t,n,r,o,a,i,l){function e(e,t){var n=o("WASmaxParseUtils").assertTag(e,"iq");if(!n.success)return n;var r=o("WASmaxParseUtils").flattenedChildWithTag(e,"error");if(!r.success)return r;var a=o("WASmaxInBlocklistsIQErrorResponseMixin").parseIQErrorResponseMixin(e,t);if(!a.success)return a;var i=o("WASmaxInBlocklistsServerErrors").parseServerErrors(r.value);return i.success?o("WAResultOrError").makeResult(babelHelpers.extends({},a.value,{errorServerErrors:i.value})):i}l.parseGetOptOutListResponseInternalServerError=e}),98); __d("WASmaxInBlocklistsGetOptOutListResponseInvalidRequest",["WAResultOrError","WASmaxInBlocklistsGetBlocklistErrors","WASmaxInBlocklistsIQErrorResponseMixin","WASmaxParseUtils"],(function(t,n,r,o,a,i,l){function e(e,t){var n=o("WASmaxParseUtils").assertTag(e,"iq");if(!n.success)return n;var r=o("WASmaxParseUtils").flattenedChildWithTag(e,"error");if(!r.success)return r;var a=o("WASmaxInBlocklistsIQErrorResponseMixin").parseIQErrorResponseMixin(e,t);if(!a.success)return a;var i=o("WASmaxInBlocklistsGetBlocklistErrors").parseGetBlocklistErrors(r.value);return i.success?o("WAResultOrError").makeResult(babelHelpers.extends({},a.value,{errorGetBlocklistErrors:i.value})):i}l.parseGetOptOutListResponseInvalidRequest=e}),98); __d("WASmaxInBlocklistsGetOptOutListResponseSuccessWithMatch",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(t,n,r,o,a,i,l){function e(e,t){var n=o("WASmaxParseUtils").assertTag(e,"iq");if(!n.success)return n;var r=o("WASmaxParseReference").attrStringFromReference(t,["to"]);if(!r.success)return r;var a=o("WASmaxParseUtils").literal(o("WASmaxParseUtils").attrString,e,"from",r.value);if(!a.success)return a;var i=o("WASmaxParseUtils").literal(o("WASmaxParseUtils").attrString,e,"type","result");if(!i.success)return i;var l=o("WASmaxParseReference").optionalAttrStringFromReference(t,["category"]);if(!l.success)return l;var s=o("WASmaxParseUtils").optionalLiteral(o("WASmaxParseUtils").attrString,e,"category",l.value);if(!s.success)return s;var u=o("WASmaxParseReference").attrStringFromReference(t,["id"]);if(!u.success)return u;var c=o("WASmaxParseUtils").literal(o("WASmaxParseUtils").attrString,e,"id",u.value);return c.success?o("WAResultOrError").makeResult({type:i.value,hasCategory:s.value!=null}):c}l.parseGetOptOutListResponseSuccessWithMatch=e}),98); __d("WASmaxInBlocklistsBizOptOutBrandIDMixin",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=o("WASmaxParseUtils").attrString(e,"biz_opt_out_brand_id");if(!t.success)return t;var n=o("WASmaxParseUtils").optional(o("WASmaxParseJid").attrUserJid,e,"biz_jid");return n.success?o("WAResultOrError").makeResult({bizOptOutBrandId:t.value,bizJid:n.value}):n}l.parseBizOptOutBrandIDMixin=e}),98); __d("WASmaxInBlocklistsBizOptOutJidMixin",["WAResultOrError","WASmaxParseJid"],(function(t,n,r,o,a,i,l){function e(e){var t=o("WASmaxParseJid").attrUserJid(e,"biz_opt_out_jid");return t.success?o("WAResultOrError").makeResult({bizOptOutJid:t.value}):t}l.parseBizOptOutJidMixin=e}),98); __d("WASmaxInBlocklistsBizOptOutIds",["WAResultOrError","WASmaxInBlocklistsBizOptOutBrandIDMixin","WASmaxInBlocklistsBizOptOutJidMixin","WASmaxParseUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=o("WASmaxInBlocklistsBizOptOutBrandIDMixin").parseBizOptOutBrandIDMixin(e);if(t.success)return o("WAResultOrError").makeResult({name:"BizOptOutBrandID",value:t.value});var n=o("WASmaxInBlocklistsBizOptOutJidMixin").parseBizOptOutJidMixin(e);return n.success?o("WAResultOrError").makeResult({name:"BizOptOutJid",value:n.value}):o("WASmaxParseUtils").errorMixinDisjunction(e,["BizOptOutBrandID","BizOptOutJid"],[t,n])}l.parseBizOptOutIds=e}),98); __d("WASmaxInBlocklistsBizOptOutResponseMixin",["WAResultOrError","WASmaxInBlocklistsBizOptOutIds","WASmaxParseUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=o("WASmaxParseUtils").optional(o("WASmaxParseUtils").attrString,e,"action");if(!t.success)return t;var n=o("WASmaxParseUtils").optional(o("WASmaxParseUtils").attrString,e,"category");if(!n.success)return n;var r=o("WASmaxInBlocklistsBizOptOutIds").parseBizOptOutIds(e);return r.success?o("WAResultOrError").makeResult({action:t.value,category:n.value,bizOptOutIds:r.value}):r}l.parseBizOptOutResponseMixin=e}),98); __d("WASmaxInBlocklistsGetOptOutListResponseSuccessWithMismatch",["WAResultOrError","WASmaxInBlocklistsBizOptOutResponseMixin","WASmaxParseReference","WASmaxParseUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=o("WASmaxParseUtils").assertTag(e,"item");if(!t.success)return t;var n=o("WASmaxInBlocklistsBizOptOutResponseMixin").parseBizOptOutResponseMixin(e);return n.success,n}function s(t,n){var r=o("WASmaxParseUtils").assertTag(t,"iq");if(!r.success)return r;var a=o("WASmaxParseUtils").flattenedChildWithTag(t,"list");if(!a.success)return a;var i=o("WASmaxParseReference").attrStringFromReference(n,["to"]);if(!i.success)return i;var l=o("WASmaxParseUtils").literal(o("WASmaxParseUtils").attrString,t,"from",i.value);if(!l.success)return l;var s=o("WASmaxParseUtils").literal(o("WASmaxParseUtils").attrString,t,"type","result");if(!s.success)return s;var u=o("WASmaxParseReference").attrStringFromReference(n,["id"]);if(!u.success)return u;var c=o("WASmaxParseUtils").literal(o("WASmaxParseUtils").attrString,t,"id",u.value);if(!c.success)return c;var d=o("WASmaxParseUtils").optional(o("WASmaxParseUtils").attrString,a.value,"dhash");if(!d.success)return d;var m=o("WASmaxParseUtils").mapChildrenWithTag(a.value,"item",0,64e3,e);return m.success?o("WAResultOrError").makeResult({type:s.value,listDhash:d.value,listItem:m.value}):m}l.parseGetOptOutListResponseSuccessWithMismatchListItem=e,l.parseGetOptOutListResponseSuccessWithMismatch=s}),98); __d("WASmaxOutBlocklistsGetOptOutListRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WAWap"],(function(t,n,r,o,a,i,l){function e(e){var t=e.itemDhash,n=o("WASmaxJsx").smax("item",{dhash:o("WAWap").CUSTOM_STRING(t)});return n}function s(t){var n=t.itemArgs,r=t.iqCategory,a=o("WASmaxJsx").smax("iq",{to:o("WAWap").S_WHATSAPP_NET,xmlns:"optoutlist",type:"get",category:o("WASmaxAttrs").OPTIONAL(o("WAWap").CUSTOM_STRING,r),id:o("WAWap").generateId()},o("WASmaxChildren").OPTIONAL_CHILD(e,n));return a}l.makeGetOptOutListRequestItem=e,l.makeGetOptOutListRequest=s}),98); __d("WASmaxBlocklistsGetOptOutListRPC",["WAComms","WASmaxInBlocklistsGetOptOutListResponseInternalServerError","WASmaxInBlocklistsGetOptOutListResponseInvalidRequest","WASmaxInBlocklistsGetOptOutListResponseSuccessWithMatch","WASmaxInBlocklistsGetOptOutListResponseSuccessWithMismatch","WASmaxOutBlocklistsGetOptOutListRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WASmaxOutBlocklistsGetOptOutListRequest").makeGetOptOutListRequest(e),r=yield o("WAComms").sendSmaxStanza(n,t),a=o("WASmaxInBlocklistsGetOptOutListResponseSuccessWithMismatch").parseGetOptOutListResponseSuccessWithMismatch(r,n);if(a.success)return{name:"GetOptOutListResponseSuccessWithMismatch",value:a.value};var i=o("WASmaxInBlocklistsGetOptOutListResponseSuccessWithMatch").parseGetOptOutListResponseSuccessWithMatch(r,n);if(i.success)return{name:"GetOptOutListResponseSuccessWithMatch",value:i.value};var l=o("WASmaxInBlocklistsGetOptOutListResponseInvalidRequest").parseGetOptOutListResponseInvalidRequest(r,n);if(l.success)return{name:"GetOptOutListResponseInvalidRequest",value:l.value};var s=o("WASmaxInBlocklistsGetOptOutListResponseInternalServerError").parseGetOptOutListResponseInternalServerError(r,n);if(s.success)return{name:"GetOptOutListResponseInternalServerError",value:s.value};throw new(o("WASmaxParsingFailure")).SmaxParsingFailure(o("WASmaxRpcUtils").errorMessageRpcParsing("GetOptOutList",{SuccessWithMismatch:a,SuccessWithMatch:i,InvalidRequest:l,InternalServerError:s}))}),s.apply(this,arguments)}l.sendGetOptOutListRPC=e}),98); __d("WAWebApiOptOutList",["Promise","WAWebBoolFunc","WAWebModelStorageUtils","WAWebSchemaOptOutList","WAWebWidFactory"],(function(t,n,r,o,a,i,l){var e;function s(){return o("WAWebSchemaOptOutList").getOptOutListTable().all().then(function(e){var t=e.map(function(e){return o("WAWebWidFactory").createUserWidOrThrow(e.id)});return t})}function u(t){if(!t)return(e||(e=n("Promise"))).resolve(!1);var r=t.map(function(e){return{id:e.toString()}});return o("WAWebModelStorageUtils").getStorage().lock(["optoutlist"],function(e){var t=e[0];return t.clear().then(function(){return t.bulkCreate(r).then(o("WAWebBoolFunc").returnTrue)})})}l.getOptOutList=s,l.updateOptOutList=u}),98); __d("WAWebGetNumbersForBrandIdsJobQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XWAGetPhoneNumbersForBrandIdsResponse",kind:"LinkedField",name:"xwa_get_numbers_for_brand_ids",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAWhatsAppBrandIdData",kind:"LinkedField",name:"brand_ids_data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"brand_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"phone_numbers",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lids",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebGetNumbersForBrandIdsJobQuery",selections:t,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebGetNumbersForBrandIdsJobQuery",selections:t},params:{id:"33391034967211217",metadata:{},name:"WAWebGetNumbersForBrandIdsJobQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebGetNumbersForBrandIdsJob",["WALogger","WAWebGetNumbersForBrandIdsJobQuery.graphql","WAWebGraphQLConstants","WAWebGraphQLServerError","WAWebMarketingMessagesUserFeedbackGatingUtils","WAWebNetworkStatus","WAWebRelayClient","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c=e!==void 0?e:e=n("WAWebGetNumbersForBrandIdsJobQuery.graphql"),d={type:"error"};function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield r("WAWebNetworkStatus").waitIfOffline();var t={input:{brand_ids:e,lid_based_response:o("WAWebMarketingMessagesUserFeedbackGatingUtils").isMMOptOutAlwaysUseLidInGraphQLEnabled()}};try{var n,a=yield o("WAWebRelayClient").fetchQuery(c,t,{accessToken:o("WAWebGraphQLConstants").WHATSAPP_GRAPHQL_WWW_ACCESS_TOKEN,environmentType:"whatsapp_www"}),i=[];return a==null||(n=a.xwa_get_numbers_for_brand_ids)==null||n.brand_ids_data.forEach(function(e){var t=e.brand_id,n=e.error,r=e.phone_numbers,a=e.lids;t!=null&&n==null&&i.push({brandId:t,lids:a.map(function(e){return o("WAWebWidFactory").createUserLidOrThrow(e,"lid")}),phoneNumbers:r})}),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["getNumbersForBrandIdsJob: success"]))),{type:"success",value:i}}catch(e){return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getNumbersForBrandIdsJob: failed with error"]))),e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:d}}),p.apply(this,arguments)}l.getNumbersForBrandIdsJob=m}),98); __d("WAWebGetOptOutList",["WASmaxBlocklistsGetOptOutListRPC","WAWebGetNumbersForBrandIdsJob","WAWebJidToWid","WAWebMarketingMessagesUserFeedbackGatingUtils","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebUserPrefsMultiDevice").getOptOutListHash(),n={itemArgs:t!=null?{itemDhash:t}:void 0,iqCategory:e},r=yield o("WASmaxBlocklistsGetOptOutListRPC").sendGetOptOutListRPC(n);switch(r.name){case"GetOptOutListResponseSuccessWithMatch":{var a={wids:[]};return a}case"GetOptOutListResponseSuccessWithMismatch":{var i={wids:[]},l=r.value.listDhash,s=r.value.listItem;l!=null&&(i.dhash=l);var u=[],c={};if(s.forEach(function(e){if(e.bizOptOutIds.name==="BizOptOutJid"){var t=o("WAWebJidToWid").userJidToUserWid(e.bizOptOutIds.value.bizOptOutJid);i.wids.push({wid:t,category:e.category})}else if(e.bizOptOutIds.name==="BizOptOutBrandID"){var n=e.bizOptOutIds.value.bizOptOutBrandId;u.push(n),c[n]=e.category}}),u.length>0){var d=yield o("WAWebGetNumbersForBrandIdsJob").getNumbersForBrandIdsJob(u);d.type==="success"&&d.value.forEach(function(e){var t=e.brandId,n=e.lids,r=e.phoneNumbers;o("WAWebMarketingMessagesUserFeedbackGatingUtils").isMMOptOutAlwaysUseLidInGraphQLEnabled()&&(n==null||n.forEach(function(e){i.wids.push({wid:e,category:c[t]})})),r.forEach(function(e){var n=o("WAWebWidFactory").createUserWidOrThrow(e);i.wids.push({wid:n,category:c[t]})})})}return i}case"GetOptOutListResponseInvalidRequest":{var m=r.value.errorGetBlocklistErrors.value,p=m.code,_=m.text;return{errorCode:Number(p),errorText:_}}case"GetOptOutListResponseInternalServerError":{var f=r.value.errorServerErrors.value,g=f.code,h=f.text;return{errorCode:Number(g),errorText:h}}}}),s.apply(this,arguments)}l.getOptOutList=e}),98); __d("WAWebQueryOptOutListJob",["WALogger","WAWebApiOptOutList","WAWebGetOptOutList","WAWebUpdateLidMetadataJob","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e,s,u;function c(){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[OptOutUserJob] fetch optoutlist using optoutlist"])));var t=yield o("WAWebGetOptOutList").getOptOutList();if(t.errorCode!=null)return t;if(t.dhash!=null&&t.dhash!==""){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[OptOutUserJob] updating optoutlist with "," contact(s)"])),t.wids.length||0),yield o("WAWebUserPrefsMultiDevice").setOptOutlistHash(t.dhash),yield o("WAWebApiOptOutList").updateOptOutList(t.wids.map(function(e){return e.wid}));var n=r("compactMap")(t.wids,function(e){var t=e.wid;if(!t.isLid())return null;var n={};return{lid:t,data:n}});yield o("WAWebUpdateLidMetadataJob").updateLidMetadataJob(n)}else o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[OptOutUserJob] no change in optoutlist, skip update"])));return t}),d.apply(this,arguments)}l.fetchAndUpdateOptOutList=c}),98); __d("WAWebOptOutSyncJob",["WAWebMarketingMessagesUserFeedbackGatingUtils","WAWebQueryOptOutListJob","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!(!o("WAWebMarketingMessagesUserFeedbackGatingUtils").isMMOptOutEnabled()||!o("WAWebMarketingMessagesUserFeedbackGatingUtils").isMMOptOutListServerSyncEnabled())){var e=yield o("WAWebQueryOptOutListJob").fetchAndUpdateOptOutList();e.dhash!=null&&e.dhash!==""&&o("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("updateOptOutListCollection",{wids:e.wids})}}),s.apply(this,arguments)}l.updateOptOutList=e}),98);