from ..endorsements.endorsement_header import generate_endorsement_page_header_text
from ...config import NEW_PAGE_TAG


@staticmethod
def generate_faq34_endorsement_text() -> str:
    endorsement_header_text = generate_endorsement_page_header_text()
    text = (
        f"{endorsement_header_text}"
        "Quebec Endorsement Form\n"
        "Q.E.F. N 34\n"
        "Accident benefits insurance\n"
        "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
        "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
        "itself, at the insurer's option.\n"
        "Name of insurer: \n"
        "Named insured: \n"
        "Endorsement to automobile insurance policy N:\n"
        "Effective date: This endorsement will apply from  at 12:01 A.M. "
        "standard time at the address of the named insured.\n"
        "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
        "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
        "TABLE OF CONTENTS\n"
        "APPLICATION 2\n"
        "INSURED PERSONS 2\n"
        "APPLICABLE DIVISION, MAXIMUM AMOUNTS AND INSURANCE PREMIUM 2\n"
        "DESCRIPTION OF DIVISIONS 3\n"
        "EXCLUSIONS 5\n"
        "WHAT TO DO IN THE EVENT OF AN ACCIDENT 6\n"
        "AUTOPSY AND MEDICAL EXAMINATION 6\n"
        "TIME TO PAY BENEFITS 6\n"
        "RIGHTS OF INSURER IN RELATION TO PAYMENT OF BENEFITS OR EXPENSES 7\n"
        "DEFINITIONS 7\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "ENDORSEMENT DESCRIPTION\n"
        "Depending on the applicable division, this endorsement provides for the payment "
        "of benefits when an accident causes bodily injury to an insured person.\n"
        "To determine which division applies, refer to the ''Applicable section, maximum amounts "
        "and insurance premium'' division of this endorsement.\n"
        "APPLICATION\n"
        "1. The motor vehicle must have been the direct cause of bodily injury, independently of "
        "any other cause.\n"
        "2. Benefits are payable per accident and per insured person. If there are several "
        "insured vehicles under the insurance contract, benefits may not be combined\n"
        "3. Only persons who comply with the conditions of the insurance contract and this "
        "endorsement may benefit from the coverage under this endorsement.\n"
        "INSURED PERSONS\n"
        "Under Division 1, ''insured person'' refers to the named insured, his or her spouse and "
        "any dependent children of either.\n"
        "Under Division 2, only the named insured is an ''insured person.''\n"
        "APPLICABLE DIVISION, MAXIMUM AMOUNTS AND INSURANCE PREMIUM\n"
        "Coverage will apply only for the divisions and subdivisions where a maximum amount or an "
        "insurance premium is shown in the table below, or entered specifically for this endorsement "
        "in the ''Declarations'' division of the insurance contract:\n"
        "DIVISION | SUBDIVISION | MAXIMUM | INSURANCE PREMIUM\n"
        "1 | A – Death benefits, B – Dismemberment benefits, C – Reimbursement of medical "
        "expenses | Principal sum $, Principal sum $, Maximum $ |  $,  $,  $"
        "2 Total disability benefits | Maximum  $, per week |  $|\n"
        "  |  | Total:|  $\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "DESCRIPTION OF DIVISIONS\n"
        "Division 1\n"
        "Death and dismemberment benefits and reimbursement of medical expenses\n"
        "Subdivision A - Death benefits\n"
        "When an insured person dies within 12 months after the accident leading to his or her death, "
        "the following benefits will be paid under Subdivision A:\n"
        "\t If the named insured dies: 100% of the principal sum, plus 10% of the principal "
        "sum per dependent child upon the death of the named insured.\n"
        "\t If the spouse of the named insured dies:  % of the principal sum, plus 10% of "
        "the principal sum per dependent child upon the death of the spouse.\n"
        "\t If a dependent child dies:  % of the principal sum.\n"
        "Benefit payments will be made as follows:\n"
        "\t If the insured person dies leaving a spouse, the benefit will be payable to the spouse.\n"
        "\t If the insured person dies without leaving a spouse, the benefit will be payable "
        "to the dependents, in equal shares.\n"
        "\t If the insured person dies without leaving either a spouse or dependents, the benefit "
        "will be payable to the insured person's succession.\n"
        "\t If a dependent child dies, the benefit will be payable to the named insured.\n"
        "If, as a result of the same accident, an insured person should suffer dismemberment and then "
        "die, the benefits that have already been paid under Subdivision B will be deducted from the "
        "benefit payable under Subdivision A.\n"
        "Subdivision B – Dismemberment benefits\n"
        "When an insured person loses his or her sight or a limb within 12 months after "
        "the accident that caused the loss, the following benefits will be paid under Subdivision B:\n"
        "\t Loss of both hands: 100% of the principal sum;\n"
        "\t Loss of both feet: 100% of the principal sum;\n"
        "\t Loss of sight in both eyes: 100% of the principal sum;\n"
        "\t Loss of one hand and one foot: 100% of the principal sum;\n"
        "\t Loss of one hand and sight in one eye: 100% of the principal sum;\n"
        "\t Loss of one foot and sight of one eye: 100% of the principal sum;\n"
        "\t Loss of one arm: 75% of the principal sum;\n"
        "\t Loss of one leg: 75% of the principal sum;\n"
        "\t Loss of one hand: 50% of the principal sum;\n"
        "\t Loss of one foot: 50% of the principal sum;\n"
        "\t Loss of sight in one eye: 50% of the principal sum.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "Loss as used with reference to eye means total and irrecoverable loss of sight.\n"
        "Loss as used with reference to a limb means:\n"
        "\t For an arm: complete severance above the elbow.\n"
        "\t For a foot: complete severance through the knee, above the ankle or through the ankle.\n"
        "\t For a hand: complete severance through the elbow, above the wrist or through the wrist.\n"
        "\t For a leg: complete severance above the knee.\n"
        "Benefits provided under this subdivision for the same accident may not exceed 100% of "
        "the principal sum.\n"
        "Subdivision C –- Reimbursement of medical expenses\n"
        "Expenses reasonably incurred for the following services, care or treatments will be "
        "reimbursed under Division C:\n"
        "\t ambulance services;\n"
        "\t dental treatment;\n"
        "\t hospital care;\n"
        "\t medical care;\n"
        "\t professional nursing care;\n"
        "\t surgical treatment.\n"
        "The expenses must have been incurred within two years after the accident that caused them.\n"
        "The total amount of expenses reimbursed for the same accident may not exceed the maximum "
        "for this subsection.\n"
        "Exclusion\n"
        "Subdivision C excludes the portion of medical expenses covered by any other "
        "government or private insurance, unless the other insurance is similar to this coverage.\n"
        "Division 2\n"
        "Total disability benefits\n"
        "Division 2 provides for the payment of an income replacement benefit when the named insured becomes "
        "wholly and continuously disabled as a result of an accident. The income replacement indemnity "
        "will be calculated on a weekly basis and will be payable only in addition to the following amounts:\n"
        "\t amounts payable by the Société de l'assurance automobile du Québec under the Quebec "
        "Automobile Insurance Act; and\n"
        "\t amounts payable under the Act respecting industrial accidents and occupational "
        "disease and the Crime Victims Compensation Act.\n"
        "Conditions\n"
        "1. The named insured must be employed on the date of the accident. The named insured is "
        "deemed to be employed in either of the following situations:\n"
        "\t - he or she was actively engaged in an occupation or employment for wages or profit;\n"
        "\t - he or she was between 21 and 65 years of age and, in the 12 months preceding the accident, "
        "he or she was engaged in an occupation or employment for wages or profit for at least "
        "six months, whether continuously or not.\n"
        "2. The disability must appear within 20 days after the accident that caused it.\n"
        "3. The disability completely prevents the named insured from actively engaging in "
        "his or her occupation or employment."
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "Limitations\n"
        "For each accident:\n"
        "The named insured will not be entitled to benefits for the first seven days of disability.\n"
        "Once the seven days have elapsed, the named insured will be entitled to benefits "
        "for a maximum of   weeks.\n"
        "If the disability continues after the maximum number of weeks, benefits will "
        "continue to be payable for a further period of up to   weeks, if:\n"
        "\t continuation of the disability is duly certified; and\n"
        "\t the disability prevents the named insured from engaging in any occupation "
        "or employment for wages or profit on a permanent basis.\n"
        "The named insured may not receive benefits greater than the money value of "
        "any occupation or employment that he engaged in for wages or profit before the accident.\n"
        "If the named insured is covered under several insurance policies, benefits will be calculated as follows:\n"
        "Money value of all occupations and employment / Total benefits payable for the "
        "disability under all insurance policies X (times) Benefit payable under Division 2 of this endorsement\n"
        "EXCLUSIONS\n"
        "The following exclusions will apply:\n"
        "A. Bodily injury caused directly or indirectly by sickness or disease, unless the "
        "sickness or disease was contracted as a direct result of an accident covered by this endorsement.\n"
        "B. Bodily injury suffered by an insured person who committed or attempted to commit suicide, "
        "whether sane or insane, if this endorsement was not continuously in force for at least two years.\n"
        "C. Whether or not war is declared, bodily injury caused directly or indirectly by:\n"
        "\t bombardment;\n"
        "\t civil war;\n"
        "\t insurrection;\n"
        "\t invasion;\n"
        "\t military power;\n"
        "\t operation of armed forces during hostilities;\n"
        "\t rebellion;\n"
        "\t revolution; and\n"
        "\t usurped power.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "WHAT TO DO IN THE EVENT OF AN ACCIDENT\n"
        "Subdivision A - Death benefits\n"
        "In the event of an accident causing death, a claim must be submitted in writing to the insurer, "
        "accompanied by proof establishing, for example:\n"
        "\t death of the insured person;\n"
        "\t cause of death;\n"
        "\t rights of beneficiaries.\n"
        "Subdivisions B and C, and Division 2 - Dismemberment benefits, reimbursement of medical "
        "expenses and total disability benefits\n"
        "In the event of an accident covered under Subdivision B or C, or Section 2, the insured "
        "person or any other beneficiary must fulfil the obligations outlined below. They may do "
        "so either personally or through an intermediary.\n"
        "Obligations to fulfil:\n"
        "\t Within 30 days of learning of the accident, the person must inform the insurer in writing.\n"
        "\t Within 90 days of learning of the accident, the person must support the claim by providing the "
        "insurer with all the information that the insurer may reasonably expect as to the circumstances "
        "and extent of the accident.\n"
        "\t In the event of failure to satisfy the 30 or 90-day requirement, the person must demonstrate that "
        "he or she was unable to act within those time periods. Benefit payment may be made "
        "nonetheless if the person fulfils his or her obligations within one year after the accident.\n"
        "\t At the insurer's request, the person must provide a medical certificate confirming the following "
        "information:\n"
        "- the cause and nature of the bodily injury for which the claim is being made;\n"
        "- the length of total disability arising from such bodily injury.\n"
        "AUTOPSY AND MEDICAL EXAMINATION\n"
        "Subdivision A - Death benefits\n"
        "If an insured person dies, the insurer may have an autopsy performed, subject to the "
        "requirements set out in the Civil Code of Quebec.\n"
        "Subdivisions B and C, and Division 2 - Dismemberment benefits, reimbursement of medical "
        "expenses and total disability benefits\n"
        "The insurer is entitled to require that the insured person undergo a medical examination within "
        "a reasonable time period, if warranted by the nature of the disability or the loss.\n"
        "The insurer may have the insured person undergo a medical examination as often as may be "
        "reasonably required while the claim is pending.\n"
        "The insured person will be required to submit to such examination.\n"
        "TIME TO PAY BENEFITS\n"
        "Subdivision A - Death benefits\n"
        "The insurer must pay the benefits within 30 days after receipt of the required information and documents.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "Subdivisions B and C - Dismemberment benefits and reimbursement of medical expenses\n"
        "The insurer must pay benefits or reimburse medical expenses within 60 days after receipt of "
        "the required information and documents.\n"
        "Division 2 - Total disability benefits\n"
        "The insurer must pay the initial benefit within 30 days after receipt of the required information "
        "and documents. During the continuation of disability, subsequent payments will be made at 30-day "
        "intervals, subject to submission of the proof set out in the ''What to do in the event of an "
        "accident'' section of this endorsement.\n"
        "RIGHTS OF INSURER IN RELATION TO PAYMENT OF BENEFITS OR EXPENSES\n"
        "The insurer may decide to pay all or part of the benefits or expenses directly to either the "
        "beneficiary or the natural or legal persons providing the medical services, care or treatments. "
        "If any amount remains payable, the total amount of benefits or expenses already paid will then "
        "be deducted from the maximum under the appropriate subsection.\n"
        "Before paying benefits:\n"
        "\t the insurer may require a release from the person to whom it paid a benefit "
        "or reimbursed expenses.\n"
        "\t the insurer may require that it be subrogated to the beneficiary's recourses "
        "against the person responsible for the bodily injury, up to the amount of the benefit it has "
        "paid. This means that the beneficiary's recourses are transferred to the insurer.\n"
        "In addition, the payment of a benefit or the reimbursement of medical expenses will not "
        "constitute an admission of liability as regards the accident. Such payment may therefore not be "
        "set up against the insured person or the insurer in respect of civil liability.\n"
        "DEFINITIONS\n"
        "For the purposes of this endorsement, the following definitions will be in addition to or "
        "will replace the definitions contained in the insurance contract.\n"
        "Bodily injury: Any injury of a physical nature, including death.\n"
        "Dependent child:\n"
        "\t Any child under 18 years of age for whom the named insured or the named "
        "insured's spouse has legal and actual custody;\n"
        "\t Any child 18 years of age or older whose domicile is the same as that of "
        "the named insured and who is entirely dependent on the named insured and/or the named "
        "insured's spouse due to a mental or physical disability.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "Dependents: This expression refers to the following persons:\n"
        "\t any dependent child; and\n"
        "\t the father or mother of the deceased insured person, if the following conditions are met:\n"
        "- the father or mother had the same domicile as the insured person on the date of the accident; and\n"
        "- the father or mother was principally dependent on the insured person for financial support up "
        "to the date of the accident.\n"
        "Named insured:\n"
        "\t The expression ''named insured'' will refer to any person named in Item 1, ''Declarations'' "
        "of the insurance contract;\n"
        "\t If the person named in Item 1 is a legal person, partnership or association, the "
        "expression will refer to each of its employees, shareholders, members or partners who "
        "usually use a described vehicle for which an insurance premium or a maximum amount "
        "is entered specifically for this endorsement (see Item 4, ''Declarations'' of the insurance contract).\n"
        "All other conditions of the insurance contract remain the same.\n"
        f"{NEW_PAGE_TAG}\n"
    )

    return text
