public function meta_box($post)
{
$order = wc_get_order($post);
$debug_page_uri = esc_url(add_query_arg(array('page' => 'wc-status', 'tab' => 'connect'), admin_url('admin.php')));
$store_options = $this->settings_store->get_store_options();
$root_view = 'wc-connect-create-shipping-label';
$admin_array = array('purchaseURL' => get_rest_url(null, '/wc/v1/connect/label/purchase'), 'addressNormalizationURL' => get_rest_url(null, '/wc/v1/connect/normalize-address'), 'getRatesURL' => get_rest_url(null, '/wc/v1/connect/shipping-rates'), 'labelStatusURL' => get_rest_url(null, '/wc/v1/connect/label/' . $order->id . '-%d'), 'labelRefundURL' => get_rest_url(null, '/wc/v1/connect/label/' . $order->id . '-%d/refund'), 'labelsPreviewURL' => get_rest_url(null, '/wc/v1/connect/labels/preview'), 'labelsPrintURL' => get_rest_url(null, '/wc/v1/connect/labels/print'), 'paperSize' => $this->get_paper_size(), 'nonce' => wp_create_nonce('wp_rest'), 'rootView' => $root_view);
$labels_data = get_post_meta($order->id, 'wc_connect_labels', true);
if ($labels_data) {
$admin_array['labelsData'] = json_decode($labels_data, true, WOOCOMMERCE_CONNECT_MAX_JSON_DECODE_DEPTH);
} else {
$store_options['countriesData'] = $this->get_states_map();
$admin_array['formData'] = $this->get_form_data($order);
}
$admin_array['storeOptions'] = $store_options;
wp_localize_script('wc_connect_admin', 'wcConnectData', $admin_array);
wp_enqueue_script('wc_connect_admin');
wp_enqueue_style('wc_connect_admin');
?>
<div class="wc-connect-admin-container" id="<?php
echo esc_attr($root_view);
?>
">
<span class="form-troubles" style="opacity: 0">
<?php
printf(__('Shipping labels not loading? Visit the <a href="%s">status page</a> for troubleshooting steps.', 'connectforwoocommerce'), $debug_page_uri);
?>
</span>
</div>
<?php
}