0iddlmZddlmZddlmZmZ ddlZddlm Z m Z erddlm Z ddlm Z ddl mZdd lmZGd d eZGd de Zy#e$r ed wxYw)) TYPE_CHECKING)add_feature_flag) DidNotEnable IntegrationN)HookMetadata)LDClient)EvaluationSeriesContext)EvaluationDetail)AnyzLaunchDarkly is not installedc(eZdZdZddZedZy)LaunchDarklyIntegration launchdarklyNc |xstj}|j s td|j ty#t$r}tdt |zd}~wwxYw)z :param client: An initialized LDClient instance. If a client is not provided, this integration will attempt to use the shared global instance. z#Error getting LaunchDarkly client. Nz'LaunchDarkly client is not initialized.)ldclientget Exceptionrrepris_initializedadd_hookLaunchDarklyHook)self ld_clientclientexcs S/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/launchdarkly.py__init__z LaunchDarklyIntegration.__init__sm  R0(,,.F$$&HI I (*+ RDtCyPQ Q RsA A4A//A4cyNr r setup_oncez"LaunchDarklyIntegration.setup_once(s r!r)__name__ __module__ __qualname__ identifierr staticmethodr"r r!rrrs J,"  r!rc(eZdZedZdZdZy)rctdS)Nzsentry-flag-auditor)name)r)rs rmetadatazLaunchDarklyHook.metadata/s233r!czt|jtr t|j|j|Sr) isinstancevalueboolrkey)rseries_contextdatadetails rafter_evaluationz!LaunchDarklyHook.after_evaluation4s) fllD ) ^// > r!c|Srr )rr1r2s rbefore_evaluationz"LaunchDarklyHook.before_evaluation;s r!N)r#r$r%propertyr+r4r6r r!rrr.s 44r!r)typingrsentry_sdk.feature_flagsrsentry_sdk.integrationsrrr ldclient.hookrrr r ldclient.evaluationr r ImportErrorrrr r!rr>s] 5= 8,%98  k 4t=8 6 778s &AA!